diff options
author | Norbert Preining <norbert@preining.info> | 2019-12-10 03:01:52 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-12-10 03:01:52 +0000 |
commit | 0174af21196c197a5b3672c87bc6f7a614fddd7d (patch) | |
tree | 00b155441be0755336593a3a2170f7531a055e99 /dviware | |
parent | d1cebb67c836ee110bdbd3aeb622675df479c993 (diff) |
CTAN sync 201912100301
Diffstat (limited to 'dviware')
53 files changed, 1652 insertions, 1587 deletions
diff --git a/dviware/dvisvgm/ChangeLog b/dviware/dvisvgm/ChangeLog index e7761560f4..c540a278c9 100644 --- a/dviware/dvisvgm/ChangeLog +++ b/dviware/dvisvgm/ChangeLog @@ -1,3 +1,67 @@ +2019-12-07 Martin Gieseking <martin.gieseking@uos.de> + + * NEWS: + updated NEWS + +2019-12-06 Martin Gieseking <martin.gieseking@uos.de> + + * .appveyor.yml, .travis.yml, configure.ac, src/Doxyfile, src/version.hpp: + set version to 2.8.2 + +2019-12-05 Martin Gieseking <martin.gieseking@uos.de> + + * src/FileSystem.cpp: + convert path separators only in Windows binaries + + * src/Process.cpp: + Subprocess: handle absolute path to executable correctly + + * src/FileFinder.cpp, src/FileFinder.hpp: + added FileFinder::lookupExecutable() + + * src/MetafontWrapper.cpp: + call 'mf-nowin' instead of 'mf' if available (closes #121) + +2019-12-04 Martin Gieseking <martin.gieseking@uos.de> + + * src/PSInterpreter.cpp: + adapt path separators before passing them to Ghostscript +closes #123 + + * src/FilePath.cpp, src/FileSystem.cpp, src/FileSystem.hpp, + src/PSInterpreter.cpp, src/PsSpecialHandler.cpp, src/dvisvgm.cpp: + renamed adaptPathSeperators() to ensureForwardSlashes() + + * src/Calculator.hpp, src/CharMapID.hpp, src/Color.hpp, src/Directory.cpp, + src/Directory.hpp, src/FixWord.hpp, src/FontStyle.hpp, + src/GFGlyphTracer.cpp, src/GFGlyphTracer.hpp, src/GFReader.cpp, + src/GFReader.hpp, src/GFTracer.cpp, src/GFTracer.hpp, + src/GlyphTracerMessages.hpp, src/HtmlSpecialHandler.hpp, + src/HyperlinkManager.hpp, src/Length.hpp, src/NoPsSpecialHandler.hpp, + src/PSPreviewFilter.cpp, src/PSPreviewFilter.hpp, src/PathClipper.hpp, + src/PreScanDVIReader.cpp, src/PreScanDVIReader.hpp, src/Process.cpp, + src/PsSpecialHandler.hpp, src/RangeMap.hpp, src/SVGOutput.cpp, + src/SVGOutput.hpp, src/SignalHandler.cpp, src/SignalHandler.hpp, + src/TFM.hpp, src/VFReader.cpp, src/VFReader.hpp, src/VectorStream.hpp: + simplified constructors, avoid constant initializers + + * src/FileSystem.cpp, src/FileSystem.hpp: + removed redundant class variable + + * src/MiKTeXCom.cpp: + fixed type mismatch of FindFile expression + +2019-12-03 Martin Gieseking <martin.gieseking@uos.de> + + * src/psdefs.cpp: + fixed handling of 'nulldevice' in PS operator 'restore' +closes #122 + +2019-11-23 Martin Gieseking <martin.gieseking@uos.de> + + * src/GraphicsPath.hpp: + added missing namespace prefix to pow() + 2019-11-14 Martin Gieseking <martin.gieseking@uos.de> * NEWS, README.md: diff --git a/dviware/dvisvgm/NEWS b/dviware/dvisvgm/NEWS index 301a2de7a6..3efe71b2d3 100644 --- a/dviware/dvisvgm/NEWS +++ b/dviware/dvisvgm/NEWS @@ -1,3 +1,11 @@ +dvisvgm-2.8.2 (2019-12-07) +- if available, call 'mf-nowin' instead of 'mf' to process Metafont files + (GH #121) +- fixed handling of null device in PS operator 'restore' (GH #122) +- fixed PS error triggered by backslashes in file paths (GH #123) +- fixed build issue related to GCC on Solaris 11 +- some code cleanup + dvisvgm-2.8.1 (2019-11-14) - added SVG optimizer module 'simplify-text' - added support for PS operator 'nulldevice' diff --git a/dviware/dvisvgm/config.guess b/dviware/dvisvgm/config.guess index b33c9e890e..256083a70d 100755 --- a/dviware/dvisvgm/config.guess +++ b/dviware/dvisvgm/config.guess @@ -2,7 +2,7 @@ # Attempt to guess a canonical system name. # Copyright 1992-2018 Free Software Foundation, Inc. -timestamp='2018-08-29' +timestamp='2018-03-08' # 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 @@ -84,6 +84,8 @@ if test $# != 0; then exit 1 fi +trap 'exit 1' 1 2 15 + # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a @@ -94,39 +96,34 @@ fi # Portable tmp directory creation inspired by the Autoconf team. -tmp= -# shellcheck disable=SC2172 -trap 'test -z "$tmp" || rm -fr "$tmp"' 1 2 13 15 -trap 'exitcode=$?; test -z "$tmp" || rm -fr "$tmp"; exit $exitcode' 0 - -set_cc_for_build() { - : "${TMPDIR=/tmp}" - # shellcheck disable=SC2039 - { 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 -} +set_cc_for_build=' +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; +: ${TMPDIR=/tmp} ; + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; +dummy=$tmp/dummy ; +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > "$dummy.c" ; + for c in cc gcc c89 c99 ; do + if ($c -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) -if test -f /.attbin/uname ; then +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi @@ -141,7 +138,7 @@ Linux|GNU|GNU/*) # We could probably try harder. LIBC=gnu - set_cc_for_build + eval "$set_cc_for_build" cat <<-EOF > "$dummy.c" #include <features.h> #if defined(__UCLIBC__) @@ -202,7 +199,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in os=netbsdelf ;; arm*|i386|m68k|ns32k|sh3*|sparc|vax) - set_cc_for_build + eval "$set_cc_for_build" if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then @@ -240,7 +237,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "$machine-${os}${release}${abi-}" + echo "$machine-${os}${release}${abi}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` @@ -392,15 +389,20 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in echo i386-pc-auroraux"$UNAME_RELEASE" exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) - UNAME_REL="`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" - case `isainfo -b` in - 32) - echo i386-pc-solaris2"$UNAME_REL" - ;; - 64) - echo x86_64-pc-solaris2"$UNAME_REL" - ;; - esac + eval "$set_cc_for_build" + SUN_ARCH=i386 + # If there is a compiler, see if it is configured for 64-bit objects. + # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. + # This test works for both compilers. + if [ "$CC_FOR_BUILD" != no_compiler_found ]; then + if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + SUN_ARCH=x86_64 + fi + fi + echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize @@ -480,7 +482,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in echo clipper-intergraph-clix"$UNAME_RELEASE" exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) - set_cc_for_build + eval "$set_cc_for_build" sed 's/^ //' << EOF > "$dummy.c" #ifdef __cplusplus #include <stdio.h> /* for printf() prototype */ @@ -577,7 +579,7 @@ EOF exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then - set_cc_for_build + eval "$set_cc_for_build" sed 's/^ //' << EOF > "$dummy.c" #include <sys/systemcfg.h> @@ -658,7 +660,7 @@ EOF esac fi if [ "$HP_ARCH" = "" ]; then - set_cc_for_build + eval "$set_cc_for_build" sed 's/^ //' << EOF > "$dummy.c" #define _HPUX_SOURCE @@ -698,7 +700,7 @@ EOF esac if [ "$HP_ARCH" = hppa2.0w ] then - set_cc_for_build + eval "$set_cc_for_build" # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler @@ -724,7 +726,7 @@ EOF echo ia64-hp-hpux"$HPUX_REV" exit ;; 3050*:HI-UX:*:*) - set_cc_for_build + eval "$set_cc_for_build" sed 's/^ //' << EOF > "$dummy.c" #include <unistd.h> int @@ -838,17 +840,6 @@ EOF *:BSD/OS:*:*) echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE" exit ;; - 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 - echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabi - else - echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabihf - fi - exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case "$UNAME_PROCESSOR" in @@ -903,8 +894,8 @@ EOF # other systems with GNU libc and userland echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC" exit ;; - *:Minix:*:*) - echo "$UNAME_MACHINE"-unknown-minix + i*86:Minix:*:*) + echo "$UNAME_MACHINE"-pc-minix exit ;; aarch64:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" @@ -931,7 +922,7 @@ EOF echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; arm*:Linux:*:*) - set_cc_for_build + eval "$set_cc_for_build" if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then @@ -980,7 +971,7 @@ EOF echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; mips:Linux:*:* | mips64:Linux:*:*) - set_cc_for_build + eval "$set_cc_for_build" sed 's/^ //' << EOF > "$dummy.c" #undef CPU #undef ${UNAME_MACHINE} @@ -1294,7 +1285,7 @@ EOF exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown - set_cc_for_build + eval "$set_cc_for_build" if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi @@ -1367,7 +1358,6 @@ EOF # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. - # shellcheck disable=SC2154 if test "$cputype" = 386; then UNAME_MACHINE=i386 else diff --git a/dviware/dvisvgm/config.sub b/dviware/dvisvgm/config.sub index b51fb8cdb6..20f7cf29a9 100755 --- a/dviware/dvisvgm/config.sub +++ b/dviware/dvisvgm/config.sub @@ -2,7 +2,7 @@ # Configuration validation subroutine script. # Copyright 1992-2018 Free Software Foundation, Inc. -timestamp='2018-08-29' +timestamp='2018-05-05' # 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 @@ -110,20 +110,16 @@ case $# in exit 1;; esac -# Split fields of configuration type +# Spilt fields of configuration type IFS="-" read -r field1 field2 field3 field4 <<EOF $1 EOF # Separate into logical components for further validation case $1 in - *-*-*-*-*) - echo Invalid configuration \`"$1"\': more than four components >&2 - exit 1 - ;; *-*-*-*) basic_machine=$field1-$field2 - os=$field3-$field4 + os=-$field3-$field4 ;; *-*-*) # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two @@ -136,1133 +132,1227 @@ case $1 in | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ | storm-chaos* | os2-emx* | rtmk-nova*) basic_machine=$field1 - os=$maybe_os + os=-$maybe_os ;; android-linux) basic_machine=$field1-unknown - os=linux-android + os=-linux-android ;; *) basic_machine=$field1-$field2 - os=$field3 + os=-$field3 ;; esac ;; *-*) - # A lone config we happen to match not fitting any patern - case $field1-$field2 in - decstation-3100) - basic_machine=mips-dec - 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 - 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 - os= - ;; - *) - basic_machine=$field1 - os=$field2 - ;; - esac - ;; - esac + basic_machine=$field1 + os=-$field2 ;; *) - # Convert single-component short-hands not valid as part of - # multi-component configurations. - case $field1 in - 386bsd) - basic_machine=i386-pc - os=bsd - ;; - a29khif) - basic_machine=a29k-amd - os=udi - ;; - adobe68k) - basic_machine=m68010-adobe - os=scout - ;; - alliant) - basic_machine=fx80-alliant - os= - ;; - altos | altos3068) - basic_machine=m68k-altos - os= - ;; - am29k) - basic_machine=a29k-none - os=bsd - ;; - amdahl) - basic_machine=580-amdahl - os=sysv - ;; - amiga) - basic_machine=m68k-unknown - os= - ;; - 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 - ;; - 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) - basic_machine=j90-cray - os=unicos - ;; - crds | unos) - basic_machine=m68k-crds - os= - ;; - da30) - basic_machine=m68k-da30 - os= - ;; - decstation | pmax | pmin | dec3100 | decstatn) - basic_machine=mips-dec - os= - ;; - delta88) - basic_machine=m88k-motorola - os=sysv3 - ;; - dicos) - basic_machine=i686-pc - os=dicos - ;; - djgpp) - basic_machine=i586-pc - os=msdosdjgpp - ;; - ebmon29k) - basic_machine=a29k-amd - os=ebmon - ;; - es1800 | OSE68k | ose68k | ose | OSE) - basic_machine=m68k-ericsson - os=ose - ;; - gmicro) - basic_machine=tron-gmicro - os=sysv - ;; - go32) - basic_machine=i386-pc - os=go32 - ;; - 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 - ;; - hppaosf) - basic_machine=hppa1.1-hp - os=osf - ;; - hppro) - basic_machine=hppa1.1-hp - os=proelf - ;; - i386mach) - basic_machine=i386-mach - os=mach - ;; - vsta) - basic_machine=i386-pc - os=vsta - ;; - isi68 | isi) - basic_machine=m68k-isi - os=sysv - ;; - m68knommu) - basic_machine=m68k-unknown - os=linux - ;; - magnum | m3230) - basic_machine=mips-mips - os=sysv - ;; - merlin) - basic_machine=ns32k-utek - os=sysv - ;; - mingw64) - basic_machine=x86_64-pc - os=mingw64 - ;; - mingw32) - basic_machine=i686-pc - os=mingw32 - ;; - mingw32ce) - basic_machine=arm-unknown - os=mingw32ce - ;; - monitor) - basic_machine=m68k-rom68k - os=coff - ;; - morphos) - basic_machine=powerpc-unknown - os=morphos - ;; - moxiebox) - basic_machine=moxie-unknown - os=moxiebox - ;; - msdos) - basic_machine=i386-pc - os=msdos - ;; - msys) - basic_machine=i686-pc - os=msys - ;; - mvs) - basic_machine=i370-ibm - os=mvs - ;; - nacl) - basic_machine=le32-unknown - os=nacl - ;; - ncr3000) - basic_machine=i486-ncr - os=sysv4 - ;; - netbsd386) - basic_machine=i386-pc - 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 - ;; - necv70) - basic_machine=v70-nec - os=sysv - ;; - 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 - ;; - os400) - basic_machine=powerpc-ibm - os=os400 - ;; - OSE68000 | ose68000) - basic_machine=m68000-ericsson - os=ose - ;; - os68k) - basic_machine=m68k-none - os=os68k - ;; - paragon) - basic_machine=i860-intel - os=osf - ;; - parisc) - basic_machine=hppa-unknown - os=linux - ;; - 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 - ;; - sa29200) - basic_machine=a29k-amd - os=udi - ;; - sei) - basic_machine=mips-sei - os=seiux - ;; - sequent) - basic_machine=i386-sequent - os= - ;; - sps7) - basic_machine=m68k-bull - os=sysv2 - ;; - st2000) - basic_machine=m68k-tandem - os= - ;; - stratus) - basic_machine=i860-stratus - os=sysv4 - ;; - sun2) - basic_machine=m68000-sun - os= - ;; - sun2os3) - basic_machine=m68000-sun - os=sunos3 - ;; - sun2os4) - basic_machine=m68000-sun - os=sunos4 - ;; - sun3) - basic_machine=m68k-sun - os= - ;; - sun3os3) - basic_machine=m68k-sun - os=sunos3 - ;; - sun3os4) - basic_machine=m68k-sun - os=sunos4 - ;; - sun4) - basic_machine=sparc-sun - os= - ;; - sun4os3) - basic_machine=sparc-sun - os=sunos3 - ;; - sun4os4) - basic_machine=sparc-sun - os=sunos4 - ;; - sun4sol2) - basic_machine=sparc-sun - os=solaris2 - ;; - sun386 | sun386i | roadrunner) - basic_machine=i386-sun - os= - ;; - 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 - ;; - toad1) - basic_machine=pdp10-xkl - os=tops20 - ;; - 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 - ;; - vxworks960) - basic_machine=i960-wrs - os=vxworks - ;; - vxworks68) - basic_machine=m68k-wrs - os=vxworks - ;; - vxworks29k) - basic_machine=a29k-wrs - os=vxworks - ;; - xbox) - basic_machine=i686-pc - os=mingw32 - ;; - ymp) - basic_machine=ymp-cray - os=unicos - ;; - *) - basic_machine=$1 - os= - ;; - esac + basic_machine=$1 + os= + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis | -knuth | -cray | -microblaze*) + os= + basic_machine=$1 + ;; + -bluegene*) + os=-cnk + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco6) + os=-sco5v6 + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` + ;; + -sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*178) + os=-lynxos178 + ;; + -lynx*5) + os=-lynxos5 + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo "$1" | sed -e 's/86-.*/86-sequent/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint ;; esac -# Decode 1-component or ad-hoc basic machines +# Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in - # 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 + # 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] | armv6m | armv[78][arm] \ + | avr | avr32 \ + | ba \ + | be32 | be64 \ + | bfin \ + | c4x | c8051 | clipper | csky \ + | d10v | d30v | dlx | dsp16xx \ + | e2k | epiphany \ + | fido | fr30 | frv | ft32 \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | hexagon \ + | i370 | i860 | i960 | ia16 | ia64 \ + | ip2k | iq2000 \ + | k1om \ + | 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 \ + | mipsisa32r6 | mipsisa32r6el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64r6 | mipsisa64r6el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipsr5900 | mipsr5900el \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | moxie \ + | mt \ + | msp430 \ + | nds32 | nds32le | nds32be \ + | nfp \ + | nios | nios2 | nios2eb | nios2el \ + | ns16k | ns32k \ + | open8 | or1k | or1knd | or32 \ + | pdp10 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle \ + | pru \ + | pyramid \ + | riscv32 | riscv64 \ + | rl78 | rx \ + | score \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]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 \ + | visium \ + | wasm32 \ + | x86 | xc16x | xstormy16 | xtensa \ + | z8k | z80) + basic_machine=$basic_machine-unknown + ;; + c54x) + basic_machine=tic54x-unknown + ;; + c55x) + basic_machine=tic55x-unknown + ;; + c6x) + basic_machine=tic6x-unknown ;; - op50n) - cpu=hppa1.1 - vendor=oki + leon|leon[3-9]) + basic_machine=sparc-$basic_machine ;; - op60c) - cpu=hppa1.1 - vendor=oki + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) + basic_machine=$basic_machine-unknown + os=-none ;; - ibm*) - cpu=i370 - vendor=ibm + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65) ;; - orion105) - cpu=clipper - vendor=highlevel + m9s12z | m68hcs12z | hcs12z | s12z) + basic_machine=s12z-unknown + os=-none ;; - 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 + ;; + xgate) + basic_machine=$basic_machine-unknown + os=-none + ;; + xscaleeb) + basic_machine=armeb-unknown + ;; + + xscaleel) + basic_machine=armel-unknown ;; + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | aarch64-* | aarch64_be-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* | avr32-* \ + | ba-* \ + | be32-* | be64-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* \ + | c8051-* | clipper-* | craynv-* | csky-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | e2k-* | elxsi-* \ + | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | hexagon-* \ + | i*86-* | i860-* | i960-* | ia16-* | ia64-* \ + | ip2k-* | iq2000-* \ + | k1om-* \ + | le32-* | le64-* \ + | lm32-* \ + | m32c-* | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ + | microblaze-* | 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-* \ + | mipsisa32r6-* | mipsisa32r6el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64r6-* | mipsisa64r6el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipsr5900-* | mipsr5900el-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | mt-* \ + | msp430-* \ + | nds32-* | nds32le-* | nds32be-* \ + | nfp-* \ + | nios-* | nios2-* | nios2eb-* | nios2el-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | open8-* \ + | or1k*-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ + | pru-* \ + | pyramid-* \ + | riscv32-* | riscv64-* \ + | rl78-* | romp-* | rs6000-* | rx-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ + | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ + | tahoe-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tile*-* \ + | tron-* \ + | ubicom32-* \ + | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ + | vax-* \ + | visium-* \ + | wasm32-* \ + | 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-pc + os=-bsd + ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) - cpu=m68000 - vendor=att + basic_machine=m68000-att ;; 3b*) - cpu=we32k - vendor=att + 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 + ;; + asmjs) + basic_machine=asmjs-unknown + ;; + 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*) - cpu=powerpc - vendor=ibm - os=cnk + 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*) - cpu=pdp10 - vendor=dec - os=tops10 + basic_machine=pdp10-dec + os=-tops10 ;; decsystem20* | dec20*) - cpu=pdp10 - vendor=dec - os=tops20 + basic_machine=pdp10-dec + os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) - cpu=m68k - vendor=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*) - cpu=m68k - vendor=bull - os=sysv3 + basic_machine=m68k-bull + os=-sysv3 ;; - encore | umax | mmax) - cpu=ns32k - vendor=encore + e500v[12]) + basic_machine=powerpc-unknown + os=$os"spe" + ;; + e500v[12]-*) + basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'` + os=$os"spe" + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon ;; elxsi) - cpu=elxsi - vendor=elxsi - os=${os:-bsd} + 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) - cpu=i860 - vendor=alliant + basic_machine=i860-alliant ;; genix) - cpu=ns32k - vendor=ns + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 ;; h3050r* | hiux*) - cpu=hppa1.1 - vendor=hitachi - os=hiuxwe2 + 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]) - cpu=hppa1.0 - vendor=hp + basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) - cpu=m68000 - vendor=hp + basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) - cpu=m68k - vendor=hp + basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) - cpu=hppa1.0 - vendor=hp + basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) - cpu=hppa1.1 - vendor=hp + basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp - cpu=hppa1.1 - vendor=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 - cpu=hppa1.1 - vendor=hp + basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) - cpu=hppa1.1 - vendor=hp + basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) - cpu=hppa1.0 - vendor=hp + basic_machine=hppa1.0-hp + ;; + 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) - cpu=`echo "$1" | sed -e 's/86.*/86/'` - vendor=pc - os=sysv32 + basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` + os=-sysv32 ;; i*86v4*) - cpu=`echo "$1" | sed -e 's/86.*/86/'` - vendor=pc - os=sysv4 + basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` + os=-sysv4 ;; i*86v) - cpu=`echo "$1" | sed -e 's/86.*/86/'` - vendor=pc - os=sysv + basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` + os=-sysv ;; i*86sol2) - cpu=`echo "$1" | sed -e 's/86.*/86/'` - vendor=pc - os=solaris2 + basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach ;; - j90 | j90-cray) - cpu=j90 - vendor=cray - os=${os:-unicos} + vsta) + basic_machine=i386-unknown + os=-vsta ;; iris | iris4d) - cpu=mips - vendor=sgi + basic_machine=mips-sgi case $os in - irix*) + -irix*) ;; *) - os=irix4 + os=-irix4 ;; esac ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + leon-*|leon[3-9]-*) + basic_machine=sparc-`echo "$basic_machine" | sed 's/-.*//'` + ;; + m68knommu) + basic_machine=m68k-unknown + os=-linux + ;; + m68knommu-*) + basic_machine=m68k-`echo "$basic_machine" | sed 's/^[^-]*-//'` + os=-linux + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + microblaze*) + basic_machine=microblaze-xilinx + ;; + mingw64) + basic_machine=x86_64-pc + os=-mingw64 + ;; + mingw32) + basic_machine=i686-pc + os=-mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + os=-mingw32ce + ;; miniframe) - cpu=m68000 - vendor=convergent + 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 + ;; + moxiebox) + basic_machine=moxie-unknown + os=-moxiebox + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + ms1-*) + basic_machine=`echo "$basic_machine" | sed -e 's/ms1-/mt-/'` + ;; + msys) + basic_machine=i686-pc + os=-msys + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + nacl) + basic_machine=le32-unknown + os=-nacl + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd ;; - *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*) - cpu=m68k - vendor=atari - os=mint + 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) - cpu=mips - vendor=sony - os=newsos + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv ;; next | m*-next) - cpu=m68k - vendor=next + basic_machine=m68k-next case $os in - nextstep* ) + -nextstep* ) ;; - ns2*) - os=nextstep2 + -ns2*) + os=-nextstep2 ;; *) - os=nextstep3 + 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) - cpu=np1 - vendor=gould + basic_machine=np1-gould + ;; + neo-tandem) + basic_machine=neo-tandem + ;; + nse-tandem) + basic_machine=nse-tandem + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + nsv-tandem) + basic_machine=nsv-tandem + ;; + nsx-tandem) + basic_machine=nsx-tandem ;; op50n-* | op60c-*) - cpu=hppa1.1 - vendor=oki - os=proelf + 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) - cpu=hppa1.1 - vendor=hitachi - os=hiuxwe2 + 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) - cpu=sparc - vendor=tti + basic_machine=sparc-tti ;; pbb) - cpu=m68k - vendor=tti + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 ;; - pc532) - cpu=ns32k - vendor=pc532 + pc98) + basic_machine=i386-pc + ;; + pc98-*) + basic_machine=i386-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc + ;; + pentiumii | pentium2 | pentiumiii | pentium3) + basic_machine=i686-pc + ;; + pentium4) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + pentium4-*) + basic_machine=i786-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pn) - cpu=pn - vendor=gould + basic_machine=pn-gould ;; - power) - cpu=power - vendor=ibm + power) basic_machine=power-ibm ;; - ps2) - cpu=i386 - vendor=ibm + ppc | ppcbe) basic_machine=powerpc-unknown ;; - rm[46]00) - cpu=mips - vendor=siemens + ppc-* | ppcbe-*) + basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; - rtpc | rtpc-*) - cpu=romp - vendor=ibm + ppcle | powerpclittle) + basic_machine=powerpcle-unknown ;; - sde) - cpu=mipsisa32 - vendor=sde - os=${os:-elf} + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; - simso-wrs) - cpu=sparclite - vendor=wrs - os=vxworks + ppc64) basic_machine=powerpc64-unknown ;; - tower | tower-32) - cpu=m68k - vendor=ncr + ppc64-*) basic_machine=powerpc64-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; - vpp*|vx|vx-*) - cpu=f301 - vendor=fujitsu + ppc64le | powerpc64little) + basic_machine=powerpc64le-unknown ;; - w65) - cpu=w65 - vendor=wdc + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; - w89k-*) - cpu=hppa1.1 - vendor=winbond - os=proelf + ps2) + basic_machine=i386-ibm ;; - none) - cpu=none - vendor=none + pw32) + basic_machine=i586-unknown + os=-pw32 ;; - leon|leon[3-9]) - cpu=sparc - vendor=$basic_machine + rdos | rdos64) + basic_machine=x86_64-pc + os=-rdos ;; - leon-*|leon[3-9]-*) - cpu=sparc - vendor=`echo "$basic_machine" | sed 's/-.*//'` + rdos32) + basic_machine=i386-pc + os=-rdos ;; - - *-*) - IFS="-" read -r cpu vendor <<EOF -$basic_machine -EOF + rom68k) + basic_machine=m68k-rom68k + os=-coff ;; - # We use `pc' rather than `unknown' - # because (1) that's what they normally are, and - # (2) the word "unknown" tends to confuse beginning users. - i*86 | x86_64) - cpu=$basic_machine - vendor=pc + rm[46]00) + basic_machine=mips-siemens ;; - # 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) - cpu=i386 - vendor=pc + rtpc | rtpc-*) + basic_machine=romp-ibm ;; - x64 | amd64) - cpu=x86_64 - vendor=pc + s390 | s390-*) + basic_machine=s390-ibm ;; - # Recognize the basic CPU types without company name. - *) - cpu=$basic_machine - vendor=unknown + s390x | s390x-*) + basic_machine=s390x-ibm ;; -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 cannonical form. It is in - # some cases the only manufacturer, in others, it is the most popular. - craynv-unknown) - vendor=cray - os=${os:-unicosmp} + sa29200) + basic_machine=a29k-amd + os=-udi ;; - c90-unknown | c90-cray) - vendor=cray - os=${os:-unicos} + sb1) + basic_machine=mipsisa64sb1-unknown ;; - fx80-unknown) - vendor=alliant + sb1el) + basic_machine=mipsisa64sb1el-unknown ;; - romp-unknown) - vendor=ibm + sde) + basic_machine=mipsisa32-sde + os=-elf ;; - mmix-unknown) - vendor=knuth + sei) + basic_machine=mips-sei + os=-seiux ;; - microblaze-unknown | microblazeel-unknown) - vendor=xilinx + sequent) + basic_machine=i386-sequent ;; - rs6000-unknown) - vendor=ibm + sh5el) + basic_machine=sh5le-unknown ;; - vax-unknown) - vendor=dec + simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks ;; - pdp11-unknown) - vendor=dec + sps7) + basic_machine=m68k-bull + os=-sysv2 ;; - we32k-unknown) - vendor=att + spur) + basic_machine=spur-unknown ;; - cydra-unknown) - vendor=cydrome + st2000) + basic_machine=m68k-tandem ;; - i370-ibm*) - vendor=ibm + stratus) + basic_machine=i860-stratus + os=-sysv4 ;; - orion-unknown) - vendor=highlevel + strongarm-* | thumb-*) + basic_machine=arm-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; - xps-unknown | xps100-unknown) - cpu=xps100 - vendor=honeywell + sun2) + basic_machine=m68000-sun ;; - - # Here we normalize CPU types with a missing or matching vendor - dpx20-unknown | dpx20-bull) - cpu=rs6000 - vendor=bull - os=${os:-bosx} + sun2os3) + basic_machine=m68000-sun + os=-sunos3 ;; - - # Here we normalize CPU types irrespective of the vendor - amd64-*) - cpu=x86_64 + sun2os4) + basic_machine=m68000-sun + os=-sunos4 ;; - blackfin-*) - cpu=bfin - os=linux + sun3os3) + basic_machine=m68k-sun + os=-sunos3 ;; - c54x-*) - cpu=tic54x + sun3os4) + basic_machine=m68k-sun + os=-sunos4 ;; - c55x-*) - cpu=tic55x + sun4os3) + basic_machine=sparc-sun + os=-sunos3 ;; - c6x-*) - cpu=tic6x + sun4os4) + basic_machine=sparc-sun + os=-sunos4 ;; - e500v[12]-*) - cpu=powerpc - os=$os"spe" + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 ;; - mips3*-*) - cpu=mips64 + sun3 | sun3-*) + basic_machine=m68k-sun ;; - ms1-*) - cpu=mt + sun4) + basic_machine=sparc-sun ;; - m68knommu-*) - cpu=m68k - os=linux + sun386 | sun386i | roadrunner) + basic_machine=i386-sun ;; - m9s12z-* | m68hcs12z-* | hcs12z-* | s12z-*) - cpu=s12z + sv1) + basic_machine=sv1-cray + os=-unicos ;; - openrisc-*) - cpu=or32 + symmetry) + basic_machine=i386-sequent + os=-dynix ;; - parisc-*) - cpu=hppa - os=linux + t3e) + basic_machine=alphaev5-cray + os=-unicos ;; - pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) - cpu=i586 + t90) + basic_machine=t90-cray + os=-unicos ;; - pentiumpro-* | p6-* | 6x86-* | athlon-* | athalon_*-*) - cpu=i686 + tile*) + basic_machine=$basic_machine-unknown + os=-linux-gnu ;; - pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) - cpu=i686 + tx39) + basic_machine=mipstx39-unknown ;; - pentium4-*) - cpu=i786 + tx39el) + basic_machine=mipstx39el-unknown ;; - pc98-*) - cpu=i386 + toad1) + basic_machine=pdp10-xkl + os=-tops20 ;; - ppc-* | ppcbe-*) - cpu=powerpc + tower | tower-32) + basic_machine=m68k-ncr ;; - ppcle-* | powerpclittle-*) - cpu=powerpcle + tpf) + basic_machine=s390x-ibm + os=-tpf ;; - ppc64-*) - cpu=powerpc64 + udi29k) + basic_machine=a29k-amd + os=-udi ;; - ppc64le-* | powerpc64little-*) - cpu=powerpc64le + ultra3) + basic_machine=a29k-nyu + os=-sym1 ;; - sb1-*) - cpu=mipsisa64sb1 + v810 | necv810) + basic_machine=v810-nec + os=-none ;; - sb1el-*) - cpu=mipsisa64sb1el + vaxv) + basic_machine=vax-dec + os=-sysv ;; - sh5e[lb]-*) - cpu=`echo "$cpu" | sed 's/^\(sh.\)e\(.\)$/\1\2e/'` + vms) + basic_machine=vax-dec + os=-vms ;; - spur-*) - cpu=spur + vpp*|vx|vx-*) + basic_machine=f301-fujitsu ;; - strongarm-* | thumb-*) - cpu=arm + 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 ;; - tx39-*) - cpu=mipstx39 + x64) + basic_machine=x86_64-pc ;; - tx39el-*) - cpu=mipstx39el + xbox) + basic_machine=i686-pc + os=-mingw32 ;; - x64-*) - cpu=x86_64 + xps | xps100) + basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) - cpu=`echo "$cpu" | sed 's/^xscale/arm/'` + basic_machine=`echo "$basic_machine" | sed 's/^xscale/arm/'` + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + none) + basic_machine=none-none + os=-none ;; - # Recognize the cannonical CPU Types that limit and/or modify the - # company names they are paired with. - cr16-*) - os=${os:-elf} +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki ;; - crisv32-* | etraxfs*-*) - cpu=crisv32 - vendor=axis + op60c) + basic_machine=hppa1.1-oki ;; - cris-* | etrax*-*) - cpu=cris - vendor=axis + romp) + basic_machine=romp-ibm ;; - crx-*) - os=${os:-elf} + mmix) + basic_machine=mmix-knuth ;; - neo-tandem) - cpu=neo - vendor=tandem + rs6000) + basic_machine=rs6000-ibm ;; - nse-tandem) - cpu=nse - vendor=tandem + vax) + basic_machine=vax-dec ;; - nsr-tandem) - cpu=nsr - vendor=tandem + pdp11) + basic_machine=pdp11-dec ;; - nsv-tandem) - cpu=nsv - vendor=tandem + we32k) + basic_machine=we32k-att ;; - nsx-tandem) - cpu=nsx - vendor=tandem + sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) + basic_machine=sh-unknown + ;; + cydra) + basic_machine=cydra-cydrome ;; - s390-*) - cpu=s390 - vendor=ibm + orion) + basic_machine=orion-highlevel ;; - s390x-*) - cpu=s390x - vendor=ibm + orion105) + basic_machine=clipper-highlevel ;; - tile*-*) - os=${os:-linux-gnu} + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. ;; - *) - # Recognize the cannonical 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 \ - | arc | arceb \ - | arm | arm[lb]e | arme[lb] | armv* \ - | avr | avr32 \ - | asmjs \ - | ba \ - | be32 | be64 \ - | bfin | 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 \ - | m32c | m32r | m32rle \ - | m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k | v70 | w65 \ - | m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip \ - | m88110 | m88k | maxq | mb | mcore | mep | 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 \ - | mipsisa32r6 | mipsisa32r6el \ - | mipsisa64 | mipsisa64el \ - | mipsisa64r2 | mipsisa64r2el \ - | 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 \ - | open8 \ - | or1k* \ - | or32 \ - | orion \ - | pdp10 | pdp11 | pj | pjl | pn | power \ - | powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \ - | pru \ - | pyramid \ - | riscv | riscv32 | riscv64 \ - | rl78 | romp | rs6000 | rx \ - | score \ - | sh | 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 \ - | tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \ - | tron \ - | ubicom32 \ - | v850 | v850e | v850e1 | v850es | v850e2 | v850e2v3 \ - | vax \ - | visium \ - | wasm32 \ - | 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 + echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2 + exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. -case $vendor in - digital*) - vendor=dec +case $basic_machine in + *-digital*) + basic_machine=`echo "$basic_machine" | sed 's/digital.*/dec/'` ;; - commodore*) - vendor=cbm + *-commodore*) + basic_machine=`echo "$basic_machine" | sed 's/commodore.*/cbm/'` ;; *) ;; @@ -1275,240 +1365,200 @@ then case $os in # First match some system type aliases that might get confused # with valid system types. - # solaris* is a basic system type, with this one exception. - auroraux) - os=auroraux + # -solaris* is a basic system type, with this one exception. + -auroraux) + os=-auroraux ;; - bluegene*) - os=cnk - ;; - solaris1 | solaris1.*) + -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; - solaris) - os=solaris2 + -solaris) + os=-solaris2 ;; - unixware*) - os=sysv4.2uw + -unixware*) + os=-sysv4.2uw ;; - gnu/linux*) + -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # es1800 is here to avoid being matched by es* (a different OS) - es1800*) - os=ose - ;; - # Some version numbers need modification - chorusos*) - os=chorusos - ;; - isc) - os=isc2.2 - ;; - sco6) - os=sco5v6 - ;; - sco5) - os=sco3.2v5 - ;; - sco4) - os=sco3.2v4 - ;; - sco3.2.[4-9]*) - os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` - ;; - sco3.2v[4-9]* | sco5v6*) - # Don't forget version if it is 3.2v4 or newer. - ;; - scout) - # Don't match below - ;; - sco*) - os=sco3.2v2 - ;; - psos*) - os=psos + -es1800*) + os=-ose ;; # Now accept the basic system types. # The portable systems comes first. # Each alternative MUST end in a * to match a version number. - # sysv* is not here because it comes later, after sysvr4. - gnu* | bsd* | mach* | minix* | genix* | ultrix* | irix* \ - | *vms* | esix* | aix* | cnk* | sunos | sunos[34]*\ - | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \ - | sym* | kopensolaris* | plan9* \ - | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \ - | aos* | aros* | cloudabi* | sortix* \ - | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \ - | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \ - | knetbsd* | mirbsd* | netbsd* \ - | bitrig* | openbsd* | solidbsd* | libertybsd* \ - | ekkobsd* | kfreebsd* | freebsd* | riscix* | lynxos* \ - | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \ - | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \ - | udi* | eabi* | lites* | ieee* | go32* | aux* | hcos* \ - | chorusrdb* | cegcc* | glidix* \ - | cygwin* | msys* | pe* | moss* | proelf* | rtems* \ - | midipix* | mingw32* | mingw64* | linux-gnu* | linux-android* \ - | linux-newlib* | linux-musl* | linux-uclibc* \ - | uxpv* | beos* | mpeix* | udk* | moxiebox* \ - | interix* | uwin* | mks* | rhapsody* | darwin* \ - | openstep* | oskit* | conix* | pw32* | nonstopux* \ - | storm-chaos* | tops10* | tenex* | tops20* | its* \ - | os2* | vos* | palmos* | uclinux* | nucleus* \ - | morphos* | superux* | rtmk* | windiss* \ - | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \ - | skyos* | haiku* | rdos* | toppers* | drops* | es* \ - | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ - | midnightbsd*) + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ + | -sym* | -kopensolaris* | -plan9* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* | -aros* | -cloudabi* | -sortix* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -knetbsd* | -mirbsd* | -netbsd* \ + | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \ + | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ + | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* | -hcos* \ + | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \ + | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ + | -linux-newlib* | -linux-musl* | -linux-uclibc* \ + | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ + | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -bme* \ + | -midnightbsd*) # Remember, each alternative MUST END IN *, to match a version number. ;; - qnx*) - case $cpu in - x86 | i*86) + -qnx*) + case $basic_machine in + x86-* | i*86-*) ;; *) - os=nto-$os + os=-nto$os ;; esac ;; - hiux*) - os=hiuxwe2 + -nto-qnx*) ;; - nto-qnx*) - ;; - nto*) + -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; - sim | xray | os68k* | v88r* \ - | windows* | osx | abug | netware* | os9* \ - | macos* | mpw* | magic* | mmixware* | mon960* | lnews*) - ;; - linux-dietlibc) - os=linux-dietlibc - ;; - linux*) - os=`echo $os | sed -e 's|linux|linux-gnu|'` - ;; - lynx*178) - os=lynxos178 - ;; - lynx*5) - os=lynxos5 - ;; - lynx*) - os=lynxos + -sim | -xray | -os68k* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; - mac*) + -mac*) os=`echo "$os" | sed -e 's|mac|macos|'` ;; - opened*) - os=openedition + -linux-dietlibc) + os=-linux-dietlibc ;; - os400*) - os=os400 + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; - sunos5*) + -sunos5*) os=`echo "$os" | sed -e 's|sunos5|solaris2|'` ;; - sunos6*) + -sunos6*) os=`echo "$os" | sed -e 's|sunos6|solaris3|'` ;; - wince*) - os=wince + -opened*) + os=-openedition ;; - utek*) - os=bsd + -os400*) + os=-os400 ;; - dynix*) - os=bsd + -wince*) + os=-wince ;; - acis*) - os=aos + -utek*) + os=-bsd ;; - atheos*) - os=atheos + -dynix*) + os=-bsd ;; - syllable*) - os=syllable + -acis*) + os=-aos ;; - 386bsd) - os=bsd + -atheos*) + os=-atheos + ;; + -syllable*) + os=-syllable + ;; + -386bsd) + os=-bsd ;; - ctix* | uts*) - os=sysv + -ctix* | -uts*) + os=-sysv ;; - nova*) - os=rtmk-nova + -nova*) + os=-rtmk-nova ;; - ns2) - os=nextstep2 + -ns2) + os=-nextstep2 ;; - nsk*) - os=nsk + -nsk*) + os=-nsk ;; # Preserve the version number of sinix5. - sinix5.*) + -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; - sinix*) - os=sysv4 + -sinix*) + os=-sysv4 ;; - tpf*) - os=tpf + -tpf*) + os=-tpf ;; - triton*) - os=sysv3 + -triton*) + os=-sysv3 ;; - oss*) - os=sysv3 + -oss*) + os=-sysv3 ;; - svr4*) - os=sysv4 + -svr4*) + os=-sysv4 ;; - svr3) - os=sysv3 + -svr3) + os=-sysv3 ;; - sysvr4) - os=sysv4 + -sysvr4) + os=-sysv4 ;; - # This must come after sysvr4. - sysv*) + # This must come after -sysvr4. + -sysv*) ;; - ose*) - os=ose + -ose*) + os=-ose ;; - *mint | mint[0-9]* | *MiNT | MiNT[0-9]*) - os=mint + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint ;; - zvmoe) - os=zvmoe + -zvmoe) + os=-zvmoe ;; - dicos*) - os=dicos + -dicos*) + os=-dicos ;; - pikeos*) + -pikeos*) # Until real need of OS specific support for # particular features comes up, bare metal # configurations are quite functional. - case $cpu in + case $basic_machine in arm*) - os=eabi + os=-eabi ;; *) - os=elf + os=-elf ;; esac ;; - nacl*) + -nacl*) ;; - ios) + -ios) ;; - none) + -none) ;; - *-eabi) + -*-eabi) + case $basic_machine in + arm*) + ;; + esac ;; *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2 exit 1 ;; @@ -1525,261 +1575,254 @@ else # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. -case $cpu-$vendor in +case $basic_machine in score-*) - os=elf + os=-elf ;; spu-*) - os=elf + os=-elf ;; *-acorn) - os=riscix1.2 + os=-riscix1.2 ;; arm*-rebel) - os=linux + os=-linux ;; arm*-semi) - os=aout + os=-aout ;; c4x-* | tic4x-*) - os=coff + os=-coff ;; c8051-*) - os=elf - ;; - clipper-intergraph) - os=clix + os=-elf ;; 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 + 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 + os=-elf ;; *-be) - os=beos + 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 + os=-luna ;; *-next) - os=nextstep + os=-nextstep ;; *-sequent) - os=ptx + os=-ptx ;; *-crds) - os=unos + os=-unos ;; *-ns) - os=genix + os=-genix ;; i370-*) - os=mvs + 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 - ;; - *-wrs) - os=vxworks + os=-mint ;; *) - os=none + os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. -case $vendor in - unknown) +vendor=unknown +case $basic_machine in + *-unknown) case $os in - riscix*) + -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 ;; - clix*) - vendor=intergraph - ;; - mvs* | opened*) + -mvs* | -opened*) vendor=ibm ;; - os400*) + -os400*) vendor=ibm ;; - ptx*) + -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 "$cpu-$vendor-$os" +echo "$basic_machine$os" exit # Local variables: diff --git a/dviware/dvisvgm/configure b/dviware/dvisvgm/configure index 3cdad36f6d..690013405a 100755 --- a/dviware/dvisvgm/configure +++ b/dviware/dvisvgm/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for dvisvgm 2.8.1. +# Generated by GNU Autoconf 2.69 for dvisvgm 2.8.2. # # Report bugs to <martin.gieseking@uos.de>. # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='dvisvgm' PACKAGE_TARNAME='dvisvgm' -PACKAGE_VERSION='2.8.1' -PACKAGE_STRING='dvisvgm 2.8.1' +PACKAGE_VERSION='2.8.2' +PACKAGE_STRING='dvisvgm 2.8.2' PACKAGE_BUGREPORT='martin.gieseking@uos.de' PACKAGE_URL='' @@ -1406,7 +1406,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures dvisvgm 2.8.1 to adapt to many kinds of systems. +\`configure' configures dvisvgm 2.8.2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1477,7 +1477,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of dvisvgm 2.8.1:";; + short | recursive ) echo "Configuration of dvisvgm 2.8.2:";; esac cat <<\_ACEOF @@ -1625,7 +1625,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -dvisvgm configure 2.8.1 +dvisvgm configure 2.8.2 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2169,7 +2169,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by dvisvgm $as_me 2.8.1, which was +It was created by dvisvgm $as_me 2.8.2, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2527,7 +2527,7 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -DATE="November 2019" +DATE="December 2019" ac_config_headers="$ac_config_headers config.h" @@ -3157,7 +3157,7 @@ fi # Define the identity of the package. PACKAGE='dvisvgm' - VERSION='2.8.1' + VERSION='2.8.2' cat >>confdefs.h <<_ACEOF @@ -20138,7 +20138,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by dvisvgm $as_me 2.8.1, which was +This file was extended by dvisvgm $as_me 2.8.2, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -20204,7 +20204,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -dvisvgm config.status 2.8.1 +dvisvgm config.status 2.8.2 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/dviware/dvisvgm/configure.ac b/dviware/dvisvgm/configure.ac index 6a85518935..3572e2d106 100644 --- a/dviware/dvisvgm/configure.ac +++ b/dviware/dvisvgm/configure.ac @@ -4,8 +4,8 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.59) -AC_INIT([dvisvgm],[2.8.1],[martin.gieseking@uos.de]) -DATE="November 2019" +AC_INIT([dvisvgm],[2.8.2],[martin.gieseking@uos.de]) +DATE="December 2019" AC_CONFIG_SRCDIR(src) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_MACRO_DIR([m4]) diff --git a/dviware/dvisvgm/doc/dvisvgm.1 b/dviware/dvisvgm/doc/dvisvgm.1 index e6d6b8743f..5c7cb95e5a 100644 --- a/dviware/dvisvgm/doc/dvisvgm.1 +++ b/dviware/dvisvgm/doc/dvisvgm.1 @@ -4,10 +4,10 @@ .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/> .\" Date: 2019-11-12 .\" Manual: dvisvgm Manual -.\" Source: dvisvgm 2.8.1 +.\" Source: dvisvgm 2.8.2 .\" Language: English .\" -.TH "DVISVGM" "1" "2019\-11\-12" "dvisvgm 2\&.8\&.1" "dvisvgm Manual" +.TH "DVISVGM" "1" "2019\-11\-12" "dvisvgm 2\&.8\&.2" "dvisvgm Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/dviware/dvisvgm/src/Calculator.hpp b/dviware/dvisvgm/src/Calculator.hpp index f498365e54..cc3b2feb6b 100644 --- a/dviware/dvisvgm/src/Calculator.hpp +++ b/dviware/dvisvgm/src/Calculator.hpp @@ -33,7 +33,6 @@ struct CalculatorException : public MessageException { class Calculator { public: - Calculator () : _numValue(0) {} double eval (std::istream &is); double eval (const std::string &expr); void setVariable (const std::string &name, double value) {_variables[name] = value;} @@ -48,7 +47,7 @@ class Calculator { private: std::map<std::string,double> _variables; - double _numValue; + double _numValue=0; std::string _strValue; }; diff --git a/dviware/dvisvgm/src/CharMapID.hpp b/dviware/dvisvgm/src/CharMapID.hpp index e79c64b24f..cdc39ca94d 100644 --- a/dviware/dvisvgm/src/CharMapID.hpp +++ b/dviware/dvisvgm/src/CharMapID.hpp @@ -25,7 +25,7 @@ /** Represents a character map of a font. */ struct CharMapID { - CharMapID () noexcept : platform_id(0), encoding_id(0) {} + CharMapID () noexcept =default; CharMapID (uint8_t plf_id, uint8_t enc_id) noexcept : platform_id(plf_id), encoding_id(enc_id) {} bool operator == (const CharMapID &ids) const { @@ -52,8 +52,8 @@ struct CharMapID { static const CharMapID MAC_SIMPLCHINESE; static const CharMapID MAC_KOREAN; - uint8_t platform_id; - uint8_t encoding_id; + uint8_t platform_id=0; + uint8_t encoding_id=0; }; #endif diff --git a/dviware/dvisvgm/src/Color.hpp b/dviware/dvisvgm/src/Color.hpp index f522bded55..c58a97f0bb 100644 --- a/dviware/dvisvgm/src/Color.hpp +++ b/dviware/dvisvgm/src/Color.hpp @@ -40,7 +40,7 @@ class Color { enum class ColorSpace {GRAY, RGB, CMYK, LAB}; public: - Color () noexcept : _rgb(0) {} + Color () noexcept =default; explicit Color (uint32_t rgb) noexcept : _rgb(rgb) {} Color (uint8_t r, uint8_t g, uint8_t b) noexcept {setRGB(r,g,b);} Color (double r, double g, double b) noexcept {setRGB(r,g,b);} @@ -90,7 +90,7 @@ class Color { static int numComponents (ColorSpace colorSpace); private: - uint32_t _rgb; + uint32_t _rgb=0; }; #endif diff --git a/dviware/dvisvgm/src/Directory.cpp b/dviware/dvisvgm/src/Directory.cpp index ccc05a2e92..748d1bc070 100644 --- a/dviware/dvisvgm/src/Directory.cpp +++ b/dviware/dvisvgm/src/Directory.cpp @@ -22,35 +22,20 @@ using namespace std; -#ifdef _WIN32 - #include "windows.hpp" -#else +#ifndef _WIN32 #include <cerrno> #include <sys/stat.h> #endif Directory::Directory () { -#if _WIN32 - _handle = INVALID_HANDLE_VALUE; - _firstread = true; +#ifdef _WIN32 memset(&_fileData, 0, sizeof(WIN32_FIND_DATA)); -#else - _dir = nullptr; - _dirent = nullptr; #endif } -Directory::Directory (const string &dirname) { -#if _WIN32 - _handle = INVALID_HANDLE_VALUE; - _firstread = true; - memset(&_fileData, 0, sizeof(WIN32_FIND_DATA)); -#else - _dir = nullptr; - _dirent = nullptr; -#endif +Directory::Directory (const string &dirname) : Directory() { open(dirname); } diff --git a/dviware/dvisvgm/src/Directory.hpp b/dviware/dvisvgm/src/Directory.hpp index a703c18977..f6ec7a9602 100644 --- a/dviware/dvisvgm/src/Directory.hpp +++ b/dviware/dvisvgm/src/Directory.hpp @@ -43,12 +43,12 @@ class Directory { private: std::string _dirname; #ifdef _WIN32 - bool _firstread; - HANDLE _handle; + bool _firstread=true; + HANDLE _handle=INVALID_HANDLE_VALUE; WIN32_FIND_DATA _fileData; #else - DIR *_dir; - struct dirent *_dirent; + DIR *_dir=nullptr; + struct dirent *_dirent=nullptr; #endif }; diff --git a/dviware/dvisvgm/src/FileFinder.cpp b/dviware/dvisvgm/src/FileFinder.cpp index dfd60412cb..e867f648a7 100644 --- a/dviware/dvisvgm/src/FileFinder.cpp +++ b/dviware/dvisvgm/src/FileFinder.cpp @@ -46,6 +46,7 @@ std::string FileFinder::_argv0; std::string FileFinder::_progname; +std::string FileFinder::_pathbuf; bool FileFinder::_enableMktex = false; @@ -109,12 +110,11 @@ const char* FileFinder::findFile (const std::string &fname, const char *ftype) c if (fname.empty()) return nullptr; - static std::string buf; // try to lookup the file in the additionally specified directories for (const std::string &dir : _additionalDirs) { - buf = dir + "/" + fname; - if (FileSystem::exists(buf)) - return buf.c_str(); + _pathbuf = dir+"/"+fname; + if (FileSystem::exists(_pathbuf)) + return _pathbuf.c_str(); } std::string ext; if (ftype) @@ -126,21 +126,18 @@ const char* FileFinder::findFile (const std::string &fname, const char *ftype) c ext = fname.substr(pos+1); } +#ifdef _WIN32 + if (ext == "dll" || ext == "exe") + return lookupExecutable(fname); #ifdef MIKTEX - if (ext == "dll" || ext == "exe") { - // lookup dll and exe files in the MiKTeX bin directory first - buf = _miktex->getBinDir() + "/" + fname; - if (FileSystem::exists(buf)) - return buf.c_str(); - } else if (ext == "cmap") { // The MiKTeX SDK doesn't support the lookup of files without suffix (yet), thus // it's not possible to find cmap files which usually don't have a suffix. In order // to work around this, we try to lookup the files by calling kpsewhich. Process process("kpsewhich", "-format=cmap "+fname); - process.run(&buf); - buf = util::trim(buf); - return buf.empty() ? nullptr : buf.c_str(); + process.run(&_pathbuf); + _pathbuf = util::trim(_pathbuf); + return _pathbuf.empty() ? nullptr : _pathbuf.c_str(); } try { return _miktex->findFile(fname.c_str()); @@ -148,17 +145,9 @@ const char* FileFinder::findFile (const std::string &fname, const char *ftype) c catch (const MessageException &e) { return nullptr; } -#else -#ifdef TEXLIVEWIN32 - if (ext == "exe") { - // lookup exe files in directory where dvisvgm is located - if (const char *path = kpse_var_value("SELFAUTOLOC")) { - buf = std::string(path) + "/" + fname; - return FileSystem::exists(buf) ? buf.c_str() : nullptr; - } - return nullptr; - } -#endif +#endif // MIKTEX +#endif // _WIN32 +#ifndef MIKTEX static std::map<std::string, kpse_file_format_type> types = { {"tfm", kpse_tfm_format}, {"pfb", kpse_type1_format}, @@ -188,12 +177,12 @@ const char* FileFinder::findFile (const std::string &fname, const char *ftype) c // In the current version of libkpathsea, each call of kpse_find_file produces // a memory leak since the path buffer is not freed. I don't think we can do // anything against it here... - buf = path; + _pathbuf = path; std::free(path); - return buf.c_str(); + return _pathbuf.c_str(); } return nullptr; -#endif +#endif // !MIKTEX } @@ -264,3 +253,35 @@ const char* FileFinder::lookup (const std::string &fname, const char *ftype, boo return path; return nullptr; } + + +/** Looks up the location of an executable file. + * @param[in] fname name of file to look up + * @param[in] addSuffix if true, ".exe" is appended to the given filename (Windows only) + * @return absolute path of file or nullptr if not found */ +const char* FileFinder::lookupExecutable (const std::string &fname, bool addSuffix) const { +#ifdef MIKTEX + _pathbuf = _miktex->getBinDir() + "/" + fname; + if (addSuffix) + _pathbuf += ".exe"; + if (FileSystem::exists(_pathbuf)) + return _pathbuf.c_str(); + try { + return _miktex->findFile(fname.c_str()); + } + catch (...) { + } +#else + // lookup executables in directory where dvisvgm is located + if (const char *path = kpse_var_value("SELFAUTOLOC")) { + _pathbuf = std::string(path) + "/" + fname; +#ifdef _WIN32 + if (addSuffix) + _pathbuf += ".exe"; +#endif + if (FileSystem::exists(_pathbuf)) + return _pathbuf.c_str(); + } +#endif // !MIKTEX + return nullptr; +} diff --git a/dviware/dvisvgm/src/FileFinder.hpp b/dviware/dvisvgm/src/FileFinder.hpp index b01c26b10c..08c59a3372 100644 --- a/dviware/dvisvgm/src/FileFinder.hpp +++ b/dviware/dvisvgm/src/FileFinder.hpp @@ -35,6 +35,7 @@ class FileFinder { void addLookupDir (const std::string &path); const char* lookup (const std::string &fname, const char *ftype, bool extended=true) const; const char* lookup (const std::string &fname, bool extended=true) const {return lookup(fname, nullptr, extended);} + const char* lookupExecutable (const std::string &fname, bool addSuffix=false) const; protected: FileFinder (); @@ -45,6 +46,7 @@ class FileFinder { private: static std::string _argv0; static std::string _progname; + static std::string _pathbuf; ///< buffer holding the path of the last search static bool _enableMktex; std::set<std::string> _additionalDirs; #ifdef MIKTEX diff --git a/dviware/dvisvgm/src/FilePath.cpp b/dviware/dvisvgm/src/FilePath.cpp index c859d30469..6f162bfab9 100644 --- a/dviware/dvisvgm/src/FilePath.cpp +++ b/dviware/dvisvgm/src/FilePath.cpp @@ -122,7 +122,7 @@ void FilePath::init (string path, bool isfile, string current_dir) { single_slashes(path); single_slashes(current_dir); #ifdef _WIN32 - path = FileSystem::adaptPathSeperators(path); + path = FileSystem::ensureForwardSlashes(path); _drive = strip_drive_letter(path); #endif if (isfile) { @@ -303,7 +303,7 @@ bool FilePath::exists () const { bool FilePath::isAbsolute (string path) { path = util::trim(path); #ifdef _WIN32 - path = FileSystem::adaptPathSeperators(path); + path = FileSystem::ensureForwardSlashes(path); if (path.length() >= 2 && path[1] == ':' && isalpha(path[0])) path.erase(0, 2); // remove drive letter and colon #endif diff --git a/dviware/dvisvgm/src/FileSystem.cpp b/dviware/dvisvgm/src/FileSystem.cpp index 35621465a5..6a081ee24f 100644 --- a/dviware/dvisvgm/src/FileSystem.cpp +++ b/dviware/dvisvgm/src/FileSystem.cpp @@ -50,7 +50,6 @@ using namespace std; #endif -FileSystem FileSystem::_fs; string FileSystem::TMPDIR; const char *FileSystem::TMPSUBDIR = nullptr; @@ -133,8 +132,10 @@ uint64_t FileSystem::filesize (const string &fname) { } -string FileSystem::adaptPathSeperators (string path) { +string FileSystem::ensureForwardSlashes (string path) { +#ifdef _WIN32 std::replace(path.begin(), path.end(), PATHSEP, '/'); +#endif return path; } @@ -142,7 +143,7 @@ string FileSystem::adaptPathSeperators (string path) { string FileSystem::getcwd () { char buf[1024]; #ifdef _WIN32 - return adaptPathSeperators(_getcwd(buf, 1024)); + return ensureForwardSlashes(_getcwd(buf, 1024)); #else return ::getcwd(buf, 1024); #endif @@ -198,7 +199,7 @@ string FileSystem::tmpdir () { #ifdef _WIN32 char buf[MAX_PATH]; if (GetTempPath(MAX_PATH, buf)) - ret = adaptPathSeperators(buf); + ret = ensureForwardSlashes(buf); else ret = "."; #else @@ -232,7 +233,7 @@ bool FileSystem::mkdir (const string &dirname) { bool success = false; if (const char *cdirname = dirname.c_str()) { success = true; - const string dirstr = adaptPathSeperators(util::trim(cdirname)); + const string dirstr = ensureForwardSlashes(util::trim(cdirname)); for (size_t pos=1; success && (pos = dirstr.find('/', pos)) != string::npos; pos++) success &= s_mkdir(dirstr.substr(0, pos)); success &= s_mkdir(dirstr); diff --git a/dviware/dvisvgm/src/FileSystem.hpp b/dviware/dvisvgm/src/FileSystem.hpp index 9a1b80067d..b882caa9fa 100644 --- a/dviware/dvisvgm/src/FileSystem.hpp +++ b/dviware/dvisvgm/src/FileSystem.hpp @@ -24,15 +24,14 @@ #include <string> #include <vector> -class FileSystem -{ +class FileSystem { public: ~FileSystem (); static bool remove (const std::string &fname); static bool rename (const std::string &oldname, const std::string &newname); static bool copy (const std::string &src, const std::string &dest, bool remove_src=false); static uint64_t filesize (const std::string &fname); - static std::string adaptPathSeperators (std::string path); + static std::string ensureForwardSlashes (std::string path); static std::string getcwd (); static std::string tmpdir (); static bool chdir (const std::string &dir); @@ -51,9 +50,6 @@ class FileSystem FileSystem () =default; bool system_tmpdir_available (); static const char* TMPSUBDIR; ///< subdirectory of the system's temporary folder - - private: - static FileSystem _fs; }; #endif diff --git a/dviware/dvisvgm/src/FixWord.hpp b/dviware/dvisvgm/src/FixWord.hpp index 41a09f1120..94166b232c 100644 --- a/dviware/dvisvgm/src/FixWord.hpp +++ b/dviware/dvisvgm/src/FixWord.hpp @@ -25,14 +25,14 @@ class FixWord { public: - FixWord () : _value(0) {} + FixWord () =default; FixWord (int32_t fw) : _value(fw) {} explicit operator double () const {return double(_value)/(1 << 20);} bool operator < (FixWord fw) const {return _value < fw._value;} bool operator == (FixWord fw) const {return _value == fw._value;} private: - int32_t _value; + int32_t _value=0; }; #endif diff --git a/dviware/dvisvgm/src/FontStyle.hpp b/dviware/dvisvgm/src/FontStyle.hpp index 40c5d3e45e..1088df3c4e 100644 --- a/dviware/dvisvgm/src/FontStyle.hpp +++ b/dviware/dvisvgm/src/FontStyle.hpp @@ -22,11 +22,11 @@ #define FONTSTYLE struct FontStyle { - FontStyle () : bold(0), extend(1), slant(0) {} + FontStyle () =default; FontStyle (float b, float e, float s) : bold(b), extend(e), slant(s) {} - double bold; ///< stroke width in pt used to draw the glyph outlines - double extend; ///< factor to strech/shrink the glyphs horizontally - double slant; ///< horizontal slanting/skewing value (= tan(phi)) + double bold=0; ///< stroke width in pt used to draw the glyph outlines + double extend=1; ///< factor to strech/shrink the glyphs horizontally + double slant=0; ///< horizontal slanting/skewing value (= tan(phi)) }; #endif diff --git a/dviware/dvisvgm/src/GFGlyphTracer.cpp b/dviware/dvisvgm/src/GFGlyphTracer.cpp index 85f7c2cab5..1b55afc593 100644 --- a/dviware/dvisvgm/src/GFGlyphTracer.cpp +++ b/dviware/dvisvgm/src/GFGlyphTracer.cpp @@ -22,10 +22,6 @@ using namespace std; -GFGlyphTracer::GFGlyphTracer () : GFTracer(_ifs, 0) -{ -} - /** Constructs a new glyph tracer. * @param[in] is GF input stream * @param[in] upp target units per PS point */ diff --git a/dviware/dvisvgm/src/GFGlyphTracer.hpp b/dviware/dvisvgm/src/GFGlyphTracer.hpp index 49f69b69ec..afe1b95253 100644 --- a/dviware/dvisvgm/src/GFGlyphTracer.hpp +++ b/dviware/dvisvgm/src/GFGlyphTracer.hpp @@ -26,8 +26,7 @@ #include "GFTracer.hpp" #include "Glyph.hpp" -class GFGlyphTracer : public GFTracer -{ +class GFGlyphTracer : public GFTracer { public: struct Callback { virtual ~Callback () =default; @@ -38,7 +37,7 @@ class GFGlyphTracer : public GFTracer }; public: - GFGlyphTracer (); + GFGlyphTracer () : GFTracer(_ifs, 0) {} GFGlyphTracer (std::string &fname, double upp, Callback *cb=nullptr); void reset (std::string &fname, double upp); void setCallback (Callback *cb) {_callback = cb;} diff --git a/dviware/dvisvgm/src/GFReader.cpp b/dviware/dvisvgm/src/GFReader.cpp index 32ba354443..a7d314d3de 100644 --- a/dviware/dvisvgm/src/GFReader.cpp +++ b/dviware/dvisvgm/src/GFReader.cpp @@ -40,16 +40,6 @@ static inline double scaled2double (int32_t scaled) { } -GFReader::GFReader (istream &is) : _in(is), _insideCharDef(false), _penDown(false) -{ - _minX = _maxX = _minY = _maxY = _x = _y = 0; - _currentChar = 0; - _designSize = 0; - _hppp = _vppp = 0; - _checksum = 0; -} - - uint32_t GFReader::readUnsigned (int bytes) { uint32_t ret = 0; for (int i=bytes-1; i >= 0 && !_in.eof(); i--) { diff --git a/dviware/dvisvgm/src/GFReader.hpp b/dviware/dvisvgm/src/GFReader.hpp index 3dfceb98cd..ad1e8b2220 100644 --- a/dviware/dvisvgm/src/GFReader.hpp +++ b/dviware/dvisvgm/src/GFReader.hpp @@ -47,7 +47,7 @@ class GFReader { }; public: - explicit GFReader (std::istream &is); + explicit GFReader (std::istream &is) : _in(is) {} virtual ~GFReader () =default; virtual bool executeChar (uint8_t c); virtual bool executeAllChars (); @@ -91,16 +91,16 @@ class GFReader { private: std::istream &_in; - int32_t _minX, _maxX, _minY, _maxY; - int32_t _x, _y; ///< current pen location (pixel units) - int32_t _currentChar; - Bitmap _bitmap; ///< bitmap of current char - double _designSize; ///< designSize in PS points - double _hppp, _vppp; ///< horizontal and vertical pixel per point - uint32_t _checksum; + int32_t _minX=0, _maxX=0, _minY=0, _maxY=0; + int32_t _x=0, _y=0; ///< current pen location (pixel units) + int32_t _currentChar=0; + Bitmap _bitmap; ///< bitmap of current char + double _designSize=0; ///< designSize in PS points + double _hppp=0, _vppp=0; ///< horizontal and vertical pixel per point + uint32_t _checksum=0; std::unordered_map<uint8_t,CharInfo> _charInfoMap; - bool _insideCharDef; ///< true if inside a character definition (between BOC and EOC) - bool _penDown; + bool _insideCharDef=false; ///< true if inside a character definition (between BOC and EOC) + bool _penDown=false; }; #endif diff --git a/dviware/dvisvgm/src/GFTracer.cpp b/dviware/dvisvgm/src/GFTracer.cpp index 61d297d982..e73aab12fd 100644 --- a/dviware/dvisvgm/src/GFTracer.cpp +++ b/dviware/dvisvgm/src/GFTracer.cpp @@ -27,12 +27,6 @@ using namespace std; -GFTracer::GFTracer (istream &is) - : GFReader(is), _unitsPerPoint(0.0) -{ -} - - /** Constructs a new GFTracer. * @param[in] is GF file is read from this stream * @param[in] upp target units per PS point */ diff --git a/dviware/dvisvgm/src/GFTracer.hpp b/dviware/dvisvgm/src/GFTracer.hpp index 8fe746cc05..efe9476a8f 100644 --- a/dviware/dvisvgm/src/GFTracer.hpp +++ b/dviware/dvisvgm/src/GFTracer.hpp @@ -26,7 +26,7 @@ class GFTracer : public GFReader { public: - explicit GFTracer (std::istream &is); + explicit GFTracer (std::istream &is) : GFReader(is) {} GFTracer (std::istream &is, double upp); virtual void moveTo (double x, double y) =0; virtual void lineTo (double x, double y) =0; @@ -39,7 +39,7 @@ class GFTracer : public GFReader { void unitsPerPoint(double upp) {_unitsPerPoint = upp;} private: - double _unitsPerPoint; ///< target units per PS point + double _unitsPerPoint=0; ///< target units per PS point }; #endif diff --git a/dviware/dvisvgm/src/GlyphTracerMessages.hpp b/dviware/dvisvgm/src/GlyphTracerMessages.hpp index 8a41b811d9..d48fe6f1b4 100644 --- a/dviware/dvisvgm/src/GlyphTracerMessages.hpp +++ b/dviware/dvisvgm/src/GlyphTracerMessages.hpp @@ -27,7 +27,8 @@ class GlyphTracerMessages : public GFGlyphTracer::Callback { public: - explicit GlyphTracerMessages (bool sfmsg=true, bool autonl=true) : _sfmsg(sfmsg), _autonl(autonl), _traced(false) {} + GlyphTracerMessages () =default; + explicit GlyphTracerMessages (bool sfmsg, bool autonl) : _sfmsg(sfmsg), _autonl(autonl) {} ~GlyphTracerMessages () override { if (_autonl) @@ -71,8 +72,8 @@ class GlyphTracerMessages : public GFGlyphTracer::Callback { private: std::string _fname; - bool _sfmsg, _autonl; - bool _traced; ///< true if a glyph of the current font has already been traced? + bool _sfmsg=true, _autonl=true; + bool _traced=false; ///< true if a glyph of the current font has already been traced? }; #endif diff --git a/dviware/dvisvgm/src/GraphicsPath.hpp b/dviware/dvisvgm/src/GraphicsPath.hpp index 78b29d4630..bf09a37d09 100644 --- a/dviware/dvisvgm/src/GraphicsPath.hpp +++ b/dviware/dvisvgm/src/GraphicsPath.hpp @@ -22,6 +22,7 @@ #include <array> #include <cctype> +#include <cmath> #include <deque> #include <ostream> #include <type_traits> @@ -687,7 +688,7 @@ class GraphicsPath { * @param[in] actions template methods called by each iteration step * @param[in] optimize if true, shorthand drawing commands (hlineto, vlineto,...) are considered */ void iterate (IterationActions &actions, bool optimize) const { - double eps = XMLString::DECIMAL_PLACES > 0 ? pow(10, -XMLString::DECIMAL_PLACES) : 1e-7; + double eps = XMLString::DECIMAL_PLACES > 0 ? std::pow(10, -XMLString::DECIMAL_PLACES) : 1e-7; IterationVisitor visitor(actions, optimize, eps); for (const CommandVariant &cmd : _commands) { if (actions.quit()) diff --git a/dviware/dvisvgm/src/HtmlSpecialHandler.hpp b/dviware/dvisvgm/src/HtmlSpecialHandler.hpp index 0d4e3e4e11..bb85b2ad2c 100644 --- a/dviware/dvisvgm/src/HtmlSpecialHandler.hpp +++ b/dviware/dvisvgm/src/HtmlSpecialHandler.hpp @@ -29,7 +29,6 @@ class SpecialActions; class HtmlSpecialHandler : public SpecialHandler { public: - HtmlSpecialHandler () : _active(false) {} void preprocess (const std::string &prefix, std::istream &is, SpecialActions &actions) override; bool process (const std::string &prefix, std::istream &is, SpecialActions &actions) override; const char* name () const override {return "html";} @@ -41,7 +40,7 @@ class HtmlSpecialHandler : public SpecialHandler { void dviMovedTo (double x, double y, SpecialActions &actions) override; private: - bool _active; + bool _active=false; }; #endif diff --git a/dviware/dvisvgm/src/HyperlinkManager.hpp b/dviware/dvisvgm/src/HyperlinkManager.hpp index 7f5a460bdb..762b4a4cca 100644 --- a/dviware/dvisvgm/src/HyperlinkManager.hpp +++ b/dviware/dvisvgm/src/HyperlinkManager.hpp @@ -59,7 +59,7 @@ class HyperlinkManager { static void setDefaultLinkColor (Color color); protected: - HyperlinkManager () : _anchorType(AnchorType::NONE), _depthThreshold(0), _linewidth(-1) {} + HyperlinkManager () =default; void markLinkedBox (SpecialActions &actions); enum class MarkerType {NONE, LINE, BOX, BGCOLOR}; @@ -69,9 +69,9 @@ class HyperlinkManager { static ColorSource COLORSOURCE; ///< if true, LINK_LINECOLOR is applied private: - AnchorType _anchorType; ///< type of active anchor - int _depthThreshold; ///< break anchor box if the DVI stack depth underruns this threshold - double _linewidth; ///< line width of link marker (-1 => compute individual value per link) + AnchorType _anchorType=AnchorType::NONE; ///< type of active anchor + int _depthThreshold=0; ///< break anchor box if the DVI stack depth underruns this threshold + double _linewidth=-1; ///< line width of link marker (-1 => compute individual value per link) std::string _base; ///< base URL that is prepended to all relative targets NamedAnchors _namedAnchors; ///< information about all named anchors processed }; diff --git a/dviware/dvisvgm/src/Length.hpp b/dviware/dvisvgm/src/Length.hpp index 4454eec168..3c4de91fae 100644 --- a/dviware/dvisvgm/src/Length.hpp +++ b/dviware/dvisvgm/src/Length.hpp @@ -39,7 +39,7 @@ class Length { enum class Unit {PT, BP, CM, MM, IN, PC, DD, CC, SP}; public: - constexpr Length () : _pt(0) {} + constexpr Length () =default; explicit constexpr Length (long double pt) : _pt(static_cast<double>(pt)) {} Length (double val, Unit unit) {set(val, unit);} Length (double val, const std::string &unitstr) {set(val, unitstr);} @@ -76,7 +76,7 @@ class Length { static constexpr double pt2sp = 65536.0; private: - double _pt; // length in TeX point units (72.27pt = 1in) + double _pt=0; // length in TeX point units (72.27pt = 1in) }; diff --git a/dviware/dvisvgm/src/MetafontWrapper.cpp b/dviware/dvisvgm/src/MetafontWrapper.cpp index 5807d7254e..202b65d6ec 100644 --- a/dviware/dvisvgm/src/MetafontWrapper.cpp +++ b/dviware/dvisvgm/src/MetafontWrapper.cpp @@ -53,19 +53,19 @@ bool MetafontWrapper::call (const string &mode, double mag) { return false; // mf file not available => no need to call the "slow" Metafont FileSystem::remove(_fontname+".gf"); -#ifdef _WIN32 -#ifdef TEXLIVEWIN32 - const char *mfname = "mf-nowin.exe"; -#else - const char *mfname = "mf.exe"; + string mfName = "mf"; // file name of Metafont executable +#ifndef MIKTEX + if (const char *mfnowinPath = FileFinder::instance().lookupExecutable("mf-nowin", true)) + mfName = mfnowinPath; + else #endif - const char *cmd = FileFinder::instance().lookup(mfname, false); - if (!cmd) { - Message::estream(true) << "can't run Metafont (" << mfname << " not found)\n"; - return false; - } -#else - const char *cmd = "mf"; + if (const char *mfPath = FileFinder::instance().lookupExecutable(mfName, true)) + mfName = mfPath; +#ifdef _WIN32 + else { + Message::estream(true) << "can't run Metafont (mf.exe and mf-nowin.exe not found)\n"; + return false; + } #endif ostringstream oss; oss << "\"\\mode=" << mode << ";" // set MF mode, e.g. 'proof', 'ljfour' or 'localfont' @@ -75,7 +75,7 @@ bool MetafontWrapper::call (const string &mode, double mag) { "batchmode;" // don't halt on errors and don't print informational messages "input " << _fontname << "\""; // load font description Message::mstream(false, Message::MC_STATE) << "\nrunning Metafont for " << _fontname << '\n'; - Process mf_process(cmd, oss.str()); + Process mf_process(mfName, oss.str()); string mf_messages; mf_process.run(_dir, &mf_messages); diff --git a/dviware/dvisvgm/src/MiKTeXCom.cpp b/dviware/dvisvgm/src/MiKTeXCom.cpp index 72c2af7f0e..957173f126 100644 --- a/dviware/dvisvgm/src/MiKTeXCom.cpp +++ b/dviware/dvisvgm/src/MiKTeXCom.cpp @@ -92,8 +92,7 @@ const char* MiKTeXCom::findFile (const char *fname) { _bstr_t path; static string ret; #ifdef _MSC_VER - HRESULT hres = _session->FindFile(fname, path.GetAddress()); - bool found = (hres != 0); + bool found = (_session->FindFile(fname, path.GetAddress()) == VARIANT_TRUE); #else VARIANT_BOOL found_var; _session->FindFile(_bstr_t(fname), path.GetAddress(), &found_var); diff --git a/dviware/dvisvgm/src/NoPsSpecialHandler.hpp b/dviware/dvisvgm/src/NoPsSpecialHandler.hpp index f4f0421885..027ea3fb62 100644 --- a/dviware/dvisvgm/src/NoPsSpecialHandler.hpp +++ b/dviware/dvisvgm/src/NoPsSpecialHandler.hpp @@ -25,7 +25,6 @@ class NoPsSpecialHandler : public SpecialHandler { public: - NoPsSpecialHandler () : _count(0) {} bool process (const std::string &prefix, std::istream &is, SpecialActions &actions) override; const char* name () const override {return nullptr;} const char* info () const override {return nullptr;} @@ -35,7 +34,7 @@ class NoPsSpecialHandler : public SpecialHandler { void dviEndPage (unsigned pageno, SpecialActions &actions) override; private: - unsigned _count; // number of PS specials skipped + size_t _count=0; // number of PS specials skipped }; #endif diff --git a/dviware/dvisvgm/src/PSInterpreter.cpp b/dviware/dvisvgm/src/PSInterpreter.cpp index aa9cab2107..4b1d1fbc15 100644 --- a/dviware/dvisvgm/src/PSInterpreter.cpp +++ b/dviware/dvisvgm/src/PSInterpreter.cpp @@ -24,6 +24,7 @@ #include <sstream> #include <unordered_map> #include "FileFinder.hpp" +#include "FileSystem.hpp" #include "InputReader.hpp" #include "Message.hpp" #include "PSFilter.hpp" @@ -352,7 +353,7 @@ int GSDLLCALL PSInterpreter::error (void *inst, const char *buf, int len) { /** Returns the total number of pages of a PDF file. * @param[in] fname name/path of the PDF file */ int PSInterpreter::pdfPageCount (const string &fname) { - executeRaw("\n("+fname+")@pdfpagecount ", 1); + executeRaw("\n("+FileSystem::ensureForwardSlashes(fname)+")@pdfpagecount ", 1); if (!_rawData.empty()) { size_t index; int ret = stoi(_rawData[0], &index, 10); @@ -370,7 +371,7 @@ int PSInterpreter::pdfPageCount (const string &fname) { * @return the bounding box of the given page */ BoundingBox PSInterpreter::pdfPageBox (const string &fname, int pageno) { BoundingBox pagebox; - executeRaw("\n"+to_string(pageno)+"("+fname+")@pdfpagebox ", 4); + executeRaw("\n"+to_string(pageno)+"("+FileSystem::ensureForwardSlashes(fname)+")@pdfpagebox ", 4); if (_rawData.size() < 4) pagebox.invalidate(); else diff --git a/dviware/dvisvgm/src/PSPreviewFilter.cpp b/dviware/dvisvgm/src/PSPreviewFilter.cpp index 36f0303e0f..6dac4945a8 100644 --- a/dviware/dvisvgm/src/PSPreviewFilter.cpp +++ b/dviware/dvisvgm/src/PSPreviewFilter.cpp @@ -28,12 +28,6 @@ using namespace std; -PSPreviewFilter::PSPreviewFilter (PSInterpreter &psi) - : PSFilter(psi), _active(false), _tightpage(false), _dvi2bp(1.0/65536.0) -{ -} - - /** Activates this filter so that the PS code will be redirected through it if * it's hooked into the PSInterpreter. */ void PSPreviewFilter::activate () { diff --git a/dviware/dvisvgm/src/PSPreviewFilter.hpp b/dviware/dvisvgm/src/PSPreviewFilter.hpp index 7de5a2e2a8..630a277b16 100644 --- a/dviware/dvisvgm/src/PSPreviewFilter.hpp +++ b/dviware/dvisvgm/src/PSPreviewFilter.hpp @@ -30,7 +30,7 @@ class SpecialActions; class PSPreviewFilter : public PSFilter { public: - explicit PSPreviewFilter (PSInterpreter &psi); + explicit PSPreviewFilter (PSInterpreter &psi) : PSFilter(psi) {} void activate (); void execute (const char *code, size_t len) override; bool active () const override {return _active;} @@ -44,11 +44,11 @@ class PSPreviewFilter : public PSFilter { double width () const; private: - std::string _version; ///< version string of preview package - bool _active; ///< true if filter is active - bool _tightpage; ///< true if tightpage option was given - double _dvi2bp; ///< factor to convert dvi units to PS points - std::vector<int> _boxExtents; ///< bounding box data set by the preview package (in DVI units) + std::string _version; ///< version string of preview package + bool _active=false; ///< true if filter is active + bool _tightpage=false; ///< true if tightpage option was given + double _dvi2bp=1.0/65536.0; ///< factor to convert dvi units to PS points + std::vector<int> _boxExtents; ///< bounding box data set by the preview package (in DVI units) }; #endif diff --git a/dviware/dvisvgm/src/PathClipper.hpp b/dviware/dvisvgm/src/PathClipper.hpp index 09c904bfd4..fb375db35f 100644 --- a/dviware/dvisvgm/src/PathClipper.hpp +++ b/dviware/dvisvgm/src/PathClipper.hpp @@ -31,25 +31,22 @@ using ClipperLib::IntPoint; -class PathClipper -{ +class PathClipper { public: using CurvedPath = GraphicsPath<double>; public: - PathClipper () : _numLines(0) {} void intersect (const CurvedPath &p1, const CurvedPath &p2, CurvedPath &result); protected: void flatten (const CurvedPath &gp, ClipperLib::Paths &polygons); -// void divide (IntPoint &p1, IntPoint &p2, IntPoint &ip); void reconstruct (const ClipperLib::Path &polygon, CurvedPath &path); void reconstruct (const ClipperLib::Paths &polygons, CurvedPath &path); static void callback (IntPoint &e1bot, IntPoint &e1top, IntPoint &e2bot, IntPoint &e2top, IntPoint &ip); private: std::vector<Bezier> _curves; - int _numLines; ///< negative number of straight line segments in path been processed + int _numLines=0; ///< negative number of straight line segments in path been processed }; #endif diff --git a/dviware/dvisvgm/src/PreScanDVIReader.cpp b/dviware/dvisvgm/src/PreScanDVIReader.cpp index 415eadbb73..7c964fae86 100644 --- a/dviware/dvisvgm/src/PreScanDVIReader.cpp +++ b/dviware/dvisvgm/src/PreScanDVIReader.cpp @@ -25,7 +25,7 @@ using namespace std; PreScanDVIReader::PreScanDVIReader (std::istream &is, DVIActions *actions) - : BasicDVIReader(is), _actions(actions), _currentPageNumber(0) + : BasicDVIReader(is), _actions(actions) { } diff --git a/dviware/dvisvgm/src/PreScanDVIReader.hpp b/dviware/dvisvgm/src/PreScanDVIReader.hpp index 614beac66e..5176f5a1f3 100644 --- a/dviware/dvisvgm/src/PreScanDVIReader.hpp +++ b/dviware/dvisvgm/src/PreScanDVIReader.hpp @@ -25,8 +25,7 @@ struct DVIActions; -class PreScanDVIReader : public BasicDVIReader -{ +class PreScanDVIReader : public BasicDVIReader { public: PreScanDVIReader (std::istream &is, DVIActions *actions); unsigned currentPageNumber () const override {return _currentPageNumber;} @@ -37,7 +36,7 @@ class PreScanDVIReader : public BasicDVIReader private: DVIActions *_actions; - unsigned _currentPageNumber; + unsigned _currentPageNumber=0; }; #endif diff --git a/dviware/dvisvgm/src/Process.cpp b/dviware/dvisvgm/src/Process.cpp index ff73cb5336..de5394f1fd 100644 --- a/dviware/dvisvgm/src/Process.cpp +++ b/dviware/dvisvgm/src/Process.cpp @@ -22,6 +22,7 @@ #include "windows.hpp" #else #include <csignal> + #include <cstring> #include <fcntl.h> #include <sys/wait.h> #include <unistd.h> @@ -42,7 +43,7 @@ class Subprocess { enum class State {RUNNING, FINISHED, FAILED}; public: - Subprocess (); + Subprocess () =default; Subprocess (const Subprocess&) =delete; Subprocess (Subprocess&&) =delete; ~Subprocess (); @@ -52,11 +53,11 @@ class Subprocess { private: #ifdef _WIN32 - HANDLE _pipeReadHandle; ///< handle of read end of pipe - HANDLE _childProcHandle; ///< handle of child process + HANDLE _pipeReadHandle=NULL; ///< handle of read end of pipe + HANDLE _childProcHandle=NULL; ///< handle of child process #else - int _readfd; ///< file descriptor of read end of pipe - pid_t _pid; ///< PID of the subprocess + int _readfd=-1; ///< file descriptor of read end of pipe + pid_t _pid=-1; ///< PID of the subprocess #endif }; @@ -113,10 +114,6 @@ static inline void close_and_zero_handle (HANDLE &handle) { } -Subprocess::Subprocess() : _pipeReadHandle(NULL), _childProcHandle(NULL) { -} - - Subprocess::~Subprocess () { if (_pipeReadHandle != NULL) CloseHandle(_pipeReadHandle); @@ -214,10 +211,6 @@ Subprocess::State Subprocess::state () { #else // !_WIN32 -Subprocess::Subprocess () : _readfd(-1), _pid(-1) { -} - - Subprocess::~Subprocess () { if (_readfd >= 0) close(_readfd); @@ -276,12 +269,12 @@ static void split_paramstr (string ¶mstr, vector<const char*> ¶ms) { /** Starts a child process. - * @param[in] cmd name of command to execute - * @param[in] paramstr parameters required by command + * @param[in] cmd name of command to execute or absolute path to executable + * @param[in] paramstr parameters required by the command * @returns true if child process started properly */ bool Subprocess::run (const string &cmd, string paramstr) { int pipefd[2]; - if (pipe(pipefd) < 0) + if (cmd.empty() || pipe(pipefd) < 0) return false; _pid = fork(); @@ -299,9 +292,11 @@ bool Subprocess::run (const string &cmd, string paramstr) { vector<const char*> params; params.push_back(cmd.c_str()); split_paramstr(paramstr, params); - params.push_back(nullptr); // trailing null pointer marks end of parameter list - signal(SIGINT, SIG_IGN); // child process is supposed to ignore ctrl-c events - execvp(cmd.c_str(), const_cast<char* const*>(¶ms[0])); + params.push_back(nullptr); // trailing null pointer marks end of parameter list + signal(SIGINT, SIG_IGN); // child process is supposed to ignore ctrl-c events + if (params[0][0] == '/') // absolute path to executable? + params[0] = strrchr(params[0], '/')+1; // filename of executable + execvp(cmd.c_str(), const_cast<char* const*>(params.data())); exit(1); } _readfd = pipefd[0]; diff --git a/dviware/dvisvgm/src/PsSpecialHandler.cpp b/dviware/dvisvgm/src/PsSpecialHandler.cpp index 405da48434..31f8aa55e7 100644 --- a/dviware/dvisvgm/src/PsSpecialHandler.cpp +++ b/dviware/dvisvgm/src/PsSpecialHandler.cpp @@ -214,7 +214,7 @@ bool PsSpecialHandler::process (const string &prefix, istream &is, SpecialAction if (_actions) { StreamInputReader in(is); string fname = in.getQuotedString(in.peek() == '"' ? "\"" : nullptr); - fname = FileSystem::adaptPathSeperators(fname); + fname = FileSystem::ensureForwardSlashes(fname); FileType fileType = FileType::EPS; if (prefix == "pdffile") fileType = FileType::PDF; @@ -392,7 +392,7 @@ unique_ptr<XMLElement> PsSpecialHandler::createImageNode (FileType type, const s unique_ptr<XMLElement> node; string pathstr; if (const char *path = FileFinder::instance().lookup(fname, false)) - pathstr = FileSystem::adaptPathSeperators(path); + pathstr = FileSystem::ensureForwardSlashes(path); if ((pathstr.empty() || !FileSystem::exists(pathstr)) && FileSystem::exists(fname)) pathstr = fname; if (pathstr.empty()) diff --git a/dviware/dvisvgm/src/PsSpecialHandler.hpp b/dviware/dvisvgm/src/PsSpecialHandler.hpp index c7a8a97815..6251e20a47 100644 --- a/dviware/dvisvgm/src/PsSpecialHandler.hpp +++ b/dviware/dvisvgm/src/PsSpecialHandler.hpp @@ -46,7 +46,6 @@ class PsSpecialHandler : public SpecialHandler, protected PSActions { * clipping paths and compute their intersections locally if necessary. */ class ClippingStack { public: - ClippingStack () : _maxID(0) {} void pushEmptyPath (); void push (const Path &path, int saveID=-1); bool replace (const Path &path); @@ -72,7 +71,7 @@ class PsSpecialHandler : public SpecialHandler, protected PSActions { Entry (const Entry &entry) =default; Entry (Entry &&entry) =default; }; - size_t _maxID; + size_t _maxID=0; std::stack<Entry> _stack; ///< stack holding the clipping information of the current graphics context }; diff --git a/dviware/dvisvgm/src/RangeMap.hpp b/dviware/dvisvgm/src/RangeMap.hpp index 128d37c038..9d3f2c2d95 100644 --- a/dviware/dvisvgm/src/RangeMap.hpp +++ b/dviware/dvisvgm/src/RangeMap.hpp @@ -30,7 +30,7 @@ class RangeMap { class Range { friend class RangeMap; public: - Range () : _min(0), _max(0), _minval(0) {} + Range () =default; Range (uint32_t min, uint32_t max, uint32_t minval) : _min(min), _max(max), _minval(minval) { if (_min > _max) @@ -53,8 +53,8 @@ class RangeMap { bool join (const Range &r); private: - uint32_t _min, _max; - uint32_t _minval; + uint32_t _min=0, _max=0; + uint32_t _minval=0; }; using Ranges = std::vector<Range>; diff --git a/dviware/dvisvgm/src/SVGOutput.cpp b/dviware/dvisvgm/src/SVGOutput.cpp index 7c4108c876..1f9e244883 100644 --- a/dviware/dvisvgm/src/SVGOutput.cpp +++ b/dviware/dvisvgm/src/SVGOutput.cpp @@ -35,7 +35,7 @@ using namespace std; SVGOutput::SVGOutput (const string &base, string pattern, int zipLevel) - : _path(base), _pattern(std::move(pattern)), _stdout(base.empty()), _zipLevel(zipLevel), _page(-1) + : _path(base), _pattern(std::move(pattern)), _stdout(base.empty()), _zipLevel(zipLevel) { } diff --git a/dviware/dvisvgm/src/SVGOutput.hpp b/dviware/dvisvgm/src/SVGOutput.hpp index 3c382f0b7f..1f4da20ee8 100644 --- a/dviware/dvisvgm/src/SVGOutput.hpp +++ b/dviware/dvisvgm/src/SVGOutput.hpp @@ -53,7 +53,7 @@ struct SVGOutputBase { class SVGOutput : public SVGOutputBase { public: - SVGOutput () : SVGOutput("", "", 0) {} + SVGOutput () =default; explicit SVGOutput (const std::string &base) : SVGOutput(base, "", 0) {} SVGOutput (const std::string &base, const std::string &pattern) : SVGOutput(base, pattern, 0) {} SVGOutput (const std::string &base, std::string pattern, int zipLevel); @@ -67,9 +67,9 @@ class SVGOutput : public SVGOutputBase { private: FilePath _path; std::string _pattern; - bool _stdout; ///< write to STDOUT? - int _zipLevel; ///< compression level - mutable int _page; ///< number of current page being written + bool _stdout=true; ///< write to STDOUT? + int _zipLevel=0; ///< compression level + mutable int _page=-1; ///< number of current page being written mutable std::unique_ptr<std::ostream> _osptr; }; diff --git a/dviware/dvisvgm/src/SignalHandler.cpp b/dviware/dvisvgm/src/SignalHandler.cpp index 886c9281bb..5af70be2e4 100644 --- a/dviware/dvisvgm/src/SignalHandler.cpp +++ b/dviware/dvisvgm/src/SignalHandler.cpp @@ -49,7 +49,7 @@ class SignalHandler::Impl { SignalHandler::SignalHandler () - : _active(false), _impl(util::make_unique<SignalHandler::Impl>()) + : _impl(util::make_unique<SignalHandler::Impl>()) { } @@ -89,7 +89,7 @@ void SignalHandler::stop () { /** Checks for incoming signals and throws an exception if CTRL-C was caught. * @throw SignalException */ -void SignalHandler::check() { +void SignalHandler::check () { if (_break) throw SignalException(); } diff --git a/dviware/dvisvgm/src/SignalHandler.hpp b/dviware/dvisvgm/src/SignalHandler.hpp index 827f9e0962..b97449399e 100644 --- a/dviware/dvisvgm/src/SignalHandler.hpp +++ b/dviware/dvisvgm/src/SignalHandler.hpp @@ -45,7 +45,7 @@ class SignalHandler { static void callback (int signal); private: - bool _active; ///< true if listening for signals + bool _active=false; ///< true if listening for signals static volatile bool _break; ///< true if signal has been caught class Impl; std::unique_ptr<Impl> _impl; ///< system-specific data/functions diff --git a/dviware/dvisvgm/src/TFM.hpp b/dviware/dvisvgm/src/TFM.hpp index 668ff39083..f2fd3027eb 100644 --- a/dviware/dvisvgm/src/TFM.hpp +++ b/dviware/dvisvgm/src/TFM.hpp @@ -30,8 +30,7 @@ class StreamReader; -class TFM : public FontMetrics -{ +class TFM : public FontMetrics { public: explicit TFM (std::istream &is); double getCharWidth (int c) const override; @@ -51,7 +50,7 @@ class TFM : public FontMetrics uint16_t lastChar () const override {return _lastChar;} protected: - TFM () : _checksum(0), _firstChar(0), _lastChar(0), _designSize(0), _params(7) {} + TFM () : _params(7) {} void readHeader (StreamReader &reader); void readTables (StreamReader &reader, int nw, int nh, int nd, int ni); void readParameters (StreamReader &reader, int np); @@ -59,9 +58,9 @@ class TFM : public FontMetrics void setCharRange (int firstchar, int lastchar) {_firstChar=firstchar; _lastChar=lastchar;} private: - uint32_t _checksum; - uint16_t _firstChar, _lastChar; - double _designSize; ///< design size of the font in PS points (72bp = 1in) + uint32_t _checksum=0; + uint16_t _firstChar=0, _lastChar=0; + double _designSize=0; ///< design size of the font in PS points (72bp = 1in) std::vector<uint32_t> _charInfoTable; std::vector<FixWord> _widthTable; ///< character widths in design size units std::vector<FixWord> _heightTable; ///< character height in design size units diff --git a/dviware/dvisvgm/src/VFReader.cpp b/dviware/dvisvgm/src/VFReader.cpp index cff67c919c..47f5e3f7b6 100644 --- a/dviware/dvisvgm/src/VFReader.cpp +++ b/dviware/dvisvgm/src/VFReader.cpp @@ -28,11 +28,6 @@ using namespace std; -VFReader::VFReader (istream &is) : StreamReader(is) -{ -} - - VFActions* VFReader::replaceActions (VFActions *a) { VFActions *ret = _actions; _actions = a; diff --git a/dviware/dvisvgm/src/VFReader.hpp b/dviware/dvisvgm/src/VFReader.hpp index 8ddba805e8..bd42289039 100644 --- a/dviware/dvisvgm/src/VFReader.hpp +++ b/dviware/dvisvgm/src/VFReader.hpp @@ -31,10 +31,10 @@ struct VFException : public MessageException { struct VFActions; -class VFReader : public StreamReader{ +class VFReader : public StreamReader { using ApproveAction = bool (*)(int); public: - explicit VFReader (std::istream &is); + explicit VFReader (std::istream &is) : StreamReader(is) {} VFActions* replaceActions (VFActions *a); bool executeAll (); bool executePreambleAndFontDefs (); diff --git a/dviware/dvisvgm/src/VectorStream.hpp b/dviware/dvisvgm/src/VectorStream.hpp index c74388e076..9672e67435 100644 --- a/dviware/dvisvgm/src/VectorStream.hpp +++ b/dviware/dvisvgm/src/VectorStream.hpp @@ -28,9 +28,7 @@ template <typename T> class VectorStreamBuffer : public std::streambuf { public: explicit VectorStreamBuffer (const std::vector<T> &v) { - if (v.empty()) - _begin = _end = _curr = nullptr; - else { + if (!v.empty()) { _begin = _curr = &v[0]; _end = &v[0]+v.size(); } @@ -68,9 +66,9 @@ class VectorStreamBuffer : public std::streambuf { } private: - const T *_begin; - const T *_end; - const T *_curr; + const T *_begin=nullptr; + const T *_end=nullptr; + const T *_curr=nullptr; }; diff --git a/dviware/dvisvgm/src/dvisvgm.cpp b/dviware/dvisvgm/src/dvisvgm.cpp index 37584d5ddb..5828299fce 100644 --- a/dviware/dvisvgm/src/dvisvgm.cpp +++ b/dviware/dvisvgm/src/dvisvgm.cpp @@ -64,7 +64,7 @@ using namespace std; //////////////////////////////////////////////////////////////////////////////// static string remove_path (string fname) { - fname = FileSystem::adaptPathSeperators(fname); + fname = FileSystem::ensureForwardSlashes(fname); size_t slashpos = fname.rfind('/'); if (slashpos == string::npos) return fname; diff --git a/dviware/dvisvgm/src/psdefs.cpp b/dviware/dvisvgm/src/psdefs.cpp index d38e2354e0..04abb6227d 100644 --- a/dviware/dvisvgm/src/psdefs.cpp +++ b/dviware/dvisvgm/src/psdefs.cpp @@ -22,103 +22,104 @@ const char *PSInterpreter::PSDEFS = "<</Install{matrix setmatrix}/HWResolution[72 72]/PageSize[10000 10000]/Imaging" -"BBox null>>setpagedevice/@dodraw true store/@nulldev false store/@patcnt 0 sto" -"re/@SD systemdict def/@UD userdict def true setglobal @SD/:save @SD/save get p" -"ut @SD/:restore @SD/restore get put @SD/:gsave @SD/gsave get put @SD/:grestore" -" @SD/grestore get put @SD/:grestoreall @SD/grestoreall get put @SD/:newpath @S" -"D/newpath get put @SD/:stroke @SD/stroke get put @SD/:fill @SD/fill get put @S" -"D/:eofill @SD/eofill get put @SD/:clip @SD/clip get put @SD/:eoclip @SD/eoclip" -" get put @SD/:charpath @SD/charpath get put @SD/:show @SD/show get put @SD/:st" -"ringwidth @SD/stringwidth get put @SD/:nulldevice @SD/nulldevice get put @SD/." -"setopacityalpha known not{@SD/.setopacityalpha{pop}put}if @SD/.setshapealpha k" -"nown not{@SD/.setshapealpha{pop}put}if @SD/.setblendmode known not{@SD/.setble" -"ndmode{pop}put}if @SD/prseq{-1 1{-1 roll =only( )print}for(\\n)print}put @SD/p" -"rcmd{( )exch(\\ndvi.)3{print}repeat prseq}put @SD/cvxall{{cvx}forall}put @SD/d" -"efpr{[exch[/copy @SD]cvxall 5 -1 roll dup 6 1 roll[/get/exec]cvxall 6 -1 roll " -"dup 7 1 roll 4 -1 roll dup 5 1 roll dup length string cvs/prcmd cvx]cvx def}pu" -"t @SD/querypos{{currentpoint}stopped{$error/newerror false put}{2(querypos)prc" -"md}ifelse}put @SD/applyscalevals{1 0 dtransform exch dup mul exch dup mul add " -"sqrt 0 1 dtransform exch dup mul exch dup mul add sqrt 1 0 dtransform dup mul " -"exch dup dup mul 3 -1 roll add dup 0 eq{pop}{sqrt div}ifelse 3(applyscalevals)" -"prcmd}put @SD/prpath{{2(moveto)prcmd}{2(lineto)prcmd}{6(curveto)prcmd}{0(close" -"path)prcmd}pathforall}put @SD/nulldevice{/@nulldev true store :nulldevice 1 1(" -"setnulldevice)prcmd}put @SD/charpath{/@dodraw false store :charpath/@dodraw tr" -"ue store}put @SD/stringwidth{/@dodraw false store :stringwidth/@dodraw true st" -"ore}put @SD/show{@dodraw @nulldev not and{dup :gsave currentpoint 2{50 mul exc" -"h}repeat :newpath moveto 50 50/scale sysexec true charpath fill :grestore/@dod" -"raw false store :show/@dodraw true store}{:show}ifelse}put @SD/varxyshow{exch " -"dup type/arraytype eq{<</arr 3 -1 roll/prc 5 -1 roll/chr 1 string/idx 0>>begin" -"{chr 0 3 -1 roll put :gsave chr show :grestore currentpoint prc moveto/idx idx" -" 1 add store}forall end}{pop show}ifelse}put @SD/xyshow{{exch arr idx 2 mul ge" -"t add exch arr idx 2 mul 1 add get add}varxyshow}put @SD/xshow{{exch arr idx g" -"et add exch}varxyshow}put @SD/yshow{{arr idx get add}varxyshow}put @SD/awidths" -"how{{1 string dup 0 5 index put :gsave show :grestore pop 0 rmoveto 3 index eq" -"{4 index 4 index rmoveto}if 1 index 1 index rmoveto}exch cshow 5{pop}repeat}pu" -"t @SD/widthshow{0 0 3 -1 roll pstack awidthshow}put @SD/ashow{0 0 0 6 3 roll a" -"widthshow}put @SD/newpath{:newpath 1 1(newpath)prcmd}put @SD/stroke{@dodraw @n" -"ulldev not and{prcolor 0 1(newpath)prcmd prpath 0(stroke)prcmd :newpath}{:stro" -"ke}ifelse}put @SD/fill{@dodraw @nulldev not and{prcolor 0 1(newpath)prcmd prpa" -"th 0(fill)prcmd :newpath}{:fill}ifelse}put @SD/eofill{@dodraw @nulldev not and" -"{prcolor 0 1(newpath)prcmd prpath 0(eofill)prcmd :newpath}{:eofill}ifelse}put " -"@SD/clip{:clip @nulldev not{0 1(newpath)prcmd prpath 0(clip)prcmd}if}put @SD/e" -"oclip{:eoclip @nulldev not{0 1(newpath)prcmd prpath 0(eoclip)prcmd}}put @SD/sh" -"fill{begin currentdict/ShadingType known currentdict/ColorSpace known and curr" -"entdict/DataSource known and currentdict/Function known not and ShadingType 4 " -"ge and DataSource type/arraytype eq and{<</DeviceGray 1/DeviceRGB 3/DeviceCMYK" -" 4/bgknown currentdict/Background known/bbknown currentdict/BBox known>>begin " -"currentdict ColorSpace known{ShadingType ColorSpace load bgknown{1 Background " -"aload pop}{0}ifelse bbknown{1 BBox aload pop}{0}ifelse ShadingType 5 eq{Vertic" -"esPerRow}if DataSource aload length 4 add bgknown{ColorSpace load add}if bbkno" -"wn{4 add}if ShadingType 5 eq{1 add}if(shfill)prcmd}if end}if end}put/@rect{4 -" -"2 roll moveto exch dup 0 rlineto exch 0 exch rlineto neg 0 rlineto closepath}b" -"ind def/@rectcc{4 -2 roll moveto 2 copy 0 lt exch 0 lt xor{dup 0 exch rlineto " -"exch 0 rlineto neg 0 exch rlineto}{exch dup 0 rlineto exch 0 exch rlineto neg " -"0 rlineto}ifelse closepath}bind def @SD/rectclip{:newpath dup type/arraytype e" -"q{aload length 4 idiv{@rectcc}repeat}{@rectcc}ifelse clip :newpath}put @SD/rec" -"tfill{gsave :newpath dup type/arraytype eq{aload length 4 idiv{@rectcc}repeat}" -"{@rectcc}ifelse fill grestore}put @SD/rectstroke{gsave :newpath dup type/array" -"type eq{aload length 4 idiv{@rect}repeat}{@rect}ifelse stroke grestore}put fal" -"se setglobal @SD readonly pop/initclip 0 defpr/clippath 0 defpr/sysexec{@SD ex" -"ch get exec}def/adddot{dup length 1 add string dup 0 46 put dup 3 -1 roll 1 ex" -"ch putinterval}def/setlinewidth{dup/setlinewidth sysexec 1(setlinewidth)prcmd}" -"def/setlinecap 1 defpr/setlinejoin 1 defpr/setmiterlimit 1 defpr/setdash{mark " -"3 1 roll 2 copy/setdash sysexec exch aload length 1 add -1 roll counttomark(se" -"tdash)prcmd pop}def/@setpagedevice{pop<<>>/setpagedevice sysexec matrix setmat" -"rix newpath 0(setpagedevice)prcmd}def/@checknulldev{@nulldev{currentpagedevice" -" maxlength 0 ne{/@nulldev false store 0 1(setnulldevice)prcmd}if}if}def/prcolo" -"r{currentrgbcolor 3(setrgbcolor)prcmd}def/printgstate{@dodraw @nulldev not and" -"{matrix currentmatrix aload pop 6(setmatrix)prcmd applyscalevals currentlinewi" -"dth 1(setlinewidth)prcmd currentlinecap 1(setlinecap)prcmd currentlinejoin 1(s" -"etlinejoin)prcmd currentmiterlimit 1(setmiterlimit)prcmd currentrgbcolor 3(set" -"rgbcolor)prcmd currentdash mark 3 1 roll exch aload length 1 add -1 roll count" -"tomark(setdash)prcmd pop}if}def/setgstate{/setgstate sysexec printgstate}def/s" -"ave{@UD begin/@saveID vmstatus pop pop def end :save @saveID 1(save)prcmd}def/" -"restore{:restore @checknulldev printgstate @UD/@saveID known{@UD begin @saveID" -" end}{0}ifelse 1(restore)prcmd}def/gsave 0 defpr/grestore{:grestore @checknull" -"dev printgstate 0(grestore)prcmd}def/grestoreall{:grestoreall @checknulldev se" -"tstate 0(grestoreall)prcmd}def/rotate{dup type/arraytype ne @dodraw and{dup 1(" -"rotate)prcmd}if/rotate sysexec applyscalevals}def/scale{dup type/arraytype ne " -"@dodraw and{2 copy 2(scale)prcmd}if/scale sysexec applyscalevals}def/translate" -"{dup type/arraytype ne @dodraw and{2 copy 2(translate)prcmd}if/translate sysex" -"ec}def/setmatrix{dup/setmatrix sysexec @dodraw{aload pop 6(setmatrix)prcmd app" -"lyscalevals}{pop}ifelse}def/initmatrix{matrix setmatrix}def/concat{matrix curr" -"entmatrix matrix concatmatrix setmatrix}def/makepattern{gsave<</mx 3 -1 roll>>" -"begin dup/XUID[1000000 @patcnt]put mx/makepattern sysexec dup dup begin Patter" -"nType @patcnt BBox aload pop XStep YStep PaintType mx aload pop 15(makepattern" -")prcmd :newpath matrix setmatrix PaintProc 0 1(makepattern)prcmd end/@patcnt @" -"patcnt 1 add store end grestore}def/setpattern{begin PatternType 1 eq{PaintTyp" -"e 1 eq{XUID aload pop exch pop 1}{:gsave[currentcolorspace aload length -1 rol" -"l pop]setcolorspace/setcolor sysexec XUID aload pop exch pop currentrgbcolor :" -"grestore 4}ifelse(setpattern)prcmd}{/setpattern sysexec}ifelse end}def/setcolo" -"r{dup type/dicttype eq{setpattern}{/setcolor sysexec/currentrgbcolor sysexec s" -"etrgbcolor}ifelse}def/setgray 1 defpr/setcmykcolor 4 defpr/sethsbcolor 3 defpr" -"/setrgbcolor 3 defpr/.setopacityalpha{dup/.setopacityalpha sysexec 1(setopacit" -"yalpha)prcmd}def/.setshapealpha{dup/.setshapealpha sysexec 1(setshapealpha)prc" -"md}def/.setblendmode{dup/.setblendmode sysexec<</Normal 0/Compatible 0/Multipl" -"y 1/Screen 2/Overlay 3/SoftLight 4/HardLight 5/ColorDodge 6/ColorBurn 7/Darken" -" 8/Lighten 9/Difference 10/Exclusion 11/Hue 12/Saturation 13/Color 14/Luminosi" -"ty 15/CompatibleOverprint 16>>exch get 1(setblendmode)prcmd}def/@pdfpagecount{" -"(r)file runpdfbegin pdfpagecount runpdfend}def/@pdfpagebox{(r)file runpdfbegin" -" dup dup 1 lt exch pdfpagecount gt or{pop}{pdfgetpage/MediaBox pget pop aload " -"pop}ifelse runpdfend}def DELAYBIND{.bindnow}if "; +"BBox null>>setpagedevice/@dodraw true store/@patcnt 0 store/@GD globaldict def" +"/@SD systemdict def/@UD userdict def @GD/@nulldev false put true setglobal @SD" +"/:save @SD/save get put @SD/:restore @SD/restore get put @SD/:gsave @SD/gsave " +"get put @SD/:grestore @SD/grestore get put @SD/:grestoreall @SD/grestoreall ge" +"t put @SD/:newpath @SD/newpath get put @SD/:stroke @SD/stroke get put @SD/:fil" +"l @SD/fill get put @SD/:eofill @SD/eofill get put @SD/:clip @SD/clip get put @" +"SD/:eoclip @SD/eoclip get put @SD/:charpath @SD/charpath get put @SD/:show @SD" +"/show get put @SD/:stringwidth @SD/stringwidth get put @SD/:nulldevice @SD/nul" +"ldevice get put @SD/.setopacityalpha known not{@SD/.setopacityalpha{pop}put}if" +" @SD/.setshapealpha known not{@SD/.setshapealpha{pop}put}if @SD/.setblendmode " +"known not{@SD/.setblendmode{pop}put}if @SD/prseq{-1 1{-1 roll =only( )print}fo" +"r(\\n)print}put @SD/prcmd{( )exch(\\ndvi.)3{print}repeat prseq}put @SD/cvxall{" +"{cvx}forall}put @SD/defpr{[exch[/copy @SD]cvxall 5 -1 roll dup 6 1 roll[/get/e" +"xec]cvxall 6 -1 roll dup 7 1 roll 4 -1 roll dup 5 1 roll dup length string cvs" +"/prcmd cvx]cvx def}put @SD/querypos{{currentpoint}stopped{$error/newerror fals" +"e put}{2(querypos)prcmd}ifelse}put @SD/applyscalevals{1 0 dtransform exch dup " +"mul exch dup mul add sqrt 0 1 dtransform exch dup mul exch dup mul add sqrt 1 " +"0 dtransform dup mul exch dup dup mul 3 -1 roll add dup 0 eq{pop}{sqrt div}ife" +"lse 3(applyscalevals)prcmd}put @SD/prpath{{2(moveto)prcmd}{2(lineto)prcmd}{6(c" +"urveto)prcmd}{0(closepath)prcmd}pathforall}put @SD/nulldevice{@GD/@nulldev tru" +"e put :nulldevice 1 1(setnulldevice)prcmd}put @SD/charpath{/@dodraw false stor" +"e :charpath/@dodraw true store}put @SD/stringwidth{/@dodraw false store :strin" +"gwidth/@dodraw true store}put @SD/show{@dodraw @GD/@nulldev get not and{dup :g" +"save currentpoint 2{50 mul exch}repeat :newpath moveto 50 50/scale sysexec tru" +"e charpath fill :grestore/@dodraw false store :show/@dodraw true store}{:show}" +"ifelse}put @SD/varxyshow{exch dup type/arraytype eq{<</arr 3 -1 roll/prc 5 -1 " +"roll/chr 1 string/idx 0>>begin{chr 0 3 -1 roll put :gsave chr show :grestore c" +"urrentpoint prc moveto/idx idx 1 add store}forall end}{pop show}ifelse}put @SD" +"/xyshow{{exch arr idx 2 mul get add exch arr idx 2 mul 1 add get add}varxyshow" +"}put @SD/xshow{{exch arr idx get add exch}varxyshow}put @SD/yshow{{arr idx get" +" add}varxyshow}put @SD/awidthshow{{1 string dup 0 5 index put :gsave show :gre" +"store pop 0 rmoveto 3 index eq{4 index 4 index rmoveto}if 1 index 1 index rmov" +"eto}exch cshow 5{pop}repeat}put @SD/widthshow{0 0 3 -1 roll pstack awidthshow}" +"put @SD/ashow{0 0 0 6 3 roll awidthshow}put @SD/newpath{:newpath 1 1(newpath)p" +"rcmd}put @SD/stroke{@dodraw @GD/@nulldev get not and{prcolor 0 1(newpath)prcmd" +" prpath 0(stroke)prcmd :newpath}{:stroke}ifelse}put @SD/fill{@dodraw @GD/@null" +"dev get not and{prcolor 0 1(newpath)prcmd prpath 0(fill)prcmd :newpath}{:fill}" +"ifelse}put @SD/eofill{@dodraw @GD/@nulldev get not and{prcolor 0 1(newpath)prc" +"md prpath 0(eofill)prcmd :newpath}{:eofill}ifelse}put @SD/clip{:clip @GD/@null" +"dev get not{0 1(newpath)prcmd prpath 0(clip)prcmd}if}put @SD/eoclip{:eoclip @G" +"D/@nulldev get not{0 1(newpath)prcmd prpath 0(eoclip)prcmd}}put @SD/shfill{beg" +"in currentdict/ShadingType known currentdict/ColorSpace known and currentdict/" +"DataSource known and currentdict/Function known not and ShadingType 4 ge and D" +"ataSource type/arraytype eq and{<</DeviceGray 1/DeviceRGB 3/DeviceCMYK 4/bgkno" +"wn currentdict/Background known/bbknown currentdict/BBox known>>begin currentd" +"ict ColorSpace known{ShadingType ColorSpace load bgknown{1 Background aload po" +"p}{0}ifelse bbknown{1 BBox aload pop}{0}ifelse ShadingType 5 eq{VerticesPerRow" +"}if DataSource aload length 4 add bgknown{ColorSpace load add}if bbknown{4 add" +"}if ShadingType 5 eq{1 add}if(shfill)prcmd}if end}if end}put/@rect{4 -2 roll m" +"oveto exch dup 0 rlineto exch 0 exch rlineto neg 0 rlineto closepath}bind def/" +"@rectcc{4 -2 roll moveto 2 copy 0 lt exch 0 lt xor{dup 0 exch rlineto exch 0 r" +"lineto neg 0 exch rlineto}{exch dup 0 rlineto exch 0 exch rlineto neg 0 rlinet" +"o}ifelse closepath}bind def @SD/rectclip{:newpath dup type/arraytype eq{aload " +"length 4 idiv{@rectcc}repeat}{@rectcc}ifelse clip :newpath}put @SD/rectfill{gs" +"ave :newpath dup type/arraytype eq{aload length 4 idiv{@rectcc}repeat}{@rectcc" +"}ifelse fill grestore}put @SD/rectstroke{gsave :newpath dup type/arraytype eq{" +"aload length 4 idiv{@rect}repeat}{@rect}ifelse stroke grestore}put false setgl" +"obal @SD readonly pop/initclip 0 defpr/clippath 0 defpr/sysexec{@SD exch get e" +"xec}def/adddot{dup length 1 add string dup 0 46 put dup 3 -1 roll 1 exch putin" +"terval}def/setlinewidth{dup/setlinewidth sysexec 1(setlinewidth)prcmd}def/setl" +"inecap 1 defpr/setlinejoin 1 defpr/setmiterlimit 1 defpr/setdash{mark 3 1 roll" +" 2 copy/setdash sysexec exch aload length 1 add -1 roll counttomark(setdash)pr" +"cmd pop}def/@setpagedevice{pop<<>>/setpagedevice sysexec matrix setmatrix newp" +"ath 0(setpagedevice)prcmd}def/@checknulldev{@GD/@nulldev get{currentpagedevice" +" maxlength 0 ne{@GD/@nulldev false put 0 1(setnulldevice)prcmd}if}if}def/prcol" +"or{currentrgbcolor 3(setrgbcolor)prcmd}def/printgstate{@dodraw @GD/@nulldev ge" +"t not and{matrix currentmatrix aload pop 6(setmatrix)prcmd applyscalevals curr" +"entlinewidth 1(setlinewidth)prcmd currentlinecap 1(setlinecap)prcmd currentlin" +"ejoin 1(setlinejoin)prcmd currentmiterlimit 1(setmiterlimit)prcmd currentrgbco" +"lor 3(setrgbcolor)prcmd currentdash mark 3 1 roll exch aload length 1 add -1 r" +"oll counttomark(setdash)prcmd pop}if}def/setgstate{/setgstate sysexec printgst" +"ate}def/save{@UD begin/@saveID vmstatus pop pop def end :save @saveID 1(save)p" +"rcmd}def/restore{:restore @checknulldev printgstate @UD/@saveID known{@UD begi" +"n @saveID end}{0}ifelse 1(restore)prcmd}def/gsave 0 defpr/grestore{:grestore @" +"checknulldev printgstate 0(grestore)prcmd}def/grestoreall{:grestoreall @checkn" +"ulldev setstate 0(grestoreall)prcmd}def/rotate{dup type/arraytype ne @dodraw a" +"nd{dup 1(rotate)prcmd}if/rotate sysexec applyscalevals}def/scale{dup type/arra" +"ytype ne @dodraw and{2 copy 2(scale)prcmd}if/scale sysexec applyscalevals}def/" +"translate{dup type/arraytype ne @dodraw and{2 copy 2(translate)prcmd}if/transl" +"ate sysexec}def/setmatrix{dup/setmatrix sysexec @dodraw{aload pop 6(setmatrix)" +"prcmd applyscalevals}{pop}ifelse}def/initmatrix{matrix setmatrix}def/concat{ma" +"trix currentmatrix matrix concatmatrix setmatrix}def/makepattern{gsave<</mx 3 " +"-1 roll>>begin dup/XUID[1000000 @patcnt]put mx/makepattern sysexec dup dup beg" +"in PatternType @patcnt BBox aload pop XStep YStep PaintType mx aload pop 15(ma" +"kepattern)prcmd :newpath matrix setmatrix PaintProc 0 1(makepattern)prcmd end/" +"@patcnt @patcnt 1 add store end grestore}def/setpattern{begin PatternType 1 eq" +"{PaintType 1 eq{XUID aload pop exch pop 1}{:gsave[currentcolorspace aload leng" +"th -1 roll pop]setcolorspace/setcolor sysexec XUID aload pop exch pop currentr" +"gbcolor :grestore 4}ifelse(setpattern)prcmd}{/setpattern sysexec}ifelse end}de" +"f/setcolor{dup type/dicttype eq{setpattern}{/setcolor sysexec/currentrgbcolor " +"sysexec setrgbcolor}ifelse}def/setgray 1 defpr/setcmykcolor 4 defpr/sethsbcolo" +"r 3 defpr/setrgbcolor 3 defpr/.setopacityalpha{dup/.setopacityalpha sysexec 1(" +"setopacityalpha)prcmd}def/.setshapealpha{dup/.setshapealpha sysexec 1(setshape" +"alpha)prcmd}def/.setblendmode{dup/.setblendmode sysexec<</Normal 0/Compatible " +"0/Multiply 1/Screen 2/Overlay 3/SoftLight 4/HardLight 5/ColorDodge 6/ColorBurn" +" 7/Darken 8/Lighten 9/Difference 10/Exclusion 11/Hue 12/Saturation 13/Color 14" +"/Luminosity 15/CompatibleOverprint 16>>exch get 1(setblendmode)prcmd}def/@pdfp" +"agecount{(r)file runpdfbegin pdfpagecount runpdfend}def/@pdfpagebox{(r)file ru" +"npdfbegin dup dup 1 lt exch pdfpagecount gt or{pop}{pdfgetpage/MediaBox pget p" +"op aload pop}ifelse runpdfend}def DELAYBIND{.bindnow}if "; |