Changeset 3123


Ignore:
Timestamp:
Dec 4, 2013 10:16:31 PM (6 years ago)
Author:
kelman
Message:

Update automake files to 1.14 versions, fixes a configure warning about old 'missing'

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/config.guess

    r3118 r3123  
    11#! /bin/sh
    22# Attempt to guess a canonical system name.
    3 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
    4 #   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
    5 #   2011, 2012 Free Software Foundation, Inc.
    6 
    7 timestamp='2012-02-10'
     3#   Copyright 1992-2013 Free Software Foundation, Inc.
     4
     5timestamp='2013-06-10'
    86
    97# This file is free software; you can redistribute it and/or modify it
    108# under the terms of the GNU General Public License as published by
    11 # the Free Software Foundation; either version 2 of the License, or
     9# the Free Software Foundation; either version 3 of the License, or
    1210# (at your option) any later version.
    1311#
     
    2321# distribute this file as part of a program that contains a
    2422# configuration script generated by Autoconf, you may include it under
    25 # the same distribution terms that you use for the rest of that program.
    26 
    27 
    28 # Originally written by Per Bothner.  Please send patches (context
    29 # diff format) to <config-patches@gnu.org> and include a ChangeLog
    30 # entry.
     23# the same distribution terms that you use for the rest of that
     24# program.  This Exception is an additional permission under section 7
     25# of the GNU General Public License, version 3 ("GPLv3").
    3126#
    32 # This script attempts to guess a canonical system name similar to
    33 # config.sub.  If it succeeds, it prints the system name on stdout, and
    34 # exits with 0.  Otherwise, it exits with 1.
     27# Originally written by Per Bothner.
    3528#
    3629# You can get the latest version of this script from:
    3730# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
     31#
     32# Please send patches with a ChangeLog entry to config-patches@gnu.org.
     33
    3834
    3935me=`echo "$0" | sed -e 's,.*/,,'`
     
    5551
    5652Originally written by Per Bothner.
    57 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
    58 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
    59 Free Software Foundation, Inc.
     53Copyright 1992-2013 Free Software Foundation, Inc.
    6054
    6155This is free software; see the source for copying conditions.  There is NO
     
    138132UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
    139133UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
     134
     135case "${UNAME_SYSTEM}" in
     136Linux|GNU|GNU/*)
     137        # If the system lacks a compiler, then just pick glibc.
     138        # We could probably try harder.
     139        LIBC=gnu
     140
     141        eval $set_cc_for_build
     142        cat <<-EOF > $dummy.c
     143        #include <features.h>
     144        #if defined(__UCLIBC__)
     145        LIBC=uclibc
     146        #elif defined(__dietlibc__)
     147        LIBC=dietlibc
     148        #else
     149        LIBC=gnu
     150        #endif
     151        EOF
     152        eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
     153        ;;
     154esac
    140155
    141156# Note: order is significant - the case branches are not exclusive.
     
    200215        # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
    201216        echo "${machine}-${os}${release}"
     217        exit ;;
     218    *:Bitrig:*:*)
     219        UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
     220        echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
    202221        exit ;;
    203222    *:OpenBSD:*:*)
     
    303322        echo arm-acorn-riscix${UNAME_RELEASE}
    304323        exit ;;
    305     arm:riscos:*:*|arm:RISCOS:*:*)
     324    arm*:riscos:*:*|arm*:RISCOS:*:*)
    306325        echo arm-unknown-riscos
    307326        exit ;;
     
    802821        echo ${UNAME_MACHINE}-pc-cygwin
    803822        exit ;;
     823    *:MINGW64*:*)
     824        echo ${UNAME_MACHINE}-pc-mingw64
     825        exit ;;
    804826    *:MINGW*:*)
    805827        echo ${UNAME_MACHINE}-pc-mingw32
     
    853875    *:GNU:*:*)
    854876        # the GNU system
    855         echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
     877        echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
    856878        exit ;;
    857879    *:GNU/*:*:*)
    858880        # other systems with GNU libc and userland
    859         echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
     881        echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
    860882        exit ;;
    861883    i*86:Minix:*:*)
     
    863885        exit ;;
    864886    aarch64:Linux:*:*)
    865         echo ${UNAME_MACHINE}-unknown-linux-gnu
     887        echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
    866888        exit ;;
    867889    aarch64_be:Linux:*:*)
    868890        UNAME_MACHINE=aarch64_be
    869         echo ${UNAME_MACHINE}-unknown-linux-gnu
     891        echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
    870892        exit ;;
    871893    alpha:Linux:*:*)
     
    880902        esac
    881903        objdump --private-headers /bin/sh | grep -q ld.so.1
    882         if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
    883         echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
     904        if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
     905        echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
     906        exit ;;
     907    arc:Linux:*:* | arceb:Linux:*:*)
     908        echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
    884909        exit ;;
    885910    arm*:Linux:*:*)
     
    888913            | grep -q __ARM_EABI__
    889914        then
    890             echo ${UNAME_MACHINE}-unknown-linux-gnu
     915            echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
    891916        else
    892917            if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
    893918                | grep -q __ARM_PCS_VFP
    894919            then
    895                 echo ${UNAME_MACHINE}-unknown-linux-gnueabi
     920                echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
    896921            else
    897                 echo ${UNAME_MACHINE}-unknown-linux-gnueabihf
     922                echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
    898923            fi
    899924        fi
    900925        exit ;;
    901926    avr32*:Linux:*:*)
    902         echo ${UNAME_MACHINE}-unknown-linux-gnu
     927        echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
    903928        exit ;;
    904929    cris:Linux:*:*)
    905         echo ${UNAME_MACHINE}-axis-linux-gnu
     930        echo ${UNAME_MACHINE}-axis-linux-${LIBC}
    906931        exit ;;
    907932    crisv32:Linux:*:*)
    908         echo ${UNAME_MACHINE}-axis-linux-gnu
     933        echo ${UNAME_MACHINE}-axis-linux-${LIBC}
    909934        exit ;;
    910935    frv:Linux:*:*)
    911         echo ${UNAME_MACHINE}-unknown-linux-gnu
     936        echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
    912937        exit ;;
    913938    hexagon:Linux:*:*)
    914         echo ${UNAME_MACHINE}-unknown-linux-gnu
     939        echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
    915940        exit ;;
    916941    i*86:Linux:*:*)
    917         LIBC=gnu
    918         eval $set_cc_for_build
    919         sed 's/^        //' << EOF >$dummy.c
    920         #ifdef __dietlibc__
    921         LIBC=dietlibc
    922         #endif
    923 EOF
    924         eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
    925         echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
     942        echo ${UNAME_MACHINE}-pc-linux-${LIBC}
    926943        exit ;;
    927944    ia64:Linux:*:*)
    928         echo ${UNAME_MACHINE}-unknown-linux-gnu
     945        echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
    929946        exit ;;
    930947    m32r*:Linux:*:*)
    931         echo ${UNAME_MACHINE}-unknown-linux-gnu
     948        echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
    932949        exit ;;
    933950    m68*:Linux:*:*)
    934         echo ${UNAME_MACHINE}-unknown-linux-gnu
     951        echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
    935952        exit ;;
    936953    mips:Linux:*:* | mips64:Linux:*:*)
     
    951968EOF
    952969        eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
    953         test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
     970        test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
    954971        ;;
     972    or1k:Linux:*:*)
     973        echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
     974        exit ;;
    955975    or32:Linux:*:*)
    956         echo ${UNAME_MACHINE}-unknown-linux-gnu
     976        echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
    957977        exit ;;
    958978    padre:Linux:*:*)
    959         echo sparc-unknown-linux-gnu
     979        echo sparc-unknown-linux-${LIBC}
    960980        exit ;;
    961981    parisc64:Linux:*:* | hppa64:Linux:*:*)
    962         echo hppa64-unknown-linux-gnu
     982        echo hppa64-unknown-linux-${LIBC}
    963983        exit ;;
    964984    parisc:Linux:*:* | hppa:Linux:*:*)
    965985        # Look for CPU level
    966986        case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
    967           PA7*) echo hppa1.1-unknown-linux-gnu ;;
    968           PA8*) echo hppa2.0-unknown-linux-gnu ;;
    969           *)    echo hppa-unknown-linux-gnu ;;
     987          PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
     988          PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
     989          *)    echo hppa-unknown-linux-${LIBC} ;;
    970990        esac
    971991        exit ;;
    972992    ppc64:Linux:*:*)
    973         echo powerpc64-unknown-linux-gnu
     993        echo powerpc64-unknown-linux-${LIBC}
    974994        exit ;;
    975995    ppc:Linux:*:*)
    976         echo powerpc-unknown-linux-gnu
     996        echo powerpc-unknown-linux-${LIBC}
     997        exit ;;
     998    ppc64le:Linux:*:*)
     999        echo powerpc64le-unknown-linux-${LIBC}
     1000        exit ;;
     1001    ppcle:Linux:*:*)
     1002        echo powerpcle-unknown-linux-${LIBC}
    9771003        exit ;;
    9781004    s390:Linux:*:* | s390x:Linux:*:*)
    979         echo ${UNAME_MACHINE}-ibm-linux
     1005        echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
    9801006        exit ;;
    9811007    sh64*:Linux:*:*)
    982         echo ${UNAME_MACHINE}-unknown-linux-gnu
     1008        echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
    9831009        exit ;;
    9841010    sh*:Linux:*:*)
    985         echo ${UNAME_MACHINE}-unknown-linux-gnu
     1011        echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
    9861012        exit ;;
    9871013    sparc:Linux:*:* | sparc64:Linux:*:*)
    988         echo ${UNAME_MACHINE}-unknown-linux-gnu
     1014        echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
    9891015        exit ;;
    9901016    tile*:Linux:*:*)
    991         echo ${UNAME_MACHINE}-unknown-linux-gnu
     1017        echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
    9921018        exit ;;
    9931019    vax:Linux:*:*)
    994         echo ${UNAME_MACHINE}-dec-linux-gnu
     1020        echo ${UNAME_MACHINE}-dec-linux-${LIBC}
    9951021        exit ;;
    9961022    x86_64:Linux:*:*)
    997         echo ${UNAME_MACHINE}-unknown-linux-gnu
     1023        echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
    9981024        exit ;;
    9991025    xtensa*:Linux:*:*)
    1000         echo ${UNAME_MACHINE}-unknown-linux-gnu
     1026        echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
    10011027        exit ;;
    10021028    i*86:DYNIX/ptx:4*:*)
     
    12021228        echo i586-pc-haiku
    12031229        exit ;;
     1230    x86_64:Haiku:*:*)
     1231        echo x86_64-unknown-haiku
     1232        exit ;;
    12041233    SX-4:SUPER-UX:*:*)
    12051234        echo sx4-nec-superux${UNAME_RELEASE}
     
    12281257    *:Darwin:*:*)
    12291258        UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
    1230         case $UNAME_PROCESSOR in
    1231             i386)
    1232                 eval $set_cc_for_build
    1233                 if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
    1234                   if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
    1235                       (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
    1236                       grep IS_64BIT_ARCH >/dev/null
    1237                   then
    1238                       UNAME_PROCESSOR="x86_64"
    1239                   fi
    1240                 fi ;;
    1241             unknown) UNAME_PROCESSOR=powerpc ;;
    1242         esac
     1259        eval $set_cc_for_build
     1260        if test "$UNAME_PROCESSOR" = unknown ; then
     1261            UNAME_PROCESSOR=powerpc
     1262        fi
     1263        if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
     1264            if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
     1265                (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
     1266                grep IS_64BIT_ARCH >/dev/null
     1267            then
     1268                case $UNAME_PROCESSOR in
     1269                    i386) UNAME_PROCESSOR=x86_64 ;;
     1270                    powerpc) UNAME_PROCESSOR=powerpc64 ;;
     1271                esac
     1272            fi
     1273        fi
    12431274        echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
    12441275        exit ;;
     
    12571288        echo neo-tandem-nsk${UNAME_RELEASE}
    12581289        exit ;;
    1259     NSE-?:NONSTOP_KERNEL:*:*)
     1290    NSE-*:NONSTOP_KERNEL:*:*)
    12601291        echo nse-tandem-nsk${UNAME_RELEASE}
    12611292        exit ;;
     
    13301361        exit ;;
    13311362esac
    1332 
    1333 #echo '(No uname command or uname output not recognized.)' 1>&2
    1334 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
    13351363
    13361364eval $set_cc_for_build
  • trunk/config.sub

    r3118 r3123  
    11#! /bin/sh
    22# Configuration validation subroutine script.
    3 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
    4 #   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
    5 #   2011, 2012 Free Software Foundation, Inc.
    6 
    7 timestamp='2012-02-10'
    8 
    9 # This file is (in principle) common to ALL GNU software.
    10 # The presence of a machine in this file suggests that SOME GNU software
    11 # can handle that machine.  It does not imply ALL GNU software can.
    12 #
    13 # This file is free software; you can redistribute it and/or modify
    14 # it under the terms of the GNU General Public License as published by
    15 # the Free Software Foundation; either version 2 of the License, or
     3#   Copyright 1992-2013 Free Software Foundation, Inc.
     4
     5timestamp='2013-04-24'
     6
     7# This file is free software; you can redistribute it and/or modify it
     8# under the terms of the GNU General Public License as published by
     9# the Free Software Foundation; either version 3 of the License, or
    1610# (at your option) any later version.
    1711#
    18 # This program is distributed in the hope that it will be useful,
    19 # but WITHOUT ANY WARRANTY; without even the implied warranty of
    20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    21 # GNU General Public License for more details.
     12# This program is distributed in the hope that it will be useful, but
     13# WITHOUT ANY WARRANTY; without even the implied warranty of
     14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     15# General Public License for more details.
    2216#
    2317# You should have received a copy of the GNU General Public License
     
    2721# distribute this file as part of a program that contains a
    2822# configuration script generated by Autoconf, you may include it under
    29 # the same distribution terms that you use for the rest of that program.
    30 
    31 
    32 # Please send patches to <config-patches@gnu.org>.  Submit a context
    33 # diff and a properly formatted GNU ChangeLog entry.
     23# the same distribution terms that you use for the rest of that
     24# program.  This Exception is an additional permission under section 7
     25# of the GNU General Public License, version 3 ("GPLv3").
     26
     27
     28# Please send patches with a ChangeLog entry to config-patches@gnu.org.
    3429#
    3530# Configuration subroutine to validate and canonicalize a configuration type.
     
    7469GNU config.sub ($timestamp)
    7570
    76 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
    77 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
    78 Free Software Foundation, Inc.
     71Copyright 1992-2013 Free Software Foundation, Inc.
    7972
    8073This is free software; see the source for copying conditions.  There is NO
     
    124117case $maybe_os in
    125118  nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
    126   linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
     119  linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
    127120  knetbsd*-gnu* | netbsd*-gnu* | \
    128121  kopensolaris*-gnu* | \
     
    157150        -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
    158151        -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
    159         -apple | -axis | -knuth | -cray | -microblaze)
     152        -apple | -axis | -knuth | -cray | -microblaze*)
    160153                os=
    161154                basic_machine=$1
     
    225218        -isc*)
    226219                basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
     220                ;;
     221        -lynx*178)
     222                os=-lynxos178
     223                ;;
     224        -lynx*5)
     225                os=-lynxos5
    227226                ;;
    228227        -lynx*)
     
    254253        | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
    255254        | am33_2.0 \
    256         | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
    257         | be32 | be64 \
     255        | arc | arceb \
     256        | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
     257        | avr | avr32 \
     258        | be32 | be64 \
    258259        | bfin \
    259260        | c4x | clipper \
     
    268269        | lm32 \
    269270        | m32c | m32r | m32rle | m68000 | m68k | m88k \
    270         | maxq | mb | microblaze | mcore | mep | metag \
     271        | maxq | mb | microblaze | microblazeel | mcore | mep | metag \
    271272        | mips | mipsbe | mipseb | mipsel | mipsle \
    272273        | mips16 \
     
    286287        | mipsisa64sb1 | mipsisa64sb1el \
    287288        | mipsisa64sr71k | mipsisa64sr71kel \
     289        | mipsr5900 | mipsr5900el \
    288290        | mipstx39 | mipstx39el \
    289291        | mn10200 | mn10300 \
     
    292294        | msp430 \
    293295        | nds32 | nds32le | nds32be \
    294         | nios | nios2 \
     296        | nios | nios2 | nios2eb | nios2el \
    295297        | ns16k | ns32k \
    296298        | open8 \
    297         | or32 \
     299        | or1k | or32 \
    298300        | pdp10 | pdp11 | pj | pjl \
    299301        | powerpc | powerpc64 | powerpc64le | powerpcle \
     
    365367        | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
    366368        | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
    367         | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
     369        | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
    368370        | arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
    369371        | avr-* | avr32-* \
     
    384386        | m32c-* | m32r-* | m32rle-* \
    385387        | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
    386         | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
     388        | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
     389        | microblaze-* | microblazeel-* \
    387390        | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
    388391        | mips16-* \
     
    402405        | mipsisa64sb1-* | mipsisa64sb1el-* \
    403406        | mipsisa64sr71k-* | mipsisa64sr71kel-* \
     407        | mipsr5900-* | mipsr5900el-* \
    404408        | mipstx39-* | mipstx39el-* \
    405409        | mmix-* \
     
    407411        | msp430-* \
    408412        | nds32-* | nds32le-* | nds32be-* \
    409         | nios-* | nios2-* \
     413        | nios-* | nios2-* | nios2eb-* | nios2el-* \
    410414        | none-* | np1-* | ns16k-* | ns32k-* \
    411415        | open8-* \
     
    783787                os=-sysv
    784788                ;;
    785         microblaze)
     789        microblaze*)
    786790                basic_machine=microblaze-xilinx
     791                ;;
     792        mingw64)
     793                basic_machine=x86_64-pc
     794                os=-mingw64
    787795                ;;
    788796        mingw32)
     
    10141022                os=-pw32
    10151023                ;;
    1016         rdos)
     1024        rdos | rdos64)
     1025                basic_machine=x86_64-pc
     1026                os=-rdos
     1027                ;;
     1028        rdos32)
    10171029                basic_machine=i386-pc
    10181030                os=-rdos
     
    13411353              | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
    13421354              | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
    1343               | -sym* | -kopensolaris* \
     1355              | -sym* | -kopensolaris* | -plan9* \
    13441356              | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
    13451357              | -aos* | -aros* \
     
    13471359              | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
    13481360              | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
    1349               | -openbsd* | -solidbsd* \
     1361              | -bitrig* | -openbsd* | -solidbsd* \
    13501362              | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
    13511363              | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
     
    13541366              | -chorusos* | -chorusrdb* | -cegcc* \
    13551367              | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
    1356               | -mingw32* | -linux-gnu* | -linux-android* \
    1357               | -linux-newlib* | -linux-uclibc* \
     1368              | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
     1369              | -linux-newlib* | -linux-musl* | -linux-uclibc* \
    13581370              | -uxpv* | -beos* | -mpeix* | -udk* \
    13591371              | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
     
    14871499                os=-aros
    14881500                ;;
    1489         -kaos*)
    1490                 os=-kaos
    1491                 ;;
    14921501        -zvmoe)
    14931502                os=-zvmoe
     
    15381547                os=-coff
    15391548                ;;
     1549        hexagon-*)
     1550                os=-elf
     1551                ;;
    15401552        tic54x-*)
    15411553                os=-coff
     
    15761588                ;;
    15771589        mips*-*)
     1590                os=-elf
     1591                ;;
     1592        or1k-*)
    15781593                os=-elf
    15791594                ;;
  • trunk/depcomp

    r3118 r3123  
    22# depcomp - compile a program generating dependencies as side-effects
    33
    4 scriptversion=2012-03-27.16; # UTC
    5 
    6 # Copyright (C) 1999-2012 Free Software Foundation, Inc.
     4scriptversion=2013-05-30.07; # UTC
     5
     6# Copyright (C) 1999-2013 Free Software Foundation, Inc.
    77
    88# This program is free software; you can redistribute it and/or modify
     
    2828case $1 in
    2929  '')
    30      echo "$0: No command.  Try '$0 --help' for more information." 1>&2
    31      exit 1;
    32      ;;
     30    echo "$0: No command.  Try '$0 --help' for more information." 1>&2
     31    exit 1;
     32    ;;
    3333  -h | --h*)
    3434    cat <<\EOF
     
    5757esac
    5858
     59# Get the directory component of the given path, and save it in the
     60# global variables '$dir'.  Note that this directory component will
     61# be either empty or ending with a '/' character.  This is deliberate.
     62set_dir_from ()
     63{
     64  case $1 in
     65    */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;;
     66      *) dir=;;
     67  esac
     68}
     69
     70# Get the suffix-stripped basename of the given path, and save it the
     71# global variable '$base'.
     72set_base_from ()
     73{
     74  base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'`
     75}
     76
     77# If no dependency file was actually created by the compiler invocation,
     78# we still have to create a dummy depfile, to avoid errors with the
     79# Makefile "include basename.Plo" scheme.
     80make_dummy_depfile ()
     81{
     82  echo "#dummy" > "$depfile"
     83}
     84
     85# Factor out some common post-processing of the generated depfile.
     86# Requires the auxiliary global variable '$tmpdepfile' to be set.
     87aix_post_process_depfile ()
     88{
     89  # If the compiler actually managed to produce a dependency file,
     90  # post-process it.
     91  if test -f "$tmpdepfile"; then
     92    # Each line is of the form 'foo.o: dependency.h'.
     93    # Do two passes, one to just change these to
     94    #   $object: dependency.h
     95    # and one to simply output
     96    #   dependency.h:
     97    # which is needed to avoid the deleted-header problem.
     98    { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile"
     99      sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile"
     100    } > "$depfile"
     101    rm -f "$tmpdepfile"
     102  else
     103    make_dummy_depfile
     104  fi
     105}
     106
    59107# A tabulation character.
    60108tab='   '
     
    62110nl='
    63111'
     112# Character ranges might be problematic outside the C locale.
     113# These definitions help.
     114upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ
     115lower=abcdefghijklmnopqrstuvwxyz
     116digits=0123456789
     117alpha=${upper}${lower}
    64118
    65119if test -z "$depmode" || test -z "$source" || test -z "$object"; then
     
    74128
    75129rm -f "$tmpdepfile"
     130
     131# Avoid interferences from the environment.
     132gccflag= dashmflag=
    76133
    77134# Some modes work just like other modes, but use different flags.  We
     
    86143
    87144if test "$depmode" = dashXmstdout; then
    88    # This is just like dashmstdout with a different argument.
    89    dashmflag=-xM
    90    depmode=dashmstdout
     145  # This is just like dashmstdout with a different argument.
     146  dashmflag=-xM
     147  depmode=dashmstdout
    91148fi
    92149
    93150cygpath_u="cygpath -u -f -"
    94151if test "$depmode" = msvcmsys; then
    95    # This is just like msvisualcpp but w/o cygpath translation.
    96    # Just convert the backslash-escaped backslashes to single forward
    97    # slashes to satisfy depend.m4
    98    cygpath_u='sed s,\\\\,/,g'
    99    depmode=msvisualcpp
     152  # This is just like msvisualcpp but w/o cygpath translation.
     153  # Just convert the backslash-escaped backslashes to single forward
     154  # slashes to satisfy depend.m4
     155  cygpath_u='sed s,\\\\,/,g'
     156  depmode=msvisualcpp
    100157fi
    101158
    102159if test "$depmode" = msvc7msys; then
    103    # This is just like msvc7 but w/o cygpath translation.
    104    # Just convert the backslash-escaped backslashes to single forward
    105    # slashes to satisfy depend.m4
    106    cygpath_u='sed s,\\\\,/,g'
    107    depmode=msvc7
     160  # This is just like msvc7 but w/o cygpath translation.
     161  # Just convert the backslash-escaped backslashes to single forward
     162  # slashes to satisfy depend.m4
     163  cygpath_u='sed s,\\\\,/,g'
     164  depmode=msvc7
    108165fi
    109166
    110167if test "$depmode" = xlc; then
    111    # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency informations.
    112    gccflag=-qmakedep=gcc,-MF
    113    depmode=gcc
     168  # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information.
     169  gccflag=-qmakedep=gcc,-MF
     170  depmode=gcc
    114171fi
    115172
     
    134191  "$@"
    135192  stat=$?
    136   if test $stat -eq 0; then :
    137   else
     193  if test $stat -ne 0; then
    138194    rm -f "$tmpdepfile"
    139195    exit $stat
     
    143199
    144200gcc)
     201## Note that this doesn't just cater to obsosete pre-3.x GCC compilers.
     202## but also to in-use compilers like IMB xlc/xlC and the HP C compiler.
     203## (see the conditional assignment to $gccflag above).
    145204## There are various ways to get dependency output from gcc.  Here's
    146205## why we pick this rather obscure method:
     
    149208##   (We might end up doing this anyway to support other compilers.)
    150209## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
    151 ##   -MM, not -M (despite what the docs say).
     210##   -MM, not -M (despite what the docs say).  Also, it might not be
     211##   supported by the other compilers which use the 'gcc' depmode.
    152212## - Using -M directly means running the compiler twice (even worse
    153213##   than renaming).
     
    157217  "$@" -Wp,"$gccflag$tmpdepfile"
    158218  stat=$?
    159   if test $stat -eq 0; then :
    160   else
     219  if test $stat -ne 0; then
    161220    rm -f "$tmpdepfile"
    162221    exit $stat
     
    164223  rm -f "$depfile"
    165224  echo "$object : \\" > "$depfile"
    166   alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
    167 ## The second -e expression handles DOS-style file names with drive letters.
     225  # The second -e expression handles DOS-style file names with drive
     226  # letters.
    168227  sed -e 's/^[^:]*: / /' \
    169228      -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
     
    174233## dummy dependencies for each header file.  Too bad gcc doesn't do
    175234## this for us directly.
    176   tr ' ' "$nl" < "$tmpdepfile" |
    177235## Some versions of gcc put a space before the ':'.  On the theory
    178236## that the space means something, we add a space to the output as
     
    181239## Some versions of the HPUX 10.20 sed can't process this invocation
    182240## correctly.  Breaking it into two sed invocations is a workaround.
    183     sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
    184       | sed -e 's/$/ :/' >> "$depfile"
     241  tr ' ' "$nl" < "$tmpdepfile" \
     242    | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
     243    | sed -e 's/$/ :/' >> "$depfile"
    185244  rm -f "$tmpdepfile"
    186245  ;;
     
    200259  fi
    201260  stat=$?
    202   if test $stat -eq 0; then :
    203   else
     261  if test $stat -ne 0; then
    204262    rm -f "$tmpdepfile"
    205263    exit $stat
     
    209267  if test -f "$tmpdepfile"; then  # yes, the sourcefile depend on other files
    210268    echo "$object : \\" > "$depfile"
    211 
    212269    # Clip off the initial element (the dependent).  Don't try to be
    213270    # clever and replace this with sed code, as IRIX sed won't handle
     
    217274    # dependency line.
    218275    tr ' ' "$nl" < "$tmpdepfile" \
    219     | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
    220     tr "$nl" ' ' >> "$depfile"
     276      | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \
     277      | tr "$nl" ' ' >> "$depfile"
    221278    echo >> "$depfile"
    222 
    223279    # The second pass generates a dummy entry for each header file.
    224280    tr ' ' "$nl" < "$tmpdepfile" \
    225    | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
    226    >> "$depfile"
     281      | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
     282      >> "$depfile"
    227283  else
    228     # The sourcefile does not contain any dependencies, so just
    229     # store a dummy comment line, to avoid errors with the Makefile
    230     # "include basename.Plo" scheme.
    231     echo "#dummy" > "$depfile"
     284    make_dummy_depfile
    232285  fi
    233286  rm -f "$tmpdepfile"
     
    247300  # start of each line; $object doesn't have directory information.
    248301  # Version 6 uses the directory in both cases.
    249   dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
    250   test "x$dir" = "x$object" && dir=
    251   base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
     302  set_dir_from "$object"
     303  set_base_from "$object"
    252304  if test "$libtool" = yes; then
    253305    tmpdepfile1=$dir$base.u
     
    262314  fi
    263315  stat=$?
    264 
    265   if test $stat -eq 0; then :
    266   else
     316  if test $stat -ne 0; then
    267317    rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
    268318    exit $stat
     
    273323    test -f "$tmpdepfile" && break
    274324  done
    275   if test -f "$tmpdepfile"; then
    276     # Each line is of the form 'foo.o: dependent.h'.
    277     # Do two passes, one to just change these to
    278     # '$object: dependent.h' and one to simply 'dependent.h:'.
    279     sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
    280     sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
    281   else
    282     # The sourcefile does not contain any dependencies, so just
    283     # store a dummy comment line, to avoid errors with the Makefile
    284     # "include basename.Plo" scheme.
    285     echo "#dummy" > "$depfile"
    286   fi
     325  aix_post_process_depfile
     326  ;;
     327
     328tcc)
     329  # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26
     330  # FIXME: That version still under development at the moment of writing.
     331  #        Make that this statement remains true also for stable, released
     332  #        versions.
     333  # It will wrap lines (doesn't matter whether long or short) with a
     334  # trailing '\', as in:
     335  #
     336  #   foo.o : \
     337  #    foo.c \
     338  #    foo.h \
     339  #
     340  # It will put a trailing '\' even on the last line, and will use leading
     341  # spaces rather than leading tabs (at least since its commit 0394caf7
     342  # "Emit spaces for -MD").
     343  "$@" -MD -MF "$tmpdepfile"
     344  stat=$?
     345  if test $stat -ne 0; then
     346    rm -f "$tmpdepfile"
     347    exit $stat
     348  fi
     349  rm -f "$depfile"
     350  # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'.
     351  # We have to change lines of the first kind to '$object: \'.
     352  sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile"
     353  # And for each line of the second kind, we have to emit a 'dep.h:'
     354  # dummy dependency, to avoid the deleted-header problem.
     355  sed -n -e 's|^  *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile"
    287356  rm -f "$tmpdepfile"
    288357  ;;
    289358
    290 icc)
    291   # Intel's C compiler anf tcc (Tiny C Compiler) understand '-MD -MF file'.
    292   # However on
    293   #    $CC -MD -MF foo.d -c -o sub/foo.o sub/foo.c
    294   # ICC 7.0 will fill foo.d with something like
    295   #    foo.o: sub/foo.c
    296   #    foo.o: sub/foo.h
    297   # which is wrong.  We want
    298   #    sub/foo.o: sub/foo.c
    299   #    sub/foo.o: sub/foo.h
    300   #    sub/foo.c:
    301   #    sub/foo.h:
    302   # ICC 7.1 will output
     359## The order of this option in the case statement is important, since the
     360## shell code in configure will try each of these formats in the order
     361## listed in this file.  A plain '-MD' option would be understood by many
     362## compilers, so we must ensure this comes after the gcc and icc options.
     363pgcc)
     364  # Portland's C compiler understands '-MD'.
     365  # Will always output deps to 'file.d' where file is the root name of the
     366  # source file under compilation, even if file resides in a subdirectory.
     367  # The object file name does not affect the name of the '.d' file.
     368  # pgcc 10.2 will output
    303369  #    foo.o: sub/foo.c sub/foo.h
    304   # and will wrap long lines using '\':
     370  # and will wrap long lines using '\' :
    305371  #    foo.o: sub/foo.c ... \
    306372  #     sub/foo.h ... \
    307373  #     ...
    308   # tcc 0.9.26 (FIXME still under development at the moment of writing)
    309   # will emit a similar output, but also prepend the continuation lines
    310   # with horizontal tabulation characters.
    311   "$@" -MD -MF "$tmpdepfile"
    312   stat=$?
    313   if test $stat -eq 0; then :
    314   else
     374  set_dir_from "$object"
     375  # Use the source, not the object, to determine the base name, since
     376  # that's sadly what pgcc will do too.
     377  set_base_from "$source"
     378  tmpdepfile=$base.d
     379
     380  # For projects that build the same source file twice into different object
     381  # files, the pgcc approach of using the *source* file root name can cause
     382  # problems in parallel builds.  Use a locking strategy to avoid stomping on
     383  # the same $tmpdepfile.
     384  lockdir=$base.d-lock
     385  trap "
     386    echo '$0: caught signal, cleaning up...' >&2
     387    rmdir '$lockdir'
     388    exit 1
     389  " 1 2 13 15
     390  numtries=100
     391  i=$numtries
     392  while test $i -gt 0; do
     393    # mkdir is a portable test-and-set.
     394    if mkdir "$lockdir" 2>/dev/null; then
     395      # This process acquired the lock.
     396      "$@" -MD
     397      stat=$?
     398      # Release the lock.
     399      rmdir "$lockdir"
     400      break
     401    else
     402      # If the lock is being held by a different process, wait
     403      # until the winning process is done or we timeout.
     404      while test -d "$lockdir" && test $i -gt 0; do
     405        sleep 1
     406        i=`expr $i - 1`
     407      done
     408    fi
     409    i=`expr $i - 1`
     410  done
     411  trap - 1 2 13 15
     412  if test $i -le 0; then
     413    echo "$0: failed to acquire lock after $numtries attempts" >&2
     414    echo "$0: check lockdir '$lockdir'" >&2
     415    exit 1
     416  fi
     417
     418  if test $stat -ne 0; then
    315419    rm -f "$tmpdepfile"
    316420    exit $stat
    317421  fi
    318422  rm -f "$depfile"
    319   # Each line is of the form 'foo.o: dependent.h',
    320   # or 'foo.o: dep1.h dep2.h \', or ' dep3.h dep4.h \'.
     423  # Each line is of the form `foo.o: dependent.h',
     424  # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
    321425  # Do two passes, one to just change these to
    322   # '$object: dependent.h' and one to simply 'dependent.h:'.
    323   sed -e "s/^[ $tab][ $tab]*/  /" -e "s,^[^:]*:,$object :," \
    324     < "$tmpdepfile" > "$depfile"
    325   sed '
    326     s/[ '"$tab"'][ '"$tab"']*/ /g
    327     s/^ *//
    328     s/ *\\*$//
    329     s/^[^:]*: *//
    330     /^$/d
    331     /:$/d
    332     s/$/ :/
    333   ' < "$tmpdepfile" >> "$depfile"
     426  # `$object: dependent.h' and one to simply `dependent.h:'.
     427  sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
     428  # Some versions of the HPUX 10.20 sed can't process this invocation
     429  # correctly.  Breaking it into two sed invocations is a workaround.
     430  sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \
     431    | sed -e 's/$/ :/' >> "$depfile"
    334432  rm -f "$tmpdepfile"
    335433  ;;
     
    342440  # happens to be.
    343441  # Much of this is similar to the tru64 case; see comments there.
    344   dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
    345   test "x$dir" = "x$object" && dir=
    346   base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
     442  set_dir_from  "$object"
     443  set_base_from "$object"
    347444  if test "$libtool" = yes; then
    348445    tmpdepfile1=$dir$base.d
     
    355452  fi
    356453  stat=$?
    357   if test $stat -eq 0; then :
    358   else
     454  if test $stat -ne 0; then
    359455     rm -f "$tmpdepfile1" "$tmpdepfile2"
    360456     exit $stat
     
    366462  done
    367463  if test -f "$tmpdepfile"; then
    368     sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
     464    sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile"
    369465    # Add 'dependent.h:' lines.
    370466    sed -ne '2,${
    371                s/^ *//
    372                s/ \\*$//
    373                s/$/:/
    374                p
    375              }' "$tmpdepfile" >> "$depfile"
     467               s/^ *//
     468               s/ \\*$//
     469               s/$/:/
     470               p
     471             }' "$tmpdepfile" >> "$depfile"
    376472  else
    377     echo "#dummy" > "$depfile"
     473    make_dummy_depfile
    378474  fi
    379475  rm -f "$tmpdepfile" "$tmpdepfile2"
     
    381477
    382478tru64)
    383    # The Tru64 compiler uses -MD to generate dependencies as a side
    384    # effect.  'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
    385    # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
    386    # dependencies in 'foo.d' instead, so we check for that too.
    387    # Subdirectories are respected.
    388    dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
    389    test "x$dir" = "x$object" && dir=
    390    base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
    391 
    392    if test "$libtool" = yes; then
    393       # With Tru64 cc, shared objects can also be used to make a
    394       # static library.  This mechanism is used in libtool 1.4 series to
    395       # handle both shared and static libraries in a single compilation.
    396       # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
    397       #
    398       # With libtool 1.5 this exception was removed, and libtool now
    399       # generates 2 separate objects for the 2 libraries.  These two
    400       # compilations output dependencies in $dir.libs/$base.o.d and
    401       # in $dir$base.o.d.  We have to check for both files, because
    402       # one of the two compilations can be disabled.  We should prefer
    403       # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
    404       # automatically cleaned when .libs/ is deleted, while ignoring
    405       # the former would cause a distcleancheck panic.
    406       tmpdepfile1=$dir.libs/$base.lo.d   # libtool 1.4
    407       tmpdepfile2=$dir$base.o.d          # libtool 1.5
    408       tmpdepfile3=$dir.libs/$base.o.d    # libtool 1.5
    409       tmpdepfile4=$dir.libs/$base.d      # Compaq CCC V6.2-504
    410       "$@" -Wc,-MD
    411    else
    412       tmpdepfile1=$dir$base.o.d
    413       tmpdepfile2=$dir$base.d
    414       tmpdepfile3=$dir$base.d
    415       tmpdepfile4=$dir$base.d
    416       "$@" -MD
    417    fi
    418 
    419    stat=$?
    420    if test $stat -eq 0; then :
    421    else
    422       rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
    423       exit $stat
    424    fi
    425 
    426    for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
    427    do
    428      test -f "$tmpdepfile" && break
    429    done
    430    if test -f "$tmpdepfile"; then
    431       sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
    432       sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
    433    else
    434       echo "#dummy" > "$depfile"
    435    fi
    436    rm -f "$tmpdepfile"
    437    ;;
     479  # The Tru64 compiler uses -MD to generate dependencies as a side
     480  # effect.  'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
     481  # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
     482  # dependencies in 'foo.d' instead, so we check for that too.
     483  # Subdirectories are respected.
     484  set_dir_from  "$object"
     485  set_base_from "$object"
     486
     487  if test "$libtool" = yes; then
     488    # Libtool generates 2 separate objects for the 2 libraries.  These
     489    # two compilations output dependencies in $dir.libs/$base.o.d and
     490    # in $dir$base.o.d.  We have to check for both files, because
     491    # one of the two compilations can be disabled.  We should prefer
     492    # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
     493    # automatically cleaned when .libs/ is deleted, while ignoring
     494    # the former would cause a distcleancheck panic.
     495    tmpdepfile1=$dir$base.o.d          # libtool 1.5
     496    tmpdepfile2=$dir.libs/$base.o.d    # Likewise.
     497    tmpdepfile3=$dir.libs/$base.d      # Compaq CCC V6.2-504
     498    "$@" -Wc,-MD
     499  else
     500    tmpdepfile1=$dir$base.d
     501    tmpdepfile2=$dir$base.d
     502    tmpdepfile3=$dir$base.d
     503    "$@" -MD
     504  fi
     505
     506  stat=$?
     507  if test $stat -ne 0; then
     508    rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
     509    exit $stat
     510  fi
     511
     512  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
     513  do
     514    test -f "$tmpdepfile" && break
     515  done
     516  # Same post-processing that is required for AIX mode.
     517  aix_post_process_depfile
     518  ;;
    438519
    439520msvc7)
     
    446527  stat=$?
    447528  grep -v '^Note: including file: ' "$tmpdepfile"
    448   if test "$stat" = 0; then :
    449   else
     529  if test $stat -ne 0; then
    450530    rm -f "$tmpdepfile"
    451531    exit $stat
     
    473553  p
    474554}' >> "$depfile"
     555  echo >> "$depfile" # make sure the fragment doesn't end with a backslash
    475556  rm -f "$tmpdepfile"
    476557  ;;
     
    524605  # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
    525606  "$@" $dashmflag |
    526     sed 's:^['"$tab"' ]*[^:'"$tab"' ][^:][^:]*\:['"$tab"' ]*:'"$object"'\: :' > "$tmpdepfile"
     607    sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile"
    527608  rm -f "$depfile"
    528609  cat < "$tmpdepfile" > "$depfile"
    529   tr ' ' "$nl" < "$tmpdepfile" | \
    530 ## Some versions of the HPUX 10.20 sed can't process this invocation
    531 ## correctly.  Breaking it into two sed invocations is a workaround.
    532     sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
     610  # Some versions of the HPUX 10.20 sed can't process this sed invocation
     611  # correctly.  Breaking it into two sed invocations is a workaround.
     612  tr ' ' "$nl" < "$tmpdepfile" \
     613    | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
     614    | sed -e 's/$/ :/' >> "$depfile"
    533615  rm -f "$tmpdepfile"
    534616  ;;
     
    583665  # No need to regex-escape $object, excess matching of '.' is harmless.
    584666  sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
    585   sed '1,2d' "$tmpdepfile" | tr ' ' "$nl" | \
    586 ## Some versions of the HPUX 10.20 sed can't process this invocation
    587 ## correctly.  Breaking it into two sed invocations is a workaround.
    588     sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
     667  # Some versions of the HPUX 10.20 sed can't process the last invocation
     668  # correctly.  Breaking it into two sed invocations is a workaround.
     669  sed '1,2d' "$tmpdepfile" \
     670    | tr ' ' "$nl" \
     671    | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
     672    | sed -e 's/$/ :/' >> "$depfile"
    589673  rm -f "$tmpdepfile" "$tmpdepfile".bak
    590674  ;;
     
    622706  done
    623707
    624   "$@" -E |
    625     sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
    626        -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
    627     sed '$ s: \\$::' > "$tmpdepfile"
     708  "$@" -E \
     709    | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
     710             -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
     711    | sed '$ s: \\$::' > "$tmpdepfile"
    628712  rm -f "$depfile"
    629713  echo "$object : \\" > "$depfile"
     
    657741      ;;
    658742    "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
    659         set fnord "$@"
    660         shift
    661         shift
    662         ;;
     743        set fnord "$@"
     744        shift
     745        shift
     746        ;;
    663747    *)
    664         set fnord "$@" "$arg"
    665         shift
    666         shift
    667         ;;
     748        set fnord "$@" "$arg"
     749        shift
     750        shift
     751        ;;
    668752    esac
    669753  done
  • trunk/missing

    r3118 r3123  
    11#! /bin/sh
    2 # Common stub for a few missing GNU programs while installing.
    3 
    4 scriptversion=2012-01-06.18; # UTC
    5 
    6 # Copyright (C) 1996-2012 Free Software Foundation, Inc.
    7 # Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
     2# Common wrapper for a few potentially missing GNU programs.
     3
     4scriptversion=2012-06-26.16; # UTC
     5
     6# Copyright (C) 1996-2013 Free Software Foundation, Inc.
     7# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
    88
    99# This program is free software; you can redistribute it and/or modify
     
    3030fi
    3131
    32 run=:
    33 sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
    34 sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
    35 
    36 # In the cases where this matters, 'missing' is being run in the
    37 # srcdir already.
    38 if test -f configure.ac; then
    39   configure_ac=configure.ac
    40 else
    41   configure_ac=configure.in
    42 fi
    43 
    44 msg="missing on your system"
    45 
    4632case $1 in
    47 --run)
    48   # Try to run requested program, and just exit if it succeeds.
    49   run=
    50   shift
    51   "$@" && exit 0
    52   # Exit code 63 means version mismatch.  This often happens
    53   # when the user try to use an ancient version of a tool on
    54   # a file that requires a minimum version.  In this case we
    55   # we should proceed has if the program had been absent, or
    56   # if --run hadn't been passed.
    57   if test $? = 63; then
    58     run=:
    59     msg="probably too old"
    60   fi
    61   ;;
     33
     34  --is-lightweight)
     35    # Used by our autoconf macros to check whether the available missing
     36    # script is modern enough.
     37    exit 0
     38    ;;
     39
     40  --run)
     41    # Back-compat with the calling convention used by older automake.
     42    shift
     43    ;;
    6244
    6345  -h|--h|--he|--hel|--help)
     
    6547$0 [OPTION]... PROGRAM [ARGUMENT]...
    6648
    67 Handle 'PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
    68 error status if there is no known handling for PROGRAM.
     49Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due
     50to PROGRAM being missing or too old.
    6951
    7052Options:
    7153  -h, --help      display this help and exit
    7254  -v, --version   output version information and exit
    73   --run           try to run the given command, and emulate it if it fails
    7455
    7556Supported PROGRAM values:
    76   aclocal      touch file 'aclocal.m4'
    77   autoconf     touch file 'configure'
    78   autoheader   touch file 'config.h.in'
    79   autom4te     touch the output file, or create a stub one
    80   automake     touch all 'Makefile.in' files
    81   bison        create 'y.tab.[ch]', if possible, from existing .[ch]
    82   flex         create 'lex.yy.c', if possible, from existing .c
    83   help2man     touch the output file
    84   lex          create 'lex.yy.c', if possible, from existing .c
    85   makeinfo     touch the output file
    86   yacc         create 'y.tab.[ch]', if possible, from existing .[ch]
     57  aclocal   autoconf  autoheader   autom4te  automake  makeinfo
     58  bison     yacc      flex         lex       help2man
    8759
    8860Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
     
    9971
    10072  -*)
    101     echo 1>&2 "$0: Unknown '$1' option"
     73    echo 1>&2 "$0: unknown '$1' option"
    10274    echo 1>&2 "Try '$0 --help' for more information"
    10375    exit 1
     
    10678esac
    10779
    108 # normalize program name to check for.
    109 program=`echo "$1" | sed '
    110   s/^gnu-//; t
    111   s/^gnu//; t
    112   s/^g//; t'`
    113 
    114 # Now exit if we have it, but it failed.  Also exit now if we
    115 # don't have it and --version was passed (most likely to detect
    116 # the program).  This is about non-GNU programs, so use $1 not
    117 # $program.
    118 case $1 in
    119   lex*|yacc*)
    120     # Not GNU programs, they don't have --version.
    121     ;;
    122 
    123   *)
    124     if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
    125        # We have it, but it failed.
    126        exit 1
    127     elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
    128        # Could not run --version or --help.  This is probably someone
    129        # running '$TOOL --version' or '$TOOL --help' to check whether
    130        # $TOOL exists and not knowing $TOOL uses missing.
    131        exit 1
    132     fi
    133     ;;
    134 esac
    135 
    136 # If it does not exist, or fails to run (possibly an outdated version),
    137 # try to emulate it.
    138 case $program in
    139   aclocal*)
    140     echo 1>&2 "\
    141 WARNING: '$1' is $msg.  You should only need it if
    142          you modified 'acinclude.m4' or '${configure_ac}'.  You might want
    143          to install the Automake and Perl packages.  Grab them from
    144          any GNU archive site."
    145     touch aclocal.m4
    146     ;;
    147 
    148   autoconf*)
    149     echo 1>&2 "\
    150 WARNING: '$1' is $msg.  You should only need it if
    151          you modified '${configure_ac}'.  You might want to install the
    152          Autoconf and GNU m4 packages.  Grab them from any GNU
    153          archive site."
    154     touch configure
    155     ;;
    156 
    157   autoheader*)
    158     echo 1>&2 "\
    159 WARNING: '$1' is $msg.  You should only need it if
    160          you modified 'acconfig.h' or '${configure_ac}'.  You might want
    161          to install the Autoconf and GNU m4 packages.  Grab them
    162          from any GNU archive site."
    163     files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
    164     test -z "$files" && files="config.h"
    165     touch_files=
    166     for f in $files; do
    167       case $f in
    168       *:*) touch_files="$touch_files "`echo "$f" |
    169                                        sed -e 's/^[^:]*://' -e 's/:.*//'`;;
    170       *) touch_files="$touch_files $f.in";;
    171       esac
    172     done
    173     touch $touch_files
    174     ;;
    175 
    176   automake*)
    177     echo 1>&2 "\
    178 WARNING: '$1' is $msg.  You should only need it if
    179          you modified 'Makefile.am', 'acinclude.m4' or '${configure_ac}'.
    180          You might want to install the Automake and Perl packages.
    181          Grab them from any GNU archive site."
    182     find . -type f -name Makefile.am -print |
    183            sed 's/\.am$/.in/' |
    184            while read f; do touch "$f"; done
    185     ;;
    186 
    187   autom4te*)
    188     echo 1>&2 "\
    189 WARNING: '$1' is needed, but is $msg.
    190          You might have modified some files without having the
    191          proper tools for further handling them.
    192          You can get '$1' as part of Autoconf from any GNU
    193          archive site."
    194 
    195     file=`echo "$*" | sed -n "$sed_output"`
    196     test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
    197     if test -f "$file"; then
    198         touch $file
    199     else
    200         test -z "$file" || exec >$file
    201         echo "#! /bin/sh"
    202         echo "# Created by GNU Automake missing as a replacement of"
    203         echo "#  $ $@"
    204         echo "exit 0"
    205         chmod +x $file
    206         exit 1
    207     fi
    208     ;;
    209 
    210   bison*|yacc*)
    211     echo 1>&2 "\
    212 WARNING: '$1' $msg.  You should only need it if
    213          you modified a '.y' file.  You may need the Bison package
    214          in order for those modifications to take effect.  You can get
    215          Bison from any GNU archive site."
    216     rm -f y.tab.c y.tab.h
    217     if test $# -ne 1; then
    218         eval LASTARG=\${$#}
    219         case $LASTARG in
    220         *.y)
    221             SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
    222             if test -f "$SRCFILE"; then
    223                  cp "$SRCFILE" y.tab.c
    224             fi
    225             SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
    226             if test -f "$SRCFILE"; then
    227                  cp "$SRCFILE" y.tab.h
    228             fi
    229           ;;
    230         esac
    231     fi
    232     if test ! -f y.tab.h; then
    233         echo >y.tab.h
    234     fi
    235     if test ! -f y.tab.c; then
    236         echo 'main() { return 0; }' >y.tab.c
    237     fi
    238     ;;
    239 
    240   lex*|flex*)
    241     echo 1>&2 "\
    242 WARNING: '$1' is $msg.  You should only need it if
    243          you modified a '.l' file.  You may need the Flex package
    244          in order for those modifications to take effect.  You can get
    245          Flex from any GNU archive site."
    246     rm -f lex.yy.c
    247     if test $# -ne 1; then
    248         eval LASTARG=\${$#}
    249         case $LASTARG in
    250         *.l)
    251             SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
    252             if test -f "$SRCFILE"; then
    253                  cp "$SRCFILE" lex.yy.c
    254             fi
    255           ;;
    256         esac
    257     fi
    258     if test ! -f lex.yy.c; then
    259         echo 'main() { return 0; }' >lex.yy.c
    260     fi
    261     ;;
    262 
    263   help2man*)
    264     echo 1>&2 "\
    265 WARNING: '$1' is $msg.  You should only need it if
    266          you modified a dependency of a manual page.  You may need the
    267          Help2man package in order for those modifications to take
    268          effect.  You can get Help2man from any GNU archive site."
    269 
    270     file=`echo "$*" | sed -n "$sed_output"`
    271     test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
    272     if test -f "$file"; then
    273         touch $file
    274     else
    275         test -z "$file" || exec >$file
    276         echo ".ab help2man is required to generate this page"
    277         exit $?
    278     fi
    279     ;;
    280 
    281   makeinfo*)
    282     echo 1>&2 "\
    283 WARNING: '$1' is $msg.  You should only need it if
    284          you modified a '.texi' or '.texinfo' file, or any other file
    285          indirectly affecting the aspect of the manual.  The spurious
    286          call might also be the consequence of using a buggy 'make' (AIX,
    287          DU, IRIX).  You might want to install the Texinfo package or
    288          the GNU make package.  Grab either from any GNU archive site."
    289     # The file to touch is that specified with -o ...
    290     file=`echo "$*" | sed -n "$sed_output"`
    291     test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
    292     if test -z "$file"; then
    293       # ... or it is the one specified with @setfilename ...
    294       infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
    295       file=`sed -n '
    296         /^@setfilename/{
    297           s/.* \([^ ]*\) *$/\1/
    298           p
    299           q
    300         }' $infile`
    301       # ... or it is derived from the source name (dir/f.texi becomes f.info)
    302       test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
    303     fi
    304     # If the file does not exist, the user really needs makeinfo;
    305     # let's fail without touching anything.
    306     test -f $file || exit 1
    307     touch $file
    308     ;;
    309 
    310   *)
    311     echo 1>&2 "\
    312 WARNING: '$1' is needed, and is $msg.
    313          You might have modified some files without having the
    314          proper tools for further handling them.  Check the 'README' file,
    315          it often tells you about the needed prerequisites for installing
    316          this package.  You may also peek at any GNU archive site, in case
    317          some other package would contain this missing '$1' program."
    318     exit 1
    319     ;;
    320 esac
    321 
    322 exit 0
     80# Run the given program, remember its exit status.
     81"$@"; st=$?
     82
     83# If it succeeded, we are done.
     84test $st -eq 0 && exit 0
     85
     86# Also exit now if we it failed (or wasn't found), and '--version' was
     87# passed; such an option is passed most likely to detect whether the
     88# program is present and works.
     89case $2 in --version|--help) exit $st;; esac
     90
     91# Exit code 63 means version mismatch.  This often happens when the user
     92# tries to use an ancient version of a tool on a file that requires a
     93# minimum version.
     94if test $st -eq 63; then
     95  msg="probably too old"
     96elif test $st -eq 127; then
     97  # Program was missing.
     98  msg="missing on your system"
     99else
     100  # Program was found and executed, but failed.  Give up.
     101  exit $st
     102fi
     103
     104perl_URL=http://www.perl.org/
     105flex_URL=http://flex.sourceforge.net/
     106gnu_software_URL=http://www.gnu.org/software
     107
     108program_details ()
     109{
     110  case $1 in
     111    aclocal|automake)
     112      echo "The '$1' program is part of the GNU Automake package:"
     113      echo "<$gnu_software_URL/automake>"
     114      echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:"
     115      echo "<$gnu_software_URL/autoconf>"
     116      echo "<$gnu_software_URL/m4/>"
     117      echo "<$perl_URL>"
     118      ;;
     119    autoconf|autom4te|autoheader)
     120      echo "The '$1' program is part of the GNU Autoconf package:"
     121      echo "<$gnu_software_URL/autoconf/>"
     122      echo "It also requires GNU m4 and Perl in order to run:"
     123      echo "<$gnu_software_URL/m4/>"
     124      echo "<$perl_URL>"
     125      ;;
     126  esac
     127}
     128
     129give_advice ()
     130{
     131  # Normalize program name to check for.
     132  normalized_program=`echo "$1" | sed '
     133    s/^gnu-//; t
     134    s/^gnu//; t
     135    s/^g//; t'`
     136
     137  printf '%s\n' "'$1' is $msg."
     138
     139  configure_deps="'configure.ac' or m4 files included by 'configure.ac'"
     140  case $normalized_program in
     141    autoconf*)
     142      echo "You should only need it if you modified 'configure.ac',"
     143      echo "or m4 files included by it."
     144      program_details 'autoconf'
     145      ;;
     146    autoheader*)
     147      echo "You should only need it if you modified 'acconfig.h' or"
     148      echo "$configure_deps."
     149      program_details 'autoheader'
     150      ;;
     151    automake*)
     152      echo "You should only need it if you modified 'Makefile.am' or"
     153      echo "$configure_deps."
     154      program_details 'automake'
     155      ;;
     156    aclocal*)
     157      echo "You should only need it if you modified 'acinclude.m4' or"
     158      echo "$configure_deps."
     159      program_details 'aclocal'
     160      ;;
     161   autom4te*)
     162      echo "You might have modified some maintainer files that require"
     163      echo "the 'automa4te' program to be rebuilt."
     164      program_details 'autom4te'
     165      ;;
     166    bison*|yacc*)
     167      echo "You should only need it if you modified a '.y' file."
     168      echo "You may want to install the GNU Bison package:"
     169      echo "<$gnu_software_URL/bison/>"
     170      ;;
     171    lex*|flex*)
     172      echo "You should only need it if you modified a '.l' file."
     173      echo "You may want to install the Fast Lexical Analyzer package:"
     174      echo "<$flex_URL>"
     175      ;;
     176    help2man*)
     177      echo "You should only need it if you modified a dependency" \
     178           "of a man page."
     179      echo "You may want to install the GNU Help2man package:"
     180      echo "<$gnu_software_URL/help2man/>"
     181    ;;
     182    makeinfo*)
     183      echo "You should only need it if you modified a '.texi' file, or"
     184      echo "any other file indirectly affecting the aspect of the manual."
     185      echo "You might want to install the Texinfo package:"
     186      echo "<$gnu_software_URL/texinfo/>"
     187      echo "The spurious makeinfo call might also be the consequence of"
     188      echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might"
     189      echo "want to install GNU make:"
     190      echo "<$gnu_software_URL/make/>"
     191      ;;
     192    *)
     193      echo "You might have modified some files without having the proper"
     194      echo "tools for further handling them.  Check the 'README' file, it"
     195      echo "often tells you about the needed prerequisites for installing"
     196      echo "this package.  You may also peek at any GNU archive site, in"
     197      echo "case some other package contains this missing '$1' program."
     198      ;;
     199  esac
     200}
     201
     202give_advice "$1" | sed -e '1s/^/WARNING: /' \
     203                       -e '2,$s/^/         /' >&2
     204
     205# Propagate the correct exit status (expected to be 127 for a program
     206# not found, 63 for a program that failed due to version mismatch).
     207exit $st
    323208
    324209# Local variables:
Note: See TracChangeset for help on using the changeset viewer.