skip_ () { warn_ "$me: skipped test: $@"; Exit 77; }
framework_failure_ () { warn_ "$me: set-up failure: $@"; Exit 99; }
+ # cross_compiling
+ # ---------------
+ # Tell whether we are cross-compiling. This is especially useful to skip
+ # tests (or portions of them) that requires a native compiler.
+ cross_compiling ()
+ {
+ test x"$host_alias" != x
+ }
+
+# is_newest FILE FILES
+# --------------------
+# Return false if any file in FILES is newer than FILE.
+# Resolve ties in favor of FILE.
+is_newest ()
+{
+ is_newest_files=`find "$@" -newer "$1"`
+ test -z "$is_newest_files"
+}
+
+# AUTOMAKE_run status [options...]
+# --------------------------------
+# Run Automake with OPTIONS, and fail if automake
+# does not exit with STATUS.
+AUTOMAKE_run ()
+{
+ expected_exitcode=$1
+ shift
+ exitcode=0
+ $AUTOMAKE ${1+"$@"} >stdout 2>stderr || exitcode=$?
+ cat stderr >&2
+ cat stdout
+ test $exitcode = $expected_exitcode || Exit 1
+}
+
+# AUTOMAKE_fails [options...]
+# ---------------------------
+# Run Automake with OPTIONS, and fail if automake
+# does not exit with STATUS.
+AUTOMAKE_fails ()
+{
+ AUTOMAKE_run 1 ${1+"$@"}
+}
+
+# using_gmake
+# -----------
+# Return success if $MAKE is GNU make, return failure otherwise.
+# Caches the result for speed reasons.
+using_gmake ()
+{
+ case $am__using_gmake in
+ yes)
+ return 0;;
+ no)
+ return 1;;
+ '')
+ # Use --version AND -v, because SGI Make doesn't fail on --version.
+ # Also grep for GNU because newer versions of FreeBSD make do
+ # not complain about `--version' (they seem to silently ignore it).
+ if $MAKE --version -v | grep GNU; then
+ am__using_gmake=yes
+ return 0
+ else
+ am__using_gmake=no
+ return 1
+ fi;;
+ *)
+ echo "invalid value for \$am__using_gmake: '$am__using_gmake'" >&2
+ Exit 99;;
+ esac
+}
+
+commented_sed_unindent_prog='
+ /^$/b # Nothing to do for empty lines.
+ x # Get x<indent> into pattern space.
+ /^$/{ # No prior x<indent>, go prepare it.
+ g # Copy this 1st non-blank line into pattern space.
+ s/^\(['"$tab"' ]*\).*/x\1/ # Prepare x<indent> in pattern space.
+ } # Now: x<indent> in pattern and <line> in hold.
+ G # Build x<indent>\n<line> in pattern space, and
+ h # duplicate it into hold space.
+ s/\n.*$// # Restore x<indent> in pattern space, and
+ x # exchange with the above duplicate in hold space.
+ s/^x\(.*\)\n\1// # Remove leading <indent> from <line>.
+ s/^x.*\n// # Restore <line> when there is no leading <indent>.
+'
+
+# unindent [input files...]
+# -------------------------
+# Remove the "proper" amount of leading whitespace from the given files,
+# and output the result on stdout. That amount is determined by looking
+# at the leading whitespace of the first non-blank line in the input
+# files. If no input file is specified, standard input is implied.
+unindent ()
+{
+ if test x"$sed_unindent_prog" = x; then
+ sed_unindent_prog=`printf '%s\n' "$commented_sed_unindent_prog" | sed -e "s/ *# .*//"`
+ fi
+ sed "$sed_unindent_prog" ${1+"$@"}
+}
+sed_unindent_prog="" # Avoid interferences from the environment.
+
+
+## ----------------------------------------------------------- ##
+## Checks for required tools, and additional setups (if any) ##
+## required by them. ##
+## ----------------------------------------------------------- ##
+
+# Print it here, so that the user will see it also if the test
+# will be skipped due to some tool missing in $PATH itself.
+echo "$PATH"
+
+ # So that we can force the use of correct gcc, g++ etc., consistently
+ # with cross-compilation settings.
+ if cross_compiling; then
+ am__tool_prefix="$host_alias-"
+ else
+ am__tool_prefix=
+ fi
+
+# Look for (and maybe set up) required tools and/or system features; skip
+# the current test if they are not found.
for tool in : $required
do
# Check that each required tool is present.
# always use it. This is important only when the user
# has defined CC in his environment, otherwise ./configure will
# prefer gcc to other compilers.
- CC=gcc
+ CC=${am__tool_prefix}gcc
export CC
echo "$me: running $CC --version"
- ( $CC --version ) || exit 77
+ $CC --version || exit 77
+ echo "$me: running $CC -v"
+ $CC -v || exit 77
;;
gcj)
- GCJ=gcj
+ GCJ=${am__tool_prefix}gcj
export GCJ
echo "$me: running $GCJ --version"
- ( $GCJ --version ) || exit 77
- ( $GCJ -v ) || exit 77
+ $GCJ --version || exit 77
+ echo "$me: running $GCJ -v"
+ $GCJ -v || exit 77
;;
g++)
- CXX=g++
+ CXX=${am__tool_prefix}g++
export CXX
echo "$me: running $CXX --version"
- ( $CXX --version ) || exit 77
+ $CXX --version || exit 77
+ echo "$me: running $CXX -v"
+ $CXX -v || exit 77
;;
+ gfortran)
+ FC=${am__tool_prefix}gfortran
+ export FC
+ echo "$me: running $FC --version"
+ $FC --version || skip_ "GNU Fortran compiler not available"
+ echo "$me: running $FC -v"
+ $FC -v || skip_ "botched installation for GNU Fortran compiler"
+ case " $required " in
+ *\ g77\ *) ;;
+ *) F77=$FC; export F77;;
+ esac
+ ;;
+ g77)
+ F77=${am__tool_prefix}g77
+ export F77
+ echo "$me: running $F77 --version"
+ $F77 --version || skip_ "GNU Fortran 77 compiler not available"
+ echo "$me: running $F77 -v"
+ $F77 -v || skip_ "botched installation for GNU Fortran 77 compiler"
+ case " $required " in
+ *\ gfortran\ *) ;;
+ *) FC=$F77; export FC;;
+ esac
+ ;;
icc)
CC=icc
export CC
(echo foo >> $priv_check_temp) >/dev/null 2>&1
overwrite_status=$?
rm -f $priv_check_temp
- test $overwrite_status = 0 && exit 77
+ if test $overwrite_status -eq 0; then
+ echo "$me: cannot drop file write permissions" >&2
+ exit 77
+ fi
+ unset priv_check_temp overwrite_status
+ ;;
+ perl-threads)
+ if test "$WANT_NO_THREADS" = "yes"; then
+ echo "$me: skip with Devel::Cover: cannot cope with threads" >&2
+ exit 77
+ fi
;;
+ non-cross)
+ cross_compiling && skip_ "doesn't work in cross-compile mode"
+ ;;
python)
# Python doesn't support --version, it has -V
echo "$me: running python -V"