annotate lib/swig/swigwin-2.0.11/Tools/config/ylwrap @ 1899:b3009adc0e2f

Adding swig, gitignore, hgignore
author Nomad
date Mon, 21 Oct 2013 10:42:27 +0200
parents
children
rev   line source
1899
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
1 #! /bin/sh
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
2 # ylwrap - wrapper for lex/yacc invocations.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
3
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
4 scriptversion=2011-08-25.18; # UTC
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
5
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
6 # Copyright (C) 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004, 2005,
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
7 # 2007, 2009, 2010, 2011 Free Software Foundation, Inc.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
8 #
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
9 # Written by Tom Tromey <tromey@cygnus.com>.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
10 #
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
11 # This program is free software; you can redistribute it and/or modify
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
12 # it under the terms of the GNU General Public License as published by
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
13 # the Free Software Foundation; either version 2, or (at your option)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
14 # any later version.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
15 #
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
16 # This program is distributed in the hope that it will be useful,
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
17 # but WITHOUT ANY WARRANTY; without even the implied warranty of
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
19 # GNU General Public License for more details.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
20 #
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
21 # You should have received a copy of the GNU General Public License
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
22 # along with this program. If not, see <http://www.gnu.org/licenses/>.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
23
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
24 # As a special exception to the GNU General Public License, if you
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
25 # distribute this file as part of a program that contains a
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
26 # configuration script generated by Autoconf, you may include it under
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
27 # the same distribution terms that you use for the rest of that program.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
28
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
29 # This file is maintained in Automake, please report
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
30 # bugs to <bug-automake@gnu.org> or send patches to
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
31 # <automake-patches@gnu.org>.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
32
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
33 case "$1" in
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
34 '')
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
35 echo "$0: No files given. Try \`$0 --help' for more information." 1>&2
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
36 exit 1
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
37 ;;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
38 --basedir)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
39 basedir=$2
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
40 shift 2
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
41 ;;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
42 -h|--h*)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
43 cat <<\EOF
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
44 Usage: ylwrap [--help|--version] INPUT [OUTPUT DESIRED]... -- PROGRAM [ARGS]...
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
45
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
46 Wrapper for lex/yacc invocations, renaming files as desired.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
47
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
48 INPUT is the input file
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
49 OUTPUT is one file PROG generates
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
50 DESIRED is the file we actually want instead of OUTPUT
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
51 PROGRAM is program to run
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
52 ARGS are passed to PROG
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
53
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
54 Any number of OUTPUT,DESIRED pairs may be used.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
55
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
56 Report bugs to <bug-automake@gnu.org>.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
57 EOF
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
58 exit $?
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
59 ;;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
60 -v|--v*)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
61 echo "ylwrap $scriptversion"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
62 exit $?
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
63 ;;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
64 esac
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
65
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
66
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
67 # The input.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
68 input="$1"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
69 shift
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
70 case "$input" in
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
71 [\\/]* | ?:[\\/]*)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
72 # Absolute path; do nothing.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
73 ;;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
74 *)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
75 # Relative path. Make it absolute.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
76 input="`pwd`/$input"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
77 ;;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
78 esac
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
79
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
80 pairlist=
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
81 while test "$#" -ne 0; do
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
82 if test "$1" = "--"; then
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
83 shift
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
84 break
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
85 fi
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
86 pairlist="$pairlist $1"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
87 shift
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
88 done
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
89
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
90 # The program to run.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
91 prog="$1"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
92 shift
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
93 # Make any relative path in $prog absolute.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
94 case "$prog" in
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
95 [\\/]* | ?:[\\/]*) ;;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
96 *[\\/]*) prog="`pwd`/$prog" ;;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
97 esac
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
98
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
99 # FIXME: add hostname here for parallel makes that run commands on
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
100 # other machines. But that might take us over the 14-char limit.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
101 dirname=ylwrap$$
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
102 do_exit="cd '`pwd`' && rm -rf $dirname > /dev/null 2>&1;"' (exit $ret); exit $ret'
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
103 trap "ret=129; $do_exit" 1
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
104 trap "ret=130; $do_exit" 2
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
105 trap "ret=141; $do_exit" 13
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
106 trap "ret=143; $do_exit" 15
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
107 mkdir $dirname || exit 1
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
108
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
109 cd $dirname
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
110
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
111 case $# in
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
112 0) "$prog" "$input" ;;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
113 *) "$prog" "$@" "$input" ;;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
114 esac
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
115 ret=$?
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
116
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
117 if test $ret -eq 0; then
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
118 set X $pairlist
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
119 shift
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
120 first=yes
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
121 # Since DOS filename conventions don't allow two dots,
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
122 # the DOS version of Bison writes out y_tab.c instead of y.tab.c
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
123 # and y_tab.h instead of y.tab.h. Test to see if this is the case.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
124 y_tab_nodot="no"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
125 if test -f y_tab.c || test -f y_tab.h; then
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
126 y_tab_nodot="yes"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
127 fi
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
128
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
129 # The directory holding the input.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
130 input_dir=`echo "$input" | sed -e 's,\([\\/]\)[^\\/]*$,\1,'`
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
131 # Quote $INPUT_DIR so we can use it in a regexp.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
132 # FIXME: really we should care about more than `.' and `\'.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
133 input_rx=`echo "$input_dir" | sed 's,\\\\,\\\\\\\\,g;s,\\.,\\\\.,g'`
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
134
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
135 while test "$#" -ne 0; do
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
136 from="$1"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
137 # Handle y_tab.c and y_tab.h output by DOS
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
138 if test $y_tab_nodot = "yes"; then
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
139 if test $from = "y.tab.c"; then
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
140 from="y_tab.c"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
141 else
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
142 if test $from = "y.tab.h"; then
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
143 from="y_tab.h"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
144 fi
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
145 fi
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
146 fi
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
147 if test -f "$from"; then
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
148 # If $2 is an absolute path name, then just use that,
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
149 # otherwise prepend `../'.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
150 case "$2" in
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
151 [\\/]* | ?:[\\/]*) target="$2";;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
152 *) target="../$2";;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
153 esac
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
154
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
155 # We do not want to overwrite a header file if it hasn't
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
156 # changed. This avoid useless recompilations. However the
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
157 # parser itself (the first file) should always be updated,
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
158 # because it is the destination of the .y.c rule in the
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
159 # Makefile. Divert the output of all other files to a temporary
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
160 # file so we can compare them to existing versions.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
161 if test $first = no; then
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
162 realtarget="$target"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
163 target="tmp-`echo $target | sed s/.*[\\/]//g`"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
164 fi
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
165 # Edit out `#line' or `#' directives.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
166 #
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
167 # We don't want the resulting debug information to point at
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
168 # an absolute srcdir; it is better for it to just mention the
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
169 # .y file with no path.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
170 #
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
171 # We want to use the real output file name, not yy.lex.c for
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
172 # instance.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
173 #
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
174 # We want the include guards to be adjusted too.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
175 FROM=`echo "$from" | sed \
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
176 -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
177 -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
178 TARGET=`echo "$2" | sed \
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
179 -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
180 -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
181
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
182 sed -e "/^#/!b" -e "s,$input_rx,," -e "s,$from,$2," \
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
183 -e "s,$FROM,$TARGET," "$from" >"$target" || ret=$?
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
184
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
185 # Check whether header files must be updated.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
186 if test $first = no; then
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
187 if test -f "$realtarget" && cmp -s "$realtarget" "$target"; then
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
188 echo "$2" is unchanged
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
189 rm -f "$target"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
190 else
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
191 echo updating "$2"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
192 mv -f "$target" "$realtarget"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
193 fi
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
194 fi
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
195 else
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
196 # A missing file is only an error for the first file. This
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
197 # is a blatant hack to let us support using "yacc -d". If -d
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
198 # is not specified, we don't want an error when the header
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
199 # file is "missing".
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
200 if test $first = yes; then
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
201 ret=1
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
202 fi
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
203 fi
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
204 shift
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
205 shift
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
206 first=no
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
207 done
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
208 else
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
209 ret=$?
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
210 fi
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
211
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
212 # Remove the directory.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
213 cd ..
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
214 rm -rf $dirname
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
215
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
216 exit $ret
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
217
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
218 # Local Variables:
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
219 # mode: shell-script
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
220 # sh-indentation: 2
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
221 # eval: (add-hook 'write-file-hooks 'time-stamp)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
222 # time-stamp-start: "scriptversion="
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
223 # time-stamp-format: "%:y-%02m-%02d.%02H"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
224 # time-stamp-time-zone: "UTC"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
225 # time-stamp-end: "; # UTC"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
226 # End: