tools/llvm: Do not build with symbols
[minix3.git] / external / bsd / byacc / byacc2netbsd
blobe5cd3ab4e86377fb17f44ff30319a82f02b0625c
1 #! /bin/sh
3 # $NetBSD: byacc2netbsd,v 1.4 2011/10/08 19:28:39 christos Exp $
5 # Copyright (c) 2000 The NetBSD Foundation, Inc.
6 # All rights reserved.
8 # Redistribution and use in source and binary forms, with or without
9 # modification, are permitted provided that the following conditions
10 # are met:
11 # 1. Redistributions of source code must retain the above copyright
12 # notice, this list of conditions and the following disclaimer.
13 # 2. Redistributions in binary form must reproduce the above copyright
14 # notice, this list of conditions and the following disclaimer in the
15 # documentation and/or other materials provided with the distribution.
17 # THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
18 # ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
19 # TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
20 # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
21 # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25 # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 # POSSIBILITY OF SUCH DAMAGE.
29 # byacc2netbsd: convert a byacc tree into a
30 # netbsd byacc source tree, under src/external/bsd/byacc/dist,
31 # based on byacc2netbsd by Bernd Ernesti and changes by Simon Burge
33 # Rough instructions for importing new byacc release:
35 # $ cd /some/where/temporary
36 # $ tar xpfz /new/byacc/release/tar/file
37 # $ sh /usr/src/external/bsd/byacc/dist/byacc2netbsd byacc-YYYYMMDD `pwd`
38 # $ cd src/external/bsd/byacc/dist
39 # $ cvs import -m "Import byacc YYYYMMDD" src/external/bsd/byacc/dist DICKEY byacc-YYYYMMDD
40 # $ cd ../../../../../byacc-YYYYMMDD
41 # $ run ./configure
42 # $ run make
43 # check the config file and copy it to /usr/src/external/bsd/byacc/include
44 # remove the version from SYSTEM_NAME
45 # check the manual page against our copy if there are new options and
46 # update
48 if [ $# -ne 2 ]; then echo "byacc2netbsd src dest"; exit 1; fi
50 r=$1
51 d=$2/src/external/bsd/byacc/dist
53 case "$d" in
54 /*)
57 d=`/bin/pwd`/$d
59 esac
61 case "$r" in
62 /*)
65 r=`/bin/pwd`/$r
67 esac
69 echo preparing directory $d
70 rm -rf $d
71 mkdir -p $d
73 ### Copy the files and directories
74 echo copying $r to $d
75 cd $r
76 pax -rw * $d
78 ### Remove the $'s around RCS tags
79 cleantags $d
81 ### Add our NetBSD RCS Id
82 find $d -type f -name '*.[chly]' -print | while read c; do
83 sed 1q < $c | grep -q '\$NetBSD' || (
84 echo "/* \$NetBSD\$ */" >/tmp/byacc3n$$
85 echo "" >>/tmp/byacc3n$$
86 cat $c >> /tmp/byacc3n$$
87 mv /tmp/byacc3n$$ $c && echo added NetBSD RCS tag to $c
89 done
91 find $d -type f -name '*.[0-9]' -print | while read m; do
92 sed 1q < $m | grep -q '\$NetBSD' || (
93 echo ".\\\" \$NetBSD\$" >/tmp/byacc2m$$
94 echo ".\\\"" >>/tmp/byacc2m$$
95 cat $m >> /tmp/byacc2m$$
96 mv /tmp/byacc2m$$ $m && echo added NetBSD RCS tag to $m
98 done
100 find $d -type f -name '*.texi' -print | while read t; do
101 sed "2 s/^/@c \$NetBSD\$\\
102 /" < $t > /tmp/byacc4t$$
103 mv /tmp/byacc4t$$ $t && echo added NetBSD RCS tag to $t
104 done
106 echo done
108 ### Clean up any CVS directories that might be around.
109 echo "cleaning up CVS residue."
111 cd $d
112 find . -type d -name "CVS" -print | xargs rm -r
114 echo done
116 ### Fixing file and directory permissions.
117 echo "Fixing file/directory permissions."
119 cd $d
120 find . -type f -print | xargs chmod u+rw,go+r
121 find . -type d -print | xargs chmod u+rwx,go+rx
123 echo done
125 exit 0