Changeset 549


Ignore:
Timestamp:
May 9, 2019, 10:43:55 PM (5 years ago)
Author:
katerina
Message:

Fix for ticket #440 (obsolete sstrip utility) and #441 (make deb broken).

Location:
trunk
Files:
2 deleted
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Makefile.in

    r548 r549  
    151151        $(srcsrc)/bignum.c $(srcsrc)/mkhdr.c \
    152152        $(srcsrc)/samhain_setpwd.c $(srcsrc)/samhain_stealth.c \
    153         $(srcsrc)/encode.c $(srcsrc)/sstrip.c \
     153        $(srcsrc)/encode.c \
    154154        $(srcsrc)/trustfile.c $(srcsrc)/exepack.c \
    155155        $(srcsrc)/exepack_fill.c $(srcsrc)/exepack_mkdata.c \
     
    232232#----------------------------------------------------------
    233233
    234 all: $(top_srcdir)/depend.sum $(SETPWD) $(STEGIN) $(SAMHAIN) $(YULECTL) sstrip
     234all: $(top_srcdir)/depend.sum $(SETPWD) $(STEGIN) $(SAMHAIN) $(YULECTL)
    235235
    236236
     
    363363
    364364CLEANFILES = encode config_xor.h depend-gen \
    365         internal.h sh_MK.h trustfile sstrip samhain mkhdr encode cutest \
     365        internal.h sh_MK.h trustfile samhain mkhdr encode cutest \
    366366        yule samhain_setpwd samhain_stealth samhainrc yulectl
    367367
     
    515515
    516516
    517 install-program: $(PROGRAMS) sstrip
     517install-program: $(PROGRAMS)
    518518        @$(mkinstalldirs) $(DESTDIR)$(sbindir)
    519519        @if test x$(mytmpdir) != x; then \
     
    528528              $(INSTALL_PROGRAM) $$p $$target; \
    529529              chmod 0700 $$target; \
    530               echo " ./sstrip $$target"; \
    531               ./sstrip $$target; \
    532530            else \
    533531              echo " $(INSTALL_SHELL) $$p $$target"; \
     
    840838        echo $(top_srcdir)/docs/README.gcc_bug           >> debian/docs; \
    841839        echo $(top_srcdir)/docs/README.LZO               >> debian/docs; \
    842         echo $(top_srcdir)/docs/README.sstrip            >> debian/docs; \
    843840        echo $(top_srcdir)/docs/README.UPGRADE           >> debian/docs; \
    844841        echo $(top_srcdir)/docs/README.win2K             >> debian/docs; \
     
    860857        echo " -- $$maintainer  `date -R`" >> debian/changelog; \
    861858        echo >> debian/changelog; \
    862         echo "Local variables:" >> debian/changelog; \
    863         echo "mode: debian-changelog" >> debian/changelog; \
    864         echo "End:" >> debian/changelog; \
    865859        cp   $(top_srcdir)/COPYING  debian/copyright; \
    866860        echo "9" > debian/compat; \
     
    890884        echo "Priority: optional" >> debian/control; \
    891885        echo "Maintainer: $$maintainer" >> debian/control; \
    892         echo "Standards-Version: 3.2.1" >> debian/control; \
     886        echo "Build-Depends: debhelper (>> 9)" >> debian/control; \
     887        echo "Standards-Version: 3.9.8" >> debian/control; \
    893888        echo >> debian/control; \
    894889        echo "Package: @install_name@" >> debian/control; \
     
    11301125
    11311126
    1132 sstrip: $(srcsrc)/sstrip.c Makefile
    1133         $(BUILD_CC) -I.  -o sstrip $(srcsrc)/sstrip.c
    1134 
    11351127encode: $(srcsrc)/encode.c Makefile
    11361128        $(BUILD_CC) -I. -o encode $(srcsrc)/encode.c
     
    12591251# prepare the data to be packed
    12601252#
    1261 exepack.data: $(SAMHAIN) exepack_mkdata sstrip
     1253exepack.data: $(SAMHAIN) exepack_mkdata
    12621254        @echo "cp ./$(SAMHAIN) ./samhain.pk.data"; \
    12631255        cp ./$(SAMHAIN) ./samhain.pk.data; \
    12641256        echo "strip ./samhain.pk.data"; \
    12651257        strip ./samhain.pk.data > /dev/null 2>&1  || echo "... is already stripped"; \
    1266         echo "./sstrip ./samhain.pk.data"; \
    1267         ./sstrip ./samhain.pk.data > /dev/null 2>&1  || echo "sstrip returned false"; \
    12681258        echo "./exepack_mkdata ./samhain.pk.data ./exepack.data 0"; \
    12691259        ./exepack_mkdata ./samhain.pk.data ./exepack.data 0; \
     
    12861276        $(LINK) exepack_fill.o minilzo.o
    12871277
    1288 samhain.pk: $(SAMHAIN) exepack exepack_fill sstrip
     1278samhain.pk: $(SAMHAIN) exepack exepack_fill
    12891279        @echo "cp ./$(SAMHAIN) ./samhain.pk.data"; \
    12901280        cp ./$(SAMHAIN) ./samhain.pk.data; \
    12911281        echo "strip ./samhain.pk.data"; \
    12921282        strip ./samhain.pk.data > /dev/null 2>&1  || echo "... is already stripped"; \
    1293         echo "./sstrip ./samhain.pk.data"; \
    1294         ./sstrip ./samhain.pk.data > /dev/null 2>&1  || echo "sstrip returned false"; \
    12951283        test -f exepack.out && rm exepack.out; \
    12961284        echo "./exepack_fill exepack samhain.pk.data exepack.out"; \
     
    12991287        echo "strip exepack.out"; \
    13001288        strip exepack.out > /dev/null 2>&1 || echo "... is already stripped"; \
    1301         ./sstrip exepack.out > /dev/null 2>&1 || echo "sstrip returned false"; \
    13021289        echo "mv exepack.out samhain.pk"; \
    13031290        rm -f samhain.pk; mv exepack.out samhain.pk
     
    16731660samhain_stealth.o: $(srcsrc)/samhain_stealth.c Makefile config_xor.h
    16741661encode.o: $(srcsrc)/encode.c Makefile
    1675 sstrip.o: $(srcsrc)/sstrip.c Makefile config.h
    16761662trustfile.o: $(srcsrc)/trustfile.c Makefile config_xor.h $(srcinc)/sh_calls.h $(srcinc)/slib.h $(srcinc)/sh_static.h $(srcinc)/sh_pthread.h
    16771663exepack.o: $(srcsrc)/exepack.c Makefile config.h $(srcinc)/minilzo.h $(srcinc)/exepack.data
  • trunk/config.guess

    r481 r549  
    11#! /bin/sh
    22# Attempt to guess a canonical system name.
    3 #   Copyright 1992-2014 Free Software Foundation, Inc.
    4 
    5 timestamp='2014-03-23'
     3#   Copyright 1992-2018 Free Software Foundation, Inc.
     4
     5timestamp='2018-02-24'
    66
    77# This file is free software; you can redistribute it and/or modify it
     
    1616#
    1717# You should have received a copy of the GNU General Public License
    18 # along with this program; if not, see <http://www.gnu.org/licenses/>.
     18# along with this program; if not, see <https://www.gnu.org/licenses/>.
    1919#
    2020# As a special exception to the GNU General Public License, if you
     
    2525# of the GNU General Public License, version 3 ("GPLv3").
    2626#
    27 # Originally written by Per Bothner.
     27# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
    2828#
    2929# You can get the latest version of this script from:
    30 # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
     30# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
    3131#
    32 # Please send patches with a ChangeLog entry to config-patches@gnu.org.
     32# Please send patches to <config-patches@gnu.org>.
    3333
    3434
     
    4040Output the configuration name of the system \`$me' is run on.
    4141
    42 Operation modes:
     42Options:
    4343  -h, --help         print this help, then exit
    4444  -t, --time-stamp   print date of last modification, then exit
     
    5151
    5252Originally written by Per Bothner.
    53 Copyright 1992-2014 Free Software Foundation, Inc.
     53Copyright 1992-2018 Free Software Foundation, Inc.
    5454
    5555This is free software; see the source for copying conditions.  There is NO
     
    108108tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
    109109case $CC_FOR_BUILD,$HOST_CC,$CC in
    110  ,,)    echo "int x;" > $dummy.c ;
     110 ,,)    echo "int x;" > "$dummy.c" ;
    111111        for c in cc gcc c89 c99 ; do
    112           if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
     112          if ($c -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
    113113             CC_FOR_BUILD="$c"; break ;
    114114          fi ;
     
    133133UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
    134134
    135 case "${UNAME_SYSTEM}" in
     135case "$UNAME_SYSTEM" in
    136136Linux|GNU|GNU/*)
    137137        # If the system lacks a compiler, then just pick glibc.
     
    139139        LIBC=gnu
    140140
    141         eval $set_cc_for_build
    142         cat <<-EOF > $dummy.c
     141        eval "$set_cc_for_build"
     142        cat <<-EOF > "$dummy.c"
    143143        #include <features.h>
    144144        #if defined(__UCLIBC__)
     
    150150        #endif
    151151        EOF
    152         eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
     152        eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`"
     153
     154        # If ldd exists, use it to detect musl libc.
     155        if command -v ldd >/dev/null && \
     156                ldd --version 2>&1 | grep -q ^musl
     157        then
     158            LIBC=musl
     159        fi
    153160        ;;
    154161esac
     
    156163# Note: order is significant - the case branches are not exclusive.
    157164
    158 case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
     165case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
    159166    *:NetBSD:*:*)
    160167        # NetBSD (nbsd) targets should (where applicable) match one or
     
    169176        # portion of the name.  We always set it to "unknown".
    170177        sysctl="sysctl -n hw.machine_arch"
    171         UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
    172             /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
    173         case "${UNAME_MACHINE_ARCH}" in
     178        UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
     179            "/sbin/$sysctl" 2>/dev/null || \
     180            "/usr/sbin/$sysctl" 2>/dev/null || \
     181            echo unknown)`
     182        case "$UNAME_MACHINE_ARCH" in
    174183            armeb) machine=armeb-unknown ;;
    175184            arm*) machine=arm-unknown ;;
     
    177186            sh3eb) machine=sh-unknown ;;
    178187            sh5el) machine=sh5le-unknown ;;
    179             *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
     188            earmv*)
     189                arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
     190                endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'`
     191                machine="${arch}${endian}"-unknown
     192                ;;
     193            *) machine="$UNAME_MACHINE_ARCH"-unknown ;;
    180194        esac
    181195        # The Operating System including object format, if it has switched
    182         # to ELF recently, or will in the future.
    183         case "${UNAME_MACHINE_ARCH}" in
     196        # to ELF recently (or will in the future) and ABI.
     197        case "$UNAME_MACHINE_ARCH" in
     198            earm*)
     199                os=netbsdelf
     200                ;;
    184201            arm*|i386|m68k|ns32k|sh3*|sparc|vax)
    185                 eval $set_cc_for_build
     202                eval "$set_cc_for_build"
    186203                if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
    187204                        | grep -q __ELF__
     
    198215                ;;
    199216        esac
     217        # Determine ABI tags.
     218        case "$UNAME_MACHINE_ARCH" in
     219            earm*)
     220                expr='s/^earmv[0-9]/-eabi/;s/eb$//'
     221                abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"`
     222                ;;
     223        esac
    200224        # The OS release
    201225        # Debian GNU/NetBSD machines have a different userland, and
     
    203227        # kernel version information, so it can be replaced with a
    204228        # suitable tag, in the style of linux-gnu.
    205         case "${UNAME_VERSION}" in
     229        case "$UNAME_VERSION" in
    206230            Debian*)
    207231                release='-gnu'
    208232                ;;
    209233            *)
    210                 release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
     234                release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2`
    211235                ;;
    212236        esac
     
    214238        # contains redundant information, the shorter form:
    215239        # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
    216         echo "${machine}-${os}${release}"
     240        echo "$machine-${os}${release}${abi}"
    217241        exit ;;
    218242    *:Bitrig:*:*)
    219243        UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
    220         echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
     244        echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE"
    221245        exit ;;
    222246    *:OpenBSD:*:*)
    223247        UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
    224         echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
     248        echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE"
     249        exit ;;
     250    *:LibertyBSD:*:*)
     251        UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
     252        echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE"
     253        exit ;;
     254    *:MidnightBSD:*:*)
     255        echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE"
    225256        exit ;;
    226257    *:ekkoBSD:*:*)
    227         echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
     258        echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE"
    228259        exit ;;
    229260    *:SolidBSD:*:*)
    230         echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
     261        echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE"
    231262        exit ;;
    232263    macppc:MirBSD:*:*)
    233         echo powerpc-unknown-mirbsd${UNAME_RELEASE}
     264        echo powerpc-unknown-mirbsd"$UNAME_RELEASE"
    234265        exit ;;
    235266    *:MirBSD:*:*)
    236         echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
    237         exit ;;
     267        echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE"
     268        exit ;;
     269    *:Sortix:*:*)
     270        echo "$UNAME_MACHINE"-unknown-sortix
     271        exit ;;
     272    *:Redox:*:*)
     273        echo "$UNAME_MACHINE"-unknown-redox
     274        exit ;;
     275    mips:OSF1:*.*)
     276        echo mips-dec-osf1
     277        exit ;;
    238278    alpha:OSF1:*:*)
    239279        case $UNAME_RELEASE in
     
    252292        case "$ALPHA_CPU_TYPE" in
    253293            "EV4 (21064)")
    254                 UNAME_MACHINE="alpha" ;;
     294                UNAME_MACHINE=alpha ;;
    255295            "EV4.5 (21064)")
    256                 UNAME_MACHINE="alpha" ;;
     296                UNAME_MACHINE=alpha ;;
    257297            "LCA4 (21066/21068)")
    258                 UNAME_MACHINE="alpha" ;;
     298                UNAME_MACHINE=alpha ;;
    259299            "EV5 (21164)")
    260                 UNAME_MACHINE="alphaev5" ;;
     300                UNAME_MACHINE=alphaev5 ;;
    261301            "EV5.6 (21164A)")
    262                 UNAME_MACHINE="alphaev56" ;;
     302                UNAME_MACHINE=alphaev56 ;;
    263303            "EV5.6 (21164PC)")
    264                 UNAME_MACHINE="alphapca56" ;;
     304                UNAME_MACHINE=alphapca56 ;;
    265305            "EV5.7 (21164PC)")
    266                 UNAME_MACHINE="alphapca57" ;;
     306                UNAME_MACHINE=alphapca57 ;;
    267307            "EV6 (21264)")
    268                 UNAME_MACHINE="alphaev6" ;;
     308                UNAME_MACHINE=alphaev6 ;;
    269309            "EV6.7 (21264A)")
    270                 UNAME_MACHINE="alphaev67" ;;
     310                UNAME_MACHINE=alphaev67 ;;
    271311            "EV6.8CB (21264C)")
    272                 UNAME_MACHINE="alphaev68" ;;
     312                UNAME_MACHINE=alphaev68 ;;
    273313            "EV6.8AL (21264B)")
    274                 UNAME_MACHINE="alphaev68" ;;
     314                UNAME_MACHINE=alphaev68 ;;
    275315            "EV6.8CX (21264D)")
    276                 UNAME_MACHINE="alphaev68" ;;
     316                UNAME_MACHINE=alphaev68 ;;
    277317            "EV6.9A (21264/EV69A)")
    278                 UNAME_MACHINE="alphaev69" ;;
     318                UNAME_MACHINE=alphaev69 ;;
    279319            "EV7 (21364)")
    280                 UNAME_MACHINE="alphaev7" ;;
     320                UNAME_MACHINE=alphaev7 ;;
    281321            "EV7.9 (21364A)")
    282                 UNAME_MACHINE="alphaev79" ;;
     322                UNAME_MACHINE=alphaev79 ;;
    283323        esac
    284324        # A Pn.n version is a patched version.
     
    287327        # A Xn.n version is an unreleased experimental baselevel.
    288328        # 1.2 uses "1.2" for uname -r.
    289         echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
     329        echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`"
    290330        # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
    291331        exitcode=$?
    292332        trap '' 0
    293333        exit $exitcode ;;
    294     Alpha\ *:Windows_NT*:*)
    295         # How do we know it's Interix rather than the generic POSIX subsystem?
    296         # Should we change UNAME_MACHINE based on the output of uname instead
    297         # of the specific Alpha model?
    298         echo alpha-pc-interix
    299         exit ;;
    300     21064:Windows_NT:50:3)
    301         echo alpha-dec-winnt3.5
    302         exit ;;
    303334    Amiga*:UNIX_System_V:4.0:*)
    304335        echo m68k-unknown-sysv4
    305336        exit ;;
    306337    *:[Aa]miga[Oo][Ss]:*:*)
    307         echo ${UNAME_MACHINE}-unknown-amigaos
     338        echo "$UNAME_MACHINE"-unknown-amigaos
    308339        exit ;;
    309340    *:[Mm]orph[Oo][Ss]:*:*)
    310         echo ${UNAME_MACHINE}-unknown-morphos
     341        echo "$UNAME_MACHINE"-unknown-morphos
    311342        exit ;;
    312343    *:OS/390:*:*)
     
    320351        exit ;;
    321352    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
    322         echo arm-acorn-riscix${UNAME_RELEASE}
     353        echo arm-acorn-riscix"$UNAME_RELEASE"
    323354        exit ;;
    324355    arm*:riscos:*:*|arm*:RISCOS:*:*)
     
    347378        esac ;;
    348379    s390x:SunOS:*:*)
    349         echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
     380        echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
    350381        exit ;;
    351382    sun4H:SunOS:5.*:*)
    352         echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
     383        echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
    353384        exit ;;
    354385    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
    355         echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
     386        echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
    356387        exit ;;
    357388    i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
    358         echo i386-pc-auroraux${UNAME_RELEASE}
     389        echo i386-pc-auroraux"$UNAME_RELEASE"
    359390        exit ;;
    360391    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
    361         eval $set_cc_for_build
    362         SUN_ARCH="i386"
     392        eval "$set_cc_for_build"
     393        SUN_ARCH=i386
    363394        # If there is a compiler, see if it is configured for 64-bit objects.
    364395        # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
    365396        # This test works for both compilers.
    366         if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
     397        if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
    367398            if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
    368                 (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
     399                (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
    369400                grep IS_64BIT_ARCH >/dev/null
    370401            then
    371                 SUN_ARCH="x86_64"
     402                SUN_ARCH=x86_64
    372403            fi
    373404        fi
    374         echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
     405        echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
    375406        exit ;;
    376407    sun4*:SunOS:6*:*)
     
    378409        # SunOS6.  Hard to guess exactly what SunOS6 will be like, but
    379410        # it's likely to be more like Solaris than SunOS4.
    380         echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
     411        echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
    381412        exit ;;
    382413    sun4*:SunOS:*:*)
     
    387418        esac
    388419        # Japanese Language versions have a version number like `4.1.3-JL'.
    389         echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
     420        echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`"
    390421        exit ;;
    391422    sun3*:SunOS:*:*)
    392         echo m68k-sun-sunos${UNAME_RELEASE}
     423        echo m68k-sun-sunos"$UNAME_RELEASE"
    393424        exit ;;
    394425    sun*:*:4.2BSD:*)
    395426        UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
    396         test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
     427        test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3
    397428        case "`/bin/arch`" in
    398429            sun3)
    399                 echo m68k-sun-sunos${UNAME_RELEASE}
     430                echo m68k-sun-sunos"$UNAME_RELEASE"
    400431                ;;
    401432            sun4)
    402                 echo sparc-sun-sunos${UNAME_RELEASE}
     433                echo sparc-sun-sunos"$UNAME_RELEASE"
    403434                ;;
    404435        esac
    405436        exit ;;
    406437    aushp:SunOS:*:*)
    407         echo sparc-auspex-sunos${UNAME_RELEASE}
     438        echo sparc-auspex-sunos"$UNAME_RELEASE"
    408439        exit ;;
    409440    # The situation for MiNT is a little confusing.  The machine name
     
    416447    # be no problem.
    417448    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
    418         echo m68k-atari-mint${UNAME_RELEASE}
     449        echo m68k-atari-mint"$UNAME_RELEASE"
    419450        exit ;;
    420451    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
    421         echo m68k-atari-mint${UNAME_RELEASE}
     452        echo m68k-atari-mint"$UNAME_RELEASE"
    422453        exit ;;
    423454    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
    424         echo m68k-atari-mint${UNAME_RELEASE}
     455        echo m68k-atari-mint"$UNAME_RELEASE"
    425456        exit ;;
    426457    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
    427         echo m68k-milan-mint${UNAME_RELEASE}
     458        echo m68k-milan-mint"$UNAME_RELEASE"
    428459        exit ;;
    429460    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
    430         echo m68k-hades-mint${UNAME_RELEASE}
     461        echo m68k-hades-mint"$UNAME_RELEASE"
    431462        exit ;;
    432463    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
    433         echo m68k-unknown-mint${UNAME_RELEASE}
     464        echo m68k-unknown-mint"$UNAME_RELEASE"
    434465        exit ;;
    435466    m68k:machten:*:*)
    436         echo m68k-apple-machten${UNAME_RELEASE}
     467        echo m68k-apple-machten"$UNAME_RELEASE"
    437468        exit ;;
    438469    powerpc:machten:*:*)
    439         echo powerpc-apple-machten${UNAME_RELEASE}
     470        echo powerpc-apple-machten"$UNAME_RELEASE"
    440471        exit ;;
    441472    RISC*:Mach:*:*)
     
    443474        exit ;;
    444475    RISC*:ULTRIX:*:*)
    445         echo mips-dec-ultrix${UNAME_RELEASE}
     476        echo mips-dec-ultrix"$UNAME_RELEASE"
    446477        exit ;;
    447478    VAX*:ULTRIX*:*:*)
    448         echo vax-dec-ultrix${UNAME_RELEASE}
     479        echo vax-dec-ultrix"$UNAME_RELEASE"
    449480        exit ;;
    450481    2020:CLIX:*:* | 2430:CLIX:*:*)
    451         echo clipper-intergraph-clix${UNAME_RELEASE}
     482        echo clipper-intergraph-clix"$UNAME_RELEASE"
    452483        exit ;;
    453484    mips:*:*:UMIPS | mips:*:*:RISCos)
    454         eval $set_cc_for_build
    455         sed 's/^        //' << EOF >$dummy.c
     485        eval "$set_cc_for_build"
     486        sed 's/^        //' << EOF > "$dummy.c"
    456487#ifdef __cplusplus
    457488#include <stdio.h>  /* for printf() prototype */
     
    462493        #if defined (host_mips) && defined (MIPSEB)
    463494        #if defined (SYSTYPE_SYSV)
    464           printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
     495          printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0);
    465496        #endif
    466497        #if defined (SYSTYPE_SVR4)
    467           printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
     498          printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0);
    468499        #endif
    469500        #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
    470           printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
     501          printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0);
    471502        #endif
    472503        #endif
     
    474505        }
    475506EOF
    476         $CC_FOR_BUILD -o $dummy $dummy.c &&
    477           dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
    478           SYSTEM_NAME=`$dummy $dummyarg` &&
     507        $CC_FOR_BUILD -o "$dummy" "$dummy.c" &&
     508          dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` &&
     509          SYSTEM_NAME=`"$dummy" "$dummyarg"` &&
    479510            { echo "$SYSTEM_NAME"; exit; }
    480         echo mips-mips-riscos${UNAME_RELEASE}
     511        echo mips-mips-riscos"$UNAME_RELEASE"
    481512        exit ;;
    482513    Motorola:PowerMAX_OS:*:*)
     
    504535        # DG/UX returns AViiON for all architectures
    505536        UNAME_PROCESSOR=`/usr/bin/uname -p`
    506         if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
     537        if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ]
    507538        then
    508             if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
    509                [ ${TARGET_BINARY_INTERFACE}x = x ]
     539            if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \
     540               [ "$TARGET_BINARY_INTERFACE"x = x ]
    510541            then
    511                 echo m88k-dg-dgux${UNAME_RELEASE}
     542                echo m88k-dg-dgux"$UNAME_RELEASE"
    512543            else
    513                 echo m88k-dg-dguxbcs${UNAME_RELEASE}
     544                echo m88k-dg-dguxbcs"$UNAME_RELEASE"
    514545            fi
    515546        else
    516             echo i586-dg-dgux${UNAME_RELEASE}
     547            echo i586-dg-dgux"$UNAME_RELEASE"
    517548        fi
    518549        exit ;;
     
    531562        exit ;;
    532563    *:IRIX*:*:*)
    533         echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
     564        echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`"
    534565        exit ;;
    535566    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
     
    543574                IBM_REV=`/usr/bin/oslevel`
    544575        else
    545                 IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
    546         fi
    547         echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
     576                IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
     577        fi
     578        echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV"
    548579        exit ;;
    549580    *:AIX:2:3)
    550581        if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
    551                 eval $set_cc_for_build
    552                 sed 's/^                //' << EOF >$dummy.c
     582                eval "$set_cc_for_build"
     583                sed 's/^                //' << EOF > "$dummy.c"
    553584                #include <sys/systemcfg.h>
    554585
     
    561592                        }
    562593EOF
    563                 if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
     594                if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"`
    564595                then
    565596                        echo "$SYSTEM_NAME"
     
    575606    *:AIX:*:[4567])
    576607        IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
    577         if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
     608        if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then
    578609                IBM_ARCH=rs6000
    579610        else
    580611                IBM_ARCH=powerpc
    581612        fi
    582         if [ -x /usr/bin/oslevel ] ; then
    583                 IBM_REV=`/usr/bin/oslevel`
     613        if [ -x /usr/bin/lslpp ] ; then
     614                IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
     615                           awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
    584616        else
    585                 IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
    586         fi
    587         echo ${IBM_ARCH}-ibm-aix${IBM_REV}
     617                IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
     618        fi
     619        echo "$IBM_ARCH"-ibm-aix"$IBM_REV"
    588620        exit ;;
    589621    *:AIX:*:*)
    590622        echo rs6000-ibm-aix
    591623        exit ;;
    592     ibmrt:4.4BSD:*|romp-ibm:BSD:*)
     624    ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*)
    593625        echo romp-ibm-bsd4.4
    594626        exit ;;
    595627    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
    596         echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
     628        echo romp-ibm-bsd"$UNAME_RELEASE"   # 4.3 with uname added to
    597629        exit ;;                             # report: romp-ibm BSD 4.3
    598630    *:BOSX:*:*)
     
    609641        exit ;;
    610642    9000/[34678]??:HP-UX:*:*)
    611         HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
    612         case "${UNAME_MACHINE}" in
    613             9000/31? )            HP_ARCH=m68000 ;;
    614             9000/[34]?? )         HP_ARCH=m68k ;;
     643        HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
     644        case "$UNAME_MACHINE" in
     645            9000/31?)            HP_ARCH=m68000 ;;
     646            9000/[34]??)         HP_ARCH=m68k ;;
    615647            9000/[678][0-9][0-9])
    616648                if [ -x /usr/bin/getconf ]; then
    617649                    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
    618650                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
    619                     case "${sc_cpu_version}" in
    620                       523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
    621                       528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
     651                    case "$sc_cpu_version" in
     652                      523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
     653                      528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
    622654                      532)                      # CPU_PA_RISC2_0
    623                         case "${sc_kernel_bits}" in
    624                           32) HP_ARCH="hppa2.0n" ;;
    625                           64) HP_ARCH="hppa2.0w" ;;
    626                           '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
     655                        case "$sc_kernel_bits" in
     656                          32) HP_ARCH=hppa2.0n ;;
     657                          64) HP_ARCH=hppa2.0w ;;
     658                          '') HP_ARCH=hppa2.0 ;;   # HP-UX 10.20
    627659                        esac ;;
    628660                    esac
    629661                fi
    630                 if [ "${HP_ARCH}" = "" ]; then
    631                     eval $set_cc_for_build
    632                     sed 's/^            //' << EOF >$dummy.c
     662                if [ "$HP_ARCH" = "" ]; then
     663                    eval "$set_cc_for_build"
     664                    sed 's/^            //' << EOF > "$dummy.c"
    633665
    634666                #define _HPUX_SOURCE
     
    663695                }
    664696EOF
    665                     (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
     697                    (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"`
    666698                    test -z "$HP_ARCH" && HP_ARCH=hppa
    667699                fi ;;
    668700        esac
    669         if [ ${HP_ARCH} = "hppa2.0w" ]
     701        if [ "$HP_ARCH" = hppa2.0w ]
    670702        then
    671             eval $set_cc_for_build
     703            eval "$set_cc_for_build"
    672704
    673705            # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
     
    680712            # => hppa64-hp-hpux11.23
    681713
    682             if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
     714            if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) |
    683715                grep -q __LP64__
    684716            then
    685                 HP_ARCH="hppa2.0w"
     717                HP_ARCH=hppa2.0w
    686718            else
    687                 HP_ARCH="hppa64"
     719                HP_ARCH=hppa64
    688720            fi
    689721        fi
    690         echo ${HP_ARCH}-hp-hpux${HPUX_REV}
     722        echo "$HP_ARCH"-hp-hpux"$HPUX_REV"
    691723        exit ;;
    692724    ia64:HP-UX:*:*)
    693         HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
    694         echo ia64-hp-hpux${HPUX_REV}
     725        HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
     726        echo ia64-hp-hpux"$HPUX_REV"
    695727        exit ;;
    696728    3050*:HI-UX:*:*)
    697         eval $set_cc_for_build
    698         sed 's/^        //' << EOF >$dummy.c
     729        eval "$set_cc_for_build"
     730        sed 's/^        //' << EOF > "$dummy.c"
    699731        #include <unistd.h>
    700732        int
     
    721753        }
    722754EOF
    723         $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
     755        $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` &&
    724756                { echo "$SYSTEM_NAME"; exit; }
    725757        echo unknown-hitachi-hiuxwe2
    726758        exit ;;
    727     9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
     759    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*)
    728760        echo hppa1.1-hp-bsd
    729761        exit ;;
     
    734766        echo hppa1.0-hp-mpeix
    735767        exit ;;
    736     hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
     768    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*)
    737769        echo hppa1.1-hp-osf
    738770        exit ;;
     
    742774    i*86:OSF1:*:*)
    743775        if [ -x /usr/sbin/sysversion ] ; then
    744             echo ${UNAME_MACHINE}-unknown-osf1mk
     776            echo "$UNAME_MACHINE"-unknown-osf1mk
    745777        else
    746             echo ${UNAME_MACHINE}-unknown-osf1
     778            echo "$UNAME_MACHINE"-unknown-osf1
    747779        fi
    748780        exit ;;
     
    769801        exit ;;
    770802    CRAY*Y-MP:*:*:*)
    771         echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
     803        echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
    772804        exit ;;
    773805    CRAY*[A-Z]90:*:*:*)
    774         echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
     806        echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \
    775807        | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
    776808              -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
     
    778810        exit ;;
    779811    CRAY*TS:*:*:*)
    780         echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
     812        echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
    781813        exit ;;
    782814    CRAY*T3E:*:*:*)
    783         echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
     815        echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
    784816        exit ;;
    785817    CRAY*SV1:*:*:*)
    786         echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
     818        echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
    787819        exit ;;
    788820    *:UNICOS/mp:*:*)
    789         echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
     821        echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
    790822        exit ;;
    791823    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
    792         FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
    793         FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
    794         FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
     824        FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
     825        FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
     826        FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'`
    795827        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
    796828        exit ;;
    797829    5000:UNIX_System_V:4.*:*)
    798         FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
    799         FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
     830        FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
     831        FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
    800832        echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
    801833        exit ;;
    802834    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
    803         echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
     835        echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE"
    804836        exit ;;
    805837    sparc*:BSD/OS:*:*)
    806         echo sparc-unknown-bsdi${UNAME_RELEASE}
     838        echo sparc-unknown-bsdi"$UNAME_RELEASE"
    807839        exit ;;
    808840    *:BSD/OS:*:*)
    809         echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
     841        echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE"
    810842        exit ;;
    811843    *:FreeBSD:*:*)
    812844        UNAME_PROCESSOR=`/usr/bin/uname -p`
    813         case ${UNAME_PROCESSOR} in
     845        case "$UNAME_PROCESSOR" in
    814846            amd64)
    815                 echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
    816             *)
    817                 echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
     847                UNAME_PROCESSOR=x86_64 ;;
     848            i386)
     849                UNAME_PROCESSOR=i586 ;;
    818850        esac
     851        echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
    819852        exit ;;
    820853    i*:CYGWIN*:*)
    821         echo ${UNAME_MACHINE}-pc-cygwin
     854        echo "$UNAME_MACHINE"-pc-cygwin
    822855        exit ;;
    823856    *:MINGW64*:*)
    824         echo ${UNAME_MACHINE}-pc-mingw64
     857        echo "$UNAME_MACHINE"-pc-mingw64
    825858        exit ;;
    826859    *:MINGW*:*)
    827         echo ${UNAME_MACHINE}-pc-mingw32
     860        echo "$UNAME_MACHINE"-pc-mingw32
    828861        exit ;;
    829862    *:MSYS*:*)
    830         echo ${UNAME_MACHINE}-pc-msys
    831         exit ;;
    832     i*:windows32*:*)
    833         # uname -m includes "-pc" on this system.
    834         echo ${UNAME_MACHINE}-mingw32
     863        echo "$UNAME_MACHINE"-pc-msys
    835864        exit ;;
    836865    i*:PW*:*)
    837         echo ${UNAME_MACHINE}-pc-pw32
     866        echo "$UNAME_MACHINE"-pc-pw32
    838867        exit ;;
    839868    *:Interix*:*)
    840         case ${UNAME_MACHINE} in
     869        case "$UNAME_MACHINE" in
    841870            x86)
    842                 echo i586-pc-interix${UNAME_RELEASE}
     871                echo i586-pc-interix"$UNAME_RELEASE"
    843872                exit ;;
    844873            authenticamd | genuineintel | EM64T)
    845                 echo x86_64-unknown-interix${UNAME_RELEASE}
     874                echo x86_64-unknown-interix"$UNAME_RELEASE"
    846875                exit ;;
    847876            IA64)
    848                 echo ia64-unknown-interix${UNAME_RELEASE}
     877                echo ia64-unknown-interix"$UNAME_RELEASE"
    849878                exit ;;
    850879        esac ;;
    851     [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
    852         echo i${UNAME_MACHINE}-pc-mks
    853         exit ;;
    854     8664:Windows_NT:*)
    855         echo x86_64-pc-mks
    856         exit ;;
    857     i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
    858         # How do we know it's Interix rather than the generic POSIX subsystem?
    859         # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
    860         # UNAME_MACHINE based on the output of uname instead of i386?
    861         echo i586-pc-interix
    862         exit ;;
    863880    i*:UWIN*:*)
    864         echo ${UNAME_MACHINE}-pc-uwin
     881        echo "$UNAME_MACHINE"-pc-uwin
    865882        exit ;;
    866883    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
    867884        echo x86_64-unknown-cygwin
    868885        exit ;;
    869     p*:CYGWIN*:*)
    870         echo powerpcle-unknown-cygwin
    871         exit ;;
    872886    prep*:SunOS:5.*:*)
    873         echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
     887        echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
    874888        exit ;;
    875889    *:GNU:*:*)
    876890        # the GNU system
    877         echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
     891        echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`"
    878892        exit ;;
    879893    *:GNU/*:*:*)
    880894        # other systems with GNU libc and userland
    881         echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
     895        echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC"
    882896        exit ;;
    883897    i*86:Minix:*:*)
    884         echo ${UNAME_MACHINE}-pc-minix
     898        echo "$UNAME_MACHINE"-pc-minix
    885899        exit ;;
    886900    aarch64:Linux:*:*)
    887         echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
     901        echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
    888902        exit ;;
    889903    aarch64_be:Linux:*:*)
    890904        UNAME_MACHINE=aarch64_be
    891         echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
     905        echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
    892906        exit ;;
    893907    alpha:Linux:*:*)
     
    902916        esac
    903917        objdump --private-headers /bin/sh | grep -q ld.so.1
    904         if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
    905         echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
     918        if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
     919        echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
    906920        exit ;;
    907921    arc:Linux:*:* | arceb:Linux:*:*)
    908         echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
     922        echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
    909923        exit ;;
    910924    arm*:Linux:*:*)
    911         eval $set_cc_for_build
     925        eval "$set_cc_for_build"
    912926        if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
    913927            | grep -q __ARM_EABI__
    914928        then
    915             echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
     929            echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
    916930        else
    917931            if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
    918932                | grep -q __ARM_PCS_VFP
    919933            then
    920                 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
     934                echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi
    921935            else
    922                 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
     936                echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf
    923937            fi
    924938        fi
    925939        exit ;;
    926940    avr32*:Linux:*:*)
    927         echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
     941        echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
    928942        exit ;;
    929943    cris:Linux:*:*)
    930         echo ${UNAME_MACHINE}-axis-linux-${LIBC}
     944        echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
    931945        exit ;;
    932946    crisv32:Linux:*:*)
    933         echo ${UNAME_MACHINE}-axis-linux-${LIBC}
     947        echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
     948        exit ;;
     949    e2k:Linux:*:*)
     950        echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
    934951        exit ;;
    935952    frv:Linux:*:*)
    936         echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
     953        echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
    937954        exit ;;
    938955    hexagon:Linux:*:*)
    939         echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
     956        echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
    940957        exit ;;
    941958    i*86:Linux:*:*)
    942         echo ${UNAME_MACHINE}-pc-linux-${LIBC}
     959        echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
    943960        exit ;;
    944961    ia64:Linux:*:*)
    945         echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
     962        echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
     963        exit ;;
     964    k1om:Linux:*:*)
     965        echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
    946966        exit ;;
    947967    m32r*:Linux:*:*)
    948         echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
     968        echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
    949969        exit ;;
    950970    m68*:Linux:*:*)
    951         echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
     971        echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
    952972        exit ;;
    953973    mips:Linux:*:* | mips64:Linux:*:*)
    954         eval $set_cc_for_build
    955         sed 's/^        //' << EOF >$dummy.c
     974        eval "$set_cc_for_build"
     975        sed 's/^        //' << EOF > "$dummy.c"
    956976        #undef CPU
    957977        #undef ${UNAME_MACHINE}
     
    967987        #endif
    968988EOF
    969         eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
    970         test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
     989        eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU'`"
     990        test "x$CPU" != x && { echo "$CPU-unknown-linux-$LIBC"; exit; }
    971991        ;;
     992    mips64el:Linux:*:*)
     993        echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
     994        exit ;;
    972995    openrisc*:Linux:*:*)
    973         echo or1k-unknown-linux-${LIBC}
     996        echo or1k-unknown-linux-"$LIBC"
    974997        exit ;;
    975998    or32:Linux:*:* | or1k*:Linux:*:*)
    976         echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
     999        echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
    9771000        exit ;;
    9781001    padre:Linux:*:*)
    979         echo sparc-unknown-linux-${LIBC}
     1002        echo sparc-unknown-linux-"$LIBC"
    9801003        exit ;;
    9811004    parisc64:Linux:*:* | hppa64:Linux:*:*)
    982         echo hppa64-unknown-linux-${LIBC}
     1005        echo hppa64-unknown-linux-"$LIBC"
    9831006        exit ;;
    9841007    parisc:Linux:*:* | hppa:Linux:*:*)
    9851008        # Look for CPU level
    9861009        case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
    987           PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
    988           PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
    989           *)    echo hppa-unknown-linux-${LIBC} ;;
     1010          PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;;
     1011          PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;;
     1012          *)    echo hppa-unknown-linux-"$LIBC" ;;
    9901013        esac
    9911014        exit ;;
    9921015    ppc64:Linux:*:*)
    993         echo powerpc64-unknown-linux-${LIBC}
     1016        echo powerpc64-unknown-linux-"$LIBC"
    9941017        exit ;;
    9951018    ppc:Linux:*:*)
    996         echo powerpc-unknown-linux-${LIBC}
     1019        echo powerpc-unknown-linux-"$LIBC"
    9971020        exit ;;
    9981021    ppc64le:Linux:*:*)
    999         echo powerpc64le-unknown-linux-${LIBC}
     1022        echo powerpc64le-unknown-linux-"$LIBC"
    10001023        exit ;;
    10011024    ppcle:Linux:*:*)
    1002         echo powerpcle-unknown-linux-${LIBC}
     1025        echo powerpcle-unknown-linux-"$LIBC"
     1026        exit ;;
     1027    riscv32:Linux:*:* | riscv64:Linux:*:*)
     1028        echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
    10031029        exit ;;
    10041030    s390:Linux:*:* | s390x:Linux:*:*)
    1005         echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
     1031        echo "$UNAME_MACHINE"-ibm-linux-"$LIBC"
    10061032        exit ;;
    10071033    sh64*:Linux:*:*)
    1008         echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
     1034        echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
    10091035        exit ;;
    10101036    sh*:Linux:*:*)
    1011         echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
     1037        echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
    10121038        exit ;;
    10131039    sparc:Linux:*:* | sparc64:Linux:*:*)
    1014         echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
     1040        echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
    10151041        exit ;;
    10161042    tile*:Linux:*:*)
    1017         echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
     1043        echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
    10181044        exit ;;
    10191045    vax:Linux:*:*)
    1020         echo ${UNAME_MACHINE}-dec-linux-${LIBC}
     1046        echo "$UNAME_MACHINE"-dec-linux-"$LIBC"
    10211047        exit ;;
    10221048    x86_64:Linux:*:*)
    1023         echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
     1049        if objdump -f /bin/sh | grep -q elf32-x86-64; then
     1050            echo "$UNAME_MACHINE"-pc-linux-"$LIBC"x32
     1051        else
     1052            echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
     1053        fi
    10241054        exit ;;
    10251055    xtensa*:Linux:*:*)
    1026         echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
     1056        echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
    10271057        exit ;;
    10281058    i*86:DYNIX/ptx:4*:*)
     
    10381068        # I just have to hope.  -- rms.
    10391069        # Use sysv4.2uw... so that sysv4* matches it.
    1040         echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
     1070        echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION"
    10411071        exit ;;
    10421072    i*86:OS/2:*:*)
    10431073        # If we were able to find `uname', then EMX Unix compatibility
    10441074        # is probably installed.
    1045         echo ${UNAME_MACHINE}-pc-os2-emx
     1075        echo "$UNAME_MACHINE"-pc-os2-emx
    10461076        exit ;;
    10471077    i*86:XTS-300:*:STOP)
    1048         echo ${UNAME_MACHINE}-unknown-stop
     1078        echo "$UNAME_MACHINE"-unknown-stop
    10491079        exit ;;
    10501080    i*86:atheos:*:*)
    1051         echo ${UNAME_MACHINE}-unknown-atheos
     1081        echo "$UNAME_MACHINE"-unknown-atheos
    10521082        exit ;;
    10531083    i*86:syllable:*:*)
    1054         echo ${UNAME_MACHINE}-pc-syllable
     1084        echo "$UNAME_MACHINE"-pc-syllable
    10551085        exit ;;
    10561086    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
    1057         echo i386-unknown-lynxos${UNAME_RELEASE}
     1087        echo i386-unknown-lynxos"$UNAME_RELEASE"
    10581088        exit ;;
    10591089    i*86:*DOS:*:*)
    1060         echo ${UNAME_MACHINE}-pc-msdosdjgpp
    1061         exit ;;
    1062     i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
    1063         UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
     1090        echo "$UNAME_MACHINE"-pc-msdosdjgpp
     1091        exit ;;
     1092    i*86:*:4.*:*)
     1093        UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'`
    10641094        if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
    1065                 echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
     1095                echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL"
    10661096        else
    1067                 echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
     1097                echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL"
    10681098        fi
    10691099        exit ;;
     
    10751105            *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
    10761106        esac
    1077         echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
     1107        echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}{$UNAME_VERSION}"
    10781108        exit ;;
    10791109    i*86:*:3.2:*)
    10801110        if test -f /usr/options/cb.name; then
    10811111                UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
    1082                 echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
     1112                echo "$UNAME_MACHINE"-pc-isc"$UNAME_REL"
    10831113        elif /bin/uname -X 2>/dev/null >/dev/null ; then
    10841114                UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
     
    10901120                (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
    10911121                        && UNAME_MACHINE=i686
    1092                 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
     1122                echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL"
    10931123        else
    1094                 echo ${UNAME_MACHINE}-pc-sysv32
     1124                echo "$UNAME_MACHINE"-pc-sysv32
    10951125        fi
    10961126        exit ;;
     
    11001130        # the processor, so we play safe by assuming i586.
    11011131        # Note: whatever this is, it MUST be the same as what config.sub
    1102         # prints for the "djgpp" host, or else GDB configury will decide that
     1132        # prints for the "djgpp" host, or else GDB configure will decide that
    11031133        # this is a cross-build.
    11041134        echo i586-pc-msdosdjgpp
     
    11121142    i860:*:4.*:*) # i860-SVR4
    11131143        if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
    1114           echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
     1144          echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4
    11151145        else # Add other i860-SVR4 vendors below as they are discovered.
    1116           echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
     1146          echo i860-unknown-sysv"$UNAME_RELEASE"  # Unknown i860-SVR4
    11171147        fi
    11181148        exit ;;
     
    11341164        && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
    11351165        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
    1136           && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
     1166          && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
    11371167        /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
    1138           && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
     1168          && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
    11391169    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
    11401170        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
     
    11451175            && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
    11461176        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
    1147             && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
     1177            && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
    11481178        /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
    1149             && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
     1179            && { echo i586-ncr-sysv4.3"$OS_REL"; exit; }
    11501180        /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
    1151             && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
     1181            && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
    11521182    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
    1153         echo m68k-unknown-lynxos${UNAME_RELEASE}
     1183        echo m68k-unknown-lynxos"$UNAME_RELEASE"
    11541184        exit ;;
    11551185    mc68030:UNIX_System_V:4.*:*)
     
    11571187        exit ;;
    11581188    TSUNAMI:LynxOS:2.*:*)
    1159         echo sparc-unknown-lynxos${UNAME_RELEASE}
     1189        echo sparc-unknown-lynxos"$UNAME_RELEASE"
    11601190        exit ;;
    11611191    rs6000:LynxOS:2.*:*)
    1162         echo rs6000-unknown-lynxos${UNAME_RELEASE}
     1192        echo rs6000-unknown-lynxos"$UNAME_RELEASE"
    11631193        exit ;;
    11641194    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
    1165         echo powerpc-unknown-lynxos${UNAME_RELEASE}
     1195        echo powerpc-unknown-lynxos"$UNAME_RELEASE"
    11661196        exit ;;
    11671197    SM[BE]S:UNIX_SV:*:*)
    1168         echo mips-dde-sysv${UNAME_RELEASE}
     1198        echo mips-dde-sysv"$UNAME_RELEASE"
    11691199        exit ;;
    11701200    RM*:ReliantUNIX-*:*:*)
     
    11771207        if uname -p 2>/dev/null >/dev/null ; then
    11781208                UNAME_MACHINE=`(uname -p) 2>/dev/null`
    1179                 echo ${UNAME_MACHINE}-sni-sysv4
     1209                echo "$UNAME_MACHINE"-sni-sysv4
    11801210        else
    11811211                echo ns32k-sni-sysv
     
    11971227    i*86:VOS:*:*)
    11981228        # From Paul.Green@stratus.com.
    1199         echo ${UNAME_MACHINE}-stratus-vos
     1229        echo "$UNAME_MACHINE"-stratus-vos
    12001230        exit ;;
    12011231    *:VOS:*:*)
     
    12041234        exit ;;
    12051235    mc68*:A/UX:*:*)
    1206         echo m68k-apple-aux${UNAME_RELEASE}
     1236        echo m68k-apple-aux"$UNAME_RELEASE"
    12071237        exit ;;
    12081238    news*:NEWS-OS:6*:*)
     
    12111241    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
    12121242        if [ -d /usr/nec ]; then
    1213                 echo mips-nec-sysv${UNAME_RELEASE}
     1243                echo mips-nec-sysv"$UNAME_RELEASE"
    12141244        else
    1215                 echo mips-unknown-sysv${UNAME_RELEASE}
     1245                echo mips-unknown-sysv"$UNAME_RELEASE"
    12161246        fi
    12171247        exit ;;
     
    12321262        exit ;;
    12331263    SX-4:SUPER-UX:*:*)
    1234         echo sx4-nec-superux${UNAME_RELEASE}
     1264        echo sx4-nec-superux"$UNAME_RELEASE"
    12351265        exit ;;
    12361266    SX-5:SUPER-UX:*:*)
    1237         echo sx5-nec-superux${UNAME_RELEASE}
     1267        echo sx5-nec-superux"$UNAME_RELEASE"
    12381268        exit ;;
    12391269    SX-6:SUPER-UX:*:*)
    1240         echo sx6-nec-superux${UNAME_RELEASE}
     1270        echo sx6-nec-superux"$UNAME_RELEASE"
    12411271        exit ;;
    12421272    SX-7:SUPER-UX:*:*)
    1243         echo sx7-nec-superux${UNAME_RELEASE}
     1273        echo sx7-nec-superux"$UNAME_RELEASE"
    12441274        exit ;;
    12451275    SX-8:SUPER-UX:*:*)
    1246         echo sx8-nec-superux${UNAME_RELEASE}
     1276        echo sx8-nec-superux"$UNAME_RELEASE"
    12471277        exit ;;
    12481278    SX-8R:SUPER-UX:*:*)
    1249         echo sx8r-nec-superux${UNAME_RELEASE}
     1279        echo sx8r-nec-superux"$UNAME_RELEASE"
     1280        exit ;;
     1281    SX-ACE:SUPER-UX:*:*)
     1282        echo sxace-nec-superux"$UNAME_RELEASE"
    12501283        exit ;;
    12511284    Power*:Rhapsody:*:*)
    1252         echo powerpc-apple-rhapsody${UNAME_RELEASE}
     1285        echo powerpc-apple-rhapsody"$UNAME_RELEASE"
    12531286        exit ;;
    12541287    *:Rhapsody:*:*)
    1255         echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
     1288        echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE"
    12561289        exit ;;
    12571290    *:Darwin:*:*)
    12581291        UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
    1259         eval $set_cc_for_build
     1292        eval "$set_cc_for_build"
    12601293        if test "$UNAME_PROCESSOR" = unknown ; then
    12611294            UNAME_PROCESSOR=powerpc
    12621295        fi
    1263         if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
    1264             if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
     1296        if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then
     1297            if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
    12651298                if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
    1266                     (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
    1267                     grep IS_64BIT_ARCH >/dev/null
     1299                       (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
     1300                       grep IS_64BIT_ARCH >/dev/null
    12681301                then
    12691302                    case $UNAME_PROCESSOR in
     
    12711304                        powerpc) UNAME_PROCESSOR=powerpc64 ;;
    12721305                    esac
     1306                fi
     1307                # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
     1308                if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
     1309                       (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
     1310                       grep IS_PPC >/dev/null
     1311                then
     1312                    UNAME_PROCESSOR=powerpc
    12731313                fi
    12741314            fi
     
    12821322            UNAME_PROCESSOR=x86_64
    12831323        fi
    1284         echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
     1324        echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE"
    12851325        exit ;;
    12861326    *:procnto*:*:* | *:QNX:[0123456789]*:*)
    12871327        UNAME_PROCESSOR=`uname -p`
    1288         if test "$UNAME_PROCESSOR" = "x86"; then
     1328        if test "$UNAME_PROCESSOR" = x86; then
    12891329                UNAME_PROCESSOR=i386
    12901330                UNAME_MACHINE=pc
    12911331        fi
    1292         echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
     1332        echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE"
    12931333        exit ;;
    12941334    *:QNX:*:4*)
    12951335        echo i386-pc-qnx
    12961336        exit ;;
    1297     NEO-?:NONSTOP_KERNEL:*:*)
    1298         echo neo-tandem-nsk${UNAME_RELEASE}
     1337    NEO-*:NONSTOP_KERNEL:*:*)
     1338        echo neo-tandem-nsk"$UNAME_RELEASE"
    12991339        exit ;;
    13001340    NSE-*:NONSTOP_KERNEL:*:*)
    1301         echo nse-tandem-nsk${UNAME_RELEASE}
    1302         exit ;;
    1303     NSR-?:NONSTOP_KERNEL:*:*)
    1304         echo nsr-tandem-nsk${UNAME_RELEASE}
     1341        echo nse-tandem-nsk"$UNAME_RELEASE"
     1342        exit ;;
     1343    NSR-*:NONSTOP_KERNEL:*:*)
     1344        echo nsr-tandem-nsk"$UNAME_RELEASE"
     1345        exit ;;
     1346    NSV-*:NONSTOP_KERNEL:*:*)
     1347        echo nsv-tandem-nsk"$UNAME_RELEASE"
     1348        exit ;;
     1349    NSX-*:NONSTOP_KERNEL:*:*)
     1350        echo nsx-tandem-nsk"$UNAME_RELEASE"
    13051351        exit ;;
    13061352    *:NonStop-UX:*:*)
     
    13111357        exit ;;
    13121358    DS/*:UNIX_System_V:*:*)
    1313         echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
     1359        echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE"
    13141360        exit ;;
    13151361    *:Plan9:*:*)
     
    13171363        # is converted to i386 for consistency with other x86
    13181364        # operating systems.
    1319         if test "$cputype" = "386"; then
     1365        if test "$cputype" = 386; then
    13201366            UNAME_MACHINE=i386
    13211367        else
    13221368            UNAME_MACHINE="$cputype"
    13231369        fi
    1324         echo ${UNAME_MACHINE}-unknown-plan9
     1370        echo "$UNAME_MACHINE"-unknown-plan9
    13251371        exit ;;
    13261372    *:TOPS-10:*:*)
     
    13431389        exit ;;
    13441390    SEI:*:*:SEIUX)
    1345         echo mips-sei-seiux${UNAME_RELEASE}
     1391        echo mips-sei-seiux"$UNAME_RELEASE"
    13461392        exit ;;
    13471393    *:DragonFly:*:*)
    1348         echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
     1394        echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
    13491395        exit ;;
    13501396    *:*VMS:*:*)
    13511397        UNAME_MACHINE=`(uname -p) 2>/dev/null`
    1352         case "${UNAME_MACHINE}" in
     1398        case "$UNAME_MACHINE" in
    13531399            A*) echo alpha-dec-vms ; exit ;;
    13541400            I*) echo ia64-dec-vms ; exit ;;
     
    13591405        exit ;;
    13601406    i*86:skyos:*:*)
    1361         echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
     1407        echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`"
    13621408        exit ;;
    13631409    i*86:rdos:*:*)
    1364         echo ${UNAME_MACHINE}-pc-rdos
     1410        echo "$UNAME_MACHINE"-pc-rdos
    13651411        exit ;;
    13661412    i*86:AROS:*:*)
    1367         echo ${UNAME_MACHINE}-pc-aros
     1413        echo "$UNAME_MACHINE"-pc-aros
    13681414        exit ;;
    13691415    x86_64:VMkernel:*:*)
    1370         echo ${UNAME_MACHINE}-unknown-esx
     1416        echo "$UNAME_MACHINE"-unknown-esx
     1417        exit ;;
     1418    amd64:Isilon\ OneFS:*:*)
     1419        echo x86_64-unknown-onefs
    13711420        exit ;;
    13721421esac
    13731422
     1423echo "$0: unable to guess system type" >&2
     1424
     1425case "$UNAME_MACHINE:$UNAME_SYSTEM" in
     1426    mips:Linux | mips64:Linux)
     1427        # If we got here on MIPS GNU/Linux, output extra information.
     1428        cat >&2 <<EOF
     1429
     1430NOTE: MIPS GNU/Linux systems require a C compiler to fully recognize
     1431the system type. Please install a C compiler and try again.
     1432EOF
     1433        ;;
     1434esac
     1435
    13741436cat >&2 <<EOF
    1375 $0: unable to guess system type
    1376 
    1377 This script, last modified $timestamp, has failed to recognize
    1378 the operating system you are using. It is advised that you
    1379 download the most up to date version of the config scripts from
    1380 
    1381   http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
     1437
     1438This script (version $timestamp), has failed to recognize the
     1439operating system you are using. If your script is old, overwrite *all*
     1440copies of config.guess and config.sub with the latest versions from:
     1441
     1442  https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
    13821443and
    1383   http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
    1384 
    1385 If the version you run ($0) is already up to date, please
    1386 send the following data and any information you think might be
    1387 pertinent to <config-patches@gnu.org> in order to provide the needed
    1388 information to handle your system.
     1444  https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
     1445
     1446If $0 has already been updated, send the following data and any
     1447information you think might be pertinent to config-patches@gnu.org to
     1448provide the necessary information to handle your system.
    13891449
    13901450config.guess timestamp = $timestamp
     
    14051465/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
    14061466
    1407 UNAME_MACHINE = ${UNAME_MACHINE}
    1408 UNAME_RELEASE = ${UNAME_RELEASE}
    1409 UNAME_SYSTEM  = ${UNAME_SYSTEM}
    1410 UNAME_VERSION = ${UNAME_VERSION}
     1467UNAME_MACHINE = "$UNAME_MACHINE"
     1468UNAME_RELEASE = "$UNAME_RELEASE"
     1469UNAME_SYSTEM  = "$UNAME_SYSTEM"
     1470UNAME_VERSION = "$UNAME_VERSION"
    14111471EOF
    14121472
     
    14141474
    14151475# Local variables:
    1416 # eval: (add-hook 'write-file-hooks 'time-stamp)
     1476# eval: (add-hook 'write-file-functions 'time-stamp)
    14171477# time-stamp-start: "timestamp='"
    14181478# time-stamp-format: "%:y-%02m-%02d"
  • trunk/config.sub

    r481 r549  
    11#! /bin/sh
    22# Configuration validation subroutine script.
    3 #   Copyright 1992-2014 Free Software Foundation, Inc.
    4 
    5 timestamp='2014-09-11'
     3#   Copyright 1992-2018 Free Software Foundation, Inc.
     4
     5timestamp='2018-02-22'
    66
    77# This file is free software; you can redistribute it and/or modify it
     
    1616#
    1717# You should have received a copy of the GNU General Public License
    18 # along with this program; if not, see <http://www.gnu.org/licenses/>.
     18# along with this program; if not, see <https://www.gnu.org/licenses/>.
    1919#
    2020# As a special exception to the GNU General Public License, if you
     
    2626
    2727
    28 # Please send patches with a ChangeLog entry to config-patches@gnu.org.
     28# Please send patches to <config-patches@gnu.org>.
    2929#
    3030# Configuration subroutine to validate and canonicalize a configuration type.
     
    3434
    3535# You can get the latest version of this script from:
    36 # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
     36# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
    3737
    3838# This file is supposed to be the same for all GNU packages
     
    5454
    5555usage="\
    56 Usage: $0 [OPTION] CPU-MFR-OPSYS
    57        $0 [OPTION] ALIAS
     56Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS
    5857
    5958Canonicalize a configuration name.
    6059
    61 Operation modes:
     60Options:
    6261  -h, --help         print this help, then exit
    6362  -t, --time-stamp   print date of last modification, then exit
     
    6968GNU config.sub ($timestamp)
    7069
    71 Copyright 1992-2014 Free Software Foundation, Inc.
     70Copyright 1992-2018 Free Software Foundation, Inc.
    7271
    7372This is free software; see the source for copying conditions.  There is NO
     
    9695    *local*)
    9796       # First pass through any local machine types.
    98        echo $1
     97       echo "$1"
    9998       exit ;;
    10099
     
    114113# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
    115114# Here we must recognize all the valid KERNEL-OS combinations.
    116 maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
     115maybe_os=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
    117116case $maybe_os in
    118117  nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
    119118  linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
    120   knetbsd*-gnu* | netbsd*-gnu* | \
    121   kopensolaris*-gnu* | \
     119  knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \
     120  kopensolaris*-gnu* | cloudabi*-eabi* | \
    122121  storm-chaos* | os2-emx* | rtmk-nova*)
    123122    os=-$maybe_os
    124     basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
     123    basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
    125124    ;;
    126125  android-linux)
    127126    os=-linux-android
    128     basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
     127    basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
    129128    ;;
    130129  *)
    131     basic_machine=`echo $1 | sed 's/-[^-]*$//'`
    132     if [ $basic_machine != $1 ]
    133     then os=`echo $1 | sed 's/.*-/-/'`
     130    basic_machine=`echo "$1" | sed 's/-[^-]*$//'`
     131    if [ "$basic_machine" != "$1" ]
     132    then os=`echo "$1" | sed 's/.*-/-/'`
    134133    else os=; fi
    135134    ;;
     
    180179        -sco6)
    181180                os=-sco5v6
    182                 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
     181                basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
    183182                ;;
    184183        -sco5)
    185184                os=-sco3.2v5
    186                 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
     185                basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
    187186                ;;
    188187        -sco4)
    189188                os=-sco3.2v4
    190                 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
     189                basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
    191190                ;;
    192191        -sco3.2.[4-9]*)
    193192                os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
    194                 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
     193                basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
    195194                ;;
    196195        -sco3.2v[4-9]*)
    197196                # Don't forget version if it is 3.2v4 or newer.
    198                 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
     197                basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
    199198                ;;
    200199        -sco5v6*)
    201200                # Don't forget version if it is 3.2v4 or newer.
    202                 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
     201                basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
    203202                ;;
    204203        -sco*)
    205204                os=-sco3.2v2
    206                 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
     205                basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
    207206                ;;
    208207        -udk*)
    209                 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
     208                basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
    210209                ;;
    211210        -isc)
    212211                os=-isc2.2
    213                 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
     212                basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
    214213                ;;
    215214        -clix*)
     
    217216                ;;
    218217        -isc*)
    219                 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
     218                basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
    220219                ;;
    221220        -lynx*178)
     
    229228                ;;
    230229        -ptx*)
    231                 basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
    232                 ;;
    233         -windowsnt*)
    234                 os=`echo $os | sed -e 's/windowsnt/winnt/'`
     230                basic_machine=`echo "$1" | sed -e 's/86-.*/86-sequent/'`
    235231                ;;
    236232        -psos*)
     
    256252        | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
    257253        | avr | avr32 \
     254        | ba \
    258255        | be32 | be64 \
    259256        | bfin \
    260257        | c4x | c8051 | clipper \
    261258        | d10v | d30v | dlx | dsp16xx \
    262         | epiphany \
    263         | fido | fr30 | frv \
     259        | e2k | epiphany \
     260        | fido | fr30 | frv | ft32 \
    264261        | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
    265262        | hexagon \
    266         | i370 | i860 | i960 | ia64 \
     263        | i370 | i860 | i960 | ia16 | ia64 \
    267264        | ip2k | iq2000 \
    268265        | k1om \
     
    300297        | ns16k | ns32k \
    301298        | open8 | or1k | or1knd | or32 \
    302         | pdp10 | pdp11 | pj | pjl \
     299        | pdp10 | pj | pjl \
    303300        | powerpc | powerpc64 | powerpc64le | powerpcle \
     301        | pru \
    304302        | pyramid \
    305303        | riscv32 | riscv64 \
    306304        | rl78 | rx \
    307305        | score \
    308         | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
     306        | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
    309307        | sh64 | sh64le \
    310308        | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
     
    314312        | ubicom32 \
    315313        | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
    316         | we32k \
     314        | visium \
     315        | wasm32 \
    317316        | x86 | xc16x | xstormy16 | xtensa \
    318317        | z8k | z80)
     
    328327                basic_machine=tic6x-unknown
    329328                ;;
     329        leon|leon[3-9])
     330                basic_machine=sparc-$basic_machine
     331                ;;
    330332        m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
    331333                basic_machine=$basic_machine-unknown
    332334                os=-none
    333335                ;;
    334         m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
     336        m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65)
    335337                ;;
    336338        ms1)
     
    361363        # Object if more than one company name word.
    362364        *-*-*)
    363                 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
     365                echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2
    364366                exit 1
    365367                ;;
     
    373375        | arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
    374376        | avr-* | avr32-* \
     377        | ba-* \
    375378        | be32-* | be64-* \
    376379        | bfin-* | bs2000-* \
     
    378381        | c8051-* | clipper-* | craynv-* | cydra-* \
    379382        | d10v-* | d30v-* | dlx-* \
    380         | elxsi-* \
     383        | e2k-* | elxsi-* \
    381384        | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
    382385        | h8300-* | h8500-* \
    383386        | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
    384387        | hexagon-* \
    385         | i*86-* | i860-* | i960-* | ia64-* \
     388        | i*86-* | i860-* | i960-* | ia16-* | ia64-* \
    386389        | ip2k-* | iq2000-* \
    387390        | k1om-* \
     
    424427        | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
    425428        | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
     429        | pru-* \
    426430        | pyramid-* \
     431        | riscv32-* | riscv64-* \
    427432        | rl78-* | romp-* | rs6000-* | rx-* \
    428433        | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
     
    430435        | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
    431436        | sparclite-* \
    432         | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
     437        | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \
    433438        | tahoe-* \
    434439        | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
     
    438443        | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
    439444        | vax-* \
     445        | visium-* \
     446        | wasm32-* \
    440447        | we32k-* \
    441448        | x86-* | x86_64-* | xc16x-* | xps100-* \
     
    451458        # for a CPU type and a company and sometimes even an OS.
    452459        386bsd)
    453                 basic_machine=i386-unknown
     460                basic_machine=i386-pc
    454461                os=-bsd
    455462                ;;
     
    485492                ;;
    486493        amd64-*)
    487                 basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
     494                basic_machine=x86_64-`echo "$basic_machine" | sed 's/^[^-]*-//'`
    488495                ;;
    489496        amdahl)
     
    514521                os=-aros
    515522                ;;
     523        asmjs)
     524                basic_machine=asmjs-unknown
     525                ;;
    516526        aux)
    517527                basic_machine=m68k-apple
     
    527537                ;;
    528538        blackfin-*)
    529                 basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
     539                basic_machine=bfin-`echo "$basic_machine" | sed 's/^[^-]*-//'`
    530540                os=-linux
    531541                ;;
     
    535545                ;;
    536546        c54x-*)
    537                 basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
     547                basic_machine=tic54x-`echo "$basic_machine" | sed 's/^[^-]*-//'`
    538548                ;;
    539549        c55x-*)
    540                 basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
     550                basic_machine=tic55x-`echo "$basic_machine" | sed 's/^[^-]*-//'`
    541551                ;;
    542552        c6x-*)
    543                 basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
     553                basic_machine=tic6x-`echo "$basic_machine" | sed 's/^[^-]*-//'`
    544554                ;;
    545555        c90)
     
    630640                os=-bosx
    631641                ;;
    632         dpx2* | dpx2*-bull)
     642        dpx2*)
    633643                basic_machine=m68k-bull
    634644                os=-sysv3
     645                ;;
     646        e500v[12])
     647                basic_machine=powerpc-unknown
     648                os=$os"spe"
     649                ;;
     650        e500v[12]-*)
     651                basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'`
     652                os=$os"spe"
    635653                ;;
    636654        ebmon29k)
     
    723741                basic_machine=hppa1.0-hp
    724742                ;;
    725         hppa-next)
    726                 os=-nextstep3
    727                 ;;
    728743        hppaosf)
    729744                basic_machine=hppa1.1-hp
     
    738753                ;;
    739754        i*86v32)
    740                 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
     755                basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
    741756                os=-sysv32
    742757                ;;
    743758        i*86v4*)
    744                 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
     759                basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
    745760                os=-sysv4
    746761                ;;
    747762        i*86v)
    748                 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
     763                basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
    749764                os=-sysv
    750765                ;;
    751766        i*86sol2)
    752                 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
     767                basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
    753768                os=-solaris2
    754769                ;;
     
    757772                os=-mach
    758773                ;;
    759         i386-vsta | vsta)
     774        vsta)
    760775                basic_machine=i386-unknown
    761776                os=-vsta
     
    775790                os=-sysv
    776791                ;;
     792        leon-*|leon[3-9]-*)
     793                basic_machine=sparc-`echo "$basic_machine" | sed 's/-.*//'`
     794                ;;
    777795        m68knommu)
    778796                basic_machine=m68k-unknown
     
    780798                ;;
    781799        m68knommu-*)
    782                 basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
     800                basic_machine=m68k-`echo "$basic_machine" | sed 's/^[^-]*-//'`
    783801                os=-linux
    784                 ;;
    785         m88k-omron*)
    786                 basic_machine=m88k-omron
    787802                ;;
    788803        magnum | m3230)
     
    817832                ;;
    818833        mips3*-*)
    819                 basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
     834                basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`
    820835                ;;
    821836        mips3*)
    822                 basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
     837                basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`-unknown
    823838                ;;
    824839        monitor)
     
    839854                ;;
    840855        ms1-*)
    841                 basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
     856                basic_machine=`echo "$basic_machine" | sed -e 's/ms1-/mt-/'`
    842857                ;;
    843858        msys)
     
    881896                os=-sysv
    882897                ;;
    883         next | m*-next )
     898        next | m*-next)
    884899                basic_machine=m68k-next
    885900                case $os in
     
    926941                basic_machine=nsr-tandem
    927942                ;;
     943        nsv-tandem)
     944                basic_machine=nsv-tandem
     945                ;;
     946        nsx-tandem)
     947                basic_machine=nsx-tandem
     948                ;;
    928949        op50n-* | op60c-*)
    929950                basic_machine=hppa1.1-oki
     
    958979                ;;
    959980        parisc-*)
    960                 basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
     981                basic_machine=hppa-`echo "$basic_machine" | sed 's/^[^-]*-//'`
    961982                os=-linux
    962983                ;;
     
    974995                ;;
    975996        pc98-*)
    976                 basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
     997                basic_machine=i386-`echo "$basic_machine" | sed 's/^[^-]*-//'`
    977998                ;;
    978999        pentium | p5 | k5 | k6 | nexgen | viac3)
     
    9891010                ;;
    9901011        pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
    991                 basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
     1012                basic_machine=i586-`echo "$basic_machine" | sed 's/^[^-]*-//'`
    9921013                ;;
    9931014        pentiumpro-* | p6-* | 6x86-* | athlon-*)
    994                 basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
     1015                basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'`
    9951016                ;;
    9961017        pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
    997                 basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
     1018                basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'`
    9981019                ;;
    9991020        pentium4-*)
    1000                 basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
     1021                basic_machine=i786-`echo "$basic_machine" | sed 's/^[^-]*-//'`
    10011022                ;;
    10021023        pn)
     
    10081029                ;;
    10091030        ppc-* | ppcbe-*)
    1010                 basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
    1011                 ;;
    1012         ppcle | powerpclittle | ppc-le | powerpc-little)
     1031                basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'`
     1032                ;;
     1033        ppcle | powerpclittle)
    10131034                basic_machine=powerpcle-unknown
    10141035                ;;
    10151036        ppcle-* | powerpclittle-*)
    1016                 basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
     1037                basic_machine=powerpcle-`echo "$basic_machine" | sed 's/^[^-]*-//'`
    10171038                ;;
    10181039        ppc64)  basic_machine=powerpc64-unknown
    10191040                ;;
    1020         ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
    1021                 ;;
    1022         ppc64le | powerpc64little | ppc64-le | powerpc64-little)
     1041        ppc64-*) basic_machine=powerpc64-`echo "$basic_machine" | sed 's/^[^-]*-//'`
     1042                ;;
     1043        ppc64le | powerpc64little)
    10231044                basic_machine=powerpc64le-unknown
    10241045                ;;
    10251046        ppc64le-* | powerpc64little-*)
    1026                 basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
     1047                basic_machine=powerpc64le-`echo "$basic_machine" | sed 's/^[^-]*-//'`
    10271048                ;;
    10281049        ps2)
     
    10781099                basic_machine=i386-sequent
    10791100                ;;
    1080         sh)
    1081                 basic_machine=sh-hitachi
    1082                 os=-hms
    1083                 ;;
    10841101        sh5el)
    10851102                basic_machine=sh5le-unknown
    10861103                ;;
    1087         sh64)
    1088                 basic_machine=sh64-unknown
    1089                 ;;
    1090         sparclite-wrs | simso-wrs)
     1104        simso-wrs)
    10911105                basic_machine=sparclite-wrs
    10921106                os=-vxworks
     
    11071121                ;;
    11081122        strongarm-* | thumb-*)
    1109                 basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
     1123                basic_machine=arm-`echo "$basic_machine" | sed 's/^[^-]*-//'`
    11101124                ;;
    11111125        sun2)
     
    12291243                os=-proelf
    12301244                ;;
     1245        x64)
     1246                basic_machine=x86_64-pc
     1247                ;;
    12311248        xbox)
    12321249                basic_machine=i686-pc
     
    12371254                ;;
    12381255        xscale-* | xscalee[bl]-*)
    1239                 basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
     1256                basic_machine=`echo "$basic_machine" | sed 's/^xscale/arm/'`
    12401257                ;;
    12411258        ymp)
    12421259                basic_machine=ymp-cray
    12431260                os=-unicos
    1244                 ;;
    1245         z8k-*-coff)
    1246                 basic_machine=z8k-unknown
    1247                 os=-sim
    1248                 ;;
    1249         z80-*-coff)
    1250                 basic_machine=z80-unknown
    1251                 os=-sim
    12521261                ;;
    12531262        none)
     
    12791288                basic_machine=vax-dec
    12801289                ;;
    1281         pdp10)
    1282                 # there are many clones, so DEC is not a safe bet
    1283                 basic_machine=pdp10-unknown
    1284                 ;;
    12851290        pdp11)
    12861291                basic_machine=pdp11-dec
     
    12921297                basic_machine=sh-unknown
    12931298                ;;
    1294         sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
    1295                 basic_machine=sparc-sun
    1296                 ;;
    12971299        cydra)
    12981300                basic_machine=cydra-cydrome
     
    13141316                ;;
    13151317        *)
    1316                 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
     1318                echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2
    13171319                exit 1
    13181320                ;;
     
    13221324case $basic_machine in
    13231325        *-digital*)
    1324                 basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
     1326                basic_machine=`echo "$basic_machine" | sed 's/digital.*/dec/'`
    13251327                ;;
    13261328        *-commodore*)
    1327                 basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
     1329                basic_machine=`echo "$basic_machine" | sed 's/commodore.*/cbm/'`
    13281330                ;;
    13291331        *)
     
    13361338then
    13371339case $os in
    1338         # First match some system type aliases
    1339         # that might get confused with valid system types.
     1340        # First match some system type aliases that might get confused
     1341        # with valid system types.
    13401342        # -solaris* is a basic system type, with this one exception.
    13411343        -auroraux)
     
    13481350                os=-solaris2
    13491351                ;;
    1350         -svr4*)
    1351                 os=-sysv4
    1352                 ;;
    13531352        -unixware*)
    13541353                os=-sysv4.2uw
     
    13571356                os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
    13581357                ;;
    1359         # First accept the basic system types.
     1358        # es1800 is here to avoid being matched by es* (a different OS)
     1359        -es1800*)
     1360                os=-ose
     1361                ;;
     1362        # Now accept the basic system types.
    13601363        # The portable systems comes first.
    1361         # Each alternative MUST END IN A *, to match a version number.
     1364        # Each alternative MUST end in a * to match a version number.
    13621365        # -sysv* is not here because it comes later, after sysvr4.
    13631366        -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
     
    13661369              | -sym* | -kopensolaris* | -plan9* \
    13671370              | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
    1368               | -aos* | -aros* \
     1371              | -aos* | -aros* | -cloudabi* | -sortix* \
    13691372              | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
    13701373              | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
    1371               | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
    1372               | -bitrig* | -openbsd* | -solidbsd* \
     1374              | -hiux* | -knetbsd* | -mirbsd* | -netbsd* \
     1375              | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \
    13731376              | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
    13741377              | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
    13751378              | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
    13761379              | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
    1377               | -chorusos* | -chorusrdb* | -cegcc* \
     1380              | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \
    13781381              | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
    1379               | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
     1382              | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
    13801383              | -linux-newlib* | -linux-musl* | -linux-uclibc* \
    13811384              | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
    1382               | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
     1385              | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* \
    13831386              | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
    13841387              | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
    13851388              | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
    1386               | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
     1389              | -morphos* | -superux* | -rtmk* | -windiss* \
    13871390              | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
    1388               | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*)
     1391              | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \
     1392              | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -bme* \
     1393              | -midnightbsd*)
    13891394        # Remember, each alternative MUST END IN *, to match a version number.
    13901395                ;;
     
    14031408                os=`echo $os | sed -e 's|nto|nto-qnx|'`
    14041409                ;;
    1405         -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
    1406               | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
     1410        -sim | -xray | -os68k* | -v88r* \
     1411              | -windows* | -osx | -abug | -netware* | -os9* \
    14071412              | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
    14081413                ;;
    14091414        -mac*)
    1410                 os=`echo $os | sed -e 's|mac|macos|'`
     1415                os=`echo "$os" | sed -e 's|mac|macos|'`
    14111416                ;;
    14121417        -linux-dietlibc)
     
    14171422                ;;
    14181423        -sunos5*)
    1419                 os=`echo $os | sed -e 's|sunos5|solaris2|'`
     1424                os=`echo "$os" | sed -e 's|sunos5|solaris2|'`
    14201425                ;;
    14211426        -sunos6*)
    1422                 os=`echo $os | sed -e 's|sunos6|solaris3|'`
     1427                os=`echo "$os" | sed -e 's|sunos6|solaris3|'`
    14231428                ;;
    14241429        -opened*)
     
    14311436                os=-wince
    14321437                ;;
    1433         -osfrose*)
    1434                 os=-osfrose
    1435                 ;;
    1436         -osf*)
    1437                 os=-osf
    1438                 ;;
    14391438        -utek*)
    14401439                os=-bsd
     
    14611460                os=-rtmk-nova
    14621461                ;;
    1463         -ns2 )
     1462        -ns2)
    14641463                os=-nextstep2
    14651464                ;;
     
    14831482                os=-sysv3
    14841483                ;;
    1485         -svr4)
     1484        -svr4*)
    14861485                os=-sysv4
    14871486                ;;
     
    14981497                os=-ose
    14991498                ;;
    1500         -es1800*)
    1501                 os=-ose
    1502                 ;;
    1503         -xenix)
    1504                 os=-xenix
    1505                 ;;
    15061499        -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
    15071500                os=-mint
    15081501                ;;
    1509         -aros*)
    1510                 os=-aros
    1511                 ;;
    15121502        -zvmoe)
    15131503                os=-zvmoe
     
    15161506                os=-dicos
    15171507                ;;
     1508        -pikeos*)
     1509                # Until real need of OS specific support for
     1510                # particular features comes up, bare metal
     1511                # configurations are quite functional.
     1512                case $basic_machine in
     1513                    arm*)
     1514                        os=-eabi
     1515                        ;;
     1516                    *)
     1517                        os=-elf
     1518                        ;;
     1519                esac
     1520                ;;
    15181521        -nacl*)
     1522                ;;
     1523        -ios)
    15191524                ;;
    15201525        -none)
     
    15231528                # Get rid of the `-' at the beginning of $os.
    15241529                os=`echo $os | sed 's/[^-]*-//'`
    1525                 echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
     1530                echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2
    15261531                exit 1
    15271532                ;;
     
    16131618                os=-sunos4.1.1
    16141619                ;;
     1620        pru-*)
     1621                os=-elf
     1622                ;;
    16151623        *-be)
    16161624                os=-beos
    16171625                ;;
    1618         *-haiku)
    1619                 os=-haiku
    1620                 ;;
    16211626        *-ibm)
    16221627                os=-aix
     
    16581663                os=-luna
    16591664                ;;
    1660         *-next )
     1665        *-next)
    16611666                os=-nextstep
    16621667                ;;
     
    16721677        i370-*)
    16731678                os=-mvs
    1674                 ;;
    1675         *-next)
    1676                 os=-nextstep3
    16771679                ;;
    16781680        *-gould)
     
    17851787                                ;;
    17861788                esac
    1787                 basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
     1789                basic_machine=`echo "$basic_machine" | sed "s/unknown/$vendor/"`
    17881790                ;;
    17891791esac
    17901792
    1791 echo $basic_machine$os
     1793echo "$basic_machine$os"
    17921794exit
    17931795
    17941796# Local variables:
    1795 # eval: (add-hook 'write-file-hooks 'time-stamp)
     1797# eval: (add-hook 'write-file-functions 'time-stamp)
    17961798# time-stamp-start: "timestamp='"
    17971799# time-stamp-format: "%:y-%02m-%02d"
  • trunk/docs/Changelog

    r544 r549  
    114.3.3:
     2        * fix broken 'make deb' makefile target
     3        * eliminate obsolete 'sstrip' utility
     4        * systemd support
     5        * fix broken rpm specfile (patch by Franky Van L.)
     6        * fix broken mysql init script
    27        * fix some issues with link-time optimisation (option -flto with
    38        recent gcc versions)
  • trunk/init/samhain.startSystemd.in

    r548 r549  
    22[Unit]
    33Description=The @install_name@ Service
    4 After=network.target syslog.target remote-fs.target nss-user-lookup.target
     4After=network.target remote-fs.target nss-user-lookup.target
    55
    66[Service]
  • trunk/rules.deb-light.in

    r531 r549  
    88#
    99
    10 # Uncomment this to turn on verbose mode.
    11 #export DH_VERBOSE=1
    1210
    13 # This is the debhelper compatability version to use.
    14 export DH_COMPAT=9
     11%:
     12        dh $@ --with-autoreconf
    1513
    16 package=@install_name@
    1714
    18 # CAVEAT: including the --enable-base= option is for packages to be
    19 #         distributed INTERNALLY on your network, NOT for packages
    20 #         to be distributed to THIRD PARTIES
     15override_dh_clean:
     16        [ ! -f Makefile ] || $(MAKE) distclean
     17        -rm -f samhainrc.install
     18        -rm -f build-stamp build-server-stamp build-client-stamp
     19        dh_clean
    2120
    22 build: build-stamp
    23 build-stamp:
    24         dh_testdir
     21override_dh_auto_configure:
    2522        @top_srcdir@/configure @mydefargs@
    26         $(MAKE)
    27         echo '#!/bin/sh' > ./sstrip
    28         echo 'echo "*** SSTRIP DISABLED ***"' >> ./sstrip
     23
     24override_dh_auto_build:
     25        dh_auto_build
    2926        if ! test x$(PASSWORD) = x; then \
    3027                if test -f samhain_setpwd; then \
     
    3431                fi; \
    3532        fi
    36         touch build-stamp
    3733
    38 clean:
    39         dh_testdir
    40         dh_testroot
    41         rm -f build-stamp
    42         -[ -f Makefile ] && $(MAKE) distclean
    43         dh_clean
    44 
    45 install: build
    46         dh_testdir
    47         dh_testroot
    48         dh_clean -k
    49         dh_installdirs
    50 
     34override_dh_auto_install:
    5135        $(MAKE) install-light install-boot DESTDIR=`pwd`/debian/@install_name@
    52         # $(MAKE) install-light install-boot DESTDIR=`pwd`/debian/tmp
    53 
    54         # However, remove the rc.d links
    55         -rm -rf `pwd`/debian/tmp/etc/rc?.d
    56 
    57         # Remove samhain_stealth for light install
    58         -rm -f `pwd`/debian/tmp/@sbindir@/@install_name@_stealth
    59 
    60 # Build architecture-independent files here.
    61 binary-indep: build install
    62 # We have nothing to do by default.
    6336
    6437
    65 # Build architecture-dependent files here.
    66 binary-arch: build install
    67 #       dh_testversion
    68         dh_testdir
    69         dh_testroot
    70         dh_installdebconf       
    71         # dh_installdocs
    72         dh_installmenu
    73         dh_installinit -- defaults 19
    74         [ -f debian/@install_name@.postinst.debhelper ] && \
    75                 cd debian && \
    76                 cat @install_name@.postinst.debhelper | \
    77                     sed 's%/etc/init.d/@install_name@ start%:%' > postinst.tmp && \
    78                     mv postinst.tmp @install_name@.postinst.debhelper
    79         [ -f debian/@install_name@.postinst.debhelper ] && \
    80                 cd debian && \
    81                 cat @install_name@.postinst.debhelper | \
    82                     sed 's%invoke-rc.d @install_name@ start%:%' > postinst.tmp && \
    83                     mv postinst.tmp @install_name@.postinst.debhelper
    84         [ -f debian/@install_name@.prerm.debhelper ] && \
    85                 cd debian && \
    86                 cat @install_name@.prerm.debhelper | \
    87                     sed 's%/etc/init.d/@install_name@ stop%/etc/init.d/@install_name@ stop || echo service @install_name@ already stopped%' > prerm.tmp && \
    88                     mv prerm.tmp @install_name@.prerm.debhelper
    89         [ -f debian/@install_name@.prerm.debhelper ] && \
    90                 cd debian && \
    91                 cat @install_name@.prerm.debhelper | \
    92                     sed 's%invoke-rc.d @install_name@ stop%invoke-rc.d @install_name@ stop || echo service @install_name@ already stopped%' > prerm.tmp && \
    93                     mv prerm.tmp @install_name@.prerm.debhelper
    94         # dh_installmanpages
    95         # dh_installchangelogs @top_srcdir@/docs/Changelog
    96         dh_link
    97         dh_strip
    98         dh_compress
     38override_dh_install:
     39        # However, remove the rc.d links
     40        -rm -rf `pwd`/debian/@install_name@/etc/rc?.d
     41        # Remove samhain_stealth for light install
     42        -rm -f `pwd`/debian/@install_name@/@sbindir@/@install_name@_stealth
     43        # remove samhain_setpwd if not needed
     44        if ! test x$(PASSWORD) = x; then \
     45                rm -f `pwd`/debian/@install_name@/@sbindir@/@install_name@_setpwd; \
     46        fi
     47
     48override_dh_installdocs:
     49        # do nothing
     50
     51override_dh_installchangelogs:
     52        # do nothing
     53
     54override_dh_installman:
     55        # do nothing
     56
     57override_dh_installinit:
     58        dh_installinit --no-start -- defaults 19
     59
     60override_dh_usrlocal:
     61        # do nothing
     62
     63override_dh_fixperms:
    9964        dh_fixperms
    100         dh_installdeb
    101         dh_shlibdeps
    102         dh_gencontrol
    103         dh_md5sums
    104         dh_builddeb
     65        # Fix the permissions
     66        chmod o-rX `pwd`/debian/@install_name@/@mydataroot@ \
     67                `pwd`/debian/@install_name@/@myconffile@
     68        if ! test "x@mylogdir@" = "x/var/log"; then \
     69                chmod o-rX `pwd`/debian/@install_name@/@mylogdir@; \
     70        fi
    10571
    10672
    107 define checkdir
    108         test -f debian/rules
    109 endef
    110 
    111 binary: binary-indep binary-arch
    112 .PHONY: build clean binary-indep binary-arch binary install
    113 
  • trunk/rules.deb.in

    r531 r549  
    88#
    99
    10 # Uncomment this to turn on verbose mode.
    11 #export DH_VERBOSE=1
     10%:
     11        dh $@ --with-autoreconf
    1212
    13 # This is the debhelper compatability version to use.
    14 export DH_COMPAT=9
     13override_dh_clean:
     14        [ ! -f Makefile ] || $(MAKE) distclean
     15        -rm -f samhainrc.install
     16        -rm -f build-stamp build-server-stamp build-client-stamp
     17        dh_clean
    1518
    16 package=@install_name@
     19override_dh_auto_configure:
     20        @top_srcdir@/configure @mydefargs@
    1721
    18 # CAVEAT: including the --enable-base= option is for packages to be
    19 #         distributed INTERNALLY on your network, NOT for packages
    20 #         to be distributed to THIRD PARTIES
    21 
    22 build: build-stamp
    23 build-stamp:
    24         dh_testdir
    25         @top_srcdir@/configure @mydefargs@
    26         $(MAKE)
    27         echo '#!/bin/sh' > ./sstrip
    28         echo 'echo "*** SSTRIP DISABLED ***"' >> ./sstrip
     22override_dh_auto_build:
     23        dh_auto_build
    2924        if ! test x$(PASSWORD) = x; then \
    3025                if test -f samhain_setpwd; then \
     
    3429                fi; \
    3530        fi
    36         touch build-stamp
    3731
    38 clean:
    39         dh_testdir
    40         dh_testroot
    41         rm -f build-stamp
    42         -[ -f Makefile ] && $(MAKE) distclean
    43         dh_clean
    44 
    45 install: build
    46         dh_testdir
    47         dh_testroot
    48         dh_clean -k
    49         dh_installdirs
    50 
    51         # Fix the permissions
    52         #chmod o-rX `pwd`/debian/tmp/var/log/samhain \
    53         #       `pwd`/debian/tmp/var/run/samhain \
    54         #       `pwd`/debian/tmp/var/lib/samhain \
    55         #       `pwd`/debian/tmp/etc/samhain
    56 
    57         # $(MAKE) install install-boot DESTDIR=`pwd`/debian/tmp
     32override_dh_auto_install:
    5833        $(MAKE) install install-boot DESTDIR=`pwd`/debian/@install_name@
    5934
     35override_dh_install:
    6036        # However, remove the rc.d links
    61         -rm -rf `pwd`/debian/tmp/etc/rc?.d
     37        -rm -rf `pwd`/debian/@install_name@/etc/rc?.d
    6238
    63         # install -m 755 encode `pwd`/debian/tmp/usr/bin/samhain_encode
    64 
    65         # install -m 644 profiles/debianlinux_i386/samhainrc `pwd`/debian/tmp@myconffile@
    66         # install -m 644 debian/samhain.logrotate `pwd`/debian/tmp/etc/logrotate.d/samhain
    67 
    68 # Build architecture-independent files here.
    69 binary-indep: build install
    70 # We have nothing to do by default.
    71 
    72 
    73 # Build architecture-dependent files here.
    74 binary-arch: build install
    75 #       dh_testversion
    76         dh_testdir
    77         dh_testroot
    78         dh_installdebconf       
    79         dh_installdocs
     39override_dh_installdocs:
     40        dh_installdocs
    8041        [ -f debian/@install_name@/usr/share/doc/@install_name@/MANUAL-2_4.html.tar ] && \
    8142                cd debian/@install_name@/usr/share/doc/@install_name@ && \
    8243                tar xf MANUAL-2_4.html.tar && mv MANUAL-2_4 manual.html && \
    83                 rm -f MANUAL-2_4.html.tar && \
     44                rm -f MANUAL-2_4.html.tar
     45        [ -f debian/@install_name@/usr/share/doc/@install_name@/MANUAL-2_4.pdf ] && \
     46                cd debian/@install_name@/usr/share/doc/@install_name@ && \
    8447                mv MANUAL-2_4.pdf manual.pdf
    85         dh_installexamples @top_srcdir@/scripts/example_pager.pl \
    86                 @top_srcdir@/scripts/example_sms.pl \
    87                 @top_srcdir@/scripts/concat.pl \
    88                 @top_srcdir@/scripts/samhain.logrotator \
    89                 @top_srcdir@/scripts/samhainadmin.pl \
    90                 @top_srcdir@/scripts/check_samhain.pl \
    91                 @top_srcdir@/yulerc.template \
    92                 @top_srcdir@/samhainrc.linux
    93         dh_installmenu
    94         dh_installinit -- defaults 19
    95         [ -f debian/@install_name@.postinst.debhelper ] && \
    96                 cd debian && \
    97                 cat @install_name@.postinst.debhelper | \
    98                     sed 's%/etc/init.d/@install_name@ start%:%' > postinst.tmp && \
    99                     mv postinst.tmp @install_name@.postinst.debhelper
    100         [ -f debian/@install_name@.postinst.debhelper ] && \
    101                 cd debian && \
    102                 cat @install_name@.postinst.debhelper | \
    103                     sed 's%invoke-rc.d @install_name@ start%:%' > postinst.tmp && \
    104                     mv postinst.tmp @install_name@.postinst.debhelper
    105         [ -f debian/@install_name@.prerm.debhelper ] && \
    106                 cd debian && \
    107                 cat @install_name@.prerm.debhelper | \
    108                     sed 's%/etc/init.d/@install_name@ stop%/etc/init.d/@install_name@ stop || echo service @install_name@ already stopped%' > prerm.tmp && \
    109                     mv prerm.tmp @install_name@.prerm.debhelper
    110         [ -f debian/@install_name@.prerm.debhelper ] && \
    111                 cd debian && \
    112                 cat @install_name@.prerm.debhelper | \
    113                     sed 's%invoke-rc.d @install_name@ stop%invoke-rc.d @install_name@ stop || echo service @install_name@ already stopped%' > prerm.tmp && \
    114                     mv prerm.tmp @install_name@.prerm.debhelper
    115         # dh_installmanpages
    116         dh_installchangelogs @top_srcdir@/docs/Changelog
    117         dh_link
    118         dh_strip
    119         dh_compress
     48
     49override_dh_installchangelogs:
     50        dh_installchangelogs docs/Changelog
     51
     52override_dh_installinit:
     53        dh_installinit --no-start -- defaults 19
     54
     55override_dh_usrlocal:
     56        # do nothing
     57
     58override_dh_fixperms:
    12059        dh_fixperms
    121         dh_installdeb
    122         dh_shlibdeps
    123         dh_gencontrol
    124         dh_md5sums
    125         dh_builddeb
     60        # Fix the permissions
     61        chmod o-rX `pwd`/debian/@install_name@/@mydataroot@ \
     62                `pwd`/debian/@install_name@/@myconffile@
     63        if ! test "x@mylogdir@" = "x/var/log"; then \
     64                chmod o-rX `pwd`/debian/@install_name@/@mylogdir@; \
     65        fi
    12666
    127 
    128 define checkdir
    129         test -f debian/rules
    130 endef
    131 
    132 binary: binary-indep binary-arch
    133 .PHONY: build clean binary-indep binary-arch binary install
    134 
Note: See TracChangeset for help on using the changeset viewer.