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

« back to all changes in this revision

Viewing changes to erts/etc/win32/cygwin_tools/mingw/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
if [ -z "$MINGW_EXE_PATH" ]; then
 
9
    echo "You have to set MINGW_EXE_PATH to run rc.sh" >&2
 
10
    exit 1
 
11
fi
 
12
 
 
13
 
 
14
# # Find the correct rc.exe. This could be done by the configure script,
 
15
# # But as we seldom use the resource compiler, it might as well be done here...
 
16
# RCC=""
 
17
# save_ifs=$IFS
 
18
# IFS=:
 
19
# for p in $PATH; do 
 
20
#     if [ -f $p/windres.exe ]; then 
 
21
#       if [ -n "`$p/windres.exe --version 2>&1 | grep -i "GNU windres"`" ]; then 
 
22
#           RCC=$p/windres.exe
 
23
#       fi
 
24
#     fi
 
25
# done
 
26
# IFS=$save_ifs
 
27
 
 
28
RCC=$MINGW_EXE_PATH/windres.exe
 
29
 
 
30
if [ -z "$RCC" ]; then
 
31
    echo 'windres.exe not found!' >&2
 
32
    exit 1
 
33
fi
 
34
 
 
35
while test -n "$1" ; do
 
36
    x="$1"
 
37
    case "$x" in
 
38
        -o)
 
39
            shift
 
40
            MPATH=`cygpath -m $1`;
 
41
            OUTPUT_FILENAME="$MPATH";;
 
42
        -o/*)
 
43
            y=`echo $x | sed 's,^-[Io]\(/.*\),\1,g'`;
 
44
            MPATH=`cygpath -m $y`;
 
45
            OUTPUT_FILENAME="$MPATH";;
 
46
        -I)
 
47
            shift
 
48
            MPATH=`cygpath -m $1`;
 
49
            CMD="$CMD -I\"$MPATH\"";;
 
50
        -I/*)
 
51
            y=`echo $x | sed 's,^-[Io]\(/.*\),\1,g'`;
 
52
            MPATH=`cygpath -m $y`;
 
53
            CMD="$CMD -I\"$MPATH\"";;
 
54
        /*)
 
55
            MPATH=`cygpath -m $x`;
 
56
            CMD="$CMD \"$MPATH\"";; 
 
57
        *)
 
58
            y=`echo $x | sed 's,",\\\",g'`;
 
59
            CMD="$CMD \"$y\"";;
 
60
    esac
 
61
    shift
 
62
done
 
63
p=$$
 
64
if [ -n "$OUTPUT_FILENAME" ]; then
 
65
    CMD="-o $OUTPUT_FILENAME $CMD"
 
66
fi
 
67
if [ "X$RC_SH_DEBUG_LOG" != "X" ]; then
 
68
    echo rc.sh "$SAVE" >>$RC_SH_DEBUG_LOG
 
69
    echo windres.exe $CMD >>$RC_SH_DEBUG_LOG
 
70
fi
 
71
eval $RCC "$CMD"  >/tmp/rc.exe.${p}.1 2>/tmp/rc.exe.${p}.2
 
72
RES=$?
 
73
cat /tmp/rc.exe.${p}.2 >&2
 
74
cat /tmp/rc.exe.${p}.1
 
75
rm -f /tmp/rc.exe.${p}.2 /tmp/rc.exe.${p}.1
 
76
exit $RES