Home | History | Annotate | Line # | Download | only in fixincludes
genfixes revision 1.7
      1  1.1  mrg #! /bin/sh
      2  1.1  mrg 
      3  1.3  mrg # Copyright (C) 1999, 2000, 2001, 2009, 2012 Free Software Foundation, Inc.
      4  1.1  mrg # This file is part of GCC.
      5  1.1  mrg 
      6  1.1  mrg # GCC is free software; you can redistribute it and/or modify
      7  1.1  mrg # it under the terms of the GNU General Public License as published by
      8  1.1  mrg # the Free Software Foundation; either version 3, or (at your option)
      9  1.1  mrg # any later version.
     10  1.1  mrg 
     11  1.1  mrg # GCC is distributed in the hope that it will be useful,
     12  1.1  mrg # but WITHOUT ANY WARRANTY; without even the implied warranty of
     13  1.1  mrg # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     14  1.1  mrg # GNU General Public License for more details.
     15  1.1  mrg 
     16  1.1  mrg # You should have received a copy of the GNU General Public License
     17  1.1  mrg # along with GCC; see the file COPYING3.  If not see
     18  1.1  mrg # <http://www.gnu.org/licenses/>.
     19  1.1  mrg 
     20  1.1  mrg SHELL=/bin/sh
     21  1.1  mrg export SHELL
     22  1.1  mrg if [ $# -eq 0 ] ; then
     23  1.1  mrg   not_done=false
     24  1.1  mrg else
     25  1.1  mrg   not_done=true
     26  1.1  mrg fi
     27  1.1  mrg 
     28  1.1  mrg while $not_done
     29  1.1  mrg do
     30  1.1  mrg   case "$1" in
     31  1.1  mrg   -D )
     32  1.1  mrg     shift
     33  1.1  mrg     if [ $# -eq 0 ] ; then
     34  1.1  mrg       not_done=false
     35  1.1  mrg     else
     36  1.1  mrg       AG="$AG -D$1"
     37  1.1  mrg       shift
     38  1.1  mrg     fi
     39  1.1  mrg     ;;
     40  1.1  mrg 
     41  1.1  mrg   -D* )
     42  1.1  mrg     AG="$AG $1"
     43  1.1  mrg     shift
     44  1.1  mrg     ;;
     45  1.1  mrg 
     46  1.1  mrg   '-?' )
     47  1.1  mrg     echo "USAGE: gendefs [ -D<def-name> ... ]"
     48  1.1  mrg     echo "WHERE: '<def-name>' specifies a #define test name from inclhack.def"
     49  1.1  mrg     exit 0
     50  1.1  mrg     ;;
     51  1.1  mrg 
     52  1.1  mrg   * )
     53  1.1  mrg     not_done=false
     54  1.1  mrg     ;;
     55  1.1  mrg   esac
     56  1.1  mrg done
     57  1.1  mrg 
     58  1.1  mrg if [ $# -eq 0 ] ; then
     59  1.1  mrg   set -- fixincl.x
     60  1.1  mrg fi
     61  1.1  mrg 
     62  1.1  mrg AG="autogen $AG"
     63  1.1  mrg set -e
     64  1.1  mrg 
     65  1.3  mrg if [ -z "`${AG} -v | fgrep ' 5.'`" ]
     66  1.1  mrg then
     67  1.1  mrg   echo "AutoGen appears to be out of date or not correctly installed."
     68  1.1  mrg   echo "Please download and install:"
     69  1.1  mrg   echo "   ftp://gcc.gnu.org/pub/gcc/infrastructure/autogen.tar.gz"
     70  1.1  mrg   touch fixincl.x
     71  1.1  mrg else
     72  1.1  mrg   echo AutoGen-ing fixincl.x
     73  1.1  mrg   $AG inclhack.def
     74  1.1  mrg fi
     75  1.1  mrg 
     76  1.1  mrg exit 0
     77