merge the formfield patch from ooo-build
[ooovba.git] / applied_patches / 0310-mono-build.diff
blobda6f439b7db3a536f01e785400e02c4226fb7097
1 diff --git cli_ure/prj/build.lst cli_ure/prj/build.lst
2 index e6c1d83..7008a9d 100644
3 --- cli_ure/prj/build.lst
4 +++ cli_ure/prj/build.lst
5 @@ -2,13 +2,13 @@ ure cli_ure : cppu cppuhelper sal codemaker stoc udkapi tools NULL
6 ure cli_ure usr1 - all ure_mkout NULL
7 ure cli_ure\inc nmake - all ure_inc NULL
8 ure cli_ure\version nmake - all ure_source_version ure_inc NULL
9 -ure cli_ure\source nmake - w,vc7 ure_source_source ure_inc NULL
10 -ure cli_ure\source\basetypes nmake - w,vc7 ure_source_basetypes ure_source_version ure_source_source.w ure_inc NULL
11 -ure cli_ure\source\climaker nmake - w,vc7 ure_source_climaker ure_source_basetypes.w ure_inc NULL
12 -ure cli_ure\unotypes nmake - w,vc7 ure_unotypes ure_source_version ure_source_source.w ure_source_climaker.w ure_inc NULL
13 -ure cli_ure\source\ure nmake - w,vc7 ure_source_ure ure_source_version ure_source_source.w ure_unotypes.w ure_inc NULL
14 -ure cli_ure\source\uno_bridge nmake - w,vc7 ure_source_uno_bridge ure_source_basetypes.w ure_unotypes.w ure_source_ure.w ure_inc NULL
15 +ure cli_ure\source nmake - all ure_source_source ure_inc NULL
16 +ure cli_ure\source\basetypes nmake - all ure_source_basetypes ure_source_version ure_source_source ure_inc NULL
17 +ure cli_ure\source\bootstrap nmake - u ure_source_bootstrap ure_source_source ure_source_basetypes ure_inc NULL
18 +ure cli_ure\source\climaker nmake - all ure_source_climaker ure_source_basetypes ure_inc NULL
19 +ure cli_ure\unotypes nmake - all ure_unotypes ure_source_version ure_source_source ure_source_climaker ure_source_basetypes ure_inc NULL
20 +ure cli_ure\source\ure nmake - all ure_source_ure ure_source_version ure_source_source ure_unotypes ure_inc NULL
21 +ure cli_ure\source\uno_bridge nmake - w,vc7 ure_source_uno_bridge ure_source_basetypes ure_unotypes ure_source_ure ure_inc NULL
22 ure cli_ure\source\mono_bridge nmake - u ure_source_mono_bridge ure_unotypes ure_source_ure ure_inc NULL
23 -ure cli_ure\source\native nmake - w,vc7 ure_source_native ure_source_version ure_source_source.w ure_source_ure.w ure_unotypes.w ure_source_uno_bridge.w ure_inc NULL
25 -#ure cli_ure\util nmake - w,vc7 ure_util ure_source_ure.w ure_source_native.w NULL
26 +ure cli_ure\source\native nmake - w,vc7 ure_source_native ure_source_version ure_source_source ure_source_ure ure_unotypes ure_source_uno_bridge ure_inc NULL
27 +#ure cli_ure\util nmake - w,vc7 ure_util ure_source_ure ure_source_native NULL
28 diff --git cli_ure/prj/d.lst cli_ure/prj/d.lst
29 index 261bb2c..56eab2d 100644
30 --- cli_ure/prj/d.lst
31 +++ cli_ure/prj/d.lst
32 @@ -3,6 +3,7 @@
33 ..\%__SRC%\bin\climaker.exe.config %_DEST%\bin%_EXT%\climaker.exe.config
35 ..\%__SRC%\bin\cli_*.dll %_DEST%\bin%_EXT%\cli_*.dll
36 +..\%__SRC%\lib\libcli*.so %_DEST%\lib%_EXT%\libcli*.so
37 ..\%__SRC%\bin\cli_*.pdb %_DEST%\bin%_EXT%\cli_*.pdb
38 ..\%__SRC%\bin\cli_*.config %_DEST%\bin%_EXT%\cli_*.config
39 ..\%__SRC%\bin\policy*.dll %_DEST%\bin%_EXT%\policy*.dll
40 diff --git cli_ure/source/basetypes/makefile.mk cli_ure/source/basetypes/makefile.mk
41 index 77def87..194c1c2 100644
42 --- cli_ure/source/basetypes/makefile.mk
43 +++ cli_ure/source/basetypes/makefile.mk
44 @@ -99,7 +99,7 @@ $(BIN)$/cli_basetypes.dll : $(CSFILES) $(BIN)$/cliureversion.mk
46 #do not forget to deliver cli_uretypes.config. It is NOT embedded in the policy file.
47 $(POLICY_ASSEMBLY_FILE) : $(BIN)$/cli_basetypes.config
48 - $(WRAPCMD) AL.exe -out:$@ \
49 + $(WRAPCMD) $(AL) -out:$@ \
50 -version:$(CLI_BASETYPES_POLICY_VERSION) \
51 -keyfile:$(BIN)$/cliuno.snk \
52 -link:$(BIN)$/cli_basetypes.config
53 diff --git cli_ure/source/native/makefile.mk cli_ure/source/native/makefile.mk
54 index 2e367b4..686f286 100644
55 --- cli_ure/source/native/makefile.mk
56 +++ cli_ure/source/native/makefile.mk
57 @@ -171,7 +171,7 @@ $(SIGN): $(SHL1TARGETN)
58 # cli_cppuhelper.dll but the system cannot locate it. It possibly assumes that the
59 # assembly is also 'MSIL' like its policy file.
60 $(POLICY_ASSEMBLY_FILE) : $(BIN)$/cli_cppuhelper.config
61 - $(WRAPCMD) AL.exe -out:$@ \
62 + $(WRAPCMD) $(AL) -out:$@ \
63 -version:$(CLI_CPPUHELPER_POLICY_VERSION) \
64 -keyfile:$(BIN)$/cliuno.snk \
65 -link:$(BIN)$/cli_cppuhelper.config \
66 @@ -179,7 +179,7 @@ $(POLICY_ASSEMBLY_FILE) : $(BIN)$/cli_cppuhelper.config
67 .ELSE
68 #.NET 1.1: platform flag not needed
69 $(POLICY_ASSEMBLY_FILE) : $(BIN)$/cli_cppuhelper.config
70 - $(WRAPCMD) AL.exe -out:$@ \
71 + $(WRAPCMD) $(AL) -out:$@ \
72 -version:$(CLI_CPPUHELPER_POLICY_VERSION) \
73 -keyfile:$(BIN)$/cliuno.snk \
74 -link:$(BIN)$/cli_cppuhelper.config
75 diff --git cli_ure/source/ure/makefile.mk cli_ure/source/ure/makefile.mk
76 index b4c13f6..3698866 100644
77 --- cli_ure/source/ure/makefile.mk
78 +++ cli_ure/source/ure/makefile.mk
79 @@ -47,6 +47,7 @@ ECHOQUOTE='
80 .ELSE
81 ECHOQUOTE=
82 .ENDIF
83 +# ' emacs is a fool
85 .IF "$(BUILD_FOR_CLI)" != ""
87 @@ -97,7 +98,7 @@ $(BIN)$/cli_ure.dll : $(CSFILES) $(BIN)$/cli_uretypes.dll $(BIN)$/cliureversion.
89 #do not forget to deliver cli_ure.config. It is NOT embedded in the policy file.
90 $(POLICY_ASSEMBLY_FILE) : $(BIN)$/cli_ure.config
91 - $(WRAPCMD) AL.exe -out:$@ \
92 + $(WRAPCMD) $(AL) -out:$@ \
93 -version:$(CLI_URE_POLICY_VERSION) \
94 -keyfile:$(BIN)$/cliuno.snk \
95 -link:$(BIN)$/cli_ure.config
96 diff --git cli_ure/util/makefile.pmk cli_ure/util/makefile.pmk
97 index 9127092..a88a211 100644
98 --- cli_ure/util/makefile.pmk
99 +++ cli_ure/util/makefile.pmk
100 @@ -31,7 +31,7 @@
102 # no translation here anyway
103 .IF "$(L10N_framework)"==""
104 -.IF "$(COM)" == "MSC"
105 +.IF "$(COM)$(COMEX)" == "MSC11" || "$(COM)$(COMEX)"== "MSC10" || "$(ENABLE_MONO)" == "YES"
106 BUILD_FOR_CLI = "true"
107 CFLAGSENABLESYMBOLS:=-Z7
108 .ENDIF
109 diff --git cli_ure/util/target.pmk cli_ure/util/target.pmk
110 index ca5b362..97ef85c 100644
111 --- cli_ure/util/target.pmk
112 +++ cli_ure/util/target.pmk
113 @@ -38,7 +38,7 @@ CSCFLAGS = -warnaserror+ -noconfig
114 .IF "$(product)" == ""
115 CSCFLAGS += -checked+ -define:DEBUG -define:TRACE
116 .ELSE
117 -CSCFLAGS += -o
118 +CSCFLAGS += -optimize
119 .ENDIF
121 .ELSE # debug
122 diff --git configure.in configure.in
123 index 8cca6e6..70df4eb 100644
124 --- configure.in
125 +++ configure.in
126 @@ -33,6 +33,9 @@ AC_ARG_ENABLE(ldap,
127 [ --disable-ldap Disables the use of LDAP backend via Netscape/Mozilla
128 or OpenLDAP LDAP SDK
129 ],,)
130 +AC_ARG_ENABLE(mono,
131 +[ --enable-mono Enables the compilation of the Mono bindings
132 +],,)
133 AC_ARG_WITH(openldap,
134 [ --with-openldap Enables the use of the OpenLDAP LDAP SDK instead
135 of the Netscape/Mozilla one
136 @@ -1816,7 +1819,6 @@ AC_SUBST(USE_MINGW)
137 dnl ===================================================================
138 dnl .NET needs special treatment
139 dnl ===================================================================
140 -if test "$_os" = "WINNT"; then
141 if test "$WITH_MINGWIN" = "yes" || test "$COMEX" -ge "10"; then
142 dnl Check midl.exe
143 AC_PATH_PROG(MIDL_PATH, midl.exe)
144 @@ -1873,6 +1875,8 @@ if test "$COMEX" -ge "10"; then
145 # Convert to posix path with 8.3 filename restrictions ( No spaces )
146 CSC_PATH=`cygpath -d "$CSC_PATH"`
147 CSC_PATH=`cygpath -u "$CSC_PATH"`
148 + CSC="$CSC_PATH/csc.exe"
149 + AL="$CSC_PATH/al.exe"
151 dnl Check mscoree.lib / .NET Frameworks dir
152 dnl For VS2003/2005 $with_frame_home has to point to the directory with lib/mscoree.lib.
153 @@ -1906,9 +1910,59 @@ if test "$COMEX" -ge "10"; then
154 FRAME_HOME=`cygpath -u "$FRAME_HOME"`
156 AC_SUBST(MIDL_PATH)
157 -AC_SUBST(CSC_PATH)
158 AC_SUBST(FRAME_HOME)
160 +if test "$_os" = "Linux"; then
161 + AC_MSG_CHECKING([whether to enable Mono bindings])
162 + CSC_PATH=
163 + CSC=
164 + ENABLE_MONO=NO
165 + if test "$enable_mono" != "no" ; then
166 + AC_MSG_RESULT([yes])
167 + if test "z$with_csc_path" != "z"; then
168 + if test -x "$with_csc_path/mcs"; then
169 + CSC_PATH="$with_csc_path"
170 + fi
171 + if test -x "$with_csc_path/bin/mcs"; then
172 + CSC_PATH="$with_csc_path/bin"
173 + fi
174 + fi
175 + if test "z$CSC_PATH" = "z"; then
176 + AC_PATH_PROG(MCS, mcs)
177 + test -z "$MCS" || CSC_PATH=`dirname $MCS`
178 + fi
179 + AL="$CSC_PATH/al"
180 + if test -x "$MCS" -a -x "$AL"; then
181 + MCS_VERSION=`$MCS --version | cut -d" " -f5`
182 + if test "`echo $MCS_VERSION | cut -d"." -f1`" -gt "1" || \
183 + test "`echo $MCS_VERSION | cut -d"." -f1`" = "1" -a \
184 + "`echo $MCS_VERSION | cut -d"." -f2`" -ge "2" || \
185 + test "`echo $MCS_VERSION | cut -d"." -f1`" = "1" -a \
186 + "`echo $MCS_VERSION | cut -d"." -f2`" = "1" -a \
187 + "`echo $MCS_VERSION | cut -d"." -f3`" -ge "8"; then
188 + ENABLE_MONO=YES
189 + CSC=$MCS
190 + else
191 + if test -n "$enable_mono" ; then
192 + AC_MSG_ERROR([no, mcs >= 1.1.8 is needed.])
193 + fi
194 + fi
195 + else
196 + if test -n "$enable_mono"; then
197 + AC_MSG_ERROR([mcs or al not found. Make sure they're in the path or use --with-csc-path])
198 + fi
199 + fi
200 + PKG_CHECK_MODULES(MONO, mono >= 1.1.8)
201 + else
202 + AC_MSG_RESULT([no])
203 + fi
205 +AC_SUBST(CSC_PATH)
206 +AC_SUBST(CSC)
207 +AC_SUBST(AL)
208 +AC_SUBST(ENABLE_MONO)
209 +AC_SUBST(MONO_CFLAGS)
210 +AC_SUBST(MONO_LIBS)
212 dnl ===================================================================
213 dnl Check if stdc headers are available excluding windows.
214 diff --git set_soenv.in set_soenv.in
215 index 2e45ac7..2d51001 100644
216 --- set_soenv.in
217 +++ set_soenv.in
218 @@ -1764,6 +1764,12 @@ ToFile( "MKDEPENDSOLVER", "TRUE", "e" );
219 # (c = comment, e = environment variable, a = alias )
220 ToFile( "Platform dependent constant values.", $empty, "c" );
221 ToFile( "SOLAR_JAVA", $SOLAR_JAVA, "e" );
222 +ToFile( "ENABLE_MONO", "@ENABLE_MONO@", "e" );
223 +ToFile( "CSC", "@CSC@", "e" );
224 +ToFile( "AL", "@AL@", "e" );
225 +ToFile( "CSC_PATH", "@CSC_PATH@", "e" );
226 +ToFile( "MONO_CFLAGS", "@MONO_CFLAGS@", "e" );
227 +ToFile( "MONO_LIBS", "@MONO_LIBS@", "e" );
228 ToFile( "BIG_SVX", $BIG_SVX, "e" );
229 ToFile( "COM", $COM, "e" );
230 ToFile( "COMPATH", $COMPATH, "e" );