1*e4b17023SJohn Marino#! /bin/sh 2*e4b17023SJohn Marino 3*e4b17023SJohn Marino# Copyright (C) 2001, 2002, 2006, 2007, 2010, 2011 Free Software Foundation, Inc. 4*e4b17023SJohn Marino# This file is part of GCC. 5*e4b17023SJohn Marino 6*e4b17023SJohn Marino# GCC is free software; you can redistribute it and/or modify 7*e4b17023SJohn Marino# it under the terms of the GNU General Public License as published by 8*e4b17023SJohn Marino# the Free Software Foundation; either version 3, or (at your option) 9*e4b17023SJohn Marino# any later version. 10*e4b17023SJohn Marino 11*e4b17023SJohn Marino# GCC is distributed in the hope that it will be useful, 12*e4b17023SJohn Marino# but WITHOUT ANY WARRANTY; without even the implied warranty of 13*e4b17023SJohn Marino# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14*e4b17023SJohn Marino# GNU General Public License for more details. 15*e4b17023SJohn Marino 16*e4b17023SJohn Marino# You should have received a copy of the GNU General Public License 17*e4b17023SJohn Marino# along with GCC; see the file COPYING3. If not see 18*e4b17023SJohn Marino# <http://www.gnu.org/licenses/>. 19*e4b17023SJohn Marino 20*e4b17023SJohn Marino 21*e4b17023SJohn Marino# Print libgcc_tm.h to the standard output. 22*e4b17023SJohn Marino# DEFINES and HEADERS are expected to be set in the environment. 23*e4b17023SJohn Marino 24*e4b17023SJohn Marino# Add multiple inclusion protection guard, part one. 25*e4b17023SJohn Marinoecho "#ifndef LIBGCC_TM_H" 26*e4b17023SJohn Marinoecho "#define LIBGCC_TM_H" 27*e4b17023SJohn Marino 28*e4b17023SJohn Marino# Generate the body of the file 29*e4b17023SJohn Marinoecho "/* Automatically generated by mkheader.sh. */" 30*e4b17023SJohn Marinofor def in $DEFINES; do 31*e4b17023SJohn Marino echo "#ifndef $def" | sed 's/=.*//' 32*e4b17023SJohn Marino echo "# define $def" | sed 's/=/ /' 33*e4b17023SJohn Marino echo "#endif" 34*e4b17023SJohn Marinodone 35*e4b17023SJohn Marino 36*e4b17023SJohn Marinofor file in $HEADERS; do 37*e4b17023SJohn Marino echo "#include \"$file\"" 38*e4b17023SJohn Marinodone 39*e4b17023SJohn Marino 40*e4b17023SJohn Marino# Add multiple inclusion protection guard, part two. 41*e4b17023SJohn Marinoecho "#endif /* LIBGCC_TM_H */" 42