Finish ABI change started by last patch, this time I tested it.
[official-gcc.git] / libstdc++-v3 / mkcshadow
blobb3cc40eee8b63e46cac777b3f0ff8cd7234f12b0
1 #!/usr/bin/env bash
3 # mkcshadow: reads header names (like "features.h" or "sys/types.h")
4 # from stdin, and creates shadow headers under cshadow/, except where
5 # a header of the same name is already in shadow/.
7 SCRIPTDIR=${0%/*}
9 if [ ! -d cshadow ]; then
10 echo "Creating cshadow."
11 mkdir ../cshadow
14 echo "Creating..."
15 while read header; do
17 if [ ! -f $SCRIPTDIR/shadow/$header ]; then
19 # strip off directory names while making
20 # any necessary directories
22 dir=../cshadow
23 case "$header" in */*)
24 right="$header"
25 while [ "$right" != "${right##*/}" ] ; do
26 dir="$dir/${right%%/*}"
27 if [ ! -d "$dir" ]; then mkdir "$dir"; fi
28 right="${right#*/}"
29 done
31 esac
33 echo " ../cshadow/$header"
34 UPNAME=`echo $header | tr 'a-z./-' 'A-Z___'`
35 cat >"../cshadow/$header" <<EOF
36 // -*- C++ -*- header wrapper.
38 // Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
40 // This file is part of the GNU ISO C++ Library. This library is free
41 // software; you can redistribute it and/or modify it under the
42 // terms of the GNU General Public License as published by the
43 // Free Software Foundation; either version 2, or (at your option)
44 // any later version.
46 // This library is distributed in the hope that it will be useful,
47 // but WITHOUT ANY WARRANTY; without even the implied warranty of
48 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
49 // GNU General Public License for more details.
51 // You should have received a copy of the GNU General Public License along
52 // with this library; see the file COPYING. If not, write to the Free
53 // Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
54 // USA.
56 // As a special exception, you may use this file as part of a free software
57 // library without restriction. Specifically, if other files instantiate
58 // templates or use macros or inline functions from this file, or you compile
59 // this file and link it with other files to produce an executable, this
60 // file does not by itself cause the resulting executable to be covered by
61 // the GNU General Public License. This exception does not however
62 // invalidate any other reasons why the executable file might be covered by
63 // the GNU General Public License.
65 // Note: this file was automatically generated by the "mkcshadow"
66 // script. RTFM!
68 #ifndef _INCLUDED_CPP_${UPNAME}_
70 # ifdef _IN_C_LEGACY_ /* sub-included by a C header */
71 # include_next <${header}>
72 # else
74 namespace _C_legacy { namespace _C_shadow { } }
75 using namespace ::_C_legacy::_C_shadow;
76 namespace _C_legacy {
77 extern "C" {
78 # define _IN_C_LEGACY_
79 # include_next <${header}>
80 } // close extern "C"
81 } // close namespace _C_legacy::
83 # endif /* _IN_C_LEGACY_ */
84 #endif /* _INCLUDED_CPP_${UPNAME}_ */
85 EOF
86 #################### end ####################
88 done