File: s_windows_dsp

package info (click to toggle)
db5.3 5.3.28%2Bdfsg1-0.5
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 158,360 kB
  • sloc: ansic: 448,411; java: 111,824; tcl: 80,544; sh: 44,326; cs: 33,697; cpp: 21,604; perl: 14,557; xml: 10,799; makefile: 4,077; yacc: 1,003; awk: 965; sql: 801; erlang: 342; python: 216; php: 24; asm: 14
file content (188 lines) | stat: -rwxr-xr-x 5,491 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
#!/bin/bash -
#	$Id$
#
# Build Windows CE .vcproj files
# Build Windows .vcproj files.

. ./RELEASE

create_projects()
{
    # project name list
    PROJECTS=$1

    # xquery script template
    TEMPLATE=genproject.template
    TEMPLATE_VS2010=vs2010.template

    # vs2010 common properties template
    LIBTEMPLATE=library.props.template
    APPTEMPLATE=application.props.template

    # temporary script, post-sed-replacement
    TEMP_SCRIPT=genproject.script

    # temporary common properties for vs2010
    TEMP_LIB=library.props
    TEMP_APP=application.props

    # xml document input template
    CONFIG_INPUT=$2

    # temporary xml document, post-sed-replacement
    CONFIG_OUTPUT=projects.xml

    # location for output project files
    PROJECT_OUTPUT_PARENT_DIR=$3

    # judge Windows or Win CE for vs2010
    WinVersion=$4

    if [ $WinVersion = "WinCE" ]; then
      VLoop=VS8
    else 
      VLoop="VS8 VS10"
    fi

    # for each project, substitute 2 variables in the XQuery script, then run it
    # temporarily use only VS10 here to omit the generation of VS8
    for v in $VLoop
    do

        if [ $v = "VS71" ]; then
            VERSION="7.10"
        elif [ $v = "VS8" ]; then
    	    VERSION="8.00"
 	elif [ $v = "VS10" ]; then
	    VERSION="10.0"
        fi

	PROJECT_OUTPUT_DIR="$PROJECT_OUTPUT_PARENT_DIR/$v"

    	# substitute some variables in the XML document template
        if [ $v = "VS10" ]; then
    	    sed -e "s/@DB_VERSION_MAJOR@/$DB_VERSION_MAJOR/g" \
                -e "s/@DB_VERSION_MINOR@/$DB_VERSION_MINOR/g" \
                -e "s/$/
/" \
                < $LIBTEMPLATE > $TEMP_LIB

            sed -e "s/@DB_VERSION_MAJOR@/$DB_VERSION_MAJOR/g" \
                -e "s/@DB_VERSION_MINOR@/$DB_VERSION_MINOR/g" \
                -e "s/$/
/" \
                < $APPTEMPLATE > $TEMP_APP

	    mv $TEMP_LIB $PROJECT_OUTPUT_DIR/$TEMP_LIB
            mv $TEMP_APP $PROJECT_OUTPUT_DIR/$TEMP_APP
	fi
    	sed -e "s/@DB_VERSION_MAJOR@/$DB_VERSION_MAJOR/g" \
            -e "s/@DB_VERSION_MINOR@/$DB_VERSION_MINOR/g" \
            < $CONFIG_INPUT > $CONFIG_OUTPUT
	
	
	
        echo "Building for Visual Studio version $VERSION"

        for i in `cat $PROJECTS`
        do
	    if [ $v = "VS10" ]; then
            	sed -e "s!@PROJECT_NAME@!$i!g" -e "s!@PROJECT_INPUT@!$CONFIG_OUTPUT!g" -e "s!@VISUAL_STUDIO_VERSION@!$VERSION!g" < $TEMPLATE_VS2010 > $TEMP_SCRIPT
            else 
            	sed -e "s!@PROJECT_NAME@!$i!g" -e "s!@PROJECT_INPUT@!$CONFIG_OUTPUT!g" -e "s!@VISUAL_STUDIO_VERSION@!$VERSION!g" < $TEMPLATE > $TEMP_SCRIPT
	    fi 	
            if [ $v = "VS7.1" ]; then
            	TMP=$PROJECT_OUTPUT_DIR/$i.tmp.vcproj
                TARG=$PROJECT_OUTPUT_DIR/${i}_vs71.vcproj
            elif [ $v = "VS8" ]; then
            	TMP=$PROJECT_OUTPUT_DIR/$i.tmp.vcproj
		TARG=$PROJECT_OUTPUT_DIR/${i}.vcproj
	    else
            	TMP=$PROJECT_OUTPUT_DIR/$i.tmp.vcxproj
                TARG=$PROJECT_OUTPUT_DIR/${i}.vcxproj
            fi
            xqilla -o $TMP $TEMP_SCRIPT
            rm -f $TEMP_SCRIPT
            chmod 644 $TMP
            cmp $TMP $TARG > /dev/null 2>&1 ||
            (echo "Building $TARG" && rm -f $TARG &&
            cp $TMP $TARG)
            rm -f $TMP
        done
    done

    # Cleanup.
    rm -f $CONFIG_OUTPUT
}

create_projects_csharp()
{
    # project name list
    PROJECTS=$1

    # xquery script template
    TEMPLATE=genproject_csharp.template

    # temporary script, post-sed-replacement
    TEMP_SCRIPT=genproject.script

    # xml document input template
    CONFIG_INPUT=$2

    # temporary xml document, post-sed-replacement
    CONFIG_OUTPUT=projects.xml

    # substitute some variables in the XML document template
    sed -e "s/@DB_VERSION_MAJOR@/$DB_VERSION_MAJOR/g" \
        -e "s/@DB_VERSION_MINOR@/$DB_VERSION_MINOR/g" \
        < $CONFIG_INPUT > $CONFIG_OUTPUT

    # for each project, substitute 2 variables in the XQuery script, then run it
    for i in `cat $PROJECTS`
    do
        # Split project path into dir + basename
        PROJECT_OUTPUT_DIR=`dirname $i`
        i=`basename $i`

        sed -e "s!@PROJECT_NAME@!$i!g" -e "s!@PROJECT_INPUT@!$CONFIG_OUTPUT!g" -e "s!@VISUAL_STUDIO_VERSION@!$VERSION!g" < $TEMPLATE > $TEMP_SCRIPT
        TMP=$PROJECT_OUTPUT_DIR/$i.tmp.csproj
        TARG=$PROJECT_OUTPUT_DIR/${i}.csproj
        xqilla -o $TMP $TEMP_SCRIPT
        rm -f $TEMP_SCRIPT
        chmod 644 $TMP
        cmp $TMP $TARG > /dev/null 2>&1 ||
        (echo "Building $TARG" && rm -f $TARG &&
        cp $TMP $TARG)
        rm -f $TMP
    done

    # Cleanup.
    rm -f $CONFIG_OUTPUT
}

# Detect XQilla
which xqilla  > /dev/null 2>&1
if [ $? -ne 0 ]; then
 	echo "Can not find xqilla command."
    	exit 1
fi

cd win_projects

# Create/Update Windows project files
echo "Building Visual Studio project files for Windows -- "
echo "   output only for modified projects (this can take a while)"
create_projects db.projects projects.template.xml ../../build_windows Win

# Create/Update Windows CE project files
echo "Building Visual Studio project files for Windows CE -- "
echo "   output only for modified projects (this can take a while)"
create_projects db_wince.projects projects_wince.template.xml ../../build_wince WinCE

# Create/Update C Sharp project files
echo "Building C Sharp project files -- "
echo "   output only for modified projects (this can take a while)"
create_projects_csharp db_csharp.projects projects_csharp.template.xml

cd ..