Changeset 39aab06a in rtems


Ignore:
Timestamp:
May 18, 2012, 5:11:47 AM (8 years ago)
Author:
Ralf Corsépius <ralf.corsepius@…>
Branches:
4.11, master
Children:
bbb69abb
Parents:
8bbf69e
Message:

Update from automake-1.11.5.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • compile

    r8bbf69e r39aab06a  
    11#! /bin/sh
    2 # Wrapper for compilers which do not understand `-c -o'.
    3 
    4 scriptversion=2010-11-15.09; # UTC
    5 
    6 # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009, 2010 Free Software
    7 # Foundation, Inc.
     2# Wrapper for compilers which do not understand '-c -o'.
     3
     4scriptversion=2012-03-05.13; # UTC
     5
     6# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009, 2010, 2012 Free
     7# Software Foundation, Inc.
    88# Written by Tom Tromey <tromey@cygnus.com>.
    99#
     
    4141# func_file_conv build_file lazy
    4242# Convert a $build file to $host form and store it in $file
    43 # Currently only supports Win32 hosts. If the determined conversion
     43# Currently only supports Windows hosts. If the determined conversion
    4444# type is listed in (the comma separated) LAZY, no conversion will
    4545# take place.
     
    7878      ;;
    7979  esac
     80}
     81
     82# func_cl_dashL linkdir
     83# Make cl look for libraries in LINKDIR
     84func_cl_dashL ()
     85{
     86  func_file_conv "$1"
     87  if test -z "$lib_path"; then
     88    lib_path=$file
     89  else
     90    lib_path="$lib_path;$file"
     91  fi
     92  linker_opts="$linker_opts -LIBPATH:$file"
     93}
     94
     95# func_cl_dashl library
     96# Do a library search-path lookup for cl
     97func_cl_dashl ()
     98{
     99  lib=$1
     100  found=no
     101  save_IFS=$IFS
     102  IFS=';'
     103  for dir in $lib_path $LIB
     104  do
     105    IFS=$save_IFS
     106    if $shared && test -f "$dir/$lib.dll.lib"; then
     107      found=yes
     108      lib=$dir/$lib.dll.lib
     109      break
     110    fi
     111    if test -f "$dir/$lib.lib"; then
     112      found=yes
     113      lib=$dir/$lib.lib
     114      break
     115    fi
     116  done
     117  IFS=$save_IFS
     118
     119  if test "$found" != yes; then
     120    lib=$lib.lib
     121  fi
    80122}
    81123
     
    95137      case $1 in
    96138        -o)
    97           # configure might choose to run compile as `compile cc -o foo foo.c'.
     139          # configure might choose to run compile as 'compile cc -o foo foo.c'.
    98140          eat=1
    99141          case $2 in
     
    110152          esac
    111153          ;;
     154        -I)
     155          eat=1
     156          func_file_conv "$2" mingw
     157          set x "$@" -I"$file"
     158          shift
     159          ;;
    112160        -I*)
    113161          func_file_conv "${1#-I}" mingw
     
    115163          shift
    116164          ;;
     165        -l)
     166          eat=1
     167          func_cl_dashl "$2"
     168          set x "$@" "$lib"
     169          shift
     170          ;;
    117171        -l*)
    118           lib=${1#-l}
    119           found=no
    120           save_IFS=$IFS
    121           IFS=';'
    122           for dir in $lib_path $LIB
    123           do
    124             IFS=$save_IFS
    125             if $shared && test -f "$dir/$lib.dll.lib"; then
    126               found=yes
    127               set x "$@" "$dir/$lib.dll.lib"
    128               break
    129             fi
    130             if test -f "$dir/$lib.lib"; then
    131               found=yes
    132               set x "$@" "$dir/$lib.lib"
    133               break
    134             fi
    135           done
    136           IFS=$save_IFS
    137 
    138           test "$found" != yes && set x "$@" "$lib.lib"
    139           shift
     172          func_cl_dashl "${1#-l}"
     173          set x "$@" "$lib"
     174          shift
     175          ;;
     176        -L)
     177          eat=1
     178          func_cl_dashL "$2"
    140179          ;;
    141180        -L*)
    142           func_file_conv "${1#-L}"
    143           if test -z "$lib_path"; then
    144             lib_path=$file
    145           else
    146             lib_path="$lib_path;$file"
    147           fi
    148           linker_opts="$linker_opts -LIBPATH:$file"
     181          func_cl_dashL "${1#-L}"
    149182          ;;
    150183        -static)
     
    197230case $1 in
    198231  '')
    199      echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
     232     echo "$0: No command.  Try '$0 --help' for more information." 1>&2
    200233     exit 1;
    201234     ;;
     
    204237Usage: compile [--help] [--version] PROGRAM [ARGS]
    205238
    206 Wrapper for compilers which do not understand `-c -o'.
    207 Remove `-o dest.o' from ARGS, run PROGRAM with the remaining
     239Wrapper for compilers which do not understand '-c -o'.
     240Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
    208241arguments, and rename the output as expected.
    209242
    210243If you are trying to build a whole package this is not the
    211 right script to run: please start by reading the file `INSTALL'.
     244right script to run: please start by reading the file 'INSTALL'.
    212245
    213246Report bugs to <bug-automake@gnu.org>.
     
    234267    case $1 in
    235268      -o)
    236         # configure might choose to run compile as `compile cc -o foo foo.c'.
    237         # So we strip `-o arg' only if arg is an object.
     269        # configure might choose to run compile as 'compile cc -o foo foo.c'.
     270        # So we strip '-o arg' only if arg is an object.
    238271        eat=1
    239272        case $2 in
     
    262295
    263296if test -z "$ofile" || test -z "$cfile"; then
    264   # If no `-o' option was seen then we might have been invoked from a
     297  # If no '-o' option was seen then we might have been invoked from a
    265298  # pattern rule where we don't need one.  That is ok -- this is a
    266299  # normal compilation that the losing compiler can handle.  If no
    267   # `.c' file was seen then we are probably linking.  That is also
     300  # '.c' file was seen then we are probably linking.  That is also
    268301  # ok.
    269302  exec "$@"
     
    274307
    275308# Create the lock directory.
    276 # Note: use `[/\\:.-]' here to ensure that we don't use the same name
     309# Note: use '[/\\:.-]' here to ensure that we don't use the same name
    277310# that we are using for the .o file.  Also, base the name on the expected
    278311# object file name, since that is what matters with a parallel build.
  • depcomp

    r8bbf69e r39aab06a  
    22# depcomp - compile a program generating dependencies as side-effects
    33
    4 scriptversion=2011-12-04.11; # UTC
     4scriptversion=2012-03-27.16; # UTC
    55
    66# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010,
    7 # 2011 Free Software Foundation, Inc.
     7# 2011, 2012 Free Software Foundation, Inc.
    88
    99# This program is free software; you can redistribute it and/or modify
     
    2929case $1 in
    3030  '')
    31      echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
     31     echo "$0: No command.  Try '$0 --help' for more information." 1>&2
    3232     exit 1;
    3333     ;;
     
    4141Environment variables:
    4242  depmode     Dependency tracking mode.
    43   source      Source file read by `PROGRAMS ARGS'.
    44   object      Object file output by `PROGRAMS ARGS'.
     43  source      Source file read by 'PROGRAMS ARGS'.
     44  object      Object file output by 'PROGRAMS ARGS'.
    4545  DEPDIR      directory where to store dependencies.
    4646  depfile     Dependency file to output.
     
    5858esac
    5959
     60# A tabulation character.
     61tab='   '
     62# A newline character.
     63nl='
     64'
     65
    6066if test -z "$depmode" || test -z "$source" || test -z "$object"; then
    6167  echo "depcomp: Variables source, object and depmode must be set" 1>&2
     
    101107   cygpath_u='sed s,\\\\,/,g'
    102108   depmode=msvc7
     109fi
     110
     111if test "$depmode" = xlc; then
     112   # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency informations.
     113   gccflag=-qmakedep=gcc,-MF
     114   depmode=gcc
    103115fi
    104116
     
    157169  sed -e 's/^[^:]*: / /' \
    158170      -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
    159 ## This next piece of magic avoids the `deleted header file' problem.
     171## This next piece of magic avoids the "deleted header file" problem.
    160172## The problem is that when a header file which appears in a .P file
    161173## is deleted, the dependency causes make to die (because there is
     
    163175## dummy dependencies for each header file.  Too bad gcc doesn't do
    164176## this for us directly.
    165   tr ' ' '
    166 ' < "$tmpdepfile" |
    167 ## Some versions of gcc put a space before the `:'.  On the theory
     177  tr ' ' "$nl" < "$tmpdepfile" |
     178## Some versions of gcc put a space before the ':'.  On the theory
    168179## that the space means something, we add a space to the output as
    169180## well.  hp depmode also adds that space, but also prefixes the VPATH
     
    204215    # lines with more than a fixed number of characters (4096 in
    205216    # IRIX 6.2 sed, 8192 in IRIX 6.5).  We also remove comment lines;
    206     # the IRIX cc adds comments like `#:fec' to the end of the
     217    # the IRIX cc adds comments like '#:fec' to the end of the
    207218    # dependency line.
    208     tr ' ' '
    209 ' < "$tmpdepfile" \
     219    tr ' ' "$nl" < "$tmpdepfile" \
    210220    | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
    211     tr '
    212 ' ' ' >> "$depfile"
     221    tr "$nl" ' ' >> "$depfile"
    213222    echo >> "$depfile"
    214223
    215224    # The second pass generates a dummy entry for each header file.
    216     tr ' ' '
    217 ' < "$tmpdepfile" \
     225    tr ' ' "$nl" < "$tmpdepfile" \
    218226   | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
    219227   >> "$depfile"
     
    227235  ;;
    228236
     237xlc)
     238  # This case exists only to let depend.m4 do its work.  It works by
     239  # looking at the text of this script.  This case will never be run,
     240  # since it is checked for above.
     241  exit 1
     242  ;;
     243
    229244aix)
    230245  # The C for AIX Compiler uses -M and outputs the dependencies
    231246  # in a .u file.  In older versions, this file always lives in the
    232   # current directory.  Also, the AIX compiler puts `$object:' at the
     247  # current directory.  Also, the AIX compiler puts '$object:' at the
    233248  # start of each line; $object doesn't have directory information.
    234249  # Version 6 uses the directory in both cases.
     
    260275  done
    261276  if test -f "$tmpdepfile"; then
    262     # Each line is of the form `foo.o: dependent.h'.
     277    # Each line is of the form 'foo.o: dependent.h'.
    263278    # Do two passes, one to just change these to
    264     # `$object: dependent.h' and one to simply `dependent.h:'.
     279    # '$object: dependent.h' and one to simply 'dependent.h:'.
    265280    sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
    266     # That's a tab and a space in the [].
    267     sed -e 's,^.*\.[a-z]*:[      ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
     281    sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
    268282  else
    269283    # The sourcefile does not contain any dependencies, so just
     
    276290
    277291icc)
    278   # Intel's C compiler understands `-MD -MF file'.  However on
    279   #    icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
     292  # Intel's C compiler anf tcc (Tiny C Compiler) understand '-MD -MF file'.
     293  # However on
     294  #    $CC -MD -MF foo.d -c -o sub/foo.o sub/foo.c
    280295  # ICC 7.0 will fill foo.d with something like
    281296  #    foo.o: sub/foo.c
    282297  #    foo.o: sub/foo.h
    283   # which is wrong.  We want:
     298  # which is wrong.  We want
    284299  #    sub/foo.o: sub/foo.c
    285300  #    sub/foo.o: sub/foo.h
     
    288303  # ICC 7.1 will output
    289304  #    foo.o: sub/foo.c sub/foo.h
    290   # and will wrap long lines using \ :
     305  # and will wrap long lines using '\':
    291306  #    foo.o: sub/foo.c ... \
    292307  #     sub/foo.h ... \
    293308  #     ...
    294 
     309  # tcc 0.9.26 (FIXME still under development at the moment of writing)
     310  # will emit a similar output, but also prepend the continuation lines
     311  # with horizontal tabulation characters.
    295312  "$@" -MD -MF "$tmpdepfile"
    296313  stat=$?
     
    301318  fi
    302319  rm -f "$depfile"
    303   # Each line is of the form `foo.o: dependent.h',
    304   # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
     320  # Each line is of the form 'foo.o: dependent.h',
     321  # or 'foo.o: dep1.h dep2.h \', or ' dep3.h dep4.h \'.
    305322  # Do two passes, one to just change these to
    306   # `$object: dependent.h' and one to simply `dependent.h:'.
    307   sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
    308   # Some versions of the HPUX 10.20 sed can't process this invocation
    309   # correctly.  Breaking it into two sed invocations is a workaround.
    310   sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
    311     sed -e 's/$/ :/' >> "$depfile"
     323  # '$object: dependent.h' and one to simply 'dependent.h:'.
     324  sed -e "s/^[ $tab][ $tab]*/  /" -e "s,^[^:]*:,$object :," \
     325    < "$tmpdepfile" > "$depfile"
     326  sed '
     327    s/[ '"$tab"'][ '"$tab"']*/ /g
     328    s/^ *//
     329    s/ *\\*$//
     330    s/^[^:]*: *//
     331    /^$/d
     332    /:$/d
     333    s/$/ :/
     334  ' < "$tmpdepfile" >> "$depfile"
    312335  rm -f "$tmpdepfile"
    313336  ;;
     
    345368  if test -f "$tmpdepfile"; then
    346369    sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
    347     # Add `dependent.h:' lines.
     370    # Add 'dependent.h:' lines.
    348371    sed -ne '2,${
    349372               s/^ *//
     
    360383tru64)
    361384   # The Tru64 compiler uses -MD to generate dependencies as a side
    362    # effect.  `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
     385   # effect.  'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
    363386   # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
    364    # dependencies in `foo.d' instead, so we check for that too.
     387   # dependencies in 'foo.d' instead, so we check for that too.
    365388   # Subdirectories are respected.
    366389   dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
     
    408431   if test -f "$tmpdepfile"; then
    409432      sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
    410       # That's a tab and a space in the [].
    411       sed -e 's,^.*\.[a-z]*:[    ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
     433      sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
    412434   else
    413435      echo "#dummy" > "$depfile"
     
    444466}' | $cygpath_u | sort -u | sed -n '
    445467s/ /\\ /g
    446 s/\(.*\)/       \1 \\/p
     468s/\(.*\)/'"$tab"'\1 \\/p
    447469s/.\(.*\) \\/\1:/
    448470H
    449471$ {
    450   s/.*/ /
     472  s/.*/'"$tab"'/
    451473  G
    452474  p
     
    479501  fi
    480502
    481   # Remove `-o $object'.
     503  # Remove '-o $object'.
    482504  IFS=" "
    483505  for arg
     
    499521
    500522  test -z "$dashmflag" && dashmflag=-M
    501   # Require at least two characters before searching for `:'
     523  # Require at least two characters before searching for ':'
    502524  # in the target name.  This is to cope with DOS-style filenames:
    503   # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
     525  # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
    504526  "$@" $dashmflag |
    505     sed 's:^[  ]*[^: ][^:][^:]*\:[    ]*:'"$object"'\: :' > "$tmpdepfile"
     527    sed 's:^['"$tab"' ]*[^:'"$tab"' ][^:][^:]*\:['"$tab"' ]*:'"$object"'\: :' > "$tmpdepfile"
    506528  rm -f "$depfile"
    507529  cat < "$tmpdepfile" > "$depfile"
    508   tr ' ' '
    509 ' < "$tmpdepfile" | \
     530  tr ' ' "$nl" < "$tmpdepfile" | \
    510531## Some versions of the HPUX 10.20 sed can't process this invocation
    511532## correctly.  Breaking it into two sed invocations is a workaround.
     
    563584  # No need to regex-escape $object, excess matching of '.' is harmless.
    564585  sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
    565   sed '1,2d' "$tmpdepfile" | tr ' ' '
    566 ' | \
     586  sed '1,2d' "$tmpdepfile" | tr ' ' "$nl" | \
    567587## Some versions of the HPUX 10.20 sed can't process this invocation
    568588## correctly.  Breaking it into two sed invocations is a workaround.
     
    584604  fi
    585605
    586   # Remove `-o $object'.
     606  # Remove '-o $object'.
    587607  IFS=" "
    588608  for arg
     
    653673  rm -f "$depfile"
    654674  echo "$object : \\" > "$depfile"
    655   sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::      \1 \\:p' >> "$depfile"
    656   echo "        " >> "$depfile"
     675  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
     676  echo "$tab" >> "$depfile"
    657677  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
    658678  rm -f "$tmpdepfile"
Note: See TracChangeset for help on using the changeset viewer.