~ubuntu-branches/debian/squeeze/erlang/squeeze

« back to all changes in this revision

Viewing changes to erts/etc/win32/cygwin_tools/vc/rc.sh

  • Committer: Bazaar Package Importer
  • Author(s): Erlang Packagers, Sergei Golovan
  • Date: 2006-12-03 17:07:44 UTC
  • mfrom: (2.1.11 feisty)
  • Revision ID: james.westby@ubuntu.com-20061203170744-rghjwupacqlzs6kv
Tags: 1:11.b.2-4
[ Sergei Golovan ]
Fixed erlang-base and erlang-base-hipe prerm scripts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh
 
2
# set -x
 
3
# Save the command line for debug outputs
 
4
SAVE="$@"
 
5
CMD=""
 
6
OUTPUT_FILENAME=""
 
7
 
 
8
# Find the correct rc.exe. This could be done by the configure script,
 
9
# But as we seldom use the resource compiler, it might as well be done here...
 
10
RCC=""
 
11
save_ifs=$IFS
 
12
IFS=:
 
13
for p in $PATH; do 
 
14
    if [ -f $p/rc.exe ]; then 
 
15
        if [ -n "`$p/rc.exe -? 2>&1 | grep -i "resource compiler"`" ]; then 
 
16
            RCC=$p/rc.exe
 
17
        fi
 
18
    fi
 
19
done
 
20
IFS=$save_ifs
 
21
 
 
22
if [ -z "$RCC" ]; then
 
23
    echo 'rc.exe not found!' >&2
 
24
    exit 1
 
25
fi
 
26
 
 
27
while test -n "$1" ; do
 
28
    x="$1"
 
29
    case "$x" in
 
30
        -o)
 
31
            shift
 
32
            MPATH=`cygpath -m $1`;
 
33
            OUTPUT_FILENAME="$MPATH";;
 
34
        -o/*)
 
35
            y=`echo $x | sed 's,^-[Io]\(/.*\),\1,g'`;
 
36
            MPATH=`cygpath -m $y`;
 
37
            OUTPUT_FILENAME="$MPATH";;
 
38
        -I)
 
39
            shift
 
40
            MPATH=`cygpath -m $1`;
 
41
            CMD="$CMD -I\"$MPATH\"";;
 
42
        -I/*)
 
43
            y=`echo $x | sed 's,^-[Io]\(/.*\),\1,g'`;
 
44
            MPATH=`cygpath -m $y`;
 
45
            CMD="$CMD -I\"$MPATH\"";;
 
46
        /*)
 
47
            MPATH=`cygpath -m $x`;
 
48
            CMD="$CMD \"$MPATH\"";; 
 
49
        *)
 
50
            y=`echo $x | sed 's,",\\\",g'`;
 
51
            CMD="$CMD \"$y\"";;
 
52
    esac
 
53
    shift
 
54
done
 
55
p=$$
 
56
if [ -n "$OUTPUT_FILENAME" ]; then
 
57
    CMD="-Fo$OUTPUT_FILENAME $CMD"
 
58
fi
 
59
if [ "X$RC_SH_DEBUG_LOG" != "X" ]; then
 
60
    echo rc.sh "$SAVE" >>$RC_SH_DEBUG_LOG
 
61
    echo rc.exe $CMD >>$RC_SH_DEBUG_LOG
 
62
fi
 
63
eval $RCC "$CMD"  >/tmp/rc.exe.${p}.1 2>/tmp/rc.exe.${p}.2
 
64
RES=$?
 
65
tail +2 /tmp/rc.exe.${p}.2 >&2
 
66
cat /tmp/rc.exe.${p}.1
 
67
rm -f /tmp/rc.exe.${p}.2 /tmp/rc.exe.${p}.1
 
68
exit $RES