merged tag ooo/OOO330_m14
[LibreOffice.git] / moz / extractfiles.mk
blobdedfade257db37a323305f1d4701402888c96fdd
1 #*************************************************************************
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 #
5 # Copyright 2000, 2010 Oracle and/or its affiliates.
7 # OpenOffice.org - a multi-platform office productivity suite
9 # This file is part of OpenOffice.org.
11 # OpenOffice.org is free software: you can redistribute it and/or modify
12 # it under the terms of the GNU Lesser General Public License version 3
13 # only, as published by the Free Software Foundation.
15 # OpenOffice.org is distributed in the hope that it will be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 # GNU Lesser General Public License version 3 for more details
19 # (a copy is included in the LICENSE file that accompanied this code).
21 # You should have received a copy of the GNU Lesser General Public License
22 # version 3 along with OpenOffice.org. If not, see
23 # <http://www.openoffice.org/license.html>
24 # for a copy of the LGPLv3 License.
26 #*************************************************************************
28 MOZTARGET=$(OS)$(COM)$(CPU)
29 MOZ_DIST_DIR=$(MISC)$/build$/mozilla$/$(BUILD_DIR)$/dist
30 MOZ_BIN_DIR=$(MOZ_DIST_DIR)$/bin
31 RUNTIME_DIR=$(MISC)$/$(MOZTARGET)runtime
32 LIB_DIR=$(LB)
33 INCLUDE_DIR=$(INCCOM)
37 #If we build the NSS module then we do not need the old nss libs from here
38 .IF "$(ENABLE_NSS_MODULE)"=="YES"
41 .IF "$(OS)" == "SOLARIS"
42 .IF "$(CPU)" == "S" #32bit
43 FREEBL_LIB=freebl_32fpu_3 freebl_32int64_3 freebl_32int_3
44 .ELIF "$(CPU)" == "U" #64bit unxsolu4
45 FREEBL_LIB=freebl_64int_3 freebl_64fpu_3
46 .ELSE
47 FREEBL_LIB=freebl3
48 .ENDIF #"$(CPU)" == "S"
50 .ELSE # "$(OS)" == "SOLARIS"
51 FREEBL_LIB=freebl3
52 .ENDIF # "$(OS)" == "SOLARIS"
55 NSS_MODULE_RUNTIME_LIST:= \
56 $(FREEBL_LIB) \
57 nspr4 \
58 nss3 \
59 nssckbi \
60 nssdbm3 \
61 nssutil3 \
62 plc4 \
63 plds4 \
64 smime3 \
65 softokn3 \
66 sqlite/sqlite3 \
67 ssl3
69 BIN_RUNTIMELIST= \
70 xpcom \
71 xpcom_core \
72 xpcom_compat
73 .ELSE
75 .IF "$(GUI)" == "WNT"
76 FREEBL_LIB=freebl3
77 .ELSE # "$(GUI)" == "WNT"
78 .IF "$(OS)$(CPUNAME)" == "SOLARISSPARC"
79 FREEBL_LIB=freebl_32fpu_3
80 .ELSE # "$(OS)$(CPUNAME)" == "SOLARISSPARC"
81 FREEBL_LIB=freebl3
82 .ENDIF # "$(OS)$(CPUNAME)" == "SOLARISSPARC"
83 .ENDIF # "$(GUI)" == "WNT"
86 BIN_RUNTIMELIST= \
87 nspr4 \
88 plc4 \
89 plds4 \
90 xpcom \
91 xpcom_core \
92 xpcom_compat \
93 nss3 \
94 ssl3 \
95 softokn3 \
96 smime3 \
97 $(FREEBL_LIB)
98 .ENDIF # "$(ENABLE_NSS_MODULE)"=="YES"
100 .IF "$(GUI)"=="WNT"
101 BIN_RUNTIMELIST+= \
102 js3250 \
103 mozz \
104 msgbsutl \
105 nsldap32v50 \
106 nsldappr32v50
107 .ELSE #"$(GUI)"=="WNT"
108 BIN_RUNTIMELIST+= \
109 mozjs \
110 mozz \
111 msgbaseutil \
112 ldap50 \
113 prldap50
114 .ENDIF
116 COMPONENT_RUNTIMELIST= \
117 addrbook \
118 mork \
119 mozldap \
120 necko \
121 profile \
122 xpcom_compat_c \
123 rdf \
124 uconv \
125 vcard \
126 i18n \
127 pipnss
129 .IF "$(GUI)"=="WNT"
130 COMPONENT_RUNTIMELIST+= \
131 xppref32 \
132 xpc3250
133 .ELSE #"$(GUI)"=="WNT"
134 COMPONENT_RUNTIMELIST+= \
135 pref \
136 xpconnect
137 .ENDIF
139 COMREGISTRY_FILELIST= \
140 necko_dns.xpt \
141 xpcom_base.xpt \
142 xpcom_obsolete.xpt \
143 xpcom_components.xpt \
144 xpcom_ds.xpt \
145 xpcom_io.xpt \
146 xpcom_xpti.xpt \
147 addrbook.xpt \
148 mozldap.xpt \
149 pref.xpt
151 .IF "$(GUI)"=="WNT"
152 COMREGISTRY_FILELIST+= xpcom_thread.xpt
153 .ELSE #"$(GUI)"=="WNT"
154 COMREGISTRY_FILELIST+= xpcom_threads.xpt
155 .ENDIF
157 DEFAULTS_RUNTIMELIST= \
158 defaults$/pref$/browser-prefs.js \
159 defaults$/pref$/mailnews.js \
160 defaults$/pref$/mdn.js \
161 defaults$/pref$/smime.js \
162 defaults$/autoconfig$/platform.js \
163 defaults$/autoconfig$/prefcalls.js \
164 greprefs$/all.js \
165 greprefs$/security-prefs.js
167 .IF "$(ENABLE_NSS_MODULE)"=="YES"
168 #These headers come from the separate NSS module if enabled
169 NSS_INCLUDE_LIST= nspr nss
171 .IF "$(GUI)"=="WNT"
172 .IF "$(COM)"=="GCC"
175 LIBLIST= \
176 libembed_base_s.a \
177 libmozreg_s.a \
178 libnslber32v50.a \
179 libnsldap32v50.a \
180 libxpcom_core.dll.a \
181 libxpcom.dll.a
183 .ELSE #"$(COM)"=="GCC"
185 LIBLIST= \
186 embed_base_s.lib \
187 mozreg_s.lib \
188 nslber32v50.lib \
189 nsldap32v50.lib \
190 xpcom_core.lib \
191 xpcom.lib
193 .ENDIF #"$(COM)"=="GCC"
195 .ELSE #"$(GUI)"=="WNT"
197 LIBLIST= \
198 libembed_base_s.a \
199 libmozreg_s.a \
200 liblber50.a \
201 libxpcom_core$(DLLPOST) \
202 libxpcom$(DLLPOST) \
203 libmsgbaseutil$(DLLPOST) \
204 libldap50$(DLLPOST) \
206 .ENDIF
208 .ELSE # .IF"$(ENABLE_NSS_MODULE)"=="YES"
210 .IF "$(GUI)"=="WNT"
211 .IF "$(COM)"=="GCC"
213 LIBLIST= \
214 libembed_base_s.a \
215 libmozreg_s.a \
216 libnslber32v50.a \
217 libnsldap32v50.a \
218 libnspr4.a \
219 libxpcom_core.dll.a \
220 libxpcom.dll.a \
221 libnss3.a \
222 libsmime3.a
224 .ELSE
226 LIBLIST= \
227 embed_base_s.lib \
228 mozreg_s.lib \
229 nslber32v50.lib \
230 nsldap32v50.lib \
231 nspr4.lib \
232 xpcom_core.lib \
233 xpcom.lib \
234 plc4.lib \
235 plds4.lib \
236 nss3.lib \
237 ssl3.lib \
238 smime3.lib
240 .ENDIF
242 .ELSE #"$(GUI)"=="WNT"
244 LIBLIST= \
245 libembed_base_s.a \
246 libmozreg_s.a \
247 liblber50.a \
248 libnspr4$(DLLPOST) \
249 libxpcom_core$(DLLPOST) \
250 libxpcom$(DLLPOST) \
251 libmsgbaseutil$(DLLPOST) \
252 libldap50$(DLLPOST) \
253 libsoftokn3$(DLLPOST) \
254 libplc4$(DLLPOST) \
255 libplds4$(DLLPOST) \
256 libnss3$(DLLPOST) \
257 libssl3$(DLLPOST) \
258 libsmime3$(DLLPOST)
260 .ENDIF
261 .ENDIF # .IF "$(ENABLE_NSS_MODULE)"=="YES"
263 INCLUDE_PATH=$(MOZ_DIST_DIR)$/include$/
264 PUBLIC_PATH=$(MOZ_DIST_DIR)$/public$/
267 .IF "$(GUI)"=="WNT"
268 REG_SUBFIX= .exe
269 .ELSE #"$(GUI)"=="WNT"
270 REG_SUBFIX=
271 .ENDIF
273 # --- Targets ------------------------------------------------------
275 extract_mozab_files: $(PACKAGE_DIR)$/$(PREDELIVER_FLAG_FILE) \
276 make_temp_dir \
277 $(MISC)$/build$/so_moz_runtime_files \
278 $(MISC)$/build$/so_moz_include_files \
279 $(MISC)$/build$/so_moz_lib_files
281 make_temp_dir:
282 @@-$(MKDIR) $(RUNTIME_DIR)
283 @@-$(MKDIR) $(RUNTIME_DIR)$/components
284 @@-$(MKDIR) $(RUNTIME_DIR)$/defaults
285 @@-$(MKDIR) $(RUNTIME_DIR)$/defaults$/pref
286 @@-$(MKDIR) $(LIB_DIR)
287 @@-$(MKDIR) $(INCLUDE_DIR)
288 .IF "$(OS)"=="SOLARIS"
289 @@-$(MKDIR) $(RUNTIME_DIR)$/res
290 .ENDIF
292 $(OUT)$/bin$/mozruntime.zip: $(PACKAGE_DIR)$/$(PREDELIVER_FLAG_FILE)
293 noop
295 $(MISC)$/build$/so_moz_runtime_files: $(OUT)$/bin$/mozruntime.zip
296 # copy files in BIN_RUNTIMELIST
297 $(foreach,file,$(BIN_RUNTIMELIST) $(COPY) $(MOZ_BIN_DIR)$/$(DLLPRE)$(file)$(DLLPOST) \
298 $(RUNTIME_DIR)$/$(DLLPRE)$(file)$(DLLPOST) &&) \
299 echo >& $(NULLDEV)
300 .IF "$(GUI)" == "UNX"
301 $(foreach,file,$(BIN_RUNTIMELIST) $(COPY) $(MOZ_BIN_DIR)$/$(DLLPRE)$(file)$(DLLPOST) \
302 $(LIB_DIR)$/$(DLLPRE)$(file)$(DLLPOST) &&) \
303 echo >& $(NULLDEV)
304 .IF "$(ENABLE_NSS_MODULE)" == "YES"
305 # We add the libraries from the separate nss module
306 $(foreach,file,$(NSS_MODULE_RUNTIME_LIST) $(COPY) $(SOLARLIBDIR)$/$(file:d:d)/$(DLLPRE)$(file:f)$(DLLPOST) \
307 $(RUNTIME_DIR)$/$(DLLPRE)$(file:f)$(DLLPOST) &&) \
308 echo >& $(NULLDEV)
309 .ENDIF
310 .ELSE # .IF "$(GUI)" == "UNX"
311 .IF "$(ENABLE_NSS_MODULE)" == "YES"
312 # We add the libraries from the separate nss module
313 $(foreach,file,$(NSS_MODULE_RUNTIME_LIST) $(COPY) $(SOLARBINDIR)$/$(DLLPRE)$(file)$(DLLPOST) \
314 $(RUNTIME_DIR)$/$(DLLPRE)$(file)$(DLLPOST) &&) \
315 echo >& $(NULLDEV)
316 .ENDIF
317 .ENDIF # .IF "$(GUI)" == "UNX"
320 # copy files in RES_FILELIST
321 .IF "$(OS)"=="SOLARIS"
322 @$(COPY) $(MOZ_BIN_DIR)$/res$/charsetalias.properties $(RUNTIME_DIR)$/res$/charsetalias.properties
323 .ELSE
324 @echo No Res Files to copy.
325 .ENDIF
327 # copy files in COMPONENT_RUNTIMELIST
328 $(foreach,file,$(COMPONENT_RUNTIMELIST) $(COPY) $(MOZ_BIN_DIR)$/components$/$(DLLPRE)$(file)$(DLLPOST) \
329 $(RUNTIME_DIR)$/components$/$(DLLPRE)$(file)$(DLLPOST) &&) \
330 echo >& $(NULLDEV)
332 # copy files in COMREGISTRY_FILELIST
333 $(foreach,file,$(COMREGISTRY_FILELIST) $(COPY) $(MOZ_BIN_DIR)$/components$/$(file) \
334 $(RUNTIME_DIR)$/components$/$(file) &&) \
335 echo >& $(NULLDEV)
337 # copy files in DEFAULTS_RUNTIMELIST
338 @@-$(MKDIR) $(RUNTIME_DIR)$/defaults$/pref
339 @@-$(MKDIR) $(RUNTIME_DIR)$/defaults$/autoconfig
340 @@-$(MKDIR) $(RUNTIME_DIR)$/greprefs
341 $(foreach,file,$(DEFAULTS_RUNTIMELIST) $(COPY) $(MOZ_BIN_DIR)$/$(file) $(RUNTIME_DIR)$/$(file) &&) \
342 echo >& $(NULLDEV)
344 .IF "$(GUI)"=="UNX"
345 .IF "$(OS)"!="MACOSX"
346 cd $(RUNTIME_DIR) && strip *$(DLLPOST)
347 cd $(RUNTIME_DIR)$/components && strip *$(DLLPOST)
348 .ENDIF
349 .ENDIF
350 .IF "$(OS)"=="MACOSX"
351 $(PERL) $(SOLARENV)$/bin$/macosx-change-install-names.pl extshl OOO \
352 $(RUNTIME_DIR)$/*$(DLLPOST)
353 # A crude hack to adapt all the install names in the components subdir:
354 $(foreach,file,$(shell ls $(RUNTIME_DIR)$/components$/*$(DLLPOST)) \
355 install_name_tool \
356 -change @executable_path/libldap50.dylib \
357 @loader_path/../libldap50.dylib \
358 -change @executable_path/libmozjs.dylib @loader_path/../libmozjs.dylib \
359 -change @executable_path/libmozz.dylib @loader_path/../libmozz.dylib \
360 -change @executable_path/libmsgbaseutil.dylib \
361 @loader_path/../libmsgbaseutil.dylib \
362 -change @executable_path/libnspr4.dylib @loader_path/../libnspr4.dylib \
363 -change @executable_path/libnss3.dylib @loader_path/../libnss3.dylib \
364 -change @executable_path/libplc4.dylib @loader_path/../libplc4.dylib \
365 -change @executable_path/libplds4.dylib @loader_path/../libplds4.dylib \
366 -change @executable_path/libprldap50.dylib \
367 @loader_path/../libprldap50.dylib \
368 -change @executable_path/libsmime3.dylib \
369 @loader_path/../libsmime3.dylib \
370 -change @executable_path/libsoftokn3.dylib \
371 @loader_path/../libsoftokn3.dylib \
372 -change @executable_path/libssl3.dylib @loader_path/../libssl3.dylib \
373 -change @executable_path/libxpcom.dylib @loader_path/../libxpcom.dylib \
374 -change @executable_path/libxpcom_compat.dylib \
375 @loader_path/../libxpcom_compat.dylib \
376 $(file) &&) true
377 .ENDIF
379 # zip runtime files to mozruntime.zip
380 cd $(RUNTIME_DIR) && zip -r ..$/..$/bin$/mozruntime.zip *
382 $(TOUCH) $@
384 $(INCCOM)$/nsBuildID.h: $(PACKAGE_DIR)$/$(PREDELIVER_FLAG_FILE)
385 @-echo "You can delete $(INCCOM) to force it copy all include files again."
388 $(MISC)$/build$/so_moz_include_files: $(INCCOM)$/nsBuildID.h
389 .IF "$(OS)"!="SOLARIS"
390 $(GNUCOPY) -pRL $(INCLUDE_PATH)* $(INCLUDE_DIR)
391 $(GNUCOPY) -pRL $(PUBLIC_PATH)* $(INCLUDE_DIR)
392 .ELSE # "$(OS)"!="SOLARIS"
393 $(COPY) -pr $(INCLUDE_PATH)* $(INCLUDE_DIR)
394 $(COPY) -pr $(PUBLIC_PATH)* $(INCLUDE_DIR)
395 .ENDIF # "$(OS)"!="SOLARIS"
397 .IF "$(GUI)"=="UNX"
398 chmod -R 775 $(INCCOM)
399 .ENDIF
400 $(TOUCH) $@
401 .IF "$(ENABLE_NSS_MODULE)"=="YES"
402 +$(foreach,dir,$(NSS_INCLUDE_LIST) $(RENAME:s/+//) $(INCLUDE_DIR)$/$(dir) $(INCLUDE_DIR)$/$(dir)_remove_me &&) echo >& $(NULLDEV)
403 $(foreach,dir,$(NSS_INCLUDE_LIST) rm -rf $(INCLUDE_DIR)$/$(dir)_remove_me &&) echo >& $(NULLDEV)
404 -$(MKDIR) $(OUT)$/inc.nss
405 cd $(OUT)$/inc.nss && $(foreach,dir,$(NSS_INCLUDE_LIST) $(GNUCOPY) -pRL $(SOLARINCDIR)$/mozilla/$(dir) . &&) echo >& $(NULLDEV)
406 .ENDIF
408 # On UNX the rules for so_moz_runtime_files copy files into the same directory
409 # used here (LIB_DIR), and on MACOSX all those files together need to be
410 # processed here, hence the dependency on so_moz_runtime_files:
411 $(MISC)$/build$/so_moz_lib_files: $(foreach,file,$(LIBLIST) $(LIB_DIR)$/$(file)) $(MISC)$/build$/so_moz_runtime_files
412 echo $(foreach,file,$(LIBLIST) $(MOZ_DIST_DIR)$/lib$/$(file))
413 $(foreach,file,$(LIBLIST) $(COPY) $(MOZ_DIST_DIR)$/lib$/$(file) \
414 $(LIB_DIR)$/$(file) &&) \
415 echo >& $(NULLDEV)
416 .IF "$(OS)"=="MACOSX"
417 $(PERL) $(SOLARENV)$/bin$/macosx-change-install-names.pl extshl OOO \
418 $(LIB_DIR)$/*$(DLLPOST)
419 .ENDIF
420 .IF "$(GUI)"=="UNX"
421 chmod -R 775 $(LB)
422 .ENDIF
423 $(TOUCH) $@
425 $(BIN_RUNTIMELIST): $(PACKAGE_DIR)$/$(PREDELIVER_FLAG_FILE)
426 @$(COPY) $(MOZ_BIN_DIR)$/$(DLLPRE)$@$(DLLPOST) $(RUNTIME_DIR)$/$(DLLPRE)$@$(DLLPOST)
428 $(COMPONENT_RUNTIMELIST): $(PACKAGE_DIR)$/$(PREDELIVER_FLAG_FILE)
429 @$(COPY) $(MOZ_BIN_DIR)$/components$/$(DLLPRE)$@$(DLLPOST) $(RUNTIME_DIR)$/components$/$(DLLPRE)$@$(DLLPOST)
431 $(COMREGISTRY_FILELIST): $(PACKAGE_DIR)$/$(PREDELIVER_FLAG_FILE)
432 @$(COPY) $(MOZ_BIN_DIR)$/components$/$@ $(RUNTIME_DIR)$/components$/$@
434 $(DEFAULTS_RUNTIMELIST): $(PACKAGE_DIR)$/$(PREDELIVER_FLAG_FILE)
435 @$(COPY) $(MOZ_BIN_DIR)$/$@ $(RUNTIME_DIR)$/$@
437 RES_FILELIST: $(PACKAGE_DIR)$/$(PREDELIVER_FLAG_FILE)
438 .IF "$(OS)"=="SOLARIS"
439 @$(COPY) $(MOZ_BIN_DIR)$/res$/charsetalias.properties $(RUNTIME_DIR)$/res$/charsetalias.properties
440 .ELSE
441 @echo No Res Files to copy.
442 .ENDIF
444 $(LIB_DIR)$/%: $(PACKAGE_DIR)$/$(PREDELIVER_FLAG_FILE)
445 noop
447 $(MISC)$/CREATETARBALL: extract_mozab_files
448 @@-$(MKDIR) $(OUT)$/zipped
449 $(COPY) $(BIN)$/mozruntime.zip $(OUT)$/zipped$/$(MOZTARGET)runtime.zip
450 .IF "$(GUI)"=="UNX"
451 .IF "$(OS)"!="MACOSX"
452 cd $(LB) && strip *$(DLLPOST)
453 .ENDIF
454 .ENDIF
455 cd $(LB) && zip -r ..$/zipped$/$(MOZTARGET)lib.zip *
456 cd $(INCCOM) && zip -r ..$/zipped$/$(MOZTARGET)inc.zip *
457 .IF "$(ENABLE_NSS_MODULE)"=="YES"
458 cd $(OUT)$/inc.nss && zip -r ..$/zipped$/$(MOZTARGET)inc.zip *
459 .ENDIF