The Trick Simulation Environment, developed at the NASA Johnson Space Center, is a powerful simulation development framework that enables users to build applications for all phases of space vehicle development. Trick expedites the creation of simulations for early vehicle design, performance evaluation, flight software development, flight vehicle dynamic load analysis, and virtual/hardware in the loop training. Trick's purpose is to provide a common set of simulation capabilities that allow users to concentrate on their domain specific models, rather than simulation-specific functions like job ordering, input file processing, or data recording.
@@ -66,6 +66,20 @@ The Trick Simulation Environment, developed at the NASA Johnson Space Center, is
+
Read detailed documentation for various Trick internals and processes.
+
+
+
+
---
Trick is released under the NASA Open Source Agreement Version 1.3 [license](https://github.com/nasa/trick/blob/master/LICENSE).
diff --git a/TrickLogo_darkmode.png b/TrickLogo_darkmode.png
new file mode 100644
index 00000000..b9436fd0
Binary files /dev/null and b/TrickLogo_darkmode.png differ
diff --git a/autoconf/config.guess b/autoconf/config.guess
old mode 100755
new mode 100644
index b79252d6..a419d864
--- a/autoconf/config.guess
+++ b/autoconf/config.guess
@@ -1,12 +1,14 @@
#! /bin/sh
# Attempt to guess a canonical system name.
-# Copyright 1992-2013 Free Software Foundation, Inc.
+# Copyright 1992-2022 Free Software Foundation, Inc.
-timestamp='2013-06-10'
+# shellcheck disable=SC2006,SC2268 # see below for rationale
+
+timestamp='2022-08-01'
# 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
+# 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
@@ -15,7 +17,7 @@ timestamp='2013-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
@@ -24,12 +26,20 @@ timestamp='2013-06-10'
# program. This Exception is an additional permission under section 7
# of the GNU General Public License, version 3 ("GPLv3").
#
-# Originally written by Per Bothner.
+# 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/cgit/config.git/plain/config.guess
#
-# Please send patches with a ChangeLog entry to config-patches@gnu.org.
+# Please send patches to .
+
+
+# The "shellcheck disable" line above the timestamp inhibits complaints
+# about features and limitations of the classic Bourne shell that were
+# superseded or lifted in POSIX. However, this script identifies a wide
+# variety of pre-POSIX systems that do not have POSIX shells at all, and
+# even some reasonably current systems (Solaris 10 as case-in-point) still
+# have a pre-POSIX /bin/sh.
me=`echo "$0" | sed -e 's,.*/,,'`
@@ -39,7 +49,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
@@ -50,7 +60,7 @@ version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
-Copyright 1992-2013 Free Software Foundation, Inc.
+Copyright 1992-2022 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."
@@ -84,7 +94,8 @@ if test $# != 0; then
exit 1
fi
-trap 'exit 1' 1 2 15
+# Just in case it came from the environment.
+GUESS=
# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
# compiler to aid in system detection is discouraged as it requires
@@ -96,66 +107,90 @@ trap 'exit 1' 1 2 15
# Portable tmp directory creation inspired by the Autoconf team.
-set_cc_for_build='
-trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
-trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
-: ${TMPDIR=/tmp} ;
- { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
- { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
- { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
- { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
-dummy=$tmp/dummy ;
-tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
-case $CC_FOR_BUILD,$HOST_CC,$CC in
- ,,) echo "int x;" > $dummy.c ;
- for c in cc gcc c89 c99 ; do
- if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
- CC_FOR_BUILD="$c"; break ;
- fi ;
- done ;
- if test x"$CC_FOR_BUILD" = x ; then
- CC_FOR_BUILD=no_compiler_found ;
- fi
- ;;
- ,,*) CC_FOR_BUILD=$CC ;;
- ,*,*) CC_FOR_BUILD=$HOST_CC ;;
-esac ; set_cc_for_build= ;'
+tmp=
+# shellcheck disable=SC2172
+trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15
+
+set_cc_for_build() {
+ # prevent multiple calls if $tmp is already set
+ test "$tmp" && return 0
+ : "${TMPDIR=/tmp}"
+ # shellcheck disable=SC2039,SC3028
+ { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } ||
+ { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } ||
+ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; }
+ dummy=$tmp/dummy
+ case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in
+ ,,) echo "int x;" > "$dummy.c"
+ for driver in cc gcc c89 c99 ; do
+ if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
+ CC_FOR_BUILD=$driver
+ break
+ fi
+ done
+ if test x"$CC_FOR_BUILD" = x ; then
+ CC_FOR_BUILD=no_compiler_found
+ fi
+ ;;
+ ,,*) CC_FOR_BUILD=$CC ;;
+ ,*,*) CC_FOR_BUILD=$HOST_CC ;;
+ esac
+}
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
# (ghazi@noc.rutgers.edu 1994-08-24)
-if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+if test -f /.attbin/uname ; then
PATH=$PATH:/.attbin ; export PATH
fi
UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
-UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
+UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
-case "${UNAME_SYSTEM}" in
+case $UNAME_SYSTEM in
Linux|GNU|GNU/*)
- # If the system lacks a compiler, then just pick glibc.
- # We could probably try harder.
- LIBC=gnu
+ LIBC=unknown
- eval $set_cc_for_build
- cat <<-EOF > $dummy.c
+ set_cc_for_build
+ cat <<-EOF > "$dummy.c"
#include
#if defined(__UCLIBC__)
LIBC=uclibc
#elif defined(__dietlibc__)
LIBC=dietlibc
- #else
+ #elif defined(__GLIBC__)
LIBC=gnu
+ #else
+ #include
+ /* First heuristic to detect musl libc. */
+ #ifdef __DEFINED_va_list
+ LIBC=musl
+ #endif
#endif
EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
+ cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
+ eval "$cc_set_libc"
+
+ # Second heuristic to detect musl libc.
+ if [ "$LIBC" = unknown ] &&
+ command -v ldd >/dev/null &&
+ ldd --version 2>&1 | grep -q ^musl; then
+ LIBC=musl
+ fi
+
+ # If the system lacks a compiler, then just pick glibc.
+ # We could probably try harder.
+ if [ "$LIBC" = unknown ]; then
+ LIBC=gnu
+ 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*,
@@ -167,22 +202,32 @@ 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 -n hw.machine_arch 2>/dev/null || \
+ /usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \
+ echo unknown)`
+ case $UNAME_MACHINE_ARCH in
+ aarch64eb) machine=aarch64_be-unknown ;;
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
+ set_cc_for_build
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ELF__
then
@@ -197,45 +242,80 @@ 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}"
- exit ;;
+ GUESS=$machine-${os}${release}${abi-}
+ ;;
*:Bitrig:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
- echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
- exit ;;
+ GUESS=$UNAME_MACHINE_ARCH-unknown-bitrig$UNAME_RELEASE
+ ;;
*:OpenBSD:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
- echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
- exit ;;
+ GUESS=$UNAME_MACHINE_ARCH-unknown-openbsd$UNAME_RELEASE
+ ;;
+ *:SecBSD:*:*)
+ UNAME_MACHINE_ARCH=`arch | sed 's/SecBSD.//'`
+ GUESS=$UNAME_MACHINE_ARCH-unknown-secbsd$UNAME_RELEASE
+ ;;
+ *:LibertyBSD:*:*)
+ UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
+ GUESS=$UNAME_MACHINE_ARCH-unknown-libertybsd$UNAME_RELEASE
+ ;;
+ *:MidnightBSD:*:*)
+ GUESS=$UNAME_MACHINE-unknown-midnightbsd$UNAME_RELEASE
+ ;;
*:ekkoBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-ekkobsd$UNAME_RELEASE
+ ;;
*:SolidBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-solidbsd$UNAME_RELEASE
+ ;;
+ *:OS108:*:*)
+ GUESS=$UNAME_MACHINE-unknown-os108_$UNAME_RELEASE
+ ;;
macppc:MirBSD:*:*)
- echo powerpc-unknown-mirbsd${UNAME_RELEASE}
- exit ;;
+ GUESS=powerpc-unknown-mirbsd$UNAME_RELEASE
+ ;;
*:MirBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-mirbsd$UNAME_RELEASE
+ ;;
+ *:Sortix:*:*)
+ GUESS=$UNAME_MACHINE-unknown-sortix
+ ;;
+ *:Twizzler:*:*)
+ GUESS=$UNAME_MACHINE-unknown-twizzler
+ ;;
+ *:Redox:*:*)
+ GUESS=$UNAME_MACHINE-unknown-redox
+ ;;
+ mips:OSF1:*.*)
+ GUESS=mips-dec-osf1
+ ;;
alpha:OSF1:*:*)
+ # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
+ trap '' 0
case $UNAME_RELEASE in
*4.0)
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
@@ -249,163 +329,158 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# covers most systems running today. This code pipes the CPU
# types through head -n 1, so we only detect the type of CPU 0.
ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
- case "$ALPHA_CPU_TYPE" in
+ 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'`
- # 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 ;;
+ OSF_REL=`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
+ GUESS=$UNAME_MACHINE-dec-osf$OSF_REL
+ ;;
Amiga*:UNIX_System_V:4.0:*)
- echo m68k-unknown-sysv4
- exit ;;
+ GUESS=m68k-unknown-sysv4
+ ;;
*:[Aa]miga[Oo][Ss]:*:*)
- echo ${UNAME_MACHINE}-unknown-amigaos
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-amigaos
+ ;;
*:[Mm]orph[Oo][Ss]:*:*)
- echo ${UNAME_MACHINE}-unknown-morphos
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-morphos
+ ;;
*:OS/390:*:*)
- echo i370-ibm-openedition
- exit ;;
+ GUESS=i370-ibm-openedition
+ ;;
*:z/VM:*:*)
- echo s390-ibm-zvmoe
- exit ;;
+ GUESS=s390-ibm-zvmoe
+ ;;
*:OS400:*:*)
- echo powerpc-ibm-os400
- exit ;;
+ GUESS=powerpc-ibm-os400
+ ;;
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
- echo arm-acorn-riscix${UNAME_RELEASE}
- exit ;;
+ GUESS=arm-acorn-riscix$UNAME_RELEASE
+ ;;
arm*:riscos:*:*|arm*:RISCOS:*:*)
- echo arm-unknown-riscos
- exit ;;
+ GUESS=arm-unknown-riscos
+ ;;
SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
- echo hppa1.1-hitachi-hiuxmpp
- exit ;;
+ GUESS=hppa1.1-hitachi-hiuxmpp
+ ;;
Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
- if test "`(/bin/universe) 2>/dev/null`" = att ; then
- echo pyramid-pyramid-sysv3
- else
- echo pyramid-pyramid-bsd
- fi
- exit ;;
+ case `(/bin/universe) 2>/dev/null` in
+ att) GUESS=pyramid-pyramid-sysv3 ;;
+ *) GUESS=pyramid-pyramid-bsd ;;
+ esac
+ ;;
NILE*:*:*:dcosx)
- echo pyramid-pyramid-svr4
- exit ;;
+ GUESS=pyramid-pyramid-svr4
+ ;;
DRS?6000:unix:4.0:6*)
- echo sparc-icl-nx6
- exit ;;
+ GUESS=sparc-icl-nx6
+ ;;
DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
case `/usr/bin/uname -p` in
- sparc) echo sparc-icl-nx7; exit ;;
- esac ;;
+ sparc) GUESS=sparc-icl-nx7 ;;
+ esac
+ ;;
s390x:SunOS:*:*)
- echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
+ SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
+ GUESS=$UNAME_MACHINE-ibm-solaris2$SUN_REL
+ ;;
sun4H:SunOS:5.*:*)
- echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
+ SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
+ GUESS=sparc-hal-solaris2$SUN_REL
+ ;;
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
- echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
+ SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
+ GUESS=sparc-sun-solaris2$SUN_REL
+ ;;
i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
- echo i386-pc-auroraux${UNAME_RELEASE}
- exit ;;
+ GUESS=i386-pc-auroraux$UNAME_RELEASE
+ ;;
i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
- eval $set_cc_for_build
- SUN_ARCH="i386"
+ 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 test "$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 -m64 -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/[^.]*//'`
- exit ;;
+ SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
+ GUESS=$SUN_ARCH-pc-solaris2$SUN_REL
+ ;;
sun4*:SunOS:6*:*)
# According to config.sub, this is the proper way to canonicalize
# SunOS6. Hard to guess exactly what SunOS6 will be like, but
# it's likely to be more like Solaris than SunOS4.
- echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
+ SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
+ GUESS=sparc-sun-solaris3$SUN_REL
+ ;;
sun4*:SunOS:*:*)
- case "`/usr/bin/arch -k`" in
+ case `/usr/bin/arch -k` in
Series*|S4*)
UNAME_RELEASE=`uname -v`
;;
esac
# Japanese Language versions have a version number like `4.1.3-JL'.
- echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
- exit ;;
+ SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'`
+ GUESS=sparc-sun-sunos$SUN_REL
+ ;;
sun3*:SunOS:*:*)
- echo m68k-sun-sunos${UNAME_RELEASE}
- exit ;;
+ GUESS=m68k-sun-sunos$UNAME_RELEASE
+ ;;
sun*:*:4.2BSD:*)
UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
- test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
- case "`/bin/arch`" in
+ test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3
+ case `/bin/arch` in
sun3)
- echo m68k-sun-sunos${UNAME_RELEASE}
+ GUESS=m68k-sun-sunos$UNAME_RELEASE
;;
sun4)
- echo sparc-sun-sunos${UNAME_RELEASE}
+ GUESS=sparc-sun-sunos$UNAME_RELEASE
;;
esac
- exit ;;
+ ;;
aushp:SunOS:*:*)
- echo sparc-auspex-sunos${UNAME_RELEASE}
- exit ;;
+ GUESS=sparc-auspex-sunos$UNAME_RELEASE
+ ;;
# The situation for MiNT is a little confusing. The machine name
# can be virtually everything (everything which is not
# "atarist" or "atariste" at least should have a processor
@@ -415,44 +490,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}
- exit ;;
+ GUESS=m68k-atari-mint$UNAME_RELEASE
+ ;;
atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit ;;
+ GUESS=m68k-atari-mint$UNAME_RELEASE
+ ;;
*falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit ;;
+ GUESS=m68k-atari-mint$UNAME_RELEASE
+ ;;
milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
- echo m68k-milan-mint${UNAME_RELEASE}
- exit ;;
+ GUESS=m68k-milan-mint$UNAME_RELEASE
+ ;;
hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
- echo m68k-hades-mint${UNAME_RELEASE}
- exit ;;
+ GUESS=m68k-hades-mint$UNAME_RELEASE
+ ;;
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
- echo m68k-unknown-mint${UNAME_RELEASE}
- exit ;;
+ GUESS=m68k-unknown-mint$UNAME_RELEASE
+ ;;
m68k:machten:*:*)
- echo m68k-apple-machten${UNAME_RELEASE}
- exit ;;
+ GUESS=m68k-apple-machten$UNAME_RELEASE
+ ;;
powerpc:machten:*:*)
- echo powerpc-apple-machten${UNAME_RELEASE}
- exit ;;
+ GUESS=powerpc-apple-machten$UNAME_RELEASE
+ ;;
RISC*:Mach:*:*)
- echo mips-dec-mach_bsd4.3
- exit ;;
+ GUESS=mips-dec-mach_bsd4.3
+ ;;
RISC*:ULTRIX:*:*)
- echo mips-dec-ultrix${UNAME_RELEASE}
- exit ;;
+ GUESS=mips-dec-ultrix$UNAME_RELEASE
+ ;;
VAX*:ULTRIX*:*:*)
- echo vax-dec-ultrix${UNAME_RELEASE}
- exit ;;
+ GUESS=vax-dec-ultrix$UNAME_RELEASE
+ ;;
2020:CLIX:*:* | 2430:CLIX:*:*)
- echo clipper-intergraph-clix${UNAME_RELEASE}
- exit ;;
+ GUESS=clipper-intergraph-clix$UNAME_RELEASE
+ ;;
mips:*:*:UMIPS | mips:*:*:RISCos)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
+ set_cc_for_build
+ sed 's/^ //' << EOF > "$dummy.c"
#ifdef __cplusplus
#include /* for printf() prototype */
int main (int argc, char *argv[]) {
@@ -461,95 +536,96 @@ 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}
- exit ;;
+ GUESS=mips-mips-riscos$UNAME_RELEASE
+ ;;
Motorola:PowerMAX_OS:*:*)
- echo powerpc-motorola-powermax
- exit ;;
+ GUESS=powerpc-motorola-powermax
+ ;;
Motorola:*:4.3:PL8-*)
- echo powerpc-harris-powermax
- exit ;;
+ GUESS=powerpc-harris-powermax
+ ;;
Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
- echo powerpc-harris-powermax
- exit ;;
+ GUESS=powerpc-harris-powermax
+ ;;
Night_Hawk:Power_UNIX:*:*)
- echo powerpc-harris-powerunix
- exit ;;
+ GUESS=powerpc-harris-powerunix
+ ;;
m88k:CX/UX:7*:*)
- echo m88k-harris-cxux7
- exit ;;
+ GUESS=m88k-harris-cxux7
+ ;;
m88k:*:4*:R4*)
- echo m88k-motorola-sysv4
- exit ;;
+ GUESS=m88k-motorola-sysv4
+ ;;
m88k:*:3*:R3*)
- echo m88k-motorola-sysv3
- exit ;;
+ GUESS=m88k-motorola-sysv3
+ ;;
AViiON:dgux:*:*)
# DG/UX returns AViiON for all architectures
UNAME_PROCESSOR=`/usr/bin/uname -p`
- if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
+ if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110
then
- if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
- [ ${TARGET_BINARY_INTERFACE}x = x ]
+ if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \
+ test "$TARGET_BINARY_INTERFACE"x = x
then
- echo m88k-dg-dgux${UNAME_RELEASE}
+ GUESS=m88k-dg-dgux$UNAME_RELEASE
else
- echo m88k-dg-dguxbcs${UNAME_RELEASE}
+ GUESS=m88k-dg-dguxbcs$UNAME_RELEASE
fi
else
- echo i586-dg-dgux${UNAME_RELEASE}
+ GUESS=i586-dg-dgux$UNAME_RELEASE
fi
- exit ;;
+ ;;
M88*:DolphinOS:*:*) # DolphinOS (SVR3)
- echo m88k-dolphin-sysv3
- exit ;;
+ GUESS=m88k-dolphin-sysv3
+ ;;
M88*:*:R3*:*)
# Delta 88k system running SVR3
- echo m88k-motorola-sysv3
- exit ;;
+ GUESS=m88k-motorola-sysv3
+ ;;
XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
- echo m88k-tektronix-sysv3
- exit ;;
+ GUESS=m88k-tektronix-sysv3
+ ;;
Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
- echo m68k-tektronix-bsd
- exit ;;
+ GUESS=m68k-tektronix-bsd
+ ;;
*:IRIX*:*:*)
- echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
- exit ;;
+ IRIX_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/g'`
+ GUESS=mips-sgi-irix$IRIX_REL
+ ;;
????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
- echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
- exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
+ GUESS=romp-ibm-aix # uname -m gives an 8 hex-code CPU id
+ ;; # Note that: echo "'`uname -s`'" gives 'AIX '
i*86:AIX:*:*)
- echo i386-ibm-aix
- exit ;;
+ GUESS=i386-ibm-aix
+ ;;
ia64:AIX:*:*)
- if [ -x /usr/bin/oslevel ] ; then
+ if test -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}
- exit ;;
+ GUESS=$UNAME_MACHINE-ibm-aix$IBM_REV
+ ;;
*: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
+ set_cc_for_build
+ sed 's/^ //' << EOF > "$dummy.c"
#include
main()
@@ -560,76 +636,77 @@ 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"
+ GUESS=$SYSTEM_NAME
else
- echo rs6000-ibm-aix3.2.5
+ GUESS=rs6000-ibm-aix3.2.5
fi
elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
- echo rs6000-ibm-aix3.2.4
+ GUESS=rs6000-ibm-aix3.2.4
else
- echo rs6000-ibm-aix3.2
+ GUESS=rs6000-ibm-aix3.2
fi
- exit ;;
+ ;;
*:AIX:*:[4567])
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
- if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+ 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 test -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}
- exit ;;
+ GUESS=$IBM_ARCH-ibm-aix$IBM_REV
+ ;;
*:AIX:*:*)
- echo rs6000-ibm-aix
- exit ;;
- ibmrt:4.4BSD:*|romp-ibm:BSD:*)
- echo romp-ibm-bsd4.4
- exit ;;
+ GUESS=rs6000-ibm-aix
+ ;;
+ ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*)
+ GUESS=romp-ibm-bsd4.4
+ ;;
ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
- echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
- exit ;; # report: romp-ibm BSD 4.3
+ GUESS=romp-ibm-bsd$UNAME_RELEASE # 4.3 with uname added to
+ ;; # report: romp-ibm BSD 4.3
*:BOSX:*:*)
- echo rs6000-bull-bosx
- exit ;;
+ GUESS=rs6000-bull-bosx
+ ;;
DPX/2?00:B.O.S.:*:*)
- echo m68k-bull-sysv3
- exit ;;
+ GUESS=m68k-bull-sysv3
+ ;;
9000/[34]??:4.3bsd:1.*:*)
- echo m68k-hp-bsd
- exit ;;
+ GUESS=m68k-hp-bsd
+ ;;
hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
- echo m68k-hp-bsd4.4
- exit ;;
+ GUESS=m68k-hp-bsd4.4
+ ;;
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
+ if test -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 test "$HP_ARCH" = ""; then
+ set_cc_for_build
+ sed 's/^ //' << EOF > "$dummy.c"
#define _HPUX_SOURCE
#include
@@ -662,13 +739,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 test "$HP_ARCH" = hppa2.0w
then
- eval $set_cc_for_build
+ 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
@@ -679,23 +756,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}
- exit ;;
+ GUESS=$HP_ARCH-hp-hpux$HPUX_REV
+ ;;
ia64:HP-UX:*:*)
- HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
- echo ia64-hp-hpux${HPUX_REV}
- exit ;;
+ HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'`
+ GUESS=ia64-hp-hpux$HPUX_REV
+ ;;
3050*:HI-UX:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
+ set_cc_for_build
+ sed 's/^ //' << EOF > "$dummy.c"
#include
int
main ()
@@ -720,38 +797,38 @@ 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:*:* )
- echo hppa1.1-hp-bsd
- exit ;;
+ GUESS=unknown-hitachi-hiuxwe2
+ ;;
+ 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*)
+ GUESS=hppa1.1-hp-bsd
+ ;;
9000/8??:4.3bsd:*:*)
- echo hppa1.0-hp-bsd
- exit ;;
+ GUESS=hppa1.0-hp-bsd
+ ;;
*9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
- echo hppa1.0-hp-mpeix
- exit ;;
- hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
- echo hppa1.1-hp-osf
- exit ;;
+ GUESS=hppa1.0-hp-mpeix
+ ;;
+ hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*)
+ GUESS=hppa1.1-hp-osf
+ ;;
hp8??:OSF1:*:*)
- echo hppa1.0-hp-osf
- exit ;;
+ GUESS=hppa1.0-hp-osf
+ ;;
i*86:OSF1:*:*)
- if [ -x /usr/sbin/sysversion ] ; then
- echo ${UNAME_MACHINE}-unknown-osf1mk
+ if test -x /usr/sbin/sysversion ; then
+ GUESS=$UNAME_MACHINE-unknown-osf1mk
else
- echo ${UNAME_MACHINE}-unknown-osf1
+ GUESS=$UNAME_MACHINE-unknown-osf1
fi
- exit ;;
+ ;;
parisc*:Lites*:*:*)
- echo hppa1.1-hp-lites
- exit ;;
+ GUESS=hppa1.1-hp-lites
+ ;;
C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
- echo c1-convex-bsd
- exit ;;
+ GUESS=c1-convex-bsd
+ ;;
C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
if getsysinfo -f scalar_acc
then echo c32-convex-bsd
@@ -759,139 +836,148 @@ EOF
fi
exit ;;
C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
- echo c34-convex-bsd
- exit ;;
+ GUESS=c34-convex-bsd
+ ;;
C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
- echo c38-convex-bsd
- exit ;;
+ GUESS=c38-convex-bsd
+ ;;
C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
- echo c4-convex-bsd
- exit ;;
+ GUESS=c4-convex-bsd
+ ;;
CRAY*Y-MP:*:*:*)
- echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
+ CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
+ GUESS=ymp-cray-unicos$CRAY_REL
+ ;;
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/'
- exit ;;
+ CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
+ GUESS=t90-cray-unicos$CRAY_REL
+ ;;
CRAY*T3E:*:*:*)
- echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
+ CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
+ GUESS=alphaev5-cray-unicosmk$CRAY_REL
+ ;;
CRAY*SV1:*:*:*)
- echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
+ CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
+ GUESS=sv1-cray-unicos$CRAY_REL
+ ;;
*:UNICOS/mp:*:*)
- echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
+ CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
+ GUESS=craynv-cray-unicosmp$CRAY_REL
+ ;;
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
- FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
- echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
- exit ;;
+ 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/ /_/'`
+ GUESS=${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}
+ ;;
5000:UNIX_System_V:4.*:*)
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
- echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
- exit ;;
+ FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
+ FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
+ GUESS=sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}
+ ;;
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
- echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
- exit ;;
+ GUESS=$UNAME_MACHINE-pc-bsdi$UNAME_RELEASE
+ ;;
sparc*:BSD/OS:*:*)
- echo sparc-unknown-bsdi${UNAME_RELEASE}
- exit ;;
+ GUESS=sparc-unknown-bsdi$UNAME_RELEASE
+ ;;
*:BSD/OS:*:*)
- echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-bsdi$UNAME_RELEASE
+ ;;
+ arm:FreeBSD:*:*)
+ UNAME_PROCESSOR=`uname -p`
+ set_cc_for_build
+ if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ARM_PCS_VFP
+ then
+ FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
+ GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabi
+ else
+ FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
+ GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabihf
+ fi
+ ;;
*: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
- exit ;;
+ FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
+ GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL
+ ;;
i*:CYGWIN*:*)
- echo ${UNAME_MACHINE}-pc-cygwin
- exit ;;
+ GUESS=$UNAME_MACHINE-pc-cygwin
+ ;;
*:MINGW64*:*)
- echo ${UNAME_MACHINE}-pc-mingw64
- exit ;;
+ GUESS=$UNAME_MACHINE-pc-mingw64
+ ;;
*:MINGW*:*)
- echo ${UNAME_MACHINE}-pc-mingw32
- exit ;;
- i*:MSYS*:*)
- echo ${UNAME_MACHINE}-pc-msys
- exit ;;
- i*:windows32*:*)
- # uname -m includes "-pc" on this system.
- echo ${UNAME_MACHINE}-mingw32
- exit ;;
+ GUESS=$UNAME_MACHINE-pc-mingw32
+ ;;
+ *:MSYS*:*)
+ GUESS=$UNAME_MACHINE-pc-msys
+ ;;
i*:PW*:*)
- echo ${UNAME_MACHINE}-pc-pw32
- exit ;;
+ GUESS=$UNAME_MACHINE-pc-pw32
+ ;;
+ *:SerenityOS:*:*)
+ GUESS=$UNAME_MACHINE-pc-serenity
+ ;;
*:Interix*:*)
- case ${UNAME_MACHINE} in
+ case $UNAME_MACHINE in
x86)
- echo i586-pc-interix${UNAME_RELEASE}
- exit ;;
+ GUESS=i586-pc-interix$UNAME_RELEASE
+ ;;
authenticamd | genuineintel | EM64T)
- echo x86_64-unknown-interix${UNAME_RELEASE}
- exit ;;
+ GUESS=x86_64-unknown-interix$UNAME_RELEASE
+ ;;
IA64)
- echo ia64-unknown-interix${UNAME_RELEASE}
- exit ;;
+ GUESS=ia64-unknown-interix$UNAME_RELEASE
+ ;;
esac ;;
- [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
- echo i${UNAME_MACHINE}-pc-mks
- exit ;;
- 8664:Windows_NT:*)
- echo x86_64-pc-mks
- exit ;;
- i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
- # How do we know it's Interix rather than the generic POSIX subsystem?
- # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
- # UNAME_MACHINE based on the output of uname instead of i386?
- echo i586-pc-interix
- exit ;;
i*:UWIN*:*)
- echo ${UNAME_MACHINE}-pc-uwin
- exit ;;
+ GUESS=$UNAME_MACHINE-pc-uwin
+ ;;
amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
- echo x86_64-unknown-cygwin
- exit ;;
- p*:CYGWIN*:*)
- echo powerpcle-unknown-cygwin
- exit ;;
+ GUESS=x86_64-pc-cygwin
+ ;;
prep*:SunOS:5.*:*)
- echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
+ SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
+ GUESS=powerpcle-unknown-solaris2$SUN_REL
+ ;;
*:GNU:*:*)
# the GNU system
- echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
- exit ;;
+ GNU_ARCH=`echo "$UNAME_MACHINE" | sed -e 's,[-/].*$,,'`
+ GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's,/.*$,,'`
+ GUESS=$GNU_ARCH-unknown-$LIBC$GNU_REL
+ ;;
*:GNU/*:*:*)
# other systems with GNU libc and userland
- echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
- exit ;;
- i*86:Minix:*:*)
- echo ${UNAME_MACHINE}-pc-minix
- exit ;;
+ GNU_SYS=`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"`
+ GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
+ GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC
+ ;;
+ *:Minix:*:*)
+ GUESS=$UNAME_MACHINE-unknown-minix
+ ;;
aarch64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
aarch64_be:Linux:*:*)
UNAME_MACHINE=aarch64_be
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
alpha:Linux:*:*)
- case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in
EV5) UNAME_MACHINE=alphaev5 ;;
EV56) UNAME_MACHINE=alphaev56 ;;
PCA56) UNAME_MACHINE=alphapca56 ;;
@@ -901,172 +987,237 @@ EOF
EV68*) UNAME_MACHINE=alphaev68 ;;
esac
objdump --private-headers /bin/sh | grep -q ld.so.1
- if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- arc:Linux:*:* | arceb:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
+ if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
+ arc:Linux:*:* | arceb:Linux:*:* | arc32:Linux:*:* | arc64:Linux:*:*)
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
arm*:Linux:*:*)
- eval $set_cc_for_build
+ set_cc_for_build
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_EABI__
then
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
else
if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_PCS_VFP
then
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
+ GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabi
else
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
+ GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabihf
fi
fi
- exit ;;
+ ;;
avr32*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
cris:Linux:*:*)
- echo ${UNAME_MACHINE}-axis-linux-${LIBC}
- exit ;;
+ GUESS=$UNAME_MACHINE-axis-linux-$LIBC
+ ;;
crisv32:Linux:*:*)
- echo ${UNAME_MACHINE}-axis-linux-${LIBC}
- exit ;;
+ GUESS=$UNAME_MACHINE-axis-linux-$LIBC
+ ;;
+ e2k:Linux:*:*)
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
frv:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
hexagon:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
i*86:Linux:*:*)
- echo ${UNAME_MACHINE}-pc-linux-${LIBC}
- exit ;;
+ GUESS=$UNAME_MACHINE-pc-linux-$LIBC
+ ;;
ia64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
+ k1om:Linux:*:*)
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
+ loongarch32:Linux:*:* | loongarch64:Linux:*:*)
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
m32r*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
m68*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
mips:Linux:*:* | mips64:Linux:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
+ set_cc_for_build
+ IS_GLIBC=0
+ test x"${LIBC}" = xgnu && IS_GLIBC=1
+ sed 's/^ //' << EOF > "$dummy.c"
#undef CPU
- #undef ${UNAME_MACHINE}
- #undef ${UNAME_MACHINE}el
+ #undef mips
+ #undef mipsel
+ #undef mips64
+ #undef mips64el
+ #if ${IS_GLIBC} && defined(_ABI64)
+ LIBCABI=gnuabi64
+ #else
+ #if ${IS_GLIBC} && defined(_ABIN32)
+ LIBCABI=gnuabin32
+ #else
+ LIBCABI=${LIBC}
+ #endif
+ #endif
+
+ #if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
+ CPU=mipsisa64r6
+ #else
+ #if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
+ CPU=mipsisa32r6
+ #else
+ #if defined(__mips64)
+ CPU=mips64
+ #else
+ CPU=mips
+ #endif
+ #endif
+ #endif
+
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
- CPU=${UNAME_MACHINE}el
+ MIPS_ENDIAN=el
#else
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
- CPU=${UNAME_MACHINE}
+ MIPS_ENDIAN=
#else
- CPU=
+ MIPS_ENDIAN=
#endif
#endif
EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
- test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
+ cc_set_vars=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'`
+ eval "$cc_set_vars"
+ test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; }
+ ;;
+ mips64el:Linux:*:*)
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
+ openrisc*:Linux:*:*)
+ GUESS=or1k-unknown-linux-$LIBC
+ ;;
+ or32:Linux:*:* | or1k*:Linux:*:*)
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
- or1k:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- or32:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
padre:Linux:*:*)
- echo sparc-unknown-linux-${LIBC}
- exit ;;
+ GUESS=sparc-unknown-linux-$LIBC
+ ;;
parisc64:Linux:*:* | hppa64:Linux:*:*)
- echo hppa64-unknown-linux-${LIBC}
- exit ;;
+ GUESS=hppa64-unknown-linux-$LIBC
+ ;;
parisc:Linux:*:* | hppa:Linux:*:*)
# Look for CPU level
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
- PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
- PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
- *) echo hppa-unknown-linux-${LIBC} ;;
+ PA7*) GUESS=hppa1.1-unknown-linux-$LIBC ;;
+ PA8*) GUESS=hppa2.0-unknown-linux-$LIBC ;;
+ *) GUESS=hppa-unknown-linux-$LIBC ;;
esac
- exit ;;
+ ;;
ppc64:Linux:*:*)
- echo powerpc64-unknown-linux-${LIBC}
- exit ;;
+ GUESS=powerpc64-unknown-linux-$LIBC
+ ;;
ppc:Linux:*:*)
- echo powerpc-unknown-linux-${LIBC}
- exit ;;
+ GUESS=powerpc-unknown-linux-$LIBC
+ ;;
ppc64le:Linux:*:*)
- echo powerpc64le-unknown-linux-${LIBC}
- exit ;;
+ GUESS=powerpc64le-unknown-linux-$LIBC
+ ;;
ppcle:Linux:*:*)
- echo powerpcle-unknown-linux-${LIBC}
- exit ;;
+ GUESS=powerpcle-unknown-linux-$LIBC
+ ;;
+ riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*)
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
s390:Linux:*:* | s390x:Linux:*:*)
- echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
- exit ;;
+ GUESS=$UNAME_MACHINE-ibm-linux-$LIBC
+ ;;
sh64*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
sh*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
sparc:Linux:*:* | sparc64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
tile*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
vax:Linux:*:*)
- echo ${UNAME_MACHINE}-dec-linux-${LIBC}
- exit ;;
+ GUESS=$UNAME_MACHINE-dec-linux-$LIBC
+ ;;
x86_64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
+ set_cc_for_build
+ CPU=$UNAME_MACHINE
+ LIBCABI=$LIBC
+ if test "$CC_FOR_BUILD" != no_compiler_found; then
+ ABI=64
+ sed 's/^ //' << EOF > "$dummy.c"
+ #ifdef __i386__
+ ABI=x86
+ #else
+ #ifdef __ILP32__
+ ABI=x32
+ #endif
+ #endif
+EOF
+ cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'`
+ eval "$cc_set_abi"
+ case $ABI in
+ x86) CPU=i686 ;;
+ x32) LIBCABI=${LIBC}x32 ;;
+ esac
+ fi
+ GUESS=$CPU-pc-linux-$LIBCABI
+ ;;
xtensa*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
i*86:DYNIX/ptx:4*:*)
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
# earlier versions are messed up and put the nodename in both
# sysname and nodename.
- echo i386-sequent-sysv4
- exit ;;
+ GUESS=i386-sequent-sysv4
+ ;;
i*86:UNIX_SV:4.2MP:2.*)
# Unixware is an offshoot of SVR4, but it has its own version
# number series starting with 2...
# I am not positive that other SVR4 systems won't match this,
# I just have to hope. -- rms.
# Use sysv4.2uw... so that sysv4* matches it.
- echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
- exit ;;
+ GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION
+ ;;
i*86:OS/2:*:*)
# If we were able to find `uname', then EMX Unix compatibility
# is probably installed.
- echo ${UNAME_MACHINE}-pc-os2-emx
- exit ;;
+ GUESS=$UNAME_MACHINE-pc-os2-emx
+ ;;
i*86:XTS-300:*:STOP)
- echo ${UNAME_MACHINE}-unknown-stop
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-stop
+ ;;
i*86:atheos:*:*)
- echo ${UNAME_MACHINE}-unknown-atheos
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-atheos
+ ;;
i*86:syllable:*:*)
- echo ${UNAME_MACHINE}-pc-syllable
- exit ;;
+ GUESS=$UNAME_MACHINE-pc-syllable
+ ;;
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
- echo i386-unknown-lynxos${UNAME_RELEASE}
- exit ;;
+ GUESS=i386-unknown-lynxos$UNAME_RELEASE
+ ;;
i*86:*DOS:*:*)
- echo ${UNAME_MACHINE}-pc-msdosdjgpp
- exit ;;
- i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
- UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
+ GUESS=$UNAME_MACHINE-pc-msdosdjgpp
+ ;;
+ 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}
+ GUESS=$UNAME_MACHINE-univel-sysv$UNAME_REL
else
- echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
+ GUESS=$UNAME_MACHINE-pc-sysv$UNAME_REL
fi
- exit ;;
+ ;;
i*86:*:5:[678]*)
# UnixWare 7.x, OpenUNIX and OpenServer 6.
case `/bin/uname -X | grep "^Machine"` in
@@ -1074,12 +1225,12 @@ EOF
*Pentium) UNAME_MACHINE=i586 ;;
*Pent*|*Celeron) UNAME_MACHINE=i686 ;;
esac
- echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+ ;;
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
@@ -1089,43 +1240,43 @@ EOF
&& UNAME_MACHINE=i686
(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
&& UNAME_MACHINE=i686
- echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+ GUESS=$UNAME_MACHINE-pc-sco$UNAME_REL
else
- echo ${UNAME_MACHINE}-pc-sysv32
+ GUESS=$UNAME_MACHINE-pc-sysv32
fi
- exit ;;
+ ;;
pc:*:*:*)
# Left here for compatibility:
# uname -m prints for DJGPP always 'pc', but it prints nothing about
# the processor, so we play safe by assuming i586.
# Note: whatever this is, it MUST be the same as what config.sub
- # prints for the "djgpp" host, or else GDB configury will decide that
+ # prints for the "djgpp" host, or else GDB configure will decide that
# this is a cross-build.
- echo i586-pc-msdosdjgpp
- exit ;;
+ GUESS=i586-pc-msdosdjgpp
+ ;;
Intel:Mach:3*:*)
- echo i386-pc-mach3
- exit ;;
+ GUESS=i386-pc-mach3
+ ;;
paragon:*:*:*)
- echo i860-intel-osf1
- exit ;;
+ GUESS=i860-intel-osf1
+ ;;
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
+ GUESS=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
+ GUESS=i860-unknown-sysv$UNAME_RELEASE # Unknown i860-SVR4
fi
- exit ;;
+ ;;
mini*:CTIX:SYS*5:*)
# "miniframe"
- echo m68010-convergent-sysv
- exit ;;
+ GUESS=m68010-convergent-sysv
+ ;;
mc68k:UNIX:SYSTEM5:3.51m)
- echo m68k-convergent-sysv
- exit ;;
+ GUESS=m68k-convergent-sysv
+ ;;
M680?0:D-NIX:5.3:*)
- echo m68k-diab-dnix
- exit ;;
+ GUESS=m68k-diab-dnix
+ ;;
M68*:*:R3V[5678]*:*)
test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
@@ -1133,9 +1284,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; } ;;
@@ -1144,228 +1295,287 @@ 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}
- exit ;;
+ GUESS=m68k-unknown-lynxos$UNAME_RELEASE
+ ;;
mc68030:UNIX_System_V:4.*:*)
- echo m68k-atari-sysv4
- exit ;;
+ GUESS=m68k-atari-sysv4
+ ;;
TSUNAMI:LynxOS:2.*:*)
- echo sparc-unknown-lynxos${UNAME_RELEASE}
- exit ;;
+ GUESS=sparc-unknown-lynxos$UNAME_RELEASE
+ ;;
rs6000:LynxOS:2.*:*)
- echo rs6000-unknown-lynxos${UNAME_RELEASE}
- exit ;;
+ GUESS=rs6000-unknown-lynxos$UNAME_RELEASE
+ ;;
PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
- echo powerpc-unknown-lynxos${UNAME_RELEASE}
- exit ;;
+ GUESS=powerpc-unknown-lynxos$UNAME_RELEASE
+ ;;
SM[BE]S:UNIX_SV:*:*)
- echo mips-dde-sysv${UNAME_RELEASE}
- exit ;;
+ GUESS=mips-dde-sysv$UNAME_RELEASE
+ ;;
RM*:ReliantUNIX-*:*:*)
- echo mips-sni-sysv4
- exit ;;
+ GUESS=mips-sni-sysv4
+ ;;
RM*:SINIX-*:*:*)
- echo mips-sni-sysv4
- exit ;;
+ GUESS=mips-sni-sysv4
+ ;;
*:SINIX-*:*:*)
if uname -p 2>/dev/null >/dev/null ; then
UNAME_MACHINE=`(uname -p) 2>/dev/null`
- echo ${UNAME_MACHINE}-sni-sysv4
+ GUESS=$UNAME_MACHINE-sni-sysv4
else
- echo ns32k-sni-sysv
+ GUESS=ns32k-sni-sysv
fi
- exit ;;
+ ;;
PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
# says
- echo i586-unisys-sysv4
- exit ;;
+ GUESS=i586-unisys-sysv4
+ ;;
*:UNIX_System_V:4*:FTX*)
# From Gerald Hewes .
# How about differentiating between stratus architectures? -djm
- echo hppa1.1-stratus-sysv4
- exit ;;
+ GUESS=hppa1.1-stratus-sysv4
+ ;;
*:*:*:FTX*)
# From seanf@swdc.stratus.com.
- echo i860-stratus-sysv4
- exit ;;
+ GUESS=i860-stratus-sysv4
+ ;;
i*86:VOS:*:*)
# From Paul.Green@stratus.com.
- echo ${UNAME_MACHINE}-stratus-vos
- exit ;;
+ GUESS=$UNAME_MACHINE-stratus-vos
+ ;;
*:VOS:*:*)
# From Paul.Green@stratus.com.
- echo hppa1.1-stratus-vos
- exit ;;
+ GUESS=hppa1.1-stratus-vos
+ ;;
mc68*:A/UX:*:*)
- echo m68k-apple-aux${UNAME_RELEASE}
- exit ;;
+ GUESS=m68k-apple-aux$UNAME_RELEASE
+ ;;
news*:NEWS-OS:6*:*)
- echo mips-sony-newsos6
- exit ;;
+ GUESS=mips-sony-newsos6
+ ;;
R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
- if [ -d /usr/nec ]; then
- echo mips-nec-sysv${UNAME_RELEASE}
+ if test -d /usr/nec; then
+ GUESS=mips-nec-sysv$UNAME_RELEASE
else
- echo mips-unknown-sysv${UNAME_RELEASE}
+ GUESS=mips-unknown-sysv$UNAME_RELEASE
fi
- exit ;;
+ ;;
BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
- echo powerpc-be-beos
- exit ;;
+ GUESS=powerpc-be-beos
+ ;;
BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
- echo powerpc-apple-beos
- exit ;;
+ GUESS=powerpc-apple-beos
+ ;;
BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
- echo i586-pc-beos
- exit ;;
+ GUESS=i586-pc-beos
+ ;;
BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
- echo i586-pc-haiku
- exit ;;
- x86_64:Haiku:*:*)
- echo x86_64-unknown-haiku
- exit ;;
+ GUESS=i586-pc-haiku
+ ;;
+ ppc:Haiku:*:*) # Haiku running on Apple PowerPC
+ GUESS=powerpc-apple-haiku
+ ;;
+ *:Haiku:*:*) # Haiku modern gcc (not bound by BeOS compat)
+ GUESS=$UNAME_MACHINE-unknown-haiku
+ ;;
SX-4:SUPER-UX:*:*)
- echo sx4-nec-superux${UNAME_RELEASE}
- exit ;;
+ GUESS=sx4-nec-superux$UNAME_RELEASE
+ ;;
SX-5:SUPER-UX:*:*)
- echo sx5-nec-superux${UNAME_RELEASE}
- exit ;;
+ GUESS=sx5-nec-superux$UNAME_RELEASE
+ ;;
SX-6:SUPER-UX:*:*)
- echo sx6-nec-superux${UNAME_RELEASE}
- exit ;;
+ GUESS=sx6-nec-superux$UNAME_RELEASE
+ ;;
SX-7:SUPER-UX:*:*)
- echo sx7-nec-superux${UNAME_RELEASE}
- exit ;;
+ GUESS=sx7-nec-superux$UNAME_RELEASE
+ ;;
SX-8:SUPER-UX:*:*)
- echo sx8-nec-superux${UNAME_RELEASE}
- exit ;;
+ GUESS=sx8-nec-superux$UNAME_RELEASE
+ ;;
SX-8R:SUPER-UX:*:*)
- echo sx8r-nec-superux${UNAME_RELEASE}
- exit ;;
+ GUESS=sx8r-nec-superux$UNAME_RELEASE
+ ;;
+ SX-ACE:SUPER-UX:*:*)
+ GUESS=sxace-nec-superux$UNAME_RELEASE
+ ;;
Power*:Rhapsody:*:*)
- echo powerpc-apple-rhapsody${UNAME_RELEASE}
- exit ;;
+ GUESS=powerpc-apple-rhapsody$UNAME_RELEASE
+ ;;
*:Rhapsody:*:*)
- echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
- exit ;;
+ GUESS=$UNAME_MACHINE-apple-rhapsody$UNAME_RELEASE
+ ;;
+ arm64:Darwin:*:*)
+ GUESS=aarch64-apple-darwin$UNAME_RELEASE
+ ;;
*:Darwin:*:*)
- UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
- eval $set_cc_for_build
- if test "$UNAME_PROCESSOR" = unknown ; then
- UNAME_PROCESSOR=powerpc
+ UNAME_PROCESSOR=`uname -p`
+ case $UNAME_PROCESSOR in
+ unknown) UNAME_PROCESSOR=powerpc ;;
+ esac
+ if command -v xcode-select > /dev/null 2> /dev/null && \
+ ! xcode-select --print-path > /dev/null 2> /dev/null ; then
+ # Avoid executing cc if there is no toolchain installed as
+ # cc will be a stub that puts up a graphical alert
+ # prompting the user to install developer tools.
+ CC_FOR_BUILD=no_compiler_found
+ else
+ set_cc_for_build
fi
- if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+ if test "$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
+ (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
+ elif test "$UNAME_PROCESSOR" = i386 ; then
+ # uname -m returns i386 or x86_64
+ UNAME_PROCESSOR=$UNAME_MACHINE
fi
- echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
- exit ;;
+ GUESS=$UNAME_PROCESSOR-apple-darwin$UNAME_RELEASE
+ ;;
*: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}
- exit ;;
+ GUESS=$UNAME_PROCESSOR-$UNAME_MACHINE-nto-qnx$UNAME_RELEASE
+ ;;
*:QNX:*:4*)
- echo i386-pc-qnx
- exit ;;
- NEO-?:NONSTOP_KERNEL:*:*)
- echo neo-tandem-nsk${UNAME_RELEASE}
- exit ;;
+ GUESS=i386-pc-qnx
+ ;;
+ NEO-*:NONSTOP_KERNEL:*:*)
+ GUESS=neo-tandem-nsk$UNAME_RELEASE
+ ;;
NSE-*:NONSTOP_KERNEL:*:*)
- echo nse-tandem-nsk${UNAME_RELEASE}
- exit ;;
- NSR-?:NONSTOP_KERNEL:*:*)
- echo nsr-tandem-nsk${UNAME_RELEASE}
- exit ;;
+ GUESS=nse-tandem-nsk$UNAME_RELEASE
+ ;;
+ NSR-*:NONSTOP_KERNEL:*:*)
+ GUESS=nsr-tandem-nsk$UNAME_RELEASE
+ ;;
+ NSV-*:NONSTOP_KERNEL:*:*)
+ GUESS=nsv-tandem-nsk$UNAME_RELEASE
+ ;;
+ NSX-*:NONSTOP_KERNEL:*:*)
+ GUESS=nsx-tandem-nsk$UNAME_RELEASE
+ ;;
*:NonStop-UX:*:*)
- echo mips-compaq-nonstopux
- exit ;;
+ GUESS=mips-compaq-nonstopux
+ ;;
BS2000:POSIX*:*:*)
- echo bs2000-siemens-sysv
- exit ;;
+ GUESS=bs2000-siemens-sysv
+ ;;
DS/*:UNIX_System_V:*:*)
- echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
- exit ;;
+ GUESS=$UNAME_MACHINE-$UNAME_SYSTEM-$UNAME_RELEASE
+ ;;
*: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"
+ elif test "x${cputype-}" != x; then
+ UNAME_MACHINE=$cputype
fi
- echo ${UNAME_MACHINE}-unknown-plan9
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-plan9
+ ;;
*:TOPS-10:*:*)
- echo pdp10-unknown-tops10
- exit ;;
+ GUESS=pdp10-unknown-tops10
+ ;;
*:TENEX:*:*)
- echo pdp10-unknown-tenex
- exit ;;
+ GUESS=pdp10-unknown-tenex
+ ;;
KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
- echo pdp10-dec-tops20
- exit ;;
+ GUESS=pdp10-dec-tops20
+ ;;
XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
- echo pdp10-xkl-tops20
- exit ;;
+ GUESS=pdp10-xkl-tops20
+ ;;
*:TOPS-20:*:*)
- echo pdp10-unknown-tops20
- exit ;;
+ GUESS=pdp10-unknown-tops20
+ ;;
*:ITS:*:*)
- echo pdp10-unknown-its
- exit ;;
+ GUESS=pdp10-unknown-its
+ ;;
SEI:*:*:SEIUX)
- echo mips-sei-seiux${UNAME_RELEASE}
- exit ;;
+ GUESS=mips-sei-seiux$UNAME_RELEASE
+ ;;
*:DragonFly:*:*)
- echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
- exit ;;
+ DRAGONFLY_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
+ GUESS=$UNAME_MACHINE-unknown-dragonfly$DRAGONFLY_REL
+ ;;
*:*VMS:*:*)
UNAME_MACHINE=`(uname -p) 2>/dev/null`
- case "${UNAME_MACHINE}" in
- A*) echo alpha-dec-vms ; exit ;;
- I*) echo ia64-dec-vms ; exit ;;
- V*) echo vax-dec-vms ; exit ;;
+ case $UNAME_MACHINE in
+ A*) GUESS=alpha-dec-vms ;;
+ I*) GUESS=ia64-dec-vms ;;
+ V*) GUESS=vax-dec-vms ;;
esac ;;
*:XENIX:*:SysV)
- echo i386-pc-xenix
- exit ;;
+ GUESS=i386-pc-xenix
+ ;;
i*86:skyos:*:*)
- echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
- exit ;;
+ SKYOS_REL=`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`
+ GUESS=$UNAME_MACHINE-pc-skyos$SKYOS_REL
+ ;;
i*86:rdos:*:*)
- echo ${UNAME_MACHINE}-pc-rdos
- exit ;;
- i*86:AROS:*:*)
- echo ${UNAME_MACHINE}-pc-aros
- exit ;;
+ GUESS=$UNAME_MACHINE-pc-rdos
+ ;;
+ i*86:Fiwix:*:*)
+ GUESS=$UNAME_MACHINE-pc-fiwix
+ ;;
+ *:AROS:*:*)
+ GUESS=$UNAME_MACHINE-unknown-aros
+ ;;
x86_64:VMkernel:*:*)
- echo ${UNAME_MACHINE}-unknown-esx
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-esx
+ ;;
+ amd64:Isilon\ OneFS:*:*)
+ GUESS=x86_64-unknown-onefs
+ ;;
+ *:Unleashed:*:*)
+ GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE
+ ;;
esac
-eval $set_cc_for_build
-cat >$dummy.c < "$dummy.c" <
-# include
+#include
+#include
+#endif
+#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
+#if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
+#include
+#if defined(_SIZE_T_) || defined(SIGLOST)
+#include
+#endif
+#endif
#endif
main ()
{
@@ -1378,22 +1588,14 @@ main ()
#include
printf ("m68k-sony-newsos%s\n",
#ifdef NEWSOS4
- "4"
+ "4"
#else
- ""
+ ""
#endif
- ); exit (0);
+ ); exit (0);
#endif
#endif
-#if defined (__arm) && defined (__acorn) && defined (__unix)
- printf ("arm-acorn-riscix\n"); exit (0);
-#endif
-
-#if defined (hp300) && !defined (hpux)
- printf ("m68k-hp-bsd\n"); exit (0);
-#endif
-
#if defined (NeXT)
#if !defined (__ARCHITECTURE__)
#define __ARCHITECTURE__ "m68k"
@@ -1433,39 +1635,54 @@ main ()
#endif
#if defined (_SEQUENT_)
- struct utsname un;
-
- uname(&un);
-
- if (strncmp(un.version, "V2", 2) == 0) {
- printf ("i386-sequent-ptx2\n"); exit (0);
- }
- if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
- printf ("i386-sequent-ptx1\n"); exit (0);
- }
- printf ("i386-sequent-ptx\n"); exit (0);
+ struct utsname un;
+ uname(&un);
+ if (strncmp(un.version, "V2", 2) == 0) {
+ printf ("i386-sequent-ptx2\n"); exit (0);
+ }
+ if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
+ printf ("i386-sequent-ptx1\n"); exit (0);
+ }
+ printf ("i386-sequent-ptx\n"); exit (0);
#endif
#if defined (vax)
-# if !defined (ultrix)
-# include
-# if defined (BSD)
-# if BSD == 43
- printf ("vax-dec-bsd4.3\n"); exit (0);
-# else
-# if BSD == 199006
- printf ("vax-dec-bsd4.3reno\n"); exit (0);
-# else
- printf ("vax-dec-bsd\n"); exit (0);
-# endif
-# endif
-# else
- printf ("vax-dec-bsd\n"); exit (0);
-# endif
-# else
- printf ("vax-dec-ultrix\n"); exit (0);
-# endif
+#if !defined (ultrix)
+#include
+#if defined (BSD)
+#if BSD == 43
+ printf ("vax-dec-bsd4.3\n"); exit (0);
+#else
+#if BSD == 199006
+ printf ("vax-dec-bsd4.3reno\n"); exit (0);
+#else
+ printf ("vax-dec-bsd\n"); exit (0);
+#endif
+#endif
+#else
+ printf ("vax-dec-bsd\n"); exit (0);
+#endif
+#else
+#if defined(_SIZE_T_) || defined(SIGLOST)
+ struct utsname un;
+ uname (&un);
+ printf ("vax-dec-ultrix%s\n", un.release); exit (0);
+#else
+ printf ("vax-dec-ultrix\n"); exit (0);
+#endif
+#endif
+#endif
+#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
+#if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
+#if defined(_SIZE_T_) || defined(SIGLOST)
+ struct utsname *un;
+ uname (&un);
+ printf ("mips-dec-ultrix%s\n", un.release); exit (0);
+#else
+ printf ("mips-dec-ultrix\n"); exit (0);
+#endif
+#endif
#endif
#if defined (alliant) && defined (i860)
@@ -1476,54 +1693,46 @@ main ()
}
EOF
-$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
+$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; }
-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
+echo "$0: unable to guess system type" >&2
-# Convex versions that predate uname can use getsysinfo(1)
+case $UNAME_MACHINE:$UNAME_SYSTEM in
+ mips:Linux | mips64:Linux)
+ # If we got here on MIPS GNU/Linux, output extra information.
+ cat >&2 <&2 < in order to provide the needed
-information to handle your system.
+our_year=`echo $timestamp | sed 's,-.*,,'`
+thisyear=`date +%Y`
+# shellcheck disable=SC2003
+script_age=`expr "$thisyear" - "$our_year"`
+if test "$script_age" -lt 3 ; then
+ cat >&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
+fi
exit 1
# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "timestamp='"
# time-stamp-format: "%:y-%02m-%02d"
# time-stamp-end: "'"
diff --git a/autoconf/config.sub b/autoconf/config.sub
old mode 100755
new mode 100644
index c765b34b..fbaa37f2
--- a/autoconf/config.sub
+++ b/autoconf/config.sub
@@ -1,12 +1,14 @@
#! /bin/sh
# Configuration validation subroutine script.
-# Copyright 1992-2013 Free Software Foundation, Inc.
+# Copyright 1992-2022 Free Software Foundation, Inc.
-timestamp='2013-04-24'
+# shellcheck disable=SC2006,SC2268 # see below for rationale
+
+timestamp='2022-08-01'
# 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
+# 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
@@ -15,7 +17,7 @@ timestamp='2013-04-24'
# 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
@@ -25,7 +27,7 @@ timestamp='2013-04-24'
# of the GNU General Public License, version 3 ("GPLv3").
-# Please send patches with a ChangeLog entry to config-patches@gnu.org.
+# Please send patches to .
#
# Configuration subroutine to validate and canonicalize a configuration type.
# Supply the specified configuration type as an argument.
@@ -33,7 +35,7 @@ timestamp='2013-04-24'
# 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/cgit/config.git/plain/config.sub
# This file is supposed to be the same for all GNU packages
# and recognize all the CPU types, system types and aliases
@@ -50,15 +52,21 @@ timestamp='2013-04-24'
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
# It is wrong to echo any other type of specification.
+# The "shellcheck disable" line above the timestamp inhibits complaints
+# about features and limitations of the classic Bourne shell that were
+# superseded or lifted in POSIX. However, this script identifies a wide
+# variety of pre-POSIX systems that do not have POSIX shells at all, and
+# even some reasonably current systems (Solaris 10 as case-in-point) still
+# have a pre-POSIX /bin/sh.
+
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
@@ -68,7 +76,7 @@ Report bugs and patches to ."
version="\
GNU config.sub ($timestamp)
-Copyright 1992-2013 Free Software Foundation, Inc.
+Copyright 1992-2022 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."
@@ -90,12 +98,12 @@ while test $# -gt 0 ; do
- ) # Use stdin as input.
break ;;
-* )
- echo "$me: invalid option $1$help"
+ echo "$me: invalid option $1$help" >&2
exit 1 ;;
*local*)
# First pass through any local machine types.
- echo $1
+ echo "$1"
exit ;;
* )
@@ -111,1209 +119,1186 @@ case $# in
exit 1;;
esac
-# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
-# Here we must recognize all the valid KERNEL-OS combinations.
-maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
-case $maybe_os in
- nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
- linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
- knetbsd*-gnu* | netbsd*-gnu* | \
- kopensolaris*-gnu* | \
- storm-chaos* | os2-emx* | rtmk-nova*)
- os=-$maybe_os
- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
- ;;
- android-linux)
- os=-linux-android
- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
- ;;
- *)
- basic_machine=`echo $1 | sed 's/-[^-]*$//'`
- if [ $basic_machine != $1 ]
- then os=`echo $1 | sed 's/.*-/-/'`
- else os=; fi
- ;;
-esac
+# Split fields of configuration type
+# shellcheck disable=SC2162
+saved_IFS=$IFS
+IFS="-" read field1 field2 field3 field4 <&2
+ exit 1
;;
- -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
- -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
- -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
- -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
- -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
- -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
- -apple | -axis | -knuth | -cray | -microblaze*)
- os=
- basic_machine=$1
+ *-*-*-*)
+ basic_machine=$field1-$field2
+ basic_os=$field3-$field4
;;
- -bluegene*)
- os=-cnk
+ *-*-*)
+ # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two
+ # parts
+ maybe_os=$field2-$field3
+ case $maybe_os in
+ nto-qnx* | linux-* | uclinux-uclibc* \
+ | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \
+ | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \
+ | storm-chaos* | os2-emx* | rtmk-nova*)
+ basic_machine=$field1
+ basic_os=$maybe_os
+ ;;
+ android-linux)
+ basic_machine=$field1-unknown
+ basic_os=linux-android
+ ;;
+ *)
+ basic_machine=$field1-$field2
+ basic_os=$field3
+ ;;
+ esac
;;
- -sim | -cisco | -oki | -wec | -winbond)
- os=
- basic_machine=$1
+ *-*)
+ # A lone config we happen to match not fitting any pattern
+ case $field1-$field2 in
+ decstation-3100)
+ basic_machine=mips-dec
+ basic_os=
+ ;;
+ *-*)
+ # Second component is usually, but not always the OS
+ case $field2 in
+ # Prevent following clause from handling this valid os
+ sun*os*)
+ basic_machine=$field1
+ basic_os=$field2
+ ;;
+ zephyr*)
+ basic_machine=$field1-unknown
+ basic_os=$field2
+ ;;
+ # Manufacturers
+ dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \
+ | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \
+ | unicom* | ibm* | next | hp | isi* | apollo | altos* \
+ | convergent* | ncr* | news | 32* | 3600* | 3100* \
+ | hitachi* | c[123]* | convex* | sun | crds | omron* | dg \
+ | ultra | tti* | harris | dolphin | highlevel | gould \
+ | cbm | ns | masscomp | apple | axis | knuth | cray \
+ | microblaze* | sim | cisco \
+ | oki | wec | wrs | winbond)
+ basic_machine=$field1-$field2
+ basic_os=
+ ;;
+ *)
+ basic_machine=$field1
+ basic_os=$field2
+ ;;
+ esac
+ ;;
+ esac
;;
- -scout)
- ;;
- -wrs)
- os=-vxworks
- basic_machine=$1
- ;;
- -chorusos*)
- os=-chorusos
- basic_machine=$1
- ;;
- -chorusrdb)
- os=-chorusrdb
- basic_machine=$1
- ;;
- -hiux*)
- os=-hiuxwe2
- ;;
- -sco6)
- os=-sco5v6
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco5)
- os=-sco3.2v5
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco4)
- os=-sco3.2v4
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco3.2.[4-9]*)
- os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco3.2v[4-9]*)
- # Don't forget version if it is 3.2v4 or newer.
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco5v6*)
- # Don't forget version if it is 3.2v4 or newer.
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco*)
- os=-sco3.2v2
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -udk*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -isc)
- os=-isc2.2
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -clix*)
- basic_machine=clipper-intergraph
- ;;
- -isc*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -lynx*178)
- os=-lynxos178
- ;;
- -lynx*5)
- os=-lynxos5
- ;;
- -lynx*)
- os=-lynxos
- ;;
- -ptx*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
- ;;
- -windowsnt*)
- os=`echo $os | sed -e 's/windowsnt/winnt/'`
- ;;
- -psos*)
- os=-psos
- ;;
- -mint | -mint[0-9]*)
- basic_machine=m68k-atari
- os=-mint
+ *)
+ # Convert single-component short-hands not valid as part of
+ # multi-component configurations.
+ case $field1 in
+ 386bsd)
+ basic_machine=i386-pc
+ basic_os=bsd
+ ;;
+ a29khif)
+ basic_machine=a29k-amd
+ basic_os=udi
+ ;;
+ adobe68k)
+ basic_machine=m68010-adobe
+ basic_os=scout
+ ;;
+ alliant)
+ basic_machine=fx80-alliant
+ basic_os=
+ ;;
+ altos | altos3068)
+ basic_machine=m68k-altos
+ basic_os=
+ ;;
+ am29k)
+ basic_machine=a29k-none
+ basic_os=bsd
+ ;;
+ amdahl)
+ basic_machine=580-amdahl
+ basic_os=sysv
+ ;;
+ amiga)
+ basic_machine=m68k-unknown
+ basic_os=
+ ;;
+ amigaos | amigados)
+ basic_machine=m68k-unknown
+ basic_os=amigaos
+ ;;
+ amigaunix | amix)
+ basic_machine=m68k-unknown
+ basic_os=sysv4
+ ;;
+ apollo68)
+ basic_machine=m68k-apollo
+ basic_os=sysv
+ ;;
+ apollo68bsd)
+ basic_machine=m68k-apollo
+ basic_os=bsd
+ ;;
+ aros)
+ basic_machine=i386-pc
+ basic_os=aros
+ ;;
+ aux)
+ basic_machine=m68k-apple
+ basic_os=aux
+ ;;
+ balance)
+ basic_machine=ns32k-sequent
+ basic_os=dynix
+ ;;
+ blackfin)
+ basic_machine=bfin-unknown
+ basic_os=linux
+ ;;
+ cegcc)
+ basic_machine=arm-unknown
+ basic_os=cegcc
+ ;;
+ convex-c1)
+ basic_machine=c1-convex
+ basic_os=bsd
+ ;;
+ convex-c2)
+ basic_machine=c2-convex
+ basic_os=bsd
+ ;;
+ convex-c32)
+ basic_machine=c32-convex
+ basic_os=bsd
+ ;;
+ convex-c34)
+ basic_machine=c34-convex
+ basic_os=bsd
+ ;;
+ convex-c38)
+ basic_machine=c38-convex
+ basic_os=bsd
+ ;;
+ cray)
+ basic_machine=j90-cray
+ basic_os=unicos
+ ;;
+ crds | unos)
+ basic_machine=m68k-crds
+ basic_os=
+ ;;
+ da30)
+ basic_machine=m68k-da30
+ basic_os=
+ ;;
+ decstation | pmax | pmin | dec3100 | decstatn)
+ basic_machine=mips-dec
+ basic_os=
+ ;;
+ delta88)
+ basic_machine=m88k-motorola
+ basic_os=sysv3
+ ;;
+ dicos)
+ basic_machine=i686-pc
+ basic_os=dicos
+ ;;
+ djgpp)
+ basic_machine=i586-pc
+ basic_os=msdosdjgpp
+ ;;
+ ebmon29k)
+ basic_machine=a29k-amd
+ basic_os=ebmon
+ ;;
+ es1800 | OSE68k | ose68k | ose | OSE)
+ basic_machine=m68k-ericsson
+ basic_os=ose
+ ;;
+ gmicro)
+ basic_machine=tron-gmicro
+ basic_os=sysv
+ ;;
+ go32)
+ basic_machine=i386-pc
+ basic_os=go32
+ ;;
+ h8300hms)
+ basic_machine=h8300-hitachi
+ basic_os=hms
+ ;;
+ h8300xray)
+ basic_machine=h8300-hitachi
+ basic_os=xray
+ ;;
+ h8500hms)
+ basic_machine=h8500-hitachi
+ basic_os=hms
+ ;;
+ harris)
+ basic_machine=m88k-harris
+ basic_os=sysv3
+ ;;
+ hp300 | hp300hpux)
+ basic_machine=m68k-hp
+ basic_os=hpux
+ ;;
+ hp300bsd)
+ basic_machine=m68k-hp
+ basic_os=bsd
+ ;;
+ hppaosf)
+ basic_machine=hppa1.1-hp
+ basic_os=osf
+ ;;
+ hppro)
+ basic_machine=hppa1.1-hp
+ basic_os=proelf
+ ;;
+ i386mach)
+ basic_machine=i386-mach
+ basic_os=mach
+ ;;
+ isi68 | isi)
+ basic_machine=m68k-isi
+ basic_os=sysv
+ ;;
+ m68knommu)
+ basic_machine=m68k-unknown
+ basic_os=linux
+ ;;
+ magnum | m3230)
+ basic_machine=mips-mips
+ basic_os=sysv
+ ;;
+ merlin)
+ basic_machine=ns32k-utek
+ basic_os=sysv
+ ;;
+ mingw64)
+ basic_machine=x86_64-pc
+ basic_os=mingw64
+ ;;
+ mingw32)
+ basic_machine=i686-pc
+ basic_os=mingw32
+ ;;
+ mingw32ce)
+ basic_machine=arm-unknown
+ basic_os=mingw32ce
+ ;;
+ monitor)
+ basic_machine=m68k-rom68k
+ basic_os=coff
+ ;;
+ morphos)
+ basic_machine=powerpc-unknown
+ basic_os=morphos
+ ;;
+ moxiebox)
+ basic_machine=moxie-unknown
+ basic_os=moxiebox
+ ;;
+ msdos)
+ basic_machine=i386-pc
+ basic_os=msdos
+ ;;
+ msys)
+ basic_machine=i686-pc
+ basic_os=msys
+ ;;
+ mvs)
+ basic_machine=i370-ibm
+ basic_os=mvs
+ ;;
+ nacl)
+ basic_machine=le32-unknown
+ basic_os=nacl
+ ;;
+ ncr3000)
+ basic_machine=i486-ncr
+ basic_os=sysv4
+ ;;
+ netbsd386)
+ basic_machine=i386-pc
+ basic_os=netbsd
+ ;;
+ netwinder)
+ basic_machine=armv4l-rebel
+ basic_os=linux
+ ;;
+ news | news700 | news800 | news900)
+ basic_machine=m68k-sony
+ basic_os=newsos
+ ;;
+ news1000)
+ basic_machine=m68030-sony
+ basic_os=newsos
+ ;;
+ necv70)
+ basic_machine=v70-nec
+ basic_os=sysv
+ ;;
+ nh3000)
+ basic_machine=m68k-harris
+ basic_os=cxux
+ ;;
+ nh[45]000)
+ basic_machine=m88k-harris
+ basic_os=cxux
+ ;;
+ nindy960)
+ basic_machine=i960-intel
+ basic_os=nindy
+ ;;
+ mon960)
+ basic_machine=i960-intel
+ basic_os=mon960
+ ;;
+ nonstopux)
+ basic_machine=mips-compaq
+ basic_os=nonstopux
+ ;;
+ os400)
+ basic_machine=powerpc-ibm
+ basic_os=os400
+ ;;
+ OSE68000 | ose68000)
+ basic_machine=m68000-ericsson
+ basic_os=ose
+ ;;
+ os68k)
+ basic_machine=m68k-none
+ basic_os=os68k
+ ;;
+ paragon)
+ basic_machine=i860-intel
+ basic_os=osf
+ ;;
+ parisc)
+ basic_machine=hppa-unknown
+ basic_os=linux
+ ;;
+ psp)
+ basic_machine=mipsallegrexel-sony
+ basic_os=psp
+ ;;
+ pw32)
+ basic_machine=i586-unknown
+ basic_os=pw32
+ ;;
+ rdos | rdos64)
+ basic_machine=x86_64-pc
+ basic_os=rdos
+ ;;
+ rdos32)
+ basic_machine=i386-pc
+ basic_os=rdos
+ ;;
+ rom68k)
+ basic_machine=m68k-rom68k
+ basic_os=coff
+ ;;
+ sa29200)
+ basic_machine=a29k-amd
+ basic_os=udi
+ ;;
+ sei)
+ basic_machine=mips-sei
+ basic_os=seiux
+ ;;
+ sequent)
+ basic_machine=i386-sequent
+ basic_os=
+ ;;
+ sps7)
+ basic_machine=m68k-bull
+ basic_os=sysv2
+ ;;
+ st2000)
+ basic_machine=m68k-tandem
+ basic_os=
+ ;;
+ stratus)
+ basic_machine=i860-stratus
+ basic_os=sysv4
+ ;;
+ sun2)
+ basic_machine=m68000-sun
+ basic_os=
+ ;;
+ sun2os3)
+ basic_machine=m68000-sun
+ basic_os=sunos3
+ ;;
+ sun2os4)
+ basic_machine=m68000-sun
+ basic_os=sunos4
+ ;;
+ sun3)
+ basic_machine=m68k-sun
+ basic_os=
+ ;;
+ sun3os3)
+ basic_machine=m68k-sun
+ basic_os=sunos3
+ ;;
+ sun3os4)
+ basic_machine=m68k-sun
+ basic_os=sunos4
+ ;;
+ sun4)
+ basic_machine=sparc-sun
+ basic_os=
+ ;;
+ sun4os3)
+ basic_machine=sparc-sun
+ basic_os=sunos3
+ ;;
+ sun4os4)
+ basic_machine=sparc-sun
+ basic_os=sunos4
+ ;;
+ sun4sol2)
+ basic_machine=sparc-sun
+ basic_os=solaris2
+ ;;
+ sun386 | sun386i | roadrunner)
+ basic_machine=i386-sun
+ basic_os=
+ ;;
+ sv1)
+ basic_machine=sv1-cray
+ basic_os=unicos
+ ;;
+ symmetry)
+ basic_machine=i386-sequent
+ basic_os=dynix
+ ;;
+ t3e)
+ basic_machine=alphaev5-cray
+ basic_os=unicos
+ ;;
+ t90)
+ basic_machine=t90-cray
+ basic_os=unicos
+ ;;
+ toad1)
+ basic_machine=pdp10-xkl
+ basic_os=tops20
+ ;;
+ tpf)
+ basic_machine=s390x-ibm
+ basic_os=tpf
+ ;;
+ udi29k)
+ basic_machine=a29k-amd
+ basic_os=udi
+ ;;
+ ultra3)
+ basic_machine=a29k-nyu
+ basic_os=sym1
+ ;;
+ v810 | necv810)
+ basic_machine=v810-nec
+ basic_os=none
+ ;;
+ vaxv)
+ basic_machine=vax-dec
+ basic_os=sysv
+ ;;
+ vms)
+ basic_machine=vax-dec
+ basic_os=vms
+ ;;
+ vsta)
+ basic_machine=i386-pc
+ basic_os=vsta
+ ;;
+ vxworks960)
+ basic_machine=i960-wrs
+ basic_os=vxworks
+ ;;
+ vxworks68)
+ basic_machine=m68k-wrs
+ basic_os=vxworks
+ ;;
+ vxworks29k)
+ basic_machine=a29k-wrs
+ basic_os=vxworks
+ ;;
+ xbox)
+ basic_machine=i686-pc
+ basic_os=mingw32
+ ;;
+ ymp)
+ basic_machine=ymp-cray
+ basic_os=unicos
+ ;;
+ *)
+ basic_machine=$1
+ basic_os=
+ ;;
+ esac
;;
esac
-# Decode aliases for certain CPU-COMPANY combinations.
+# Decode 1-component or ad-hoc basic machines
case $basic_machine in
- # Recognize the basic CPU types without company name.
- # Some are omitted here because they have special meanings below.
- 1750a | 580 \
- | a29k \
- | aarch64 | aarch64_be \
- | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
- | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
- | am33_2.0 \
- | arc | arceb \
- | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
- | avr | avr32 \
- | be32 | be64 \
- | bfin \
- | c4x | clipper \
- | d10v | d30v | dlx | dsp16xx \
- | epiphany \
- | fido | fr30 | frv \
- | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
- | hexagon \
- | i370 | i860 | i960 | ia64 \
- | ip2k | iq2000 \
- | le32 | le64 \
- | lm32 \
- | m32c | m32r | m32rle | m68000 | m68k | m88k \
- | maxq | mb | microblaze | microblazeel | mcore | mep | metag \
- | mips | mipsbe | mipseb | mipsel | mipsle \
- | mips16 \
- | mips64 | mips64el \
- | mips64octeon | mips64octeonel \
- | mips64orion | mips64orionel \
- | mips64r5900 | mips64r5900el \
- | mips64vr | mips64vrel \
- | mips64vr4100 | mips64vr4100el \
- | mips64vr4300 | mips64vr4300el \
- | mips64vr5000 | mips64vr5000el \
- | mips64vr5900 | mips64vr5900el \
- | mipsisa32 | mipsisa32el \
- | mipsisa32r2 | mipsisa32r2el \
- | mipsisa64 | mipsisa64el \
- | mipsisa64r2 | mipsisa64r2el \
- | mipsisa64sb1 | mipsisa64sb1el \
- | mipsisa64sr71k | mipsisa64sr71kel \
- | mipsr5900 | mipsr5900el \
- | mipstx39 | mipstx39el \
- | mn10200 | mn10300 \
- | moxie \
- | mt \
- | msp430 \
- | nds32 | nds32le | nds32be \
- | nios | nios2 | nios2eb | nios2el \
- | ns16k | ns32k \
- | open8 \
- | or1k | or32 \
- | pdp10 | pdp11 | pj | pjl \
- | powerpc | powerpc64 | powerpc64le | powerpcle \
- | pyramid \
- | rl78 | rx \
- | score \
- | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
- | sh64 | sh64le \
- | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
- | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
- | spu \
- | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
- | ubicom32 \
- | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
- | we32k \
- | x86 | xc16x | xstormy16 | xtensa \
- | z8k | z80)
- basic_machine=$basic_machine-unknown
+ # Here we handle the default manufacturer of certain CPU types. It is in
+ # some cases the only manufacturer, in others, it is the most popular.
+ w89k)
+ cpu=hppa1.1
+ vendor=winbond
;;
- c54x)
- basic_machine=tic54x-unknown
+ op50n)
+ cpu=hppa1.1
+ vendor=oki
;;
- c55x)
- basic_machine=tic55x-unknown
+ op60c)
+ cpu=hppa1.1
+ vendor=oki
;;
- c6x)
- basic_machine=tic6x-unknown
+ ibm*)
+ cpu=i370
+ vendor=ibm
;;
- m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip)
- basic_machine=$basic_machine-unknown
- os=-none
+ orion105)
+ cpu=clipper
+ vendor=highlevel
;;
- m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
+ mac | mpw | mac-mpw)
+ cpu=m68k
+ vendor=apple
;;
- ms1)
- basic_machine=mt-unknown
+ pmac | pmac-mpw)
+ cpu=powerpc
+ vendor=apple
;;
- strongarm | thumb | xscale)
- basic_machine=arm-unknown
+ # Recognize the various machine names and aliases which stand
+ # for a CPU type and a company and sometimes even an OS.
+ 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
+ cpu=m68000
+ vendor=att
;;
- xgate)
- basic_machine=$basic_machine-unknown
- os=-none
+ 3b*)
+ cpu=we32k
+ vendor=att
;;
- xscaleeb)
- basic_machine=armeb-unknown
+ bluegene*)
+ cpu=powerpc
+ vendor=ibm
+ basic_os=cnk
+ ;;
+ decsystem10* | dec10*)
+ cpu=pdp10
+ vendor=dec
+ basic_os=tops10
+ ;;
+ decsystem20* | dec20*)
+ cpu=pdp10
+ vendor=dec
+ basic_os=tops20
+ ;;
+ delta | 3300 | motorola-3300 | motorola-delta \
+ | 3300-motorola | delta-motorola)
+ cpu=m68k
+ vendor=motorola
+ ;;
+ dpx2*)
+ cpu=m68k
+ vendor=bull
+ basic_os=sysv3
+ ;;
+ encore | umax | mmax)
+ cpu=ns32k
+ vendor=encore
+ ;;
+ elxsi)
+ cpu=elxsi
+ vendor=elxsi
+ basic_os=${basic_os:-bsd}
+ ;;
+ fx2800)
+ cpu=i860
+ vendor=alliant
+ ;;
+ genix)
+ cpu=ns32k
+ vendor=ns
+ ;;
+ h3050r* | hiux*)
+ cpu=hppa1.1
+ vendor=hitachi
+ basic_os=hiuxwe2
+ ;;
+ hp3k9[0-9][0-9] | hp9[0-9][0-9])
+ cpu=hppa1.0
+ vendor=hp
+ ;;
+ hp9k2[0-9][0-9] | hp9k31[0-9])
+ cpu=m68000
+ vendor=hp
+ ;;
+ hp9k3[2-9][0-9])
+ cpu=m68k
+ vendor=hp
+ ;;
+ hp9k6[0-9][0-9] | hp6[0-9][0-9])
+ cpu=hppa1.0
+ vendor=hp
+ ;;
+ hp9k7[0-79][0-9] | hp7[0-79][0-9])
+ cpu=hppa1.1
+ vendor=hp
+ ;;
+ hp9k78[0-9] | hp78[0-9])
+ # FIXME: really hppa2.0-hp
+ cpu=hppa1.1
+ vendor=hp
+ ;;
+ hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
+ # FIXME: really hppa2.0-hp
+ cpu=hppa1.1
+ vendor=hp
+ ;;
+ hp9k8[0-9][13679] | hp8[0-9][13679])
+ cpu=hppa1.1
+ vendor=hp
+ ;;
+ hp9k8[0-9][0-9] | hp8[0-9][0-9])
+ cpu=hppa1.0
+ vendor=hp
+ ;;
+ i*86v32)
+ cpu=`echo "$1" | sed -e 's/86.*/86/'`
+ vendor=pc
+ basic_os=sysv32
+ ;;
+ i*86v4*)
+ cpu=`echo "$1" | sed -e 's/86.*/86/'`
+ vendor=pc
+ basic_os=sysv4
+ ;;
+ i*86v)
+ cpu=`echo "$1" | sed -e 's/86.*/86/'`
+ vendor=pc
+ basic_os=sysv
+ ;;
+ i*86sol2)
+ cpu=`echo "$1" | sed -e 's/86.*/86/'`
+ vendor=pc
+ basic_os=solaris2
+ ;;
+ j90 | j90-cray)
+ cpu=j90
+ vendor=cray
+ basic_os=${basic_os:-unicos}
+ ;;
+ iris | iris4d)
+ cpu=mips
+ vendor=sgi
+ case $basic_os in
+ irix*)
+ ;;
+ *)
+ basic_os=irix4
+ ;;
+ esac
+ ;;
+ miniframe)
+ cpu=m68000
+ vendor=convergent
+ ;;
+ *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*)
+ cpu=m68k
+ vendor=atari
+ basic_os=mint
+ ;;
+ news-3600 | risc-news)
+ cpu=mips
+ vendor=sony
+ basic_os=newsos
+ ;;
+ next | m*-next)
+ cpu=m68k
+ vendor=next
+ case $basic_os in
+ openstep*)
+ ;;
+ nextstep*)
+ ;;
+ ns2*)
+ basic_os=nextstep2
+ ;;
+ *)
+ basic_os=nextstep3
+ ;;
+ esac
+ ;;
+ np1)
+ cpu=np1
+ vendor=gould
+ ;;
+ op50n-* | op60c-*)
+ cpu=hppa1.1
+ vendor=oki
+ basic_os=proelf
+ ;;
+ pa-hitachi)
+ cpu=hppa1.1
+ vendor=hitachi
+ basic_os=hiuxwe2
+ ;;
+ pbd)
+ cpu=sparc
+ vendor=tti
+ ;;
+ pbb)
+ cpu=m68k
+ vendor=tti
+ ;;
+ pc532)
+ cpu=ns32k
+ vendor=pc532
+ ;;
+ pn)
+ cpu=pn
+ vendor=gould
+ ;;
+ power)
+ cpu=power
+ vendor=ibm
+ ;;
+ ps2)
+ cpu=i386
+ vendor=ibm
+ ;;
+ rm[46]00)
+ cpu=mips
+ vendor=siemens
+ ;;
+ rtpc | rtpc-*)
+ cpu=romp
+ vendor=ibm
+ ;;
+ sde)
+ cpu=mipsisa32
+ vendor=sde
+ basic_os=${basic_os:-elf}
+ ;;
+ simso-wrs)
+ cpu=sparclite
+ vendor=wrs
+ basic_os=vxworks
+ ;;
+ tower | tower-32)
+ cpu=m68k
+ vendor=ncr
+ ;;
+ vpp*|vx|vx-*)
+ cpu=f301
+ vendor=fujitsu
+ ;;
+ w65)
+ cpu=w65
+ vendor=wdc
+ ;;
+ w89k-*)
+ cpu=hppa1.1
+ vendor=winbond
+ basic_os=proelf
+ ;;
+ none)
+ cpu=none
+ vendor=none
+ ;;
+ leon|leon[3-9])
+ cpu=sparc
+ vendor=$basic_machine
+ ;;
+ leon-*|leon[3-9]-*)
+ cpu=sparc
+ vendor=`echo "$basic_machine" | sed 's/-.*//'`
;;
- xscaleel)
- basic_machine=armel-unknown
+ *-*)
+ # shellcheck disable=SC2162
+ saved_IFS=$IFS
+ IFS="-" read cpu vendor <&2
- exit 1
- ;;
- # Recognize the basic CPU types with company name.
- 580-* \
- | a29k-* \
- | aarch64-* | aarch64_be-* \
- | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
- | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
- | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
- | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
- | avr-* | avr32-* \
- | be32-* | be64-* \
- | bfin-* | bs2000-* \
- | c[123]* | c30-* | [cjt]90-* | c4x-* \
- | clipper-* | craynv-* | cydra-* \
- | d10v-* | d30v-* | dlx-* \
- | elxsi-* \
- | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
- | h8300-* | h8500-* \
- | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
- | hexagon-* \
- | i*86-* | i860-* | i960-* | ia64-* \
- | ip2k-* | iq2000-* \
- | le32-* | le64-* \
- | lm32-* \
- | m32c-* | m32r-* | m32rle-* \
- | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
- | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
- | microblaze-* | microblazeel-* \
- | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
- | mips16-* \
- | mips64-* | mips64el-* \
- | mips64octeon-* | mips64octeonel-* \
- | mips64orion-* | mips64orionel-* \
- | mips64r5900-* | mips64r5900el-* \
- | mips64vr-* | mips64vrel-* \
- | mips64vr4100-* | mips64vr4100el-* \
- | mips64vr4300-* | mips64vr4300el-* \
- | mips64vr5000-* | mips64vr5000el-* \
- | mips64vr5900-* | mips64vr5900el-* \
- | mipsisa32-* | mipsisa32el-* \
- | mipsisa32r2-* | mipsisa32r2el-* \
- | mipsisa64-* | mipsisa64el-* \
- | mipsisa64r2-* | mipsisa64r2el-* \
- | mipsisa64sb1-* | mipsisa64sb1el-* \
- | mipsisa64sr71k-* | mipsisa64sr71kel-* \
- | mipsr5900-* | mipsr5900el-* \
- | mipstx39-* | mipstx39el-* \
- | mmix-* \
- | mt-* \
- | msp430-* \
- | nds32-* | nds32le-* | nds32be-* \
- | nios-* | nios2-* | nios2eb-* | nios2el-* \
- | none-* | np1-* | ns16k-* | ns32k-* \
- | open8-* \
- | orion-* \
- | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
- | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
- | pyramid-* \
- | rl78-* | romp-* | rs6000-* | rx-* \
- | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
- | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
- | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
- | sparclite-* \
- | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
- | tahoe-* \
- | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
- | tile*-* \
- | tron-* \
- | ubicom32-* \
- | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
- | vax-* \
- | we32k-* \
- | x86-* | x86_64-* | xc16x-* | xps100-* \
- | xstormy16-* | xtensa*-* \
- | ymp-* \
- | z8k-* | z80-*)
- ;;
- # Recognize the basic CPU types without company name, with glob match.
- xtensa*)
- basic_machine=$basic_machine-unknown
- ;;
- # Recognize the various machine names and aliases which stand
- # for a CPU type and a company and sometimes even an OS.
- 386bsd)
- basic_machine=i386-unknown
- os=-bsd
- ;;
- 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
- basic_machine=m68000-att
- ;;
- 3b*)
- basic_machine=we32k-att
- ;;
- a29khif)
- basic_machine=a29k-amd
- os=-udi
- ;;
- abacus)
- basic_machine=abacus-unknown
- ;;
- adobe68k)
- basic_machine=m68010-adobe
- os=-scout
- ;;
- alliant | fx80)
- basic_machine=fx80-alliant
- ;;
- altos | altos3068)
- basic_machine=m68k-altos
- ;;
- am29k)
- basic_machine=a29k-none
- os=-bsd
- ;;
- amd64)
- basic_machine=x86_64-pc
- ;;
- amd64-*)
- basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- amdahl)
- basic_machine=580-amdahl
- os=-sysv
- ;;
- amiga | amiga-*)
- basic_machine=m68k-unknown
- ;;
- amigaos | amigados)
- basic_machine=m68k-unknown
- os=-amigaos
- ;;
- amigaunix | amix)
- basic_machine=m68k-unknown
- os=-sysv4
- ;;
- apollo68)
- basic_machine=m68k-apollo
- os=-sysv
- ;;
- apollo68bsd)
- basic_machine=m68k-apollo
- os=-bsd
- ;;
- aros)
- basic_machine=i386-pc
- os=-aros
- ;;
- aux)
- basic_machine=m68k-apple
- os=-aux
- ;;
- balance)
- basic_machine=ns32k-sequent
- os=-dynix
- ;;
- blackfin)
- basic_machine=bfin-unknown
- os=-linux
- ;;
- blackfin-*)
- basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
- os=-linux
- ;;
- bluegene*)
- basic_machine=powerpc-ibm
- os=-cnk
- ;;
- c54x-*)
- basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- c55x-*)
- basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- c6x-*)
- basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- c90)
- basic_machine=c90-cray
- os=-unicos
- ;;
- cegcc)
- basic_machine=arm-unknown
- os=-cegcc
- ;;
- convex-c1)
- basic_machine=c1-convex
- os=-bsd
- ;;
- convex-c2)
- basic_machine=c2-convex
- os=-bsd
- ;;
- convex-c32)
- basic_machine=c32-convex
- os=-bsd
- ;;
- convex-c34)
- basic_machine=c34-convex
- os=-bsd
- ;;
- convex-c38)
- basic_machine=c38-convex
- os=-bsd
- ;;
- cray | j90)
- basic_machine=j90-cray
- os=-unicos
- ;;
- craynv)
- basic_machine=craynv-cray
- os=-unicosmp
- ;;
- cr16 | cr16-*)
- basic_machine=cr16-unknown
- os=-elf
- ;;
- crds | unos)
- basic_machine=m68k-crds
- ;;
- crisv32 | crisv32-* | etraxfs*)
- basic_machine=crisv32-axis
- ;;
- cris | cris-* | etrax*)
- basic_machine=cris-axis
- ;;
- crx)
- basic_machine=crx-unknown
- os=-elf
- ;;
- da30 | da30-*)
- basic_machine=m68k-da30
- ;;
- decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
- basic_machine=mips-dec
- ;;
- decsystem10* | dec10*)
- basic_machine=pdp10-dec
- os=-tops10
- ;;
- decsystem20* | dec20*)
- basic_machine=pdp10-dec
- os=-tops20
- ;;
- delta | 3300 | motorola-3300 | motorola-delta \
- | 3300-motorola | delta-motorola)
- basic_machine=m68k-motorola
- ;;
- delta88)
- basic_machine=m88k-motorola
- os=-sysv3
- ;;
- dicos)
- basic_machine=i686-pc
- os=-dicos
- ;;
- djgpp)
- basic_machine=i586-pc
- os=-msdosdjgpp
- ;;
- dpx20 | dpx20-*)
- basic_machine=rs6000-bull
- os=-bosx
- ;;
- dpx2* | dpx2*-bull)
- basic_machine=m68k-bull
- os=-sysv3
- ;;
- ebmon29k)
- basic_machine=a29k-amd
- os=-ebmon
- ;;
- elxsi)
- basic_machine=elxsi-elxsi
- os=-bsd
- ;;
- encore | umax | mmax)
- basic_machine=ns32k-encore
- ;;
- es1800 | OSE68k | ose68k | ose | OSE)
- basic_machine=m68k-ericsson
- os=-ose
- ;;
- fx2800)
- basic_machine=i860-alliant
- ;;
- genix)
- basic_machine=ns32k-ns
- ;;
- gmicro)
- basic_machine=tron-gmicro
- os=-sysv
- ;;
- go32)
- basic_machine=i386-pc
- os=-go32
- ;;
- h3050r* | hiux*)
- basic_machine=hppa1.1-hitachi
- os=-hiuxwe2
- ;;
- h8300hms)
- basic_machine=h8300-hitachi
- os=-hms
- ;;
- h8300xray)
- basic_machine=h8300-hitachi
- os=-xray
- ;;
- h8500hms)
- basic_machine=h8500-hitachi
- os=-hms
- ;;
- harris)
- basic_machine=m88k-harris
- os=-sysv3
- ;;
- hp300-*)
- basic_machine=m68k-hp
- ;;
- hp300bsd)
- basic_machine=m68k-hp
- os=-bsd
- ;;
- hp300hpux)
- basic_machine=m68k-hp
- os=-hpux
- ;;
- hp3k9[0-9][0-9] | hp9[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hp9k2[0-9][0-9] | hp9k31[0-9])
- basic_machine=m68000-hp
- ;;
- hp9k3[2-9][0-9])
- basic_machine=m68k-hp
- ;;
- hp9k6[0-9][0-9] | hp6[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hp9k7[0-79][0-9] | hp7[0-79][0-9])
- basic_machine=hppa1.1-hp
- ;;
- hp9k78[0-9] | hp78[0-9])
- # FIXME: really hppa2.0-hp
- basic_machine=hppa1.1-hp
- ;;
- hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
- # FIXME: really hppa2.0-hp
- basic_machine=hppa1.1-hp
- ;;
- hp9k8[0-9][13679] | hp8[0-9][13679])
- basic_machine=hppa1.1-hp
- ;;
- hp9k8[0-9][0-9] | hp8[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hppa-next)
- os=-nextstep3
- ;;
- hppaosf)
- basic_machine=hppa1.1-hp
- os=-osf
- ;;
- hppro)
- basic_machine=hppa1.1-hp
- os=-proelf
- ;;
- i370-ibm* | ibm*)
- basic_machine=i370-ibm
- ;;
- i*86v32)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv32
- ;;
- i*86v4*)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv4
- ;;
- i*86v)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv
- ;;
- i*86sol2)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-solaris2
- ;;
- i386mach)
- basic_machine=i386-mach
- os=-mach
- ;;
- i386-vsta | vsta)
- basic_machine=i386-unknown
- os=-vsta
- ;;
- iris | iris4d)
- basic_machine=mips-sgi
- case $os in
- -irix*)
- ;;
- *)
- os=-irix4
- ;;
- esac
- ;;
- isi68 | isi)
- basic_machine=m68k-isi
- os=-sysv
- ;;
- m68knommu)
- basic_machine=m68k-unknown
- os=-linux
- ;;
- m68knommu-*)
- basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
- os=-linux
- ;;
- m88k-omron*)
- basic_machine=m88k-omron
- ;;
- magnum | m3230)
- basic_machine=mips-mips
- os=-sysv
- ;;
- merlin)
- basic_machine=ns32k-utek
- os=-sysv
- ;;
- microblaze*)
- basic_machine=microblaze-xilinx
- ;;
- mingw64)
- basic_machine=x86_64-pc
- os=-mingw64
- ;;
- mingw32)
- basic_machine=i386-pc
- os=-mingw32
- ;;
- mingw32ce)
- basic_machine=arm-unknown
- os=-mingw32ce
- ;;
- miniframe)
- basic_machine=m68000-convergent
- ;;
- *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
- basic_machine=m68k-atari
- os=-mint
- ;;
- mips3*-*)
- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
- ;;
- mips3*)
- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
- ;;
- monitor)
- basic_machine=m68k-rom68k
- os=-coff
- ;;
- morphos)
- basic_machine=powerpc-unknown
- os=-morphos
- ;;
- msdos)
- basic_machine=i386-pc
- os=-msdos
- ;;
- ms1-*)
- basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
- ;;
- msys)
- basic_machine=i386-pc
- os=-msys
- ;;
- mvs)
- basic_machine=i370-ibm
- os=-mvs
- ;;
- nacl)
- basic_machine=le32-unknown
- os=-nacl
- ;;
- ncr3000)
- basic_machine=i486-ncr
- os=-sysv4
- ;;
- netbsd386)
- basic_machine=i386-unknown
- os=-netbsd
- ;;
- netwinder)
- basic_machine=armv4l-rebel
- os=-linux
- ;;
- news | news700 | news800 | news900)
- basic_machine=m68k-sony
- os=-newsos
- ;;
- news1000)
- basic_machine=m68030-sony
- os=-newsos
- ;;
- news-3600 | risc-news)
- basic_machine=mips-sony
- os=-newsos
- ;;
- necv70)
- basic_machine=v70-nec
- os=-sysv
- ;;
- next | m*-next )
- basic_machine=m68k-next
- case $os in
- -nextstep* )
- ;;
- -ns2*)
- os=-nextstep2
- ;;
- *)
- os=-nextstep3
- ;;
- esac
- ;;
- nh3000)
- basic_machine=m68k-harris
- os=-cxux
- ;;
- nh[45]000)
- basic_machine=m88k-harris
- os=-cxux
- ;;
- nindy960)
- basic_machine=i960-intel
- os=-nindy
- ;;
- mon960)
- basic_machine=i960-intel
- os=-mon960
- ;;
- nonstopux)
- basic_machine=mips-compaq
- os=-nonstopux
- ;;
- np1)
- basic_machine=np1-gould
- ;;
- neo-tandem)
- basic_machine=neo-tandem
- ;;
- nse-tandem)
- basic_machine=nse-tandem
- ;;
- nsr-tandem)
- basic_machine=nsr-tandem
- ;;
- op50n-* | op60c-*)
- basic_machine=hppa1.1-oki
- os=-proelf
- ;;
- openrisc | openrisc-*)
- basic_machine=or32-unknown
- ;;
- os400)
- basic_machine=powerpc-ibm
- os=-os400
- ;;
- OSE68000 | ose68000)
- basic_machine=m68000-ericsson
- os=-ose
- ;;
- os68k)
- basic_machine=m68k-none
- os=-os68k
- ;;
- pa-hitachi)
- basic_machine=hppa1.1-hitachi
- os=-hiuxwe2
- ;;
- paragon)
- basic_machine=i860-intel
- os=-osf
- ;;
- parisc)
- basic_machine=hppa-unknown
- os=-linux
- ;;
- parisc-*)
- basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
- os=-linux
- ;;
- pbd)
- basic_machine=sparc-tti
- ;;
- pbb)
- basic_machine=m68k-tti
- ;;
- pc532 | pc532-*)
- basic_machine=ns32k-pc532
+ cpu=$basic_machine
+ vendor=pc
;;
+ # These rules are duplicated from below for sake of the special case above;
+ # i.e. things that normalized to x86 arches should also default to "pc"
pc98)
- basic_machine=i386-pc
+ cpu=i386
+ vendor=pc
;;
- pc98-*)
- basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+ x64 | amd64)
+ cpu=x86_64
+ vendor=pc
;;
- pentium | p5 | k5 | k6 | nexgen | viac3)
- basic_machine=i586-pc
+ # Recognize the basic CPU types without company name.
+ *)
+ cpu=$basic_machine
+ vendor=unknown
;;
- pentiumpro | p6 | 6x86 | athlon | athlon_*)
- basic_machine=i686-pc
+esac
+
+unset -v basic_machine
+
+# Decode basic machines in the full and proper CPU-Company form.
+case $cpu-$vendor in
+ # Here we handle the default manufacturer of certain CPU types in canonical form. It is in
+ # some cases the only manufacturer, in others, it is the most popular.
+ craynv-unknown)
+ vendor=cray
+ basic_os=${basic_os:-unicosmp}
;;
- pentiumii | pentium2 | pentiumiii | pentium3)
- basic_machine=i686-pc
+ c90-unknown | c90-cray)
+ vendor=cray
+ basic_os=${Basic_os:-unicos}
;;
- pentium4)
- basic_machine=i786-pc
+ fx80-unknown)
+ vendor=alliant
;;
- pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
- basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
+ romp-unknown)
+ vendor=ibm
;;
- pentiumpro-* | p6-* | 6x86-* | athlon-*)
- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+ mmix-unknown)
+ vendor=knuth
;;
- pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+ microblaze-unknown | microblazeel-unknown)
+ vendor=xilinx
;;
- pentium4-*)
- basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+ rs6000-unknown)
+ vendor=ibm
;;
- pn)
- basic_machine=pn-gould
+ vax-unknown)
+ vendor=dec
;;
- power) basic_machine=power-ibm
+ pdp11-unknown)
+ vendor=dec
;;
- ppc | ppcbe) basic_machine=powerpc-unknown
+ we32k-unknown)
+ vendor=att
;;
- ppc-* | ppcbe-*)
- basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+ cydra-unknown)
+ vendor=cydrome
;;
- ppcle | powerpclittle | ppc-le | powerpc-little)
- basic_machine=powerpcle-unknown
+ i370-ibm*)
+ vendor=ibm
;;
- ppcle-* | powerpclittle-*)
- basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
+ orion-unknown)
+ vendor=highlevel
;;
- ppc64) basic_machine=powerpc64-unknown
- ;;
- ppc64-* | ppc64p7-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppc64le | powerpc64little | ppc64-le | powerpc64-little)
- basic_machine=powerpc64le-unknown
- ;;
- ppc64le-* | powerpc64little-*)
- basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ps2)
- basic_machine=i386-ibm
- ;;
- pw32)
- basic_machine=i586-unknown
- os=-pw32
- ;;
- rdos | rdos64)
- basic_machine=x86_64-pc
- os=-rdos
- ;;
- rdos32)
- basic_machine=i386-pc
- os=-rdos
- ;;
- rom68k)
- basic_machine=m68k-rom68k
- os=-coff
- ;;
- rm[46]00)
- basic_machine=mips-siemens
- ;;
- rtpc | rtpc-*)
- basic_machine=romp-ibm
- ;;
- s390 | s390-*)
- basic_machine=s390-ibm
- ;;
- s390x | s390x-*)
- basic_machine=s390x-ibm
- ;;
- sa29200)
- basic_machine=a29k-amd
- os=-udi
- ;;
- sb1)
- basic_machine=mipsisa64sb1-unknown
- ;;
- sb1el)
- basic_machine=mipsisa64sb1el-unknown
- ;;
- sde)
- basic_machine=mipsisa32-sde
- os=-elf
- ;;
- sei)
- basic_machine=mips-sei
- os=-seiux
- ;;
- sequent)
- basic_machine=i386-sequent
- ;;
- sh)
- basic_machine=sh-hitachi
- os=-hms
- ;;
- sh5el)
- basic_machine=sh5le-unknown
- ;;
- sh64)
- basic_machine=sh64-unknown
- ;;
- sparclite-wrs | simso-wrs)
- basic_machine=sparclite-wrs
- os=-vxworks
- ;;
- sps7)
- basic_machine=m68k-bull
- os=-sysv2
- ;;
- spur)
- basic_machine=spur-unknown
- ;;
- st2000)
- basic_machine=m68k-tandem
- ;;
- stratus)
- basic_machine=i860-stratus
- os=-sysv4
- ;;
- strongarm-* | thumb-*)
- basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- sun2)
- basic_machine=m68000-sun
- ;;
- sun2os3)
- basic_machine=m68000-sun
- os=-sunos3
- ;;
- sun2os4)
- basic_machine=m68000-sun
- os=-sunos4
- ;;
- sun3os3)
- basic_machine=m68k-sun
- os=-sunos3
- ;;
- sun3os4)
- basic_machine=m68k-sun
- os=-sunos4
- ;;
- sun4os3)
- basic_machine=sparc-sun
- os=-sunos3
- ;;
- sun4os4)
- basic_machine=sparc-sun
- os=-sunos4
- ;;
- sun4sol2)
- basic_machine=sparc-sun
- os=-solaris2
- ;;
- sun3 | sun3-*)
- basic_machine=m68k-sun
- ;;
- sun4)
- basic_machine=sparc-sun
- ;;
- sun386 | sun386i | roadrunner)
- basic_machine=i386-sun
- ;;
- sv1)
- basic_machine=sv1-cray
- os=-unicos
- ;;
- symmetry)
- basic_machine=i386-sequent
- os=-dynix
- ;;
- t3e)
- basic_machine=alphaev5-cray
- os=-unicos
- ;;
- t90)
- basic_machine=t90-cray
- os=-unicos
- ;;
- tile*)
- basic_machine=$basic_machine-unknown
- os=-linux-gnu
- ;;
- tx39)
- basic_machine=mipstx39-unknown
- ;;
- tx39el)
- basic_machine=mipstx39el-unknown
- ;;
- toad1)
- basic_machine=pdp10-xkl
- os=-tops20
- ;;
- tower | tower-32)
- basic_machine=m68k-ncr
- ;;
- tpf)
- basic_machine=s390x-ibm
- os=-tpf
- ;;
- udi29k)
- basic_machine=a29k-amd
- os=-udi
- ;;
- ultra3)
- basic_machine=a29k-nyu
- os=-sym1
- ;;
- v810 | necv810)
- basic_machine=v810-nec
- os=-none
- ;;
- vaxv)
- basic_machine=vax-dec
- os=-sysv
- ;;
- vms)
- basic_machine=vax-dec
- os=-vms
- ;;
- vpp*|vx|vx-*)
- basic_machine=f301-fujitsu
- ;;
- vxworks960)
- basic_machine=i960-wrs
- os=-vxworks
- ;;
- vxworks68)
- basic_machine=m68k-wrs
- os=-vxworks
- ;;
- vxworks29k)
- basic_machine=a29k-wrs
- os=-vxworks
- ;;
- w65*)
- basic_machine=w65-wdc
- os=-none
- ;;
- w89k-*)
- basic_machine=hppa1.1-winbond
- os=-proelf
- ;;
- xbox)
- basic_machine=i686-pc
- os=-mingw32
- ;;
- xps | xps100)
- basic_machine=xps100-honeywell
- ;;
- xscale-* | xscalee[bl]-*)
- basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
- ;;
- ymp)
- basic_machine=ymp-cray
- os=-unicos
- ;;
- z8k-*-coff)
- basic_machine=z8k-unknown
- os=-sim
- ;;
- z80-*-coff)
- basic_machine=z80-unknown
- os=-sim
- ;;
- none)
- basic_machine=none-none
- os=-none
+ xps-unknown | xps100-unknown)
+ cpu=xps100
+ vendor=honeywell
;;
-# Here we handle the default manufacturer of certain CPU types. It is in
-# some cases the only manufacturer, in others, it is the most popular.
- w89k)
- basic_machine=hppa1.1-winbond
+ # Here we normalize CPU types with a missing or matching vendor
+ armh-unknown | armh-alt)
+ cpu=armv7l
+ vendor=alt
+ basic_os=${basic_os:-linux-gnueabihf}
;;
- op50n)
- basic_machine=hppa1.1-oki
+ dpx20-unknown | dpx20-bull)
+ cpu=rs6000
+ vendor=bull
+ basic_os=${basic_os:-bosx}
;;
- op60c)
- basic_machine=hppa1.1-oki
+
+ # Here we normalize CPU types irrespective of the vendor
+ amd64-*)
+ cpu=x86_64
;;
- romp)
- basic_machine=romp-ibm
+ blackfin-*)
+ cpu=bfin
+ basic_os=linux
;;
- mmix)
- basic_machine=mmix-knuth
+ c54x-*)
+ cpu=tic54x
;;
- rs6000)
- basic_machine=rs6000-ibm
+ c55x-*)
+ cpu=tic55x
;;
- vax)
- basic_machine=vax-dec
+ c6x-*)
+ cpu=tic6x
;;
- pdp10)
- # there are many clones, so DEC is not a safe bet
- basic_machine=pdp10-unknown
+ e500v[12]-*)
+ cpu=powerpc
+ basic_os=${basic_os}"spe"
;;
- pdp11)
- basic_machine=pdp11-dec
+ mips3*-*)
+ cpu=mips64
;;
- we32k)
- basic_machine=we32k-att
+ ms1-*)
+ cpu=mt
;;
- sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
- basic_machine=sh-unknown
+ m68knommu-*)
+ cpu=m68k
+ basic_os=linux
;;
- sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
- basic_machine=sparc-sun
+ m9s12z-* | m68hcs12z-* | hcs12z-* | s12z-*)
+ cpu=s12z
;;
- cydra)
- basic_machine=cydra-cydrome
+ openrisc-*)
+ cpu=or32
;;
- orion)
- basic_machine=orion-highlevel
+ parisc-*)
+ cpu=hppa
+ basic_os=linux
;;
- orion105)
- basic_machine=clipper-highlevel
+ pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+ cpu=i586
;;
- mac | mpw | mac-mpw)
- basic_machine=m68k-apple
+ pentiumpro-* | p6-* | 6x86-* | athlon-* | athalon_*-*)
+ cpu=i686
;;
- pmac | pmac-mpw)
- basic_machine=powerpc-apple
+ pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
+ cpu=i686
;;
- *-unknown)
- # Make sure to match an already-canonicalized machine name.
+ pentium4-*)
+ cpu=i786
;;
+ pc98-*)
+ cpu=i386
+ ;;
+ ppc-* | ppcbe-*)
+ cpu=powerpc
+ ;;
+ ppcle-* | powerpclittle-*)
+ cpu=powerpcle
+ ;;
+ ppc64-*)
+ cpu=powerpc64
+ ;;
+ ppc64le-* | powerpc64little-*)
+ cpu=powerpc64le
+ ;;
+ sb1-*)
+ cpu=mipsisa64sb1
+ ;;
+ sb1el-*)
+ cpu=mipsisa64sb1el
+ ;;
+ sh5e[lb]-*)
+ cpu=`echo "$cpu" | sed 's/^\(sh.\)e\(.\)$/\1\2e/'`
+ ;;
+ spur-*)
+ cpu=spur
+ ;;
+ strongarm-* | thumb-*)
+ cpu=arm
+ ;;
+ tx39-*)
+ cpu=mipstx39
+ ;;
+ tx39el-*)
+ cpu=mipstx39el
+ ;;
+ x64-*)
+ cpu=x86_64
+ ;;
+ xscale-* | xscalee[bl]-*)
+ cpu=`echo "$cpu" | sed 's/^xscale/arm/'`
+ ;;
+ arm64-* | aarch64le-*)
+ cpu=aarch64
+ ;;
+
+ # Recognize the canonical CPU Types that limit and/or modify the
+ # company names they are paired with.
+ cr16-*)
+ basic_os=${basic_os:-elf}
+ ;;
+ crisv32-* | etraxfs*-*)
+ cpu=crisv32
+ vendor=axis
+ ;;
+ cris-* | etrax*-*)
+ cpu=cris
+ vendor=axis
+ ;;
+ crx-*)
+ basic_os=${basic_os:-elf}
+ ;;
+ neo-tandem)
+ cpu=neo
+ vendor=tandem
+ ;;
+ nse-tandem)
+ cpu=nse
+ vendor=tandem
+ ;;
+ nsr-tandem)
+ cpu=nsr
+ vendor=tandem
+ ;;
+ nsv-tandem)
+ cpu=nsv
+ vendor=tandem
+ ;;
+ nsx-tandem)
+ cpu=nsx
+ vendor=tandem
+ ;;
+ mipsallegrexel-sony)
+ cpu=mipsallegrexel
+ vendor=sony
+ ;;
+ tile*-*)
+ basic_os=${basic_os:-linux-gnu}
+ ;;
+
*)
- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
- exit 1
+ # Recognize the canonical CPU types that are allowed with any
+ # company name.
+ case $cpu in
+ 1750a | 580 \
+ | a29k \
+ | aarch64 | aarch64_be \
+ | abacus \
+ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] \
+ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] \
+ | alphapca5[67] | alpha64pca5[67] \
+ | am33_2.0 \
+ | amdgcn \
+ | arc | arceb | arc32 | arc64 \
+ | arm | arm[lb]e | arme[lb] | armv* \
+ | avr | avr32 \
+ | asmjs \
+ | ba \
+ | be32 | be64 \
+ | bfin | bpf | bs2000 \
+ | c[123]* | c30 | [cjt]90 | c4x \
+ | c8051 | clipper | craynv | csky | cydra \
+ | d10v | d30v | dlx | dsp16xx \
+ | e2k | elxsi | epiphany \
+ | f30[01] | f700 | fido | fr30 | frv | ft32 | fx80 \
+ | h8300 | h8500 \
+ | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+ | hexagon \
+ | i370 | i*86 | i860 | i960 | ia16 | ia64 \
+ | ip2k | iq2000 \
+ | k1om \
+ | le32 | le64 \
+ | lm32 \
+ | loongarch32 | loongarch64 \
+ | m32c | m32r | m32rle \
+ | m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k \
+ | m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \
+ | m88110 | m88k | maxq | mb | mcore | mep | metag \
+ | microblaze | microblazeel \
+ | mips | mipsbe | mipseb | mipsel | mipsle \
+ | mips16 \
+ | mips64 | mips64eb | mips64el \
+ | mips64octeon | mips64octeonel \
+ | mips64orion | mips64orionel \
+ | mips64r5900 | mips64r5900el \
+ | mips64vr | mips64vrel \
+ | mips64vr4100 | mips64vr4100el \
+ | mips64vr4300 | mips64vr4300el \
+ | mips64vr5000 | mips64vr5000el \
+ | mips64vr5900 | mips64vr5900el \
+ | mipsisa32 | mipsisa32el \
+ | mipsisa32r2 | mipsisa32r2el \
+ | mipsisa32r3 | mipsisa32r3el \
+ | mipsisa32r5 | mipsisa32r5el \
+ | mipsisa32r6 | mipsisa32r6el \
+ | mipsisa64 | mipsisa64el \
+ | mipsisa64r2 | mipsisa64r2el \
+ | mipsisa64r3 | mipsisa64r3el \
+ | mipsisa64r5 | mipsisa64r5el \
+ | mipsisa64r6 | mipsisa64r6el \
+ | mipsisa64sb1 | mipsisa64sb1el \
+ | mipsisa64sr71k | mipsisa64sr71kel \
+ | mipsr5900 | mipsr5900el \
+ | mipstx39 | mipstx39el \
+ | mmix \
+ | mn10200 | mn10300 \
+ | moxie \
+ | mt \
+ | msp430 \
+ | nds32 | nds32le | nds32be \
+ | nfp \
+ | nios | nios2 | nios2eb | nios2el \
+ | none | np1 | ns16k | ns32k | nvptx \
+ | open8 \
+ | or1k* \
+ | or32 \
+ | orion \
+ | picochip \
+ | pdp10 | pdp11 | pj | pjl | pn | power \
+ | powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \
+ | pru \
+ | pyramid \
+ | riscv | riscv32 | riscv32be | riscv64 | riscv64be \
+ | rl78 | romp | rs6000 | rx \
+ | s390 | s390x \
+ | score \
+ | sh | shl \
+ | sh[1234] | sh[24]a | sh[24]ae[lb] | sh[23]e | she[lb] | sh[lb]e \
+ | sh[1234]e[lb] | sh[12345][lb]e | sh[23]ele | sh64 | sh64le \
+ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet \
+ | sparclite \
+ | sparcv8 | sparcv9 | sparcv9b | sparcv9v | sv1 | sx* \
+ | spu \
+ | tahoe \
+ | thumbv7* \
+ | tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \
+ | tron \
+ | ubicom32 \
+ | v70 | v850 | v850e | v850e1 | v850es | v850e2 | v850e2v3 \
+ | vax \
+ | visium \
+ | w65 \
+ | wasm32 | wasm64 \
+ | we32k \
+ | x86 | x86_64 | xc16x | xgate | xps100 \
+ | xstormy16 | xtensa* \
+ | ymp \
+ | z8k | z80)
+ ;;
+
+ *)
+ echo Invalid configuration \`"$1"\': machine \`"$cpu-$vendor"\' not recognized 1>&2
+ exit 1
+ ;;
+ esac
;;
esac
# Here we canonicalize certain aliases for manufacturers.
-case $basic_machine in
- *-digital*)
- basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
+case $vendor in
+ digital*)
+ vendor=dec
;;
- *-commodore*)
- basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
+ commodore*)
+ vendor=cbm
;;
*)
;;
@@ -1321,200 +1306,215 @@ esac
# Decode manufacturer-specific aliases for certain operating systems.
-if [ x"$os" != x"" ]
+if test x$basic_os != x
then
+
+# First recognize some ad-hoc cases, or perhaps split kernel-os, or else just
+# set os.
+case $basic_os in
+ gnu/linux*)
+ kernel=linux
+ os=`echo "$basic_os" | sed -e 's|gnu/linux|gnu|'`
+ ;;
+ os2-emx)
+ kernel=os2
+ os=`echo "$basic_os" | sed -e 's|os2-emx|emx|'`
+ ;;
+ nto-qnx*)
+ kernel=nto
+ os=`echo "$basic_os" | sed -e 's|nto-qnx|qnx|'`
+ ;;
+ *-*)
+ # shellcheck disable=SC2162
+ saved_IFS=$IFS
+ IFS="-" read kernel os <&2
- exit 1
+ # No normalization, but not necessarily accepted, that comes below.
;;
esac
+
else
# Here we handle the default operating systems that come with various machines.
@@ -1527,261 +1527,363 @@ else
# will signal an error saying that MANUFACTURER isn't an operating
# system, and we'll never get to this point.
-case $basic_machine in
+kernel=
+case $cpu-$vendor in
score-*)
- os=-elf
+ os=elf
;;
spu-*)
- os=-elf
+ os=elf
;;
*-acorn)
- os=-riscix1.2
+ os=riscix1.2
;;
arm*-rebel)
- os=-linux
+ kernel=linux
+ os=gnu
;;
arm*-semi)
- os=-aout
+ os=aout
;;
c4x-* | tic4x-*)
- os=-coff
+ os=coff
+ ;;
+ c8051-*)
+ os=elf
+ ;;
+ clipper-intergraph)
+ os=clix
;;
hexagon-*)
- os=-elf
+ os=elf
;;
tic54x-*)
- os=-coff
+ os=coff
;;
tic55x-*)
- os=-coff
+ os=coff
;;
tic6x-*)
- os=-coff
+ os=coff
;;
# This must come before the *-dec entry.
pdp10-*)
- os=-tops20
+ os=tops20
;;
pdp11-*)
- os=-none
+ os=none
;;
*-dec | vax-*)
- os=-ultrix4.2
+ os=ultrix4.2
;;
m68*-apollo)
- os=-domain
+ os=domain
;;
i386-sun)
- os=-sunos4.0.2
+ os=sunos4.0.2
;;
m68000-sun)
- os=-sunos3
+ os=sunos3
;;
m68*-cisco)
- os=-aout
+ os=aout
;;
mep-*)
- os=-elf
+ os=elf
;;
mips*-cisco)
- os=-elf
+ os=elf
;;
mips*-*)
- os=-elf
- ;;
- or1k-*)
- os=-elf
+ os=elf
;;
or32-*)
- os=-coff
+ os=coff
;;
*-tti) # must be before sparc entry or we get the wrong os.
- os=-sysv3
+ os=sysv3
;;
sparc-* | *-sun)
- os=-sunos4.1.1
+ os=sunos4.1.1
+ ;;
+ pru-*)
+ os=elf
;;
*-be)
- os=-beos
- ;;
- *-haiku)
- os=-haiku
+ os=beos
;;
*-ibm)
- os=-aix
+ os=aix
;;
*-knuth)
- os=-mmixware
+ os=mmixware
;;
*-wec)
- os=-proelf
+ os=proelf
;;
*-winbond)
- os=-proelf
+ os=proelf
;;
*-oki)
- os=-proelf
+ os=proelf
;;
*-hp)
- os=-hpux
+ os=hpux
;;
*-hitachi)
- os=-hiux
+ os=hiux
;;
i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
- os=-sysv
+ os=sysv
;;
*-cbm)
- os=-amigaos
+ os=amigaos
;;
*-dg)
- os=-dgux
+ os=dgux
;;
*-dolphin)
- os=-sysv3
+ os=sysv3
;;
m68k-ccur)
- os=-rtu
+ os=rtu
;;
m88k-omron*)
- os=-luna
- ;;
- *-next )
- os=-nextstep
- ;;
- *-sequent)
- os=-ptx
- ;;
- *-crds)
- os=-unos
- ;;
- *-ns)
- os=-genix
- ;;
- i370-*)
- os=-mvs
+ os=luna
;;
*-next)
- os=-nextstep3
+ os=nextstep
+ ;;
+ *-sequent)
+ os=ptx
+ ;;
+ *-crds)
+ os=unos
+ ;;
+ *-ns)
+ os=genix
+ ;;
+ i370-*)
+ os=mvs
;;
*-gould)
- os=-sysv
+ os=sysv
;;
*-highlevel)
- os=-bsd
+ os=bsd
;;
*-encore)
- os=-bsd
+ os=bsd
;;
*-sgi)
- os=-irix
+ os=irix
;;
*-siemens)
- os=-sysv4
+ os=sysv4
;;
*-masscomp)
- os=-rtu
+ os=rtu
;;
f30[01]-fujitsu | f700-fujitsu)
- os=-uxpv
+ os=uxpv
;;
*-rom68k)
- os=-coff
+ os=coff
;;
*-*bug)
- os=-coff
+ os=coff
;;
*-apple)
- os=-macos
+ os=macos
;;
*-atari*)
- os=-mint
+ os=mint
+ ;;
+ *-wrs)
+ os=vxworks
;;
*)
- os=-none
+ os=none
;;
esac
+
fi
+# Now, validate our (potentially fixed-up) OS.
+case $os in
+ # Sometimes we do "kernel-libc", so those need to count as OSes.
+ musl* | newlib* | relibc* | uclibc*)
+ ;;
+ # Likewise for "kernel-abi"
+ eabi* | gnueabi*)
+ ;;
+ # VxWorks passes extra cpu info in the 4th filed.
+ simlinux | simwindows | spe)
+ ;;
+ # Now accept the basic system types.
+ # The portable systems comes first.
+ # Each alternative MUST end in a * to match a version number.
+ gnu* | android* | bsd* | mach* | minix* | genix* | ultrix* | irix* \
+ | *vms* | esix* | aix* | cnk* | sunos | sunos[34]* \
+ | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \
+ | sym* | plan9* | psp* | sim* | xray* | os68k* | v88r* \
+ | hiux* | abug | nacl* | netware* | windows* \
+ | os9* | macos* | osx* | ios* \
+ | mpw* | magic* | mmixware* | mon960* | lnews* \
+ | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \
+ | aos* | aros* | cloudabi* | sortix* | twizzler* \
+ | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \
+ | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \
+ | mirbsd* | netbsd* | dicos* | openedition* | ose* \
+ | bitrig* | openbsd* | secbsd* | solidbsd* | libertybsd* | os108* \
+ | ekkobsd* | freebsd* | riscix* | lynxos* | os400* \
+ | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \
+ | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \
+ | udi* | lites* | ieee* | go32* | aux* | hcos* \
+ | chorusrdb* | cegcc* | glidix* | serenity* \
+ | cygwin* | msys* | pe* | moss* | proelf* | rtems* \
+ | midipix* | mingw32* | mingw64* | mint* \
+ | 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* \
+ | scout* | superux* | sysv* | rtmk* | tpf* | windiss* \
+ | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \
+ | skyos* | haiku* | rdos* | toppers* | drops* | es* \
+ | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
+ | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \
+ | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr* \
+ | fiwix* )
+ ;;
+ # This one is extra strict with allowed versions
+ sco3.2v2 | sco3.2v[4-9]* | sco5v6*)
+ # Don't forget version if it is 3.2v4 or newer.
+ ;;
+ none)
+ ;;
+ *)
+ echo Invalid configuration \`"$1"\': OS \`"$os"\' not recognized 1>&2
+ exit 1
+ ;;
+esac
+
+# As a final step for OS-related things, validate the OS-kernel combination
+# (given a valid OS), if there is a kernel.
+case $kernel-$os in
+ linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* \
+ | linux-musl* | linux-relibc* | linux-uclibc* )
+ ;;
+ uclinux-uclibc* )
+ ;;
+ -dietlibc* | -newlib* | -musl* | -relibc* | -uclibc* )
+ # These are just libc implementations, not actual OSes, and thus
+ # require a kernel.
+ echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2
+ exit 1
+ ;;
+ kfreebsd*-gnu* | kopensolaris*-gnu*)
+ ;;
+ vxworks-simlinux | vxworks-simwindows | vxworks-spe)
+ ;;
+ nto-qnx*)
+ ;;
+ os2-emx)
+ ;;
+ *-eabi* | *-gnueabi*)
+ ;;
+ -*)
+ # Blank kernel with real OS is always fine.
+ ;;
+ *-*)
+ echo "Invalid configuration \`$1': Kernel \`$kernel' not known to work with OS \`$os'." 1>&2
+ exit 1
+ ;;
+esac
+
# Here we handle the case where we know the os, and the CPU type, but not the
# manufacturer. We pick the logical manufacturer.
-vendor=unknown
-case $basic_machine in
- *-unknown)
- case $os in
- -riscix*)
+case $vendor in
+ unknown)
+ case $cpu-$os in
+ *-riscix*)
vendor=acorn
;;
- -sunos*)
+ *-sunos*)
vendor=sun
;;
- -cnk*|-aix*)
+ *-cnk* | *-aix*)
vendor=ibm
;;
- -beos*)
+ *-beos*)
vendor=be
;;
- -hpux*)
+ *-hpux*)
vendor=hp
;;
- -mpeix*)
+ *-mpeix*)
vendor=hp
;;
- -hiux*)
+ *-hiux*)
vendor=hitachi
;;
- -unos*)
+ *-unos*)
vendor=crds
;;
- -dgux*)
+ *-dgux*)
vendor=dg
;;
- -luna*)
+ *-luna*)
vendor=omron
;;
- -genix*)
+ *-genix*)
vendor=ns
;;
- -mvs* | -opened*)
+ *-clix*)
+ vendor=intergraph
+ ;;
+ *-mvs* | *-opened*)
vendor=ibm
;;
- -os400*)
+ *-os400*)
vendor=ibm
;;
- -ptx*)
+ s390-* | s390x-*)
+ vendor=ibm
+ ;;
+ *-ptx*)
vendor=sequent
;;
- -tpf*)
+ *-tpf*)
vendor=ibm
;;
- -vxsim* | -vxworks* | -windiss*)
+ *-vxsim* | *-vxworks* | *-windiss*)
vendor=wrs
;;
- -aux*)
+ *-aux*)
vendor=apple
;;
- -hms*)
+ *-hms*)
vendor=hitachi
;;
- -mpw* | -macos*)
+ *-mpw* | *-macos*)
vendor=apple
;;
- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ *-*mint | *-mint[0-9]* | *-*MiNT | *-MiNT[0-9]*)
vendor=atari
;;
- -vos*)
+ *-vos*)
vendor=stratus
;;
esac
- basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
;;
esac
-echo $basic_machine$os
+echo "$cpu-$vendor-${kernel:+$kernel-}$os"
exit
# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "timestamp='"
# time-stamp-format: "%:y-%02m-%02d"
# time-stamp-end: "'"
diff --git a/autoconf/configure.ac b/autoconf/configure.ac
index b5cee7f4..bde64a1b 100644
--- a/autoconf/configure.ac
+++ b/autoconf/configure.ac
@@ -1,307 +1,25 @@
dnl To generate a new top level configure script from this autoconf directory
dnl 1. aclocal
dnl 2. autoconf -o ../configure
-dnl If you run into "configure.ac:15: error: possibly undefined macro: AC_MSG_ERROR",
-dnl try:
-dnl autoreconf -fi
AC_INIT([Trick],[17+])
AC_LANG(C++)
AC_CONFIG_AUX_DIR([autoconf])
-
-AC_DEFUN([AX_LLVM_HOME],[
- AC_ARG_WITH([llvm],
- AS_HELP_STRING([--with-llvm@<:@=DIR@:>@], [LLVM root directory]),
- [LLVM_HOME="$withval"
- AC_PATH_PROG(LLVM_CONFIG, llvm-config, no-llvm-config, "$LLVM_HOME/bin")
- AS_IF([test "$ac_cv_path_LLVM_CONFIG" = "no-llvm-config"],AC_MSG_ERROR([could not find llvm-config]),[])
- ],
- [
- AC_PATH_PROG(LLVM_CONFIG, llvm-config, no-llvm-config, "/bin:/usr/bin:/usr/local/bin:/sw/bin:/usr/local/opt/llvm/bin")
- AS_IF([test "$ac_cv_path_LLVM_CONFIG" = "no-llvm-config"],AC_MSG_ERROR([could not find llvm-config]),[])
- LLVM_HOME=`$LLVM_CONFIG --prefix`
- ]
- )
-])
-
-AC_DEFUN([AX_HDF5_HOME],[
- AC_ARG_WITH([hdf5],
- AS_HELP_STRING([--with-hdf5@<:@=DIR@:>@], [HDF5 root directory]),
- [HDF5_HOME="$withval"
- AS_IF([test "$HDF5_HOME" = "yes"],
- AC_CHECK_HEADER(hdf5.h,[HDF5_HOME="/usr"],AC_MSG_ERROR([could not find hdf5.h])),
- AS_IF([test "$HDF5_HOME" = "no"],[HDF5_HOME=""],
- AC_CHECK_FILE([$HDF5_HOME/include/hdf5.h],
- [],
- AC_MSG_ERROR([could not find $HDF5_HOME/include/hdf5.h])
- )
- )
- )],
- [
- AC_CHECK_HEADER(hdf5.h, [HDF5_HOME="/usr"], [HDF5_HOME=""])
- ]
- )
- AS_IF([test "$HDF5_HOME" != ""],
- [
- LDFLAGS="${LDFLAGS} -L${HDF5_HOME}/lib"
- AC_CHECK_LIB(hdf5, main, [],AC_MSG_ERROR([could not find libhdf5]))
- ]
- []
- )
- AC_SUBST([HDF5_HOME])
-])
-
-AC_DEFUN([AX_GSL_HOME],[
- AC_ARG_WITH([gsl],
- AS_HELP_STRING([--with-gsl@<:@=DIR@:>@], [GSL root directory]),
- [GSL_HOME="$withval"
- AS_IF([test "$GSL_HOME" = "yes"],
- AC_CHECK_HEADER(gsl/gsl_rng.h,[GSL_HOME="/usr"],AC_MSG_ERROR([could not find gsl/gsl_rng.h])),
- AS_IF([test "$GSL_HOME" = "no"],[GSL_HOME=""],
- AC_CHECK_FILE([$GSL_HOME/include/gsl],
- [],
- AC_MSG_ERROR([could not find $GSL_HOME/include/gsl])
- )
- )
- )],
- [AC_CHECK_HEADER(gsl/gsl_rng.h, [GSL_HOME="/usr"], [GSL_HOME=""])]
- )
- AS_IF([test "$GSL_HOME" != ""],
- [
- LDFLAGS="${LDFLAGS} -L${GSL_HOME}/lib"
- AC_CHECK_LIB(gsl, main, [],AC_MSG_ERROR([could not find libgsl]),[-lgslcblas])
- ],
- []
- )
- AC_SUBST([GSL_HOME])
-])
-
-AC_DEFUN([AX_GTEST_HOME],[
- AC_ARG_WITH([gtest],
- AS_HELP_STRING([--with-gtest@<:@=DIR@:>@], [GTEST root directory]),
- [GTEST_HOME="$withval"
- AS_IF([test "$GTEST_HOME" = "yes"],
- AC_CHECK_HEADER(gtest/gtest.h,[GTEST_HOME="/usr"],AC_MSG_ERROR([could not find gtest/gtest.h])),
- AS_IF([test "$GTEST_HOME" = "no"],[GTEST_HOME=""],
- AC_CHECK_FILE([$GTEST_HOME/include/gtest],
- [],
- AC_MSG_ERROR([could not find $GTEST_HOME/include/gtest])
- )
- )
- )],
- [AC_CHECK_HEADER(gtest/gtest.h, [GTEST_HOME="/usr"], [GTEST_HOME=""])]
- )
- AC_SUBST([GTEST_HOME])
-])
-
-AC_DEFUN([AX_CIVETWEB_HOME],[
- AC_ARG_WITH([civetweb],
- AS_HELP_STRING([--with-civetweb@<:@=DIR@:>@],
- [CIVETWEB root directory]),
- # --with option was provided.
- [CIVETWEB_HOME="$withval"
- USE_CIVETWEB="0"
- # check whether directory arg was also provided.
- AS_IF([test "$CIVETWEB_HOME" = "yes"],
- AC_CHECK_HEADER(civetweb.h,
- [CIVETWEB_HOME="/usr"; USE_CIVETWEB="1"],
- AC_MSG_ERROR([could not find civetweb.h])),
- # else check whether --without-civet or --with-civet=no specified.
- AS_IF([test "$CIVETWEB_HOME" = "no"],
- [CIVETWEB_HOME=""],
- # else --with-civet was provided with a directory path.
- AC_CHECK_FILES([$CIVETWEB_HOME/include/civetweb.h $CIVETWEB_HOME/lib/libcivetweb.a],
- [USE_CIVETWEB="1"],
- AC_MSG_ERROR([Could not find all of the civetweb files.]))
- ))
- ],
- # --with option not provided.
- [AC_CHECK_HEADER(civetweb.h,
- [CIVETWEB_HOME="/usr"; USE_CIVETWEB="1"],
- [CIVETWEB_HOME=""; USE_CIVETWEB="0"])
- ]
- )
- AC_SUBST([CIVETWEB_HOME])
- AC_SUBST([USE_CIVETWEB])
-])
-
-
-AC_DEFUN([AX_SWIG_BIN],[
- AC_ARG_WITH([swig],
- [AS_HELP_STRING([--with-swig@<:@=DIR@:>@], [path of directory containing the SWIG executable.])],
- [
- TEMP_PATH="${PATH}"
- PATH="$withval:${PATH}"
- AX_PKG_SWIG($1, [], [AC_MSG_ERROR([Trick requires SWIG version >= 2.0])])
- PATH="${TEMP_PATH}"
- ],
- [AX_PKG_SWIG($1, [], [AC_MSG_ERROR([Trick requires SWIG version >= 2.0])])]
- )
-])
-
-AC_DEFUN([AX_UDUNITS_HOME],[
- AC_ARG_WITH([udunits],
- AS_HELP_STRING([--with-udunits@<:@=DIR@:>@], [UDUnits root directory]),
- [UDUNITS_HOME="$withval"],
- [UDUNITS_HOME=""]
- )
- AC_SUBST([UDUNITS_HOME])
-])
-
-dnl SOURCE: https://stackoverflow.com/a/59191148
-
-dnl NA_HELP_STRINGS(list1, help1[, list2, help2[, ... listN, helpN]])
-dnl **************************************************************************
-dnl
-dnl Similar to `AS_HELP_STRING()`, but with support for multiple strings, each
-dnl one associated with one or more options
-dnl
-dnl From: https://github.com/madmurphy/not-autotools
-dnl
-dnl **************************************************************************
-m4_define([NA_HELP_STRINGS],
- [m4_if(m4_count($1), [1],
- [m4_if([$#], [0], [], [$#], [1],
- [m4_text_wrap($1, [ ])],
- [AS_HELP_STRING(m4_normalize($1), [$2])m4_if([$#], [2], [], [m4_newline()NA_HELP_STRINGS(m4_shift2($@))])])],
- [m4_text_wrap(m4_argn(1, $1)[,], [ ])m4_newline()NA_HELP_STRINGS(m4_dquote(m4_shift($1))m4_if([$#], [1], [], [, m4_shift($@)]))])])
-
-
-
-dnl test if want to prepend /usr/local/bin to PATH
-dnl AC_ARG_WITH (package, help-string, [action-if-given], [action-if-not-given])
-AC_DEFUN(
- [AX_PREPEND_PATH],
- [AC_ARG_WITH(
- [prepend-path],
- [NA_HELP_STRINGS(
-[--without-prepend-path], [do not prepend to path (this is default)], [--with-prepend-path@<:@=DIR@:>@], [specify a directory to prepend to PATH (default is /usr/local/bin)])],
- [AS_IF(
- [test "x${with_prepend_path}" = xyes],
- [PATH="/usr/local/bin:${PATH}"],
- [AS_IF(
- [test "x${with_prepend_path}" != xno],
- [PATH="${withval}:${PATH}"],
- []
- )]
- )],
- []
- )]
-)
-
-
-dnl test if we want to use java, default to yes
-AC_DEFUN([AX_JAVA],[
- AC_ARG_ENABLE([java],
- AS_HELP_STRING([--enable-java], [use java (default is yes)]),
- AS_IF([test "x$enable_java" = xyes], [USE_JAVA="1"], [USE_JAVA="0"]),
- [USE_JAVA="1"]
- )
- AC_SUBST([USE_JAVA])
- AS_IF([test "$USE_JAVA" = "1"],[
- AC_PROG_AWK
- AX_PROG_JAVA_CC(javac)
- JAVA_VER=`$JAVA_CC -version 2>&1 | $ac_cv_path_PERL -ne 'print $& if /\d+(\.\d+)?/'`
- AC_MSG_CHECKING([$JAVA_CC version >= 1.8])
- AX_COMPARE_VERSION([$JAVA_VER],[ge],[1.8], [AC_MSG_RESULT([yes])],
- [AC_MSG_RESULT([no])
- AC_MSG_ERROR([Trick requires javac version >= 1.8])
- ])
- AS_IF([test "$TRICK_OFFLINE" = "0"], [
- AC_PATH_PROG(MVN, mvn, nomvn)
- AS_IF([test "$ac_cv_path_MVN" = "nomvn"],AC_MSG_ERROR([could not find maven]),[])
- ], [])
- ],[])
-])
-
-dnl test if we want to use er7_utils, default to yes
-AC_DEFUN([AX_ER7_UTILS],[
- AC_ARG_ENABLE([er7utils],
- AS_HELP_STRING([--enable-er7utils], [use er7_utils (default is yes)]),
- AS_IF([test "x$enable_er7utils" = xyes], [USE_ER7_UTILS="1"], [USE_ER7_UTILS="0"]),
- [USE_ER7_UTILS="1"]
- )
- AC_SUBST([USE_ER7_UTILS])
-])
-
-dnl if fermi-ware directory exists, test for motif.
-AC_DEFUN([AX_JSC_DIRS],[
- AC_CHECK_FILE([trick_source/data_products/fermi-ware],
- [
- AC_CHECK_HEADER(Xm/Xm.h, [MOTIF_HOME="/usr"],
- AC_CHECK_FILE(/usr/local/include/Xm/Xm.h, [MOTIF_HOME="/usr/local"],
- AC_CHECK_FILE(/sw/include/Xm/Xm.h, [MOTIF_HOME="/sw"],AC_MSG_ERROR([could not find Xm/Xm.h]))))
- ],
- [
- MOTIF_HOME=""
- ]
- )
- AC_SUBST([MOTIF_HOME])
-])
-
-AC_DEFUN([AX_GCC_VERSION], [
- GCC_VERSION=""
- AS_IF([test "x$GCC" = "xyes"],[
- AS_IF([test "x$ax_gcc_version_option" != "xno"],[
- AC_CACHE_CHECK([gcc version],[ax_cv_gcc_version],[
- ax_cv_gcc_version="`$CC -dumpversion`"
- AS_IF([test "x$ax_cv_gcc_version" = "x"],[
- ax_cv_gcc_version=""
- ])
- ])
- GCC_VERSION=$ax_cv_gcc_version
- ])
- ])
- AC_SUBST([GCC_VERSION])
-])
+AC_CONFIG_MACRO_DIRS([m4])
dnl get the host and build.
AC_CANONICAL_HOST
AC_CANONICAL_BUILD
-dnl AC_CANONICAL_HOST provides platform. MacOSX is diverging... have to do special things
-ON_MAC=no
-case "${host_os}" in
- darwin*)
- ON_MAC=yes
- ;;
- *)
- ;;
-esac
-
-
-dnl add extra paths to find xml headers and X headers on the mac.
-AS_IF([test "$ON_MAC" = "yes"],
-[
- AC_PATH_PROG(XCRUN, xcrun, noxcrun)
- AS_IF([test "$ac_cv_path_XCRUN" = "norun"],AC_MSG_ERROR([could not find xcrun - install Xcode command line tools]),[])
- XCODE_SDK_PATH=`$XCRUN --show-sdk-path`
- XTRAINCPATHS="-I/usr/X11/include -I${XCODE_SDK_PATH}/usr/include -I${XCODE_SDK_PATH}/usr/include/libxml2"
-],
-[
- XTRAINCPATHS="-I/usr/include/libxml2/"
-])
-CFLAGS="$CFLAGS $XTRAINCPATHS"
-CPPFLAGS="$CPPFLAGS $XTRAINCPATHS"
+dnl check if we are on a mac
+TR_MAC_DARWIN()
+dnl add x11 libs to environment
+TR_X11()
dnl look for X windows libraries and headers we need to compile
dnl these checks must be done before we force 32bit mode.
-AC_PATH_X
-AS_IF([test "$no_x" = "yes"],
- [
- USE_X_WINDOWS=0
- ],
- [
- USE_X_WINDOWS=1
- AS_IF([test "x$x_includes" = "x"],[],[X_INCLUDE_DIR=-I$x_includes])
- AS_IF([test "x$x_libraries" = "x"],[],[X_LIB_DIR=-L$x_libraries])
- AC_CHECK_HEADER([X11/Intrinsic.h],[],AC_MSG_ERROR([could not find libxt development headers]))
- AX_JSC_DIRS([])
- ]
-)
-AC_SUBST([USE_X_WINDOWS])
-AC_SUBST([X_LIB_DIR])
+TR_XWINDOWS()
dnl TODO Need to check 64bit only!
AC_CHECK_LIB(xml2, main,
@@ -377,7 +95,7 @@ AC_PROG_CC
AC_PROG_CXX
dnl do not test gcc version on mac. clang as gcc will return version and it's not >= 4.8
-AS_IF([test "$ON_MAC" = "no"],[AX_GCC_VERSION],[])
+AS_IF([test "$ON_MAC" = "no"],[TR_GCC_VERSION],[])
dnl if the compiler is gcc, test for gcc >= 4.8
AS_IF([test "x$GCC_VERSION" = "x"],[],
[AC_MSG_CHECKING([gcc version >= 4.8])
@@ -394,7 +112,7 @@ AC_PATH_PROG(TEE, tee, notee)
AS_IF([test "$ac_cv_path_TEE" = "notee"],AC_MSG_ERROR([could not find tee]),[])
AC_PATH_PROG(LD, ld, nold)
AS_IF([test "$ac_cv_path_LD" = "nold"],AC_MSG_ERROR([could not find ld]),[])
-AC_PROG_LEX
+AC_PROG_LEX([noyywrap])
AS_IF([test "x$LEX" = "x:"],AC_MSG_ERROR([could not find flex]),[])
AC_PATH_PROG(BISON, bison, nobison)
AS_IF([test "$ac_cv_path_BISON" = "nobison"],AC_MSG_ERROR([could not find bison]),[])
@@ -463,21 +181,22 @@ AX_COMPARE_VERSION(
PYTHON_CPPFLAGS=`${PYTHON_CONFIG} --includes | sed 's/-I/-isystem/g'`
PYTHON_LIBS=`${PYTHON_LIBS_COMMAND} | tr '\r\n' ' '`
+
AC_SUBST([PYTHON_CPPFLAGS])
AC_SUBST([PYTHON_LIBS])
AC_SUBST([PYTHON_EXTRA_LIBS])
-AX_PREPEND_PATH
+TR_PREPEND_PATH()
AC_PATH_PROG(GNUPLOT, gnuplot, nognuplot)
AS_IF([test "$ac_cv_path_GNUPLOT" = "nognuplot"],AC_MSG_NOTICE([could not find gnuplot]),[])
-AX_SWIG_BIN([2.0])
-AX_JAVA
+TR_SWIG_BIN([2.0])
+TR_JAVA
AX_PTHREAD()
AX_PROG_PERL_MODULES( Text::Balanced ,[],AC_MSG_ERROR([could not find perl modules Text::Balanced]))
AX_PROG_PERL_MODULES( Digest::MD5,[],AC_MSG_ERROR([could not find perl module Digest::MD5]))
dnl process the optional --with-llvm command line arguments
-AX_LLVM_HOME([])
+TR_LLVM_HOME([])
LLVM_LIB_DIR=`$LLVM_CONFIG --libdir`
LLVM_BIN_DIR=`$LLVM_CONFIG --bindir`
LLVM_INCLUDE_DIR=`$LLVM_CONFIG --includedir`
@@ -514,19 +233,11 @@ AC_CHECK_FILE([$LLVM_LIB_DIR/libclangFrontend.a],
)
)
+AC_CHECK_FILE([$LLVM_LIB_DIR/libclangSupport.a],[ICG_CLANGLIBS="$ICG_CLANGLIBS -lclangSupport"],[])
+
AC_SUBST([ICG_CLANGLIBS])
-
-AC_DEFUN([AX_CLANG_VERSION], [
- CLANG_VERSION=""
- ax_cv_clang_version="`$CLANG --version | grep "version" | sed "s/.*version \([0-9]*\.[0-9]*\.[0-9]*\).*/\1/"`"
- AS_IF([test "x$ax_cv_clang_version" = "x"],[
- ax_cv_clang_version=""
- ])
- CLANG_VERSION=$ax_cv_clang_version
- AC_SUBST([CLANG_VERSION])
-])
-AX_CLANG_VERSION
+TR_CLANG_VERSION
dnl if llvm/clang, test for version >= 3.4.2
AS_IF([test "x$CLANG_VERSION" = "x"],[],
[AC_MSG_CHECKING([clang version >= 3.4.2])
@@ -539,7 +250,7 @@ AS_IF([test "x$CLANG_VERSION" = "x"],[],
AX_CHECK_ZLIB([],AC_MSG_ERROR([could not find zlib]))
dnl look for udunits in /usr/include and /usr/include/udunits2
-AX_UDUNITS_HOME([])
+TR_UDUNITS_HOME([])
AS_IF([test "$UDUNITS_HOME" = ""],
[
AC_CHECK_HEADER([udunits2.h],
@@ -571,11 +282,11 @@ AC_SUBST([UDUNITS_LDFLAGS])
AC_SUBST([UDUNITS_EXCLUDE])
dnl process the other optional command line arguments
-AX_HDF5_HOME([])
-AX_GSL_HOME([])
-AX_GTEST_HOME([])
-AX_CIVETWEB_HOME([])
-AX_ER7_UTILS([])
+TR_HDF5_HOME([])
+TR_GSL_HOME([])
+TR_GTEST_HOME([])
+TR_CIVETWEB_HOME([])
+TR_ER7_UTILS([])
AC_CONFIG_FILES([share/trick/makefiles/config_user.mk])
AC_OUTPUT
diff --git a/autoconf/install-sh b/autoconf/install-sh
index 377bb868..ec298b53 100755
--- a/autoconf/install-sh
+++ b/autoconf/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;;
+ # 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
- *[0-7])
- mkdir_umask=`expr $umask + 22 \
- - $umask % 100 % 40 + $umask % 20 \
- - $umask % 10 % 4 + $umask % 2
- `;;
- *) mkdir_umask=$umask,go-w;;
- esac
+ 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-$$
- # 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
+ 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
+ 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/
+ 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 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"
+ # 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:
diff --git a/autoconf/m4/tr_civetweb_home.m4 b/autoconf/m4/tr_civetweb_home.m4
new file mode 100644
index 00000000..5ed7ff1f
--- /dev/null
+++ b/autoconf/m4/tr_civetweb_home.m4
@@ -0,0 +1,32 @@
+
+
+AC_DEFUN([TR_CIVETWEB_HOME],[
+ AC_ARG_WITH([civetweb],
+ AS_HELP_STRING([--with-civetweb@<:@=DIR@:>@],
+ [CIVETWEB root directory]),
+ # --with option was provided.
+ [CIVETWEB_HOME="$withval"
+ USE_CIVETWEB="0"
+ # check whether directory arg was also provided.
+ AS_IF([test "$CIVETWEB_HOME" = "yes"],
+ AC_CHECK_HEADER(civetweb.h,
+ [CIVETWEB_HOME="/usr"; USE_CIVETWEB="1"],
+ AC_MSG_ERROR([could not find civetweb.h])),
+ # else check whether --without-civet or --with-civet=no specified.
+ AS_IF([test "$CIVETWEB_HOME" = "no"],
+ [CIVETWEB_HOME=""],
+ # else --with-civet was provided with a directory path.
+ AC_CHECK_FILES([$CIVETWEB_HOME/include/civetweb.h $CIVETWEB_HOME/lib/libcivetweb.a],
+ [USE_CIVETWEB="1"],
+ AC_MSG_ERROR([Could not find all of the civetweb files.]))
+ ))
+ ],
+ # --with option not provided.
+ [AC_CHECK_HEADER(civetweb.h,
+ [CIVETWEB_HOME="/usr"; USE_CIVETWEB="1"],
+ [CIVETWEB_HOME=""; USE_CIVETWEB="0"])
+ ]
+ )
+ AC_SUBST([CIVETWEB_HOME])
+ AC_SUBST([USE_CIVETWEB])
+])
diff --git a/autoconf/m4/tr_clang_version.m4 b/autoconf/m4/tr_clang_version.m4
new file mode 100644
index 00000000..99b0aac8
--- /dev/null
+++ b/autoconf/m4/tr_clang_version.m4
@@ -0,0 +1,11 @@
+
+
+AC_DEFUN([TR_CLANG_VERSION], [
+ CLANG_VERSION=""
+ ax_cv_clang_version="`$CLANG --version | grep "version" | sed "s/.*version \([0-9]*\.[0-9]*\.[0-9]*\).*/\1/"`"
+ AS_IF([test "x$ax_cv_clang_version" = "x"],[
+ ax_cv_clang_version=""
+ ])
+ CLANG_VERSION=$ax_cv_clang_version
+ AC_SUBST([CLANG_VERSION])
+])
\ No newline at end of file
diff --git a/autoconf/m4/tr_er7_utils.m4 b/autoconf/m4/tr_er7_utils.m4
new file mode 100644
index 00000000..574ad8e1
--- /dev/null
+++ b/autoconf/m4/tr_er7_utils.m4
@@ -0,0 +1,11 @@
+
+
+dnl test if we want to use er7_utils, default to yes
+AC_DEFUN([TR_ER7_UTILS],[
+ AC_ARG_ENABLE([er7utils],
+ AS_HELP_STRING([--enable-er7utils], [use er7_utils (default is yes)]),
+ AS_IF([test "x$enable_er7utils" = xyes], [USE_ER7_UTILS="1"], [USE_ER7_UTILS="0"]),
+ [USE_ER7_UTILS="1"]
+ )
+ AC_SUBST([USE_ER7_UTILS])
+])
\ No newline at end of file
diff --git a/autoconf/m4/tr_gcc_version.m4 b/autoconf/m4/tr_gcc_version.m4
new file mode 100644
index 00000000..0b9c96fb
--- /dev/null
+++ b/autoconf/m4/tr_gcc_version.m4
@@ -0,0 +1,17 @@
+
+
+AC_DEFUN([TR_GCC_VERSION], [
+ GCC_VERSION=""
+ AS_IF([test "x$GCC" = "xyes"],[
+ AS_IF([test "x$ax_gcc_version_option" != "xno"],[
+ AC_CACHE_CHECK([gcc version],[ax_cv_gcc_version],[
+ ax_cv_gcc_version="`$CC -dumpfullversion -dumpversion`"
+ AS_IF([test "x$ax_cv_gcc_version" = "x"],[
+ ax_cv_gcc_version=""
+ ])
+ ])
+ GCC_VERSION=$ax_cv_gcc_version
+ ])
+ ])
+ AC_SUBST([GCC_VERSION])
+])
\ No newline at end of file
diff --git a/autoconf/m4/tr_gsl_home.m4 b/autoconf/m4/tr_gsl_home.m4
new file mode 100644
index 00000000..d0e51536
--- /dev/null
+++ b/autoconf/m4/tr_gsl_home.m4
@@ -0,0 +1,26 @@
+
+
+AC_DEFUN([TR_GSL_HOME],[
+ AC_ARG_WITH([gsl],
+ AS_HELP_STRING([--with-gsl@<:@=DIR@:>@], [GSL root directory]),
+ [GSL_HOME="$withval"
+ AS_IF([test "$GSL_HOME" = "yes"],
+ AC_CHECK_HEADER(gsl/gsl_rng.h,[GSL_HOME="/usr"],AC_MSG_ERROR([could not find gsl/gsl_rng.h])),
+ AS_IF([test "$GSL_HOME" = "no"],[GSL_HOME=""],
+ AC_CHECK_FILE([$GSL_HOME/include/gsl],
+ [],
+ AC_MSG_ERROR([could not find $GSL_HOME/include/gsl])
+ )
+ )
+ )],
+ [AC_CHECK_HEADER(gsl/gsl_rng.h, [GSL_HOME="/usr"], [GSL_HOME=""])]
+ )
+ AS_IF([test "$GSL_HOME" != ""],
+ [
+ LDFLAGS="${LDFLAGS} -L${GSL_HOME}/lib"
+ AC_CHECK_LIB(gsl, main, [],AC_MSG_ERROR([could not find libgsl]),[-lgslcblas])
+ ],
+ []
+ )
+ AC_SUBST([GSL_HOME])
+])
diff --git a/autoconf/m4/tr_gtest_home.m4 b/autoconf/m4/tr_gtest_home.m4
new file mode 100644
index 00000000..312c227a
--- /dev/null
+++ b/autoconf/m4/tr_gtest_home.m4
@@ -0,0 +1,19 @@
+
+
+AC_DEFUN([TR_GTEST_HOME],[
+ AC_ARG_WITH([gtest],
+ AS_HELP_STRING([--with-gtest@<:@=DIR@:>@], [GTEST root directory]),
+ [GTEST_HOME="$withval"
+ AS_IF([test "$GTEST_HOME" = "yes"],
+ AC_CHECK_HEADER(gtest/gtest.h,[GTEST_HOME="/usr"],AC_MSG_ERROR([could not find gtest/gtest.h])),
+ AS_IF([test "$GTEST_HOME" = "no"],[GTEST_HOME=""],
+ AC_CHECK_FILE([$GTEST_HOME/include/gtest],
+ [],
+ AC_MSG_ERROR([could not find $GTEST_HOME/include/gtest])
+ )
+ )
+ )],
+ [AC_CHECK_HEADER(gtest/gtest.h, [GTEST_HOME="/usr"], [GTEST_HOME=""])]
+ )
+ AC_SUBST([GTEST_HOME])
+])
\ No newline at end of file
diff --git a/autoconf/m4/tr_hdf5_home.m4 b/autoconf/m4/tr_hdf5_home.m4
new file mode 100644
index 00000000..09ff850b
--- /dev/null
+++ b/autoconf/m4/tr_hdf5_home.m4
@@ -0,0 +1,28 @@
+
+
+AC_DEFUN([TR_HDF5_HOME],[
+ AC_ARG_WITH([hdf5],
+ AS_HELP_STRING([--with-hdf5@<:@=DIR@:>@], [HDF5 root directory]),
+ [HDF5_HOME="$withval"
+ AS_IF([test "$HDF5_HOME" = "yes"],
+ AC_CHECK_HEADER(hdf5.h,[HDF5_HOME="/usr"],AC_MSG_ERROR([could not find hdf5.h])),
+ AS_IF([test "$HDF5_HOME" = "no"],[HDF5_HOME=""],
+ AC_CHECK_FILE([$HDF5_HOME/include/hdf5.h],
+ [],
+ AC_MSG_ERROR([could not find $HDF5_HOME/include/hdf5.h])
+ )
+ )
+ )],
+ [
+ AC_CHECK_HEADER(hdf5.h, [HDF5_HOME="/usr"], [HDF5_HOME=""])
+ ]
+ )
+ AS_IF([test "$HDF5_HOME" != ""],
+ [
+ LDFLAGS="${LDFLAGS} -L${HDF5_HOME}/lib"
+ AC_CHECK_LIB(hdf5, main, [],AC_MSG_ERROR([could not find libhdf5]))
+ ]
+ []
+ )
+ AC_SUBST([HDF5_HOME])
+])
\ No newline at end of file
diff --git a/autoconf/m4/tr_java.m4 b/autoconf/m4/tr_java.m4
new file mode 100644
index 00000000..e4f1e5bb
--- /dev/null
+++ b/autoconf/m4/tr_java.m4
@@ -0,0 +1,25 @@
+
+
+dnl test if we want to use java, default to yes
+AC_DEFUN([TR_JAVA],[
+ AC_ARG_ENABLE([java],
+ AS_HELP_STRING([--enable-java], [use java (default is yes)]),
+ AS_IF([test "x$enable_java" = xyes], [USE_JAVA="1"], [USE_JAVA="0"]),
+ [USE_JAVA="1"]
+ )
+ AC_SUBST([USE_JAVA])
+ AS_IF([test "$USE_JAVA" = "1"],[
+ AC_PROG_AWK
+ AX_PROG_JAVA_CC(javac)
+ JAVA_VER=`$JAVA_CC -version 2>&1 | $ac_cv_path_PERL -ne 'print $& if /\d+(\.\d+)?/'`
+ AC_MSG_CHECKING([$JAVA_CC version >= 1.8])
+ AX_COMPARE_VERSION([$JAVA_VER],[ge],[1.8], [AC_MSG_RESULT([yes])],
+ [AC_MSG_RESULT([no])
+ AC_MSG_ERROR([Trick requires javac version >= 1.8])
+ ])
+ AS_IF([test "$TRICK_OFFLINE" = "0"], [
+ AC_PATH_PROG(MVN, mvn, nomvn)
+ AS_IF([test "$ac_cv_path_MVN" = "nomvn"],AC_MSG_ERROR([could not find maven]),[])
+ ], [])
+ ],[])
+])
diff --git a/autoconf/m4/tr_jsc_dirs.m4 b/autoconf/m4/tr_jsc_dirs.m4
new file mode 100644
index 00000000..696a582f
--- /dev/null
+++ b/autoconf/m4/tr_jsc_dirs.m4
@@ -0,0 +1,16 @@
+
+
+dnl if fermi-ware directory exists, test for motif.
+AC_DEFUN([TR_JSC_DIRS],[
+ AC_CHECK_FILE([trick_source/data_products/fermi-ware],
+ [
+ AC_CHECK_HEADER(Xm/Xm.h, [MOTIF_HOME="/usr"],
+ AC_CHECK_FILE(/usr/local/include/Xm/Xm.h, [MOTIF_HOME="/usr/local"],
+ AC_CHECK_FILE(/sw/include/Xm/Xm.h, [MOTIF_HOME="/sw"],AC_MSG_ERROR([could not find Xm/Xm.h]))))
+ ],
+ [
+ MOTIF_HOME=""
+ ]
+ )
+ AC_SUBST([MOTIF_HOME])
+])
\ No newline at end of file
diff --git a/autoconf/m4/tr_llvm_home.m4 b/autoconf/m4/tr_llvm_home.m4
new file mode 100644
index 00000000..005d4cd1
--- /dev/null
+++ b/autoconf/m4/tr_llvm_home.m4
@@ -0,0 +1,16 @@
+
+
+AC_DEFUN([TR_LLVM_HOME],[
+ AC_ARG_WITH([llvm],
+ AS_HELP_STRING([--with-llvm@<:@=DIR@:>@], [LLVM root directory]),
+ [LLVM_HOME="$withval"
+ AC_PATH_PROG(LLVM_CONFIG, llvm-config, no-llvm-config, "$LLVM_HOME/bin")
+ AS_IF([test "$ac_cv_path_LLVM_CONFIG" = "no-llvm-config"],AC_MSG_ERROR([could not find llvm-config]),[])
+ ],
+ [
+ AC_PATH_PROG(LLVM_CONFIG, llvm-config, no-llvm-config, "/bin:/usr/bin:/usr/local/bin:/sw/bin:/usr/local/opt/llvm/bin")
+ AS_IF([test "$ac_cv_path_LLVM_CONFIG" = "no-llvm-config"],AC_MSG_ERROR([could not find llvm-config]),[])
+ LLVM_HOME=`$LLVM_CONFIG --prefix`
+ ]
+ )
+])
\ No newline at end of file
diff --git a/autoconf/m4/tr_mac_darwin.m4 b/autoconf/m4/tr_mac_darwin.m4
new file mode 100644
index 00000000..fecbbbce
--- /dev/null
+++ b/autoconf/m4/tr_mac_darwin.m4
@@ -0,0 +1,13 @@
+
+dnl Set ON_MAC=yes if we are on a mac (darwin host)
+AC_DEFUN([TR_MAC_DARWIN], [
+ dnl AC_CANONICAL_HOST provides platform. MacOSX is diverging... have to do special things
+ ON_MAC=no
+ case "${host_os}" in
+ darwin*)
+ ON_MAC=yes
+ ;;
+ *)
+ ;;
+ esac
+])
\ No newline at end of file
diff --git a/autoconf/m4/tr_prepend_path.m4 b/autoconf/m4/tr_prepend_path.m4
new file mode 100644
index 00000000..87b0b533
--- /dev/null
+++ b/autoconf/m4/tr_prepend_path.m4
@@ -0,0 +1,19 @@
+
+dnl test if want to prepend /usr/local/bin to PATH
+dnl AC_ARG_WITH (package, help-string, [action-if-given], [action-if-not-given])
+AC_DEFUN([TR_PREPEND_PATH],
+ [AC_ARG_WITH(
+ [prepend-path],
+ [AS_HELP_STRING([--with-prepend-path@<:@=DIR@:>@], [specify a directory to prepend to PATH (default is /usr/local/bin). Use --without-prepend-path for no directory.])],
+ [AS_IF(
+ [test "x${with_prepend_path}" = xyes],
+ [PATH="/usr/local/bin:${PATH}"],
+ [AS_IF(
+ [test "x${with_prepend_path}" != xno],
+ [PATH="${withval}:${PATH}"],
+ []
+ )]
+ )],
+ []
+ )]
+)
diff --git a/autoconf/m4/tr_swig_bin.m4 b/autoconf/m4/tr_swig_bin.m4
new file mode 100644
index 00000000..d9bbfc1c
--- /dev/null
+++ b/autoconf/m4/tr_swig_bin.m4
@@ -0,0 +1,14 @@
+
+
+AC_DEFUN([TR_SWIG_BIN],[
+ AC_ARG_WITH([swig],
+ [AS_HELP_STRING([--with-swig@<:@=DIR@:>@], [path of directory containing the SWIG executable.])],
+ [
+ TEMP_PATH="${PATH}"
+ PATH="$withval:${PATH}"
+ AX_PKG_SWIG($1, [], [AC_MSG_ERROR([Trick requires SWIG version >= 2.0])])
+ PATH="${TEMP_PATH}"
+ ],
+ [AX_PKG_SWIG($1, [], [AC_MSG_ERROR([Trick requires SWIG version >= 2.0])])]
+ )
+])
\ No newline at end of file
diff --git a/autoconf/m4/tr_udunits_home.m4 b/autoconf/m4/tr_udunits_home.m4
new file mode 100644
index 00000000..9979eb20
--- /dev/null
+++ b/autoconf/m4/tr_udunits_home.m4
@@ -0,0 +1,10 @@
+
+
+AC_DEFUN([TR_UDUNITS_HOME],[
+ AC_ARG_WITH([udunits],
+ AS_HELP_STRING([--with-udunits@<:@=DIR@:>@], [UDUnits root directory]),
+ [UDUNITS_HOME="$withval"],
+ [UDUNITS_HOME=""]
+ )
+ AC_SUBST([UDUNITS_HOME])
+])
\ No newline at end of file
diff --git a/autoconf/m4/tr_x11.m4 b/autoconf/m4/tr_x11.m4
new file mode 100644
index 00000000..9f787336
--- /dev/null
+++ b/autoconf/m4/tr_x11.m4
@@ -0,0 +1,16 @@
+
+dnl find xml headers based on host type
+AC_DEFUN([TR_X11], [
+ AS_IF([test "$ON_MAC" = "yes"],
+ [
+ AC_PATH_PROG(XCRUN, xcrun, noxcrun)
+ AS_IF([test "$ac_cv_path_XCRUN" = "norun"],AC_MSG_ERROR([could not find xcrun - install Xcode command line tools]),[])
+ XCODE_SDK_PATH=`$XCRUN --show-sdk-path`
+ XTRAINCPATHS="-I/usr/X11/include -I${XCODE_SDK_PATH}/usr/include -I${XCODE_SDK_PATH}/usr/include/libxml2"
+ ],
+ [
+ XTRAINCPATHS="-I/usr/include/libxml2/"
+ ])
+ CFLAGS="$CFLAGS $XTRAINCPATHS"
+ CPPFLAGS="$CPPFLAGS $XTRAINCPATHS"
+])
\ No newline at end of file
diff --git a/autoconf/m4/tr_xwindows.m4 b/autoconf/m4/tr_xwindows.m4
new file mode 100644
index 00000000..00af2b3c
--- /dev/null
+++ b/autoconf/m4/tr_xwindows.m4
@@ -0,0 +1,19 @@
+
+dnl look for X windows libraries and headers we need to compile
+AC_DEFUN([TR_XWINDOWS], [
+ AC_PATH_X
+ AS_IF([test "$no_x" = "yes"],
+ [
+ USE_X_WINDOWS=0
+ ],
+ [
+ USE_X_WINDOWS=1
+ AS_IF([test "x$x_includes" = "x"],[],[X_INCLUDE_DIR=-I$x_includes])
+ AS_IF([test "x$x_libraries" = "x"],[],[X_LIB_DIR=-L$x_libraries])
+ AC_CHECK_HEADER([X11/Intrinsic.h],[],AC_MSG_ERROR([could not find libxt development headers]))
+ TR_JSC_DIRS([])
+ ]
+ )
+ AC_SUBST([USE_X_WINDOWS])
+ AC_SUBST([X_LIB_DIR])
+])
\ No newline at end of file
diff --git a/autoconf/missing b/autoconf/missing
old mode 100755
new mode 100644
index cdea5149..74eaae7c
--- a/autoconf/missing
+++ b/autoconf/missing
@@ -1,9 +1,9 @@
#! /bin/sh
# Common wrapper for a few potentially missing GNU programs.
-scriptversion=2012-06-26.16; # UTC
+scriptversion=2018-03-07.03; # UTC
-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+# Copyright (C) 1996-2022 Free Software Foundation, Inc.
# Originally written by Fran,cois Pinard , 1996.
# This program is free software; you can redistribute it and/or modify
@@ -17,7 +17,7 @@ scriptversion=2012-06-26.16; # UTC
# 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
@@ -101,9 +101,9 @@ else
exit $st
fi
-perl_URL=http://www.perl.org/
-flex_URL=http://flex.sourceforge.net/
-gnu_software_URL=http://www.gnu.org/software
+perl_URL=https://www.perl.org/
+flex_URL=https://github.com/westes/flex
+gnu_software_URL=https://www.gnu.org/software
program_details ()
{
@@ -160,7 +160,7 @@ give_advice ()
;;
autom4te*)
echo "You might have modified some maintainer files that require"
- echo "the 'automa4te' program to be rebuilt."
+ echo "the 'autom4te' program to be rebuilt."
program_details 'autom4te'
;;
bison*|yacc*)
@@ -207,9 +207,9 @@ give_advice "$1" | sed -e '1s/^/WARNING: /' \
exit $st
# 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:
diff --git a/bin/trick-CP b/bin/trick-CP
index f537fe5a..67430b0a 100755
--- a/bin/trick-CP
+++ b/bin/trick-CP
@@ -60,7 +60,7 @@ if ( -f $sdefine ) {
system("make -f makefile " . $makefileAddArgs) ;
exit $? >> 8;
} else {
- print "S_define does not exist" ;
+ print "S_define does not exist\n" ;
exit 1 ;
}
diff --git a/bin/trick-units b/bin/trick-units
index 2e86f209..2078dbf6 100755
--- a/bin/trick-units
+++ b/bin/trick-units
@@ -134,7 +134,7 @@ print "-" x 50 . "\n";
printf "%25s%s", "Kelvin: ", "K, °K, degK"; print "\n";
printf "%25s%s", "Centigrade: ", "°C, degC"; print "\n";
printf "%25s%s", "Fahrenheit: ", "°F, degF"; print "\n";
-printf "%25s%s", "Rankine: ", "°R, degF"; print "\n";
+printf "%25s%s", "Rankine: ", "°R, degR"; print "\n";
print "\n";
diff --git a/configure b/configure
index dcea12e7..c920daa5 100755
--- a/configure
+++ b/configure
@@ -717,7 +717,6 @@ infodir
docdir
oldincludedir
includedir
-runstatedir
localstatedir
sharedstatedir
sysconfdir
@@ -811,7 +810,6 @@ 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}'
@@ -1064,15 +1062,6 @@ 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=* \
@@ -1210,7 +1199,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 runstatedir
+ libdir localedir mandir
do
eval ac_val=\$$ac_var
# Remove trailing slashes.
@@ -1363,7 +1352,6 @@ 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]
@@ -1413,10 +1401,10 @@ Optional Packages:
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--with-x use the X Window System
--with-python[=DIR] python root directory
- --without-prepend-path do not prepend to path (this is default)
--with-prepend-path[=DIR]
specify a directory to prepend to PATH (default is
- /usr/local/bin)
+ /usr/local/bin). Use --without-prepend-path for no
+ directory.
--with-swig[=DIR] path of directory containing the SWIG executable.
--with-llvm[=DIR] LLVM root directory
--with-zlib=DIR root directory path of zlib installation [defaults to
@@ -2406,36 +2394,6 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
# 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
@@ -2509,19 +2467,20 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
-ON_MAC=no
-case "${host_os}" in
- darwin*)
- ON_MAC=yes
- ;;
- *)
- ;;
-esac
+
+ ON_MAC=no
+ case "${host_os}" in
+ darwin*)
+ ON_MAC=yes
+ ;;
+ *)
+ ;;
+ esac
-if test "$ON_MAC" = "yes"; then :
+ if test "$ON_MAC" = "yes"; then :
- # Extract the first word of "xcrun", so it can be a program name with args.
+ # Extract the first word of "xcrun", so it can be a program name with args.
set dummy xcrun; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
@@ -2562,19 +2521,20 @@ $as_echo "no" >&6; }
fi
- if test "$ac_cv_path_XCRUN" = "norun"; then :
+ if test "$ac_cv_path_XCRUN" = "norun"; then :
as_fn_error $? "could not find xcrun - install Xcode command line tools" "$LINENO" 5
fi
- XCODE_SDK_PATH=`$XCRUN --show-sdk-path`
- XTRAINCPATHS="-I/usr/X11/include -I${XCODE_SDK_PATH}/usr/include -I${XCODE_SDK_PATH}/usr/include/libxml2"
+ XCODE_SDK_PATH=`$XCRUN --show-sdk-path`
+ XTRAINCPATHS="-I/usr/X11/include -I${XCODE_SDK_PATH}/usr/include -I${XCODE_SDK_PATH}/usr/include/libxml2"
else
- XTRAINCPATHS="-I/usr/include/libxml2/"
+ XTRAINCPATHS="-I/usr/include/libxml2/"
fi
-CFLAGS="$CFLAGS $XTRAINCPATHS"
-CPPFLAGS="$CPPFLAGS $XTRAINCPATHS"
+ CFLAGS="$CFLAGS $XTRAINCPATHS"
+ CPPFLAGS="$CPPFLAGS $XTRAINCPATHS"
+
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
@@ -3218,199 +3178,6 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ex
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for X" >&5
-$as_echo_n "checking for X... " >&6; }
-
-
-# Check whether --with-x was given.
-if test "${with_x+set}" = set; then :
- withval=$with_x;
-fi
-
-# $have_x is `yes', `no', `disabled', or empty when we do not yet know.
-if test "x$with_x" = xno; then
- # The user explicitly disabled X.
- have_x=disabled
-else
- case $x_includes,$x_libraries in #(
- *\'*) as_fn_error $? "cannot use X directory names containing '" "$LINENO" 5;; #(
- *,NONE | NONE,*) if ${ac_cv_have_x+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- # One or both of the vars are not set, and there is no cached value.
-ac_x_includes=no ac_x_libraries=no
-rm -f -r conftest.dir
-if mkdir conftest.dir; then
- cd conftest.dir
- cat >Imakefile <<'_ACEOF'
-incroot:
- @echo incroot='${INCROOT}'
-usrlibdir:
- @echo usrlibdir='${USRLIBDIR}'
-libdir:
- @echo libdir='${LIBDIR}'
-_ACEOF
- if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then
- # GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
- for ac_var in incroot usrlibdir libdir; do
- eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`"
- done
- # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
- for ac_extension in a so sl dylib la dll; do
- if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" &&
- test -f "$ac_im_libdir/libX11.$ac_extension"; then
- ac_im_usrlibdir=$ac_im_libdir; break
- fi
- done
- # Screen out bogus values from the imake configuration. They are
- # bogus both because they are the default anyway, and because
- # using them would break gcc on systems where it needs fixed includes.
- case $ac_im_incroot in
- /usr/include) ac_x_includes= ;;
- *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
- esac
- case $ac_im_usrlibdir in
- /usr/lib | /usr/lib64 | /lib | /lib64) ;;
- *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
- esac
- fi
- cd ..
- rm -f -r conftest.dir
-fi
-
-# Standard set of common directories for X headers.
-# Check X11 before X11Rn because it is often a symlink to the current release.
-ac_x_header_dirs='
-/usr/X11/include
-/usr/X11R7/include
-/usr/X11R6/include
-/usr/X11R5/include
-/usr/X11R4/include
-
-/usr/include/X11
-/usr/include/X11R7
-/usr/include/X11R6
-/usr/include/X11R5
-/usr/include/X11R4
-
-/usr/local/X11/include
-/usr/local/X11R7/include
-/usr/local/X11R6/include
-/usr/local/X11R5/include
-/usr/local/X11R4/include
-
-/usr/local/include/X11
-/usr/local/include/X11R7
-/usr/local/include/X11R6
-/usr/local/include/X11R5
-/usr/local/include/X11R4
-
-/usr/X386/include
-/usr/x386/include
-/usr/XFree86/include/X11
-
-/usr/include
-/usr/local/include
-/usr/unsupported/include
-/usr/athena/include
-/usr/local/x11r5/include
-/usr/lpp/Xamples/include
-
-/usr/openwin/include
-/usr/openwin/share/include'
-
-if test "$ac_x_includes" = no; then
- # Guess where to find include files, by looking for Xlib.h.
- # First, try using that file with no special directory specified.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include
-_ACEOF
-if ac_fn_cxx_try_cpp "$LINENO"; then :
- # We can compile using X headers with no special include directory.
-ac_x_includes=
-else
- for ac_dir in $ac_x_header_dirs; do
- if test -r "$ac_dir/X11/Xlib.h"; then
- ac_x_includes=$ac_dir
- break
- fi
-done
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-fi # $ac_x_includes = no
-
-if test "$ac_x_libraries" = no; then
- # Check for the libraries.
- # See if we find them without any special options.
- # Don't add to $LIBS permanently.
- ac_save_LIBS=$LIBS
- LIBS="-lX11 $LIBS"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include
-int
-main ()
-{
-XrmInitialize ()
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_link "$LINENO"; then :
- LIBS=$ac_save_LIBS
-# We can link X programs with no special library path.
-ac_x_libraries=
-else
- LIBS=$ac_save_LIBS
-for ac_dir in `$as_echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
-do
- # Don't even attempt the hair of trying to link an X program!
- for ac_extension in a so sl dylib la dll; do
- if test -r "$ac_dir/libX11.$ac_extension"; then
- ac_x_libraries=$ac_dir
- break 2
- fi
- done
-done
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi # $ac_x_libraries = no
-
-case $ac_x_includes,$ac_x_libraries in #(
- no,* | *,no | *\'*)
- # Didn't find X, or a directory has "'" in its name.
- ac_cv_have_x="have_x=no";; #(
- *)
- # Record where we found X for the cache.
- ac_cv_have_x="have_x=yes\
- ac_x_includes='$ac_x_includes'\
- ac_x_libraries='$ac_x_libraries'"
-esac
-fi
-;; #(
- *) have_x=yes;;
- esac
- eval "$ac_cv_have_x"
-fi # $with_x != no
-
-if test "$have_x" != yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_x" >&5
-$as_echo "$have_x" >&6; }
- no_x=yes
-else
- # If each of the values was on the command line, it overrides each guess.
- test "x$x_includes" = xNONE && x_includes=$ac_x_includes
- test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
- # Update the cache value to reflect the command line values.
- ac_cv_have_x="have_x=yes\
- ac_x_includes='$x_includes'\
- ac_x_libraries='$x_libraries'"
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: libraries $x_libraries, headers $x_includes" >&5
-$as_echo "libraries $x_libraries, headers $x_includes" >&6; }
-fi
-
{ $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 :
@@ -3670,24 +3437,218 @@ fi
done
-if test "$no_x" = "yes"; then :
- USE_X_WINDOWS=0
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for X" >&5
+$as_echo_n "checking for X... " >&6; }
+
+
+# Check whether --with-x was given.
+if test "${with_x+set}" = set; then :
+ withval=$with_x;
+fi
+
+# $have_x is `yes', `no', `disabled', or empty when we do not yet know.
+if test "x$with_x" = xno; then
+ # The user explicitly disabled X.
+ have_x=disabled
+else
+ case $x_includes,$x_libraries in #(
+ *\'*) as_fn_error $? "cannot use X directory names containing '" "$LINENO" 5;; #(
+ *,NONE | NONE,*) if ${ac_cv_have_x+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ # One or both of the vars are not set, and there is no cached value.
+ac_x_includes=no ac_x_libraries=no
+rm -f -r conftest.dir
+if mkdir conftest.dir; then
+ cd conftest.dir
+ cat >Imakefile <<'_ACEOF'
+incroot:
+ @echo incroot='${INCROOT}'
+usrlibdir:
+ @echo usrlibdir='${USRLIBDIR}'
+libdir:
+ @echo libdir='${LIBDIR}'
+_ACEOF
+ if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then
+ # GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
+ for ac_var in incroot usrlibdir libdir; do
+ eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`"
+ done
+ # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
+ for ac_extension in a so sl dylib la dll; do
+ if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" &&
+ test -f "$ac_im_libdir/libX11.$ac_extension"; then
+ ac_im_usrlibdir=$ac_im_libdir; break
+ fi
+ done
+ # Screen out bogus values from the imake configuration. They are
+ # bogus both because they are the default anyway, and because
+ # using them would break gcc on systems where it needs fixed includes.
+ case $ac_im_incroot in
+ /usr/include) ac_x_includes= ;;
+ *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
+ esac
+ case $ac_im_usrlibdir in
+ /usr/lib | /usr/lib64 | /lib | /lib64) ;;
+ *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
+ esac
+ fi
+ cd ..
+ rm -f -r conftest.dir
+fi
+
+# Standard set of common directories for X headers.
+# Check X11 before X11Rn because it is often a symlink to the current release.
+ac_x_header_dirs='
+/usr/X11/include
+/usr/X11R7/include
+/usr/X11R6/include
+/usr/X11R5/include
+/usr/X11R4/include
+
+/usr/include/X11
+/usr/include/X11R7
+/usr/include/X11R6
+/usr/include/X11R5
+/usr/include/X11R4
+
+/usr/local/X11/include
+/usr/local/X11R7/include
+/usr/local/X11R6/include
+/usr/local/X11R5/include
+/usr/local/X11R4/include
+
+/usr/local/include/X11
+/usr/local/include/X11R7
+/usr/local/include/X11R6
+/usr/local/include/X11R5
+/usr/local/include/X11R4
+
+/usr/X386/include
+/usr/x386/include
+/usr/XFree86/include/X11
+
+/usr/include
+/usr/local/include
+/usr/unsupported/include
+/usr/athena/include
+/usr/local/x11r5/include
+/usr/lpp/Xamples/include
+
+/usr/openwin/include
+/usr/openwin/share/include'
+
+if test "$ac_x_includes" = no; then
+ # Guess where to find include files, by looking for Xlib.h.
+ # First, try using that file with no special directory specified.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include
+_ACEOF
+if ac_fn_cxx_try_cpp "$LINENO"; then :
+ # We can compile using X headers with no special include directory.
+ac_x_includes=
+else
+ for ac_dir in $ac_x_header_dirs; do
+ if test -r "$ac_dir/X11/Xlib.h"; then
+ ac_x_includes=$ac_dir
+ break
+ fi
+done
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+fi # $ac_x_includes = no
+
+if test "$ac_x_libraries" = no; then
+ # Check for the libraries.
+ # See if we find them without any special options.
+ # Don't add to $LIBS permanently.
+ ac_save_LIBS=$LIBS
+ LIBS="-lX11 $LIBS"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include
+int
+main ()
+{
+XrmInitialize ()
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+ LIBS=$ac_save_LIBS
+# We can link X programs with no special library path.
+ac_x_libraries=
+else
+ LIBS=$ac_save_LIBS
+for ac_dir in `$as_echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
+do
+ # Don't even attempt the hair of trying to link an X program!
+ for ac_extension in a so sl dylib la dll; do
+ if test -r "$ac_dir/libX11.$ac_extension"; then
+ ac_x_libraries=$ac_dir
+ break 2
+ fi
+ done
+done
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi # $ac_x_libraries = no
+
+case $ac_x_includes,$ac_x_libraries in #(
+ no,* | *,no | *\'*)
+ # Didn't find X, or a directory has "'" in its name.
+ ac_cv_have_x="have_x=no";; #(
+ *)
+ # Record where we found X for the cache.
+ ac_cv_have_x="have_x=yes\
+ ac_x_includes='$ac_x_includes'\
+ ac_x_libraries='$ac_x_libraries'"
+esac
+fi
+;; #(
+ *) have_x=yes;;
+ esac
+ eval "$ac_cv_have_x"
+fi # $with_x != no
+
+if test "$have_x" != yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_x" >&5
+$as_echo "$have_x" >&6; }
+ no_x=yes
+else
+ # If each of the values was on the command line, it overrides each guess.
+ test "x$x_includes" = xNONE && x_includes=$ac_x_includes
+ test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
+ # Update the cache value to reflect the command line values.
+ ac_cv_have_x="have_x=yes\
+ ac_x_includes='$x_includes'\
+ ac_x_libraries='$x_libraries'"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: libraries $x_libraries, headers $x_includes" >&5
+$as_echo "libraries $x_libraries, headers $x_includes" >&6; }
+fi
+
+ if test "$no_x" = "yes"; then :
+
+ USE_X_WINDOWS=0
else
- USE_X_WINDOWS=1
- if test "x$x_includes" = "x"; then :
+ USE_X_WINDOWS=1
+ if test "x$x_includes" = "x"; then :
else
X_INCLUDE_DIR=-I$x_includes
fi
- if test "x$x_libraries" = "x"; then :
+ if test "x$x_libraries" = "x"; then :
else
X_LIB_DIR=-L$x_libraries
fi
- ac_fn_cxx_check_header_mongrel "$LINENO" "X11/Intrinsic.h" "ac_cv_header_X11_Intrinsic_h" "$ac_includes_default"
+ ac_fn_cxx_check_header_mongrel "$LINENO" "X11/Intrinsic.h" "ac_cv_header_X11_Intrinsic_h" "$ac_includes_default"
if test "x$ac_cv_header_X11_Intrinsic_h" = xyes; then :
else
@@ -3777,6 +3738,7 @@ fi
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lxml2" >&5
$as_echo_n "checking for main in -lxml2... " >&6; }
if ${ac_cv_lib_xml2_main+:} false; then :
@@ -4771,7 +4733,7 @@ if ${ax_cv_gcc_version+:} false; then :
$as_echo_n "(cached) " >&6
else
- ax_cv_gcc_version="`$CC -dumpversion`"
+ ax_cv_gcc_version="`$CC -dumpfullversion -dumpversion`"
if test "x$ax_cv_gcc_version" = "x"; then :
ax_cv_gcc_version=""
@@ -5667,6 +5629,7 @@ PYTHON_LIBS=`${PYTHON_LIBS_COMMAND} | tr '\r\n' ' '`
+
# Check whether --with-prepend-path was given.
if test "${with_prepend_path+set}" = set; then :
withval=$with_prepend_path; if test "x${with_prepend_path}" = xyes; then :
@@ -7478,6 +7441,26 @@ fi
fi
+as_ac_File=`$as_echo "ac_cv_file_$LLVM_LIB_DIR/libclangSupport.a" | $as_tr_sh`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LLVM_LIB_DIR/libclangSupport.a" >&5
+$as_echo_n "checking for $LLVM_LIB_DIR/libclangSupport.a... " >&6; }
+if eval \${$as_ac_File+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ test "$cross_compiling" = yes &&
+ as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5
+if test -r "$LLVM_LIB_DIR/libclangSupport.a"; then
+ eval "$as_ac_File=yes"
+else
+ eval "$as_ac_File=no"
+fi
+fi
+eval ac_res=\$$as_ac_File
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+if eval test \"x\$"$as_ac_File"\" = x"yes"; then :
+ ICG_CLANGLIBS="$ICG_CLANGLIBS -lclangSupport"
+fi
diff --git a/docs/developer_docs/Developer-Docs-Home.md b/docs/developer_docs/Developer-Docs-Home.md
new file mode 100644
index 00000000..ed9f2faa
--- /dev/null
+++ b/docs/developer_docs/Developer-Docs-Home.md
@@ -0,0 +1,13 @@
+| [Home](/trick) → Developer Docs |
+|------------------------------------------------------------------|
+
+# Developer Documentation
+
+
+Link documentation for Trick internals, processes, and plans here.
+
+- [Testing](Testing)
+- [How to make a new Trick release on GitHub](How-To-Make-A-Release)
+- [Tooling and Sanitizers](Tooling-and-Sanitizers)
+- [Python Environment](Python-Environment-Issues)
+
diff --git a/docs/developer_docs/How-To-Make-A-Release.md b/docs/developer_docs/How-To-Make-A-Release.md
new file mode 100644
index 00000000..18bd8e1a
--- /dev/null
+++ b/docs/developer_docs/How-To-Make-A-Release.md
@@ -0,0 +1,44 @@
+| [Home](/trick) → [Developer Docs](Developer-Docs-Home) → How to make a release |
+|------------------------------------------------------------------|
+
+# How To Make A Trick Release
+This guide describes how to make a Trick release on GitHub
+### Close Open Issues
+Go through recently updated issues/pull requests and make sure that any open issues that have been fixed are merged and closed
+### Make the release notes
+#### Examples
+https://github.com/nasa/trick/releases
+#### Steps
+* Review closed issues, pull requests, and commits since the last release and make a bulleted list of major changes
+ * UI Changes
+ * Header Changes
+ * Dependency Changes
+ * Major Bugfixes
+ * New features, tools, and example sims
+ * New OS/distro support
+ * New dependency support (such as LLVM/GCC versions)
+ * Major Documentation changes
+### Choose a version number
+* Advance major version number if there are interface changes or other major build-breaking changes
+* Advance minor version number if there are major improvements or new features that are not build breaking
+* Advance patch/tiny version number for hotfixes or other bugfixes
+### Change the version numbers in the master branch
+#### Example
+https://github.com/nasa/trick/commit/a317c222748e706e89b7f344f6910d1f39824feb
+#### Steps
+* In share/trick/trick_ver.txt change the "current_version" string to match the new version number and remove any suffixes (like: "-beta").
+* In trick_source/java/pom.xml change the \ tag to the new version and remove any suffixes.
+* In CMakeLists.txt change TRICK_MAJOR TRICK_MINOR TRICK_TINY to match the current version, and set TRICK_PRERELEASE to an empty string
+### Create a commit, tag, and push to github.com
+ * `git commit -m "update version numbers for Trick Simulation Environment X.Y.Z"`
+ * `git tag -a -m "Trick Simulation Environment "` e.g. `git tag -a 25.0.0 -m "Trick Simulation Environment 25.0.0"`
+ * `git push origin `
+### Change version numbers back to prerelease and push
+ * Reverse the process of changing the version numbers in the files listed above; update to the next minor prerelease version (or major version if planning a major release soon).
+ * Remember to add the -beta suffix to the version number
+ * `git commit -m "update version numbers to prerelease X.Y.Z-beta"`
+ * `git push origin master`
+### Create the release through the github UI
+ * This process is subject to change, so I'm posting the link to GitHub documentation here:
+ * https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository#creating-a-release
+ * Currently we do not add any artifacts/binaries or open discussions, so you can ignore those optional steps.
diff --git a/docs/developer_docs/Python-Environment-Issues.md b/docs/developer_docs/Python-Environment-Issues.md
new file mode 100644
index 00000000..ca3381b1
--- /dev/null
+++ b/docs/developer_docs/Python-Environment-Issues.md
@@ -0,0 +1,57 @@
+| [Home](/trick) → [Developer Docs](Developer-Docs-Home) → Python Environment Issues |
+|------------------------------------------------------------------|
+
+# Python Environment in Trick
+
+In the `./configure` step, Trick finds the Python environment that is used as the embedded interpreter to execute input files and events.
+
+The configure script first tries to find the Python executable and the python-config script. If the `--with-python=[DIR]` option is used, it will only look in that given directory. Otherwise, it will use the system path. The python-config script is used to find the location of Python.h, installed python libraries, etc.
+
+## Help! The packages that I installed with pip are not being found by my Trick input files!
+
+This often happens when a machine has multiple Python installations, particularly on Mac with brew python vs system python. To debug this:
+
+Find where the `python` and `pip` (or `python3` and `pip3`) symlinks are – this is the version that Trick will pick up unless you have specified something else using the `--with-python=` configure option.
+
+```
+which python3
+which pip
+```
+
+These should match. cd into that directory. It was `/usr/local/bin` for me, which is the default Brew install directory for python.
+
+Read the path for the symlinks for `python3`, `pip3`, and `python3-config` (or whichever preferred version). These paths should match as well, but often this is the problem.
+
+```
+readlink python3
+ /Library/Frameworks/Python.framework/Versions/3.10/bin/python3
+readlink pip3
+ /usr/local/Cellar/python@3.11/3.11.3/bin/pip3
+```
+
+Brew is supposed to be able to detect problems like this with `brew doctor`. Mine detected that `python3.11` was unlinked:
+
+```
+Warning: You have unlinked kegs in your Cellar.
+Leaving kegs unlinked can lead to build-trouble and cause formulae that depend on
+those kegs to fail to run properly once built. Run `brew link` on these:
+ python@3.11
+```
+
+Run with the `--overwrite` flag:
+
+```
+brew link --overwrite python@3.11
+```
+
+Running readlink should now show the correct Brew install (the one with Cellar in the path) for all the Python executables.
+
+Trick will search for the python3 and python3-config executables first on the user provided directory (if given) --with-python= and then along the system path. It then uses python3-config to find installed modules and the CPython headers and libraries. Trick assumes that these symlinks point to the same Python install, and when this assumption is violated it can cause problems with finding pip installed libaries.
+
+This is a common problem for systems with multiple Python installs, particularly for Macs with Brew python and Xcode python. Another option is just to completely remove the Python install in /Library/Frameworks/Python.framework.
+
+Helpful links:
+
+https://faun.pub/the-right-way-to-set-up-python-on-your-mac-e923ffe8cf8e
+
+https://stackoverflow.com/questions/5157678/how-do-i-use-brew-installed-python-as-the-default-python
\ No newline at end of file
diff --git a/docs/developer_docs/Testing.md b/docs/developer_docs/Testing.md
new file mode 100644
index 00000000..9746e2ce
--- /dev/null
+++ b/docs/developer_docs/Testing.md
@@ -0,0 +1,61 @@
+| [Home](/trick) → [Developer Docs](Developer-Docs-Home) → Testing |
+|------------------------------------------------------------------|
+
+
+# Testing
+
+Currently, Trick has a suite of unit and integration tests that run through a hodgepodge of GTest, Trick's internal unit test framework, Makefiles, and TrickOps.
+
+Unit tests can be found in their respective `trick_source/[sim_services|utils]/*/test` directories, and primarily use the Gtest framework. These are run primarily through test targets in their Makefiles. See `trick_source/sim_services/MemoryManager/test` for an example of organization.
+
+Integration tests take the form of Sims with some embedded tests. They live under `trick_sims/` and `test/`. A full list of sims that are used as part of the test suite are in [test_sims.yml](). These are run with TrickOps.
+
+## Test suite dependencies
+
+Gtest is required for the unit tests and some integration tests. See the [install guide](../documentation/install_guide/Install-Guide.md) for gtest installation.
+
+TrickOps requires python3 and the packages `PyYAML` and `psutil` (updated list in [Trickops requirements.txt](https://github.com/nasa/trick/blob/master/share/trick/trickops/requirements.txt)). Install these in your python environment, or create a virtual environment as follows:
+```
+cd share/trick/trickops/
+python3 -m venv .venv && . .venv/bin/activate && pip3 install -r requirements.txt
+cd ../../../
+```
+
+
+## Running the test suite
+From trick home:
+```
+# Run everything
+make test
+
+# Run only integration tests
+make sim_test
+
+# Run only unit tests
+make unit_test
+```
+
+Currently, TrickOps will redirect all console output from tests into logs under {TRICK_HOME}/trickops_logs/, and will also dump the output of failing logs to console after the test suite is finished.
+
+## Coverage
+Trick uses [Coveralls](https://coveralls.io/github/nasa/trick?branch=master) to host code coverage. Coverage is generated by running the test suite with gcov in CI, and then those files are uploaded to Coveralls.
+
+To enable gcov in Trick, it must be cleaned and compiled with the following:
+```
+export CFLAGS="-fprofile-arcs -ftest-coverage -O0"
+export CXXFLAGS="-fprofile-arcs -ftest-coverage -O0"
+export LDFLAGS="-fprofile-arcs -ftest-coverage -O0"
+export TRICK_CFLAGS="-fprofile-arcs -ftest-coverage -O0"
+export TRICK_CXXFLAGS="-fprofile-arcs -ftest-coverage -O0"
+export TRICK_SYSTEM_LDFLAGS="-fprofile-arcs -ftest-coverage -O0"
+export TRICK_SYSTEM_CFLAGS="-fprofile-arcs -ftest-coverage -O0"
+export TRICK_SYSTEM_CXXFLAGS="-fprofile-arcs -ftest-coverage -O0"
+```
+
+After Trick has been rebuild with the instrumentation, run:
+```
+make code-coverage
+```
+This will generate, collect, and filter all the various coverage data collection files into `coverage.info`. This is the file that is uploaded to Coveralls in the [code_coverage.yml](https://github.com/nasa/trick/blob/master/.github/workflows/code_coverage.yml) Github Actions workflow.
+
+
diff --git a/docs/developer_docs/Tooling-and-Sanitizers.md b/docs/developer_docs/Tooling-and-Sanitizers.md
new file mode 100644
index 00000000..19c569e6
--- /dev/null
+++ b/docs/developer_docs/Tooling-and-Sanitizers.md
@@ -0,0 +1,35 @@
+| [Home](/trick) → [Developer Docs](Developer-Docs-Home) → Tooling and Sanitizers |
+|------------------------------------------------------------------|
+
+Lots of development and debugging tools require a binary to be instrumented with compiler flags. Trick does compiling and linking steps separately and uses several variables to propogate flags to different parts of the build. The following is a convenience function that can be added to your bashrc to easily modify the flags in your environment:
+
+```
+add-trickenv () {
+ export CFLAGS="$CFLAGS $1"
+ export CXXFLAGS="$CXXFLAGS $1"
+ export LDFLAGS="$LDFLAGS $1"
+ export TRICK_CFLAGS="$TRICK_CFLAGS $1"
+ export TRICK_CXXFLAGS="$TRICK_CXXFLAGS $1"
+ export TRICK_LDFLAGS="$TRICK_LDFLAGS $1"
+ export TRICK_SYSTEM_CFLAGS="$TRICK_SYSTEM_CFLAGS $1"
+ export TRICK_SYSTEM_CXXFLAGS="$TRICK_SYSTEM_CXXFLAGS $1"
+ export TRICK_SYSTEM_LDFLAGS="$TRICK_SYSTEM_LDFLAGS $1"
+}
+```
+
+To debug a sim, you will likely need to run a clean build of all of Trick with these flags set.
+
+## Tools that are known to work well with Trick
+
+GDB/LLDB: `-g`
+
+gcov: `-fprofile-arcs -ftest-coverage -O0`
+
+tsan: `-g -fsanitize=thread`
+
+asan: `-g -fsanitize=address -fsanitize-recover=address`
+
+Suggest running asan instrumented sims with:
+
+`ASAN_OPTIONS=halt_on_error=0 ./S_main* `
+
diff --git a/docs/documentation/Documentation-Home.md b/docs/documentation/Documentation-Home.md
index 2b80b6ed..3c9e5183 100644
--- a/docs/documentation/Documentation-Home.md
+++ b/docs/documentation/Documentation-Home.md
@@ -36,6 +36,7 @@ The user guide contains information pertinent to Trick users. These pages will h
01. [Realtime Sleep Timer](simulation_capabilities/Realtime-Timer)
01. [Realtime Injector](simulation_capabilities/Realtime-Injector)
01. [Monte Carlo](simulation_capabilities/UserGuide-Monte-Carlo)
+ 02. [Monte Carlo Generation](miscellaneous_trick_tools/MonteCarloGeneration)
01. [Master Slave](simulation_capabilities/Master-Slave)
01. [Data Record](simulation_capabilities/Data-Record)
01. [Checkpoints](simulation_capabilities/Checkpoints)
@@ -48,17 +49,17 @@ The user guide contains information pertinent to Trick users. These pages will h
01. [Status Message System](simulation_capabilities/Status-Message-System)
01. [Command Line Arguments](simulation_capabilities/Command-Line-Arguments)
01. [Environment](simulation_capabilities/Environment)
- 01. [Standard Template Library Checkpointing](simulation_capabilities/STL-Checkpointing)
+ 01. [Standard Template Library Checkpointing](simulation_capabilities/STL-capabilities)
01. [Threads](simulation_capabilities/Threads)
-01. [Web Server](web)
- 01. [Adding a Web Server to Your Sim](web/Adding_a_Web_Server_to_Your_Sim)
- 01. Web Server APIs
- 01. [HTTP-API_alloc_info](web/HTTP-API_alloc_info)
- 01. [WS-API_VariableServer](web/WS-API_VariableServer)
- 01. Adding New Web Server APIs
- 01. [Extending_the_HTTP-API](web/Extending_the_HTTP-API)
- 01. [Extending_the_WS-API](web/Extending_the_WS-API)
+01. [Web Server](web/Webserver)
+ 01. [Configure Trick with Civetweb](web/Configure-Civetweb)
+ 01. [Add SSL encryption to your webserver](web/SSL)
+ 01. [Web Server APIs](web/Webserver-apis)
+ 01. [HTTP alloc API](web/http-alloc-api.md)
+ 01. [WS Variable Server API](web/ws-variable-server-api.md)
+ 01. [Extend the HTTP API](web/Extend-http-api.md)
+ 01. [Extend the WS API](web/Extend-ws-api.md)
01. [Simulation Utilities](simulation_utilities/Simulation-Utilities)
01. [Trickcomm](simulation_utilities/Trickcomm)
diff --git a/docs/documentation/building_a_simulation/Building-a-Simulation.md b/docs/documentation/building_a_simulation/Building-a-Simulation.md
index d95f0d5f..c7eddd29 100644
--- a/docs/documentation/building_a_simulation/Building-a-Simulation.md
+++ b/docs/documentation/building_a_simulation/Building-a-Simulation.md
@@ -1,3 +1,6 @@
+| [Home](/trick) → [Documentation Home](../Documentation-Home) → Building a Simulation |
+|------------------------------------------------------------------|
+
The building blocks of a basic Trick simulation are C/C++ structures/classes (models), a Python input file and a Trick simulation definition file (S_define). The S_define contains simulation objects which offer a way to turn the C/C++ function/methods into simulation jobs. Trick generates the necessary Python glue code which makes the C/C++ structures/classes accessible by the Python input file. The input file configures the simulation and is a command-line argument to the simulation executable.
... to be continued ...
diff --git a/docs/documentation/building_a_simulation/Environment-Variables.md b/docs/documentation/building_a_simulation/Environment-Variables.md
index 91024723..c6d6a694 100644
--- a/docs/documentation/building_a_simulation/Environment-Variables.md
+++ b/docs/documentation/building_a_simulation/Environment-Variables.md
@@ -1,3 +1,6 @@
+| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Building a Simulation](Building-a-Simulation) → Environment Variables |
+|------------------------------------------------------------------|
+
Trick uses a list of variables for building sims e.g. TRICK_CFLAGS and TRICK_CXXFLAGS. Each variable has a default value that may be overridden by setting the value in the environment. Trick resolves these variables by a call to a function called "trick-gte". Type in "${TRICK_HOME}/bin/trick-gte" on the command line to see what the "Trick environment" is.
### Adding ${TRICK_HOME}/bin to PATH
diff --git a/docs/documentation/building_a_simulation/Making-the-Simulation.md b/docs/documentation/building_a_simulation/Making-the-Simulation.md
index 22fa9b23..73ca61b0 100644
--- a/docs/documentation/building_a_simulation/Making-the-Simulation.md
+++ b/docs/documentation/building_a_simulation/Making-the-Simulation.md
@@ -1,3 +1,7 @@
+| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Building a Simulation](Building-a-Simulation) → Making the Simulation |
+|------------------------------------------------------------------|
+
+
### Simulation Compilation Environment Variables
The -Ipaths in TRICK_CFLAGS and TRICK_CXXFLAGS tell Trick where to find model source files. The flags also can contain compiler settings, for instance the -g flag is used for compiling in debug mode. See section Trick_Environment for more detail and information on variables for linking in external libraries, setting the compiler etc.
diff --git a/docs/documentation/building_a_simulation/Model-Source-Code.md b/docs/documentation/building_a_simulation/Model-Source-Code.md
index f0b0fb7e..15c56389 100644
--- a/docs/documentation/building_a_simulation/Model-Source-Code.md
+++ b/docs/documentation/building_a_simulation/Model-Source-Code.md
@@ -1,3 +1,6 @@
+| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Building a Simulation](Building-a-Simulation) → Model Source Code |
+|------------------------------------------------------------------|
+
This section details the syntax for creating headers and source code that Trick can process.
It also details the operation of the Trick Interface Code Generator (ICG) that processes headers, and the Module Interface Specification Processor (MIS) that processes source code.
@@ -159,7 +162,7 @@ The `ICG IGNORE TYPES` field lists the structs or classes to be ignored. Any par
###### `PYTHON_MODULE`
-Specifying a `python_module` name will place any class/struct and function definitions in this header file in a python module of the same name. All classes and functions are flattened into the python `trick` namespace by default. This capability allows users to avoid possible name collisions between names when they are flattened.
+Specifying a `python_module` name will place any class/struct and function definitions in this header file in a python module of the same name. All classes and functions are flattened into the python `trick` namespace by default. This capability allows users to avoid possible name collisions between names when they are flattened. An empty `python_module` statement will be ignored.
##### Compiler Directives
diff --git a/docs/documentation/building_a_simulation/Simulation-Definition-File.md b/docs/documentation/building_a_simulation/Simulation-Definition-File.md
index 72773652..d5911819 100644
--- a/docs/documentation/building_a_simulation/Simulation-Definition-File.md
+++ b/docs/documentation/building_a_simulation/Simulation-Definition-File.md
@@ -1,3 +1,6 @@
+| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Building a Simulation](Building-a-Simulation) → Simulation Definition File |
+|------------------------------------------------------------------|
+
The Simulation Definition File or S_define is the file which lays out the architecture
of the simulation. Details about job frequencies, job class, job data, importing/exporting
data to other simulations, freeze cycles, integration, etc. are all housed in this one file.
@@ -374,15 +377,18 @@ This section of the S_define (encapsulated by "job_class_order{...};) can be use
scheduled loop job class order. The user may simply re-order the existing job classes that exist or
can specify a new set of scheduled loop job classes. Job classes that are eligible for reassignment
are listed in Table SD_1 between automatic and automatic_last inclusive. The order they are shown
-in the table is the default ordering.
+in the table is the default ordering. Note that if the user provides an ordering, classes that are
+not included in the ordering (excluding automatic and automatic_last) will not be handled by any scheduler,
+ and therefore not executed in the sim.
+
```C++
job_class_order {
- my_job_class_1 ;
- my_job_class_2 ;
- scheduled ;
- my_job_class_3 ;
-}
+ my_job_class_1 ,
+ my_job_class_2 ,
+ scheduled ,
+ my_job_class_3
+};
```
### Simulation Object C++ properties
diff --git a/docs/documentation/building_a_simulation/Trickified-Project-Libraries.md b/docs/documentation/building_a_simulation/Trickified-Project-Libraries.md
index b4e3a938..cb06ceb3 100644
--- a/docs/documentation/building_a_simulation/Trickified-Project-Libraries.md
+++ b/docs/documentation/building_a_simulation/Trickified-Project-Libraries.md
@@ -1,3 +1,7 @@
+| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Building a Simulation](Building-a-Simulation) → Trickified Project Libraries |
+|------------------------------------------------------------------|
+
+
During a simulation build, Trick generates several rounds of files to support data recording, checkpointing, and Python access:
* Trick generates `S_source.hh` from the `S_define`
diff --git a/docs/documentation/data_products/DP-Product-File-Format.md b/docs/documentation/data_products/DP-Product-File-Format.md
index 5f806edf..fc282b78 100644
--- a/docs/documentation/data_products/DP-Product-File-Format.md
+++ b/docs/documentation/data_products/DP-Product-File-Format.md
@@ -1,3 +1,6 @@
+| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Data Products](Data-Products) → DP Product File Format |
+|------------------------------------------------------------------|
+
Since Trick 10, the DP Product Specification File Format is changed to XML. The DP Product XML file
DTD is defined as following:
diff --git a/docs/documentation/data_products/DP-Session-File-Format.md b/docs/documentation/data_products/DP-Session-File-Format.md
index 9f6c32a0..5b00c49e 100644
--- a/docs/documentation/data_products/DP-Session-File-Format.md
+++ b/docs/documentation/data_products/DP-Session-File-Format.md
@@ -1,3 +1,5 @@
+| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Data Products](Data-Products) → DP Session File Format |
+|------------------------------------------------------------------|
Since Trick 10, the DP Session file is changed to XML format. The Session XML Document
Type Definitions(DTD) is defined as following:
diff --git a/docs/documentation/data_products/Data-Products-GUIs.md b/docs/documentation/data_products/Data-Products-GUIs.md
index e84ca91f..0154aba1 100644
--- a/docs/documentation/data_products/Data-Products-GUIs.md
+++ b/docs/documentation/data_products/Data-Products-GUIs.md
@@ -1,3 +1,5 @@
+| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Data Products](Data-Products) → Data Products GUIs |
+|------------------------------------------------------------------|
There are two main GUIs for viewing Trick logged data:
diff --git a/docs/documentation/data_products/Data-Products.md b/docs/documentation/data_products/Data-Products.md
index eb653591..fc58b4eb 100644
--- a/docs/documentation/data_products/Data-Products.md
+++ b/docs/documentation/data_products/Data-Products.md
@@ -1,3 +1,6 @@
+| [Home](/trick) → [Documentation Home](../Documentation-Home) → Data Products |
+|------------------------------------------------------------------|
+
The Data Products (DP) is a simulation data post processor designed to allow visualization of data recorded in the Trick simulation.
The data products can plot ASCII, Binary & HDF5 data. HDF5 is the new data format supported since Trick 10.
diff --git a/docs/documentation/data_products/Plot-Printing.md b/docs/documentation/data_products/Plot-Printing.md
index 5139ade8..1c88ce2f 100644
--- a/docs/documentation/data_products/Plot-Printing.md
+++ b/docs/documentation/data_products/Plot-Printing.md
@@ -1,3 +1,6 @@
+| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Data Products](Data-Products) → Plot Printing |
+|------------------------------------------------------------------|
+
To print fermi plots, simply bring up the fermi plot, and press either the "Print" (printer icon) button or the individual "Print" (printer icon) buttons on the plots themselves. In order for this to work you should set two environment variables:
```
diff --git a/docs/documentation/install_guide/Install-Guide.md b/docs/documentation/install_guide/Install-Guide.md
index 1afbf4bc..cc025119 100644
--- a/docs/documentation/install_guide/Install-Guide.md
+++ b/docs/documentation/install_guide/Install-Guide.md
@@ -9,16 +9,16 @@ Trick requires various free third party utilities in order to function. All the
| Utility | Version | Description | Usage | Notes |
|---------------:|:-------:|:-----------------------:|:---------------------------------------------------------:|:------------------------------------------------------|
-| [gcc] and g++ | 4.8+ | C/C++ Compiler | Compiles Trick and Trick simulations. | |
-| [clang]/[llvm] | <=13 (14 not currently supported) | C/C++ Compiler | Utilized by the interface code generator. | |
-| [python] | 2.7+ | Programming Language | Lets the user interact with a simulation. | Trick has been tested up to python 3.9 as of 02/21 |
-| [perl] | 5.6+ | Programming Language | Allows executable scripts in the bin directory to run. | |
-| [java] | 11+ | Programming Language | Necessary for Trick GUIs. | |
-| [swig] | 2.x-3.x | Language Interfacing | Connects the python input processor with Trick's C code. | 3.0+ required for some unit tests in make test target |
-| [make] | 3.78+ | Build Automation | Automates the building and cleaning of Trick. | |
-| [openmotif] | 2.2.0+ | GUI Toolkit | Covers Trick GUIs not made with Java. | |
-| [udunits] | 2.x+ | C Unit Library/Database | Provides support for units of physical quantities. | |
-| [maven] | x.x | Java package manager | Downloads Java dependencies and builds trick GUIs | |
+| [gcc] and g++ | 4.8+ | C/C++ Compiler | Compiles Trick and Trick simulations. | |
+| [clang]/[llvm] | <=14 | C/C++ Compiler | Utilized by the interface code generator. | Trick Versions <= 19.3 should use LLVM <= 9 |
+| [python] | 2.7+ | Programming Language | Lets the user interact with a simulation. | Trick has been tested up to python 3.11 as of 04/23 |
+| [perl] | 5.6+ | Programming Language | Allows executable scripts in the bin directory to run. | |
+| [java] | 11+ | Programming Language | Necessary for Trick GUIs. | |
+| [swig] | 2.x-3.x | Language Interfacing | Connects the python input processor with Trick's C code. | 3.0+ required for some unit tests in make test target. SWIG 4.x is compatible with Trick, but has some issues https://github.com/nasa/trick/issues/1288 |
+| [make] | 3.78+ | Build Automation | Automates the building and cleaning of Trick. | |
+| [openmotif] | 2.2.0+ | GUI Toolkit | Covers Trick GUIs not made with Java. | |
+| [udunits] | 2.x+ | C Unit Library/Database | Provides support for units of physical quantities. | |
+| [maven] | x.x | Java package manager | Downloads Java dependencies and builds trick GUIs | |
[gcc]: https://gcc.gnu.org/
[clang]: https://clang.llvm.org/
@@ -48,27 +48,44 @@ Trick runs on GNU/Linux and macOS, though any System V/POSIX compatible UNIX wor
| Quick Jump Menu |
|---|
|[RedHat Enterprise Linux (RHEL) 8](#redhat8)|
-|[CentOS 8](#redhat8)|
+|[Oracle Linux 8](#redhat8)|
+|[AlmaLinux 8](#redhat8)|
+|[Rocky Linux 8](#redhat8)|
|[RedHat Enterprise Linux (RHEL) 7](#redhat7)|
|[CentOS 7](#redhat7)|
|[Fedora](#fedora)|
|[Ubuntu](#ubuntu)|
|[macOS](#macos)|
|[Windows 10 (Linux Subsystem Only)](#windows10)|
+|[Troubleshooting](#trouble)|
---
+
### Troubleshooting
+
+#### Environment Variables
+Sometimes environment variables affect the Trick build and can cause it to fail. If you find one that isn't listed here, please create an issue and we'll add it to the list.
+
+
+```
+JAVA_HOME # Trick and Maven will use JAVA_HOME to build the GUIs instead of javac in PATH if it is set.
+TRICK_HOME # This variable is optional but may cause a Trick build to fail if it is set to the wrong directory.
+CFLAGS, CXXFLAGS, LDFLAGS # If these flags are set they may affect flags passed to your compiler and linker
+```
+#### If You Think The Install Instructions Do Not Work Or Are Outdated
If the Trick tests are passing, you can see *exactly* how we configure our test machines on Github's test integration platform, Github Actions.
If logged into any github account on github.com, you can access the [Actions](https://github.com/nasa/trick/actions) tab on the Trick repo page. Go to [Trick-CI](https://github.com/nasa/trick/actions?query=workflow%3A%22Trick+CI%22), and click the latest passing run. Here you can access a log of our shell commands to configure each OS with dependencies and also the commands we use to install Trick. In fact, that is exactly where I go when I want to update the install guide! @spfennell
-The configuration for these tests can be found in the [trick/.github/workflow/test.yml](https://github.com/nasa/trick/blob/master/.github/workflows/test.yml) file.
+The configuration for these tests can be found in the [trick/.github/workflow/test_linux.yml](https://github.com/nasa/trick/blob/master/.github/workflows/test_linux.yml) file.
+#### Weird Linker Error
+It is possible you may have an old version of Trick installed, and Trick's libraries are on your LDPATH and interfering with your new build. The solution is to uninstall the old version before building the new one. Call `sudo make uninstall` from any Trick top level directory and it will remove the old libraries.
---
-### RedHat Enterprise Linux (RHEL) 8, CentOS 8
+### RedHat Enterprise Linux (RHEL) 8, Oracle Linux 8, Rocky Linux 8, AlmaLinux 8
Trick requires the clang/llvm compiler to compile and link the Trick Interface Code Generator. clang/llvm is available through the [Extra Packages for Enterprise Linux](https://fedoraproject.org/wiki/EPEL) repository. Download and install the 'epel-release' package.
@@ -84,12 +101,21 @@ python3-devel diffutils
-Trick makes use of several optional packages if they are present on the system. These include using the HDF5 package for logging, the GSL packages for random number generation, and google test (gtest) for Trick's unit testing. These are available from the EPEL repository. In order to access gtest-devel in the epel repository you need to enable the dnf option PowerTools
+Trick makes use of several optional packages if they are present on the system. These include using the HDF5 package for logging, the GSL packages for random number generation, and google test (gtest) for Trick's unit testing. These are available from the EPEL repository. In order to access gtest-devel in the epel repository on RHEL 8 you need to enable the dnf repo CodeReady Linux Builder. In Rocky Linux and Alma Linux you can instead enable the Power Tools Repo. On Oracle Linux 8 you must enable OL8 CodeReady Builder.
+See RedHat's documentation to enable the CodeReady Linux Builder repository:
+https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/package_manifest/codereadylinuxbuilder-repository
+
+On AlmaLinux 8, Rocky Linux 8:
```bash
-yum install -y 'dnf-command(config-manager)'
-yum config-manager --enable PowerTools
-yum install hdf5-devel gsl-devel gtest-devel
+dnf config-manager --enable powertools
+ dnf install -y gtest-devel
+```
+
+On Oracle Linux 8:
+```
+dnf config-manager --enable ol8_codeready_builder
+dnf install -y gtest-devel
```
proceed to [Install Trick](#install) section of the install guide
@@ -168,6 +194,7 @@ export PYTHON_VERSION=3
proceed to [Install Trick](#install) section of the install guide
+---
### macOS Monterey, Big Sur, Catalina
#### These instructions are for Intel-based macs. For the latest Apple silicon (M1) instructions see this issue: https://github.com/nasa/trick/issues/1283
@@ -188,10 +215,10 @@ xcode-select --install
brew install python java xquartz swig@3 maven udunits openmotif
```
-IMPORTANT: Make sure to follow the instructions for adding java to your path provided by brew. If you missed them, you can see them again by using `brew info java`.
+IMPORTANT: Make sure to follow the instructions for adding java and swig to your `PATH` provided by brew. If you missed them, you can see them again by using `brew info java` and `brew info swig@3`. Remember, you may need to restart your terminal for these `PATH` changes to take effect.
-5. Download and un-compress the latest pre-built clang+llvm 13 from llvm-project github. Go to https://github.com/llvm/llvm-project/releases
-and download the latest version of 13 from the release assets. 13.0.1 is the latest as of the writing of this guide, the link I used is below:
+5. Download and un-compress the latest pre-built clang+llvm from llvm-project github. Go to https://github.com/llvm/llvm-project/releases
+and download the latest version llvm that matches your Xcode version from the release assets. For example, if your Xcode version is 14 then you will want the latest 14.x.x release of llvm. 13.0.1 is the latest as of the writing of this guide, the link I used is below:
https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.1/clang+llvm-13.0.1-x86_64-apple-darwin.tar.xz
Tip: I suggest renaming the untar'd directory to something simple like llvm13 and putting it in your home directory or development environment.
@@ -214,6 +241,17 @@ e.g.
./configure --with-llvm=/Users/trickguy/llvm13 --with-udunits=/usr/local/Cellar/udunits/2.2.28
```
+OPTIONAL: Trick uses google test (gtest) version 1.8 for unit testing. To install gtest:
+```
+brew install cmake wget
+wget https://github.com/google/googletest/archive/release-1.8.0.tar.gz
+tar xzvf release-1.8.0.tar.gz
+cd googletest-release-1.8.0/googletest
+cmake .
+make
+make install
+```
+
proceed to [Install Trick](#install) section of the install guide
---
@@ -327,3 +365,12 @@ cp prebuiltTrick/libexec/trick/java/build/*.jar trick/trick-offline
```
4. Follow regular install instructions above.
+
+### Python Version
+
+If you would like to use Python 2 with Trick please first make sure Python 2 and the Python 2 libs are installed. Then you will likely need to set `PYTHON_VERSION=2` in your shell environment before executing the `configure` script so that Trick will use Python 2 instead of Python 3. This can be done in bash or zsh with the following commands:
+
+```
+export PYTHON_VERSION=2
+./configure
+```
diff --git a/docs/documentation/introduction/Introduction.md b/docs/documentation/introduction/Introduction.md
index 02ed4bed..6ba3cd18 100644
--- a/docs/documentation/introduction/Introduction.md
+++ b/docs/documentation/introduction/Introduction.md
@@ -1,3 +1,6 @@
+| [Home](/trick) → [Documentation Home](../Documentation-Home) → Introduction |
+|------------------------------------------------------------------|
+
The responsibility for this document lies with the [Simulation and Graphics Branch (ER7)](https://er.jsc.nasa.gov/ER7/) of the [Automation, Robotics and Simulation Division](https://er.jsc.nasa.gov/) of the NASA JSC Engineering Directorate.
The purpose of this document is to provide Trick simulation developers and users with a detailed user’s reference guide on how to install Trick, use Trick processors and utilities, and how to operate a simulation from execution to data post processing.
diff --git a/docs/documentation/miscellaneous_trick_tools/MCG_verification_2020.pdf b/docs/documentation/miscellaneous_trick_tools/MCG_verification_2020.pdf
new file mode 100644
index 00000000..e53844d2
Binary files /dev/null and b/docs/documentation/miscellaneous_trick_tools/MCG_verification_2020.pdf differ
diff --git a/docs/documentation/miscellaneous_trick_tools/Miscellaneous-Trick-Tools.md b/docs/documentation/miscellaneous_trick_tools/Miscellaneous-Trick-Tools.md
index df2858fa..a7156bed 100644
--- a/docs/documentation/miscellaneous_trick_tools/Miscellaneous-Trick-Tools.md
+++ b/docs/documentation/miscellaneous_trick_tools/Miscellaneous-Trick-Tools.md
@@ -1,3 +1,5 @@
+| [Home](/trick) → [Documentation Home](../Documentation-Home) → Miscellaneous Trick Tools |
+|------------------------------------------------------------------|
### Interface Code Generator - ICG
diff --git a/docs/documentation/miscellaneous_trick_tools/MonteCarloGeneration.md b/docs/documentation/miscellaneous_trick_tools/MonteCarloGeneration.md
new file mode 100644
index 00000000..90139ec8
--- /dev/null
+++ b/docs/documentation/miscellaneous_trick_tools/MonteCarloGeneration.md
@@ -0,0 +1,705 @@
+# MonteCarloGeneration Model
+
+# Revision History
+| Version | Date | Author | Purpose |
+| :--- |:---| :--- | :--- |
+| 1 | April 2020 | Gary Turner | Initial Version |
+| 2 | March 2021 | Gary Turner | Added Verification |
+| 3 | October 2022 | Isaac Reaves | Converted to Markdown |
+
+# 1 Introduction
+
+The MonteCarlo Model is used to disperse the values assigned to variables at the start of a simulation. Dispersing the initial
+conditions and configurations for the simulation allows for robust testing and statistical analysis of the probability of
+undesirable outcomes, and measuring the confidence levels associated with achieving desirable outcomes.
+
+Conventionally, most of the time we think about dispersing variables, we think about apply some sort of statistical
+distribution to the value. Most often, that is a normal or uniform distribution, but there may be situations in which other
+distributions are desired. In particular, this model provides an extensible framework allowing for any type of distribution to
+be applied to any variable.
+
+For extensive analysis of safety-critical scenarios, where it is necessary to demonstrate high probability of success with high
+confidence, traditional MonteCarlo analyses require often many thousands of runs. For long duration simulations, it may
+not be feasible to run the number of simulations necessary to reach the high confidence of high success probability that is
+necessary to meet requirements. Typically, failure cases occur out near the edges of state-space, but most of the runs will be
+“right down the middle”; using conventional MonteCarlo techniques, most of these runs are completely unnecessary. With
+a Sequential-MonteCarlo configuration, a small number of runs can be executed, allowing for identification of problem
+areas, and a focussing of the distribution on those areas of state-space, thereby reducing the overall number of runs while
+adding complexity to the setup. While this model does not (at this time) provide a Sequential-MonteCarlo capability, the
+organization of the model has been designed to support external tools seeking to sequentially modify the distributions being
+applied to the dispersed variables, and generate new dispersion sets.
+
+# 2 Requirements
+
+1. The model shall provide common statistical distribution capabilities, including:
+ 1. Uniform distribution between specified values
+ 1. as a floating-point value
+ 1. as an integer value
+ 1. Normal distribution, specified by mean and standard deviation
+ 1. Truncated Normal Distribution, including
+ 1. symmetric and asymmetric truncations
+ 1. it shall be possible to specify truncations by:
+ 1. some number of standard deviations from the mean,
+ 1. a numerical difference from the mean, and
+ 1. an upper and lower limit
+1. The model shall provide an extensible framework suitable for supporting other statistical distributions
+1. The model shall provide the ability to assign a common value to all runs:
+ 1. This value could be a fixed, user-defined value
+ 1. This value could be a random assignment, generated once and then applied to all runs
+1. The model shall provide the capability to read values from a pre-generated file instead of generating its own values
+1. The model shall provide the ability to randomly select from a discrete data set, including:
+ 1. enumerations,
+ 1. character-strings,
+ 1. boolean values, and
+ 1. numerical values
+1. The model shall provide the capability to compute follow-on variables, the values of which are a function of one or more dispersed variables with values generated using any of the methods in requirements 1-5.
+1. The model shall provide a record of the generated distributions, allowing for repeated execution of the same scenario using exactly the same conditions.
+1. The model shall provide summary data of the dispersions which have been applied, including:
+ 1. number of dispersions
+ 1. types of dispersions
+ 1. correlations between variables
+
+# 3 Model Specification
+
+## 3.1 Code Structure
+
+The model can be broken down into its constituent classes; there are two principle components to the model – the variables,
+and the management of the variables.
+
+### 3.1.1 Variable Management (MonteCarloMaster)
+
+MonteCarloMaster is the manager of the MonteCarlo variables. This class controls how many sets of dispersed variables
+are to be generated; for each set, it has the responsibility for
+* instructing each variable to generate its own dispersed value
+* collecting those values and writing them to an external file
+
+### 3.1.2 Dispersed Variables (MonteCarloVariable)
+
+MonteCarloVariable is an abstract class that forms the basis for all dispersed variables. The following classes inherit from
+MonteCarloVariable:
+* MonteCarloVariableFile will extract a value for its variable from a specified text file. Typically, a data file will
+comprise some number of rows and some number of columns of data. Each column of data represents the possible
+values for one variable. Each row of data represents a correlated set of data to be applied to several variables; each
+data-set generation will be taken from one line of data. Typically, each subsequent data-set will be generated from the
+next line of data; however, this is not required.
+* In some situations, it is desirable to have the next line of data to be used for any given data set be somewhat randomly
+chosen. This has the disadvantageous effect of having some data sets being used more than others, but it supports
+better cross-population when multiple data files are being used.
+ * For example, if file1 contained 2 data sets and file2 contained 4 data sets, then a sequential sweep through
+these file would set up a repeating pattern with line 1 of file2 always being paired with line 1 of file1. For
+example, in 8 runs, we would get this pattern of line numbers from each run:
+ * (1,1), (2,2), (1,3), (2,4), (1,1), (2,2), (1,3), (2,4)
+ * If the first file was allowed to skip a line, the pattern can produce a more comprehensive combination of
+data:
+ * (1,1), (1,2), (2,3), (1,4), (2,1), (2,2), (2,3), (1,4)
+* MonteCarloVariableFixed provides fixed-values to a variable for all generated data-sets. The values can be
+represented as a double, int, or STL-string.
+* MonteCarloVariableRandom is the base class for all variables being assigned a random value. The values can be
+represented as a double, int, or STL-string. There are several subclasses:
+ * MonteCarloVariableRandomNormal provides a variable with a value dispersed according to a normal
+distribution specified by its mean and standard deviation.
+ * MonteCarloVariableRandomUniformInt provides a variable with a value dispersed according to a uniform
+distribution specified by its upper and lower bounds. This class represents a discrete distribution, providing an
+integer value.
+ * MonteCarloVariableRandomUniform provides a variable with a value dispersed according to a uniform
+distribution specified by its upper and lower bounds. This class represents a continuous distribution.
+ * MonteCarloVariableRandomStringSet represents a discrete variable, drawn from a set of STL-strings. The
+class inherits from MonteCarloVariableRandomUniform; this distribution generates a continuous value in [0,1)
+and scales and casts that to an integer index in {0, …, size-1} where size is the number of available strings
+from which to choose.
+
+ Note – an astute reader may question why the discrete MonteCarloVariableRandomStringSet inherits from
+the continuous MonteCarloVariableRandomUniform rather than from the discrete
+MonteCarloVariableRandomUniformInt. The rationale is based on the population of the vector of
+selectable strings in this class. It is desirable to have this vector be available for population outside the
+construction of the class, so at construction time the size of this vector is not known. However, the
+construction of the MonteCarloVariableRandomUniformInt requires specifying the lower and upper
+bounds, which would be 0 and size-1 respectively. Because size is not known at construction, this cannot
+be specified. Conversely, constructing a MonteCarloVariableRandomUniform with bounds at [0,1) still
+allows for scaling to the eventual size of the strings vector.
+
+* MonteCarloVariableSemiFixed utilizes a two-step process. First, a seed-variable has its value generated, then that
+value is copied to this variable. The seed-variable could be a “throw-away” variable, used only to seed this value, or it
+could be an instance of another dispersed variable. Once the value has been copied to this instance, it is retained in this
+instance for all data sets. The seed-variable will continue to generate a new value for each data set, but they will not be
+seen by this variable after that first set.
+
+ The seed-variable can be any type of MonteCarloVariable, but note that not all types of MonteCarloVariable actually
+make sense to use in this context. Most of the usable types are specialized types of MonteCarloVariableRandom.
+
+ However, restricting the seed-variable in such a way would limit the extensibility of the model. All
+MonteCarloVariableRandom types use the C++ \ library for data generation. Limiting the
+MonteCarloVariableSemiFixed type to be seeded only by something using the \ library violates the concept of
+free-extensibility. Consequently, the assigned value may be extracted from any MonteCarloVariable type. The only
+constraint is that the command generated by the seed-variable includes an “=” symbol; everything to the right of that
+symbol will be assigned to this variable.
+
+* MonteCarloPythonLineExec provides a line of executable Python code that can be used to compute the value of this
+variable. So rather than generating an assignment statement, e.g.
+
+```
+var_x = 5
+```
+
+when the MonteCarloMaster processes an instance of this class, it will use a character string to generate an
+instruction statement, e.g.
+
+```
+var_x = math.sin(2 * math.pi * object.circle_fraction)
+```
+
+(in this case, the character string would be “math.sin(2 * math.pi * object.circle_fraction)” and
+object.circle_fraction could be a previously-dispersed variable).
+
+ A particularly useful application of this capability is in generating systematic data sweeps across a domain, as
+opposed to random distributions within a domain. These are commonly implemented as a for-loop, but we can use
+the MonteCarloPythonLineExec to generate them internally. The first data assignment made in each file is to a
+run-number, which can be used as an index. The example shown below will generate a sweep across the domain
+[20,45) in steps of 2.5.
+
+```
+object.sweep_variable = (monte_carlo.master.monte_run_number % 10) * 2.5 + 20
+```
+
+ * MonteCarloPythonFileExec is used when simple assignments and one-line instructions are insufficient, such as
+when one generated-value that feeds into an analytical algorithm to generate multiple other values. With this class,
+the execution of the Python file generated by MonteCarloMaster will hit a call to execute a file as specified by this
+class. This is an oddity among the bank of MonteCarloVariable implementations. In all other implementations,
+the identifying variable_name is used to identify the variable whose value is to be assigned (or computed). With
+the MonteCarloPythonFileExec implementation, the variable_name is hijacked to provide the name of the file to
+be executed.
+
+## 3.2 Mathematical Formulation
+
+No mathematical formulation. The random number generators use the C++ \ library.
+
+# 4 User's Guide
+
+## 4.1 What to expect
+
+This role played by this model can be easily misunderstood, so let’s start there.
+**This model generates Python files containing assignments to variables.**
+
+That’s it!! It does not manage MonteCarlo runs. It does not execute any simulations. When it runs, it creates the requested
+number of Python files and exits.
+
+This design is deliberate; we want the model to generate the instruction sets that will allow execution of a set of dispersed
+configurations. At that point, the simulation should cease, returning control to the user to distribute the execution of those
+configurations according to whatever distribution mechanism they desire. This could be:
+
+* something really simple, like a wild-card, \ `MONTE_RUN_test/RUN*/monte_input.py`
+* a batch-script,
+* a set of batch-scripts launching subsets onto different machines,
+* a load-management service, like SLURM
+* any other mechanism tailored to the user’s currently available computing resources
+
+The intention is that the model runs very early in the simulation sequence. If the model is inactive (as when running a regular, non-MonteCarlo run), it will take no action. But when this model is activated, the user should expect the simulation to terminate before it starts on any propagation.
+
+**When a simulation executes with this model active, the only result of the simulation will be the generation of files containing the assignments to the dispersed variables. The simulation should be expected to terminate at t=0.**
+
+## 4.1.1 Trick Users
+
+The model is currently configured for users of the Trick simulation engine. The functionality of the model is almost exclusively independent of the chosen simulation engine, with the exceptions being the shutdown sequence, and the application of units information in the variables.
+
+Found at the end of the `MonteCarloMaster::execute()` method, the following code:
+
+```c++
+exec_terminate_with_return(0, __FILE__, __LINE__,message.c_str());
+```
+
+is a Trick instruction set to end the simulation.
+
+Found at the end of `MonteCarloVariable::insert_units()`, the following code:
+
+```c++
+// TODO: Pick a unit-conversion mechanism
+// Right now, the only one available is Trick:
+trick_units( pos_equ+1);
+```
+
+provides the call to
+
+```c++
+MonteCarloVariable::trick_units(
+ size_t insertion_pt)
+{
+ command.insert(insertion_pt, " trick.attach_units(\"" + units + "\",");
+ command.append(")");
+```
+
+which appends Trick instructions to interpret the generated value as being represented in the specified units.
+
+The rest of the User’s Guide will use examples of configurations for Trick-simulation input files
+
+## 4.1.2 Non-Trick Users
+
+To configure the model for simulation engines other than Trick, the Trick-specific content identified above should be replaced with equivalent content that will result in:
+* the shutdown of the simulation, and
+* the conversion of units from the type specified in the distribution specification to the type native to the variable to which the generated value is to be assigned.
+
+While the rest of the User’s Guide will use examples of configurations for Trick-simulation input files, understand that these are mostly just C++ or Python code setting the values in this model to make it work as desired. Similar assignments would be required for any other simulation engine.
+
+## 4.2 MonteCarlo Manager (MonteCarloMaster)
+
+### 4.2.1 Instantiation
+
+The instantiation of MonteCarloMaster would typically be done directly in the S_module. The construction of this instance takes a single argument, a STL-string describing its own location within the simulation data-structure.
+
+The MonteCarloMaster class has a single public-interface method call, `MonteCarloMaster::execute()`. This method has 2 gate-keeping flags that must be set (the reason for there being 2 will be explained later):
+* `active`
+* `generate_dispersions`
+
+If either of these flags is false (for reference, `active` is constructed as false and `generate_dispersions` is constructed as true) then this method returns with no action. If both are true, then the model will generate the dispersions, write those dispersions to the external files, and shut down the simulation.
+
+An example S-module
+
+```c++
+class MonteCarloSimObject : public Trick::SimObject
+{
+ public:
+ MonteCarloMaster master; // <--- master is instantiated
+ MonteCarloSimObject(std::string location)
+ :
+ master(location) // <--- master is constructed with this STL-string
+ {
+ P_MONTECARLO ("initialization") master.execute(); // <--- the only function
+call
+ }
+};
+MonteCarloSimObject monte_carlo("monte_carlo.master"); // <--- location of “master”
+ is passed as an
+ argument
+```
+
+### 4.2.2 Configuration
+
+The configuration of the MonteCarloMaster is something to be handled as a user-input to the simulation without requiring re-compilation; as such, it is typically handled in a Python input file. There are two sections for configuration:
+* modifications to the regular input file, and
+* new file-input or other external monte-carlo initiation mechanism
+
+#### 4.2.2.1 Modifications to the regular input file
+
+A regular input file sets up a particular scenario for a nominal run. To add monte-carlo capabilities to this input file, the
+following code should be inserted somewhere in the file:
+
+```python
+if monte_carlo.master.active:
+ # insert non-mc-variable MC configurations like logging
+ if monte_carlo.master.generate_dispersions:
+ exec(open(“Modified_data/monte_variables.py").read())
+```
+
+Let’s break this down, because it explains the reason for having 2 flags:
+
+| `generate_dispersions` | `active` | Result |
+| :--- |:---| :--- |
+| false | false | Regular (non-monte-carlo) run |
+| false | true | Run scenario with monte-carlo configuration and pre-generated dispersions |
+| true | false | Regular (non-monte-carlo) runs |
+| true | true | Generate dispersions for this scenario, but do not run the scenario |
+
+ 1. If the master is inactive, this content is passed over and the input file runs just as it would without this content
+ 2. Having the master `active` flag set to true instructs the simulation that the execution is intended to be part of a monte-carlo analysis. Now there are 2 types of executions that fit this intent:
+ * The generation of the dispersion files
+ * The execution of this run with the application of previously-generated dispersions
+
+Any code to be executed for case (a) must go inside the `generate_dispersions` gate. Any code to be executed for
+case (b) goes inside the `active` gate, but outside the `generate_dispersions` gate.
+
+You may wonder why this distinction is made. In many cases, it is desirable to make the execution for monte-carlo
+analysis subtly different to that for regular analysis. One commonly used distinction is logging of data; the logging
+requirement may differ between a regular run and one as part of a monte-carlo analysis (typically, monte-carlo runs
+execute with reduced logging). By providing a configuration area for a monte-carlo run, we can support these
+distinctions.
+Note – any code to be executed for only non-monte-carlo runs can be put in an else: block. For example, this code
+will set up one set of logging for a monte-carlo run, and another for a non-monte-carlo run of the same scenario:
+```python
+if monte_carlo.master.active:
+ exec(open(“Log_data/log_for_monte_carlo.py”).read())
+ if monte_carlo.master.generate_dispersions:
+ exec(open(“Modified_data/monte_variables.py").read())
+else:
+ exec(open(“Log_data/log_for_regular.py”).read())
+```
+ 3. If the `generate_dispersions` flag is also set to true, the `MonteCarloMaster::execute()` method will execute,
+generating the dispersion files and shutting down the simulation.
+
+#### 4.2.2.2 Initiating MonteCarlo
+
+Somewhere outside this file, the `active` and generate_dispersion flags must be set. This can be performed either in a separate input file or via a command-line argument. Unless the command-line argument capability is already supported, by far the easiest mechanism is to create a new input file that subsequently reads the existing input file:
+
+```
+monte_carlo.master.activate("RUN_1")
+exec(open("RUN_1/input.py").read())
+```
+
+The activate method takes a single string argument, representing the name of the run. This must be exactly the same name as the directory containing the original input file, “RUN_1” in the example above. This argument is used in 2 places (\ in these descriptions refers to the content of the argument string):
+
+* In the creation of a `MONTE_` directory. This directory will contain some number of sub-directories identified as, for example, RUN_01, RUN_02, RUN_03, etc. each of which will contain one of the generated dispersion files.
+* In the instructions written into the generated dispersion files to execute the content of the input file found in ``.
+
+#### 4.2.2.3 Additional Configurations
+
+There are additional configurations instructing the MonteCarloMaster on the generation of the new dispersion files. Depending on the use-case, these could either be embedded within the `if monte_carlo.master.generate_dispersions:` block of the original input file, or in the secondary input file (or command-line arguments if configured to do so).
+
+* Number of runs is controlled with a single statement, e.g.
+
+ ```monte_carlo.master.set_num_runs(10)```
+
+* Generation of meta-data. The meta-data provides a summary of which variables are being dispersed, the type of dispersion applied to each, the random seeds being used, and correlation between different variables. This is written out to a file called MonteCarlo_Meta_data_output in the MONTE_* directory.
+
+ ```monte_carlo.master.generate_meta_data = True```
+
+* Changing the name of the automatically-generated monte-directory. By default, this takes the form “MONTE_\” as assigned in the MonteCarloMaster::activate(...) method. The monte_dir variable is public and can be reset after activation and before the `MonteCarloMaster::execute()` method runs. This is particularly useful if it is desired to compare two distribution sets for the same run.
+
+ ```monte_carlo.master.monte_dir = “MONTE_RUN_1_vers2”```
+
+* Changing the input file name. It is expected that most applications of this model will run with a typical organization of a Trick simulation. Consequently, the original input file is probably named input.py, and this is the default setting for the input_file_name variable. However, to support other cases, this variable is public and can be changed at any time between construction and the execution of the `MonteCarloMaster::execute()` method.
+
+ ```monte_carlo.master.input_file_name = “modified_input.py”```
+
+* Padding the filenames of the generated files. By default, the generated RUN directories in the generated MONTE_* directory will have their numerical component padded according to the number of runs. When:
+ * between 1 - 10 runs are generated, the directories will be named RUN_0, RUN_1, …
+ * between 11-100 runs are generated, the directories will be named RUN_00, RUN_01, …
+ * between 101-1000 runs are generated, the directories will be named RUN_000, RUN_001, …
+ * etc.
+
+ Specification of a minimum padding width is supported. For example, it might be desired to create 3 runs with names RUN_00000, RUN_00001, and RUN_00002, in which case the minimum-padding should be specified as 5 characters
+
+ ```monte_carlo.master.minimum_padding = 5```
+
+* Changing the run-name. For convenience, the run-name is provided as an argument in the MonteCarloMaster::activate(...) method. The run_name variable is public, and can be reset after activation and before the `MonteCarloMaster::execute()` method runs. Because this setting determines which run is to be launched from the dispersion files, resetting run_name has limited application – effectively limited to correcting an error, which could typically be more easily corrected directly.
+
+ ```monte_carlo.master.run_name = “RUN_2”```
+
+## 4.3 MonteCarlo Variables (MonteCarloVariable)
+
+The instantiation of the MonteCarloVariable instances is typically handled as a user-input to the simulation without requiring re-compilation. As such, these are usually implemented in Python input files. This is not a requirement, and these instances can be compiled as part of the simulation build. Both cases are presented.
+
+### 4.3.1 Instantiation and Registration
+
+For each variable to be dispersed, an instance of a MonteCarloVariable must be created, and that instance registered with the MonteCarloMaster instance:
+
+1. Identify the type of dispersion desired
+2. Select the appropriate type of MonteCarloVariable to provide that dispersion.
+3. Create the new instance using its constructor.
+4. Register it with the MonteCarloMaster using the `MonteCarloMaster::add_variable( MonteVarloVariable&)` method
+
+#### 4.3.1.1 Python input file implementation for Trick:
+
+When the individual instances are registered with the master, it only records the address of those instances. A user may create completely new variable names for each dispersion, or use a generic name as illustrated in the example below. Because these are typically created within a Python function, it is important to add the thisown=False instruction on each creation to prevent its destruction when the function returns.
+
+```python
+mc_var = trick.MonteCarloVariableRandomUniform( "object.x_uniform", 0, 10, 20)
+mc_var.thisown = False
+monte_carlo.master.add_variable(mc_var)
+mc_var = trick.MonteCarloVariableRandomNormal( "object.x_normal", 0, 0, 5)
+mc_var.thisown = False
+monte_carlo.master.add_variable(mc_var)
+```
+
+#### 4.3.1.2 C++ implementation in its own class:
+
+In this case, the instances do have to be uniquely named.
+
+Note that the registering of the variables could be done in the class constructor rather than in an additional method (process_variables), thereby eliminating the need to store the reference to MonteCarloMaster. In this case, the `generate_dispersions` flag is completely redundant because the variables are already registered by the time the input file is executed. Realize, however, that doing so does carry the overhead of registering those variables with the MonteCarloMaster every time the simulation starts up. This can a viable solution when there are only a few MonteCarloVariable instances, but is generally not recommended; using an independent method (process_variables) allows restricting the registering of the variables to be executed only when generating new dispersions.
+
+```c++
+class MonteCarloVarSet {
+ private:
+ MonteCarloMaster & master;
+ public:
+ MonteCarloVariableRandomUniform x_uniform;
+ MonteCarloVariableRandomNormal x_normal;
+ ...
+ MonteCarloVarSet( MonteCarloMaster & master_)
+ :
+ master(master_),
+ x_uniform("object.x_uniform", 0, 10, 20),
+ x_normal ("object.x_normal", 0, 0, 5),
+ ...
+ { };
+
+ void process_variables() {
+ master.add_variable(x_uniform);
+ master.add_variable(x_normal);
+ ...
+ }
+};
+```
+
+#### 4.3.1.3 C++ implementation within a Trick S-module:
+
+Instantiating the variables into the same S-module as the master is also a viable design pattern. However, this can lead to a very long S-module so is typically only recommended when there are few variables. As with the C++ implementation in a class, the variables can be registered with the master in the constructor rather than in an additional method, with the same caveats presented earlier.
+
+```c++
+class MonteCarloSimObject : public Trick::SimObject
+{
+ public:
+ MonteCarloMaster master;
+ MonteCarloVariableRandomUniform x_uniform;
+ MonteCarloVariableRandomNormal x_normal;
+ ...
+ MonteCarloSimObject(std::string location)
+ :
+ master(location),
+ x_uniform("object.x_uniform", 0, 10, 20),
+ x_normal ("object.x_normal", 0, 0, 5),
+ ...
+{ };
+ void process_variables() {
+ master.add_variable(x_uniform);
+ master.add_variable(x_normal);
+ ...
+};
+ {
+ P_MONTECARLO ("initialization") master.execute();
+} };
+MonteCarloSimObject monte_carlo("monte_carlo.master");
+```
+
+### 4.3.2 input-file Access
+
+If using a (compiled) C++ implementation with the registration conducted at construction, the `generate_dispersions` flag is not used in the input file.
+
+```python
+if monte_carlo.master.active:
+ if monte_carlo.master.generate_dispersions:
+ exec(open(“Modified_data/monte_variables.py").read())
+```
+
+(where monte_variables.py is the file containing the mc_var = … content described earlier)
+
+```python
+if monte_carlo.master.active:
+ if monte_carlo.master.generate_dispersions:
+ monte_carlo_variables.process_variables()
+```
+
+If using a (compiled) C++ implementation with a method to process the registration, that method call must be contained inside the `generate_dispersions` gate in the input file:
+```
+if monte_carlo.master.active:
+ # add only those lines such as logging configuration
+```
+
+### 4.3.3 Configuration
+
+For all variable-types, the variable_name is provided as the first argument to the constructor. This variable name must include the full address from the top level of the simulation. After this argument, each variable type differs in its construction arguments and subsequent configuration options.
+
+#### 4.3.3.1 MonteCarloVariable
+
+MonteCarloVariable is an abstract class; its instantiable implementations are presented below. There is one important configuration for general application to these implementations, the setting of units. In a typical simulation, a variable has an inherent unit-type; these are often SI units, but may be based on another system. Those native units may be different to those in which the distribution is described. In this case, assigning the generated numerical value to the variable without heed to the units mismatch would result in significant error.
+
+```set_units(std::string units)```
+
+This method specifies that the numerical value being generated is to be interpreted in the specified units.
+
+Notes
+* if it is known that the variable’s native units and the dispersion units match (including the case of a dimensionless value), this method is not needed.
+* This method is not applicable to all types of MonteCarloVariable; use with MonteCarloVariableRandomBool and MonteCarloPython* is considered undefined behavior.
+
+#### 4.3.3.2 MonteCarloVariableFile
+
+The construction arguments are:
+
+1. variable name
+2. filename containing the data
+3. column number containing data for this variable
+4. (optional) first column number. This defaults to 1, but some users may want to zero-index their column numbers, in which case it can be set to 0.
+
+There is no additional configuration beyond the constructor
+
+There is no additional configuration beyond the constructor.
+
+#### 4.3.3.3 MonteCarloVariableFixed
+
+The construction arguments are:
+1. variable name
+2. value to be assigned
+
+Additional configuration for this model includes the specification of the maximum number of lines to skip between runs.
+`max_skip`. This public variable has a default value of 0 – meaning that the next run will be drawn from the next line of data, but this can be adjusted.
+
+#### 4.3.3.4 MonteCarloVariableRandomBool
+
+The construction arguments are:
+1. variable name
+2. seed for random generator
+There is no additional configuration beyond the constructor.
+
+#### 4.3.3.5 MonteCarloVariableRandomNormal
+
+The construction arguments are:
+1. variable name
+2. seed for random generator, defaults to 0
+3. mean of distribution, defaults to 0
+4. standard-deviation of distribution, defaults to 1.
+
+The normal distribution may be truncated, and there are several configuration settings associated with truncation. Note that for all of these truncation options, if the lower truncation bound is set to be larger than the upper truncation bound, the generation of the dispersed value will fail and the simulation will terminate without generation of files. If the upper andlower bound are set to be equal, the result will be a forced assignment to that value.
+
+`TruncationType`
+
+This is an enumerated type, supporting the specification of the truncation limits in one of three ways:
+* `StandardDeviation`: The distribution will be truncated at the specified number(s) of standard deviations away from the mean.
+* `Relative`: The distribution will be truncated at the specified value(s) relative to the mean value.
+* `Absolute`: The distribution will be truncated at the specified value(s).
+
+`max_num_tries`
+
+The truncation is performed by repeatedly generating a number from the unbounded distribution until one is found that lies within the truncation limits. This max_num_tries value determines how many attempts may be made before the algorithm concedes. It defaults to 10,000. If a value has not been found within the specified number of tries, an error message is sent and the value is calculated according to the following rules:
+* For a distribution truncated at only one end, the truncation limit is used
+* For a distribution truncated at both ends, the midpoint value between the two truncation limits is used.
+
+`truncate( double limit, TruncationType)`
+
+This method provides a symmetric truncation, with the numerical value provided by limit being interpreted as a number of standard-deviations either side of the mean, a relative numerical value from the mean, or an absolute value.
+
+The value limit should be positive. If a negative value is provided, it will be negated to a positive value.
+
+The use of TruncationType Absolute and this method requires a brief clarification because this may result in an asymmetric distribution. In this case, the distribution will be truncated to lie between (-limit, limit) which will be asymmteric for all cases in which the mean is non-zero.
+
+`truncate( double min, double max, TruncationType)`
+
+This method provides a more general truncation, with the numerical value provided by min and max being interpreted as a number of standard-deviations away from the mean, a relative numerical value from the mean, or an absolute value.
+
+Unlike the previous method, the numerical arguments (min and max) may be positive or negative, and care must be taken especially when specifying min with TruncationType StandardDeviation or Relative. Realize that a positive value of min will result in a lower bound with value above that of the mean; min does not mean “distance to the left of the mean”, it means the smallest acceptable value relative to the mean.
+
+`truncate_low( double limit, TruncationType)`
+
+This method provides a one-sided truncation. All generated values will be above the limit specification.
+
+`truncate_high( double limit, TruncationType)`
+
+This method provides a one-sided truncation. All generated values will be below the limit specification.
+
+`untruncate()`
+
+This method removes previously configured truncation limits.
+
+#### 4.3.3.6 MonteCarloVariableRandomStringSet
+
+The construction arguments are:
+1. variable name
+2. seed for random generator
+
+This type of MonteCarloVariable contains a STL-vector of STL-strings containing the possible values that can be assigned by this generator. This vector is NOT populated at construction time and must be configured.
+
+`add_string(std::string new_string)`
+
+This method adds the specified string (`new_string`) to the vector of available strings
+
+#### 4.3.3.7 MonteCarloVariableRandomUniform
+
+The construction arguments are:
+1. variable name
+2. seed for random generator, defaults to 0
+3. lower-bound of distribution, default to 0
+4. upper-bound for distribution, defaults to 1
+
+There is no additional configuration beyond the constructor
+
+#### 4.3.3.8 MonteCarloVariableRandomUniformInt
+
+The construction arguments are:
+1. variable name
+2. seed for random generator, defaults to 0
+3. lower-bound of distribution, default to 0
+4. upper-bound for distribution, defaults to 1
+
+There is no additional configuration beyond the constructor
+
+#### 4.3.3.9 MonteCarloVariableSemiFixed
+
+The construction arguments are:
+1. variable name
+2. reference to the MonteCarloVariable whose generated value is to be used as the fixed value.
+
+There is no additional configuration beyond the constructor.
+
+#### 4.3.3.10 MonteCarloPythonLineExec
+
+The construction arguments are:
+1. variable name
+2. an STL-string providing the Python instruction for the computing of the value to be assigned to the specified variable.
+
+There is no additional configuration beyond the constructor.
+
+#### 4.3.3.11 MonteCarloPythonFileExec
+The construction argument is:
+1. name of the file to be executed from the generated input file.
+
+There is no additional configuration beyond the constructor.
+
+## 4.4 Information on the Generated Files
+
+This section is for informational purposes only to describe the contents of the automatically-generated dispersion files. Users do not need to take action on any content in here.
+
+The generated files can be broken down into 3 parts:
+* Configuration for the input file. These two lines set the flags such that when this file is executed, the content of the original input file will configure the run for a monte-carlo analysis but without re-generating the dispersion files.
+
+```python
+monte_carlo.master.active = True
+monte_carlo.master.generate_dispersions = False
+```
+
+* Execution of the original input file. This line opens the original input file so that when this file is executed, the original input file is also executed automatically.
+
+```python
+exec(open('RUN_1/input.py').read())
+```
+
+* Assignment to simulation variables. This section always starts with the assignment to the run-number, which is also found in the name of the run, so RUN_0 gets a 0, RUN_1 gets a 1, etc. This value can be used, for example, to generate data sweeps as described in section MonteCarloPythonLineExec above.
+
+```python
+monte_carlo.master.monte_run_number = 0
+object.test_variable1 = 5
+object.test_variable1 = 1.23456789
+...
+```
+
+## 4.5 Extension
+
+The model is designed to be extensible and while we have tried to cover the most commonly used applications, complete anticipation of all use-case needs is impossible. The most likely candidate for extension is in the area of additional distributions. In this case:
+* A new distribution should be defined in its own class
+* That class shall inherit from MonteCarloVariable or, if it involves a random generation using a distribution found in the C++ `` library, from MonteCarloVariableRandom.
+ * Populate the command variable inherited from MonteCarloVariable. This is the STL string representing the content that the MonteCarloMaster will place into the generated dispersion files.
+ * Call the `insert_units()` method inherited from MonteCarloVariable
+ * Set the `command_generated` flag to true if the command has been successfully generated.
+
+## 4.6 Running generated runs within an HPC framework
+
+Modern HPC (High Performance Computing) labs typically have one or more tools for managing the execution of jobs across multiple computers. There are several linux-based scheduling tools, but this section focuses on running the generated runs using a SLURM (Simple Linux Utility for Resource Management) array job. Consider this script using a simulation built with gcc 4.8 and a user-configured run named `RUN_example` which has already executed once with the Monte-Carlo Generation model enabled to generate 100 runs on disk:
+
+```bash
+#SBATCH --array=0-99
+
+# This is an example sbatch script demonstrating running an array job in SLURM.
+# SLURM is an HPC (High-Performance-Computing) scheduling tool installed in
+# many modern super-compute clusters that manages execution of a massive
+# number of user-jobs. When a script like this is associated with an array
+# job, this script is executed once per enumerated value in the array. After
+# the Monte Carlo Generation Model executes, the resulting RUNs can be queued
+# for SLURM execution using a script like this. Alternatively, sbatch --wrap
+# can be used. See the SLURM documentation for more in-depth information.
+#
+# Slurm: https://slurm.schedmd.com/documentation.html
+
+# $SLURM_ARRAY_TASK_ID is automatically provided by slurm, and will be an
+# integer between 0-99 per the "SBATCH --array" flag specified at the top of
+# this script
+echo "SLURM has provided us with array job integer: $SLURM_ARRAY_TASK_ID"
+# Convert this integer to a zero-padded string matching the RUN naming
+# convention associated with thi
+RUN_NUM=`printf %02d $SLURM_ARRAY_TASK_ID`
+# Execute the single trick simulation run associated with RUN_NUM
+echo "Running RUN_$RUN_NUM ..."
+./S_main_Linux_4.8_x86_64.exe MONTE_RUN_example/RUN_${RUN_NUM}/monte_input.py
+```
+
+The above script can be executed within a SLURM environment by running `sbatch `. This single command will create 100 independent array jobs in SLURM, allowing the scheduler to execute them as resources permit. Be extra careful with the zero-padding logic in the script above. The monte-carlo generation model will create zero-padded `RUN` names suitable for the number of runs requested to be generated by the user. The `%02d` part of the script above specifies 2-digit zero-padding which is suitable for 100 runs. Be sure to match this logic with the zero-padding as appropriate for your use-case.
+
+For more information on SLURM, refer to the project documentation: https://slurm.schedmd.com/documentation.html
+
+# 5 Verification
+
+The verification of the model is provided by tests defined in `test/SIM_mc_generation`. This sim was originally developed by by JSC/EG NASA in the 2020 timeframe. The verification section of the original documentation is omitted from this markdown file because it heavily leverages formatting that markdown cannot support. It can be viewed [here](MCG_verification_2020.pdf)
diff --git a/docs/documentation/miscellaneous_trick_tools/Python-Variable-Server-Client.md b/docs/documentation/miscellaneous_trick_tools/Python-Variable-Server-Client.md
index 89e1e32f..720566f9 100644
--- a/docs/documentation/miscellaneous_trick_tools/Python-Variable-Server-Client.md
+++ b/docs/documentation/miscellaneous_trick_tools/Python-Variable-Server-Client.md
@@ -1,3 +1,7 @@
+| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Miscellaneous Trick Tools](Miscellaneous-Trick-Tools) → Python Variable Server Client |
+|------------------------------------------------------------------|
+
+
`variable_server.py` is a Python module for communicating with a sim's variable server from a Python program. Its primary purpose is to easily get and set variable values and units, but it also includes some additional convenience methods for affecting the sim's state. The code itself is well-commented, so I won't be reproducing the API here. Run `pydoc variable_server` (in the containing directory) for that.
# Release Your Resources!
@@ -384,4 +388,4 @@ class Variable(__builtin__.object)
| should not directly change any part of this class.
```
-[Continue to Software Requirements](software_requirements_specification/SRS)
+[Continue to Trick Ops](TrickOps)
diff --git a/docs/documentation/miscellaneous_trick_tools/TrickOps.md b/docs/documentation/miscellaneous_trick_tools/TrickOps.md
index 228dcd87..024c3c49 100644
--- a/docs/documentation/miscellaneous_trick_tools/TrickOps.md
+++ b/docs/documentation/miscellaneous_trick_tools/TrickOps.md
@@ -1,3 +1,6 @@
+| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Miscellaneous Trick Tools](Miscellaneous-Trick-Tools) → Trick Ops |
+|------------------------------------------------------------------|
+
# Table of Contents
* [Requirements](#Requirements)
* [Features](#Features)
@@ -9,10 +12,11 @@
* [Other Useful Examples](#other-useful-examples)
* [The TrickOps Design](#regarding-the-design-why-do-i-have-to-write-my-own-script)
* [Tips & Best Practices](#tips--best-practices)
+* [MonteCarloGenerationHelper](#montecarlogenerationhelper---trickops-helper-class-for-montecarlogeneratesm-users)
# TrickOps
-TrickOps is shorthand for "Trick Operations", and is a `python3` framework that provides an easy-to-use interface for common testing and workflow actions that Trick simulation developers and users often run repeatedly. Good software developer workflows typically have a script or set of scripts that the developer can run to answer the question "have I broken anything?". The purpose of TrickOps is to provide the logic central to managing these tests while allowing each project to define how and and what they wish to test. Don't reinvent the wheel, use TrickOps!
+TrickOps is shorthand for "Trick Operations". TrickOps is a `python3` framework that provides an easy-to-use interface for common testing and workflow actions that Trick simulation developers and users often run repeatedly. Good software developer workflows typically have a script or set of scripts that the developer can run to answer the question "have I broken anything?". The purpose of TrickOps is to provide the logic central to managing these tests while allowing each project to define how and and what they wish to test. Don't reinvent the wheel, use TrickOps!
TrickOps is *not* a GUI, it's a set of python modules that you can `import` that let you build a testing framework for your Trick-based project with just a few lines of python code.
@@ -51,39 +55,42 @@ Simple and readable, this config file is parsed by `PyYAML` and adheres to all n
```yaml
globals:
- env: <-- optional literal string executed before all tests, e.g. env setup
- parallel_safety: <-- strict won't allow multiple input files per RUN dir
-
+ env: <-- optional literal string executed before all tests, ex: ". env.sh"
SIM_abc: <-- required unique name for sim of interest, must start with SIM
path: <-- required SIM path relative to project top level
description: <-- optional description for this sim
labels: <-- optional list of labels for this sim, can be used to get sims
- model_x by label within the framework, or for any other project-defined
- verification purpose
- build_command: <-- optional literal cmd executed for SIM_build, defaults to trick-CP
+ build_args: <-- optional literal args passed to trick-CP during sim build
+ binary: <-- optional name of sim binary, defaults to S_main_{cpu}.exe
size: <-- optional estimated size of successful build output file in bytes
+ phase: <-- optional phase to be used for ordering builds if needed
+ parallel_safety: <-- strict won't allow multiple input files per RUN dir.
+ Defaults to "loose" if not specified
runs: <-- optional dict of runs to be executed for this sim, where the
RUN_1/input.py --foo: dict keys are the literal arguments passed to the sim binary
RUN_2/input.py: and the dict values are other run-specific optional dictionaries
- ... described as follows ...
+ RUN_[10-20]/input.py: described in indented sections below. Zero-padded integer ranges
+ can specify a set of runs with continuous numbering using
+ [-] notation
returns: <---- optional exit code of this run upon completion (0-255). Defaults
to 0
compare: <---- optional list of vs. comparison strings to be
- - a vs. b compared after this run is complete. This is extensible in that
- - d vs. e all non-list values are ignored and assumed to be used to define
- - ... an alternate comparison method in derived classes
+ - a vs. b compared after this run is complete. Zero-padded integer ranges
+ - d vs. e are supported as long as they match the pattern in the parent run.
+ - ... All non-list values are ignored and assumed to be used to define
+ - ... an alternate comparison method in a class extending this one
analyze: <-- optional arbitrary string to execute as job in bash shell from
project top level, for project-specific post-run analysis
- valgrind: <-- optional dict describing how to execute runs within valgrind
- flags: <-- string of all flags passed to valgrind for all runs
- runs: <-- list of literal arguments passed to the sim binary through
- - RUN_1... valgrind
-
+ phase: <-- optional phase to be used for ordering runs if needed
+ valgrind: <-- optional string of flags passed to valgrind for this run.
+ If missing or empty, this run will not use valgrind
non_sim_extension_example:
will: be ignored by TrickWorkflow parsing for derived classes to implement as they wish
```
-Almost everything in this file is optional, but there must be at least one top-level key that starts with `SIM` and it must contain a valid `path: ` with respect to the top level directory of your project. Here, `SIM_abc` represents "any sim" and the name is up to the user, but it *must* begin with `SIM` since `TrickWorkflow` purposefully ignores any top-level key not beginning with `SIM` in order to allow for extensibility of the YAML file for non-sim tests specific to a project.
+Almost everything in this file is optional, but there must be at least one top-level key that starts with `SIM` and it must contain a valid `path: ` with respect to the top level directory of your project. Here, `SIM_abc` represents "any sim" and the name is up to the user, but it *must* begin with `SIM` since `TrickWorkflow` purposefully ignores any top-level key not beginning with `SIM` and any key found under the `SIM` key not matching any named parameter above. This design allows for extensibility of the YAML file for non-sim tests specific to a project.
There is *no limit* to number of `SIM`s, `runs:`, `compare:` lists, `valgrind` `runs:` list, etc. This file is intended to contain every Sim and and every sim's run, and every run's comparison and so on that your project cares about. Remember, this file represents the *pool* of tests, not necessarily what *must* be tested every time your scripts which use it run.
@@ -97,19 +104,21 @@ cd trick/share/trick/trickops/
```
When running, you should see output that looks like this:
-![ExampleWorkflow In Action](trickops_example.png)
+![ExampleWorkflow In Action](images/trickops_example.png)
-When running, you'll notice that tests occur in two phases. First, sims build in parallel up to three at a time. Then when all builds complete, sims run in parallel up to three at a time. Progress bars show how far along each build and sim run is at any given time. The terminal window will accept scroll wheel and arrow input to view current builds/runs that are longer than the terminal height.
+When running this example script, you'll notice that tests occur in two phases. First, sims build in parallel up to three at a time. Then when all builds complete, sims run in parallel up to three at a time. Progress bars show how far along each build and sim run is at any given time. The terminal window will accept scroll wheel and arrow input to view current builds/runs that are longer than the terminal height. Before the script finishes, it reports a summary of what was done, providing a list of which sims and runs were successful and which were not.
-Looking inside the script, the code at top of the script creates a yaml file containing a large portion of the sims and runs that ship with trick and writes it to `/tmp/config.yml`. This config file will be input to the framework. At the bottom of the script is where the magic happens, this is where the TrickOps modules are used:
+Looking inside the script, the code at top of the script creates a yaml file containing a large portion of the sims and runs that ship with trick and writes it to `/tmp/config.yml`. This config file is then used as input to the `TrickWorkflow` framework. At the bottom of the script is where the magic happens, this is where the TrickOps modules are used:
```python
from TrickWorkflow import *
class ExampleWorkflow(TrickWorkflow):
def __init__( self, quiet, trick_top_level='/tmp/trick'):
- # Real projects already have trick somewhere, but for this test, just clone it
+ # Real projects already have trick somewhere, but for this example, just clone & build it
if not os.path.exists(trick_top_level):
os.system('cd %s && git clone https://github.com/nasa/trick' % (os.path.dirname(trick_top_level)))
+ if not os.path.exists(os.path.join(trick_top_level, 'lib64/libtrick.a')):
+ os.system('cd %s && ./configure && make' % (trick_top_level))
# Base Class initialize, this creates internal management structures
TrickWorkflow.__init__(self, project_top_level=trick_top_level, log_dir='/tmp/',
trick_dir=trick_top_level, config_file="/tmp/config.yml", cpus=3, quiet=quiet)
@@ -131,9 +140,11 @@ Let's look at a few key parts of the example script. Here, we create a new class
from TrickWorkflow import *
class ExampleWorkflow(TrickWorkflow):
def __init__( self, quiet, trick_top_level='/tmp/trick'):
- # Real projects already have trick somewhere, but for this test, just clone it
+ # Real projects already have trick somewhere, but for this example, just clone & build it
if not os.path.exists(trick_top_level):
os.system('cd %s && git clone https://github.com/nasa/trick' % (os.path.dirname(trick_top_level)))
+ if not os.path.exists(os.path.join(trick_top_level, 'lib64/libtrick.a')):
+ os.system('cd %s && ./configure && make' % (trick_top_level))
```
Our new class `ExampleWorkflow.py` can be initialized however we wish as long as it provides the necessary arguments to it's Base class initializer. In this example, `__init__` takes two parameters: `trick_top_level` which defaults to `/tmp/trick`, and `quiet` which will be `False` unless `quiet` is found in the command-line args to this script. The magic happens on the very next line where we call the base-class `TrickWorkflow` initializer which accepts four required parameters:
@@ -145,15 +156,15 @@ The required parameters are described as follows:
* `project_top_level` is the absolute path to the highest-level directory of your project. The "top level" is up to the user to define, but usually this is the top level of your repository and at minimum must be a directory from which all sims, runs, and other files used in your testing are recursively reachable.
* `log_dir` is a path to a user-chosen directory where all logging for all tests will go. This path will be created for you if it doesn't already exist.
* `trick_dir` is an absolute path to the top level directory for the instance of trick used for your project. For projects that use trick as a `git` `submodule`, this is usually `/trick`
-* `config_file` is the path to a YAML config file describing the sims, runs, etc. for your project. It's recommended this file be tracked in your SCM tool but that is not required. More information on the syntax expected in this file in the **The YAML File** section below.
+* `config_file` is the path to a YAML config file describing the sims, runs, etc. for your project. It's recommended this file be tracked in your SCM tool but that is not required. More information on the syntax expected in this file in the **The YAML File** section above.
The optional parameters are described as follows:
* `cpus` tells the framework how many CPUs to use on sim builds. This translates directly to `MAKEFLAGS` and is separate from the maximum number of simultaneous sim builds.
* `quiet` tells the framework to suppress progress bars and other verbose output. It's a good idea to use `quiet=True` if your scripts are going to be run in a continuous integration (CI) testing framework such as GitHub Actions, GitLab CI, or Jenkins, because it suppresses all `curses` logic during job execution which itself expects `stdin` to exist.
-When `TrickWorkflow` initializes, it reads the `config_file` and verifies the information given matches the expected convention. If a non-fatal error is encountered, a message detailing the error is printed to `stdout` and the internal timestamped log file under `log_dir`. A fatal error will `raise RuntimeError`.
+When `TrickWorkflow` initializes, it reads the `config_file` and verifies the information given matches the expected convention. If a non-fatal error is encountered, a message detailing the error is printed to `stdout` and the internal timestamped log file under `log_dir`. A fatal error will `raise RuntimeError`. Classes which inherit from `TrickWorkflow` may also access `self.parsing_errors` and `self.config_errors` which are lists of errors encountered from parsing the YAML file and errors encountered from processing the YAML file respectively.
-Moving on to the next important lines of code in our `ExampleWorkflow.py` script. The `def run(self):` line declares a function whose return code on run is passed back to the calling shell via `sys.exit()`. This is where we use the functions given to us by inherting from `TrickWorkflow`:
+Moving on to the next few important lines of code in our `ExampleWorkflow.py` script. The `def run(self):` line declares a function whose return code on run is passed back to the calling shell via `sys.exit()`. This is where we use the functions given to us by inherting from `TrickWorkflow`:
```python
@@ -173,7 +184,7 @@ The last three lines simply print a detailed report of what was executed and man
return (builds_status or runs_status or self.config_errors)
```
-The `ExampleWorkflow.py` uses sims/runs provided by trick to exercise *some* of the functionality provided by TrickOps. This script does not have any comparisons, post-run analyses, or valgrind runs defined in the YAML file, so there is no execution of those tests in this example.
+The `ExampleWorkflow.py` script uses sims/runs provided by trick to exercise *some* of the functionality provided by TrickOps. This script does not have any comparisons, post-run analyses, or valgrind runs defined in the YAML file, so there is no execution of those tests in this example.
## `compare:` - File vs. File Comparisons
@@ -188,8 +199,8 @@ SIM_ball:
RUN_foo/input.py:
RUN_test/input.py:
compare:
- - path/to/SIM_/ball/RUN_test/log_a.csv vs. regression/SIM_ball/log_a.csv
- - path/to/SIM_/ball/RUN_test/log_b.trk vs. regression/SIM_ball/log_b.trk
+ - path/to/SIM_ball/RUN_test/log_a.csv vs. regression/SIM_ball/log_a.csv
+ - path/to/SIM_ball/RUN_test/log_b.trk vs. regression/SIM_ball/log_b.trk
```
In this example, `SIM_ball`'s run `RUN_foo/input.py` doesn't have any comparisons, but `RUN_test/input.py` contains two comparisons, each of which compares data generated by the execution of `RUN_test/input.py` to a stored off version of the file under the `regression/` directory relative to the top level of the project. The comparisons themselves can be executed in your python script via the `compare()` function in multiple ways. For example:
@@ -233,10 +244,98 @@ if not failure:
If an error is encountered, like `koviz` or a given directory cannot be found, `None` is returned in the first index of the tuple, and the error information is returned in the second index of the tuple for `get_koviz_report_job()`. The `get_koviz_report_jobs()` function just wraps the singular call and returns a tuple of `( list_of_jobs, list_of_any_failures )`. Note that `koviz` accepts entire directories as input, not specific paths to files. Keep this in mind when you organize how regression data is stored and how logged data is generated by your runs.
+
## `analyze:` - Post-Run Analysis
The optional `analyze:` section of a `run:` is intended to be a catch-all for "post-run analysis". The string given will be transformed into a `Job()` instance that can be retrieved and executed via `execute_jobs()` just like any other test. All analyze jobs are assumed to return 0 on success, non-zero on failure. One example use case for this would be creating a `jupytr` notebook that contains an analysis of a particular run.
+## Defining sets of runs using [integer-integer] range notation
+
+The `yaml` file for your project can grow quite large if your sims have a lot of runs. This is especially the case for users of monte-carlo, which may generate hundreds or thousands of runs that you may want to execute as part of your TrickOps script. In order to support these use cases without requiring the user to specify all of these runs individually, TrickOps supports a zero-padded `[integer-integer]` range notation in the `run:` and `compare:` fields. Consider this example `yaml` file:
+
+```yaml
+SIM_many_runs:
+ path: sims/SIM_many_runs
+ runs:
+ RUN_[000-100]/monte_input.py:
+ returns: 0
+ compare:
+ sims/SIM_many_runs/RUN_[000-100]/log_common.csv vs. baseline/sims/SIM_many_runs/log_common.csv
+ sims/SIM_many_runs/RUN_[000-100]/log_verif.csv vs. baseline/sims/SIM_many_runs/RUN_[000-100]/log_verif.csv
+```
+In this example, `SIM_many_runs` has 101 runs. Instead of specifying each individual run (`RUN_000/`, `RUN_001`, etc), in the `yaml` file, the `[000-100]` notation is used to specify a set of runs. All sub-fields of the run apply to that same set. For example, the default value of `0` is used for `returns:`, which also applies to all 101 runs. The `compare:` subsection supports the same range notation, as long as the same range is used in the `run:` named field. Each of the 101 runs shown above has two comparisons. The first `compare:` line defines a common file to be compared against all 101 runs. The second `compare:` line defines run-specific comparisons using the same `[integer-integer]` sequence. Note that when using these range notations zero-padding must be consistent, the values (inclusive) must be non-negative, and the square bracket notation must be used with the format `[minimum-maximum]`.
+
+
+## `phase:` - An optional mechanism to order builds, runs, and analyses
+
+The `yaml` file supports an optional parameter `phase: ` at the sim and run level which allows the user to easily order sim builds, runs, and/or analyses, to suit their specific project constraints. If not specified, all sims, runs, and analyses, have a `phase` value of `0` by default. Consider this example `yaml` file with three sims:
+
+```yaml
+SIM_car:
+ path: sims/SIM_car
+
+SIM_monte:
+ path: sims/SIM_monte
+ runs:
+ RUN_nominal/input.py --monte-carlo: # Generates the runs below
+ phase: -1
+ MONTE_RUN_nominal/RUN_000/monte_input.py: # Generated run
+ MONTE_RUN_nominal/RUN_001/monte_input.py: # Generated run
+ MONTE_RUN_nominal/RUN_002/monte_input.py: # Generated run
+ MONTE_RUN_nominal/RUN_003/monte_input.py: # Generated run
+ MONTE_RUN_nominal/RUN_004/monte_input.py: # Generated run
+
+# A sim with constraints that make the build finnicky, and we can't change the code
+SIM_external:
+ path: sims/SIM_external
+ phase: -1
+ runs:
+ RUN_test/input.py:
+ returns: 0
+```
+Here we have three sims: `SIM_car`, `SIM_monte`, and `SIM_external`. `SIM_car` and `SIM_monte` have the default `phase` of `0` and `SIM_external` has been assigned `phase: -1` explicitly. If using non-zero phases, jobs can be optionally filtered by them when calling helper functions like `self.get_jobs(kind, phase)`. Some examples:
+```python
+ build_jobs = self.get_jobs(kind='build') # Get all build jobs regardless of phase
+ build_jobs = self.get_jobs(kind='build', phase=0) # Get all build jobs with (default) phase 0
+ build_jobs = self.get_jobs(kind='build', phase=-1) # Get all build jobs with phase -1
+ build_jobs = self.get_jobs(kind='build', phase=[0, 1, 3]) # Get all build jobs with phase 0, 1, or 3
+ build_jobs = self.get_jobs(kind='build', phase=range(-10,11)) # Get all build jobs with phases between -10 and 10
+```
+This can be done for runs and analyses in the same manner:
+```python
+ run_jobs = self.get_jobs(kind='run') # Get all run jobs regardless of phase
+ run_jobs = self.get_jobs(kind='run', phase=0) # Get all run jobs with (default) phase 0
+ # Get all run jobs with all phases less than zero
+ run_jobs = self.get_jobs(kind='run', phase=range(TrickWorkflow.allowed_phase_range['min'],0))
+ # Get all analysis jobs with all phases zero or greater
+ an_jobs = self.get_jobs(kind='analysis', phase=range(0, TrickWorkflow.allowed_phase_range['max'+1]))
+```
+Note that since analysis jobs are directly tied to a single named run, they inherit the `phase` value of their run as specfied in the `yaml` file. In other words, do not add a `phase:` section indented under any `analyze:` section in your `yaml` file.
+
+It's worth emphasizing that the specfiication of a non-zero `phase` in the `yaml` file, by itself, does not affect the order in which actions are taken. **It is on the user of TrickOps to use this information to order jobs appropriately**. Here's an example in code of what that might look for the example use-case described by the `yaml` file in this section:
+
+```python
+ first_build_jobs = self.get_jobs(kind='build', phase=-1) # Get all build jobs with phase -1 (SIM_external)
+ second_build_jobs = self.get_jobs(kind='build', phase=0) # Get all build jobs with phase 0 (SIM_car & SIM_monte)
+ first_run_jobs = self.get_jobs(kind='run', phase=-1) # Get all run jobs with phase -1 (RUN_nominal/input.py --monte-carlo)
+ second_run_jobs = self.get_jobs(kind='run', phase=0) # Get all run jobs with phase 0 (All generated runs & RUN_test/input.py)
+
+ # SIM_external must build before SIM_car and SIM_monte, for project-specific reasons
+ builds_status1 = self.execute_jobs(first_build_jobs, max_concurrent=3, header='Executing 1st phase sim builds.')
+ # SIM_car and SIM_monte can build at the same time with no issue
+ builds_status2 = self.execute_jobs(second_build_jobs, max_concurrent=3, header='Executing 2nd phase sim builds.')
+ # SIM_monte's 'RUN_nominal/input.py --monte-carlo' generates runs
+ runs_status1 = self.execute_jobs(first_run_jobs, max_concurrent=3, header='Executing 1st phase sim runs.')
+ # SIM_monte's 'MONTE_RUN_nominal/RUN*/monte_input.py' are the generated runs, they must execute after the generation is complete
+ runs_status2 = self.execute_jobs(second_run_jobs, max_concurrent=3, header='Executing 2nd phase sim runs.')
+```
+Astute observers may have noticed that `SIM_external`'s `RUN_test/input.py` technically has no order dependencies and could execute in either the first or second run job set without issue.
+
+A couple important points on the motivation for this capability:
+* Run phasing was primarly developed to support testing monte-carlo and checkpoint sim scenarios, where output from a set of scenarios (like generated runs or dumped checkpoints) becomes the input to another set of sim scenarios.
+* Sim phasing exists primarly to support testing scenarios where sims are poorly architectured or immutable, making them unable to be built independently.
+
+
## Where does the output of my tests go?
All output goes to a single directory `log_dir`, which is a required input to the `TrickWorkflow.__init__()` function. Sim builds, runs, comparisons, koviz reports etc. are all put in a single directory with unique names. This is purposeful for two reasons:
@@ -284,11 +383,48 @@ This is purposeful -- handling every project-specific constraint is impossible.
* If your project requires an environment, it's usually a good idea to track a source-able environment file that users can execute in their shell. For example, if `myproject/.bashrc` contains your project environment, you should add `source .bashrc ;` to the `env:` section of `globals` in your YAML config file. This tells `TrickWorkflow` to add `source .bashrc ; ` before every `Job()`'s `command`.
* Make sure you execute your tests in an order that makes sense logically. The TrickOps framework will not automatically execute a sim build before a sim run for example, it's on the user to define the order in which tests run and which tests are important to them.
* Be cognizant of how many CPUs you've passed into `TricKWorkflow.__init__` and how many sims you build at once. Each sim build will use the `cpus` given to `TrickWorkflow.__init__`, so if you are building 3 sims at once each with 3 cpus you're technically requesting 9 cpus worth of build, so to speak.
-* If `TrickWorkflow` encounters non-fatal errors while validating the content of the given YAML config file, it will set the internal member `self.config_erros` to be `True`. If you want your script to return non-zero on any non-fatal error, add this return code to your final script `sys.exit()`.
+* If `TrickWorkflow` encounters non-fatal errors while verifying the content of the given YAML config file, it will add those errors to the internal `self.config_errors` list of strings. If you want your script to return non-zero on any non-fatal error, include `self.config_errors` in the criteria used for `sys.exit()`. Similar recommendation for `self.parsing_errors` which contains all errors found while parsing the YAML file.
* Treat the YAML file like your project owns it. You can store project-specific information and retrieve that information in your scripts by accessing the `self.config` dictionary. Anything not recognized by the internal validation of the YAML file is ignored, but that information is still provided to the user. For example, if you wanted to store a list of POCS in your YAML file so that your script could print a helpful message on error, simply add a new entry `project_pocs: email1, email2...` and then access that information via `self.config['project_pocs']` in your script.
+## `MonteCarloGenerationHelper` - TrickOps Helper Class for `MonteCarloGenerate.sm` users
+
+TrickOps provides the `MonteCarloGenerationHelper` python module as an interface between a sim using the `MonteCarloGenerate.sm` (MCG) sim module and a typical Trick-based workflow. This module allows MCG users to easily generate monte-carlo runs and execute them locally or alternatively through an HPC job scheduler like SLURM. Below is an example usage of the module. This example assumes:
+1. The using script inherits from or otherwise leverages `TrickWorkflow`, giving it access to `self.execute_jobs()`
+2. `SIM_A` is already built and configured with the `MonteCarloGenerate.sm` sim module
+3. `RUN_mc/input.py` is configured with to generate runs when executed, specifically that `monte_carlo.mc_master.generate_dispersions == monte_carlo.mc_master.active == True` in the input file.
+
+```python
+# Instantiate an MCG helper instance, providing the sim and input file for generation
+mgh = MonteCarloGenerationHelper(sim_path="path/to/SIM_A", input_path="RUN_mc/input.py")
+# Get the generation SingleRun() instance
+gj = mgh.get_generation_job()
+# Execute the generation Job to generate RUNS
+ret = self.execute_jobs([gj])
+
+if ret == 0: # Successful generation
+ # Get a SLURM sbatch array job for all generated runs found in monte_dir
+ # SLURM is an HPC (High-Performance-Computing) scheduling tool installed on
+ # many modern super-compute clusters that manages execution of a massive
+ # number of jobs. See the official documentation for more information
+ # Slurm: https://slurm.schedmd.com/documentation.html
+ sbj = mgh.get_sbatch_job(monte_dir="path/to/MONTE_RUN_mc")
+ # Execute the sbatch job, which queues all runs in SLURM for execution
+ # Use hpc_passthrough_args ='--wait' to block until all runs complete
+ ret = self.execute_jobs([sbj])
+
+ # Instead of using SLURM, generated runs can be executed locally through
+ # TrickOps calls on the host where this script runs. First get a list of
+ # run jobs
+ run_jobs = mgh.get_generated_run_jobs(monte_dir="path/to/MONTE_RUN_mc")
+ # Then execute all generated SingleRun instances, up to 10 at once
+ ret = self.execute_jobs(run_jobs, max_concurrent=10)
+```
+
+Note that the number of runs to-be-generated is configured somewhere in the `input.py` code and this module cannot robustly know that information for any particular use-case. This is why `monte_dir` is a required input to several functions - this directory is processed by the module to understand how many runs were generated.
+
## More Information
-A lot of time was spent adding `python` docstrings to the `TrickWorkflow.py` and `WorkflowCommon.py` modules. This README does not cover all functionality, so please see the in-code documentation for more detailed information on the framework.
+A lot of time was spent adding `python` docstrings to the modules in the `trickops/` directory and tests under the `trickops/tests/`. This README does not cover all functionality, so please see the in-code documentation and unit tests for more detailed information on the framework capabilities.
+[Continue to Software Requirements](../software_requirements_specification/SRS)
diff --git a/docs/documentation/miscellaneous_trick_tools/trickops_example.png b/docs/documentation/miscellaneous_trick_tools/images/trickops_example.png
similarity index 100%
rename from docs/documentation/miscellaneous_trick_tools/trickops_example.png
rename to docs/documentation/miscellaneous_trick_tools/images/trickops_example.png
diff --git a/docs/documentation/running_a_simulation/Input-File.md b/docs/documentation/running_a_simulation/Input-File.md
index 577e2bfc..68cfd5b4 100644
--- a/docs/documentation/running_a_simulation/Input-File.md
+++ b/docs/documentation/running_a_simulation/Input-File.md
@@ -1,3 +1,5 @@
+| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Running a Simulation](Running-a-Simulation) → Input File |
+|------------------------------------------------------------------|
The primary interface between the simulation executable and the user is the runstream
input file. The Trick simulation input file syntax is Python. All Python syntax rules
@@ -253,7 +255,7 @@ There are several ways to include files in Python.
```python
# One way is to use the execfile command
-execfile("Modified_data/data_record.py")
+exec(open("Modified_data/data_record.py").read())
# Another way is to make the included file a module and import it.
# Import search paths may be added using the sys.path.append command.
@@ -447,6 +449,9 @@ For information on how Trick processes events during runtime, see [Event Process
# Add the event to the input processor's list of events (it will be processed at top of frame before scheduled jobs)
trick.add_event()
+
+# Tell trick whether to terminate the sim if an error occurs while parsing Python code. Defaults to False
+trick.terminate_on_event_parse_error()
```
#### Advanced Event (Malfunction) Usage
diff --git a/docs/documentation/running_a_simulation/Running-a-Simulation.md b/docs/documentation/running_a_simulation/Running-a-Simulation.md
index 619c28c2..7baaef8e 100644
--- a/docs/documentation/running_a_simulation/Running-a-Simulation.md
+++ b/docs/documentation/running_a_simulation/Running-a-Simulation.md
@@ -1,3 +1,6 @@
+| [Home](/trick) → [Documentation Home](../Documentation-Home) → Running a Simulation |
+|------------------------------------------------------------------|
+
S_main_${TRICK_HOST_CPU}.exe is generated by the CP and is the simulation main executable program.
The runtime configuration of the executive and its associated support utilities may be manipulated through entries in the simulation input file. The input file is described in detail in Input_File.
@@ -9,6 +12,7 @@ S_main_${TRICK_HOST_CPU}.exe [trick_version] [sie]
RUN_/ [-d]
[-O ]
[-OO ]
+ [--read-only-sim]
[-u ]
```
@@ -18,6 +22,7 @@ S_main_${TRICK_HOST_CPU}.exe [trick_version] [sie]
- The '-d' argument is optional and, if specified, starts the simulation in an input file verification mode. In this mode the entire input file is read, echoed to standard out, and then the simulation exits without calling any jobs listed in the S_define file. This mode helps debug input file syntax errors.
- The '-O ' option allows the user to specify the directory to which simulation data log files will be written. If this option is omitted, the RUN_ directory is used.
- The '-OO ' option allows the user to specify the directory to which ALL simulation output files will be written. If this option is omitted, the RUN_ directory is used.
+- The '--read-only-sim' flag can be used to redirect all files written at simulation runtime into the output directory.
- The '-u' option specifies that all remaining arguments are meant to be used by user supplied jobs. All arguments after the -u can be accessed internal to the simulation jobs by calling the get_cmnd_args() function of the executive as illustrated below. In a master/slave simulation, the master's -u args will be passed to the slave.
The following code example shows how a function can access the command line arguments during execution.
diff --git a/docs/documentation/running_a_simulation/Runtime-Output.md b/docs/documentation/running_a_simulation/Runtime-Output.md
index 229c771e..3910302b 100644
--- a/docs/documentation/running_a_simulation/Runtime-Output.md
+++ b/docs/documentation/running_a_simulation/Runtime-Output.md
@@ -1,3 +1,6 @@
+| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Running a Simulation](Running-a-Simulation) → Runtime Output|
+|------------------------------------------------------------------|
+
Executing the simulation main executable S_main_${TRICK_HOST_CPU}.exe generates a handful of log files that document a simulation run.
The log files are written to the RUN_ directory by default. The destination can be redirected by specifying the -O or -OO option for the runtime executive. Two of the log files are described below.
diff --git a/docs/documentation/running_a_simulation/runtime_guis/MalfunctionsTrickView.md b/docs/documentation/running_a_simulation/runtime_guis/MalfunctionsTrickView.md
index a834662d..8d0ed569 100644
--- a/docs/documentation/running_a_simulation/runtime_guis/MalfunctionsTrickView.md
+++ b/docs/documentation/running_a_simulation/runtime_guis/MalfunctionsTrickView.md
@@ -1,3 +1,6 @@
+| [Home](/trick) → [Documentation Home](../../Documentation-Home) → [Running a Simulation](../Running-a-Simulation) → [Runtime GUIs](Runtime-GUIs) → Malfunctions |
+|------------------------------------------------------------------|
+
### Events/Malfunctions Trick View
Events/Malfunctions Trick View (hereafter referred to as MTV) is a graphical user interface that has two main functions:
diff --git a/docs/documentation/running_a_simulation/runtime_guis/MonteMonitor.md b/docs/documentation/running_a_simulation/runtime_guis/MonteMonitor.md
index 1293bba7..9b46cdae 100644
--- a/docs/documentation/running_a_simulation/runtime_guis/MonteMonitor.md
+++ b/docs/documentation/running_a_simulation/runtime_guis/MonteMonitor.md
@@ -1,3 +1,6 @@
+| [Home](/trick) → [Documentation Home](../../Documentation-Home) → [Running a Simulation](../Running-a-Simulation) → [Runtime GUIs](Runtime-GUIs) → Monte Monitor |
+|------------------------------------------------------------------|
+
### Monte Monitor
Monte Monitor (hereafter referred to as MM) is a graphical user interface that allows users to view and modify the states
diff --git a/docs/documentation/running_a_simulation/runtime_guis/Runtime-GUIs.md b/docs/documentation/running_a_simulation/runtime_guis/Runtime-GUIs.md
index 2e5a38fa..880dfcf4 100644
--- a/docs/documentation/running_a_simulation/runtime_guis/Runtime-GUIs.md
+++ b/docs/documentation/running_a_simulation/runtime_guis/Runtime-GUIs.md
@@ -1,3 +1,6 @@
+| [Home](/trick) → [Documentation Home](../../Documentation-Home) → [Running a Simulation](../Running-a-Simulation) → Runtime GUIs |
+|------------------------------------------------------------------|
+
Trick provides the following graphical user interfaces:
### Simulation Control Panel
diff --git a/docs/documentation/running_a_simulation/runtime_guis/TrickView.md b/docs/documentation/running_a_simulation/runtime_guis/TrickView.md
index 0d2aae70..df6e2d7a 100644
--- a/docs/documentation/running_a_simulation/runtime_guis/TrickView.md
+++ b/docs/documentation/running_a_simulation/runtime_guis/TrickView.md
@@ -1,3 +1,6 @@
+| [Home](/trick) → [Documentation Home](../../Documentation-Home) → [Running a Simulation](../Running-a-Simulation) → [Runtime GUIs](Runtime-GUIs) → Trick View |
+|------------------------------------------------------------------|
+
Trick View (hereafter referred to as TV) is a graphical user interface that allows users to view and modify Trick-managed variables in a simulation while it is running. It also provides for the launching of integrated strip charts and can save and restore lists of variables and their associated strip charts.
#### Launching
diff --git a/docs/documentation/simulation_capabilities/Checkpoints.md b/docs/documentation/simulation_capabilities/Checkpoints.md
index d1eb6f20..0f9aedb3 100644
--- a/docs/documentation/simulation_capabilities/Checkpoints.md
+++ b/docs/documentation/simulation_capabilities/Checkpoints.md
@@ -1,3 +1,6 @@
+| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Simulation Capabilities](Simulation-Capabilities) → Checkpoints |
+|------------------------------------------------------------------|
+
The Trick CheckPointWriter is a C++ Class that implements checkpointing.
## Checkpointing
@@ -20,6 +23,12 @@ trick.checkpoint_cpu()
trick.checkpoint_safestore_set_enabled(True|False)
# Set the safestore checkpoint period. default 9x10e18
trick.checkpoint_safestore()
+
+# Load a checkpoint
+trick.load_checkpoint()
+# Load a checkpoint without restoring STLs
+trick.load_checkpoint(, False)
+
```
[Continue to Memory Manager](memory_manager/MemoryManager)
diff --git a/docs/documentation/simulation_capabilities/Command-Line-Arguments.md b/docs/documentation/simulation_capabilities/Command-Line-Arguments.md
index ddf99bb1..06f33f08 100644
--- a/docs/documentation/simulation_capabilities/Command-Line-Arguments.md
+++ b/docs/documentation/simulation_capabilities/Command-Line-Arguments.md
@@ -1,3 +1,6 @@
+| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Simulation Capabilities](Simulation-Capabilities) → Command Line Arguments |
+|------------------------------------------------------------------|
+
The Trick::CommandLineArguments class stores the command line arguments specified
by the user when starting the simulation. The class provides routines to
diff --git a/docs/documentation/simulation_capabilities/Data-Record.md b/docs/documentation/simulation_capabilities/Data-Record.md
index df0a6fc8..f742acbd 100644
--- a/docs/documentation/simulation_capabilities/Data-Record.md
+++ b/docs/documentation/simulation_capabilities/Data-Record.md
@@ -1,3 +1,5 @@
+| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Simulation Capabilities](Simulation-Capabilities) → Data Record |
+|------------------------------------------------------------------|
Data Recording provides the capability to specify any number of data recording groups,
each with an unlimited number of parameter references, and with each group recording
@@ -43,6 +45,7 @@ For example:
drg.add_variable("ball.obj.state.output.position[0]")
drg.add_variable("ball.obj.state.output.position[1]")
```
+In this example `position` is an array of floating point numbers. **DO NOT ATTEMPT TO DATA RECORD C OR C++ STRINGS. THIS HAS BEEN OBSERVED TO CREATE MEMORY ISSUES AND TRICK DOES NOT CURRENTLY PROVIDE ERROR CHECKING FOR THIS UNSUPPORTED USE CASE**
An optional alias may also be specified in the method as drg.add_variable("" [, ""]).
If an alias is present as a second argument, the alias name will be used in the data recording file instead of the actual variable name.
@@ -53,6 +56,8 @@ drg.add_variable("ball.obj.state.output.position[0]", "x_pos")
drg.add_variable("ball.obj.state.output.position[1]", "y_pos")
```
+Only individual primitive types can be recorded. Arrays, strings/char *, structured objects, or STL types are not supported.
+
### Changing the Recording Rate
To change the recording rate call the set_cycle() method of the recording group.
@@ -380,7 +385,7 @@ The following data-types are used in Trick versions >= 10, that is for, *vv* = "
### DRHDF5 Recording Format
HDF5 recording format is an industry conforming HDF5 formatted file. Files written in this format are named
-log_.hd5. The contents of this file type are readable by the Trick Data Products packages from
+log_.h5. The contents of this file type are readable by the Trick Data Products packages from
Trick 07 to the current version. The contents of the file are binary and is not included here. The HDF5 layout
of the file follows.
@@ -415,4 +420,16 @@ GROUP "/" {
}
```
+
+### Interaction with Checkpoints
+
+Data recording groups are able to be checkpointed, reloaded, and restarted without any interaction by the user. When a checkpoint is loaded that includes data recording,
+the data recording groups will be initiated and begin recording at the time in the checkpoint. For example, if a checkpoint was dumped when t=5, when the checkpoint is
+loaded into another run, it will data record starting at t=5, no matter what time in the run it was loaded or whether the run was already data recording. Loading a checkpoint
+will overwrite any data recording files that were being recorded before the load.
+
+Loading a checkpoint with different data recording groups than the current run will overwrite the current data recording groups.
+
+Refer to test/SIM_checkpoint_data_recording to see expected behavior in action. Overall, the loading a checkpoint should completely overwrite any other data recording the sim is currently doing, and the new recording will start at the time in the checkpoint. If you come across different behavior, please open an issue.
+
[Continue to Checkpointing](Checkpoints)
diff --git a/docs/documentation/simulation_capabilities/Debug-Pause.md b/docs/documentation/simulation_capabilities/Debug-Pause.md
index 10fc3624..e8984587 100644
--- a/docs/documentation/simulation_capabilities/Debug-Pause.md
+++ b/docs/documentation/simulation_capabilities/Debug-Pause.md
@@ -1,3 +1,5 @@
+| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Simulation Capabilities](Simulation-Capabilities) → Debug Pause |
+|------------------------------------------------------------------|
Debug Pause is a debugging feature provided by Trick. When turned on, Debug Pause will print the current simulation time and
the name of the current job, and pause the simulation @e before the job is executed. Debug Pause provides a way for the user to step
diff --git a/docs/documentation/simulation_capabilities/Echo-Jobs.md b/docs/documentation/simulation_capabilities/Echo-Jobs.md
index a2bdce00..0f39b37e 100644
--- a/docs/documentation/simulation_capabilities/Echo-Jobs.md
+++ b/docs/documentation/simulation_capabilities/Echo-Jobs.md
@@ -1,3 +1,5 @@
+| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Simulation Capabilities](Simulation-Capabilities) → Echo Jobs |
+|------------------------------------------------------------------|
Echo Jobs is a handy debugging toggle provided by Trick. When turned on, Echo Jobs will print the current simulation time and
the name of the current job being executed. Echo Jobs is a convenient way to see the order of job execution and narrow down when
diff --git a/docs/documentation/simulation_capabilities/Environment.md b/docs/documentation/simulation_capabilities/Environment.md
index 9eecc030..f29aab0a 100644
--- a/docs/documentation/simulation_capabilities/Environment.md
+++ b/docs/documentation/simulation_capabilities/Environment.md
@@ -1,3 +1,5 @@
+| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Simulation Capabilities](Simulation-Capabilities) → Environment |
+|------------------------------------------------------------------|
This class saves the Trick environment variables at compile-time. The variables
are saved inside the S_main executable. These variables are read-only after they
@@ -7,4 +9,4 @@ are compiled into the sim.
const char * get_trick_env( char * variable_name )
```
-[Continue to STL Checkpointing](STL-Checkpointing)
+[Continue to STL Checkpointing](STL-Capabilities)
diff --git a/docs/documentation/simulation_capabilities/Event-Manager.md b/docs/documentation/simulation_capabilities/Event-Manager.md
index 263b7448..7d317b89 100644
--- a/docs/documentation/simulation_capabilities/Event-Manager.md
+++ b/docs/documentation/simulation_capabilities/Event-Manager.md
@@ -1,3 +1,5 @@
+| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Simulation Capabilities](Simulation-Capabilities) → Event Manager |
+|------------------------------------------------------------------|
This page describes the methods available in the Trick::EventManager and Trick::EventProcessor class.
See [Input_File](/trick/documentation/running_a_simulation/Input-File) for detailed information on the syntax of the input processor file.
diff --git a/docs/documentation/simulation_capabilities/Executive-Scheduler.md b/docs/documentation/simulation_capabilities/Executive-Scheduler.md
index 5c8a2b8f..48c07af1 100644
--- a/docs/documentation/simulation_capabilities/Executive-Scheduler.md
+++ b/docs/documentation/simulation_capabilities/Executive-Scheduler.md
@@ -1,3 +1,5 @@
+| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Simulation Capabilities](Simulation-Capabilities) → Executive Scheduler |
+|------------------------------------------------------------------|
This scheduler or derivative of this class is required for Trick simulations to run.
@@ -203,10 +205,26 @@ If there is a job tag specified for one of more jobs in the S_define file, you c
```
# Python code
-trick.exec_set_sim_object_onoff(char * job_name , int on) ;
+trick.exec_set_sim_object_onoff(char * sim_object_name , int on) ;
```
-The exec_set_sim_object_onoff routine allows users to turn individual whole sim_objects on and off.
+The exec_set_sim_object_onoff routine allows users to turn individual whole sim_objects on and off. If individiual jobs were disabled before the sim object is disabled, they will retain their disabled status when the sim object is turned back on.
+
+```
+# Python code
+trick.exec_get_sim_object_onoff(char * sim_object_name) ;
+```
+
+The exec_get_sim_object_onoff routine allows users to determine if the sim_object is currently on or off.
+
+
+```
+# Python code
+trick.exec_set_sim_object_jobs_onoff(char * sim_object_name , int on) ;
+```
+
+The exec_set_sim_object_jobs_onoff allows users to turn all of the jobs in a sim_object on or off, but does not change the overall sim object's disabled status.
+
#### Job Cycle Time
diff --git a/docs/documentation/simulation_capabilities/Frame-Logging.md b/docs/documentation/simulation_capabilities/Frame-Logging.md
index 537e1e73..4f388baa 100644
--- a/docs/documentation/simulation_capabilities/Frame-Logging.md
+++ b/docs/documentation/simulation_capabilities/Frame-Logging.md
@@ -1,3 +1,5 @@
+| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Simulation Capabilities](Simulation-Capabilities) → Frame Logging |
+|------------------------------------------------------------------|
Trick provides a means to gather simulation performance data and view it using Data Products (see [Data Products](Data-Products)).
When the user turns on the Frame Logging feature, Trick will use its Data Recording mechanism to track the following:
diff --git a/docs/documentation/simulation_capabilities/Input-Processor.md b/docs/documentation/simulation_capabilities/Input-Processor.md
index d0ba447f..f0e011b9 100644
--- a/docs/documentation/simulation_capabilities/Input-Processor.md
+++ b/docs/documentation/simulation_capabilities/Input-Processor.md
@@ -1,3 +1,5 @@
+| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Simulation Capabilities](Simulation-Capabilities) → Input Processor |
+|------------------------------------------------------------------|
This page describes the methods available in the Trick::InputProcessor class.
See [Input File](../running_a_simulation/Input-File) for detailed information on the syntax of the input processor file.
diff --git a/docs/documentation/simulation_capabilities/Integrator.md b/docs/documentation/simulation_capabilities/Integrator.md
index 56382dd2..9b941325 100644
--- a/docs/documentation/simulation_capabilities/Integrator.md
+++ b/docs/documentation/simulation_capabilities/Integrator.md
@@ -1,3 +1,5 @@
+| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Simulation Capabilities](Simulation-Capabilities) → Integrator |
+|------------------------------------------------------------------|
Trick provides a state integration capability described by the inputs below.
To use these options a developer must develop application code which interfaces the application states with
diff --git a/docs/documentation/simulation_capabilities/JIT-Input-Processor.md b/docs/documentation/simulation_capabilities/JIT-Input-Processor.md
index eb4b91e8..b8777385 100644
--- a/docs/documentation/simulation_capabilities/JIT-Input-Processor.md
+++ b/docs/documentation/simulation_capabilities/JIT-Input-Processor.md
@@ -1,3 +1,6 @@
+| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Simulation Capabilities](Simulation-Capabilities) → JIT Input Processor |
+|------------------------------------------------------------------|
+
A JIT input file is a C++ input file that can be used along side a python input file, or even replace the python input file. The JIT input file includes "S_source.hh" that gives it access to the entire simulation. The code in a JIT input file is compiled into a shared library during simulation initialization. The simulation dynamically opens the shared library and runs a specific function called "run_me" that must be defined in the JIT input file. There are a couple of advantages to this type of input file.
1. Once compiled, a JIT input file is orders of magnitude faster to execute than a python equivalent. That is because there is no python is involved, everything is C++.
diff --git a/docs/documentation/simulation_capabilities/Master-Slave.md b/docs/documentation/simulation_capabilities/Master-Slave.md
index 2332fb70..1e798b06 100644
--- a/docs/documentation/simulation_capabilities/Master-Slave.md
+++ b/docs/documentation/simulation_capabilities/Master-Slave.md
@@ -1,3 +1,5 @@
+| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Simulation Capabilities](Simulation-Capabilities) → Master/Slave |
+|------------------------------------------------------------------|
Master/Slave is a way to do distributed processing in Trick using multiple simulations.
Master/Slave synchronization synchronizes a master simulation to one or more slave
diff --git a/docs/documentation/simulation_capabilities/Realtime-Clock.md b/docs/documentation/simulation_capabilities/Realtime-Clock.md
index 95064820..4f0571c0 100644
--- a/docs/documentation/simulation_capabilities/Realtime-Clock.md
+++ b/docs/documentation/simulation_capabilities/Realtime-Clock.md
@@ -1,3 +1,6 @@
+| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Simulation Capabilities](Simulation-Capabilities) → Realtime Clock |
+|------------------------------------------------------------------|
+
# Realtime-Clock
**Contents**
@@ -194,6 +197,6 @@ double exec_get_sim_time(void) ;
defined in ```exec_proto.h```.
-
+Continue to [Realtime Timer](Realtime-Timer)
\ No newline at end of file
diff --git a/docs/documentation/simulation_capabilities/Realtime-Injector.md b/docs/documentation/simulation_capabilities/Realtime-Injector.md
index e18db2a3..eb6f06ec 100644
--- a/docs/documentation/simulation_capabilities/Realtime-Injector.md
+++ b/docs/documentation/simulation_capabilities/Realtime-Injector.md
@@ -1,3 +1,5 @@
+| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Simulation Capabilities](Simulation-Capabilities) → Realtime Injector |
+|------------------------------------------------------------------|
The Real Time Injector (RTI) allows the user to set simulation variables
synchronously without impacting real-time performance. The RTI performs the injection
diff --git a/docs/documentation/simulation_capabilities/Realtime-Timer.md b/docs/documentation/simulation_capabilities/Realtime-Timer.md
index a2e09682..6ecdf360 100644
--- a/docs/documentation/simulation_capabilities/Realtime-Timer.md
+++ b/docs/documentation/simulation_capabilities/Realtime-Timer.md
@@ -1,3 +1,5 @@
+| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Simulation Capabilities](Simulation-Capabilities) → Realtime Timer |
+|------------------------------------------------------------------|
A realtime sleep timer is an optional class for Trick simulations.
diff --git a/docs/documentation/simulation_capabilities/Realtime.md b/docs/documentation/simulation_capabilities/Realtime.md
index 3bd32c20..59bc4d11 100644
--- a/docs/documentation/simulation_capabilities/Realtime.md
+++ b/docs/documentation/simulation_capabilities/Realtime.md
@@ -1,3 +1,5 @@
+| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Simulation Capabilities](Simulation-Capabilities) → Realtime |
+|------------------------------------------------------------------|
Trick provides a real-time processing capability which is different from many real-time
simulation capabilities. The Trick executive is a "time based" executive and can run in
diff --git a/docs/documentation/simulation_capabilities/STL-Checkpointing.md b/docs/documentation/simulation_capabilities/STL-Checkpointing.md
deleted file mode 100644
index 606c896d..00000000
--- a/docs/documentation/simulation_capabilities/STL-Checkpointing.md
+++ /dev/null
@@ -1,5 +0,0 @@
-
-Trick checkpoints the following STL types: array, vector, list, deque, set, multiset map, multimap, stack, queue, priority_queue, pair.
-
-
-[Continue to Threads](Threads)
diff --git a/docs/documentation/simulation_capabilities/STL-capabilities.md b/docs/documentation/simulation_capabilities/STL-capabilities.md
new file mode 100644
index 00000000..d8737a93
--- /dev/null
+++ b/docs/documentation/simulation_capabilities/STL-capabilities.md
@@ -0,0 +1,113 @@
+| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Simulation Capabilities](Simulation-Capabilities) → Using STLs in Trick Sims |
+|------------------------------------------------------------------|
+
+# Standard Template Libraries (STL) in Trick
+
+STLs may be used in models. However, STL variables (currently) are not data recordable, visible in the variable server, nor directly accessible in the input file. Some STLs can be checkpointed: array, vector, list, deque, set, multiset, map, multimap, stack, queue, priority_queue, pair.
+
+STL classes cannot be directly registered with the memory manager, but they can be processed by the checkpoint agent when nested inside normal C++ classes (including sim objects).
+
+STL checkpoint restore may slow down the default data jobs of some sims. STL restore is on by default. To turn off STL restore:
+
+If using memory manager through the C interface:
+```
+int TMM_set_stl_restore (int on_off);
+```
+
+If using the memory manager through the C++ interface, set the default or pass a parameter to your read_checkpoint function of choice:
+```
+int set_restore_stls_default (bool on);
+int read_checkpoint( std::istream* in_s, bool do_restore_stls = restore_stls_default);
+int read_checkpoint_from_string( const char* s, bool do_restore_stls = restore_stls_default );
+int init_from_checkpoint( std::istream* in_s, bool do_restore_stls = restore_stls_default);
+```
+
+If using the checkpoint restart C interface:
+```
+int load_checkpoint_stls( const char * file_name, int with_stls ) ;
+```
+
+
+
+## What works:
+
+To checkpoint an STL, it **must** be a member of a class or struct.
+```
+class AnyClass {
+ std::vector vec;
+}
+```
+Declare an instance of this class with the memory manager in the usual way:
+```
+AnyClass * my_class = tmm->declare_var("AnyClass my_alloc");
+```
+
+If it is in a class that is nested in a `sim_object`, it will be registered with the memory manager automatically.
+
+You can nest an arbitrary amount of STLs, they will all be checkpointed as long as
+the base is a member of a class that is registered with the memory manager. There
+are a some known [**limitations**](#limitations).
+
+```
+class AnyClass {
+ std::pair>
+}
+```
+
+
+
+## Limitations
+
+The STL checkpointing feature can only handle simple types, pointers, and nested STL types.
+
+### An STL type within a user defined type within an STL will fail to checkpoint.
+
+For example: a user defined class with an STL in it:
+```
+class VectorWrapper {
+ int a;
+ std::vector vec;
+}
+```
+
+An outer class (which is registered with the memory manager, like a member of a sim_object or something that has been explicitly declared) that has an STL container of these objects:
+```
+class MyObject {
+ std::vector vec_user_defined;
+}
+```
+
+If MyObject is populated, it will be able to checkpoint and restore without throwing an error, and all the `VectorWrapper` objects will be present, but `vec` will not be restored (`a` will restore successfully). The contents of `vec` are never written out to the checkpoint file.
+
+
+If `MyObject` instead has a vector of pointers to `VectorWrapper`, and each `VectorWrapper` is registered with the memory manager, `vec` will checkpoint and restore successfully.
+```
+class MyObject {
+ std::vector vec_user_defined_ptr;
+}
+```
+
+### You cannot directly create or register an external stl with the memory manager, you will get a parser error.
+
+STLs can't register it with the memory manager, so there's no way for the checkpoint to know where the memory is.
+
+```
+class AnyClass {
+ std::vector *anything;
+}
+
+class AnyClass {
+ std::pair[5];
+}
+
+
+memorymanager->declare_var("std::vector my_vector_allocation");
+
+std::vector my_vector;
+memorymanager->declare_var_extern(&my_vector, "std::vector my_vector_allocation");
+
+```
+
+
+
+[Continue to Threads](Threads)
diff --git a/docs/documentation/simulation_capabilities/Simulation-Capabilities.md b/docs/documentation/simulation_capabilities/Simulation-Capabilities.md
index 8f4956b9..841c9f4f 100644
--- a/docs/documentation/simulation_capabilities/Simulation-Capabilities.md
+++ b/docs/documentation/simulation_capabilities/Simulation-Capabilities.md
@@ -1,4 +1,5 @@
-
+| [Home](/trick) → [Documentation Home](../Documentation-Home) → Simulation Capabilities |
+|------------------------------------------------------------------|
This section details the runtime capabilities of Trick.
diff --git a/docs/documentation/simulation_capabilities/Status-Message-System.md b/docs/documentation/simulation_capabilities/Status-Message-System.md
index 8b4b75d6..1f4b4fc9 100644
--- a/docs/documentation/simulation_capabilities/Status-Message-System.md
+++ b/docs/documentation/simulation_capabilities/Status-Message-System.md
@@ -1,3 +1,5 @@
+| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Simulation Capabilities](Simulation-Capabilities) → Status Message System |
+|------------------------------------------------------------------|
The Message Publisher publishes executive and/or model messages. A Message Subscriber gets the messages published by the Publisher.
diff --git a/docs/documentation/simulation_capabilities/Threads.md b/docs/documentation/simulation_capabilities/Threads.md
index ca2391c4..c032840b 100644
--- a/docs/documentation/simulation_capabilities/Threads.md
+++ b/docs/documentation/simulation_capabilities/Threads.md
@@ -1,3 +1,6 @@
+| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Simulation Capabilities](Simulation-Capabilities) → Threads |
+|------------------------------------------------------------------|
+
# The ThreadBase Class
A trick sim is a multi-threaded process, and all of the threads that are created by Trick or Trick generated code inherit from the abstract class ThreadBase. ThreadBase classes have the capability to change the priority and cpu affinity of the thread. ThreadBase classes include trick_sys threads as well as user defined threads from the S_define:
@@ -70,4 +73,5 @@ Set the priority for the thread. See the man page for sched(7) for more details.
```cpp
int set_priority(unsigned int req_priority)
```
-[Continue to Simulation Utilities](/trick/documentation/simulation_utilities/Simulation-Utilities)
+
+[Continue to Web Server](../web/Webserver)
diff --git a/docs/documentation/simulation_capabilities/UserGuide-Monte-Carlo.md b/docs/documentation/simulation_capabilities/UserGuide-Monte-Carlo.md
index 409b5a50..39e746e2 100644
--- a/docs/documentation/simulation_capabilities/UserGuide-Monte-Carlo.md
+++ b/docs/documentation/simulation_capabilities/UserGuide-Monte-Carlo.md
@@ -1,5 +1,5 @@
-| [Home](Home) → [Documentation Home](Documentation-Home) → Monte Carlo |
-|--------------------------------------------------------------------------------------|
+| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Simulation Capabilities](Simulation-Capabilities) → Monte Carlo |
+|------------------------------------------------------------------|
# Introduction
Monte Carlo is an advanced simulation capability provided by Trick that allows users to repeatedly run copies of a simulation with different input values. Users can vary the input space of a simulation via input file, random value generation, or by calculating values from previous Monte Carlo runs in a process called optimization.
diff --git a/docs/documentation/simulation_capabilities/Variable-Server.md b/docs/documentation/simulation_capabilities/Variable-Server.md
index ff8a1684..6dc5824b 100644
--- a/docs/documentation/simulation_capabilities/Variable-Server.md
+++ b/docs/documentation/simulation_capabilities/Variable-Server.md
@@ -1,3 +1,5 @@
+| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Simulation Capabilities](Simulation-Capabilities) → Variable Server |
+|------------------------------------------------------------------|
When running a Trick simulation, unless specifically turned off, a server called the
"variable server" is always up and listening in a separate thread of execution. The
@@ -61,6 +63,16 @@ trick.var_server_get_hostname()
trick.var_server_get_port()
```
+Additional TCP or UDP sockets can be opened as well. Additional TCP sockets operate the same way as the original variable server socket. A UDP socket will only host 1 variable server session, and the responses will be sent to the latest address that sends commands to it.
+
+Note that this is not necessary to allow multiple variable server clients - any number of clients can connect to the original variable server port.
+
+```python
+trick.var_server_create_udp_socket( const char * source_address, unsigned short port )
+trick.var_server_create_tcp_socket( const char * source_address, unsigned short port )
+```
+
+
### Commands
The variable server accepts commands in the form of strings. The variable server parses
@@ -135,10 +147,10 @@ The frame refers to the software frame in the Executive. In freeze mode a diffe
multiplier and offset are used.
```python
-trick.var_set_frame_multiplier(int mult)
+trick.var_set_frame_multiple(int mult)
trick.var_set_frame_offset(int offset)
-trick.var_set_freeze_frame_multiplier(int mult)
+trick.var_set_freeze_frame_multiple(int mult)
trick.var_set_freeze_frame_offset(int offset)
```
@@ -187,6 +199,22 @@ trick.var_send()
The var_send command forces the variable server to return the list of values to the
client immediately.
+#### Sending variables only once and immediately
+
+```python
+trick.var_send_once( string var_name)
+```
+
+The var_send_once command forces the variable server to return the value of the given
+variable to the client immediately.
+
+```python
+trick.var_send_once( string var_list, int num_vars)
+```
+
+var_send_once can also accept a comma separated list of variables. The number of variables
+in this list must match num_vars, or it will not be processed.
+
#### Changing the Units
```python
@@ -384,12 +412,17 @@ unprintable character) that occurs within the character string value will appear
escaped character, i.e. preceded by a backslash.
The 1st value returned in the list will always be a message indicator. The possible
-values of the message indicator are:
-- 0 returned variable value(s) from var_add or var_send
-- 1 returned value from var_exists
-- 2 returned value from send_sie_resource (special command used by Trick View)
-- 3 returned value from send_event_data (special command used by Events/Malfunctions Trick View) or var_send_list_size
-- 4 values redirected from stdio if var_set_send_stdio is enabled
+values of the message indicator listen in the table below.
+
+| Name | Value | Meaning |
+|-------------------|-------|---------|
+| VS\_IP\_ERROR | -1 | Protocol Error|
+| VS\_VAR\_LIST | 0 | A list of variable values. |
+| VS\_VAR\_EXISTS | 1 | Response to var\_exists( variable_name )|
+| VS\_SIE\_RESOURCE | 2 | Response to send_sie_resource|
+| VS\_LIST\_SIZE | 3 | Response to var_send_list_size or send_event_data|
+| VS\_STDIO | 4 | Values Redirected from stdio if var_set_send_stdio is enabled|
+| VS\_SEND\_ONCE | 5 | Response to var\_send\_once|
If the variable units are also specified along with the variable name in a var_add or
var_units command, then that variable will also have its units specification returned following
@@ -487,6 +520,8 @@ on your network sends it's information to this address and port so there may be
messages with variable server information available here. Here is some
C code that reads all messages on the variable server channel.
+Note that the multicast protocol is disabled by default in MacOS.
+
```c
#include
#include
diff --git a/docs/documentation/simulation_capabilities/memory_manager/MemoryManager-Declaration-String.md b/docs/documentation/simulation_capabilities/memory_manager/MemoryManager-Declaration-String.md
index 049f1e42..b122ad58 100644
--- a/docs/documentation/simulation_capabilities/memory_manager/MemoryManager-Declaration-String.md
+++ b/docs/documentation/simulation_capabilities/memory_manager/MemoryManager-Declaration-String.md
@@ -1,3 +1,7 @@
+| [Home](/trick) → [Documentation Home](../../Documentation-Home) → [Simulation Capabilities](../Simulation-Capabilities) → [Memory Manager](MemoryManager) → Declaration String|
+|------------------------------------------------------------------|
+
+
### Memory Manager Declaration
A declaration provides a data type description of a chunk of memory.
diff --git a/docs/documentation/simulation_capabilities/memory_manager/MemoryManager-TRICK_TYPE.md b/docs/documentation/simulation_capabilities/memory_manager/MemoryManager-TRICK_TYPE.md
index c052d5e6..43c83ccb 100644
--- a/docs/documentation/simulation_capabilities/memory_manager/MemoryManager-TRICK_TYPE.md
+++ b/docs/documentation/simulation_capabilities/memory_manager/MemoryManager-TRICK_TYPE.md
@@ -1,3 +1,5 @@
+| [Home](/trick) → [Documentation Home](../../Documentation-Home) → [Simulation Capabilities](../Simulation-Capabilities) → [Memory Manager](MemoryManager) → Trick Type|
+|------------------------------------------------------------------|
- **TRICK_TYPE** is an enmeration type that specifies data types.
Available types are provided in the following table.
diff --git a/docs/documentation/simulation_capabilities/memory_manager/MemoryManager.md b/docs/documentation/simulation_capabilities/memory_manager/MemoryManager.md
index 3ff0106f..7419ad72 100644
--- a/docs/documentation/simulation_capabilities/memory_manager/MemoryManager.md
+++ b/docs/documentation/simulation_capabilities/memory_manager/MemoryManager.md
@@ -1,3 +1,6 @@
+| [Home](/trick) → [Documentation Home](../../Documentation-Home) → [Simulation Capabilities](../Simulation-Capabilities) → Memory Manager |
+|------------------------------------------------------------------|
+
## Trick Memory Manager
The Memory Manager
diff --git a/docs/documentation/simulation_utilities/Math-Utilities.md b/docs/documentation/simulation_utilities/Math-Utilities.md
index b2a5855a..d794a179 100644
--- a/docs/documentation/simulation_utilities/Math-Utilities.md
+++ b/docs/documentation/simulation_utilities/Math-Utilities.md
@@ -1,3 +1,6 @@
+| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Simulation Utilities](Simulation-Utilities) → Math Utilities |
+|------------------------------------------------------------------|
+
To be added.
[Continue to Miscellaneous Trick Tools](../miscellaneous_trick_tools/Miscellaneous-Trick-Tools)
diff --git a/docs/documentation/simulation_utilities/Simulation-Utilities.md b/docs/documentation/simulation_utilities/Simulation-Utilities.md
index 020b2ed2..a1b72c08 100644
--- a/docs/documentation/simulation_utilities/Simulation-Utilities.md
+++ b/docs/documentation/simulation_utilities/Simulation-Utilities.md
@@ -1,3 +1,6 @@
+| [Home](/trick) → [Documentation Home](../Documentation-Home) → Simulation Utilities |
+|------------------------------------------------------------------|
+
This section details the simulation utilities of Trick. Simulation utilities provide a service to
user models. These included a socket communication library, Trickcomm, as well as math routines,
units conversion routines, and some abstract data types written in C.
diff --git a/docs/documentation/simulation_utilities/Trickcomm.md b/docs/documentation/simulation_utilities/Trickcomm.md
index 069a26f8..617b4c37 100644
--- a/docs/documentation/simulation_utilities/Trickcomm.md
+++ b/docs/documentation/simulation_utilities/Trickcomm.md
@@ -1,3 +1,5 @@
+| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Simulation Utilities](Simulation-Utilities) → TrickComm |
+|------------------------------------------------------------------|
To be added.
diff --git a/docs/documentation/web/Configure-Civetweb.md b/docs/documentation/web/Configure-Civetweb.md
new file mode 100644
index 00000000..19ddf882
--- /dev/null
+++ b/docs/documentation/web/Configure-Civetweb.md
@@ -0,0 +1,26 @@
+| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Web Server](Webserver) → Configuring Trick with Civetweb |
+|------------------------------------------------------------------|
+
+## Configuring Trick with Civetweb
+To configure Trick to support the civetweb web server, you'll need to
+
+1. Download or clone Civetweb release (currently v1.15) from [Github](https://github.com/civetweb/civetweb). Where you put the Civetweb directory will be designated as $(CIVETWEB_HOME).
+
+2. Build the Civetweb library.
+3. Configure Trick.
+
+### Building the Civetweb Library
+```bash
+cd $(CIVETWEB_HOME)
+mkdir lib
+make install-lib PREFIX=. CAN_INSTALL=1 WITH_WEBSOCKET=1
+```
+### Configuring Trick with Civetweb
+```bash
+cd $(TRICK_HOME)
+./configure --with-civetweb=$(CIVETWEB_HOME)
+make clean
+make
+```
+
+Continue to [Adding SSL Encryption](SSL)
\ No newline at end of file
diff --git a/docs/documentation/web/Configuring_TRICK_with_Civetweb.md b/docs/documentation/web/Configuring_TRICK_with_Civetweb.md
deleted file mode 100644
index 36e2ffae..00000000
--- a/docs/documentation/web/Configuring_TRICK_with_Civetweb.md
+++ /dev/null
@@ -1,21 +0,0 @@
-## Configuring Trick with Civetweb
-To configure Trick to support the civetweb web server, you'll need to
-
-1. Download Civetweb from [Github](https://github.com/civetweb/civetweb). Where you put the Civetweb directory will be designated as $(CIVETWEB_HOME).
-
-2. Build the Civetweb library.
-3. Configure Trick.
-
-### Building the Civetweb Library
-```bash
-cd $(CIVETWEB_HOME)
-mkdir lib
-make install-lib PREFIX=. CAN_INSTALL=1 WITH_WEBSOCKET=1
-```
-### Configuring Trick with Civetweb
-```bash
-cd $(TRICK_HOME)
-./configure --with-civetweb=$(CIVETWEB_HOME)
-make clean
-make
-```
diff --git a/docs/documentation/web/Extending_the_HTTP-API.md b/docs/documentation/web/Extend-http-api.md
similarity index 89%
rename from docs/documentation/web/Extending_the_HTTP-API.md
rename to docs/documentation/web/Extend-http-api.md
index 0c114d67..087b39c9 100644
--- a/docs/documentation/web/Extending_the_HTTP-API.md
+++ b/docs/documentation/web/Extend-http-api.md
@@ -1,3 +1,6 @@
+| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Web Server](Webserver) → [APIs](WebServerAPIs) → Extending the HTTP API |
+|------------------------------------------------------------------|
+
## Extending the HTTP-API
The HTTP-API is implemented as a collection of ```httpMethodHandlers```. An ```httpMethodHandler``` is a pointer to a function that is expected to respond to an HTTP GET request, using the **CivetWeb** framework. An ```httpMethodHandler``` is defined (in ```trick/CivetWeb.hh```) as follows:
@@ -113,3 +116,5 @@ void create_connections() {
}
```
+
+Continue to [Extending the WS API](Extend-ws-api)
\ No newline at end of file
diff --git a/docs/documentation/web/Extending_the_WS-API.md b/docs/documentation/web/Extend-ws-api.md
similarity index 95%
rename from docs/documentation/web/Extending_the_WS-API.md
rename to docs/documentation/web/Extend-ws-api.md
index a82c47c4..13c35b7e 100644
--- a/docs/documentation/web/Extending_the_WS-API.md
+++ b/docs/documentation/web/Extend-ws-api.md
@@ -1,3 +1,6 @@
+| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Web Server](Webserver) → [APIs](WebServerAPIs) → Extend the WS API |
+|------------------------------------------------------------------|
+
## Extending the WebSocket-API
## When You Create a WebSocket Connection
@@ -145,7 +148,7 @@ void TimeSession::sendMessage() {
int month = theTime->tm_mon + 1;
int year = theTime->tm_year + 1900;
- sprintf(message, "Time: %02d:%02d:%02d Date: %02d/%02d/%d\n", hours, minutes, seconds, month, day, year);
+ snprintf(message, sizeof(message), "Time: %02d:%02d:%02d Date: %02d/%02d/%d\n", hours, minutes, seconds, month, day, year);
mg_websocket_write(connection, MG_WEBSOCKET_OPCODE_TEXT, message, strlen(message));
}
@@ -267,6 +270,4 @@ To test your new web socket interface, put the following ```time.html``` file in