Mercurial > hg > octave-nkf > gnulib-hg
annotate build-aux/csharpcomp.sh.in @ 17764:2e1bf0ada123
autoupdate
author | Karl Berry <karl@freefriends.org> |
---|---|
date | Fri, 26 Sep 2014 09:07:05 -0700 |
parents | 344018b6e5d7 |
children | ab58d4870664 |
rev | line source |
---|---|
6514
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1 #!/bin/sh |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
2 # Compile a C# program. |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3 |
17587 | 4 # Copyright (C) 2003-2014 Free Software Foundation, Inc. |
6514
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5 # Written by Bruno Haible <bruno@clisp.org>, 2003. |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6 # |
9309
bbbbbf4cd1c5
Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
7011
diff
changeset
|
7 # This program is free software: you can redistribute it and/or modify |
6514
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
8 # it under the terms of the GNU General Public License as published by |
9309
bbbbbf4cd1c5
Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
7011
diff
changeset
|
9 # the Free Software Foundation; either version 3 of the License, or |
bbbbbf4cd1c5
Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
7011
diff
changeset
|
10 # (at your option) any later version. |
6514
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
11 # |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
12 # This program is distributed in the hope that it will be useful, |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
15 # GNU General Public License for more details. |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
16 # |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
17 # You should have received a copy of the GNU General Public License |
9309
bbbbbf4cd1c5
Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
7011
diff
changeset
|
18 # along with this program. If not, see <http://www.gnu.org/licenses/>. |
6514
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
19 |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
20 # This uses the same choices as csharpcomp.c, but instead of relying on the |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
21 # environment settings at run time, it uses the environment variables |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
22 # present at configuration time. |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
23 # |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
24 # This is a separate shell script, because the various C# compilers have |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
25 # different command line options. |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
26 # |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
27 # Usage: /bin/sh csharpcomp.sh [OPTION] SOURCE.cs ... RES.resource ... |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
28 # Options: |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
29 # -o PROGRAM.exe or -o LIBRARY.dll |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
30 # set the output assembly name |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
31 # -L DIRECTORY search for C# libraries also in DIRECTORY |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
32 # -l LIBRARY reference the C# library LIBRARY.dll |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
33 # -O optimize |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
34 # -g generate debugging information |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
35 |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
36 # func_tmpdir |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
37 # creates a temporary directory. |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
38 # Sets variable |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
39 # - tmp pathname of freshly created temporary directory |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
40 func_tmpdir () |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
41 { |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
42 # Use the environment variable TMPDIR, falling back to /tmp. This allows |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
43 # users to specify a different temporary directory, for example, if their |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
44 # /tmp is filled up or too small. |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
45 : ${TMPDIR=/tmp} |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
46 { |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
47 # Use the mktemp program if available. If not available, hide the error |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
48 # message. |
7011
c91111628d88
Update csharpcomp module from GNU gettext 0.15.
Bruno Haible <bruno@clisp.org>
parents:
6581
diff
changeset
|
49 tmp=`(umask 077 && mktemp -d -q "$TMPDIR/gtXXXXXX") 2>/dev/null` && |
6514
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
50 test -n "$tmp" && test -d "$tmp" |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
51 } || |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
52 { |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
53 # Use a simple mkdir command. It is guaranteed to fail if the directory |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
54 # already exists. $RANDOM is bash specific and expands to empty in shells |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
55 # other than bash, ksh and zsh. Its use does not increase security; |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
56 # rather, it minimizes the probability of failure in a very cluttered /tmp |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
57 # directory. |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
58 tmp=$TMPDIR/gt$$-$RANDOM |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
59 (umask 077 && mkdir "$tmp") |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
60 } || |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
61 { |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
62 echo "$0: cannot create a temporary directory in $TMPDIR" >&2 |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
63 { (exit 1); exit 1; } |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
64 } |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
65 } |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
66 |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
67 sed_quote_subst='s/\([|&;<>()$`"'"'"'*?[#~=% \\]\)/\\\1/g' |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
68 options_cscc= |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
69 options_mcs= |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
70 options_csc="-nologo" |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
71 sources= |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
72 while test $# != 0; do |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
73 case "$1" in |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
74 -o) |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
75 case "$2" in |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
76 *.dll) |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
77 options_cscc="$options_cscc -shared" |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
78 options_mcs="$options_mcs -target:library" |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
79 options_csc="$options_csc -target:library" |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
80 ;; |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
81 *.exe) |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
82 options_csc="$options_csc -target:exe" |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
83 ;; |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
84 esac |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
85 options_cscc="$options_cscc -o "`echo "$2" | sed -e "$sed_quote_subst"` |
7011
c91111628d88
Update csharpcomp module from GNU gettext 0.15.
Bruno Haible <bruno@clisp.org>
parents:
6581
diff
changeset
|
86 options_mcs="$options_mcs -out:"`echo "$2" | sed -e "$sed_quote_subst"` |
6514
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
87 options_csc="$options_csc -out:"`echo "$2" | sed -e "$sed_quote_subst"` |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
88 shift |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
89 ;; |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
90 -L) |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
91 options_cscc="$options_cscc -L "`echo "$2" | sed -e "$sed_quote_subst"` |
7011
c91111628d88
Update csharpcomp module from GNU gettext 0.15.
Bruno Haible <bruno@clisp.org>
parents:
6581
diff
changeset
|
92 options_mcs="$options_mcs -lib:"`echo "$2" | sed -e "$sed_quote_subst"` |
6514
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
93 options_csc="$options_csc -lib:"`echo "$2" | sed -e "$sed_quote_subst"` |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
94 shift |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
95 ;; |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
96 -l) |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
97 options_cscc="$options_cscc -l "`echo "$2" | sed -e "$sed_quote_subst"` |
7011
c91111628d88
Update csharpcomp module from GNU gettext 0.15.
Bruno Haible <bruno@clisp.org>
parents:
6581
diff
changeset
|
98 options_mcs="$options_mcs -reference:"`echo "$2" | sed -e "$sed_quote_subst"` |
6514
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
99 options_csc="$options_csc -reference:"`echo "$2" | sed -e "$sed_quote_subst"`".dll" |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
100 shift |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
101 ;; |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
102 -O) |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
103 options_cscc="$options_cscc -O" |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
104 options_csc="$options_csc -optimize+" |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
105 ;; |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
106 -g) |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
107 options_cscc="$options_cscc -g" |
7011
c91111628d88
Update csharpcomp module from GNU gettext 0.15.
Bruno Haible <bruno@clisp.org>
parents:
6581
diff
changeset
|
108 options_mcs="$options_mcs -debug" |
6514
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
109 options_csc="$options_csc -debug+" |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
110 ;; |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
111 -*) |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
112 echo "csharpcomp: unknown option '$1'" 1>&2 |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
113 exit 1 |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
114 ;; |
7011
c91111628d88
Update csharpcomp module from GNU gettext 0.15.
Bruno Haible <bruno@clisp.org>
parents:
6581
diff
changeset
|
115 *.resources) |
6514
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
116 options_cscc="$options_cscc -fresources="`echo "$1" | sed -e "$sed_quote_subst"` |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
117 options_mcs="$options_mcs -resource:"`echo "$1" | sed -e "$sed_quote_subst"` |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
118 options_csc="$options_csc -resource:"`echo "$1" | sed -e "$sed_quote_subst"` |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
119 ;; |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
120 *.cs) |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
121 sources="$sources "`echo "$1" | sed -e "$sed_quote_subst"` |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
122 ;; |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
123 *) |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
124 echo "csharpcomp: unknown type of argument '$1'" 1>&2 |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
125 exit 1 |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
126 ;; |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
127 esac |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
128 shift |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
129 done |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
130 |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
131 if test -n "@HAVE_CSCC@"; then |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
132 test -z "$CSHARP_VERBOSE" || echo cscc $options_cscc $sources |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
133 exec cscc $options_cscc $sources |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
134 else |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
135 if test -n "@HAVE_MCS@"; then |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
136 # mcs prints it errors and warnings to stdout, not stderr. Furthermore it |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
137 # adds a useless line "Compilation succeeded..." at the end. Correct both. |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
138 sed_drop_success_line='${ |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
139 /^Compilation succeeded/d |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
140 }' |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
141 func_tmpdir |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
142 trap 'rm -rf "$tmp"' 1 2 3 15 |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
143 test -z "$CSHARP_VERBOSE" || echo mcs $options_mcs $sources |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
144 mcs $options_mcs $sources > "$tmp"/mcs.err |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
145 result=$? |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
146 sed -e "$sed_drop_success_line" < "$tmp"/mcs.err >&2 |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
147 rm -rf "$tmp" |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
148 exit $result |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
149 else |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
150 if test -n "@HAVE_CSC@"; then |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
151 test -z "$CSHARP_VERBOSE" || echo csc $options_csc $sources |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
152 exec csc $options_csc $sources |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
153 else |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
154 echo 'C# compiler not found, try installing pnet, then reconfigure' 1>&2 |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
155 exit 1 |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
156 fi |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
157 fi |
7c86315addec
Moved here from lib/csharpcomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
158 fi |