From f5f083532c5769f3e65273c45d86b80b7b0e0f2f Mon Sep 17 00:00:00 2001 From: Richard Brooksby Date: Mon, 6 Feb 2023 17:33:27 +0000 Subject: [PATCH 01/43] Adding a Cirrus CI configuration to get things started. --- .cirrus.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .cirrus.yml diff --git a/.cirrus.yml b/.cirrus.yml new file mode 100644 index 0000000000..727882f39b --- /dev/null +++ b/.cirrus.yml @@ -0,0 +1,13 @@ +# .cirrus.yml -- Cirrus CI configuration for the MPS + +# FIXME: Just a test based on https://cirrus-ci.org/guide/macOS/ + +macos_instance: + image: ghcr.io/cirruslabs/macos-ventura-xcode:latest + +task: + script: + - uname -a + - arch + - ./configure + - make From f60017c49aaf544e31092414f8dd6878ff3d09b0 Mon Sep 17 00:00:00 2001 From: Richard Brooksby Date: Mon, 6 Feb 2023 18:16:28 +0000 Subject: [PATCH 02/43] Testing Cirrus CI configurations for FRI6LL and LIA6*. --- .cirrus.yml | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 727882f39b..370e3008f2 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -2,12 +2,23 @@ # FIXME: Just a test based on https://cirrus-ci.org/guide/macOS/ -macos_instance: - image: ghcr.io/cirruslabs/macos-ventura-xcode:latest - -task: - script: - - uname -a - - arch - - ./configure - - make +XCA6LL_task: + macos_instance: + # What does this syntax mean? + image: ghcr.io/cirruslabs/macos-ventura-xcode:latest + script: ./configure --prefix=$PWD/prefix && make install && make test + +# https://cirrus-ci.org/guide/writing-tasks/ doesn't seem to allow for FreeBSD on arm64 +FRI6LL_task: + freebsd_instance: + # Why is this a "family"? + image_family: freebsd-13-1 + # Which compiler will this end up with by default? + script: ./configure --prefix=$PWD/prefix && make install && make test + +LIA6_task: + arm_container: + matrix: + - image: clang:latest + - image: gcc:latest + script: ./configure --prefix=$PWD/prefix && make install && make test From 279ce81d03a1a231e7ed6b19319e9c8866e22cf9 Mon Sep 17 00:00:00 2001 From: Richard Brooksby Date: Mon, 6 Feb 2023 22:34:59 +0000 Subject: [PATCH 03/43] Persuade Cirrus CI to reveal details about the platforms. --- .cirrus.yml | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 370e3008f2..591d7c9e5e 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -6,7 +6,11 @@ XCA6LL_task: macos_instance: # What does this syntax mean? image: ghcr.io/cirruslabs/macos-ventura-xcode:latest - script: ./configure --prefix=$PWD/prefix && make install && make test + script: + - uname -a + - cc --version + - cc -dumpmachine + - ./configure --prefix=$PWD/prefix && make install && make test # https://cirrus-ci.org/guide/writing-tasks/ doesn't seem to allow for FreeBSD on arm64 FRI6LL_task: @@ -14,11 +18,20 @@ FRI6LL_task: # Why is this a "family"? image_family: freebsd-13-1 # Which compiler will this end up with by default? - script: ./configure --prefix=$PWD/prefix && make install && make test + script: + - uname -a + - cc --version + - cc -dumpmachine + - pkg install -y gmake + - ./configure --prefix=$PWD/prefix && make install && make test LIA6_task: arm_container: matrix: - image: clang:latest - image: gcc:latest - script: ./configure --prefix=$PWD/prefix && make install && make test + script: + - uname -a + - cc --version + - cc -dumpmachine + - ./configure --prefix=$PWD/prefix && make install && make test From 1fb620c23120d20e7dfe449bcf50fe52a03713b1 Mon Sep 17 00:00:00 2001 From: Richard Brooksby Date: Tue, 7 Feb 2023 08:13:43 +0000 Subject: [PATCH 04/43] Match arm64 for XCA6LL since that's what's produced by Cirrus CI VMs . --- configure | 2839 ++++++++++++++------------ configure.ac | 3 +- tool/autoconf/build-aux/config.guess | 918 ++++----- tool/autoconf/build-aux/config.sub | 409 ++-- tool/autoconf/build-aux/install-sh | 422 ++-- 5 files changed, 2388 insertions(+), 2203 deletions(-) mode change 100644 => 100755 tool/autoconf/build-aux/config.guess mode change 100644 => 100755 tool/autoconf/build-aux/config.sub mode change 100644 => 100755 tool/autoconf/build-aux/install-sh diff --git a/configure b/configure index 9f06a0dc11..55214c2df8 100755 --- a/configure +++ b/configure @@ -1,11 +1,12 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for Memory Pool System Kit release/1.118.0. +# Generated by GNU Autoconf 2.71 for Memory Pool System Kit release/1.118.0. # # Report bugs to . # # -# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, +# Inc. # # # This configure script is free software; the Free Software Foundation @@ -16,14 +17,16 @@ # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : +as_nop=: +if test ${ZSH_VERSION+y} && (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 +else $as_nop case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( @@ -33,46 +36,46 @@ esac fi + +# Reset variables that may have inherited troublesome values from +# the environment. + +# IFS needs to be set, to space, tab, and newline, in precisely that order. +# (If _AS_PATH_WALK were called with IFS unset, it would have the +# side effect of setting IFS to empty, thus disabling word splitting.) +# Quoting is to prevent editors from complaining about space-tab. 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 +IFS=" "" $as_nl" + +PS1='$ ' +PS2='> ' +PS4='+ ' + +# Ensure predictable behavior from utilities with locale-dependent output. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# We cannot yet rely on "unset" to work, but we need these variables +# to be unset--not just set to an empty or harmless value--now, to +# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct +# also avoids known problems related to "unset" and subshell syntax +# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). +for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH +do eval test \${$as_var+y} \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done + +# Ensure that fds 0, 1, and 2 are open. +if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi +if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then +if ${PATH_SEPARATOR+false} :; 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 || @@ -81,13 +84,6 @@ if test "${PATH_SEPARATOR+set}" != set; then 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 #(( @@ -96,8 +92,12 @@ case $0 in #(( 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS @@ -109,30 +109,10 @@ 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 + printf "%s\n" "$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. @@ -154,20 +134,22 @@ 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 +printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 +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 : + as_bourne_compatible="as_nop=: +if test \${ZSH_VERSION+y} && (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 +else \$as_nop case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( @@ -187,42 +169,52 @@ 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 : +if ( set x; as_fn_ret_success y && test x = \"\$1\" ) +then : -else +else \$as_nop exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 +blah=\$(echo \$(echo blah)) +test x\"\$blah\" = xblah || 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 \$(( 1 + 1 )) = 2 || exit 1" - if (eval "$as_required") 2>/dev/null; then : + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1" + if (eval "$as_required") 2>/dev/null +then : as_have_required=yes -else +else $as_nop as_have_required=no fi - if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null +then : -else +else $as_nop 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=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac 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 + 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 : + as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 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 : + if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null +then : break 2 fi fi @@ -230,14 +222,21 @@ fi 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 $as_found +then : + +else $as_nop + if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null +then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi +fi - if test "x$CONFIG_SHELL" != x; then : + 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 @@ -255,18 +254,19 @@ 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 +printf "%s\n" "$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." + if test x$as_have_required = xno +then : + printf "%s\n" "$0: This script requires a shell more modern than all" + printf "%s\n" "$0: the shells that I found on your system." + if test ${ZSH_VERSION+y} ; then + printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should" + printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." else - $as_echo "$0: Please tell bug-autoconf@gnu.org and + printf "%s\n" "$0: Please tell bug-autoconf@gnu.org and $0: mps-questions@ravenbrook.com about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run @@ -294,6 +294,7 @@ as_fn_unset () } as_unset=as_fn_unset + # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. @@ -311,6 +312,14 @@ as_fn_exit () as_fn_set_status $1 exit $1 } # as_fn_exit +# as_fn_nop +# --------- +# Do nothing but, unlike ":", preserve the value of $?. +as_fn_nop () +{ + return $? +} +as_nop=as_fn_nop # as_fn_mkdir_p # ------------- @@ -325,7 +334,7 @@ as_fn_mkdir_p () as_dirs= while :; do case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" @@ -334,7 +343,7 @@ $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" | +printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -373,12 +382,13 @@ as_fn_executable_p () # 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 : +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 +else $as_nop as_fn_append () { eval $1=\$$1\$2 @@ -390,18 +400,27 @@ fi # as_fn_append # 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 : +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null +then : eval 'as_fn_arith () { as_val=$(( $* )) }' -else +else $as_nop as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith +# as_fn_nop +# --------- +# Do nothing but, unlike ":", preserve the value of $?. +as_fn_nop () +{ + return $? +} +as_nop=as_fn_nop # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- @@ -413,9 +432,9 @@ 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 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - $as_echo "$as_me: error: $2" >&2 + printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error @@ -442,7 +461,7 @@ as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | +printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -486,7 +505,7 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits 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; } + { printf "%s\n" "$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 @@ -500,6 +519,10 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits exit } + +# Determine whether it's possible to make 'echo' print without a newline. +# These variables are no longer used directly by Autoconf, but are AC_SUBSTed +# for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) @@ -513,6 +536,13 @@ case `echo -n x` in #((((( ECHO_N='-n';; esac +# For backward compatibility with old third-party macros, we provide +# the shell variables $as_echo and $as_echo_n. New code should use +# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. +as_echo='printf %s\n' +as_echo_n='printf %s' + + rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file @@ -588,40 +618,36 @@ PACKAGE_URL='https://www.ravenbrook.com/project/mps/' ac_unique_file="code/mps.c" # Factoring default headers for most tests. ac_includes_default="\ -#include -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_STAT_H -# include +#include +#ifdef HAVE_STDIO_H +# include #endif -#ifdef STDC_HEADERS +#ifdef HAVE_STDLIB_H # 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_STRINGS_H +# include +#endif +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif #ifdef HAVE_UNISTD_H # include #endif" +ac_header_c_list= ac_subst_vars='LTLIBOBJS LIBOBJS EXTRA_TARGETS @@ -641,9 +667,6 @@ build_os build_vendor build_cpu build -EGREP -GREP -CPP INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM @@ -673,6 +696,7 @@ infodir docdir oldincludedir includedir +runstatedir localstatedir sharedstatedir sysconfdir @@ -703,8 +727,7 @@ CC CFLAGS LDFLAGS LIBS -CPPFLAGS -CPP' +CPPFLAGS' # Initialize some variables set by options. @@ -743,6 +766,7 @@ datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' +runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' @@ -772,8 +796,6 @@ do *) ac_optarg=yes ;; esac - # Accept the important Cygnus configure options, so we can diagnose typos. - case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; @@ -814,9 +836,9 @@ do 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" + as_fn_error $? "invalid feature name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" @@ -840,9 +862,9 @@ do 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" + as_fn_error $? "invalid feature name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" @@ -995,6 +1017,15 @@ do | -silent | --silent | --silen | --sile | --sil) silent=yes ;; + -runstatedir | --runstatedir | --runstatedi | --runstated \ + | --runstate | --runstat | --runsta | --runst | --runs \ + | --run | --ru | --r) + ac_prev=runstatedir ;; + -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ + | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ + | --run=* | --ru=* | --r=*) + runstatedir=$ac_optarg ;; + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ @@ -1044,9 +1075,9 @@ do 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" + as_fn_error $? "invalid package name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" @@ -1060,9 +1091,9 @@ do 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" + as_fn_error $? "invalid package name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" @@ -1106,9 +1137,9 @@ Try \`$0 --help' for more information" *) # FIXME: should be removed in autoconf 3.0. - $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + printf "%s\n" "$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 + printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; @@ -1124,7 +1155,7 @@ 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 ;; + *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi @@ -1132,7 +1163,7 @@ fi 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 + libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. @@ -1188,7 +1219,7 @@ $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" | +printf "%s\n" X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -1285,6 +1316,7 @@ Fine tuning of the installation directories: --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] + --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] @@ -1322,7 +1354,6 @@ Some influential environment variables: 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. @@ -1344,9 +1375,9 @@ if test "$ac_init_help" = "recursive"; then case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + ac_dir_suffix=/`printf "%s\n" "$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|/||'` + ac_top_builddir_sub=`printf "%s\n" "$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/ ;; @@ -1374,7 +1405,8 @@ esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } - # Check for guested configure. + # Check for configure.gnu first; this name is used for a wrapper for + # Metaconfig's "Configure" on case-insensitive file systems. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive @@ -1382,7 +1414,7 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix echo && $SHELL "$ac_srcdir/configure" --help=recursive else - $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done @@ -1392,9 +1424,9 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF Memory Pool System Kit configure release/1.118.0 -generated by GNU Autoconf 2.69 +generated by GNU Autoconf 2.71 -Copyright (C) 2012 Free Software Foundation, Inc. +Copyright (C) 2021 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1411,14 +1443,14 @@ fi ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext + rm -f conftest.$ac_objext conftest.beam 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 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -1426,14 +1458,15 @@ $as_echo "$ac_try_echo"; } >&5 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$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 : + } && test -s conftest.$ac_objext +then : ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 @@ -1443,25 +1476,28 @@ fi } # ac_fn_c_try_compile -# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES -# --------------------------------------------- +# ac_fn_check_decl LINENO SYMBOL VAR INCLUDES EXTRA-OPTIONS FLAG-VAR +# ------------------------------------------------------------------ # Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR -# accordingly. -ac_fn_c_check_decl () +# accordingly. Pass EXTRA-OPTIONS to the compiler, using FLAG-VAR. +ac_fn_check_decl () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack as_decl_name=`echo $2|sed 's/ *(.*//'` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 +printf %s "checking whether $as_decl_name is declared... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 -$as_echo_n "checking whether $as_decl_name is declared... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else + eval ac_save_FLAGS=\$$6 + as_fn_append $6 " $5" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int -main () +main (void) { #ifndef $as_decl_name #ifdef __cplusplus @@ -1475,98 +1511,22 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : eval "$3=yes" -else +else $as_nop 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_decl - -# 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 +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + eval $6=\$ac_save_FLAGS - ac_retval=$ac_status fi - rm -rf conftest.dSYM conftest_ipa8_conftest.oo +eval ac_res=\$$3 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval -} # ac_fn_c_try_run +} # ac_fn_check_decl # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- @@ -1575,128 +1535,59 @@ fi 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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : eval "$3=yes" -else +else $as_nop eval "$3=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile +ac_configure_args_raw= +for ac_arg +do + case $ac_arg in + *\'*) + ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append ac_configure_args_raw " '$ac_arg'" +done -# 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 "## ------------------------------------------- ## -## Report this to mps-questions@ravenbrook.com ## -## ------------------------------------------- ##" - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; +case $ac_configure_args_raw in + *$as_nl*) + ac_safe_unquote= ;; + *) + ac_unsafe_z='|&;<>()$`\\"*?[ '' ' # This string ends in space, tab. + ac_unsafe_a="$ac_unsafe_z#~" + ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g" + ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;; 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 Memory Pool System Kit $as_me release/1.118.0, which was -generated by GNU Autoconf 2.69. Invocation command line was +generated by GNU Autoconf 2.71. Invocation command line was - $ $0 $@ + $ $0$ac_configure_args_raw _ACEOF exec 5>>config.log @@ -1729,8 +1620,12 @@ 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" + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + printf "%s\n" "PATH: $as_dir" done IFS=$as_save_IFS @@ -1765,7 +1660,7 @@ do | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) - ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; @@ -1800,11 +1695,13 @@ done # 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=$? + # Sanitize IFS. + IFS=" "" $as_nl" # Save into config.log some information that might help in debugging. { echo - $as_echo "## ---------------- ## + printf "%s\n" "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo @@ -1815,8 +1712,8 @@ trap 'exit_status=$? 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;} ;; + *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( @@ -1840,7 +1737,7 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; ) echo - $as_echo "## ----------------- ## + printf "%s\n" "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo @@ -1848,14 +1745,14 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - $as_echo "$ac_var='\''$ac_val'\''" + printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then - $as_echo "## ------------------- ## + printf "%s\n" "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo @@ -1863,15 +1760,15 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - $as_echo "$ac_var='\''$ac_val'\''" + printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then - $as_echo "## ----------- ## + printf "%s\n" "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo @@ -1879,8 +1776,8 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; echo fi test "$ac_signal" != 0 && - $as_echo "$as_me: caught signal $ac_signal" - $as_echo "$as_me: exit $exit_status" + printf "%s\n" "$as_me: caught signal $ac_signal" + printf "%s\n" "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && @@ -1894,63 +1791,48 @@ 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 +printf "%s\n" "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. -cat >>confdefs.h <<_ACEOF -#define PACKAGE_NAME "$PACKAGE_NAME" -_ACEOF +printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_TARNAME "$PACKAGE_TARNAME" -_ACEOF +printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_VERSION "$PACKAGE_VERSION" -_ACEOF +printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_STRING "$PACKAGE_STRING" -_ACEOF +printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -_ACEOF +printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_URL "$PACKAGE_URL" -_ACEOF +printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h # 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 + ac_site_files="$CONFIG_SITE" elif test "x$prefix" != xNONE; then - ac_site_file1=$prefix/share/config.site - ac_site_file2=$prefix/etc/config.site + ac_site_files="$prefix/share/config.site $prefix/etc/config.site" else - ac_site_file1=$ac_default_prefix/share/config.site - ac_site_file2=$ac_default_prefix/etc/config.site + ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi -for ac_site_file in "$ac_site_file1" "$ac_site_file2" + +for ac_site_file in $ac_site_files 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;} + case $ac_site_file in #( + */*) : + ;; #( + *) : + ac_site_file=./$ac_site_file ;; +esac + if test -f "$ac_site_file" && test -r "$ac_site_file"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +printf "%s\n" "$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;} + || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$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 @@ -1960,119 +1842,516 @@ 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;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +printf "%s\n" "$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;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +printf "%s\n" "$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 +# Test code for whether the C compiler supports C89 (global declarations) +ac_c_conftest_c89_globals=' +/* Does the compiler advertise C89 conformance? + Do not test the value of __STDC__, because some compilers set it to 0 + while being otherwise adequately conformant. */ +#if !defined __STDC__ +# error "Compiler does not advertise C89 conformance" +#endif +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ +struct buf { int x; }; +struct buf * (*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; +} -ac_aux_dir= -for ac_dir in tool/autoconf/build-aux "$srcdir"/tool/autoconf/build-aux; 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 tool/autoconf/build-aux \"$srcdir\"/tool/autoconf/build-aux" "$LINENO" 5 -fi +/* 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 do not provoke an error unfortunately, instead are silently treated + as an "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 is necessary to write \x00 == 0 to get something + that is 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 **, int *(*)(struct buf *, struct stat *, int), + int, int);' + +# Test code for whether the C compiler supports C89 (body of main). +ac_c_conftest_c89_main=' +ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); +' + +# Test code for whether the C compiler supports C99 (global declarations) +ac_c_conftest_c99_globals=' +// Does the compiler advertise C99 conformance? +#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L +# error "Compiler does not advertise C99 conformance" +#endif + +#include +extern int puts (const char *); +extern int printf (const char *, ...); +extern int dprintf (int, const char *, ...); +extern void *malloc (size_t); + +// Check varargs macros. These examples are taken from C99 6.10.3.5. +// dprintf is used instead of fprintf to avoid needing to declare +// FILE and stderr. +#define debug(...) dprintf (2, __VA_ARGS__) +#define showlist(...) puts (#__VA_ARGS__) +#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) +static void +test_varargs_macros (void) +{ + int x = 1234; + int y = 5678; + debug ("Flag"); + debug ("X = %d\n", x); + showlist (The first, second, and third items.); + report (x>y, "x is %d but y is %d", x, y); +} + +// Check long long types. +#define BIG64 18446744073709551615ull +#define BIG32 4294967295ul +#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) +#if !BIG_OK + #error "your preprocessor is broken" +#endif +#if BIG_OK +#else + #error "your preprocessor is broken" +#endif +static long long int bignum = -9223372036854775807LL; +static unsigned long long int ubignum = BIG64; + +struct incomplete_array +{ + int datasize; + double data[]; +}; + +struct named_init { + int number; + const wchar_t *name; + double average; +}; + +typedef const char *ccp; + +static inline int +test_restrict (ccp restrict text) +{ + // See if C++-style comments work. + // Iterate through items via the restricted pointer. + // Also check for declarations in for loops. + for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) + continue; + return 0; +} + +// Check varargs and va_copy. +static bool +test_varargs (const char *format, ...) +{ + va_list args; + va_start (args, format); + va_list args_copy; + va_copy (args_copy, args); + + const char *str = ""; + int number = 0; + float fnumber = 0; + + while (*format) + { + switch (*format++) + { + case '\''s'\'': // string + str = va_arg (args_copy, const char *); + break; + case '\''d'\'': // int + number = va_arg (args_copy, int); + break; + case '\''f'\'': // float + fnumber = va_arg (args_copy, double); + break; + default: + break; + } + } + va_end (args_copy); + va_end (args); + + return *str && number && fnumber; +} +' + +# Test code for whether the C compiler supports C99 (body of main). +ac_c_conftest_c99_main=' + // Check bool. + _Bool success = false; + success |= (argc != 0); + + // Check restrict. + if (test_restrict ("String literal") == 0) + success = true; + char *restrict newvar = "Another string"; + + // Check varargs. + success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234); + test_varargs_macros (); + + // Check flexible array members. + struct incomplete_array *ia = + malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); + ia->datasize = 10; + for (int i = 0; i < ia->datasize; ++i) + ia->data[i] = i * 1.234; + + // Check named initializers. + struct named_init ni = { + .number = 34, + .name = L"Test wide string", + .average = 543.34343, + }; + + ni.number = 58; + + int dynamic_array[ni.number]; + dynamic_array[0] = argv[0][0]; + dynamic_array[ni.number - 1] = 543; + + // work around unused variable warnings + ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\'' + || dynamic_array[ni.number - 1] != 543); +' + +# Test code for whether the C compiler supports C11 (global declarations) +ac_c_conftest_c11_globals=' +// Does the compiler advertise C11 conformance? +#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L +# error "Compiler does not advertise C11 conformance" +#endif + +// Check _Alignas. +char _Alignas (double) aligned_as_double; +char _Alignas (0) no_special_alignment; +extern char aligned_as_int; +char _Alignas (0) _Alignas (int) aligned_as_int; + +// Check _Alignof. +enum +{ + int_alignment = _Alignof (int), + int_array_alignment = _Alignof (int[100]), + char_alignment = _Alignof (char) +}; +_Static_assert (0 < -_Alignof (int), "_Alignof is signed"); + +// Check _Noreturn. +int _Noreturn does_not_return (void) { for (;;) continue; } + +// Check _Static_assert. +struct test_static_assert +{ + int x; + _Static_assert (sizeof (int) <= sizeof (long int), + "_Static_assert does not work in struct"); + long int y; +}; + +// Check UTF-8 literals. +#define u8 syntax error! +char const utf8_literal[] = u8"happens to be ASCII" "another string"; + +// Check duplicate typedefs. +typedef long *long_ptr; +typedef long int *long_ptr; +typedef long_ptr long_ptr; + +// Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. +struct anonymous +{ + union { + struct { int i; int j; }; + struct { int k; long int l; } w; + }; + int m; +} v1; +' + +# Test code for whether the C compiler supports C11 (body of main). +ac_c_conftest_c11_main=' + _Static_assert ((offsetof (struct anonymous, i) + == offsetof (struct anonymous, w.k)), + "Anonymous union alignment botch"); + v1.i = 2; + v1.w.k = 5; + ok |= v1.i != 5; +' + +# Test code for whether the C compiler supports C11 (complete). +ac_c_conftest_c11_program="${ac_c_conftest_c89_globals} +${ac_c_conftest_c99_globals} +${ac_c_conftest_c11_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + ${ac_c_conftest_c99_main} + ${ac_c_conftest_c11_main} + return ok; +} +" + +# Test code for whether the C compiler supports C99 (complete). +ac_c_conftest_c99_program="${ac_c_conftest_c89_globals} +${ac_c_conftest_c99_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + ${ac_c_conftest_c99_main} + return ok; +} +" + +# Test code for whether the C compiler supports C89 (complete). +ac_c_conftest_c89_program="${ac_c_conftest_c89_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + return ok; +} +" + +as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H" +as_fn_append ac_header_c_list " stdlib.h stdlib_h HAVE_STDLIB_H" +as_fn_append ac_header_c_list " string.h string_h HAVE_STRING_H" +as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H" +as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H" +as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H" +as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" +as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" +as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H" + +# Auxiliary files required by this configure script. +ac_aux_files="config.guess config.sub install-sh" + +# Locations in which to look for auxiliary files. +ac_aux_dir_candidates="${srcdir}/tool/autoconf/build-aux" + +# Search for a directory containing all of the required auxiliary files, +# $ac_aux_files, from the $PATH-style list $ac_aux_dir_candidates. +# If we don't find one directory that contains all the files we need, +# we report the set of missing files from the *first* directory in +# $ac_aux_dir_candidates and give up. +ac_missing_aux_files="" +ac_first_candidate=: +printf "%s\n" "$as_me:${as_lineno-$LINENO}: looking for aux files: $ac_aux_files" >&5 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in $ac_aux_dir_candidates +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + as_found=: + + printf "%s\n" "$as_me:${as_lineno-$LINENO}: trying $as_dir" >&5 + ac_aux_dir_found=yes + ac_install_sh= + for ac_aux in $ac_aux_files + do + # As a special case, if "install-sh" is required, that requirement + # can be satisfied by any of "install-sh", "install.sh", or "shtool", + # and $ac_install_sh is set appropriately for whichever one is found. + if test x"$ac_aux" = x"install-sh" + then + if test -f "${as_dir}install-sh"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install-sh found" >&5 + ac_install_sh="${as_dir}install-sh -c" + elif test -f "${as_dir}install.sh"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install.sh found" >&5 + ac_install_sh="${as_dir}install.sh -c" + elif test -f "${as_dir}shtool"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}shtool found" >&5 + ac_install_sh="${as_dir}shtool install -c" + else + ac_aux_dir_found=no + if $ac_first_candidate; then + ac_missing_aux_files="${ac_missing_aux_files} install-sh" + else + break + fi + fi + else + if test -f "${as_dir}${ac_aux}"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}${ac_aux} found" >&5 + else + ac_aux_dir_found=no + if $ac_first_candidate; then + ac_missing_aux_files="${ac_missing_aux_files} ${ac_aux}" + else + break + fi + fi + fi + done + if test "$ac_aux_dir_found" = yes; then + ac_aux_dir="$as_dir" + break + fi + ac_first_candidate=false + + as_found=false +done +IFS=$as_save_IFS +if $as_found +then : + +else $as_nop + as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$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. +if test -f "${ac_aux_dir}config.guess"; then + ac_config_guess="$SHELL ${ac_aux_dir}config.guess" +fi +if test -f "${ac_aux_dir}config.sub"; then + ac_config_sub="$SHELL ${ac_aux_dir}config.sub" +fi +if test -f "$ac_aux_dir/configure"; then + ac_configure="$SHELL ${ac_aux_dir}configure" +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,) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +printf "%s\n" "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +printf "%s\n" "$as_me: former value: \`$ac_old_val'" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +printf "%s\n" "$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=`printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`${MAKE-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 -# 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. # Checks for programs. + + + + + + + + + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -2081,11 +2360,12 @@ 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -2093,11 +2373,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$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 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2108,11 +2392,11 @@ 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; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -2121,11 +2405,12 @@ 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else @@ -2133,11 +2418,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$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 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2148,11 +2437,11 @@ 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; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then @@ -2160,8 +2449,8 @@ fi 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;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC @@ -2174,11 +2463,12 @@ 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -2186,11 +2476,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$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 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2201,11 +2495,11 @@ 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; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -2214,11 +2508,12 @@ 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -2227,15 +2522,19 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac 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 + 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 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2251,18 +2550,18 @@ if test $ac_prog_rejected = yes; then # 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+' '}$@" + 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; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -2273,11 +2572,12 @@ if test -z "$CC"; then 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -2285,11 +2585,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$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 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2300,11 +2604,11 @@ 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; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -2317,11 +2621,12 @@ if test -z "$CC"; then 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else @@ -2329,11 +2634,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$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 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2344,11 +2653,11 @@ 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; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -2360,34 +2669,138 @@ done 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;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. +set dummy ${ac_tool_prefix}clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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}clang" + printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "clang", so it can be a program name with args. +set dummy clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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="clang" + printf "%s\n" "$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$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 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;} +test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$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 +printf "%s\n" "$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 +for ac_option in --version -v -V -qversion -version; 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 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -2397,7 +2810,7 @@ $as_echo "$ac_try_echo"; } >&5 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done @@ -2405,7 +2818,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; @@ -2417,9 +2830,9 @@ 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[^ ]*//'` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +printf %s "checking whether the C compiler works... " >&6; } +ac_link_default=`printf "%s\n" "$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.*" @@ -2440,11 +2853,12 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$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 : + printf "%s\n" "$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, @@ -2461,7 +2875,7 @@ do # certainly right. break;; *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi @@ -2477,44 +2891,46 @@ do done test "$ac_cv_exeext" = no && ac_cv_exeext= -else +else $as_nop 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 +if test -z "$ac_file" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +printf "%s\n" "$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;} +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$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; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +printf %s "checking for C compiler default output file name... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +printf "%s\n" "$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; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +printf %s "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 +printf "%s\n" "$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 : + printf "%s\n" "$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 @@ -2528,15 +2944,15 @@ for ac_file in conftest.exe conftest conftest.*; do * ) 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;} +else $as_nop + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$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; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +printf "%s\n" "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext @@ -2545,7 +2961,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; @@ -2557,8 +2973,8 @@ _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; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +printf %s "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in @@ -2566,10 +2982,10 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in @@ -2577,39 +2993,40 @@ $as_echo "$ac_try_echo"; } >&5 *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$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. + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "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; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +printf "%s\n" "$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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +printf %s "checking for suffix of object files... " >&6; } +if test ${ac_cv_objext+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; @@ -2623,11 +3040,12 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$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 : + printf "%s\n" "$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 @@ -2636,31 +3054,32 @@ $as_echo "$ac_try_echo"; } >&5 break;; esac done -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$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;} +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$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; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +printf "%s\n" "$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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 +printf %s "checking whether the compiler supports GNU C... " >&6; } +if test ${ac_cv_c_compiler_gnu+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { #ifndef __GNUC__ choke me @@ -2670,29 +3089,33 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_compiler_gnu=yes -else +else $as_nop ac_compiler_gnu=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam 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; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } +ac_compiler_gnu=$ac_cv_c_compiler_gnu + if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi -ac_test_CFLAGS=${CFLAGS+set} +ac_test_CFLAGS=${CFLAGS+y} 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +printf %s "checking whether $CC accepts -g... " >&6; } +if test ${ac_cv_prog_cc_g+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no @@ -2701,57 +3124,60 @@ else /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_prog_cc_g=yes -else +else $as_nop CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : -else +else $as_nop ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +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 +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +printf "%s\n" "$ac_cv_prog_cc_g" >&6; } +if test $ac_test_CFLAGS; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then @@ -2766,94 +3192,144 @@ 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_prog_cc_stdc=no +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 +printf %s "checking for $CC option to enable C11 features... " >&6; } +if test ${ac_cv_prog_cc_c11+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c11=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c11_program +_ACEOF +for ac_arg in '' -std=gnu11 +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c11=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c11" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi + +if test "x$ac_cv_prog_cc_c11" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c11" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 +printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } + CC="$CC $ac_cv_prog_cc_c11" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 + ac_prog_cc_stdc=c11 +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 +printf %s "checking for $CC option to enable C99 features... " >&6; } +if test ${ac_cv_prog_cc_c99+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c99=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c99_program +_ACEOF +for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c99=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c99" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi + +if test "x$ac_cv_prog_cc_c99" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c99" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 +printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } + CC="$CC $ac_cv_prog_cc_c99" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 + ac_prog_cc_stdc=c99 +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 +printf %s "checking for $CC option to enable C89 features... " >&6; } +if test ${ac_cv_prog_cc_c89+y} +then : + printf %s "(cached) " >&6 +else $as_nop 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; -} +$ac_c_conftest_c89_program _ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +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 : + if ac_fn_c_try_compile "$LINENO" +then : ac_cv_prog_cc_c89=$ac_arg fi -rm -f core conftest.err conftest.$ac_objext +rm -f core conftest.err conftest.$ac_objext conftest.beam 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 : +if test "x$ac_cv_prog_cc_c89" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c89" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } + CC="$CC $ac_cv_prog_cc_c89" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 + ac_prog_cc_stdc=c89 +fi fi ac_ext=c @@ -2868,7 +3344,9 @@ 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 -# Find a good install program. We prefer a C program (faster), + + + # 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 @@ -2882,20 +3360,25 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu # 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; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +printf %s "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 +if test ${ac_cv_path_install+y} +then : + printf %s "(cached) " >&6 +else $as_nop 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]/* | \ + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + # Account for fact that we put trailing slashes in our PATH walk. +case $as_dir in #(( + ./ | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; @@ -2905,13 +3388,13 @@ case $as_dir/ in #(( # 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 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 + 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 + 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 @@ -2919,12 +3402,12 @@ case $as_dir/ in #(( 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" && + 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" + ac_cv_path_install="$as_dir$ac_prog$ac_exec_ext -c" break 3 fi fi @@ -2940,7 +3423,7 @@ IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi - if test "${ac_cv_path_install+set}" = set; then + if test ${ac_cv_path_install+y}; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a @@ -2950,8 +3433,8 @@ fi INSTALL=$ac_install_sh fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 -$as_echo "$INSTALL" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +printf "%s\n" "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. @@ -2964,411 +3447,123 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' # Check for Clang/LLVM. -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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC options needed to detect all undeclared functions" >&5 +printf %s "checking for $CC options needed to detect all undeclared functions... " >&6; } +if test ${ac_cv_c_undeclared_builtin_options+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_save_CFLAGS=$CFLAGS + ac_cv_c_undeclared_builtin_options='cannot detect' + for ac_arg in '' -fno-builtin; do + CFLAGS="$ac_save_CFLAGS $ac_arg" + # This test program should *not* compile successfully. + 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 +int +main (void) +{ +(void) strchr; + ; + return 0; +} _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 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 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 +if ac_fn_c_try_compile "$LINENO" +then : + +else $as_nop + # This test program should compile successfully. + # No library function is consistently available on + # freestanding implementations, so test against a dummy + # declaration. Include always-available headers on the + # off chance that they somehow elicit warnings. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#include -#include #include +#include +#include +#include +extern void ac_decl (int, char *); int -main () +main (void) { +(void) ac_decl (0, (char *) 0); + (void) ac_decl; ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes -else - ac_cv_header_stdc=no +if ac_fn_c_try_compile "$LINENO" +then : + if test x"$ac_arg" = x +then : + ac_cv_c_undeclared_builtin_options='none needed' +else $as_nop + ac_cv_c_undeclared_builtin_options=$ac_arg 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 + break fi -rm -f conftest* - +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + done + CFLAGS=$ac_save_CFLAGS + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_undeclared_builtin_options" >&5 +printf "%s\n" "$ac_cv_c_undeclared_builtin_options" >&6; } + case $ac_cv_c_undeclared_builtin_options in #( + 'cannot detect') : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot make $CC report undeclared builtins +See \`config.log' for more details" "$LINENO" 5; } ;; #( + 'none needed') : + ac_c_undeclared_builtin_options='' ;; #( + *) : + ac_c_undeclared_builtin_options=$ac_cv_c_undeclared_builtin_options ;; +esac -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 : +ac_header= ac_cache= +for ac_item in $ac_header_c_list +do + if test $ac_cache; then + ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default" + if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then + printf "%s\n" "#define $ac_item 1" >> confdefs.h + fi + ac_header= ac_cache= + elif test $ac_header; then + ac_cache=$ac_item + else + ac_header=$ac_item + fi +done -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 +if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes +then : -# 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 +printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h fi - -done - - -ac_fn_c_check_decl "$LINENO" "__clang__" "ac_cv_have_decl___clang__" "$ac_includes_default" -if test "x$ac_cv_have_decl___clang__" = xyes; then : +ac_fn_check_decl "$LINENO" "__clang__" "ac_cv_have_decl___clang__" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl___clang__" = xyes +then : CLANG=yes -else +else $as_nop CLANG=no fi - # These flags aren't used for building the MPS, but for sample programs. CFLAGS_GC="-ansi -pedantic -Wall -Werror -Wpointer-arith \ -Wstrict-prototypes -Wmissing-prototypes \ @@ -3376,26 +3571,29 @@ CFLAGS_GC="-ansi -pedantic -Wall -Werror -Wpointer-arith \ -Wcast-qual -Wstrict-aliasing=2 -O -g3 -pthread" CFLAGS_LL="$CFLAGS_GC" -# 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 + + # 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 + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +printf %s "checking build system type... " >&6; } +if test ${ac_cv_build+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_build_alias=$build_alias test "x$ac_build_alias" = x && - ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` + 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 +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; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +printf "%s\n" "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; @@ -3414,21 +3612,22 @@ 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +printf %s "checking host system type... " >&6; } +if test ${ac_cv_host+y} +then : + printf %s "(cached) " >&6 +else $as_nop 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 + 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; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +printf "%s\n" "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; @@ -3447,56 +3646,57 @@ IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target platform" >&5 -$as_echo_n "checking target platform... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking target platform" >&5 +printf %s "checking target platform... " >&6; } BUILD_TARGET=build-via-make CLEAN_TARGET=clean-make-build INSTALL_TARGET=install-make-build TEST_TARGET=test-make-build case $host/$CLANG in aarch64-*-linux*/no) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Linux ARM64" >&5 -$as_echo "Linux ARM64" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Linux ARM64" >&5 +printf "%s\n" "Linux ARM64" >&6; } MPS_OS_NAME=li MPS_ARCH_NAME=a6 MPS_BUILD_NAME=gc PFMCFLAGS="$CFLAGS_GC" ;; aarch64-*-linux*/yes) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Linux ARM64" >&5 -$as_echo "Linux ARM64" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Linux ARM64" >&5 +printf "%s\n" "Linux ARM64" >&6; } MPS_OS_NAME=li MPS_ARCH_NAME=a6 MPS_BUILD_NAME=ll PFMCFLAGS="$CFLAGS_LL" ;; i*86-*-linux*/no) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Linux x86" >&5 -$as_echo "Linux x86" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Linux x86" >&5 +printf "%s\n" "Linux x86" >&6; } MPS_OS_NAME=li MPS_ARCH_NAME=i3 MPS_BUILD_NAME=gc PFMCFLAGS="$CFLAGS_GC" ;; x86_64-*-linux*/no) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Linux x86_64" >&5 -$as_echo "Linux x86_64" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Linux x86_64" >&5 +printf "%s\n" "Linux x86_64" >&6; } MPS_OS_NAME=li MPS_ARCH_NAME=i6 MPS_BUILD_NAME=gc PFMCFLAGS="$CFLAGS_GC" ;; x86_64-*-linux*/yes) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Linux x86_64" >&5 -$as_echo "Linux x86_64" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Linux x86_64" >&5 +printf "%s\n" "Linux x86_64" >&6; } MPS_OS_NAME=li MPS_ARCH_NAME=i6 MPS_BUILD_NAME=ll PFMCFLAGS="$CFLAGS_LL" ;; - aarch64-*-darwin*/*) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Mac OS X ARM64" >&5 -$as_echo "Mac OS X ARM64" >&6; } + # FIXME: Cirrus CI build machines produce arm64 not aarch64. Investigate. + aarch64-*-darwin*/*|arm64-*-darwin*/*) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Mac OS X ARM64" >&5 +printf "%s\n" "Mac OS X ARM64" >&6; } MPS_OS_NAME=xc MPS_ARCH_NAME=a6 MPS_BUILD_NAME=ll @@ -3507,8 +3707,8 @@ $as_echo "Mac OS X ARM64" >&6; } PFMCFLAGS="$CFLAGS_LL" ;; i*86-*-darwin*/*) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Mac OS X x86" >&5 -$as_echo "Mac OS X x86" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Mac OS X x86" >&5 +printf "%s\n" "Mac OS X x86" >&6; } MPS_OS_NAME=xc MPS_ARCH_NAME=i3 MPS_BUILD_NAME=ll @@ -3519,8 +3719,8 @@ $as_echo "Mac OS X x86" >&6; } PFMCFLAGS="$CFLAGS_LL" ;; x86_64-apple-darwin*/*) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Mac OS X x86_64" >&5 -$as_echo "Mac OS X x86_64" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Mac OS X x86_64" >&5 +printf "%s\n" "Mac OS X x86_64" >&6; } MPS_OS_NAME=xc MPS_ARCH_NAME=i6 MPS_BUILD_NAME=ll @@ -3531,8 +3731,8 @@ $as_echo "Mac OS X x86_64" >&6; } PFMCFLAGS="$CFLAGS_LL" ;; i*86-*-freebsd*/no) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: FreeBSD x86" >&5 -$as_echo "FreeBSD x86" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: FreeBSD x86" >&5 +printf "%s\n" "FreeBSD x86" >&6; } MPS_OS_NAME=fr MPS_ARCH_NAME=i3 MPS_BUILD_NAME=gc @@ -3542,8 +3742,8 @@ $as_echo "FreeBSD x86" >&6; } PFMCFLAGS="$CFLAGS_GC" ;; amd64-*-freebsd*/yes | x86_64-*-freebsd*/yes) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: FreeBSD x86_64" >&5 -$as_echo "FreeBSD x86_64" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: FreeBSD x86_64" >&5 +printf "%s\n" "FreeBSD x86_64" >&6; } MPS_OS_NAME=fr MPS_ARCH_NAME=i6 MPS_BUILD_NAME=ll @@ -3553,8 +3753,8 @@ $as_echo "FreeBSD x86_64" >&6; } PFMCFLAGS="$CFLAGS_GC" ;; amd64-*-freebsd*/no | x86_64-*-freebsd*/no) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: FreeBSD x86_64" >&5 -$as_echo "FreeBSD x86_64" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: FreeBSD x86_64" >&5 +printf "%s\n" "FreeBSD x86_64" >&6; } MPS_OS_NAME=fr MPS_ARCH_NAME=i6 MPS_BUILD_NAME=gc @@ -3564,8 +3764,8 @@ $as_echo "FreeBSD x86_64" >&6; } PFMCFLAGS="$CFLAGS_GC" ;; i*86-*-freebsd*/yes) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: FreeBSD x86" >&5 -$as_echo "FreeBSD x86" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: FreeBSD x86" >&5 +printf "%s\n" "FreeBSD x86" >&6; } MPS_OS_NAME=fr MPS_ARCH_NAME=i3 MPS_BUILD_NAME=ll @@ -3575,8 +3775,8 @@ $as_echo "FreeBSD x86" >&6; } PFMCFLAGS="$CFLAGS_LL" ;; amd64-*-freebsd*/no | x86_64-*-freebsd*/no) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: FreeBSD x86_64" >&5 -$as_echo "FreeBSD x86_64" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: FreeBSD x86_64" >&5 +printf "%s\n" "FreeBSD x86_64" >&6; } MPS_OS_NAME=fr MPS_ARCH_NAME=i6 MPS_BUILD_NAME=ll @@ -3593,11 +3793,12 @@ for ac_prog in gnumake gmake make 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_MAKE+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_MAKE+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$MAKE"; then ac_cv_prog_MAKE="$MAKE" # Let the user override the test. else @@ -3605,11 +3806,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_MAKE="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3620,11 +3825,11 @@ fi fi MAKE=$ac_cv_prog_MAKE if test -n "$MAKE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAKE" >&5 -$as_echo "$MAKE" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MAKE" >&5 +printf "%s\n" "$MAKE" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -3637,13 +3842,13 @@ if ! $MAKE --version | grep -q "GNU" 2> /dev/null; then fi EXTRA_TARGETS="mpseventcnv mpseventpy mpseventtxt" -ac_fn_c_check_header_mongrel "$LINENO" "sqlite3.h" "ac_cv_header_sqlite3_h" "$ac_includes_default" -if test "x$ac_cv_header_sqlite3_h" = xyes; then : +ac_fn_c_check_header_compile "$LINENO" "sqlite3.h" "ac_cv_header_sqlite3_h" "$ac_includes_default" +if test "x$ac_cv_header_sqlite3_h" = xyes +then : EXTRA_TARGETS="$EXTRA_TARGETS mpseventsql" fi - # Put platform compiler flags like -ansi -pedantic into CFLAGS only # after checking for sqlite3.h -- that header doesn't compile with # those flags. @@ -3690,8 +3895,8 @@ _ACEOF 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;} ;; + *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( @@ -3721,15 +3926,15 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; /^ac_cv_env_/b end t clear :clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/ 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;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +printf "%s\n" "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else @@ -3743,8 +3948,8 @@ $as_echo "$as_me: updating cache $cache_file" >&6;} 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;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache @@ -3797,7 +4002,7 @@ 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"` + ac_i=`printf "%s\n" "$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" @@ -3813,8 +4018,8 @@ LTLIBOBJS=$ac_ltlibobjs 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;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL @@ -3837,14 +4042,16 @@ cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : +as_nop=: +if test ${ZSH_VERSION+y} && (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 +else $as_nop case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( @@ -3854,46 +4061,46 @@ esac fi + +# Reset variables that may have inherited troublesome values from +# the environment. + +# IFS needs to be set, to space, tab, and newline, in precisely that order. +# (If _AS_PATH_WALK were called with IFS unset, it would have the +# side effect of setting IFS to empty, thus disabling word splitting.) +# Quoting is to prevent editors from complaining about space-tab. 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 +IFS=" "" $as_nl" + +PS1='$ ' +PS2='> ' +PS4='+ ' + +# Ensure predictable behavior from utilities with locale-dependent output. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# We cannot yet rely on "unset" to work, but we need these variables +# to be unset--not just set to an empty or harmless value--now, to +# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct +# also avoids known problems related to "unset" and subshell syntax +# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). +for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH +do eval test \${$as_var+y} \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done + +# Ensure that fds 0, 1, and 2 are open. +if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi +if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then +if ${PATH_SEPARATOR+false} :; 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 || @@ -3902,13 +4109,6 @@ if test "${PATH_SEPARATOR+set}" != set; then 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 #(( @@ -3917,8 +4117,12 @@ case $0 in #(( 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS @@ -3930,30 +4134,10 @@ 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 + printf "%s\n" "$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] @@ -3966,13 +4150,14 @@ 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 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - $as_echo "$as_me: error: $2" >&2 + printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error + # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. @@ -3999,18 +4184,20 @@ 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 : +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 +else $as_nop as_fn_append () { eval $1=\$$1\$2 @@ -4022,12 +4209,13 @@ fi # as_fn_append # 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 : +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null +then : eval 'as_fn_arith () { as_val=$(( $* )) }' -else +else $as_nop as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` @@ -4058,7 +4246,7 @@ as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | +printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -4080,6 +4268,10 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits + +# Determine whether it's possible to make 'echo' print without a newline. +# These variables are no longer used directly by Autoconf, but are AC_SUBSTed +# for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) @@ -4093,6 +4285,12 @@ case `echo -n x` in #((((( ECHO_N='-n';; esac +# For backward compatibility with old third-party macros, we provide +# the shell variables $as_echo and $as_echo_n. New code should use +# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. +as_echo='printf %s\n' +as_echo_n='printf %s' + rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file @@ -4134,7 +4332,7 @@ as_fn_mkdir_p () as_dirs= while :; do case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" @@ -4143,7 +4341,7 @@ $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" | +printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -4206,7 +4404,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # values after options handling. ac_log=" This file was extended by Memory Pool System Kit $as_me release/1.118.0, which was -generated by GNU Autoconf 2.69. Invocation command line was +generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -4256,14 +4454,16 @@ Report bugs to . Memory Pool System Kit home page: ." _ACEOF +ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"` +ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ Memory Pool System Kit config.status release/1.118.0 -configured by $0, generated by GNU Autoconf 2.69, +configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" -Copyright (C) 2012 Free Software Foundation, Inc. +Copyright (C) 2021 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -4301,21 +4501,21 @@ do -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 ;; + printf "%s\n" "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) - $as_echo "$ac_cs_config"; exit ;; + printf "%s\n" "$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"` ;; + *\'*) ac_optarg=`printf "%s\n" "$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 ;; + printf "%s\n" "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; @@ -4343,7 +4543,7 @@ 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 + \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" @@ -4357,7 +4557,7 @@ exec 5>>config.log sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX - $as_echo "$ac_log" + printf "%s\n" "$ac_log" } >&5 _ACEOF @@ -4383,7 +4583,7 @@ done # 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_FILES+y} || CONFIG_FILES=$config_files fi # Have a temporary directory for convenience. Make it in the build tree @@ -4611,7 +4811,7 @@ do 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 + case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done @@ -4619,17 +4819,17 @@ do # 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' + printf "%s\n" "$*" | 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;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +printf "%s\n" "$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" | + ac_sed_conf_input=`printf "%s\n" "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac @@ -4646,7 +4846,7 @@ $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" | +printf "%s\n" X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -4670,9 +4870,9 @@ $as_echo X"$ac_file" | case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + ac_dir_suffix=/`printf "%s\n" "$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|/||'` + ac_top_builddir_sub=`printf "%s\n" "$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/ ;; @@ -4729,8 +4929,8 @@ ac_sed_dataroot=' 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;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +printf "%s\n" "$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=' @@ -4773,9 +4973,9 @@ 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' + { printf "%s\n" "$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' +printf "%s\n" "$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" @@ -4822,8 +5022,8 @@ if test "$no_create" != yes; then $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;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi @@ -4858,3 +5058,4 @@ echo 1>&2 "CONFIGURE/MAKE IS NOT THE BEST WAY TO BUILD THE MPS # 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 --git a/configure.ac b/configure.ac index e10e8322ef..225d7a35fd 100644 --- a/configure.ac +++ b/configure.ac @@ -80,7 +80,8 @@ case $host/$CLANG in MPS_BUILD_NAME=ll PFMCFLAGS="$CFLAGS_LL" ;; - aarch64-*-darwin*/*) + # FIXME: Cirrus CI build machines produce arm64 not aarch64. Investigate. + aarch64-*-darwin*/*|arm64-*-darwin*/*) AC_MSG_RESULT([Mac OS X ARM64]) MPS_OS_NAME=xc MPS_ARCH_NAME=a6 diff --git a/tool/autoconf/build-aux/config.guess b/tool/autoconf/build-aux/config.guess old mode 100644 new mode 100755 index c0adba94b2..f50dcdb6de --- a/tool/autoconf/build-aux/config.guess +++ b/tool/autoconf/build-aux/config.guess @@ -1,14 +1,12 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, -# 2011, 2012 Free Software Foundation, Inc. +# Copyright 1992-2018 Free Software Foundation, Inc. -timestamp='2012-06-10' +timestamp='2018-02-24' # 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 2 of the License, or +# 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 @@ -17,24 +15,22 @@ timestamp='2012-06-10' # 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 . +# 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 Per Bothner. Please send patches (context -# diff format) to and include a ChangeLog -# entry. +# 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"). # -# This script attempts to guess a canonical system name similar to -# config.sub. If it succeeds, it prints the system name on stdout, and -# exits with 0. Otherwise, it exits with 1. +# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # 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 +# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess +# +# Please send patches to . + me=`echo "$0" | sed -e 's,.*/,,'` @@ -43,7 +39,7 @@ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. -Operation modes: +Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit @@ -54,9 +50,7 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 -Free Software Foundation, Inc. +Copyright 1992-2018 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." @@ -113,9 +107,9 @@ trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in - ,,) echo "int x;" > $dummy.c ; + ,,) 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 + if ($c -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; @@ -138,9 +132,37 @@ 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' | sed 's, ,,g'`" + + # If ldd exists, use it to detect musl libc. + if command -v ldd >/dev/null && \ + ldd --version 2>&1 | grep -q ^musl + then + LIBC=musl + fi + ;; +esac + # Note: order is significant - the case branches are not exclusive. -case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in +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*, @@ -153,21 +175,31 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # 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 + UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ + "/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 ;; + earmv*) + arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` + endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` + machine="${arch}${endian}"-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 + # to ELF recently (or will in the future) and ABI. + case "$UNAME_MACHINE_ARCH" in + earm*) + os=netbsdelf + ;; arm*|i386|m68k|ns32k|sh3*|sparc|vax) - eval $set_cc_for_build + eval "$set_cc_for_build" if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then @@ -182,40 +214,67 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in os=netbsd ;; esac + # Determine ABI tags. + case "$UNAME_MACHINE_ARCH" in + earm*) + expr='s/^earmv[0-9]/-eabi/;s/eb$//' + abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` + ;; + 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 + case "$UNAME_VERSION" in Debian*) release='-gnu' ;; *) - release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` ;; 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}" + echo "$machine-${os}${release}${abi}" + 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} + echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE" + exit ;; + *:LibertyBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` + echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE" + exit ;; + *:MidnightBSD:*:*) + echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE" exit ;; *:ekkoBSD:*:*) - echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE" exit ;; *:SolidBSD:*:*) - echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} + echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE" exit ;; macppc:MirBSD:*:*) - echo powerpc-unknown-mirbsd${UNAME_RELEASE} + echo powerpc-unknown-mirbsd"$UNAME_RELEASE" exit ;; *:MirBSD:*:*) - echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE" + exit ;; + *:Sortix:*:*) + echo "$UNAME_MACHINE"-unknown-sortix exit ;; + *:Redox:*:*) + echo "$UNAME_MACHINE"-unknown-redox + exit ;; + mips:OSF1:*.*) + echo mips-dec-osf1 + exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) @@ -232,63 +291,54 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in 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" ;; + UNAME_MACHINE=alpha ;; "EV4.5 (21064)") - UNAME_MACHINE="alpha" ;; + UNAME_MACHINE=alpha ;; "LCA4 (21066/21068)") - UNAME_MACHINE="alpha" ;; + UNAME_MACHINE=alpha ;; "EV5 (21164)") - UNAME_MACHINE="alphaev5" ;; + UNAME_MACHINE=alphaev5 ;; "EV5.6 (21164A)") - UNAME_MACHINE="alphaev56" ;; + UNAME_MACHINE=alphaev56 ;; "EV5.6 (21164PC)") - UNAME_MACHINE="alphapca56" ;; + UNAME_MACHINE=alphapca56 ;; "EV5.7 (21164PC)") - UNAME_MACHINE="alphapca57" ;; + UNAME_MACHINE=alphapca57 ;; "EV6 (21264)") - UNAME_MACHINE="alphaev6" ;; + UNAME_MACHINE=alphaev6 ;; "EV6.7 (21264A)") - UNAME_MACHINE="alphaev67" ;; + UNAME_MACHINE=alphaev67 ;; "EV6.8CB (21264C)") - UNAME_MACHINE="alphaev68" ;; + UNAME_MACHINE=alphaev68 ;; "EV6.8AL (21264B)") - UNAME_MACHINE="alphaev68" ;; + UNAME_MACHINE=alphaev68 ;; "EV6.8CX (21264D)") - UNAME_MACHINE="alphaev68" ;; + UNAME_MACHINE=alphaev68 ;; "EV6.9A (21264/EV69A)") - UNAME_MACHINE="alphaev69" ;; + UNAME_MACHINE=alphaev69 ;; "EV7 (21364)") - UNAME_MACHINE="alphaev7" ;; + UNAME_MACHINE=alphaev7 ;; "EV7.9 (21364A)") - UNAME_MACHINE="alphaev79" ;; + 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'` + 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 + echo "$UNAME_MACHINE"-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-morphos + echo "$UNAME_MACHINE"-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition @@ -300,9 +350,9 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix${UNAME_RELEASE} + echo arm-acorn-riscix"$UNAME_RELEASE" exit ;; - arm:riscos:*:*|arm:RISCOS:*:*) + arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) @@ -327,38 +377,38 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) - echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + 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/[^.]*//'` + 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/[^.]*//'` + echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) - echo i386-pc-auroraux${UNAME_RELEASE} + echo i386-pc-auroraux"$UNAME_RELEASE" exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) - eval $set_cc_for_build - SUN_ARCH="i386" + 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 [ "$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) | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then - SUN_ARCH="x86_64" + SUN_ARCH=x86_64 fi fi - echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + 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/[^.]*//'` + echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in @@ -367,25 +417,25 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`" exit ;; sun3*:SunOS:*:*) - echo m68k-sun-sunos${UNAME_RELEASE} + 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 + test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) - echo m68k-sun-sunos${UNAME_RELEASE} + echo m68k-sun-sunos"$UNAME_RELEASE" ;; sun4) - echo sparc-sun-sunos${UNAME_RELEASE} + echo sparc-sun-sunos"$UNAME_RELEASE" ;; esac exit ;; aushp:SunOS:*:*) - echo sparc-auspex-sunos${UNAME_RELEASE} + 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 @@ -396,44 +446,44 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # 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} + echo m68k-atari-mint"$UNAME_RELEASE" exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint"$UNAME_RELEASE" exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint"$UNAME_RELEASE" exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} + echo m68k-milan-mint"$UNAME_RELEASE" exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} + echo m68k-hades-mint"$UNAME_RELEASE" exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} + echo m68k-unknown-mint"$UNAME_RELEASE" exit ;; m68k:machten:*:*) - echo m68k-apple-machten${UNAME_RELEASE} + echo m68k-apple-machten"$UNAME_RELEASE" exit ;; powerpc:machten:*:*) - echo powerpc-apple-machten${UNAME_RELEASE} + echo powerpc-apple-machten"$UNAME_RELEASE" exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) - echo mips-dec-ultrix${UNAME_RELEASE} + echo mips-dec-ultrix"$UNAME_RELEASE" exit ;; VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix${UNAME_RELEASE} + echo vax-dec-ultrix"$UNAME_RELEASE" exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix${UNAME_RELEASE} + echo clipper-intergraph-clix"$UNAME_RELEASE" exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + eval "$set_cc_for_build" + sed 's/^ //' << EOF > "$dummy.c" #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { @@ -442,23 +492,23 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) - printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + 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); + 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); + 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` && + $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} + echo mips-mips-riscos"$UNAME_RELEASE" exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax @@ -484,17 +534,17 @@ EOF AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ] then - if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ - [ ${TARGET_BINARY_INTERFACE}x = x ] + if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \ + [ "$TARGET_BINARY_INTERFACE"x = x ] then - echo m88k-dg-dgux${UNAME_RELEASE} + echo m88k-dg-dgux"$UNAME_RELEASE" else - echo m88k-dg-dguxbcs${UNAME_RELEASE} + echo m88k-dg-dguxbcs"$UNAME_RELEASE" fi else - echo i586-dg-dgux${UNAME_RELEASE} + echo i586-dg-dgux"$UNAME_RELEASE" fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) @@ -511,7 +561,7 @@ EOF echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) - echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + 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 @@ -523,14 +573,14 @@ EOF if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi - echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + 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 + eval "$set_cc_for_build" + sed 's/^ //' << EOF > "$dummy.c" #include main() @@ -541,7 +591,7 @@ EOF exit(0); } EOF - if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` then echo "$SYSTEM_NAME" else @@ -555,26 +605,27 @@ EOF 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 + 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` + if [ -x /usr/bin/lslpp ] ; then + IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | + awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi - echo ${IBM_ARCH}-ibm-aix${IBM_REV} + echo "$IBM_ARCH"-ibm-aix"$IBM_REV" exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; - ibmrt:4.4BSD:*|romp-ibm:BSD:*) + ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) 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 + echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx @@ -589,28 +640,28 @@ EOF 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 ;; + 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 + 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 + 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 + if [ "$HP_ARCH" = "" ]; then + eval "$set_cc_for_build" + sed 's/^ //' << EOF > "$dummy.c" #define _HPUX_SOURCE #include @@ -643,13 +694,13 @@ EOF exit (0); } EOF - (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + (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" ] + if [ "$HP_ARCH" = hppa2.0w ] then - eval $set_cc_for_build + 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 @@ -660,23 +711,23 @@ EOF # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 - if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | + if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then - HP_ARCH="hppa2.0w" + HP_ARCH=hppa2.0w else - HP_ARCH="hppa64" + HP_ARCH=hppa64 fi fi - echo ${HP_ARCH}-hp-hpux${HPUX_REV} + 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} + 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 + eval "$set_cc_for_build" + sed 's/^ //' << EOF > "$dummy.c" #include int main () @@ -701,11 +752,11 @@ EOF exit (0); } EOF - $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + $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:*:* ) + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) @@ -714,7 +765,7 @@ EOF *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; - hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) @@ -722,9 +773,9 @@ EOF exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then - echo ${UNAME_MACHINE}-unknown-osf1mk + echo "$UNAME_MACHINE"-unknown-osf1mk else - echo ${UNAME_MACHINE}-unknown-osf1 + echo "$UNAME_MACHINE"-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) @@ -749,124 +800,109 @@ EOF echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) - echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + 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/' + echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) - echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) - echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) - echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + 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/ /_/'` + 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/ /_/'` + 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} + echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE" exit ;; sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi${UNAME_RELEASE} + echo sparc-unknown-bsdi"$UNAME_RELEASE" exit ;; *:BSD/OS:*:*) - echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE" exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` - case ${UNAME_PROCESSOR} in + 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/[-(].*//'` ;; + UNAME_PROCESSOR=x86_64 ;; + i386) + UNAME_PROCESSOR=i586 ;; esac + echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" exit ;; i*:CYGWIN*:*) - echo ${UNAME_MACHINE}-pc-cygwin + echo "$UNAME_MACHINE"-pc-cygwin exit ;; - *:MINGW*:*) - echo ${UNAME_MACHINE}-pc-mingw32 + *:MINGW64*:*) + echo "$UNAME_MACHINE"-pc-mingw64 exit ;; - i*:MSYS*:*) - echo ${UNAME_MACHINE}-pc-msys + *:MINGW*:*) + echo "$UNAME_MACHINE"-pc-mingw32 exit ;; - i*:windows32*:*) - # uname -m includes "-pc" on this system. - echo ${UNAME_MACHINE}-mingw32 + *:MSYS*:*) + echo "$UNAME_MACHINE"-pc-msys exit ;; i*:PW*:*) - echo ${UNAME_MACHINE}-pc-pw32 + echo "$UNAME_MACHINE"-pc-pw32 exit ;; *:Interix*:*) - case ${UNAME_MACHINE} in + case "$UNAME_MACHINE" in x86) - echo i586-pc-interix${UNAME_RELEASE} + echo i586-pc-interix"$UNAME_RELEASE" exit ;; authenticamd | genuineintel | EM64T) - echo x86_64-unknown-interix${UNAME_RELEASE} + echo x86_64-unknown-interix"$UNAME_RELEASE" exit ;; IA64) - echo ia64-unknown-interix${UNAME_RELEASE} + 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 + 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/[^.]*//'` + echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; *:GNU:*:*) # the GNU system - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + 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/[-(].*//'`-gnu + echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC" exit ;; i*86:Minix:*:*) - echo ${UNAME_MACHINE}-pc-minix + echo "$UNAME_MACHINE"-pc-minix exit ;; aarch64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in @@ -879,63 +915,64 @@ EOF EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 - if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + 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 + 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-gnu + 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-gnueabi + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi else - echo ${UNAME_MACHINE}-unknown-linux-gnueabihf + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf fi fi exit ;; avr32*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; cris:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-gnu + echo "$UNAME_MACHINE"-axis-linux-"$LIBC" exit ;; crisv32:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-gnu + echo "$UNAME_MACHINE"-axis-linux-"$LIBC" + exit ;; + e2k:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; frv:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; hexagon:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; i*86:Linux:*:*) - LIBC=gnu - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #ifdef __dietlibc__ - LIBC=dietlibc - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` - echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + echo "$UNAME_MACHINE"-pc-linux-"$LIBC" exit ;; ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + k1om:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; m32r*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; mips:Linux:*:* | mips64:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + eval "$set_cc_for_build" + sed 's/^ //' << EOF > "$dummy.c" #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el @@ -949,55 +986,74 @@ EOF #endif #endif EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU'`" + test "x$CPU" != x && { echo "$CPU-unknown-linux-$LIBC"; exit; } ;; - or32:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + mips64el:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + openrisc*:Linux:*:*) + echo or1k-unknown-linux-"$LIBC" + exit ;; + or32:Linux:*:* | or1k*:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; padre:Linux:*:*) - echo sparc-unknown-linux-gnu + echo sparc-unknown-linux-"$LIBC" exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-gnu + 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-gnu ;; - PA8*) echo hppa2.0-unknown-linux-gnu ;; - *) echo hppa-unknown-linux-gnu ;; + 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-gnu + echo powerpc64-unknown-linux-"$LIBC" exit ;; ppc:Linux:*:*) - echo powerpc-unknown-linux-gnu + echo powerpc-unknown-linux-"$LIBC" + exit ;; + ppc64le:Linux:*:*) + echo powerpc64le-unknown-linux-"$LIBC" + exit ;; + ppcle:Linux:*:*) + echo powerpcle-unknown-linux-"$LIBC" + exit ;; + riscv32:Linux:*:* | riscv64:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux + echo "$UNAME_MACHINE"-ibm-linux-"$LIBC" exit ;; sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; tile*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; vax:Linux:*:*) - echo ${UNAME_MACHINE}-dec-linux-gnu + echo "$UNAME_MACHINE"-dec-linux-"$LIBC" exit ;; x86_64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + if objdump -f /bin/sh | grep -q elf32-x86-64; then + echo "$UNAME_MACHINE"-pc-linux-"$LIBC"x32 + else + echo "$UNAME_MACHINE"-pc-linux-"$LIBC" + fi exit ;; xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. @@ -1011,34 +1067,34 @@ EOF # 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} + 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 + echo "$UNAME_MACHINE"-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) - echo ${UNAME_MACHINE}-unknown-stop + echo "$UNAME_MACHINE"-unknown-stop exit ;; i*86:atheos:*:*) - echo ${UNAME_MACHINE}-unknown-atheos + echo "$UNAME_MACHINE"-unknown-atheos exit ;; i*86:syllable:*:*) - echo ${UNAME_MACHINE}-pc-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} + echo i386-unknown-lynxos"$UNAME_RELEASE" exit ;; i*86:*DOS:*:*) - echo ${UNAME_MACHINE}-pc-msdosdjgpp + echo "$UNAME_MACHINE"-pc-msdosdjgpp exit ;; - i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) - UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + i*86:*: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} + echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL" else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL" fi exit ;; i*86:*:5:[678]*) @@ -1048,12 +1104,12 @@ EOF *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac - echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + 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 @@ -1063,9 +1119,9 @@ EOF && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 - echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL" else - echo ${UNAME_MACHINE}-pc-sysv32 + echo "$UNAME_MACHINE"-pc-sysv32 fi exit ;; pc:*:*:*) @@ -1073,7 +1129,7 @@ EOF # 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 + # prints for the "djgpp" host, or else GDB configure will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; @@ -1085,9 +1141,9 @@ EOF 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 + 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 + echo i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) @@ -1107,9 +1163,9 @@ EOF 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; } + && { 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; } ;; + && { 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; } ;; @@ -1118,28 +1174,28 @@ EOF 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; } + && { 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; } + && { 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; } ;; + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - echo m68k-unknown-lynxos${UNAME_RELEASE} + 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} + echo sparc-unknown-lynxos"$UNAME_RELEASE" exit ;; rs6000:LynxOS:2.*:*) - echo rs6000-unknown-lynxos${UNAME_RELEASE} + echo rs6000-unknown-lynxos"$UNAME_RELEASE" exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) - echo powerpc-unknown-lynxos${UNAME_RELEASE} + echo powerpc-unknown-lynxos"$UNAME_RELEASE" exit ;; SM[BE]S:UNIX_SV:*:*) - echo mips-dde-sysv${UNAME_RELEASE} + echo mips-dde-sysv"$UNAME_RELEASE" exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 @@ -1150,7 +1206,7 @@ EOF *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` - echo ${UNAME_MACHINE}-sni-sysv4 + echo "$UNAME_MACHINE"-sni-sysv4 else echo ns32k-sni-sysv fi @@ -1170,23 +1226,23 @@ EOF exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. - echo ${UNAME_MACHINE}-stratus-vos + 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} + 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} + echo mips-nec-sysv"$UNAME_RELEASE" else - echo mips-unknown-sysv${UNAME_RELEASE} + echo mips-unknown-sysv"$UNAME_RELEASE" fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. @@ -1201,66 +1257,97 @@ EOF 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} + echo sx4-nec-superux"$UNAME_RELEASE" exit ;; SX-5:SUPER-UX:*:*) - echo sx5-nec-superux${UNAME_RELEASE} + echo sx5-nec-superux"$UNAME_RELEASE" exit ;; SX-6:SUPER-UX:*:*) - echo sx6-nec-superux${UNAME_RELEASE} + echo sx6-nec-superux"$UNAME_RELEASE" exit ;; SX-7:SUPER-UX:*:*) - echo sx7-nec-superux${UNAME_RELEASE} + echo sx7-nec-superux"$UNAME_RELEASE" exit ;; SX-8:SUPER-UX:*:*) - echo sx8-nec-superux${UNAME_RELEASE} + echo sx8-nec-superux"$UNAME_RELEASE" exit ;; SX-8R:SUPER-UX:*:*) - echo sx8r-nec-superux${UNAME_RELEASE} + echo sx8r-nec-superux"$UNAME_RELEASE" + exit ;; + SX-ACE:SUPER-UX:*:*) + echo sxace-nec-superux"$UNAME_RELEASE" exit ;; Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody${UNAME_RELEASE} + echo powerpc-apple-rhapsody"$UNAME_RELEASE" exit ;; *:Rhapsody:*:*) - echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE" exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown - case $UNAME_PROCESSOR in - i386) - eval $set_cc_for_build - 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 - UNAME_PROCESSOR="x86_64" - fi - fi ;; - unknown) UNAME_PROCESSOR=powerpc ;; - esac - echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + eval "$set_cc_for_build" + if test "$UNAME_PROCESSOR" = unknown ; then + UNAME_PROCESSOR=powerpc + fi + if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then + 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 + # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc + if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_PPC >/dev/null + then + UNAME_PROCESSOR=powerpc + fi + fi + elif test "$UNAME_PROCESSOR" = i386 ; then + # Avoid executing cc on OS X 10.9, as it ships with a stub + # that puts up a graphical alert prompting to install + # developer tools. Any system running Mac OS X 10.7 or + # later (Darwin 11 and later) is required to have a 64-bit + # processor. This is not true of the ARM version of Darwin + # that Apple uses in portable devices. + UNAME_PROCESSOR=x86_64 + fi + echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE" exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` - if test "$UNAME_PROCESSOR" = "x86"; then + if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi - echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + 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} + NEO-*:NONSTOP_KERNEL:*:*) + echo neo-tandem-nsk"$UNAME_RELEASE" exit ;; NSE-*:NONSTOP_KERNEL:*:*) - echo nse-tandem-nsk${UNAME_RELEASE} + echo nse-tandem-nsk"$UNAME_RELEASE" + exit ;; + NSR-*:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk"$UNAME_RELEASE" exit ;; - NSR-?:NONSTOP_KERNEL:*:*) - echo nsr-tandem-nsk${UNAME_RELEASE} + NSV-*:NONSTOP_KERNEL:*:*) + echo nsv-tandem-nsk"$UNAME_RELEASE" + exit ;; + NSX-*:NONSTOP_KERNEL:*:*) + echo nsx-tandem-nsk"$UNAME_RELEASE" exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux @@ -1269,18 +1356,18 @@ EOF echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) - echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + 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 + if test "$cputype" = 386; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi - echo ${UNAME_MACHINE}-unknown-plan9 + echo "$UNAME_MACHINE"-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 @@ -1301,14 +1388,14 @@ EOF echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) - echo mips-sei-seiux${UNAME_RELEASE} + echo mips-sei-seiux"$UNAME_RELEASE" exit ;; *:DragonFly:*:*) - echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` - case "${UNAME_MACHINE}" in + case "$UNAME_MACHINE" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; @@ -1317,185 +1404,48 @@ EOF echo i386-pc-xenix exit ;; i*86:skyos:*:*) - echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' + echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`" exit ;; i*86:rdos:*:*) - echo ${UNAME_MACHINE}-pc-rdos + echo "$UNAME_MACHINE"-pc-rdos exit ;; i*86:AROS:*:*) - echo ${UNAME_MACHINE}-pc-aros + echo "$UNAME_MACHINE"-pc-aros exit ;; x86_64:VMkernel:*:*) - echo ${UNAME_MACHINE}-unknown-esx + echo "$UNAME_MACHINE"-unknown-esx + exit ;; + amd64:Isilon\ OneFS:*:*) + echo x86_64-unknown-onefs exit ;; esac -#echo '(No uname command or uname output not recognized.)' 1>&2 -#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 - -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 +echo "$0: unable to guess system type" >&2 -#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 +case "$UNAME_MACHINE:$UNAME_SYSTEM" in + mips:Linux | mips64:Linux) + # If we got here on MIPS GNU/Linux, output extra information. + cat >&2 < -# 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); -} +NOTE: MIPS GNU/Linux systems require a C compiler to fully recognize +the system type. Please install a C compiler and try again. 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 + ;; +esac cat >&2 < in order to provide the needed -information to handle your system. +If $0 has already been updated, send the following data and any +information you think might be pertinent to config-patches@gnu.org to +provide the necessary information to handle your system. config.guess timestamp = $timestamp @@ -1514,16 +1464,16 @@ hostinfo = `(hostinfo) 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} +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) +# eval: (add-hook 'write-file-functions 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" diff --git a/tool/autoconf/build-aux/config.sub b/tool/autoconf/build-aux/config.sub old mode 100644 new mode 100755 index 6205f8423d..1d8e98bcee --- a/tool/autoconf/build-aux/config.sub +++ b/tool/autoconf/build-aux/config.sub @@ -1,36 +1,31 @@ #! /bin/sh # Configuration validation subroutine script. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, -# 2011, 2012 Free Software Foundation, Inc. +# Copyright 1992-2018 Free Software Foundation, Inc. -timestamp='2012-04-18' +timestamp='2018-02-22' -# This file is (in principle) common to ALL GNU software. -# The presence of a machine in this file suggests that SOME GNU software -# can handle that machine. It does not imply ALL GNU software can. -# -# 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 2 of the License, or +# 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. +# 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 . +# 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. +# 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 to . Submit a context -# diff and a properly formatted GNU ChangeLog entry. +# Please send patches to . # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. @@ -38,7 +33,7 @@ timestamp='2012-04-18' # 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 +# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases @@ -58,12 +53,11 @@ timestamp='2012-04-18' me=`echo "$0" | sed -e 's,.*/,,'` usage="\ -Usage: $0 [OPTION] CPU-MFR-OPSYS - $0 [OPTION] ALIAS +Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS Canonicalize a configuration name. -Operation modes: +Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit @@ -73,9 +67,7 @@ Report bugs and patches to ." version="\ GNU config.sub ($timestamp) -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 -Free Software Foundation, Inc. +Copyright 1992-2018 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." @@ -102,7 +94,7 @@ while test $# -gt 0 ; do *local*) # First pass through any local machine types. - echo $1 + echo "$1" exit ;; * ) @@ -120,24 +112,24 @@ 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/'` +maybe_os=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ - linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ - knetbsd*-gnu* | netbsd*-gnu* | \ - kopensolaris*-gnu* | \ + linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ + knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ + kopensolaris*-gnu* | cloudabi*-eabi* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + 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/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ;; *) - basic_machine=`echo $1 | sed 's/-[^-]*$//'` - if [ $basic_machine != $1 ] - then os=`echo $1 | sed 's/.*-/-/'` + basic_machine=`echo "$1" | sed 's/-[^-]*$//'` + if [ "$basic_machine" != "$1" ] + then os=`echo "$1" | sed 's/.*-/-/'` else os=; fi ;; esac @@ -156,7 +148,7 @@ case $os in -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) + -apple | -axis | -knuth | -cray | -microblaze*) os= basic_machine=$1 ;; @@ -186,44 +178,44 @@ case $os in ;; -sco6) os=-sco5v6 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + 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/'` + 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/'` + 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/'` + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -udk*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + 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/'` + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -lynx*178) os=-lynxos178 @@ -235,10 +227,7 @@ case $os in os=-lynxos ;; -ptx*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` - ;; - -windowsnt*) - os=`echo $os | sed -e 's/windowsnt/winnt/'` + basic_machine=`echo "$1" | sed -e 's/86-.*/86-sequent/'` ;; -psos*) os=-psos @@ -259,21 +248,25 @@ case $basic_machine in | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ - | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ - | be32 | be64 \ + | arc | arceb \ + | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ + | avr | avr32 \ + | ba \ + | be32 | be64 \ | bfin \ - | c4x | clipper \ + | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ - | epiphany \ - | fido | fr30 | frv \ + | e2k | epiphany \ + | fido | fr30 | frv | ft32 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ - | i370 | i860 | i960 | ia64 \ + | i370 | i860 | i960 | ia16 | ia64 \ | ip2k | iq2000 \ + | k1om \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ - | maxq | mb | microblaze | mcore | mep | metag \ + | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ @@ -287,26 +280,30 @@ case $basic_machine in | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ + | mipsisa32r6 | mipsisa32r6el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64r6 | mipsisa64r6el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ + | mipsr5900 | mipsr5900el \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ - | nios | nios2 \ + | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ - | open8 \ - | or32 \ - | pdp10 | pdp11 | pj | pjl \ + | open8 | or1k | or1knd | or32 \ + | pdp10 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ + | pru \ | pyramid \ + | riscv32 | riscv64 \ | 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 \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ @@ -314,7 +311,8 @@ case $basic_machine in | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ - | we32k \ + | visium \ + | wasm32 \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown @@ -328,11 +326,14 @@ case $basic_machine in c6x) basic_machine=tic6x-unknown ;; - m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) + leon|leon[3-9]) + basic_machine=sparc-$basic_machine + ;; + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown os=-none ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65) ;; ms1) basic_machine=mt-unknown @@ -361,7 +362,7 @@ case $basic_machine in ;; # Object if more than one company name word. *-*-*) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. @@ -370,26 +371,29 @@ case $basic_machine in | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ + | ba-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ - | clipper-* | craynv-* | cydra-* \ + | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ - | elxsi-* \ + | e2k-* | 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-* \ + | i*86-* | i860-* | i960-* | ia16-* | ia64-* \ | ip2k-* | iq2000-* \ + | k1om-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ + | microblaze-* | microblazeel-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ @@ -403,28 +407,34 @@ case $basic_machine in | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa32r6-* | mipsisa32r6el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64r6-* | mipsisa64r6el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipsr5900-* | mipsr5900el-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ - | nios-* | nios2-* \ + | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ + | or1k*-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ + | pru-* \ | pyramid-* \ + | riscv32-* | riscv64-* \ | 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?-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ @@ -432,6 +442,8 @@ case $basic_machine in | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ + | visium-* \ + | wasm32-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ @@ -445,7 +457,7 @@ case $basic_machine in # 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 + basic_machine=i386-pc os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) @@ -479,7 +491,7 @@ case $basic_machine in basic_machine=x86_64-pc ;; amd64-*) - basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=x86_64-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl @@ -508,6 +520,9 @@ case $basic_machine in basic_machine=i386-pc os=-aros ;; + asmjs) + basic_machine=asmjs-unknown + ;; aux) basic_machine=m68k-apple os=-aux @@ -521,7 +536,7 @@ case $basic_machine in os=-linux ;; blackfin-*) - basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=bfin-`echo "$basic_machine" | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) @@ -529,13 +544,13 @@ case $basic_machine in os=-cnk ;; c54x-*) - basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=tic54x-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; c55x-*) - basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=tic55x-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; c6x-*) - basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=tic6x-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray @@ -624,10 +639,18 @@ case $basic_machine in basic_machine=rs6000-bull os=-bosx ;; - dpx2* | dpx2*-bull) + dpx2*) basic_machine=m68k-bull os=-sysv3 ;; + e500v[12]) + basic_machine=powerpc-unknown + os=$os"spe" + ;; + e500v[12]-*) + basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'` + os=$os"spe" + ;; ebmon29k) basic_machine=a29k-amd os=-ebmon @@ -717,9 +740,6 @@ case $basic_machine in 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 @@ -732,26 +752,26 @@ case $basic_machine in basic_machine=i370-ibm ;; i*86v32) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; - i386-vsta | vsta) + vsta) basic_machine=i386-unknown os=-vsta ;; @@ -769,17 +789,17 @@ case $basic_machine in basic_machine=m68k-isi os=-sysv ;; + leon-*|leon[3-9]-*) + basic_machine=sparc-`echo "$basic_machine" | sed 's/-.*//'` + ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) - basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=m68k-`echo "$basic_machine" | sed 's/^[^-]*-//'` os=-linux ;; - m88k-omron*) - basic_machine=m88k-omron - ;; magnum | m3230) basic_machine=mips-mips os=-sysv @@ -788,11 +808,15 @@ case $basic_machine in basic_machine=ns32k-utek os=-sysv ;; - microblaze) + microblaze*) basic_machine=microblaze-xilinx ;; + mingw64) + basic_machine=x86_64-pc + os=-mingw64 + ;; mingw32) - basic_machine=i386-pc + basic_machine=i686-pc os=-mingw32 ;; mingw32ce) @@ -807,10 +831,10 @@ case $basic_machine in os=-mint ;; mips3*-*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'` ;; mips3*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k @@ -820,15 +844,19 @@ case $basic_machine in basic_machine=powerpc-unknown os=-morphos ;; + moxiebox) + basic_machine=moxie-unknown + os=-moxiebox + ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) - basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + basic_machine=`echo "$basic_machine" | sed -e 's/ms1-/mt-/'` ;; msys) - basic_machine=i386-pc + basic_machine=i686-pc os=-msys ;; mvs) @@ -867,7 +895,7 @@ case $basic_machine in basic_machine=v70-nec os=-sysv ;; - next | m*-next ) + next | m*-next) basic_machine=m68k-next case $os in -nextstep* ) @@ -912,6 +940,12 @@ case $basic_machine in nsr-tandem) basic_machine=nsr-tandem ;; + nsv-tandem) + basic_machine=nsv-tandem + ;; + nsx-tandem) + basic_machine=nsx-tandem + ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf @@ -944,7 +978,7 @@ case $basic_machine in os=-linux ;; parisc-*) - basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=hppa-`echo "$basic_machine" | sed 's/^[^-]*-//'` os=-linux ;; pbd) @@ -960,7 +994,7 @@ case $basic_machine in basic_machine=i386-pc ;; pc98-*) - basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=i386-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc @@ -975,16 +1009,16 @@ case $basic_machine in basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) - basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=i586-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentium4-*) - basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=i786-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould @@ -994,23 +1028,23 @@ case $basic_machine in ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) - basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; - ppcle | powerpclittle | ppc-le | powerpc-little) + ppcle | powerpclittle) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) - basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=powerpcle-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; - ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ppc64-*) basic_machine=powerpc64-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; - ppc64le | powerpc64little | ppc64-le | powerpc64-little) + ppc64le | powerpc64little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) - basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=powerpc64le-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm @@ -1019,7 +1053,11 @@ case $basic_machine in basic_machine=i586-unknown os=-pw32 ;; - rdos) + rdos | rdos64) + basic_machine=x86_64-pc + os=-rdos + ;; + rdos32) basic_machine=i386-pc os=-rdos ;; @@ -1060,17 +1098,10 @@ case $basic_machine in 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) + simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; @@ -1089,7 +1120,7 @@ case $basic_machine in os=-sysv4 ;; strongarm-* | thumb-*) - basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=arm-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun @@ -1211,6 +1242,9 @@ case $basic_machine in basic_machine=hppa1.1-winbond os=-proelf ;; + x64) + basic_machine=x86_64-pc + ;; xbox) basic_machine=i686-pc os=-mingw32 @@ -1219,20 +1253,12 @@ case $basic_machine in basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) - basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` + 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 @@ -1261,10 +1287,6 @@ case $basic_machine in 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 ;; @@ -1274,9 +1296,6 @@ case $basic_machine in 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 ;; @@ -1296,7 +1315,7 @@ case $basic_machine in # Make sure to match an already-canonicalized machine name. ;; *) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2 exit 1 ;; esac @@ -1304,10 +1323,10 @@ esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) - basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + basic_machine=`echo "$basic_machine" | sed 's/digital.*/dec/'` ;; *-commodore*) - basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + basic_machine=`echo "$basic_machine" | sed 's/commodore.*/cbm/'` ;; *) ;; @@ -1318,8 +1337,8 @@ esac if [ x"$os" != x"" ] then case $os in - # First match some system type aliases - # that might get confused with valid system types. + # 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 @@ -1330,45 +1349,48 @@ case $os in -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. + # es1800 is here to avoid being matched by es* (a different OS) + -es1800*) + os=-ose + ;; + # Now accept the basic system types. # The portable systems comes first. - # Each alternative MUST END IN A *, to match a version number. + # 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* \ + | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* | -aros* \ + | -aos* | -aros* | -cloudabi* | -sortix* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ - | -openbsd* | -solidbsd* \ + | -hiux* | -knetbsd* | -mirbsd* | -netbsd* \ + | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \ | -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* \ + | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -linux-android* \ - | -linux-newlib* | -linux-uclibc* \ - | -uxpv* | -beos* | -mpeix* | -udk* \ - | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ + | -linux-newlib* | -linux-musl* | -linux-uclibc* \ + | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ - | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -morphos* | -superux* | -rtmk* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ + | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -bme* \ + | -midnightbsd*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) @@ -1385,12 +1407,12 @@ case $os in -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; - -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ - | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ + -sim | -xray | -os68k* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) - os=`echo $os | sed -e 's|mac|macos|'` + os=`echo "$os" | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc @@ -1399,10 +1421,10 @@ case $os in os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) - os=`echo $os | sed -e 's|sunos5|solaris2|'` + os=`echo "$os" | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) - os=`echo $os | sed -e 's|sunos6|solaris3|'` + os=`echo "$os" | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition @@ -1413,12 +1435,6 @@ case $os in -wince*) os=-wince ;; - -osfrose*) - os=-osfrose - ;; - -osf*) - os=-osf - ;; -utek*) os=-bsd ;; @@ -1443,7 +1459,7 @@ case $os in -nova*) os=-rtmk-nova ;; - -ns2 ) + -ns2) os=-nextstep2 ;; -nsk*) @@ -1465,7 +1481,7 @@ case $os in -oss*) os=-sysv3 ;; - -svr4) + -svr4*) os=-sysv4 ;; -svr3) @@ -1480,35 +1496,38 @@ case $os in -ose*) os=-ose ;; - -es1800*) - os=-ose - ;; - -xenix) - os=-xenix - ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; - -aros*) - os=-aros - ;; - -kaos*) - os=-kaos - ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; + -pikeos*) + # Until real need of OS specific support for + # particular features comes up, bare metal + # configurations are quite functional. + case $basic_machine in + arm*) + os=-eabi + ;; + *) + os=-elf + ;; + esac + ;; -nacl*) ;; + -ios) + ;; -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 + echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2 exit 1 ;; esac @@ -1543,6 +1562,9 @@ case $basic_machine in c4x-* | tic4x-*) os=-coff ;; + c8051-*) + os=-elf + ;; hexagon-*) os=-elf ;; @@ -1595,12 +1617,12 @@ case $basic_machine in sparc-* | *-sun) os=-sunos4.1.1 ;; + pru-*) + os=-elf + ;; *-be) os=-beos ;; - *-haiku) - os=-haiku - ;; *-ibm) os=-aix ;; @@ -1640,7 +1662,7 @@ case $basic_machine in m88k-omron*) os=-luna ;; - *-next ) + *-next) os=-nextstep ;; *-sequent) @@ -1655,9 +1677,6 @@ case $basic_machine in i370-*) os=-mvs ;; - *-next) - os=-nextstep3 - ;; *-gould) os=-sysv ;; @@ -1767,15 +1786,15 @@ case $basic_machine in vendor=stratus ;; esac - basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + basic_machine=`echo "$basic_machine" | sed "s/unknown/$vendor/"` ;; esac -echo $basic_machine$os +echo "$basic_machine$os" exit # Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'write-file-functions 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" diff --git a/tool/autoconf/build-aux/install-sh b/tool/autoconf/build-aux/install-sh old mode 100644 new mode 100755 index 377bb8687f..ec298b5374 --- a/tool/autoconf/build-aux/install-sh +++ b/tool/autoconf/build-aux/install-sh @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2011-11-20.07; # UTC +scriptversion=2020-11-14.01; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -41,19 +41,15 @@ scriptversion=2011-11-20.07; # UTC # This script is compatible with the BSD install script, but was written # from scratch. +tab=' ' nl=' ' -IFS=" "" $nl" +IFS=" $tab$nl" -# set DOITPROG to echo to test this script +# 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 +doit_exec=${doit:-exec} # Put in absolute file names if you don't have them in your path; # or use environment vars. @@ -68,22 +64,16 @@ 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 +# Create dirs (including intermediate dirs) using mode 755. +# This is like GNU 'install' as of coreutils 8.32 (2020). +mkdir_umask=22 + +backupsuffix= chgrpcmd= chmodcmd=$chmodprog chowncmd= @@ -97,7 +87,7 @@ dir_arg= dst_arg= copy_on_change=false -no_target_directory= +is_target_a_directory=possibly usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE @@ -114,18 +104,28 @@ Options: --version display version info and exit. -c (ignored) - -C install only if different (preserve the last data modification time) + -C install only if different (preserve 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. + -p pass -p to $cpprog. -s $stripprog installed files. + -S SUFFIX attempt to back up existing files, with suffix SUFFIX. -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 + +By default, rm is invoked with -f; when overridden with RMPROG, +it's up to you to specify -f if you want it. + +If -S is not specified, no backups are attempted. + +Email bug reports to bug-automake@gnu.org. +Automake home page: https://www.gnu.org/software/automake/ " while test $# -ne 0; do @@ -137,46 +137,62 @@ while test $# -ne 0; do -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" - shift;; + shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 - case $mode in - *' '* | *' '* | *' -'* | *'*'* | *'?'* | *'['*) - echo "$0: invalid mode: $mode" >&2 - exit 1;; - esac - shift;; + case $mode in + *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; -o) chowncmd="$chownprog $2" - shift;; + shift;; + + -p) cpprog="$cpprog -p";; -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;; + -S) backupsuffix="$2" + shift;; - -T) no_target_directory=true;; + -t) + is_target_a_directory=always + dst_arg=$2 + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + shift;; + + -T) is_target_a_directory=never;; --version) echo "$0 $scriptversion"; exit $?;; - --) shift - break;; + --) shift + break;; - -*) echo "$0: invalid option: $1" >&2 - exit 1;; + -*) echo "$0: invalid option: $1" >&2 + exit 1;; *) break;; esac shift done +# We allow the use of options -d and -T together, by making -d +# take the precedence; this is for compatibility with GNU install. + +if test -n "$dir_arg"; then + if test -n "$dst_arg"; then + echo "$0: target directory not allowed when installing a directory." >&2 + exit 1 + fi +fi + 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. @@ -207,6 +223,15 @@ if test $# -eq 0; then exit 0 fi +if test -z "$dir_arg"; then + if test $# -gt 1 || test "$is_target_a_directory" = always; then + if test ! -d "$dst_arg"; then + echo "$0: $dst_arg: Is not a directory." >&2 + exit 1 + fi + fi +fi + if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 @@ -223,16 +248,16 @@ if test -z "$dir_arg"; then *[0-7]) if test -z "$stripcmd"; then - u_plus_rw= + u_plus_rw= else - u_plus_rw='% 200' + u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then - u_plus_rw= + u_plus_rw= else - u_plus_rw=,u+rw + u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac @@ -250,6 +275,10 @@ do dstdir=$dst test -d "$dstdir" dstdir_status=$? + # Don't chown directories that already exist. + if test $dstdir_status = 0; then + chowncmd="" + fi else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command @@ -266,178 +295,148 @@ do fi dst=$dst_arg - # If destination is a directory, append the input filename; won't work - # if double slashes aren't ignored. + # If destination is a directory, append the input filename. if test -d "$dst"; then - if test -n "$no_target_directory"; then - echo "$0: $dst_arg: Is a directory" >&2 - exit 1 + if test "$is_target_a_directory" = never; then + echo "$0: $dst_arg: Is a directory" >&2 + exit 1 fi dstdir=$dst - dst=$dstdir/`basename "$src"` + dstbase=`basename "$src"` + case $dst in + */) dst=$dst$dstbase;; + *) dst=$dst/$dstbase;; + esac 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' - ` - + dstdir=`dirname "$dst"` test -d "$dstdir" dstdir_status=$? fi fi + case $dstdir in + */) dstdirslash=$dstdir;; + *) dstdirslash=$dstdir/;; + esac + 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 + # 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 + # The $RANDOM variable is not portable (e.g., dash). Use it + # here however when possible just to lower collision chance. + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + + trap ' + ret=$? + rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null + exit $ret + ' 0 + + # Because "mkdir -p" follows existing symlinks and we likely work + # directly in world-writeable /tmp, make sure that the '$tmpdir' + # directory is successfully created first before we actually test + # 'mkdir -p'. + if (umask $mkdir_umask && + $mkdirprog $mkdir_mode "$tmpdir" && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/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. + test_tmpdir="$tmpdir/a" + ls_ld_tmpdir=`ls -ld "$test_tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" else - mkdir_mode= + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null 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;; + trap '' 0;; esac if $posix_mkdir && ( - umask $mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else - # The umask is ridiculous, or mkdir does not conform to POSIX, + # 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='';; + /*) prefix='/';; + [-=\(\)!]*) prefix='./';; + *) prefix='';; esac - eval "$initialize_posix_glob" - oIFS=$IFS IFS=/ - $posix_glob set -f + set -f set fnord $dstdir shift - $posix_glob set +f + 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/ + 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 + # 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 @@ -450,14 +449,25 @@ do else # Make a couple of temp file names in the proper directory. - dsttmp=$dstdir/_inst.$$_ - rmtmp=$dstdir/_rm.$$_ + dsttmp=${dstdirslash}_inst.$$_ + rmtmp=${dstdirslash}_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") && + (umask $cp_umask && + { test -z "$stripcmd" || { + # Create $dsttmp read-write so that cp doesn't create it read-only, + # which would cause strip to fail. + if test -z "$doit"; then + : >"$dsttmp" # No need to fork-exec 'touch'. + else + $doit touch "$dsttmp" + fi + } + } && + $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # @@ -472,20 +482,24 @@ do # 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 && + old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && + new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && + set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && - $posix_glob set +f && - + set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else + # If $backupsuffix is set, and the file being installed + # already exists, attempt a backup. Don't worry if it fails, + # e.g., if mv doesn't support -f. + if test -n "$backupsuffix" && test -f "$dst"; then + $doit $mvcmd -f "$dst" "$dst$backupsuffix" 2>/dev/null + fi + # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || @@ -493,24 +507,24 @@ do # 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" + # 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 "$dst" 2>/dev/null || + { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && + { $doit $rmcmd "$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 @@ -519,9 +533,9 @@ do done # Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: From 6379e6e4da1c3f9a1e768b8a4c8115930464c6e2 Mon Sep 17 00:00:00 2001 From: Richard Brooksby Date: Tue, 7 Feb 2023 08:31:03 +0000 Subject: [PATCH 05/43] Match "arm" for XCA6LL since that's what's produced by autoconf scripts on Cirrus CI VMs . --- configure | 6 ++++-- configure.ac | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/configure b/configure index 55214c2df8..5f9d96d7d4 100755 --- a/configure +++ b/configure @@ -3693,8 +3693,10 @@ printf "%s\n" "Linux x86_64" >&6; } MPS_BUILD_NAME=ll PFMCFLAGS="$CFLAGS_LL" ;; - # FIXME: Cirrus CI build machines produce arm64 not aarch64. Investigate. - aarch64-*-darwin*/*|arm64-*-darwin*/*) + # FIXME: Cirrus CI build machines produce "arm64" from `cc + # -dumpmachine` but tools/autoconf/build-aux/config.sub produces + # "arm". Neither produces "aarch64". Investigate. + aarch64-*-darwin*/*|arm*-*-darwin*/*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Mac OS X ARM64" >&5 printf "%s\n" "Mac OS X ARM64" >&6; } MPS_OS_NAME=xc diff --git a/configure.ac b/configure.ac index 225d7a35fd..6ced7c4774 100644 --- a/configure.ac +++ b/configure.ac @@ -80,8 +80,10 @@ case $host/$CLANG in MPS_BUILD_NAME=ll PFMCFLAGS="$CFLAGS_LL" ;; - # FIXME: Cirrus CI build machines produce arm64 not aarch64. Investigate. - aarch64-*-darwin*/*|arm64-*-darwin*/*) + # FIXME: Cirrus CI build machines produce "arm64" from `cc + # -dumpmachine` but tools/autoconf/build-aux/config.sub produces + # "arm". Neither produces "aarch64". Investigate. + aarch64-*-darwin*/*|arm*-*-darwin*/*) AC_MSG_RESULT([Mac OS X ARM64]) MPS_OS_NAME=xc MPS_ARCH_NAME=a6 From 2f359b45bc7c38dfda75fb624f8ebd5a1862d633 Mon Sep 17 00:00:00 2001 From: Richard Brooksby Date: Tue, 7 Feb 2023 17:48:45 +0000 Subject: [PATCH 06/43] Refining Cirrus CI configuration based on better understanding of what it's doing. --- .cirrus.yml | 37 +++++++++++++++++++++++++++++-------- 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 591d7c9e5e..4d677083b3 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -5,7 +5,7 @@ XCA6LL_task: macos_instance: # What does this syntax mean? - image: ghcr.io/cirruslabs/macos-ventura-xcode:latest + image: ghcr.io/cirruslabs/macos-ventura-xcode script: - uname -a - cc --version @@ -13,25 +13,46 @@ XCA6LL_task: - ./configure --prefix=$PWD/prefix && make install && make test # https://cirrus-ci.org/guide/writing-tasks/ doesn't seem to allow for FreeBSD on arm64 + FRI6LL_task: freebsd_instance: # Why is this a "family"? image_family: freebsd-13-1 - # Which compiler will this end up with by default? + # Which compiler will this end up with by default? Clang. script: - uname -a + - pkg install -y gmake - cc --version - cc -dumpmachine - - pkg install -y gmake - - ./configure --prefix=$PWD/prefix && make install && make test + - ./configure --prefix=$PWD/prefix-clang && make install && make test + +FRI6GC_task: + freebsd_instance: + # Why is this a "family"? + image_family: freebsd-13-1 + script: + - uname -a + - pkg install -y gmake gcc + - gcc --version + - gcc -dumpmachine + - CC=gcc ./configure --prefix=$PWD/prefix-gcc && make install && make test -LIA6_task: +# Is this really "LI" if it's a docker container? Does it matter? +LIA6GC_task: arm_container: - matrix: - - image: clang:latest - - image: gcc:latest + image: gcc # https://hub.docker.com/_/gcc script: - uname -a - cc --version - cc -dumpmachine - ./configure --prefix=$PWD/prefix && make install && make test + +LIA6LL_task: + arm_container: + image: ubuntu # https://hub.docker.com/_/ubuntu + script: + - uname -a + - apt-get install -y clang + - clang --version + - clang -dumpmachine + - CC=clang ./configure --prefix=$PWD/prefix && make install && make test From 7f54c3468a1c4d60b51a256c4d1db31478b72f2f Mon Sep 17 00:00:00 2001 From: Richard Brooksby Date: Wed, 8 Feb 2023 16:00:20 +0000 Subject: [PATCH 07/43] Attempt to specify architecture for FreeBSD. Attempt to find out why clang isn't available. Attempt to explicitly specify clang. --- .cirrus.yml | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 4d677083b3..6b130ebcf8 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -4,7 +4,7 @@ XCA6LL_task: macos_instance: - # What does this syntax mean? + # What does this syntax mean? See . image: ghcr.io/cirruslabs/macos-ventura-xcode script: - uname -a @@ -16,9 +16,19 @@ XCA6LL_task: FRI6LL_task: freebsd_instance: - # Why is this a "family"? + # Why is this a "family"? See . image_family: freebsd-13-1 - # Which compiler will this end up with by default? Clang. + script: + - uname -a + - pkg install -y gmake + - clang --version + - clang -dumpmachine + - CC=clang ./configure --prefix=$PWD/prefix-clang && make install && make test + +FRA6LL_task: + freebsd_instance: + image_family: freebsd-13-1 + architecture: arm64 script: - uname -a - pkg install -y gmake @@ -28,7 +38,6 @@ FRI6LL_task: FRI6GC_task: freebsd_instance: - # Why is this a "family"? image_family: freebsd-13-1 script: - uname -a @@ -52,6 +61,8 @@ LIA6LL_task: image: ubuntu # https://hub.docker.com/_/ubuntu script: - uname -a + - apt-get update + - apt search clang - apt-get install -y clang - clang --version - clang -dumpmachine From 0a2191754273f37b26b02aae04640cdd54e3bbae Mon Sep 17 00:00:00 2001 From: Richard Brooksby Date: Wed, 8 Feb 2023 16:26:34 +0000 Subject: [PATCH 08/43] Suppress uninitialized warning on platforms where VMParamFromArgs does nothing. Discovered by GCC 12.2.0. --- code/arenavm.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/code/arenavm.c b/code/arenavm.c index fbd523eb96..3843021fe7 100644 --- a/code/arenavm.c +++ b/code/arenavm.c @@ -609,6 +609,10 @@ static Res VMArenaCreate(Arena *arenaReturn, ArgList args) zones. Make it easier to write portable programs by rounding up. */ size = grainSize * MPS_WORD_WIDTH; + /* Suppress uninitialized warning on platforms where VMParamFromArgs + does nothing. Discovered by GCC 12.2.0. */ + mps_lib_memset(vmParams, 0, sizeof(vmParams)); + /* Parse remaining arguments, if any, into VM parameters. We must do this into some stack-allocated memory for the moment, since we don't have anywhere else to put it. It gets copied later. */ From 17e500cfab0ad551b3ef913b2e6f3619c67cbb03 Mon Sep 17 00:00:00 2001 From: Richard Brooksby Date: Wed, 8 Feb 2023 16:42:41 +0000 Subject: [PATCH 09/43] Lifting compiler dimension out of scripts. --- .cirrus.yml | 64 +++++++++++++++++++++++++++++------------------------ 1 file changed, 35 insertions(+), 29 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 6b130ebcf8..9238a54ca2 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -18,33 +18,39 @@ FRI6LL_task: freebsd_instance: # Why is this a "family"? See . image_family: freebsd-13-1 - script: - - uname -a - - pkg install -y gmake - - clang --version - - clang -dumpmachine - - CC=clang ./configure --prefix=$PWD/prefix-clang && make install && make test + script: | + CC=clang + uname -a + pkg install -y gmake $CC + $CC --version + $CC -dumpmachine + CC=$CC ./configure --prefix=$PWD/prefix-clang && make install && make test + +# FRA6LL doesn't seem to work. Cirrus CI gets an "Agent is not +# responding!" error on its status page. FRA6LL_task: freebsd_instance: image_family: freebsd-13-1 architecture: arm64 - script: - - uname -a - - pkg install -y gmake - - cc --version - - cc -dumpmachine - - ./configure --prefix=$PWD/prefix-clang && make install && make test + script: | + CC=clang + uname -a + pkg install -y gmake $CC + $CC --version + $CC -dumpmachine + CC=$CC ./configure --prefix=$PWD/prefix-clang && make install && make test FRI6GC_task: freebsd_instance: image_family: freebsd-13-1 - script: - - uname -a - - pkg install -y gmake gcc - - gcc --version - - gcc -dumpmachine - - CC=gcc ./configure --prefix=$PWD/prefix-gcc && make install && make test + script: | + CC=gcc + uname -a + pkg install -y gmake $CC + $CC --version + $CC -dumpmachine + CC=$CC ./configure --prefix=$PWD/prefix-clang && make install && make test # Is this really "LI" if it's a docker container? Does it matter? LIA6GC_task: @@ -52,18 +58,18 @@ LIA6GC_task: image: gcc # https://hub.docker.com/_/gcc script: - uname -a - - cc --version - - cc -dumpmachine - - ./configure --prefix=$PWD/prefix && make install && make test + - gcc --version + - gcc -dumpmachine + - CC=gcc ./configure --prefix=$PWD/prefix && make install && make test LIA6LL_task: arm_container: image: ubuntu # https://hub.docker.com/_/ubuntu - script: - - uname -a - - apt-get update - - apt search clang - - apt-get install -y clang - - clang --version - - clang -dumpmachine - - CC=clang ./configure --prefix=$PWD/prefix && make install && make test + script: | + CC=clang + uname -a + apt-get update + apt-get install -y gmake $CC + $CC --version + $CC -dumpmachine + CC=$CC ./configure --prefix=$PWD/prefix && make install && make test From 2c482a78a4792389077c490386d504afb55f6d8e Mon Sep 17 00:00:00 2001 From: Richard Brooksby Date: Wed, 8 Feb 2023 16:58:48 +0000 Subject: [PATCH 10/43] Package names on Linux and FreeBSD aren't as orthogonal as I hoped. --- .cirrus.yml | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 9238a54ca2..e3c94fa6e5 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -1,5 +1,7 @@ # .cirrus.yml -- Cirrus CI configuration for the MPS +# FIXME: Specify versions of OS and toolchains. Source? + # FIXME: Just a test based on https://cirrus-ci.org/guide/macOS/ XCA6LL_task: @@ -19,9 +21,10 @@ FRI6LL_task: # Why is this a "family"? See . image_family: freebsd-13-1 script: | + set -x CC=clang uname -a - pkg install -y gmake $CC + pkg install -y gmake $CC --version $CC -dumpmachine CC=$CC ./configure --prefix=$PWD/prefix-clang && make install && make test @@ -34,9 +37,10 @@ FRA6LL_task: image_family: freebsd-13-1 architecture: arm64 script: | + set -x CC=clang uname -a - pkg install -y gmake $CC + pkg install -y gmake $CC --version $CC -dumpmachine CC=$CC ./configure --prefix=$PWD/prefix-clang && make install && make test @@ -45,31 +49,35 @@ FRI6GC_task: freebsd_instance: image_family: freebsd-13-1 script: | + set -x CC=gcc uname -a - pkg install -y gmake $CC + pkg install -y gmake gcc $CC --version $CC -dumpmachine CC=$CC ./configure --prefix=$PWD/prefix-clang && make install && make test # Is this really "LI" if it's a docker container? Does it matter? +# Is gcc:latest what we want to test against? LIA6GC_task: arm_container: image: gcc # https://hub.docker.com/_/gcc - script: - - uname -a - - gcc --version - - gcc -dumpmachine - - CC=gcc ./configure --prefix=$PWD/prefix && make install && make test + script: | + set -x + uname -a + $CC --version + $CC -dumpmachine + CC=$CC ./configure --prefix=$PWD/prefix && make install && make test LIA6LL_task: arm_container: image: ubuntu # https://hub.docker.com/_/ubuntu script: | + set -x CC=clang uname -a apt-get update - apt-get install -y gmake $CC + apt-get install -y make clang $CC --version $CC -dumpmachine CC=$CC ./configure --prefix=$PWD/prefix && make install && make test From 42a97e8ab1273cf7cddeed19601a385ef8995163 Mon Sep 17 00:00:00 2001 From: Richard Brooksby Date: Wed, 8 Feb 2023 21:01:43 +0000 Subject: [PATCH 11/43] Moving LIA6* and FRI6* to Cirrus CI from Travis CI where they won't consume credits. --- .cirrus.yml | 34 ++++++++++++++++++++++------------ .travis.yml | 29 ++++++----------------------- 2 files changed, 28 insertions(+), 35 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index e3c94fa6e5..76a9d57bb4 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -1,5 +1,7 @@ # .cirrus.yml -- Cirrus CI configuration for the MPS +# FIXME: Copyright, licence, etc. + # FIXME: Specify versions of OS and toolchains. Source? # FIXME: Just a test based on https://cirrus-ci.org/guide/macOS/ @@ -31,19 +33,25 @@ FRI6LL_task: # FRA6LL doesn't seem to work. Cirrus CI gets an "Agent is not # responding!" error on its status page. +# +# There's no output from:: +# +# gcloud compute images list --project freebsd-org-cloud-dev --no-standard-images | grep -v amd64 +# +# Fortunately, we can do this using Travis CI. See .travis.yml. -FRA6LL_task: - freebsd_instance: - image_family: freebsd-13-1 - architecture: arm64 - script: | - set -x - CC=clang - uname -a - pkg install -y gmake - $CC --version - $CC -dumpmachine - CC=$CC ./configure --prefix=$PWD/prefix-clang && make install && make test +# FRA6LL_task: +# freebsd_instance: +# image_family: freebsd-13-1 +# architecture: arm64 +# script: | +# set -x +# CC=clang +# uname -a +# pkg install -y gmake +# $CC --version +# $CC -dumpmachine +# CC=$CC ./configure --prefix=$PWD/prefix-clang && make install && make test FRI6GC_task: freebsd_instance: @@ -59,11 +67,13 @@ FRI6GC_task: # Is this really "LI" if it's a docker container? Does it matter? # Is gcc:latest what we want to test against? +# Perhaps we should start with an ubuntu image. LIA6GC_task: arm_container: image: gcc # https://hub.docker.com/_/gcc script: | set -x + CC=gcc uname -a $CC --version $CC -dumpmachine diff --git a/.travis.yml b/.travis.yml index 3a9d340e5a..baaed86dd8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,10 +19,15 @@ language: c # see . # # Most x86_64/amd64 builds are in GitHub CI, configured by # .github/workflows/build-and-test.yml. +# +# FreeBSD on x86_64 builds are in Cirrus CI, configured by +# .cirrus.yml. +# +# FIXME: The above information should appear once somewhere and be +# referenced from here. os: - freebsd - - linux arch: - arm64 compiler: @@ -32,28 +37,6 @@ compiler: script: # see design.mps.test.ci.run.posix - ./configure --prefix=$PWD/prefix && make install && make test -matrix: - - # Extra build jobs to add to the matrix - include: - - # GitHub CI does not provide FreeBSD - # - # on any architecture, so we add it here for amd64. See also - # design.mps.tests.ci.travis.platforms. - - - os: freebsd - arch: amd64 - compiler: clang - - os: freebsd - arch: amd64 - compiler: gcc - - # Specific combinations to exclude from the matrix - exclude: - - os: osx - compiler: gcc - notifications: email: - mps-travis@ravenbrook.com From 86e3275435c3624d33a09d072c085421a8b1c297 Mon Sep 17 00:00:00 2001 From: Richard Brooksby Date: Thu, 9 Feb 2023 02:06:03 +0000 Subject: [PATCH 12/43] Splitting design.mps.ci from design.mps.tests and noting items for inclusion. --- design/ci.txt | 293 +++++++++++++++++++++++++++++++++ design/index.txt | 5 + design/tests.txt | 136 ++------------- manual/source/design/index.rst | 3 + manual/source/design/old.rst | 2 + 5 files changed, 317 insertions(+), 122 deletions(-) create mode 100644 design/ci.txt diff --git a/design/ci.txt b/design/ci.txt new file mode 100644 index 0000000000..12c5af2d9f --- /dev/null +++ b/design/ci.txt @@ -0,0 +1,293 @@ +.. mode: -*- rst -*- + +====================== +Continuous Integration +====================== + +:Tag: design.mps.ci +:Author: Richard Brooksby +:Organization: Ravenbrook Limited +:Date: 2023-02-09 +:Confidentiality: public +:Copyright: See `Copyright and License`_. +:Readership: MPS developers +:Index terms: pair: continuous integration; design + +.. TODO: more index terms? + +.. TODO: Readership could be a role that doesn't include MPS programmers. + + +Introduction +============ + +_`.intro`: This document describes the design and implementation of +`continuous integration +`_ of the Memory +Pool System. + + +Goals +===== + +[For inclusion: + +- Provide rapid feedback to developers. +- Cover a wide array of target platforms. +- Early detection of defects. +- Deployment of documentation. + +RB 2023-02-09] + + +Requirements +============ + +[For inclusion: + +- Cover all "supported" target platforms. +- Zero monetary cost. +- Low maintenance overheads. +- Easy to extend with improvements and prevention. +- Easy to switch providers. +- Include all tests. +- Portable outside GitHub. +- Administration by more than one person. + +RB 2023-02-09] + + +Design +====== + +[For inclusion: + +- the testci make target +- third-party systems used +- relationship to review +- relationship to merge +- configuration files +- tool scripts +- how to extend +- KISS +- forks +- 32-bit? + +RB 2023-02-09] + + +Implementation +============== + +Services +-------- + +_`.service`: The `Ravenbrook MPS repository on GitHub`_ uses +third-party continuous integration services. + +[Should be a table cross-referenced to the build instructions. RB +2023-02-09] + +- _`.service.github`: `GitHub CI`_ is used to `.build`_ and `.test`_ + on Linux, macOS, and Windows on amd64 platforms (LII6GC, LII6LL, + XCI6LL, W3I6MV). `GitHub CI`_ is also used to run checks + (`.run.other.checks`_). `GitHub CI`_ only provides amd64 and does + not provide FreeBSD. + +- _`.service.cirrus`: `Cirrus CI`_ is used to `.build`_ and `.test`_ + on macOS M1 (XCA6LL), Linux on arm64 (LIA6GC, LIA6LL), and FreeBSD + on amd64 (FRI6GC, FRI6LL). `Cirrus CI`_ runs OS images on Google + Cloud Services by default, and no FreeBSD on arm64 image is + available. + +- _`.service.travis`: `Travis CI`_ is used to `.build`_ and `.test`_ + on FreeBSD on arm64 (FRA6GC, FRA6LL). + +- _`.service.readthedocs`: `Read the Docs`_ is used to `.build`_ and + `.publish`_ the `MPS manual`_. + +.. _GitHub CI: https://docs.github.com/en/actions/automating-builds-and-tests/about-continuous-integration + +.. _Cirrus CI: https://cirrus-ci.com/ + +.. _Travis CI: https://travis-ci.com/ + +.. _Read the Docs: https://readthedocs.org/ + +_`.service.choice`: Favour the services higher up this list when +making changes. [Why? Cost. Stability. RB 2023-02-09] + +[To include: + +_`.build`: translates correctly without errors or warnings + +- _`.build.code`: ``make -C code`` +- _`.build.manual`: ``make -C manual html`` + +_`.test`: runs correctly + +- ``make test`` etc. + +_`.publish`: is made available to the public + +- Appears at https://memory-pool-system.readthedocs.io/ +- Published versions +- Branches and pull requests + +RB 2023-02-09] + +[To include: service configuration and admin. RB 2023-02-09] + +[This section needs: definition of CI goals and requirements, what we +need CI to do and why, how the testci target meets those +requirements. 'taint really a design without this. Mention how CI +supports the pull request merge procedure (except that exists on a +separate branch at the moment). RB 2023-01-15] + +[Need to discuss compilers and toolchains. RB 2023-01-15] + +_`.run.posix`: On Posix systems where we have autoconf, the CI +services run commands equivalent to:: + + ./configure + make install + make test + +which execises the testci target, as defined by `Makefile.in +<../Makefile.in>`_ in the root of the MPS tree. + +_`.run.windows`: On Windows the CI services run commands that do at +least:: + + make /f w3i6mv.nmk all testci + +as defined by the `.github.config`_. + +_`.run.other.targets`: On some platforms we arrange to run the testansi, +testpollnone, testratio, and testscheme targets. [Need to explain +why, where, etc. RB 2023-01-15] + +_`.run.other.checks`: We could also run various non-build checks +using CI to check: + +- document formatting +- shell script syntax + +[In the branch of writing, these do not yet exist. They are the +subject of `GitHub pull request #113 +`_ of +branch/2023-01-13/rst-check. When merged, they can be linked. RB +2023-01-15] + +_`.when:`: CI is triggered on the `mps GitHub repo`_ by: + +- commits (pushes) +- new pull requests +- manually, using tools (see `.tools`_) + +.. _mps GitHub repo: https://github.com/ravenbrook/mps + +_`.results`: CI results are visible via the GitHub web interface: + +- in pull requests, under "Checks", + +- on the `branches page `_ + as green ticks or red crosses that link to details. + +as well as in logs specific to the type of CI. + +_`.results.travis`: Results from Travis CI can be found at the +`Travis CI build history for the MPS GitHub repo +`_. + +_`.results.github`: Results from GitHub CI can be found at `build +and test actions on the Actions tab at the Ravenbrook GitHub repo +`_. + +_`.github`: [Insert overview of GitHub CI here. RB 2023-01-15] + +_`.github.platforms`: GitHub provides runners_ for Linux, Windows, +and macOS, but only on x86_64. See `.travis.platforms`_ for ARM64 +and FreeBSD. + +.. _runners: https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources + +_`.github.config`: GitHub CI is configured using the +`build-and-test.yml <../.github/workflows/build-and-test.yml>`_ file +in the .github/workflows directory of the MPS tree. + +_`.travis`: [Insert overview of Travis CI here. RB 2023-01-15] + +_`.travis.platforms`: Where possible, we use `GitHub CI`_ for +platforms, because `Travis CI is slow and expensive`_. However +`GitHub CI`_ does not provide ARM64 or FreeBSD, so we use `Travis CI`_ +for those. + +.. _Travis CI is slow and expensive: https://github.com/Ravenbrook/mps/issues/109 + +_`.travis.config`: Travis is configured using the `.travis.yml +<../.travis.yml>`_ file at top level of the MPS tree. + +_`.tools`: The MPS tree contains some simple tools for managing CI +without the need to install whole packages such as the GitHub CLI or +Travis CI's Ruby gem. + +_`.tools.kick`: `tool/github-ci-kick <../tool/github-ci-kick>`_ and +`tool/travis-ci-kick <../tool/travis-ci-kick>`_ both trigger CI builds +without the need to push a change or make a pull request in the `mps +GitHub repo`_. In particular, they are useful for applying CI to work +that was pushed while CI was disabled, for whatever reason. + + + +References +---------- + +[To include: + +- CI system documentation + +RB 2023-02-09] + + +Document History +---------------- + +========== ===== ================================================== +2023-02-09 RB_ Split from design.mps.tests as part of GitHub + `pull request #145`_. +========== ===== ================================================== + +.. _RB: mailto:rb@ravenbrook.com +.. _pull request #145: https://github.com/Ravenbrook/mps/pull/145 + + +Copyright and License +--------------------- + +Copyright © 2013–2023 `Ravenbrook Limited `_. + +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. + +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. + +.. end diff --git a/design/index.txt b/design/index.txt index ab28baaa74..adb2e7bcfe 100644 --- a/design/index.txt +++ b/design/index.txt @@ -36,6 +36,9 @@ product. Designs ------- +.. IMPORTANT: Keep in sync with the contents trees at + manual/source/design/index.rst and manual/source/design/old.rst. + .. class:: index ====================== ================================================ @@ -49,6 +52,7 @@ bt_ Bit tables buffer_ Allocation buffers and allocation points cbs_ Coalescing block structures check_ Checking +ci_ Continuous integration clock_ Fast high-resolution clock collection_ Collection framework config_ MPS configuration @@ -126,6 +130,7 @@ writef_ The WriteF function .. _buffer: buffer .. _cbs: cbs .. _check: check +.. _ci: ci .. _clock: clock .. _collection: collection .. _config: config diff --git a/design/tests.txt b/design/tests.txt index 5342e3cd16..6c7b30e43f 100644 --- a/design/tests.txt +++ b/design/tests.txt @@ -58,9 +58,13 @@ This subset of tests are quick checks that the MPS is working. They run quickly enough for it to be practical to run them every time the MPS is built. -_`.target.testci`: The ``testci`` target runs the continuous -integration tests, the subset of tests that are expected to pass in -full-featured build configurations. +_`.target.testci`: The ``testci`` target runs the `continuous +integration`_ tests, the subset of tests that are expected to pass in +full-featured build configurations. See `design.mps.ci`_. + +.. _continuous integration: `design.mps.ci`_ + +.. _design.mps.ci: ci.txt _`.target.testansi`: The ``testansi`` target runs the subset of the tests that are expected to pass in the generic ("ANSI") build @@ -169,7 +173,7 @@ Test runner ----------- _`.runner.req.automated`: The test runner must execute without user -interaction, so that it can be used for continuous integration. +interaction, so that it can be used for `continuous integration`_. _`.runner.req.output.pass`: Test cases are expected to pass nearly all the time, and in these cases we almost never want to see the output, so @@ -180,8 +184,8 @@ test runner must preserve the output from the failing test, including the random seed (see `.randomize.seed`_), so that this can be analyzed and the test repeated. Moreover, it must print the output from the failing test, so that if the test is being run on a `continuous -integration`_ system (see `.ci`_), then the output of the failing -tests is included in the failure report. (See job003489_.) +integration`_ system, then the output of the +failing tests is included in the failure report. (See job003489_.) .. _job003489: https://www.ravenbrook.com/project/mps/issue/job003489/ @@ -200,8 +204,8 @@ testing that this falls under an acceptable limit. _`.ratio.cpu-time`: Note that we use the CPU time (reported by ``/usr/bin/time``) and not the elapsed time (as reported by the -benchmark) because we want to be able to run this test on continuous -integration machines that might be heavily loaded. +benchmark) because we want to be able to run this test on `continuous +integration`_ machines that might be heavily loaded. _`.ratio.platform`: This target is currently supported only on Unix platforms using GNU Makefiles. @@ -273,120 +277,6 @@ _`.new.manual`: Edit manual/source/code-index.rst and add the new test case to the "Automated test cases" section. -Continuous integration ----------------------- - -[This section might need to become a document in its own right. CI -has grown in importance and complexity. RB 2023-01-15] - -_`.ci`: Ravenbrook uses both `GitHub CI`_ and `Travis CI`_ for -continuous integration of the MPS via GitHub. - -.. _Travis CI: https://travis-ci.com/ - -.. _GitHub CI: https://docs.github.com/en/actions/automating-builds-and-tests/about-continuous-integration - -[This section needs: definition of CI goals and requirements, what we -need CI to do and why, how the testci target meets those -requirements. 'taint really a design without this. Mention how CI -supports the pull request merge procedure (except that exists on a -separate branch at the moment). RB 2023-01-15] - -[Need to discuss compilers and toolchains. RB 2023-01-15] - -_`.ci.run.posix`: On Posix systems where we have autoconf, the CI -services run commands equivalent to:: - - ./configure - make install - make test - -which execises the testci target, as defined by `Makefile.in -<../Makefile.in>`_ in the root of the MPS tree. - -_`.ci.run.windows`: On Windows the CI services run commands that do at -least:: - - make /f w3i6mv.nmk all testci - -as defined by the `.ci.github.config`_. - -_`.ci.run.other.targets`: On some platforms we arrange to run the testansi, -testpollnone, testratio, and testscheme targets. [Need to explain -why, where, etc. RB 2023-01-15] - -_`.ci.run.other.checks`: We could also run various non-build checks -using CI to check: - -- document formatting -- shell script syntax - -[In the branch of writing, these do not yet exist. They are the -subject of `GitHub pull request #113 -`_ of -branch/2023-01-13/rst-check. When merged, they can be linked. RB -2023-01-15] - -_`.ci.when:`: CI is triggered on the `mps GitHub repo`_ by: - -- commits (pushes) -- new pull requests -- manually, using tools (see `.ci.tools`_) - -.. _mps GitHub repo: https://github.com/ravenbrook/mps - -_`.ci.results`: CI results are visible via the GitHub web interface: - -- in pull requests, under "Checks", - -- on the `branches page `_ - as green ticks or red crosses that link to details. - -as well as in logs specific to the type of CI. - -_`.ci.results.travis`: Results from Travis CI can be found at the -`Travis CI build history for the MPS GitHub repo -`_. - -_`.ci.results.github`: Results from GitHub CI can be found at `build -and test actions on the Actions tab at the Ravenbrook GitHub repo -`_. - -_`.ci.github`: [Insert overview of GitHub CI here. RB 2023-01-15] - -_`.ci.github.platforms`: GitHub provides runners_ for Linux, Windows, -and macOS, but only on x86_64. See `.ci.travis.platforms`_ for ARM64 -and FreeBSD. - -.. _runners: https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources - -_`.ci.github.config`: GitHub CI is configured using the -`build-and-test.yml <../.github/workflows/build-and-test.yml>`_ file -in the .github/workflows directory of the MPS tree. - -_`.ci.travis`: [Insert overview of Travis CI here. RB 2023-01-15] - -_`.ci.travis.platforms`: Where possible, we use `GitHub CI`_ for -platforms, because `Travis CI is slow and expensive`_. However -`GitHub CI`_ does not provide ARM64 or FreeBSD, so we use `Travis CI`_ -for those. - -.. _Travis CI is slow and expensive: https://github.com/Ravenbrook/mps/issues/109 - -_`.ci.travis.config`: Travis is configured using the `.travis.yml -<../.travis.yml>`_ file at top level of the MPS tree. - -_`.ci.tools`: The MPS tree contains some simple tools for managing CI -without the need to install whole packages such as the GitHub CLI or -Travis CI's Ruby gem. - -_`.ci.tools.kick`: `tool/github-ci-kick <../tool/github-ci-kick>`_ and -`tool/travis-ci-kick <../tool/travis-ci-kick>`_ both trigger CI builds -without the need to push a change or make a pull request in the `mps -GitHub repo`_. In particular, they are useful for applying CI to work -that was pushed while CI was disabled, for whatever reason. - - MMQA tests ---------- @@ -443,6 +333,8 @@ Document History - 2023-01-15 RB_ Bringing CI section up to date with Travis configuration. Removing obsolete Jenkins info. Adding GitHub CI. +- 2023-02-09 RB_ Split CI into its own document: `design.mps.ci`_. + .. _RB: https://www.ravenbrook.com/consultants/rb/ .. _GDR: https://www.ravenbrook.com/consultants/gdr/ diff --git a/manual/source/design/index.rst b/manual/source/design/index.rst index 7e568a89d7..4f218ccf9e 100644 --- a/manual/source/design/index.rst +++ b/manual/source/design/index.rst @@ -3,6 +3,8 @@ Design ****** +.. IMPORTANT: Keep in sync with the index at design/index.txt. + .. toctree:: :numbered: @@ -10,6 +12,7 @@ Design an bootstrap cbs + ci clock config critical-path diff --git a/manual/source/design/old.rst b/manual/source/design/old.rst index 49893a8805..4a2dd9a51e 100644 --- a/manual/source/design/old.rst +++ b/manual/source/design/old.rst @@ -3,6 +3,8 @@ Old design ********** +.. IMPORTANT: Keep in sync with the index at design/index.txt. + .. warning:: Much of the documentation in this section is very old: some of it From 6dadde6addc40301eb1e77df9dab6c04bfe64d76 Mon Sep 17 00:00:00 2001 From: Richard Brooksby Date: Thu, 9 Feb 2023 09:06:14 +0000 Subject: [PATCH 13/43] Lifting environment variables as a step to reducing repetition. --- .cirrus.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 76a9d57bb4..23a0a66293 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -10,11 +10,12 @@ XCA6LL_task: macos_instance: # What does this syntax mean? See . image: ghcr.io/cirruslabs/macos-ventura-xcode + env.CC: cc script: - uname -a - - cc --version - - cc -dumpmachine - - ./configure --prefix=$PWD/prefix && make install && make test + - $CC --version + - $CC -dumpmachine + - CC=$CC ./configure --prefix=$PWD/prefix && make install && make test # https://cirrus-ci.org/guide/writing-tasks/ doesn't seem to allow for FreeBSD on arm64 @@ -22,9 +23,9 @@ FRI6LL_task: freebsd_instance: # Why is this a "family"? See . image_family: freebsd-13-1 + env.CC: clang script: | set -x - CC=clang uname -a pkg install -y gmake $CC --version @@ -56,9 +57,9 @@ FRI6LL_task: FRI6GC_task: freebsd_instance: image_family: freebsd-13-1 + env.CC: gcc script: | set -x - CC=gcc uname -a pkg install -y gmake gcc $CC --version @@ -71,9 +72,9 @@ FRI6GC_task: LIA6GC_task: arm_container: image: gcc # https://hub.docker.com/_/gcc + env.CC: gcc script: | set -x - CC=gcc uname -a $CC --version $CC -dumpmachine @@ -82,9 +83,9 @@ LIA6GC_task: LIA6LL_task: arm_container: image: ubuntu # https://hub.docker.com/_/ubuntu + env.CC: clang script: | set -x - CC=clang uname -a apt-get update apt-get install -y make clang From ddcb384b3b061a9f50e5e6d13602c378ec4bf9fd Mon Sep 17 00:00:00 2001 From: Richard Brooksby Date: Thu, 9 Feb 2023 09:11:23 +0000 Subject: [PATCH 14/43] Environment variables didn't seem to work. Testing with documentation example. --- .cirrus.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.cirrus.yml b/.cirrus.yml index 23a0a66293..1d1798d3c9 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -4,13 +4,21 @@ # FIXME: Specify versions of OS and toolchains. Source? +# FIXME: This is just a test based on . + +echo_task: + env: + FOO: Bar + echo_script: echo $FOO + # FIXME: Just a test based on https://cirrus-ci.org/guide/macOS/ XCA6LL_task: macos_instance: # What does this syntax mean? See . image: ghcr.io/cirruslabs/macos-ventura-xcode - env.CC: cc + env: + CC: cc script: - uname -a - $CC --version From fd32ff314fec102886291f96e7133271aff71558 Mon Sep 17 00:00:00 2001 From: Richard Brooksby Date: Thu, 9 Feb 2023 09:13:06 +0000 Subject: [PATCH 15/43] Documentation example doesn't work as shown. Adding container. --- .cirrus.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.cirrus.yml b/.cirrus.yml index 1d1798d3c9..951922bbb3 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -7,6 +7,8 @@ # FIXME: This is just a test based on . echo_task: + container: + image: ubuntu env: FOO: Bar echo_script: echo $FOO From 81f9e9c4e25f182d235796ecbb7e7d65af5b8a0f Mon Sep 17 00:00:00 2001 From: Richard Brooksby Date: Thu, 9 Feb 2023 09:22:31 +0000 Subject: [PATCH 16/43] Lifting common script parts into templates to reduce repetition. --- .cirrus.yml | 92 ++++++++++++++++++++--------------------------------- 1 file changed, 34 insertions(+), 58 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 951922bbb3..1b09af9926 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -4,16 +4,18 @@ # FIXME: Specify versions of OS and toolchains. Source? -# FIXME: This is just a test based on . +# Templates for inclusion in tasks. +# See . -echo_task: - container: - image: ubuntu - env: - FOO: Bar - echo_script: echo $FOO +init_script_template: &INIT_SCRIPT_TEMPLATE + init_script: + - uname -a -# FIXME: Just a test based on https://cirrus-ci.org/guide/macOS/ +build_script_template: &BUILD_SCRIPT_TEMPLATE + build_script: + - $CC --version + - $CC -dumpmachine + - CC=$CC ./configure --prefix=$PWD/prefix && make install && make test XCA6LL_task: macos_instance: @@ -21,11 +23,8 @@ XCA6LL_task: image: ghcr.io/cirruslabs/macos-ventura-xcode env: CC: cc - script: - - uname -a - - $CC --version - - $CC -dumpmachine - - CC=$CC ./configure --prefix=$PWD/prefix && make install && make test + << : *INIT_SCRIPT_TEMPLATE + << : *BUILD_SCRIPT_TEMPLATE # https://cirrus-ci.org/guide/writing-tasks/ doesn't seem to allow for FreeBSD on arm64 @@ -33,14 +32,11 @@ FRI6LL_task: freebsd_instance: # Why is this a "family"? See . image_family: freebsd-13-1 - env.CC: clang - script: | - set -x - uname -a - pkg install -y gmake - $CC --version - $CC -dumpmachine - CC=$CC ./configure --prefix=$PWD/prefix-clang && make install && make test + env: + CC: clang + << : *INIT_SCRIPT_TEMPLATE + install_script: pkg install -y gmake + << : *BUILD_SCRIPT_TEMPLATE # FRA6LL doesn't seem to work. Cirrus CI gets an "Agent is not # responding!" error on its status page. @@ -51,30 +47,15 @@ FRI6LL_task: # # Fortunately, we can do this using Travis CI. See .travis.yml. -# FRA6LL_task: -# freebsd_instance: -# image_family: freebsd-13-1 -# architecture: arm64 -# script: | -# set -x -# CC=clang -# uname -a -# pkg install -y gmake -# $CC --version -# $CC -dumpmachine -# CC=$CC ./configure --prefix=$PWD/prefix-clang && make install && make test - FRI6GC_task: freebsd_instance: image_family: freebsd-13-1 - env.CC: gcc - script: | - set -x - uname -a - pkg install -y gmake gcc - $CC --version - $CC -dumpmachine - CC=$CC ./configure --prefix=$PWD/prefix-clang && make install && make test + env: + CC: gcc + << : *INIT_SCRIPT_TEMPLATE + install_script: + - pkg install -y gmake gcc + << : *BUILD_SCRIPT_TEMPLATE # Is this really "LI" if it's a docker container? Does it matter? # Is gcc:latest what we want to test against? @@ -82,23 +63,18 @@ FRI6GC_task: LIA6GC_task: arm_container: image: gcc # https://hub.docker.com/_/gcc - env.CC: gcc - script: | - set -x - uname -a - $CC --version - $CC -dumpmachine - CC=$CC ./configure --prefix=$PWD/prefix && make install && make test + env: + CC: gcc + << : *INIT_SCRIPT_TEMPLATE + << : *BUILD_SCRIPT_TEMPLATE LIA6LL_task: arm_container: image: ubuntu # https://hub.docker.com/_/ubuntu - env.CC: clang - script: | - set -x - uname -a - apt-get update - apt-get install -y make clang - $CC --version - $CC -dumpmachine - CC=$CC ./configure --prefix=$PWD/prefix && make install && make test + env: + CC: clang + << : *INIT_SCRIPT_TEMPLATE + install_script: + - apt-get update + - apt-get install -y make clang + << : *BUILD_SCRIPT_TEMPLATE From 8c6c2e35348ee897d75c65c3972836be643f793d Mon Sep 17 00:00:00 2001 From: Richard Brooksby Date: Thu, 9 Feb 2023 09:38:32 +0000 Subject: [PATCH 17/43] Overriding clone script to try to apply CI to trial merge. --- .cirrus.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/.cirrus.yml b/.cirrus.yml index 1b09af9926..a419c2e8e8 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -7,6 +7,9 @@ # Templates for inclusion in tasks. # See . +# Cirrus CI doesn't include detailed machine configuration information +# in its output, so include commands here to gather it. + init_script_template: &INIT_SCRIPT_TEMPLATE init_script: - uname -a @@ -17,12 +20,30 @@ build_script_template: &BUILD_SCRIPT_TEMPLATE - $CC -dumpmachine - CC=$CC ./configure --prefix=$PWD/prefix && make install && make test +# Override clone script to get the *trial merge* of a pull request +# with its base (usually master) rather than the branch. See +# . +# See also +# . + +clone_script_template: &CLONE_SCRIPT_TEMPLATE + clone_script: | + set -x + which go-git + if [ -z "$CIRRUS_PR" ]; then + git clone --recursive --branch=$CIRRUS_BRANCH https://x-access-token:${CIRRUS_REPO_CLONE_TOKEN}@github.com/${CIRRUS_REPO_FULL_NAME}.git $CIRRUS_WORKING_DIR + else + git clone --recursive --branch=pull/$CIRRUS_PR/merge https://x-access-token:${CIRRUS_REPO_CLONE_TOKEN}@github.com/${CIRRUS_REPO_FULL_NAME}.git $CIRRUS_WORKING_DIR + fi + + XCA6LL_task: macos_instance: # What does this syntax mean? See . image: ghcr.io/cirruslabs/macos-ventura-xcode env: CC: cc + << : *CLONE_SCRIPT_TEMPLATE << : *INIT_SCRIPT_TEMPLATE << : *BUILD_SCRIPT_TEMPLATE @@ -34,6 +55,7 @@ FRI6LL_task: image_family: freebsd-13-1 env: CC: clang + << : *CLONE_SCRIPT_TEMPLATE << : *INIT_SCRIPT_TEMPLATE install_script: pkg install -y gmake << : *BUILD_SCRIPT_TEMPLATE @@ -52,6 +74,7 @@ FRI6GC_task: image_family: freebsd-13-1 env: CC: gcc + << : *CLONE_SCRIPT_TEMPLATE << : *INIT_SCRIPT_TEMPLATE install_script: - pkg install -y gmake gcc @@ -65,6 +88,7 @@ LIA6GC_task: image: gcc # https://hub.docker.com/_/gcc env: CC: gcc + << : *CLONE_SCRIPT_TEMPLATE << : *INIT_SCRIPT_TEMPLATE << : *BUILD_SCRIPT_TEMPLATE @@ -73,6 +97,7 @@ LIA6LL_task: image: ubuntu # https://hub.docker.com/_/ubuntu env: CC: clang + << : *CLONE_SCRIPT_TEMPLATE << : *INIT_SCRIPT_TEMPLATE install_script: - apt-get update From 7e1ecd3d58143a855490e67048aa531133ba7594 Mon Sep 17 00:00:00 2001 From: Richard Brooksby Date: Thu, 9 Feb 2023 09:43:27 +0000 Subject: [PATCH 18/43] Removing "which" test command because it stops cloning on failure. --- .cirrus.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.cirrus.yml b/.cirrus.yml index a419c2e8e8..b8325f9c12 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -29,7 +29,6 @@ build_script_template: &BUILD_SCRIPT_TEMPLATE clone_script_template: &CLONE_SCRIPT_TEMPLATE clone_script: | set -x - which go-git if [ -z "$CIRRUS_PR" ]; then git clone --recursive --branch=$CIRRUS_BRANCH https://x-access-token:${CIRRUS_REPO_CLONE_TOKEN}@github.com/${CIRRUS_REPO_FULL_NAME}.git $CIRRUS_WORKING_DIR else From 752859af6136a763aac0c13bd22afd5e397c35d2 Mon Sep 17 00:00:00 2001 From: Richard Brooksby Date: Thu, 9 Feb 2023 09:59:14 +0000 Subject: [PATCH 19/43] Second attempt at fetching the trial merge for pull requests. --- .cirrus.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index b8325f9c12..cc99fc00a3 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -29,10 +29,11 @@ build_script_template: &BUILD_SCRIPT_TEMPLATE clone_script_template: &CLONE_SCRIPT_TEMPLATE clone_script: | set -x - if [ -z "$CIRRUS_PR" ]; then - git clone --recursive --branch=$CIRRUS_BRANCH https://x-access-token:${CIRRUS_REPO_CLONE_TOKEN}@github.com/${CIRRUS_REPO_FULL_NAME}.git $CIRRUS_WORKING_DIR - else - git clone --recursive --branch=pull/$CIRRUS_PR/merge https://x-access-token:${CIRRUS_REPO_CLONE_TOKEN}@github.com/${CIRRUS_REPO_FULL_NAME}.git $CIRRUS_WORKING_DIR + git clone --depth=1 --branch=$CIRRUS_BRANCH https://x-access-token:${CIRRUS_REPO_CLONE_TOKEN}@github.com/${CIRRUS_REPO_FULL_NAME}.git $CIRRUS_WORKING_DIR + if test -n "$CIRRUS_PR"; then + cd $CIRRUS_WORKING_DIR && + git fetch --depth=1 origin pull/$CIRRUS_PR/merge && + git checkout FETCH_HEAD fi From 0442b6089ddd0aa33d5bb0de3f620a958d4b33c6 Mon Sep 17 00:00:00 2001 From: Richard Brooksby Date: Thu, 9 Feb 2023 10:05:10 +0000 Subject: [PATCH 20/43] Adding git to install to enable clone script override. --- .cirrus.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index cc99fc00a3..afb3cbfd16 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -55,9 +55,9 @@ FRI6LL_task: image_family: freebsd-13-1 env: CC: clang + install_script: pkg install -y git gmake << : *CLONE_SCRIPT_TEMPLATE << : *INIT_SCRIPT_TEMPLATE - install_script: pkg install -y gmake << : *BUILD_SCRIPT_TEMPLATE # FRA6LL doesn't seem to work. Cirrus CI gets an "Agent is not @@ -74,10 +74,9 @@ FRI6GC_task: image_family: freebsd-13-1 env: CC: gcc + install_script: pkg install -y git gmake gcc << : *CLONE_SCRIPT_TEMPLATE << : *INIT_SCRIPT_TEMPLATE - install_script: - - pkg install -y gmake gcc << : *BUILD_SCRIPT_TEMPLATE # Is this really "LI" if it's a docker container? Does it matter? @@ -97,9 +96,9 @@ LIA6LL_task: image: ubuntu # https://hub.docker.com/_/ubuntu env: CC: clang - << : *CLONE_SCRIPT_TEMPLATE - << : *INIT_SCRIPT_TEMPLATE install_script: - apt-get update - - apt-get install -y make clang + - apt-get install -y git make clang + << : *CLONE_SCRIPT_TEMPLATE + << : *INIT_SCRIPT_TEMPLATE << : *BUILD_SCRIPT_TEMPLATE From 0da68847615d4619145a1dda02e2b0a8c2dbaed7 Mon Sep 17 00:00:00 2001 From: Richard Brooksby Date: Thu, 9 Feb 2023 17:20:02 +0000 Subject: [PATCH 21/43] Adding list of platforms built by which CI system, and cross-referencing to readme.txt and manual/build.txt. --- design/ci.txt | 37 +++++++++++++++++++++++++++++++++++++ manual/build.txt | 8 ++++++++ readme.txt | 25 ++++++++++++++----------- 3 files changed, 59 insertions(+), 11 deletions(-) diff --git a/design/ci.txt b/design/ci.txt index 12c5af2d9f..c2c4022f1e 100644 --- a/design/ci.txt +++ b/design/ci.txt @@ -117,6 +117,43 @@ third-party continuous integration services. _`.service.choice`: Favour the services higher up this list when making changes. [Why? Cost. Stability. RB 2023-02-09] + +Platforms +--------- + +_`.platform`: This table shows how each defined platform [ref? RB +2023-02-09] is built and tested by CI. + +========== ============ ===================================== +Platform Service Notes +========== ============ ===================================== +``anangc`` [policy?] not "supported", testing only +``ananll`` [policy?] not "supported", testing only +``fra6gc`` `Travis CI`_ not "supported" +``fra6ll`` `Travis CI`_ not "supported" +``fri3gc`` none +``fri3ll`` none +``fri6gc`` `Cirrus CI`_ GitHub has no FreeBSD +``fri6ll`` `Cirrus CI`_ GitHub has no FreeBSD +``lia6gc`` `Cirrus CI`_ GitHub has no arm64, not supported +``lia6ll`` `Cirrus CI`_ GitHub has no arm64, not supported +``lii3gc`` none +``lii6gc`` `GitHub CI`_ +``lii6ll`` `GitHub CI`_ +``w3i3mv`` none +``w3i6mv`` `GitHub CI`_ +``xca6ll`` `Cirrus CI`_ Cirrus has Tart +``xci6ll`` `GitHub CI`_ +========== ============ ===================================== + +_`.platform.supported`: The platforms here must be a superset of the platforms +listed as "supported" in readme.txt. + +_`.platform.builds`: The platforms here must be a subset of the +platforms listed in "Building the MPS" manual/build.txt, but +preferably the same set so that CI covers all defined platforms. + + [To include: _`.build`: translates correctly without errors or warnings diff --git a/manual/build.txt b/manual/build.txt index 7c222d8a63..c646452195 100644 --- a/manual/build.txt +++ b/manual/build.txt @@ -135,6 +135,14 @@ architecture, and ``CT`` the compiler toolchain. Here are the platforms that we have regular access to and on which the MPS works well: +.. IMPORTANT: The platforms here must be a superset of the platforms + listed as "supported" in readme.txt. + +.. IMPORTANT: The platforms listed here should be a superset of the + platforms listed in design.mps.ci [FIXME: precise tag?] and + preferably the same list so that the assertion of "regular access" + above stays true. + ========== ========= ============= ============ ================= Platform OS Architecture Compiler Makefile ========== ========= ============= ============ ================= diff --git a/readme.txt b/readme.txt index 2633787f01..7b255425c1 100644 --- a/readme.txt +++ b/readme.txt @@ -68,17 +68,20 @@ Supported target platforms The MPS is currently supported for deployment on: -- Windows Vista or later, on IA-32 and x86-64, using Microsoft Visual - C/C++; - -- Linux 2.6 or later, on IA-32 using GCC and on x86-64 using GCC or - Clang/LLVM; - -- FreeBSD 7 or later, on IA-32 and x86-64, using GCC or Clang/LLVM; - -- macOS 10.4 or later, on x86-64, using Clang/LLVM. - -.. TODO: Reformat the above as a table. RB 2023-02-01. +.. IMPORTANT: Maintain as a subset of platforms listed in + manual/build.txt. + +.. IMPORTANT: Maintain design.mps.ci as a superset of these platforms. + +====================== ============= ====================== +Operating system Archtectures Toolchains +====================== ============= ====================== +Windows Vista or later IA-32, x86-64 Microsoft Visual C/C++ +Linux 2.6 or later IA-32, x86-64 GCC, Clang/LLVM + (x86-64 only) +FreeBSD 7 or later IA-32, x86-64 GCC, Clang/LLVM +macOS 10.4 or later x86-64 Clang/LLVM (Xcode) +====================== ============= ====================== The MPS is highly portable and has run on many other processors and operating systems in the past (see `Building the MPS From 1e0849751f6880015767df8cce9590172cb57d00 Mon Sep 17 00:00:00 2001 From: Richard Brooksby Date: Thu, 9 Feb 2023 18:12:08 +0000 Subject: [PATCH 22/43] Updating design.mps.ci.service to be an overview of relevant facts about services. --- design/ci.txt | 56 +++++++++++++++++++++++++++++++++++---------------- 1 file changed, 39 insertions(+), 17 deletions(-) diff --git a/design/ci.txt b/design/ci.txt index c2c4022f1e..7df7919f75 100644 --- a/design/ci.txt +++ b/design/ci.txt @@ -82,29 +82,51 @@ Implementation Services -------- -_`.service`: The `Ravenbrook MPS repository on GitHub`_ uses -third-party continuous integration services. +_`.service`: The `Ravenbrook MPS repository on GitHub +`_ uses third-party continuous +integration services. -[Should be a table cross-referenced to the build instructions. RB -2023-02-09] +- _`.service.github`: `GitHub CI`_ uses `GitHub Actions + `__ to trigger builds on + `GitHub-hosted runners + `_ + and can orchestrate external "`self-hosted runners + `__". -- _`.service.github`: `GitHub CI`_ is used to `.build`_ and `.test`_ - on Linux, macOS, and Windows on amd64 platforms (LII6GC, LII6LL, - XCI6LL, W3I6MV). `GitHub CI`_ is also used to run checks - (`.run.other.checks`_). `GitHub CI`_ only provides amd64 and does - not provide FreeBSD. + - `GitHub CI`_ is free to use for public repositories. -- _`.service.cirrus`: `Cirrus CI`_ is used to `.build`_ and `.test`_ - on macOS M1 (XCA6LL), Linux on arm64 (LIA6GC, LIA6LL), and FreeBSD - on amd64 (FRI6GC, FRI6LL). `Cirrus CI`_ runs OS images on Google - Cloud Services by default, and no FreeBSD on arm64 image is - available. + - `GitHub CI`_ only provides hosted runners for amd64. -- _`.service.travis`: `Travis CI`_ is used to `.build`_ and `.test`_ - on FreeBSD on arm64 (FRA6GC, FRA6LL). + - `GitHub CI`_ does not support FreeBSD, even for self-hosted runners. + + - There is a hazard of GitHub lock-in. + + - `GitHub CI`_ is also used to run checks (`.run.other.checks`_). + +- _`.service.cirrus`: `Cirrus CI`_ mainly uses Google Compute Cloud to + run public images, mainly Docker images. + + - `Cirrus CI`_ is free to use for public repositories. + + - `Cirrus CI`_ provides macOS M1 (Apple Silicon) using `Tart + `_ and so can provide coverage + for XCA6LL. + + - `Cirrus CI`_ can orchestrate Amazon EC2 for extra control. + + - `Cirrus CI`_ can provide FreeBSD on amd64 but not arm64. + +- _`.service.travis`: `Travis CI`_ is a commercial system that + provides a wide variety of platforms and simple configuration. + + - `Travis CI`_ is a paid service with limited concurrency. + + - Ravenbrook has negotiated a quota of "OSS credits" with Travis for + the public MPS repo. - _`.service.readthedocs`: `Read the Docs`_ is used to `.build`_ and - `.publish`_ the `MPS manual`_. + `.publish`_ the `MPS manual + `_. .. _GitHub CI: https://docs.github.com/en/actions/automating-builds-and-tests/about-continuous-integration From a7d85d1aa366eb4eb6b1911cbf30d971cf0b981c Mon Sep 17 00:00:00 2001 From: Richard Brooksby Date: Thu, 9 Feb 2023 19:31:15 +0000 Subject: [PATCH 23/43] Reorganising existing text into new outline for design.mps.ci. --- design/ci.txt | 124 ++++++++++++++++++++++++++++++-------------------- 1 file changed, 75 insertions(+), 49 deletions(-) diff --git a/design/ci.txt b/design/ci.txt index 7df7919f75..fbbe90fa17 100644 --- a/design/ci.txt +++ b/design/ci.txt @@ -15,7 +15,15 @@ Continuous Integration .. TODO: more index terms? -.. TODO: Readership could be a role that doesn't include MPS programmers. +.. TODO: Readership could be a role that doesn't include MPS + programmers. + +.. TODO: Section on service configuration and admin. + +.. TODO: Discussion of compilers and toolchains. + +.. TODO: Discussion of *versions* of platforms, e.g. whether and how + we specify compiler versions to CI. Introduction @@ -57,6 +65,26 @@ Requirements RB 2023-02-09] +[To include: + +_`.build`: translates correctly without errors or warnings + +- _`.build.code`: ``make -C code`` +- _`.build.manual`: ``make -C manual html`` + +_`.test`: runs correctly + +- ``make test`` etc. + +_`.publish`: is made available to the public + +- Appears at https://memory-pool-system.readthedocs.io/ +- Published versions +- Branches and pull requests + +RB 2023-02-09] + + Design ====== @@ -75,6 +103,9 @@ Design RB 2023-02-09] +[Mention how CI supports the pull request merge procedure (except that +exists on a separate branch at the moment). RB 2023-01-15] + Implementation ============== @@ -121,6 +152,8 @@ integration services. - `Travis CI`_ is a paid service with limited concurrency. + - `Travis CI is slow and expensive`_ + - Ravenbrook has negotiated a quota of "OSS credits" with Travis for the public MPS repo. @@ -136,9 +169,20 @@ integration services. .. _Read the Docs: https://readthedocs.org/ +.. _Travis CI is slow and expensive: https://github.com/Ravenbrook/mps/issues/109 + _`.service.choice`: Favour the services higher up this list when making changes. [Why? Cost. Stability. RB 2023-02-09] +[Previous text on service choice: + +_`.travis.platforms`: Where possible, we use `GitHub CI`_ for +platforms, because `Travis CI is slow and expensive`_. However +`GitHub CI`_ does not provide ARM64 or FreeBSD, so we use `Travis CI`_ +for those. + +RB 2023-02-09] + Platforms --------- @@ -176,34 +220,8 @@ platforms listed in "Building the MPS" manual/build.txt, but preferably the same set so that CI covers all defined platforms. -[To include: - -_`.build`: translates correctly without errors or warnings - -- _`.build.code`: ``make -C code`` -- _`.build.manual`: ``make -C manual html`` - -_`.test`: runs correctly - -- ``make test`` etc. - -_`.publish`: is made available to the public - -- Appears at https://memory-pool-system.readthedocs.io/ -- Published versions -- Branches and pull requests - -RB 2023-02-09] - -[To include: service configuration and admin. RB 2023-02-09] - -[This section needs: definition of CI goals and requirements, what we -need CI to do and why, how the testci target meets those -requirements. 'taint really a design without this. Mention how CI -supports the pull request merge procedure (except that exists on a -separate branch at the moment). RB 2023-01-15] - -[Need to discuss compilers and toolchains. RB 2023-01-15] +Commands +-------- _`.run.posix`: On Posix systems where we have autoconf, the CI services run commands equivalent to:: @@ -238,14 +256,22 @@ subject of `GitHub pull request #113 branch/2023-01-13/rst-check. When merged, they can be linked. RB 2023-01-15] + +Events +------ + _`.when:`: CI is triggered on the `mps GitHub repo`_ by: - commits (pushes) - new pull requests -- manually, using tools (see `.tools`_) +- manually, using `.tools`_ .. _mps GitHub repo: https://github.com/ravenbrook/mps + +Results +------- + _`.results`: CI results are visible via the GitHub web interface: - in pull requests, under "Checks", @@ -255,38 +281,37 @@ _`.results`: CI results are visible via the GitHub web interface: as well as in logs specific to the type of CI. -_`.results.travis`: Results from Travis CI can be found at the -`Travis CI build history for the MPS GitHub repo -`_. - -_`.results.github`: Results from GitHub CI can be found at `build +_`.results.github`: Results from `GitHub CI`_ can be found at `build and test actions on the Actions tab at the Ravenbrook GitHub repo `_. -_`.github`: [Insert overview of GitHub CI here. RB 2023-01-15] +_`.results.cirrus`: Results from `Cirrus CI`_ can be found at +`Ravenbrook/mps - Cirrus CI +`_. + +_`.results.travis`: Results from `Travis CI`_ can be found at `Travis +CI build history for the MPS GitHub repo +`_. -_`.github.platforms`: GitHub provides runners_ for Linux, Windows, -and macOS, but only on x86_64. See `.travis.platforms`_ for ARM64 -and FreeBSD. +_`.results.readthedocs`: Results from `Read the Docs`_ can be found at +`Builds | Read the Docs +`_. -.. _runners: https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources + +Configuration +------------- _`.github.config`: GitHub CI is configured using the `build-and-test.yml <../.github/workflows/build-and-test.yml>`_ file in the .github/workflows directory of the MPS tree. -_`.travis`: [Insert overview of Travis CI here. RB 2023-01-15] - -_`.travis.platforms`: Where possible, we use `GitHub CI`_ for -platforms, because `Travis CI is slow and expensive`_. However -`GitHub CI`_ does not provide ARM64 or FreeBSD, so we use `Travis CI`_ -for those. - -.. _Travis CI is slow and expensive: https://github.com/Ravenbrook/mps/issues/109 - _`.travis.config`: Travis is configured using the `.travis.yml <../.travis.yml>`_ file at top level of the MPS tree. + +Tools +----- + _`.tools`: The MPS tree contains some simple tools for managing CI without the need to install whole packages such as the GitHub CLI or Travis CI's Ruby gem. @@ -297,6 +322,7 @@ without the need to push a change or make a pull request in the `mps GitHub repo`_. In particular, they are useful for applying CI to work that was pushed while CI was disabled, for whatever reason. +[FIXME: No cirrus-ci-kick? Read the Docs kick? RB 2023-02-09] References From aa07e8d0496a272fb98870611c47e1f74b93e1c1 Mon Sep 17 00:00:00 2001 From: Richard Brooksby Date: Thu, 9 Feb 2023 20:36:16 +0000 Subject: [PATCH 24/43] Adding CI as an index term, and Confidentiality as a valid field for design documents. --- design/ci.txt | 3 +-- manual/source/extensions/mps/designs.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/design/ci.txt b/design/ci.txt index fbbe90fa17..d0f5e4f01e 100644 --- a/design/ci.txt +++ b/design/ci.txt @@ -12,8 +12,7 @@ Continuous Integration :Copyright: See `Copyright and License`_. :Readership: MPS developers :Index terms: pair: continuous integration; design - -.. TODO: more index terms? + pair: CI; design .. TODO: Readership could be a role that doesn't include MPS programmers. diff --git a/manual/source/extensions/mps/designs.py b/manual/source/extensions/mps/designs.py index 39f2301879..99747bad93 100644 --- a/manual/source/extensions/mps/designs.py +++ b/manual/source/extensions/mps/designs.py @@ -44,7 +44,7 @@ mode = re.compile(r'\.\. mode: .*\n') prefix = re.compile(r'^:Tag: ([a-z][a-z.0-9-]*[a-z0-9])$', re.MULTILINE) -rst_tag = re.compile(r'^:(?:Author|Date|Status|Revision|Copyright|Organization|Format|Index terms|Readership):.*?$\n', re.MULTILINE | re.IGNORECASE) +rst_tag = re.compile(r'^:(?:Author|Date|Status|Revision|Copyright|Organization|Format|Index terms|Readership|Confidentiality):.*?$\n', re.MULTILINE | re.IGNORECASE) mps_tag = re.compile(r'_`\.([a-z][A-Za-z.0-9_-]*[A-Za-z0-9])`:') mps_ref = re.compile(r'`(\.[a-z][A-Za-z.0-9_-]*[A-Za-z0-9])`_(?: )?') funcdef = re.compile(r'^``([^`]*\([^`]*\))``$', re.MULTILINE) From a76ce9c80d496c4cc6911e9f6dd8da006431da4c Mon Sep 17 00:00:00 2001 From: Richard Brooksby Date: Thu, 9 Feb 2023 20:54:22 +0000 Subject: [PATCH 25/43] Fixing up tag references from CI configuration files. Misc minor consistency fixes. --- .cirrus.yml | 77 +++++++++++++++++++++------- .github/workflows/build-and-test.yml | 8 +-- .travis.yml | 15 ++---- design/ci.txt | 65 +++++++++++------------ 4 files changed, 99 insertions(+), 66 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index afb3cbfd16..0958a016d6 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -1,23 +1,28 @@ # .cirrus.yml -- Cirrus CI configuration for the MPS - -# FIXME: Copyright, licence, etc. +# +# Copyright (c) 2023 Ravenbrook Limited. See end of file for license. +# +# See design.mps.ci. # FIXME: Specify versions of OS and toolchains. Source? # Templates for inclusion in tasks. +# # See . -# Cirrus CI doesn't include detailed machine configuration information -# in its output, so include commands here to gather it. - init_script_template: &INIT_SCRIPT_TEMPLATE init_script: + # Cirrus CI doesn't include machine configuration in its output, + # so gather it here. - uname -a build_script_template: &BUILD_SCRIPT_TEMPLATE build_script: + # Cirrus CI doesn't include toolchain configuration in its output, + # so gather it here. - $CC --version - $CC -dumpmachine + # see design.mps.ci.run.posix - CC=$CC ./configure --prefix=$PWD/prefix && make install && make test # Override clone script to get the *trial merge* of a pull request @@ -37,9 +42,14 @@ clone_script_template: &CLONE_SCRIPT_TEMPLATE fi +# The builds for Cirrus CI +# +# See design.mps.ci.platforms + XCA6LL_task: macos_instance: - # What does this syntax mean? See . + # What does this syntax mean? + # See . image: ghcr.io/cirruslabs/macos-ventura-xcode env: CC: cc @@ -47,11 +57,10 @@ XCA6LL_task: << : *INIT_SCRIPT_TEMPLATE << : *BUILD_SCRIPT_TEMPLATE -# https://cirrus-ci.org/guide/writing-tasks/ doesn't seem to allow for FreeBSD on arm64 - FRI6LL_task: freebsd_instance: - # Why is this a "family"? See . + # Why is this a "family"? + # See . image_family: freebsd-13-1 env: CC: clang @@ -60,15 +69,6 @@ FRI6LL_task: << : *INIT_SCRIPT_TEMPLATE << : *BUILD_SCRIPT_TEMPLATE -# FRA6LL doesn't seem to work. Cirrus CI gets an "Agent is not -# responding!" error on its status page. -# -# There's no output from:: -# -# gcloud compute images list --project freebsd-org-cloud-dev --no-standard-images | grep -v amd64 -# -# Fortunately, we can do this using Travis CI. See .travis.yml. - FRI6GC_task: freebsd_instance: image_family: freebsd-13-1 @@ -102,3 +102,44 @@ LIA6LL_task: << : *CLONE_SCRIPT_TEMPLATE << : *INIT_SCRIPT_TEMPLATE << : *BUILD_SCRIPT_TEMPLATE + + +# A. REFERENCES +# +# +# B. DOCUMENT HISTORY +# +# 2013-02-08 RB Created. +# +# +# C. COPYRIGHT AND LICENSE +# +# Copyright (C) 2023 Ravenbrook Limited . +# +# 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. +# +# 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. +# +# +# $Id$ + diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 1ab63c1159..267c7cbe23 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -3,7 +3,7 @@ # Copyright (c) 2019-2022 `GitHub contributors`_ (MIT License). # Copyright (c) 2023 Ravenbrook Limited. See end of file for license. # -# See design.mps.test.ci. +# See design.mps.ci. # # TODO: Exclude certain branches. # @@ -25,7 +25,7 @@ jobs: # The build matrix for GitHub CI on Posix platforms # - # See design.mps.tests.ci.github.platforms. + # See design.mps.ci.platforms. # # FreeBSD and ARM64 targets are in Travis CI, configured by # .travis.yml. @@ -42,7 +42,7 @@ jobs: runs-on: ${{ matrix.os }} - # See design.mps.tests.ci.run.posix. + # See design.mps.ci.run.posix. steps: - uses: actions/checkout@v3 - run: CC=${{ matrix.compiler }} ./configure @@ -53,7 +53,7 @@ jobs: runs-on: windows-latest - # See design.mps.tests.ci.run.windows. + # See design.mps.ci.run.windows. # # The path to Visual Studio is documented at # . diff --git a/.travis.yml b/.travis.yml index baaed86dd8..7079ef0fc0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,7 @@ # # Copyright (c) 2013-2023 Ravenbrook Limited. See end of file for license. # -# See design.mps.test.ci. +# See design.mps.ci. # Some branches don't need builds. Add them here to avoid using build # resources and unnecessary build messages. @@ -15,16 +15,7 @@ language: c # see . # The build matrix for Travis CI # -# See design.mps.tests.ci.travis.platforms. -# -# Most x86_64/amd64 builds are in GitHub CI, configured by -# .github/workflows/build-and-test.yml. -# -# FreeBSD on x86_64 builds are in Cirrus CI, configured by -# .cirrus.yml. -# -# FIXME: The above information should appear once somewhere and be -# referenced from here. +# See design.mps.ci.platforms. os: - freebsd @@ -34,7 +25,7 @@ compiler: - clang - gcc -script: # see design.mps.test.ci.run.posix +script: # see design.mps.ci.run.posix - ./configure --prefix=$PWD/prefix && make install && make test notifications: diff --git a/design/ci.txt b/design/ci.txt index d0f5e4f01e..585a7f492c 100644 --- a/design/ci.txt +++ b/design/ci.txt @@ -116,49 +116,49 @@ _`.service`: The `Ravenbrook MPS repository on GitHub `_ uses third-party continuous integration services. -- _`.service.github`: `GitHub CI`_ uses `GitHub Actions - `__ to trigger builds on - `GitHub-hosted runners - `_ - and can orchestrate external "`self-hosted runners - `__". +_`.service.github`: `GitHub CI`_ uses `GitHub Actions +`__ to trigger builds on +`GitHub-hosted runners +`_ +and can orchestrate external "`self-hosted runners +`__". - - `GitHub CI`_ is free to use for public repositories. +- `GitHub CI`_ is free to use for public repositories. - - `GitHub CI`_ only provides hosted runners for amd64. +- `GitHub CI`_ only provides hosted runners for amd64. - - `GitHub CI`_ does not support FreeBSD, even for self-hosted runners. +- `GitHub CI`_ does not support FreeBSD, even for self-hosted runners. - - There is a hazard of GitHub lock-in. +- There is a hazard of GitHub lock-in. - - `GitHub CI`_ is also used to run checks (`.run.other.checks`_). +- `GitHub CI`_ is also used to run checks (`.run.other.checks`_). -- _`.service.cirrus`: `Cirrus CI`_ mainly uses Google Compute Cloud to - run public images, mainly Docker images. +_`.service.cirrus`: `Cirrus CI`_ mainly uses Google Compute Cloud to +run public images, mainly Docker images. - - `Cirrus CI`_ is free to use for public repositories. +- `Cirrus CI`_ is free to use for public repositories. - - `Cirrus CI`_ provides macOS M1 (Apple Silicon) using `Tart - `_ and so can provide coverage - for XCA6LL. +- `Cirrus CI`_ provides macOS M1 (Apple Silicon) using `Tart + `_ and so can provide coverage + for XCA6LL. - - `Cirrus CI`_ can orchestrate Amazon EC2 for extra control. +- `Cirrus CI`_ can orchestrate Amazon EC2 for extra control. - - `Cirrus CI`_ can provide FreeBSD on amd64 but not arm64. +- `Cirrus CI`_ can provide FreeBSD on amd64 but not arm64. -- _`.service.travis`: `Travis CI`_ is a commercial system that - provides a wide variety of platforms and simple configuration. +_`.service.travis`: `Travis CI`_ is a commercial system that +provides a wide variety of platforms and simple configuration. - - `Travis CI`_ is a paid service with limited concurrency. +- `Travis CI`_ is a paid service with limited concurrency. - - `Travis CI is slow and expensive`_ +- `Travis CI is slow and expensive`_ - - Ravenbrook has negotiated a quota of "OSS credits" with Travis for - the public MPS repo. +- Ravenbrook has negotiated a quota of "OSS credits" with Travis for + the public MPS repo. -- _`.service.readthedocs`: `Read the Docs`_ is used to `.build`_ and - `.publish`_ the `MPS manual - `_. +_`.service.readthedocs`: `Read the Docs`_ is used to `.build`_ and +`.publish`_ the `MPS manual +`_. .. _GitHub CI: https://docs.github.com/en/actions/automating-builds-and-tests/about-continuous-integration @@ -186,7 +186,7 @@ RB 2023-02-09] Platforms --------- -_`.platform`: This table shows how each defined platform [ref? RB +_`.platforms`: This table shows how each defined platform [ref? RB 2023-02-09] is built and tested by CI. ========== ============ ===================================== @@ -222,8 +222,9 @@ preferably the same set so that CI covers all defined platforms. Commands -------- -_`.run.posix`: On Posix systems where we have autoconf, the CI -services run commands equivalent to:: +_`.run.posix`: On Posix systems where we have `autoconf +`_, the CI services run +commands equivalent to:: ./configure make install @@ -235,7 +236,7 @@ which execises the testci target, as defined by `Makefile.in _`.run.windows`: On Windows the CI services run commands that do at least:: - make /f w3i6mv.nmk all testci + nmake /f w3i6mv.nmk all testci as defined by the `.github.config`_. From e92b175620702ebf26b6578a28f546b4fca3009e Mon Sep 17 00:00:00 2001 From: Richard Brooksby Date: Thu, 9 Feb 2023 21:08:01 +0000 Subject: [PATCH 26/43] Better references to configuration files. Draft administration section. --- design/ci.txt | 39 ++++++++++++++++++++++++++++++++------- 1 file changed, 32 insertions(+), 7 deletions(-) diff --git a/design/ci.txt b/design/ci.txt index 585a7f492c..2b6b43e006 100644 --- a/design/ci.txt +++ b/design/ci.txt @@ -17,8 +17,6 @@ Continuous Integration .. TODO: Readership could be a role that doesn't include MPS programmers. -.. TODO: Section on service configuration and admin. - .. TODO: Discussion of compilers and toolchains. .. TODO: Discussion of *versions* of platforms, e.g. whether and how @@ -244,6 +242,9 @@ _`.run.other.targets`: On some platforms we arrange to run the testansi, testpollnone, testratio, and testscheme targets. [Need to explain why, where, etc. RB 2023-01-15] +_`.run.manual`: The manual is built by Read the Docs which directly +invokes Sphinx, so there are no commands. + _`.run.other.checks`: We could also run various non-build checks using CI to check: @@ -252,7 +253,7 @@ using CI to check: [In the branch of writing, these do not yet exist. They are the subject of `GitHub pull request #113 -`_ of +`_ of branch/2023-01-13/rst-check. When merged, they can be linked. RB 2023-01-15] @@ -301,14 +302,38 @@ _`.results.readthedocs`: Results from `Read the Docs`_ can be found at Configuration ------------- -_`.github.config`: GitHub CI is configured using the -`build-and-test.yml <../.github/workflows/build-and-test.yml>`_ file -in the .github/workflows directory of the MPS tree. +_`.github.config`: `GitHub CI`_ is configured using several +"workflows" in the `.github/workflows directory +<../.github/workflows/>`_ of the MPS tree: + +- the `build-and-test.yml <../.github/workflows/build-and-test.yml>`_ + file runs build and test commands (`.run.posix`_ , `.run.windows`_). + +- the `shell-script-check.yml + <../.github/workflows/shell-script-check.yml>`_ file runs the + lint checks on shell scripts + +[Coming soon from a branch/2023-01-13/rst-check near you: + +- the `rst-check.yml <../.github/workflows/shell-script-check.yml>`_ + file runs syntax checks on reStructuredText documents -_`.travis.config`: Travis is configured using the `.travis.yml +RB 2023-02-09] + +_`.cirrus.config`: `Cirrus CI`_ is configured using the `.cirrus.yml +<../.cirrus.yml>`_ file at top level of the MPS tree. + +_`.travis.config`: `Travis CI`_ is configured using the `.travis.yml <../.travis.yml>`_ file at top level of the MPS tree. +Administration +-------------- + +[FIXME: Insert links, instructions, and setups on the CI sites and in +the repo settings. RB 2023-02-09] + + Tools ----- From a536e1a9a181438afa4c613693876ab5de31a4f4 Mon Sep 17 00:00:00 2001 From: Richard Brooksby Date: Thu, 9 Feb 2023 21:18:04 +0000 Subject: [PATCH 27/43] Fixing markup of definition list. --- design/config.txt | 3 --- 1 file changed, 3 deletions(-) diff --git a/design/config.txt b/design/config.txt index 0afb21d778..bd4f467b9a 100644 --- a/design/config.txt +++ b/design/config.txt @@ -172,18 +172,15 @@ predefined when compiling the module sources:: _`.var`: The variety codes are as follows: _`.var.hot`: ``HOT`` - Intended for release in products. Optimised, reduced internal checking, especially on the critical path [RB_2012-09-07]_. _`.var.cool`: ``COOL`` - Intended for use during development. Moderately thorough internal consistency checking. Reduced optimisation to allow for single-stepping. _`.var.rash`: ``RASH`` - No internal checking at all. Slight performance improvement over `.var.hot`_ at the cost of early detection of memory management bugs. We do not advise use of this variety, as memory management From bef3b95d8df2d6fa4fcd7d0f0ddd18f03e40ef4d Mon Sep 17 00:00:00 2001 From: Richard Brooksby Date: Fri, 10 Feb 2023 10:48:16 +0000 Subject: [PATCH 28/43] Adding reference to design.mps.ci. --- .github/workflows/shell-script-check.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/shell-script-check.yml b/.github/workflows/shell-script-check.yml index 9c44793a45..1e398d1d65 100644 --- a/.github/workflows/shell-script-check.yml +++ b/.github/workflows/shell-script-check.yml @@ -1,5 +1,7 @@ # .github/workflows/shell-script-check.yml -- check shell scripts # +# See design.mps.ci.run.other.checks. +# # This is a GitHub CI workflow # # to check shell scripts. From 787733961951473dd237791971e02c72e32c8373 Mon Sep 17 00:00:00 2001 From: Richard Brooksby Date: Fri, 10 Feb 2023 11:45:37 +0000 Subject: [PATCH 29/43] Adding a FIXME to include Cirrus etc. in proc.merge.pull-request. --- procedure/pull-request-merge.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/procedure/pull-request-merge.rst b/procedure/pull-request-merge.rst index 5d83ad18b1..888d19584b 100644 --- a/procedure/pull-request-merge.rst +++ b/procedure/pull-request-merge.rst @@ -129,6 +129,8 @@ When you finish the checklist, decide whether to start You can also look for a build results in the `Travis CI build history for the repo`_ and in the `GitHub workflows for the repo`_. + [FIXME: Also Cirrus and Read the Docs. And search elsewhere for + Travis. RB 2023-02-10] If there is a failed build *of the branch* you should not execute `the merging procedure`_, but talk to the contributor about fixing From 8f278eb3e00a85bfe87dd8fa8dc584900081cb8a Mon Sep 17 00:00:00 2001 From: Richard Brooksby Date: Fri, 10 Feb 2023 21:16:46 +0000 Subject: [PATCH 30/43] Drafting goals (design.mps.ci.goal) and requirements (design.mps.ci.req). --- design/ci.txt | 67 ++++++++++++++++++++++++++++++--------------------- 1 file changed, 40 insertions(+), 27 deletions(-) diff --git a/design/ci.txt b/design/ci.txt index 2b6b43e006..791c099538 100644 --- a/design/ci.txt +++ b/design/ci.txt @@ -35,51 +35,64 @@ Pool System. Goals ===== -[For inclusion: +.goal.platforms: Reduce the cost to developers of supporting target +platforms. -- Provide rapid feedback to developers. -- Cover a wide array of target platforms. -- Early detection of defects. -- Deployment of documentation. +.goal.detect: Detect introduced defects early in development so that +they can be fixed at lower cost. -RB 2023-02-09] +.goal.publish: Publish documentation promptly and cheaply. Requirements ============ -[For inclusion: +.req.rapid: Provide build and test results within 30 minutes of +submission of changes. (goal.detect) -- Cover all "supported" target platforms. -- Zero monetary cost. -- Low maintenance overheads. -- Easy to extend with improvements and prevention. -- Easy to switch providers. -- Include all tests. -- Portable outside GitHub. -- Administration by more than one person. +.req.branch: Provide build and test results for submissions to +development branches (pushes). (goal.detect) -RB 2023-02-09] +.req.merge: Provide build and test results for merge candidate changes +(pull requests) before they are merged to master. (goal.detect) +.req.platforms: Build and test on all supported target platforms. +(goal.platforms) -[To include: +.req.cost: Cost no money in normal circumstances. (goal.platforms, +goal.detect, goal.publish) -_`.build`: translates correctly without errors or warnings +.req.maintinable: Low maintenance cost. (goal.platforms) -- _`.build.code`: ``make -C code`` -- _`.build.manual`: ``make -C manual html`` +.req.extensible: Easy to extend with new platforms, improvements, and +defect prevention. (goal.platforms, goal.publish) -_`.test`: runs correctly +.req.coverage: Includes all tests. (goal.detect, goal.platforms) -- ``make test`` etc. +.req.portable: Be portable away from any particular hosting service, +e.g. GitHub, at reasonable cost. (goal.platforms, goal.publish) -_`.publish`: is made available to the public +.req.admin: Administration is available to more than one person. +(goal.platforms, goal,publish) -- Appears at https://memory-pool-system.readthedocs.io/ -- Published versions -- Branches and pull requests +.req.manual: Publish the manual. -RB 2023-02-09] +.req.manual.versions: Publish versions of the manual that document +releases. + +.req.build.code: Check that changed code compiles correctly without errors +or warnings. + +.req.build.manual: Check that the manual translates correctly without +errors or warnings. + +.req.test: Check that tests do not find any defects. + +[To include: + +- What kinds of defects to find by testing (functional, performance, etc.) + +RB 2023-02-10] Design From d203affd383930cf5376ee5ca7af72342f7ba427 Mon Sep 17 00:00:00 2001 From: Richard Brooksby Date: Fri, 10 Feb 2023 21:30:41 +0000 Subject: [PATCH 31/43] Adding a few notes on design. --- design/ci.txt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/design/ci.txt b/design/ci.txt index 791c099538..bd2449912e 100644 --- a/design/ci.txt +++ b/design/ci.txt @@ -99,7 +99,8 @@ Design ====== [For inclusion: - +- use third-party CI systems (req.cost, req.platforms, req.maintainable) +- do third-party CI systems represent real platforms? (req.platforms) - the testci make target - third-party systems used - relationship to review @@ -113,9 +114,6 @@ Design RB 2023-02-09] -[Mention how CI supports the pull request merge procedure (except that -exists on a separate branch at the moment). RB 2023-01-15] - Implementation ============== From bdfccc0d6ef7bcd7483315572211632e69d52cca Mon Sep 17 00:00:00 2001 From: Richard Brooksby Date: Sun, 26 Feb 2023 19:15:52 +0000 Subject: [PATCH 32/43] Drafting more of the requirements and design sections. --- design/ci.txt | 90 ++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 79 insertions(+), 11 deletions(-) diff --git a/design/ci.txt b/design/ci.txt index bd2449912e..6159464e27 100644 --- a/design/ci.txt +++ b/design/ci.txt @@ -35,8 +35,9 @@ Pool System. Goals ===== -.goal.platforms: Reduce the cost to developers of supporting target -platforms. +.goal.platforms: Reduce the cost to developers and collaborators of +supporting target platforms. [Cross-reference to where those are +defined. RB 2023-02-26] .goal.detect: Detect introduced defects early in development so that they can be fixed at lower cost. @@ -59,16 +60,17 @@ development branches (pushes). (goal.detect) .req.platforms: Build and test on all supported target platforms. (goal.platforms) -.req.cost: Cost no money in normal circumstances. (goal.platforms, -goal.detect, goal.publish) +.req.cost: Cost no money in normal circumstances. (This also supports +.req.fork.) (goal.platforms, goal.detect, goal.publish) -.req.maintinable: Low maintenance cost. (goal.platforms) +.req.fork: Operate on forks of the repo. (goal.platforms, goal.detect) + +.req.maintinable: Low maintenance overhead. [Around 20 h/year or 1%. +RB 2023-02-26] (goal.platforms) .req.extensible: Easy to extend with new platforms, improvements, and defect prevention. (goal.platforms, goal.publish) -.req.coverage: Includes all tests. (goal.detect, goal.platforms) - .req.portable: Be portable away from any particular hosting service, e.g. GitHub, at reasonable cost. (goal.platforms, goal.publish) @@ -80,13 +82,28 @@ e.g. GitHub, at reasonable cost. (goal.platforms, goal.publish) .req.manual.versions: Publish versions of the manual that document releases. -.req.build.code: Check that changed code compiles correctly without errors -or warnings. +.req.build.code: Check that changed code compiles correctly without +errors or warnings. -.req.build.manual: Check that the manual translates correctly without +.req.build.manual: Check that the manual builds correctly without errors or warnings. -.req.test: Check that tests do not find any defects. +.req.test: Allow the running of tests (.def.test) on target platforms. +(goal.detect) + +.def.test: A "test" is something that runs the compiled MPS in order +to determine facts about it: find defects, check performance, etc. + +.req.test.coverage: Includes all tests. (goal.detect, goal.platforms) + +.req.test.detect: Detect wheter tests find any defects. (goal.detect) + +.req.test.results: Provide detailed test results to diagnose defects. +(goal.platforms) + +.req.test.real: Test realistic target platforms, e.g. test interacting +with the real target kernel rather than a virtualized simulation. +(goal.detect) [To include: @@ -94,10 +111,61 @@ errors or warnings. RB 2023-02-10] +.req.check: Allow programmatic checks (.def.check) of the MPS source +tree. + +.def.check: A "check", as opposed to a "test" of the compiled MPS, is +something that e.g. finds missing cross-references, inconsistencies, +or runs a lint tool. + +.req.check.coverage: Include all checks. (goal.detect) + +.req.check.detect: Detect whether checks find any defects. (goal.detect) + +.req.check.results: Provide detailed results of checks. (goal.platforms) + + + Design ====== +CI configurations +----------------- + +.design.config: CI systems are usually configured though simple YAML +files that give instructions for what to do on various events. + +.design.config.kiss: Keep the CI setups and configurations as simple +as possible to meet .req.maintainable and .req.portable. + +.design.config.one-line: As far as possible, each CI configuration +should be a single command line that invokes part of the MPS build +system. Something like ``./configure && make all testci``. + +.design.config.cross-platform: The .design.config.one-line command +should invoke a platform independent script, so that we get uniform +coverage of platforms. For example, ``test/check-rst`` or ``make +testci``. Unfortunately, Windows often demands a different script. +Minimise duplication on Windows. + + +Checks +------ + +.design.check.posix: Checks must run on Posix but may also run on +Windows. The majority of CI systems run on Posix, with macOS as a +special case. Linux features that are not available in macOS (which +is based on BSD) should not be used. + +.design.check.cross-platform: Checks should be designed to be +independent of platforms, so that defects in the Windows build are +detected by checks run on Posix. Therefore, checks should not exclude +files by platform. + +[TODO: Review against each requirement and each implementation point. +Design connects them. RB 2023-02-26] + [For inclusion: - use third-party CI systems (req.cost, req.platforms, req.maintainable) - do third-party CI systems represent real platforms? (req.platforms) From 549d329992147e47ffc7d5400bdec4069734b89c Mon Sep 17 00:00:00 2001 From: Richard Brooksby Date: Wed, 8 Mar 2023 03:08:22 +0000 Subject: [PATCH 33/43] Completing CI requirements, although in some cases with notes. --- design/ci.txt | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/design/ci.txt b/design/ci.txt index 6159464e27..ef35d42d3a 100644 --- a/design/ci.txt +++ b/design/ci.txt @@ -19,9 +19,6 @@ Continuous Integration .. TODO: Discussion of compilers and toolchains. -.. TODO: Discussion of *versions* of platforms, e.g. whether and how - we specify compiler versions to CI. - Introduction ============ @@ -101,15 +98,15 @@ to determine facts about it: find defects, check performance, etc. .req.test.results: Provide detailed test results to diagnose defects. (goal.platforms) -.req.test.real: Test realistic target platforms, e.g. test interacting -with the real target kernel rather than a virtualized simulation. -(goal.detect) - -[To include: - -- What kinds of defects to find by testing (functional, performance, etc.) +.req.test.real: Test the attributes of realistic target platforms, +e.g. test interacting with the real target kernel rather than a +virtualized simulation. This is especially important for performance +tests. (goal.detect) -RB 2023-02-10] +.req.test.type: Test for all the types defects for which we have +tests. [TODO: Analyse and specify explicitly what types of tests are +required, probably in design.mps.tests, and reference here. RB +2023-03-08.] .req.check: Allow programmatic checks (.def.check) of the MPS source tree. @@ -124,7 +121,8 @@ or runs a lint tool. .req.check.results: Provide detailed results of checks. (goal.platforms) - +[TODO: What do we need to do about *version* of platforms, e.g. kernel +versions, compiler versions, etc.? RB 2023-03-08] Design From 717d55d9589241a84d7f3744ed13138f92705819 Mon Sep 17 00:00:00 2001 From: Richard Brooksby Date: Wed, 8 Mar 2023 03:21:20 +0000 Subject: [PATCH 34/43] Using RFC 2119 key words. --- design/ci.txt | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/design/ci.txt b/design/ci.txt index ef35d42d3a..7fdb1c231f 100644 --- a/design/ci.txt +++ b/design/ci.txt @@ -28,6 +28,12 @@ _`.intro`: This document describes the design and implementation of `_ of the Memory Pool System. +_`.levels`: The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", +"SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", +"MAY", and "OPTIONAL" in this document are to be interpreted as +described in RFC 2119 [RFC-2119]_. They indicate what is requried for +the design to succeed in achieving its goals. + Goals ===== @@ -134,31 +140,31 @@ CI configurations .design.config: CI systems are usually configured though simple YAML files that give instructions for what to do on various events. -.design.config.kiss: Keep the CI setups and configurations as simple -as possible to meet .req.maintainable and .req.portable. +.design.config.kiss: CI setups SHOULD be kept as simple as possible to +meet .req.maintainable and .req.portable. -.design.config.one-line: As far as possible, each CI configuration -should be a single command line that invokes part of the MPS build -system. Something like ``./configure && make all testci``. +.design.config.one-line: Each CI configuration SHOULD be a single +command line that invokes part of the MPS build system. Something +like ``./configure && make all testci``. .design.config.cross-platform: The .design.config.one-line command -should invoke a platform independent script, so that we get uniform +SHOULD invoke a platform independent script, so that we get uniform coverage of platforms. For example, ``test/check-rst`` or ``make testci``. Unfortunately, Windows often demands a different script. -Minimise duplication on Windows. +Duplication for Windows SHOULD be minimized. Checks ------ -.design.check.posix: Checks must run on Posix but may also run on +.design.check.posix: Checks MUST run on Posix but MAY also run on Windows. The majority of CI systems run on Posix, with macOS as a special case. Linux features that are not available in macOS (which -is based on BSD) should not be used. +is based on BSD) SHOULD NOT be used. -.design.check.cross-platform: Checks should be designed to be +.design.check.cross-platform: Checks SHOULD be designed to be independent of platforms, so that defects in the Windows build are -detected by checks run on Posix. Therefore, checks should not exclude +detected by checks run on Posix. Therefore, checks SHOULD NOT exclude files by platform. [TODO: Review against each requirement and each implementation point. @@ -430,6 +436,13 @@ that was pushed while CI was disabled, for whatever reason. References ---------- +.. [RFC-2119] + "Key words for use in RFCs to Indicate Requirement Levels"; + S. Bradner; + Harvard University; + 1997-03; + (with errata). + [To include: - CI system documentation From fc54e1aa93883c6a03956d2050697d500a711bf5 Mon Sep 17 00:00:00 2001 From: Richard Brooksby Date: Wed, 8 Mar 2023 03:28:27 +0000 Subject: [PATCH 35/43] Defining CI platform requirements. --- design/ci.txt | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/design/ci.txt b/design/ci.txt index 7fdb1c231f..b2768b975d 100644 --- a/design/ci.txt +++ b/design/ci.txt @@ -39,8 +39,7 @@ Goals ===== .goal.platforms: Reduce the cost to developers and collaborators of -supporting target platforms. [Cross-reference to where those are -defined. RB 2023-02-26] +supporting target platforms. .goal.detect: Detect introduced defects early in development so that they can be fixed at lower cost. @@ -60,8 +59,11 @@ development branches (pushes). (goal.detect) .req.merge: Provide build and test results for merge candidate changes (pull requests) before they are merged to master. (goal.detect) -.req.platforms: Build and test on all supported target platforms. -(goal.platforms) +.req.platforms: Build and test on all supported target platforms +defined in `Building the Memory Pool System <../manual/build.txt>`_ +(goal.platforms). [TODO: The target platforms should be referencable +by tag. See also `GitHub issue #147 +`_. RB 2023-03-08] .req.cost: Cost no money in normal circumstances. (This also supports .req.fork.) (goal.platforms, goal.detect, goal.publish) @@ -267,8 +269,8 @@ RB 2023-02-09] Platforms --------- -_`.platforms`: This table shows how each defined platform [ref? RB -2023-02-09] is built and tested by CI. +_`.platforms`: This table shows how each defined platform +(.req.platforms) is built and tested by CI. ========== ============ ===================================== Platform Service Notes @@ -292,12 +294,12 @@ Platform Service Notes ``xci6ll`` `GitHub CI`_ ========== ============ ===================================== -_`.platform.supported`: The platforms here must be a superset of the platforms -listed as "supported" in readme.txt. +_`.platform.supported`: The platforms here MUST be a superset of the +platforms listed as "supported" in readme.txt (.req.platforms). -_`.platform.builds`: The platforms here must be a subset of the -platforms listed in "Building the MPS" manual/build.txt, but -preferably the same set so that CI covers all defined platforms. +_`.platform.builds`: The platforms here MUST be a subset of the +platforms listed in "Building the MPS" manual/build.txt, but SHOULD be +the same set so that CI covers all defined platforms (.req.platforms). Commands From b7c229e3aaa3f59522abc74cf12fd3f943f26665 Mon Sep 17 00:00:00 2001 From: Richard Brooksby Date: Wed, 8 Mar 2023 03:48:51 +0000 Subject: [PATCH 36/43] Cleaning up the Services section and linking to requirements. --- design/ci.txt | 90 +++++++++++++++++++++++++++------------------------ 1 file changed, 47 insertions(+), 43 deletions(-) diff --git a/design/ci.txt b/design/ci.txt index b2768b975d..df3ef07540 100644 --- a/design/ci.txt +++ b/design/ci.txt @@ -139,21 +139,21 @@ Design CI configurations ----------------- -.design.config: CI systems are usually configured though simple YAML -files that give instructions for what to do on various events. +.config: CI systems are usually configured though simple YAML files +that give instructions for what to do on various events. -.design.config.kiss: CI setups SHOULD be kept as simple as possible to -meet .req.maintainable and .req.portable. +.config.kiss: CI setups SHOULD be kept as simple as possible to meet +.req.maintainable and .req.portable. -.design.config.one-line: Each CI configuration SHOULD be a single -command line that invokes part of the MPS build system. Something -like ``./configure && make all testci``. +.config.one-line: Each CI configuration SHOULD be a single command +line that invokes part of the MPS build system. Something like +``./configure && make all testci``. -.design.config.cross-platform: The .design.config.one-line command -SHOULD invoke a platform independent script, so that we get uniform -coverage of platforms. For example, ``test/check-rst`` or ``make -testci``. Unfortunately, Windows often demands a different script. -Duplication for Windows SHOULD be minimized. +.config.cross-platform: The .design.config.one-line command SHOULD +invoke a platform independent script, so that we get uniform coverage +of platforms. For example, ``test/check-rst`` or ``make testci``. +Unfortunately, Windows often demands a different script. Duplication +for Windows SHOULD be minimized. Checks @@ -197,7 +197,13 @@ Services _`.service`: The `Ravenbrook MPS repository on GitHub `_ uses third-party continuous -integration services. +integration services in order to meet .req.platforms, +.req.maintainable, and .req.extensible without the overhead of +maintaining a lot systems. + +_`.service.choice`: The services have been chosen to best meet +requirements, with the best fit earliest in the list. Therefore, we +SHOULD favour the services higher up this list when making changes. _`.service.github`: `GitHub CI`_ uses `GitHub Actions `__ to trigger builds on @@ -206,42 +212,47 @@ _`.service.github`: `GitHub CI`_ uses `GitHub Actions and can orchestrate external "`self-hosted runners `__". -- `GitHub CI`_ is free to use for public repositories. +- `GitHub CI`_ is free to use for public repositories (.req.cost). -- `GitHub CI`_ only provides hosted runners for amd64. +- `GitHub CI`_ only provides hosted runners for amd64 (.req.plaforms). -- `GitHub CI`_ does not support FreeBSD, even for self-hosted runners. +- `GitHub CI`_ does not support FreeBSD, even for self-hosted runners (.req.platforms). -- There is a hazard of GitHub lock-in. +- There is a hazard of GitHub lock-in (.req.portable). -- `GitHub CI`_ is also used to run checks (`.run.other.checks`_). +- `GitHub CI`_ is also used to run checks (`.run.other.checks`_, .req.check). _`.service.cirrus`: `Cirrus CI`_ mainly uses Google Compute Cloud to run public images, mainly Docker images. -- `Cirrus CI`_ is free to use for public repositories. +- `Cirrus CI`_ is free to use for public repositories (.req.cost). - `Cirrus CI`_ provides macOS M1 (Apple Silicon) using `Tart `_ and so can provide coverage - for XCA6LL. + for XCA6LL (.req.platforms). -- `Cirrus CI`_ can orchestrate Amazon EC2 for extra control. +- `Cirrus CI`_ can orchestrate Amazon EC2 for extra control, though we + don't currently use this feature. It could be used to meet + .req.test.real. -- `Cirrus CI`_ can provide FreeBSD on amd64 but not arm64. +- `Cirrus CI`_ can provide FreeBSD on amd64 but not arm64 + (.req.platforms). -_`.service.travis`: `Travis CI`_ is a commercial system that -provides a wide variety of platforms and simple configuration. +_`.service.travis`: `Travis CI`_ is a commercial system that provides +a wide variety of platforms and simple configuration +(.req.maintainable). -- `Travis CI`_ is a paid service with limited concurrency. +- `Travis CI`_ is a paid service with limited concurrency (.req.cost). -- `Travis CI is slow and expensive`_ +- `Travis CI is slow and expensive`_ (.req.cost, .req.rapid). - Ravenbrook has negotiated a quota of "OSS credits" with Travis for - the public MPS repo. + the public MPS repo [Travis_42376]_. _`.service.readthedocs`: `Read the Docs`_ is used to `.build`_ and `.publish`_ the `MPS manual -`_. +`_ (.req.manual, +req.build.manual). .. _GitHub CI: https://docs.github.com/en/actions/automating-builds-and-tests/about-continuous-integration @@ -253,18 +264,6 @@ _`.service.readthedocs`: `Read the Docs`_ is used to `.build`_ and .. _Travis CI is slow and expensive: https://github.com/Ravenbrook/mps/issues/109 -_`.service.choice`: Favour the services higher up this list when -making changes. [Why? Cost. Stability. RB 2023-02-09] - -[Previous text on service choice: - -_`.travis.platforms`: Where possible, we use `GitHub CI`_ for -platforms, because `Travis CI is slow and expensive`_. However -`GitHub CI`_ does not provide ARM64 or FreeBSD, so we use `Travis CI`_ -for those. - -RB 2023-02-09] - Platforms --------- @@ -309,9 +308,7 @@ _`.run.posix`: On Posix systems where we have `autoconf `_, the CI services run commands equivalent to:: - ./configure - make install - make test + ./configure && make install && make test which execises the testci target, as defined by `Makefile.in <../Makefile.in>`_ in the root of the MPS tree. @@ -445,6 +442,13 @@ References 1997-03; (with errata). +.. [Travis_42376] + "Travis CI: [42376] - OSS credit request"; + Manish Nagdewan; + Travis CI; + 2023-02-08; + . + [To include: - CI system documentation From e595d8c472f1553ea13d07d44af0f8e0dd60b236 Mon Sep 17 00:00:00 2001 From: Richard Brooksby Date: Wed, 8 Mar 2023 03:53:03 +0000 Subject: [PATCH 37/43] Removing TODO notes that are done. --- design/ci.txt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/design/ci.txt b/design/ci.txt index df3ef07540..e86ec1b580 100644 --- a/design/ci.txt +++ b/design/ci.txt @@ -173,16 +173,12 @@ files by platform. Design connects them. RB 2023-02-26] [For inclusion: -- use third-party CI systems (req.cost, req.platforms, req.maintainable) -- do third-party CI systems represent real platforms? (req.platforms) - the testci make target -- third-party systems used - relationship to review - relationship to merge - configuration files - tool scripts - how to extend -- KISS - forks - 32-bit? @@ -205,6 +201,8 @@ _`.service.choice`: The services have been chosen to best meet requirements, with the best fit earliest in the list. Therefore, we SHOULD favour the services higher up this list when making changes. +[TODO: Is .req.test.real adequately met? RB 2023-03-08] + _`.service.github`: `GitHub CI`_ uses `GitHub Actions `__ to trigger builds on `GitHub-hosted runners From 79a814dc82f2d7b94e66ae40c704290fc3ebc51b Mon Sep 17 00:00:00 2001 From: Richard Brooksby Date: Wed, 8 Mar 2023 10:05:23 +0000 Subject: [PATCH 38/43] Removing references to Travis CI from proc.merge.pull-request and incorporating statements about Travis CI into general design. --- design/ci.txt | 26 ++++++++++++++++++++++---- manual/build.txt | 9 ++++----- procedure/pull-request-merge.rst | 31 +++++++++---------------------- 3 files changed, 35 insertions(+), 31 deletions(-) diff --git a/design/ci.txt b/design/ci.txt index e86ec1b580..cdbed7ecba 100644 --- a/design/ci.txt +++ b/design/ci.txt @@ -220,6 +220,10 @@ and can orchestrate external "`self-hosted runners - `GitHub CI`_ is also used to run checks (`.run.other.checks`_, .req.check). +- `GitHub CI`_ builds both `pushes and pull requests + `__ + (.req.branch, .req.merge). + _`.service.cirrus`: `Cirrus CI`_ mainly uses Google Compute Cloud to run public images, mainly Docker images. @@ -236,6 +240,11 @@ run public images, mainly Docker images. - `Cirrus CI`_ can provide FreeBSD on amd64 but not arm64 (.req.platforms). +- `Cirrus CI`_ builds either pushes or pull requests, but not both. + [TODO: Escalate `my workaround + `__ + or figure out how to fix it. RB 2023-03-08] + _`.service.travis`: `Travis CI`_ is a commercial system that provides a wide variety of platforms and simple configuration (.req.maintainable). @@ -247,10 +256,19 @@ a wide variety of platforms and simple configuration - Ravenbrook has negotiated a quota of "OSS credits" with Travis for the public MPS repo [Travis_42376]_. -_`.service.readthedocs`: `Read the Docs`_ is used to `.build`_ and -`.publish`_ the `MPS manual -`_ (.req.manual, -req.build.manual). +- `Travis CI`_ builds both `pushes and pull requests + `__ + (.req.branch, .req.merge). + +_`.service.readthedocs`: `Read the Docs`_ is used build and publish +the `MPS manual `_ +(.req.manual, req.build.manual). + +- `Read the Docs`_ builds `pull requests + `__ + automatically, and can build `branches + `__ + (.req.branch, .req.merge). .. _GitHub CI: https://docs.github.com/en/actions/automating-builds-and-tests/about-continuous-integration diff --git a/manual/build.txt b/manual/build.txt index c937933638..d207fa3421 100644 --- a/manual/build.txt +++ b/manual/build.txt @@ -168,13 +168,12 @@ architecture, and ``CT`` the compiler toolchain. Here are the platforms that we have regular access to and on which the MPS works well: -.. IMPORTANT: The platforms here must be a superset of the platforms +.. IMPORTANT: The platforms here MUST be a superset of the platforms listed as "supported" in readme.txt. -.. IMPORTANT: The platforms listed here should be a superset of the - platforms listed in design.mps.ci [FIXME: precise tag?] and - preferably the same list so that the assertion of "regular access" - above stays true. +.. IMPORTANT: The platforms listed here MAY be a superset of the + platforms listed in design.mps.ci.platforms but SHOULD be the same + list so that the assertion of "regular access" above stays true. ========== ========= ============= ============ ================= Platform OS Architecture Compiler Makefile diff --git a/procedure/pull-request-merge.rst b/procedure/pull-request-merge.rst index da31793bb7..15410ef490 100644 --- a/procedure/pull-request-merge.rst +++ b/procedure/pull-request-merge.rst @@ -131,7 +131,7 @@ When you finish the checklist, decide whether to start results are missing, inform sysadmins that CI isn't functioning. You can also look for a build results in the logs of CI systems. - See `design.mps.ci.results <../design/tests.txt#ci-results>`__. + See `design.mps.ci.results <../design/tests.txt#ci-results>`_. Are the build results up to date? If master has changed since the date of the commit that kicked off the build (the one immediately @@ -139,8 +139,6 @@ When you finish the checklist, decide whether to start Consider a *catch-up merge* from master to the branch to bring the branch up to date and kick off new builds. - [FIXME: Search elsewhere for Travis. RB 2023-02-10] - If there is a failed build *of the branch* you should not execute `the merging procedure`_, but talk to the contributor about fixing the branch. @@ -159,14 +157,15 @@ When you finish the checklist, decide whether to start .. [#trial-merge] CI is run against both the branch (labelled "push"), and a `pull request merge branch`_ (labelled "pull - request") automatically created by GitHub. + request") automatically created by GitHub. See + `design.mps.ci.req.merge`_. + +.. _design.mps.ci.req.merge: ../design/ci.txt#req-merge .. _permalink: https://docs.github.com/en/repositories/working-with-files/using-files/getting-permanent-links-to-files .. _pull request merge branch: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request -.. _Travis CI build history for the repo: https://app.travis-ci.com/github/Ravenbrook/mps/builds - .. _GitHub workflows for the repo: https://github.com/Ravenbrook/mps/actions .. _MPS interface: https://www.ravenbrook.com/project/mps/master/manual/html/topic/interface.html @@ -343,9 +342,8 @@ working repo before that point. git push github HEAD:merge/2023-01-06/speed-hax - You will need to wait for results from CI. Look for a build - results in the `Travis CI build history for the repo`_ and in the - `GitHub workflows for the repo`_. + You will need to wait for results from CI. See + `design.mps.ci.results`_. See build (step 5) about what to do if tests do not pass. @@ -465,19 +463,8 @@ According to `GitHub's "About pull request merges" request on GitHub.com, all commits from the feature branch are added to the base branch in a merge commit. -`Travis CI builds and tests this merge in advance `_: - - Rather than build the commits that have been pushed to the branch - the pull request is from, we build the merge between the source - branch and the upstream branch. - -When we use a GitHub CI on pull requests, that's also run on the merge -results. As `GitHub's pull request event documentation -`_ -says: - - GITHUB_SHA for this event is the last merge commit of the pull - request merge branch. +We also ensure (`design.mps.ci.req.merge`_) that CI results are valid +for this merge in advance. So, `once Git becomes the home `_ we will be able to use From 8b6ae56708ebaa2f56e54be12399520304dd0b07 Mon Sep 17 00:00:00 2001 From: Richard Brooksby Date: Wed, 8 Mar 2023 10:51:29 +0000 Subject: [PATCH 39/43] Promoting some comments to TODOs and attempting to resolve others. --- design/ci.txt | 115 ++++++++++++++++++++++++-------------------------- 1 file changed, 55 insertions(+), 60 deletions(-) diff --git a/design/ci.txt b/design/ci.txt index cdbed7ecba..2bdae26e55 100644 --- a/design/ci.txt +++ b/design/ci.txt @@ -19,6 +19,22 @@ Continuous Integration .. TODO: Discussion of compilers and toolchains. +.. TODO: Investigate and document the testci make target. + +.. TODO: Explain the relationship of CI to review. + +.. TODO: Explain the relationship of CI to merge. + +.. TODO: Explain the tool scripts for talking to CI systems. + +.. TODO: Give instructions for maintenance and extension. + +.. TODO: Explain how CI will interact with forks. What is required + for us to work with third-party submissions? + +.. FIXME: Link each design and implementation point to requirements. + RB 2023-02-26 + Introduction ============ @@ -136,8 +152,8 @@ versions, compiler versions, etc.? RB 2023-03-08] Design ====== -CI configurations ------------------ +Configuration +------------- .config: CI systems are usually configured though simple YAML files that give instructions for what to do on various events. @@ -155,6 +171,37 @@ of platforms. For example, ``test/check-rst`` or ``make testci``. Unfortunately, Windows often demands a different script. Duplication for Windows SHOULD be minimized. +_`.github.config`: `GitHub CI`_ is configured using several +"workflows" in the `.github/workflows directory +<../.github/workflows/>`_ of the MPS tree: + +- the `build-and-test.yml <../.github/workflows/build-and-test.yml>`_ + file runs build and test commands (`.run.posix`_ , `.run.windows`_). + +- the `shell-script-check.yml + <../.github/workflows/shell-script-check.yml>`_ file runs the + lint checks on shell scripts + +- the `rst-check.yml <../.github/workflows/shell-script-check.yml>`_ + file runs syntax checks on reStructuredText documents + +_`.cirrus.config`: `Cirrus CI`_ is configured using the `.cirrus.yml +<../.cirrus.yml>`_ file at top level of the MPS tree. + +_`.travis.config`: `Travis CI`_ is configured using the `.travis.yml +<../.travis.yml>`_ file at top level of the MPS tree. + +_`.readthedocs.config`: `Read the Docs`_ is configured using the +`.readthedocs.yml <../.readthedocs.yml>`_ file at the top level of the +MPS tree. + + +Administration +-------------- + +[FIXME: Insert links, instructions, and setups on the CI sites and in +the repo settings. RB 2023-02-09] + Checks ------ @@ -169,21 +216,6 @@ independent of platforms, so that defects in the Windows build are detected by checks run on Posix. Therefore, checks SHOULD NOT exclude files by platform. -[TODO: Review against each requirement and each implementation point. -Design connects them. RB 2023-02-26] - -[For inclusion: -- the testci make target -- relationship to review -- relationship to merge -- configuration files -- tool scripts -- how to extend -- forks -- 32-bit? - -RB 2023-02-09] - Implementation ============== @@ -397,41 +429,6 @@ _`.results.readthedocs`: Results from `Read the Docs`_ can be found at `_. -Configuration -------------- - -_`.github.config`: `GitHub CI`_ is configured using several -"workflows" in the `.github/workflows directory -<../.github/workflows/>`_ of the MPS tree: - -- the `build-and-test.yml <../.github/workflows/build-and-test.yml>`_ - file runs build and test commands (`.run.posix`_ , `.run.windows`_). - -- the `shell-script-check.yml - <../.github/workflows/shell-script-check.yml>`_ file runs the - lint checks on shell scripts - -[Coming soon from a branch/2023-01-13/rst-check near you: - -- the `rst-check.yml <../.github/workflows/shell-script-check.yml>`_ - file runs syntax checks on reStructuredText documents - -RB 2023-02-09] - -_`.cirrus.config`: `Cirrus CI`_ is configured using the `.cirrus.yml -<../.cirrus.yml>`_ file at top level of the MPS tree. - -_`.travis.config`: `Travis CI`_ is configured using the `.travis.yml -<../.travis.yml>`_ file at top level of the MPS tree. - - -Administration --------------- - -[FIXME: Insert links, instructions, and setups on the CI sites and in -the repo settings. RB 2023-02-09] - - Tools ----- @@ -443,9 +440,9 @@ _`.tools.kick`: `tool/github-ci-kick <../tool/github-ci-kick>`_ and `tool/travis-ci-kick <../tool/travis-ci-kick>`_ both trigger CI builds without the need to push a change or make a pull request in the `mps GitHub repo`_. In particular, they are useful for applying CI to work -that was pushed while CI was disabled, for whatever reason. - -[FIXME: No cirrus-ci-kick? Read the Docs kick? RB 2023-02-09] +that was pushed while CI was disabled, for whatever reason. There are +currently no kick scripts for `Cirrus CI`_ or `Read the Docs`_. As of +2023-03 they haven't been needed. References @@ -465,11 +462,7 @@ References 2023-02-08; . -[To include: - -- CI system documentation - -RB 2023-02-09] +[FIXME: include CI system documentation. RB 2023-02-09] Document History @@ -478,6 +471,8 @@ Document History ========== ===== ================================================== 2023-02-09 RB_ Split from design.mps.tests as part of GitHub `pull request #145`_. +2023-03-08 RB_ Including goals, requirements, and justification + of design. ========== ===== ================================================== .. _RB: mailto:rb@ravenbrook.com From 6cba37c6713efc5420cfa0b6728157ffe42d6209 Mon Sep 17 00:00:00 2001 From: Richard Brooksby Date: Wed, 15 Mar 2023 10:35:12 +0000 Subject: [PATCH 40/43] Correcting tag "design.mps.ci" to "design.ci" because CI is not *part* of the MPS. --- .cirrus.yml | 6 +++--- .github/workflows/build-and-test.yml | 8 ++++---- .github/workflows/shell-script-check.yml | 2 +- .travis.yml | 6 +++--- design/ci.txt | 2 +- design/tests.txt | 8 ++++---- manual/build.txt | 2 +- procedure/pull-request-merge.rst | 10 +++++----- readme.txt | 2 +- 9 files changed, 23 insertions(+), 23 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 0958a016d6..3bcb7a9505 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -2,7 +2,7 @@ # # Copyright (c) 2023 Ravenbrook Limited. See end of file for license. # -# See design.mps.ci. +# See design.ci.cirrus.config. # FIXME: Specify versions of OS and toolchains. Source? @@ -22,7 +22,7 @@ build_script_template: &BUILD_SCRIPT_TEMPLATE # so gather it here. - $CC --version - $CC -dumpmachine - # see design.mps.ci.run.posix + # see design.ci.run.posix - CC=$CC ./configure --prefix=$PWD/prefix && make install && make test # Override clone script to get the *trial merge* of a pull request @@ -44,7 +44,7 @@ clone_script_template: &CLONE_SCRIPT_TEMPLATE # The builds for Cirrus CI # -# See design.mps.ci.platforms +# See design.ci.platforms. XCA6LL_task: macos_instance: diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 267c7cbe23..590cbf7098 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -3,7 +3,7 @@ # Copyright (c) 2019-2022 `GitHub contributors`_ (MIT License). # Copyright (c) 2023 Ravenbrook Limited. See end of file for license. # -# See design.mps.ci. +# See design.ci.github.config. # # TODO: Exclude certain branches. # @@ -25,7 +25,7 @@ jobs: # The build matrix for GitHub CI on Posix platforms # - # See design.mps.ci.platforms. + # See design.ci.platforms. # # FreeBSD and ARM64 targets are in Travis CI, configured by # .travis.yml. @@ -42,7 +42,7 @@ jobs: runs-on: ${{ matrix.os }} - # See design.mps.ci.run.posix. + # See design.ci.run.posix. steps: - uses: actions/checkout@v3 - run: CC=${{ matrix.compiler }} ./configure @@ -53,7 +53,7 @@ jobs: runs-on: windows-latest - # See design.mps.ci.run.windows. + # See design.ci.run.windows. # # The path to Visual Studio is documented at # . diff --git a/.github/workflows/shell-script-check.yml b/.github/workflows/shell-script-check.yml index 1e398d1d65..86dfcba8e7 100644 --- a/.github/workflows/shell-script-check.yml +++ b/.github/workflows/shell-script-check.yml @@ -1,6 +1,6 @@ # .github/workflows/shell-script-check.yml -- check shell scripts # -# See design.mps.ci.run.other.checks. +# See design.ci.run.other.checks. # # This is a GitHub CI workflow # diff --git a/.travis.yml b/.travis.yml index 7079ef0fc0..303acbd586 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,7 @@ # # Copyright (c) 2013-2023 Ravenbrook Limited. See end of file for license. # -# See design.mps.ci. +# See design.ci.travis.config. # Some branches don't need builds. Add them here to avoid using build # resources and unnecessary build messages. @@ -15,7 +15,7 @@ language: c # see . # The build matrix for Travis CI # -# See design.mps.ci.platforms. +# See design.ci.platforms. os: - freebsd @@ -25,7 +25,7 @@ compiler: - clang - gcc -script: # see design.mps.ci.run.posix +script: # see design.ci.run.posix - ./configure --prefix=$PWD/prefix && make install && make test notifications: diff --git a/design/ci.txt b/design/ci.txt index 2bdae26e55..a2b14dd9a0 100644 --- a/design/ci.txt +++ b/design/ci.txt @@ -4,7 +4,7 @@ Continuous Integration ====================== -:Tag: design.mps.ci +:Tag: design.ci :Author: Richard Brooksby :Organization: Ravenbrook Limited :Date: 2023-02-09 diff --git a/design/tests.txt b/design/tests.txt index 00c346d20c..4f2ff757b5 100644 --- a/design/tests.txt +++ b/design/tests.txt @@ -60,11 +60,11 @@ MPS is built. _`.target.testci`: The ``testci`` target runs the `continuous integration`_ tests, the subset of tests that are expected to pass in -full-featured build configurations. See `design.mps.ci`_. +full-featured build configurations. See `design.ci`_. -.. _continuous integration: `design.mps.ci`_ +.. _continuous integration: `design.ci`_ -.. _design.mps.ci: ci.txt +.. _design.ci: ci.txt _`.target.testansi`: The ``testansi`` target runs the subset of the tests that are expected to pass in the generic ("ANSI") build @@ -333,7 +333,7 @@ Document History - 2023-01-15 RB_ Bringing CI section up to date with Travis configuration. Removing obsolete Jenkins info. Adding GitHub CI. -- 2023-02-09 RB_ Split CI into its own document: `design.mps.ci`_. +- 2023-02-09 RB_ Split CI into its own document: `design.ci`_. .. _RB: https://www.ravenbrook.com/consultants/rb/ .. _GDR: https://www.ravenbrook.com/consultants/gdr/ diff --git a/manual/build.txt b/manual/build.txt index d207fa3421..5485c23cae 100644 --- a/manual/build.txt +++ b/manual/build.txt @@ -172,7 +172,7 @@ well: listed as "supported" in readme.txt. .. IMPORTANT: The platforms listed here MAY be a superset of the - platforms listed in design.mps.ci.platforms but SHOULD be the same + platforms listed in design.ci.platforms but SHOULD be the same list so that the assertion of "regular access" above stays true. ========== ========= ============= ============ ================= diff --git a/procedure/pull-request-merge.rst b/procedure/pull-request-merge.rst index 15410ef490..3dbb70f067 100644 --- a/procedure/pull-request-merge.rst +++ b/procedure/pull-request-merge.rst @@ -131,7 +131,7 @@ When you finish the checklist, decide whether to start results are missing, inform sysadmins that CI isn't functioning. You can also look for a build results in the logs of CI systems. - See `design.mps.ci.results <../design/tests.txt#ci-results>`_. + See `design.ci.results <../design/tests.txt#ci-results>`_. Are the build results up to date? If master has changed since the date of the commit that kicked off the build (the one immediately @@ -158,9 +158,9 @@ When you finish the checklist, decide whether to start .. [#trial-merge] CI is run against both the branch (labelled "push"), and a `pull request merge branch`_ (labelled "pull request") automatically created by GitHub. See - `design.mps.ci.req.merge`_. + `design.ci.req.merge`_. -.. _design.mps.ci.req.merge: ../design/ci.txt#req-merge +.. _design.ci.req.merge: ../design/ci.txt#req-merge .. _permalink: https://docs.github.com/en/repositories/working-with-files/using-files/getting-permanent-links-to-files @@ -343,7 +343,7 @@ working repo before that point. git push github HEAD:merge/2023-01-06/speed-hax You will need to wait for results from CI. See - `design.mps.ci.results`_. + `design.ci.results`_. See build (step 5) about what to do if tests do not pass. @@ -463,7 +463,7 @@ According to `GitHub's "About pull request merges" request on GitHub.com, all commits from the feature branch are added to the base branch in a merge commit. -We also ensure (`design.mps.ci.req.merge`_) that CI results are valid +We also ensure (`design.ci.req.merge`_) that CI results are valid for this merge in advance. So, `once Git becomes the home diff --git a/readme.txt b/readme.txt index 8e4092c78c..c7b6c2dd62 100644 --- a/readme.txt +++ b/readme.txt @@ -78,7 +78,7 @@ The MPS is currently supported for deployment on: .. IMPORTANT: Maintain as a subset of platforms listed in manual/build.txt. -.. IMPORTANT: Maintain design.mps.ci as a superset of these platforms. +.. IMPORTANT: Maintain design.ci as a superset of these platforms. ====================== ============= ====================== Operating system Archtectures Toolchains From e6c97d2a7c004552e5115d3a8780b6234512b71b Mon Sep 17 00:00:00 2001 From: Richard Brooksby Date: Thu, 16 Mar 2023 09:24:02 +0000 Subject: [PATCH 41/43] Clarifying some TODOs. Drafting administration section. Drafting design for check scripts. Linking GitHub check actions to design and vice-versa. --- .github/workflows/fixme-check.yml | 2 + .github/workflows/rst-check.yml | 2 + .github/workflows/shell-script-check.yml | 2 +- design/ci.txt | 77 ++++++++++++++++++------ 4 files changed, 62 insertions(+), 21 deletions(-) diff --git a/.github/workflows/fixme-check.yml b/.github/workflows/fixme-check.yml index 7e34fea8ca..2a307182f5 100644 --- a/.github/workflows/fixme-check.yml +++ b/.github/workflows/fixme-check.yml @@ -1,5 +1,7 @@ # .github/workflows/fixme-check.yml -- check for FIXME task labels # +# See design.ci.run.checks. +# # This is a GitHub CI workflow # # to check for FIXME and similar task labels left unresolved in the diff --git a/.github/workflows/rst-check.yml b/.github/workflows/rst-check.yml index 329b1b2043..f4c44eec04 100644 --- a/.github/workflows/rst-check.yml +++ b/.github/workflows/rst-check.yml @@ -1,5 +1,7 @@ # .github/workflows/rst-check.yml -- check syntax of reStructuredText files # +# See design.ci.run.checks. +# # This is a GitHub CI workflow # # to check the syntax of reStructuredText files. diff --git a/.github/workflows/shell-script-check.yml b/.github/workflows/shell-script-check.yml index 86dfcba8e7..3ca3ad4f62 100644 --- a/.github/workflows/shell-script-check.yml +++ b/.github/workflows/shell-script-check.yml @@ -1,6 +1,6 @@ # .github/workflows/shell-script-check.yml -- check shell scripts # -# See design.ci.run.other.checks. +# See design.ci.run.checks. # # This is a GitHub CI workflow # diff --git a/design/ci.txt b/design/ci.txt index a2b14dd9a0..fa0d284b9a 100644 --- a/design/ci.txt +++ b/design/ci.txt @@ -15,7 +15,7 @@ Continuous Integration pair: CI; design .. TODO: Readership could be a role that doesn't include MPS - programmers. + programmers, such as "integrators". .. TODO: Discussion of compilers and toolchains. @@ -35,6 +35,8 @@ Continuous Integration .. FIXME: Link each design and implementation point to requirements. RB 2023-02-26 +.. FIXME: Link tags. RB 2023-03-16 + Introduction ============ @@ -145,7 +147,7 @@ or runs a lint tool. .req.check.results: Provide detailed results of checks. (goal.platforms) -[TODO: What do we need to do about *version* of platforms, e.g. kernel +[TODO: What is required about *version* of platforms, e.g. kernel versions, compiler versions, etc.? RB 2023-03-08] @@ -199,13 +201,49 @@ MPS tree. Administration -------------- -[FIXME: Insert links, instructions, and setups on the CI sites and in -the repo settings. RB 2023-02-09] +_`.github.admin`: `GitHub CI`_ is build on GitHub Actions, which are +managed in `the Actions section of the MPS repo settings +`__. The repo +uses the default settings. + +_`.cirrus.admin`: `Cirrus CI`_ is managed in the `Settings for +Ravenbrook page of the Cirrus CI app +`__. The settings +are defaults. + +_`.cirrus.github`: `Cirrus CI`_ uses a GitHub app to monitor activity +in the MPS repo and kick off builds. The app is managed in the +`GitHub apps section of the MPS repo settings +`__. The +settings are defaults. + +_`.travis.admin`: `Travis CI`_ is managed on the `Ravenbrook / mps +page of the Travis CI app +`__ but the *account +plan* is managed on the `Ravenbrook plan page +`__. + +_`.travis.github`: `Travis CI`_ uses a GitHub app to monitor activity +in the MPS repo and kick off builds. The app is managed in the +`GitHub apps section of the MPS repo settings +`__. The +settings are defaults. + +_`.readthedocs.admin`: `Read the Docs`_ is managed on the `Memory Pool +System project page +`__. [FIXME: +Write about managing Read the Docs versions and builds. RB +2023-03-16] Checks ------ +.design.check.script: Checks SHOULD be implemented as executable +scripts in the tool directory at the root of the MPS tree. This keeps +the CI config simple (.config.kiss) and allows checks, like builds, to +be run by developers from the command line. + .design.check.posix: Checks MUST run on Posix but MAY also run on Windows. The majority of CI systems run on Posix, with macOS as a special case. Linux features that are not available in macOS (which @@ -359,33 +397,32 @@ commands equivalent to:: ./configure && make install && make test which execises the testci target, as defined by `Makefile.in -<../Makefile.in>`_ in the root of the MPS tree. +<../Makefile.in>`_ in the root of the MPS tree. See also +.config.kiss. _`.run.windows`: On Windows the CI services run commands that do at least:: nmake /f w3i6mv.nmk all testci -as defined by the `.github.config`_. +as defined by the `.github.config`_. See also .config.kiss. -_`.run.other.targets`: On some platforms we arrange to run the testansi, -testpollnone, testratio, and testscheme targets. [Need to explain -why, where, etc. RB 2023-01-15] +_`.run.other.targets`: On some platforms we arrange to run the +testansi, testpollnone, testratio, and testscheme targets. [TODO: +Investigate and explain why, where, etc. RB 2023-01-15] -_`.run.manual`: The manual is built by Read the Docs which directly -invokes Sphinx, so there are no commands. +_`.run.manual`: The manual is built by Read the Docs which `directly +invokes Sphinx +`__, +so there are no commands. -_`.run.other.checks`: We could also run various non-build checks -using CI to check: +_`.run.checks`: We also run various non-build checks using CI to check +things like document formatting and lint shell scripts. Each of these +runs a single command like:: -- document formatting -- shell script syntax + tool/check-rst -[In the branch of writing, these do not yet exist. They are the -subject of `GitHub pull request #113 -`_ of -branch/2023-01-13/rst-check. When merged, they can be linked. RB -2023-01-15] +(see .design.check.script). Events From f5f3d23303ae45448d7f509c5a4fc0eba751f997 Mon Sep 17 00:00:00 2001 From: Richard Brooksby Date: Thu, 16 Mar 2023 09:33:55 +0000 Subject: [PATCH 42/43] Linking tags. --- design/ci.txt | 140 +++++++++++++++++++++++++------------------------- 1 file changed, 70 insertions(+), 70 deletions(-) diff --git a/design/ci.txt b/design/ci.txt index fa0d284b9a..75e51c7836 100644 --- a/design/ci.txt +++ b/design/ci.txt @@ -56,96 +56,96 @@ the design to succeed in achieving its goals. Goals ===== -.goal.platforms: Reduce the cost to developers and collaborators of +_`.goal.platforms`: Reduce the cost to developers and collaborators of supporting target platforms. -.goal.detect: Detect introduced defects early in development so that +_`.goal.detect`: Detect introduced defects early in development so that they can be fixed at lower cost. -.goal.publish: Publish documentation promptly and cheaply. +_`.goal.publish`: Publish documentation promptly and cheaply. Requirements ============ -.req.rapid: Provide build and test results within 30 minutes of -submission of changes. (goal.detect) +_`.req.rapid`: Provide build and test results within 30 minutes of +submission of changes. (`.goal.detect`_) -.req.branch: Provide build and test results for submissions to -development branches (pushes). (goal.detect) +_`.req.branch`: Provide build and test results for submissions to +development branches (pushes). (`.goal.detect`_) -.req.merge: Provide build and test results for merge candidate changes -(pull requests) before they are merged to master. (goal.detect) +_`.req.merge`: Provide build and test results for merge candidate changes +(pull requests) before they are merged to master. (`.goal.detect`_) -.req.platforms: Build and test on all supported target platforms +_`.req.platforms`: Build and test on all supported target platforms defined in `Building the Memory Pool System <../manual/build.txt>`_ -(goal.platforms). [TODO: The target platforms should be referencable +(`.goal.platforms`_). [TODO: The target platforms should be referencable by tag. See also `GitHub issue #147 `_. RB 2023-03-08] -.req.cost: Cost no money in normal circumstances. (This also supports -.req.fork.) (goal.platforms, goal.detect, goal.publish) +_`.req.cost`: Cost no money in normal circumstances. (This also supports +.req.fork.) (`.goal.platforms`_, `.goal.detect`_, `.goal.publish`_) -.req.fork: Operate on forks of the repo. (goal.platforms, goal.detect) +_`.req.fork`: Operate on forks of the repo. (`.goal.platforms`_, `.goal.detect`_) -.req.maintinable: Low maintenance overhead. [Around 20 h/year or 1%. -RB 2023-02-26] (goal.platforms) +_`.req.maintainable`: Low maintenance overhead. [Around 20 h/year or 1%. +RB 2023-02-26] (`.goal.platforms`_) -.req.extensible: Easy to extend with new platforms, improvements, and -defect prevention. (goal.platforms, goal.publish) +_`.req.extensible`: Easy to extend with new platforms, improvements, and +defect prevention. (`.goal.platforms`_, `.goal.publish`_) -.req.portable: Be portable away from any particular hosting service, -e.g. GitHub, at reasonable cost. (goal.platforms, goal.publish) +_`.req.portable`: Be portable away from any particular hosting service, +e.g. GitHub, at reasonable cost. (`.goal.platforms`_, `.goal.publish`_) -.req.admin: Administration is available to more than one person. -(goal.platforms, goal,publish) +_`.req.admin`: Administration is available to more than one person. +(`.goal.platforms`_, goal,publish) -.req.manual: Publish the manual. +_`.req.manual`: Publish the manual. -.req.manual.versions: Publish versions of the manual that document +_`.req.manual.versions`: Publish versions of the manual that document releases. -.req.build.code: Check that changed code compiles correctly without +_`.req.build.code`: Check that changed code compiles correctly without errors or warnings. -.req.build.manual: Check that the manual builds correctly without +_`.req.build.manual`: Check that the manual builds correctly without errors or warnings. -.req.test: Allow the running of tests (.def.test) on target platforms. -(goal.detect) +_`.req.test`: Allow the running of tests (`.def.test`_) on target platforms. +(`.goal.detect`_) -.def.test: A "test" is something that runs the compiled MPS in order +_`.def.test`: A "test" is something that runs the compiled MPS in order to determine facts about it: find defects, check performance, etc. -.req.test.coverage: Includes all tests. (goal.detect, goal.platforms) +_`.req.test.coverage`: Includes all tests. (`.goal.detect`_, `.goal.platforms`_) -.req.test.detect: Detect wheter tests find any defects. (goal.detect) +_`.req.test.detect`: Detect wheter tests find any defects. (`.goal.detect`_) -.req.test.results: Provide detailed test results to diagnose defects. -(goal.platforms) +_`.req.test.results`: Provide detailed test results to diagnose defects. +(`.goal.platforms`_) -.req.test.real: Test the attributes of realistic target platforms, +_`.req.test.real`: Test the attributes of realistic target platforms, e.g. test interacting with the real target kernel rather than a virtualized simulation. This is especially important for performance -tests. (goal.detect) +tests. (`.goal.detect`_) -.req.test.type: Test for all the types defects for which we have +_`.req.test.type`: Test for all the types defects for which we have tests. [TODO: Analyse and specify explicitly what types of tests are required, probably in design.mps.tests, and reference here. RB 2023-03-08.] -.req.check: Allow programmatic checks (.def.check) of the MPS source +_`.req.check`: Allow programmatic checks (`.def.check`_) of the MPS source tree. -.def.check: A "check", as opposed to a "test" of the compiled MPS, is +_`.def.check`: A "check", as opposed to a "test" of the compiled MPS, is something that e.g. finds missing cross-references, inconsistencies, or runs a lint tool. -.req.check.coverage: Include all checks. (goal.detect) +_`.req.check.coverage`: Include all checks. (`.goal.detect`_) -.req.check.detect: Detect whether checks find any defects. (goal.detect) +_`.req.check.detect`: Detect whether checks find any defects. (`.goal.detect`_) -.req.check.results: Provide detailed results of checks. (goal.platforms) +_`.req.check.results`: Provide detailed results of checks. (`.goal.platforms`_) [TODO: What is required about *version* of platforms, e.g. kernel versions, compiler versions, etc.? RB 2023-03-08] @@ -157,17 +157,17 @@ Design Configuration ------------- -.config: CI systems are usually configured though simple YAML files +_`.config`: CI systems are usually configured though simple YAML files that give instructions for what to do on various events. -.config.kiss: CI setups SHOULD be kept as simple as possible to meet -.req.maintainable and .req.portable. +_`.config.kiss`: CI setups SHOULD be kept as simple as possible to meet +`.req.maintainable`_ and `.req.portable`_. -.config.one-line: Each CI configuration SHOULD be a single command +_`.config.one-line`: Each CI configuration SHOULD be a single command line that invokes part of the MPS build system. Something like ``./configure && make all testci``. -.config.cross-platform: The .design.config.one-line command SHOULD +_`.config.cross-platform`: The .design.config.one-line command SHOULD invoke a platform independent script, so that we get uniform coverage of platforms. For example, ``test/check-rst`` or ``make testci``. Unfortunately, Windows often demands a different script. Duplication @@ -239,17 +239,17 @@ Write about managing Read the Docs versions and builds. RB Checks ------ -.design.check.script: Checks SHOULD be implemented as executable +_`.design.check.script`: Checks SHOULD be implemented as executable scripts in the tool directory at the root of the MPS tree. This keeps the CI config simple (.config.kiss) and allows checks, like builds, to be run by developers from the command line. -.design.check.posix: Checks MUST run on Posix but MAY also run on +_`.design.check.posix`: Checks MUST run on Posix but MAY also run on Windows. The majority of CI systems run on Posix, with macOS as a special case. Linux features that are not available in macOS (which is based on BSD) SHOULD NOT be used. -.design.check.cross-platform: Checks SHOULD be designed to be +_`.design.check.cross-platform`: Checks SHOULD be designed to be independent of platforms, so that defects in the Windows build are detected by checks run on Posix. Therefore, checks SHOULD NOT exclude files by platform. @@ -263,8 +263,8 @@ Services _`.service`: The `Ravenbrook MPS repository on GitHub `_ uses third-party continuous -integration services in order to meet .req.platforms, -.req.maintainable, and .req.extensible without the overhead of +integration services in order to meet `.req.platforms`_, +`.req.maintainable`_, and `.req.extensible`_ without the overhead of maintaining a lot systems. _`.service.choice`: The services have been chosen to best meet @@ -280,35 +280,35 @@ _`.service.github`: `GitHub CI`_ uses `GitHub Actions and can orchestrate external "`self-hosted runners `__". -- `GitHub CI`_ is free to use for public repositories (.req.cost). +- `GitHub CI`_ is free to use for public repositories (`.req.cost`_). -- `GitHub CI`_ only provides hosted runners for amd64 (.req.plaforms). +- `GitHub CI`_ only provides hosted runners for amd64 (`.req.platforms`_). -- `GitHub CI`_ does not support FreeBSD, even for self-hosted runners (.req.platforms). +- `GitHub CI`_ does not support FreeBSD, even for self-hosted runners (`.req.platforms`_). -- There is a hazard of GitHub lock-in (.req.portable). +- There is a hazard of GitHub lock-in (`.req.portable`_). -- `GitHub CI`_ is also used to run checks (`.run.other.checks`_, .req.check). +- `GitHub CI`_ is also used to run checks (`.run.checks`_, `.req.check`_). - `GitHub CI`_ builds both `pushes and pull requests `__ - (.req.branch, .req.merge). + (`.req.branch`_, `.req.merge`_). _`.service.cirrus`: `Cirrus CI`_ mainly uses Google Compute Cloud to run public images, mainly Docker images. -- `Cirrus CI`_ is free to use for public repositories (.req.cost). +- `Cirrus CI`_ is free to use for public repositories (`.req.cost`_). - `Cirrus CI`_ provides macOS M1 (Apple Silicon) using `Tart `_ and so can provide coverage - for XCA6LL (.req.platforms). + for XCA6LL (`.req.platforms`_). - `Cirrus CI`_ can orchestrate Amazon EC2 for extra control, though we don't currently use this feature. It could be used to meet - .req.test.real. + `.req.test.real`_. - `Cirrus CI`_ can provide FreeBSD on amd64 but not arm64 - (.req.platforms). + (`.req.platforms`_). - `Cirrus CI`_ builds either pushes or pull requests, but not both. [TODO: Escalate `my workaround @@ -317,28 +317,28 @@ run public images, mainly Docker images. _`.service.travis`: `Travis CI`_ is a commercial system that provides a wide variety of platforms and simple configuration -(.req.maintainable). +(`.req.maintainable`_). -- `Travis CI`_ is a paid service with limited concurrency (.req.cost). +- `Travis CI`_ is a paid service with limited concurrency (`.req.cost`_). -- `Travis CI is slow and expensive`_ (.req.cost, .req.rapid). +- `Travis CI is slow and expensive`_ (`.req.cost`_, `.req.rapid`_). - Ravenbrook has negotiated a quota of "OSS credits" with Travis for the public MPS repo [Travis_42376]_. - `Travis CI`_ builds both `pushes and pull requests `__ - (.req.branch, .req.merge). + (`.req.branch`_, `.req.merge`_). _`.service.readthedocs`: `Read the Docs`_ is used build and publish the `MPS manual `_ -(.req.manual, req.build.manual). +(`.req.manual`_, `.req.build.manual`_). - `Read the Docs`_ builds `pull requests `__ automatically, and can build `branches `__ - (.req.branch, .req.merge). + (`.req.branch`_, `.req.merge`_). .. _GitHub CI: https://docs.github.com/en/actions/automating-builds-and-tests/about-continuous-integration @@ -355,7 +355,7 @@ Platforms --------- _`.platforms`: This table shows how each defined platform -(.req.platforms) is built and tested by CI. +(`.req.platforms`_) is built and tested by CI. ========== ============ ===================================== Platform Service Notes @@ -380,11 +380,11 @@ Platform Service Notes ========== ============ ===================================== _`.platform.supported`: The platforms here MUST be a superset of the -platforms listed as "supported" in readme.txt (.req.platforms). +platforms listed as "supported" in readme.txt (`.req.platforms`_). _`.platform.builds`: The platforms here MUST be a subset of the platforms listed in "Building the MPS" manual/build.txt, but SHOULD be -the same set so that CI covers all defined platforms (.req.platforms). +the same set so that CI covers all defined platforms (`.req.platforms`_). Commands From 32185edb514e044d2ff7be7001f65ad24a989dbc Mon Sep 17 00:00:00 2001 From: Richard Brooksby Date: Fri, 17 Mar 2023 15:47:45 +0000 Subject: [PATCH 43/43] Another pass of improvements including quantified requirememnts, clarification, linking to design.mps.tests, and more justification. --- design/ci.txt | 98 ++++++++++++++++++++++++++++++--------------------- 1 file changed, 57 insertions(+), 41 deletions(-) diff --git a/design/ci.txt b/design/ci.txt index 75e51c7836..5431260d6d 100644 --- a/design/ci.txt +++ b/design/ci.txt @@ -83,41 +83,52 @@ defined in `Building the Memory Pool System <../manual/build.txt>`_ by tag. See also `GitHub issue #147 `_. RB 2023-03-08] -_`.req.cost`: Cost no money in normal circumstances. (This also supports -.req.fork.) (`.goal.platforms`_, `.goal.detect`_, `.goal.publish`_) +_`.req.cost`: Cost no money in normal circumstances. (This also +supports `.req.fork`_) (`.goal.platforms`_, `.goal.detect`_, +`.goal.publish`_) -_`.req.fork`: Operate on forks of the repo. (`.goal.platforms`_, `.goal.detect`_) +_`.req.fork`: Operate on forks of the repo, to further promote early +detection. (`.goal.platforms`_, `.goal.detect`_) -_`.req.maintainable`: Low maintenance overhead. [Around 20 h/year or 1%. -RB 2023-02-26] (`.goal.platforms`_) +_`.req.maintainable`: Low maintenance overhead. Around 20 h/year, +which is about 1% of a person. (`.goal.platforms`_) -_`.req.extensible`: Easy to extend with new platforms, improvements, and -defect prevention. (`.goal.platforms`_, `.goal.publish`_) +_`.req.extensible`: Easy to extend with new platforms, improvements, +and defect prevention. Less than 4 h of work to add a new platform or +check (not including the development of the port or check). +(`.goal.platforms`_, `.goal.publish`_) -_`.req.portable`: Be portable away from any particular hosting service, -e.g. GitHub, at reasonable cost. (`.goal.platforms`_, `.goal.publish`_) +_`.req.portable`: Be portable away from any particular hosting +service, e.g. GitHub, in less than 40 h of work. (`.goal.platforms`_, +`.goal.publish`_) -_`.req.admin`: Administration is available to more than one person. -(`.goal.platforms`_, goal,publish) +_`.req.admin`: Administration is available to more than one person in +the organization. (`.goal.platforms`_, `.goal.publish`_) -_`.req.manual`: Publish the manual. +_`.req.manual`: Publish the manual. [TODO: Define where, how prompty, +etc. RB 2023-03-17] _`.req.manual.versions`: Publish versions of the manual that document -releases. +releases. [TODO: Connect with version and release procedures. RB +2023-03-17] -_`.req.build.code`: Check that changed code compiles correctly without +_`.req.build.code`: Check that the MPS code compiles correctly without errors or warnings. _`.req.build.manual`: Check that the manual builds correctly without errors or warnings. -_`.req.test`: Allow the running of tests (`.def.test`_) on target platforms. -(`.goal.detect`_) +_`.req.test`: Detect defects detected by tests +(`design.mps.tests`_) on target platforms. (`.goal.detect`_) -_`.def.test`: A "test" is something that runs the compiled MPS in order -to determine facts about it: find defects, check performance, etc. +.. _design.mps.tests: tests.txt -_`.req.test.coverage`: Includes all tests. (`.goal.detect`_, `.goal.platforms`_) +_`.req.test.coverage`: Includes all CI tests +(`design.mps.tests.target.testci`_). (`.goal.detect`_, +`.goal.platforms`_) [TODO: This is a circular definition. What +determines whether a test is in this set? RB 2023-03-17] + +.. _design.mps.tests.target.testci: tests.txt#target-testci _`.req.test.detect`: Detect wheter tests find any defects. (`.goal.detect`_) @@ -131,11 +142,11 @@ tests. (`.goal.detect`_) _`.req.test.type`: Test for all the types defects for which we have tests. [TODO: Analyse and specify explicitly what types of tests are -required, probably in design.mps.tests, and reference here. RB +required, probably in `design.mps.tests`_, and reference here. RB 2023-03-08.] -_`.req.check`: Allow programmatic checks (`.def.check`_) of the MPS source -tree. +_`.req.check`: Detect defects detected by programmatic checks +(`.def.check`_) of the MPS source tree. _`.def.check`: A "check", as opposed to a "test" of the compiled MPS, is something that e.g. finds missing cross-references, inconsistencies, @@ -164,18 +175,20 @@ _`.config.kiss`: CI setups SHOULD be kept as simple as possible to meet `.req.maintainable`_ and `.req.portable`_. _`.config.one-line`: Each CI configuration SHOULD be a single command -line that invokes part of the MPS build system. Something like -``./configure && make all testci``. +line that invokes part of the MPS build system. (See `.run.posix`_ +and `.run.windows`_.) -_`.config.cross-platform`: The .design.config.one-line command SHOULD +_`.config.cross-platform`: The `.config.one-line`_ command SHOULD invoke a platform independent script, so that we get uniform coverage of platforms. For example, ``test/check-rst`` or ``make testci``. Unfortunately, Windows often demands a different script. Duplication for Windows SHOULD be minimized. _`.github.config`: `GitHub CI`_ is configured using several -"workflows" in the `.github/workflows directory -<../.github/workflows/>`_ of the MPS tree: +`"workflows" +`__ +in the `.github/workflows directory <../.github/workflows/>`_ of the +MPS tree: - the `build-and-test.yml <../.github/workflows/build-and-test.yml>`_ file runs build and test commands (`.run.posix`_ , `.run.windows`_). @@ -241,18 +254,21 @@ Checks _`.design.check.script`: Checks SHOULD be implemented as executable scripts in the tool directory at the root of the MPS tree. This keeps -the CI config simple (.config.kiss) and allows checks, like builds, to -be run by developers from the command line. +the CI config simple (`.config.kiss`_) and allows checks, like builds, +to be run by developers from the command line (`.goal.detect`_). + +_`.design.check.posix`: Checks MUST run on Posix. Checks MAY also run +on Windows. Checks SHOULD run on Posix layered on Windows, such +`WSL`_. The majority of CI systems run on Posix, which includes +macOS. Linux features that are not available in macOS (which is based +on BSD) SHOULD NOT be used. -_`.design.check.posix`: Checks MUST run on Posix but MAY also run on -Windows. The majority of CI systems run on Posix, with macOS as a -special case. Linux features that are not available in macOS (which -is based on BSD) SHOULD NOT be used. +.. _WSL: https://learn.microsoft.com/en-us/windows/wsl/about _`.design.check.cross-platform`: Checks SHOULD be designed to be -independent of platforms, so that defects in the Windows build are -detected by checks run on Posix. Therefore, checks SHOULD NOT exclude -files by platform. +independent of target platforms, so that defects in the Windows build +are detected by checks run on Posix. Therefore, checks SHOULD NOT +exclude files by platform (`.goal.detect`_). Implementation @@ -271,7 +287,7 @@ _`.service.choice`: The services have been chosen to best meet requirements, with the best fit earliest in the list. Therefore, we SHOULD favour the services higher up this list when making changes. -[TODO: Is .req.test.real adequately met? RB 2023-03-08] +[TODO: Is `.req.test.real`_ adequately met? RB 2023-03-08] _`.service.github`: `GitHub CI`_ uses `GitHub Actions `__ to trigger builds on @@ -397,15 +413,15 @@ commands equivalent to:: ./configure && make install && make test which execises the testci target, as defined by `Makefile.in -<../Makefile.in>`_ in the root of the MPS tree. See also -.config.kiss. +<../Makefile.in>`_ in the root of the MPS tree. (See +`.config.one-line`_.) _`.run.windows`: On Windows the CI services run commands that do at least:: nmake /f w3i6mv.nmk all testci -as defined by the `.github.config`_. See also .config.kiss. +as defined by the `.github.config`_. (See `.config.one-line`_.) _`.run.other.targets`: On some platforms we arrange to run the testansi, testpollnone, testratio, and testscheme targets. [TODO: @@ -422,7 +438,7 @@ runs a single command like:: tool/check-rst -(see .design.check.script). +(see `.design.check.script`_). Events