default to -r on gbuild for performance (assumed esp. on make 3.82)
[LibreOffice.git] / RepositoryExternal.mk
blobd69b677a38375a3491fad58af378302f919ff28b
1 # -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
2 #*************************************************************************
4 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 #
6 # Copyright 2009 by Sun Microsystems, Inc.
8 # OpenOffice.org - a multi-platform office productivity suite
10 # This file is part of OpenOffice.org.
12 # OpenOffice.org is free software: you can redistribute it and/or modify
13 # it under the terms of the GNU Lesser General Public License version 3
14 # only, as published by the Free Software Foundation.
16 # OpenOffice.org is distributed in the hope that it will be useful,
17 # but WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 # GNU Lesser General Public License version 3 for more details
20 # (a copy is included in the LICENSE file that accompanied this code).
22 # You should have received a copy of the GNU Lesser General Public License
23 # version 3 along with OpenOffice.org. If not, see
24 # <http://www.openoffice.org/license.html>
25 # for a copy of the LGPLv3 License.
27 #*************************************************************************
29 # this file describes all the external libraries
30 # depending on the configure options these may be taken from the system,
31 # or the internal/bundled copy may be built.
33 # for every external, a function gb_LinkTarget_use__FOO is defined,
34 # once for the system case, once for the internal case.
36 # in the system case, no libraries should be registered, but the target-local
37 # variable LIBS should be set to FOO_LIBS, and INCLUDES to FOO_CFLAGS.
39 ifeq ($(SYSTEM_MESA_HEADERS),YES)
41 gb_LinkTarget__use_Mesa:=
43 else
45 define gb_LinkTarget__use_Mesa
46 $(eval $(call gb_LinkTarget_add_external_headers,$(1),Mesa_inc))
47 endef
49 endif
51 ifeq ($(SYSTEM_CPPUNIT),YES)
53 define gb_LinkTarget__use_cppunit
54 $(call gb_LinkTarget_set_include,$(1),\
55 $$(INCLUDE) \
56 $(CPPUNIT_CFLAGS) \
59 $(call gb_LinkTarget_add_libs,$(1),\
60 $(CPPUNIT_LIBS) \
63 endef
65 else
67 $(eval $(call gb_Helper_register_libraries,PLAINLIBS_OOO,\
68 cppunit \
71 define gb_LinkTarget__use_cppunit
72 $(call gb_LinkTarget_add_linked_libs,$(1),\
73 cppunit \
76 endef
78 endif
80 ifeq ($(SYSTEM_ZLIB),YES)
82 define gb_LinkTarget__use_zlib
83 $(call gb_LinkTarget_add_defs,$(1),\
84 -DSYSTEM_ZLIB \
86 $(call gb_LinkTarget_add_libs,$(1),-lz)
88 endef
90 else # !SYSTEM_ZLIB
92 $(eval $(call gb_Helper_register_static_libraries,PLAINLIBS, \
93 zlib \
96 define gb_LinkTarget__use_zlib
97 $(call gb_LinkTarget_add_linked_static_libs,$(1),\
98 zlib \
101 endef
103 endif # SYSTEM_ZLIB
106 ifeq ($(SYSTEM_JPEG),YES)
108 define gb_LinkTarget__use_jpeg
109 $(call gb_LinkTarget_add_libs,$(1),-ljpeg)
110 $(call gb_LinkTarget_set_ldflags,$(1),\
111 $$(filter-out -L/usr/lib/jvm%,$$(T_LDFLAGS)) \
114 endef
116 else # !SYSTEM_JPEG
118 $(eval $(call gb_Helper_register_static_libraries,PLAINLIBS, \
119 jpeglib \
122 define gb_LinkTarget__use_jpeg
123 $(call gb_LinkTarget_add_linked_static_libs,$(1),\
124 jpeglib \
127 endef
129 endif # SYSTEM_JPEG
132 ifeq ($(SYSTEM_EXPAT),YES)
134 define gb_LinkTarget__use_expat
135 $(if $(2),,$(error gb_LinkTarget__use_expat needs additional parameter))
137 $(call gb_LinkTarget_add_defs,$(1),\
138 -DSYSTEM_EXPAT \
141 $(call gb_LinkTarget_add_libs,$(1),-lexpat)
143 endef
145 else # !SYSTEM_EXPAT
147 $(eval $(call gb_Helper_register_static_libraries,PLAINLIBS, \
148 ascii_expat_xmlparse \
149 expat_xmlparse \
150 expat_xmltok \
153 define gb_LinkTarget__use_expat
154 $(if $(2),,$(error gb_LinkTarget__use_expat needs additional parameter))
156 $(if $(filter-out ascii_expat_xmlparse,$(2)),\
157 $(call gb_LinkTarget_add_defs,$(1),\
158 -DXML_UNICODE \
161 $(call gb_LinkTarget_add_linked_static_libs,$(1),\
162 $(2) \
163 expat_xmltok \
166 endef
168 endif # SYSTEM_EXPAT
170 # now define 2 wrappers that select which internal static library to use...
171 define gb_LinkTarget__use_expat_utf8
172 $(call gb_LinkTarget__use_expat,$(1),ascii_expat_xmlparse)
174 endef
176 define gb_LinkTarget__use_expat_utf16
177 $(call gb_LinkTarget__use_expat,$(1),expat_xmlparse)
179 endef
182 ifeq ($(SYSTEM_LIBXML),YES)
184 define gb_LinkTarget__use_libxml2
185 $(call gb_LinkTarget_add_defs,$(1),\
186 -DSYSTEM_LIBXML \
188 $(call gb_LinkTarget_set_include,$(1),\
189 $$(INCLUDE) \
190 $(LIBXML_CFLAGS) \
192 $(call gb_LinkTarget_add_libs,$(1),$(LIBXML_LIBS))
194 endef
196 else # !SYSTEM_LIBXML
198 $(eval $(call gb_Helper_register_libraries,PLAINLIBS_URE, \
199 xml2 \
202 define gb_LinkTarget__use_libxml2
203 $(call gb_LinkTarget_add_linked_libs,$(1),\
204 xml2 \
207 endef
209 endif # SYSTEM_LIBXML
212 ifeq ($(SYSTEM_LIBXSLT),YES)
214 define gb_LinkTarget__use_libxslt
215 $(call gb_LinkTarget_set_include,$(1),\
216 $$(INCLUDE) \
217 $(LIBXSLT_CFLAGS) \
219 $(call gb_LinkTarget_add_libs,$(1),$(LIBXSLT_LIBS))
221 endef
223 else # !SYSTEM_LIBXSLT
225 $(eval $(call gb_Helper_register_libraries,PLAINLIBS_OOO, \
226 xslt \
229 define gb_LinkTarget__use_libxslt
230 $(call gb_LinkTarget_add_linked_libs,$(1),\
231 xslt \
234 endef
236 endif # SYSTEM_LIBXSLT
239 ifeq ($(SYSTEM_REDLAND),YES)
241 define gb_LinkTarget__use_librdf
242 $(call gb_LinkTarget_add_defs,$(1),\
243 -DSYSTEM_REDLAND \
245 $(call gb_LinkTarget_set_include,$(1),\
246 $$(INCLUDE) \
247 $(REDLAND_CFLAGS) \
249 $(call gb_LinkTarget_add_libs,$(1),$(REDLAND_LIBS))
251 endef
253 else # !SYSTEM_REDLAND
255 $(eval $(call gb_Helper_register_libraries,PLAINLIBS_OOO, \
256 rdf \
259 define gb_LinkTarget__use_librdf
260 $(call gb_LinkTarget_add_linked_libs,$(1),\
261 rdf \
264 endef
266 endif # SYSTEM_REDLAND
269 ifeq ($(SYSTEM_CAIRO),YES)
271 # FREETYPE_CLAGS from environment if ENABLE_CAIRO is used
272 define gb_LinkTarget__use_cairo
273 $(call gb_LinkTarget_set_include,$(1),\
274 $$(INCLUDE) \
275 $(FREETYPE_CFLAGS) \
276 $(CAIRO_CFLAGS) \
278 $(call gb_LinkTarget_add_libs,$(1),$(CAIRO_LIBS))
280 endef
282 else # !SYSTEM_CAIRO
284 $(eval $(call gb_Helper_register_libraries,PLAINLIBS_OOO, \
285 cairo \
287 ifneq ($(OS),WNT)
288 $(eval $(call gb_Helper_register_libraries,PLAINLIBS_OOO, \
289 pixman-1 \
291 endif # WNT
293 define gb_LinkTarget__use_cairo
294 $(call gb_LinkTarget_set_include,$(1),\
295 $$(INCLUDE) \
296 -I$(OUTDIR)/inc/cairo \
297 $(FREETYPE_CFLAGS) \
299 $(call gb_LinkTarget_add_linked_libs,$(1),\
300 cairo \
302 ifneq ($(OS),WNT)
303 ifeq ($(OS),MACOSX)
304 $(call gb_LinkTarget_add_static_libs,$(1),\
305 pixman-1 \
307 else
308 $(call gb_LinkTarget_add_linked_libs,$(1),\
309 pixman-1 \
311 endif
312 endif
314 endef
316 endif # SYSTEM_CAIRO
318 define gb_LinkTarget__use_freetype
319 $(call gb_LinkTarget_set_include,$(1),\
320 $$(INCLUDE) \
321 $(FREETYPE_CFLAGS) \
323 $(call gb_LinkTarget_add_libs,$(1),$(FREETYPE_LIBS))
325 endef
327 define gb_LinkTarget__use_fontconfig
328 $(call gb_LinkTarget_set_include,$(1),\
329 $$(INCLUDE) \
330 $(FONTCONFIG_CFLAGS) \
332 $(call gb_LinkTarget_add_libs,$(1),$(FONTCONFIG_LIBS))
334 endef
336 ifeq ($(SYSTEM_GRAPHITE),YES)
338 define gb_LinkTarget__use_graphite
339 $(call gb_LinkTarget_set_include,$(1),\
340 $$(INCLUDE) \
341 $(GRAPHITE_CFLAGS) \
343 $(call gb_LinkTarget_add_libs,$(1),$(GRAPHITE_LIBS))
345 endef
347 else # !SYSTEM_GRAPHITE
349 $(eval $(call gb_Helper_register_static_libraries,PLAINLIBS, \
350 graphite2_off \
352 define gb_LinkTarget__use_graphite
353 $(call gb_LinkTarget_add_linked_static_libs,$(1),\
354 graphite2_off \
357 endef
359 endif # SYSTEM_GRAPHITE
362 ifeq ($(SYSTEM_ICU),YES)
364 define gb_LinkTarget__use_icudata
365 $(call gb_LinkTarget_add_libs,$(1),-licudata)
367 endef
368 define gb_LinkTarget__use_icui18n
369 $(call gb_LinkTarget_add_libs,$(1),-licui18n)
371 endef
372 define gb_LinkTarget__use_icule
373 $(call gb_LinkTarget_add_libs,$(1),-licule)
375 endef
376 define gb_LinkTarget__use_icutu
377 $(call gb_LinkTarget_add_libs,$(1),-licutu)
379 endef
380 define gb_LinkTarget__use_icuuc
381 $(call gb_LinkTarget_add_libs,$(1),-licuuc)
383 endef
385 else # !SYSTEM_ICU
387 # icudata and icui18n is called icudt and icuin when built with MSVC :-(
388 ifeq ($(OS)$(COM),WNTMSC)
389 $(eval $(call gb_Helper_register_libraries,PLAINLIBS_OOO, \
390 icudt \
391 icuin \
392 icule \
393 icutu \
394 icuuc \
397 define gb_LinkTarget__use_icudt
398 $(call gb_LinkTarget_add_linked_libs,$(1),\
399 icudt \
402 endef
403 define gb_LinkTarget__use_icuin
404 $(call gb_LinkTarget_add_linked_libs,$(1),\
405 icuin \
408 endef
409 else
410 $(eval $(call gb_Helper_register_libraries,PLAINLIBS_OOO, \
411 icudata \
412 icui18n \
413 icule \
414 icutu \
415 icuuc \
418 define gb_LinkTarget__use_icudata
419 $(call gb_LinkTarget_add_linked_libs,$(1),\
420 icudata \
423 endef
424 define gb_LinkTarget__use_icui18n
425 $(call gb_LinkTarget_add_linked_libs,$(1),\
426 icui18n \
429 endef
430 endif
432 define gb_LinkTarget__use_icule
433 $(call gb_LinkTarget_add_linked_libs,$(1),\
434 icule \
437 endef
438 define gb_LinkTarget__use_icutu
439 $(call gb_LinkTarget_add_linked_libs,$(1),\
440 icutu \
443 endef
444 define gb_LinkTarget__use_icuuc
445 $(call gb_LinkTarget_add_linked_libs,$(1),\
446 icuuc \
449 endef
451 endif # SYSTEM_ICU
454 ifeq ($(SYSTEM_OPENSSL),YES)
456 define gb_LinkTarget__use_openssl
457 $(call gb_LinkTarget_set_include,$(1),\
458 $$(INCLUDE) \
459 $(OPENSSL_CFLAGS) \
461 $(call gb_LinkTarget_add_libs,$(1),$(OPENSSL_LIBS))
463 endef
465 else # !SYSTEM_OPENSSL
467 ifeq ($(OS),WNT)
468 $(eval $(call gb_Helper_register_libraries,PLAINLIBS_OOO, \
469 crypto \
470 ssl \
472 else
473 $(eval $(call gb_Helper_register_static_libraries,PLAINLIBS, \
474 crypto \
475 ssl \
477 endif
479 define gb_LinkTarget__use_openssl
480 ifeq ($(OS),WNT)
481 $(call gb_LinkTarget_add_linked_libs,$(1),\
482 crypto \
483 ssl \
485 else
486 $(call gb_LinkTarget_add_linked_static_libs,$(1),\
487 crypto \
488 ssl \
490 ifeq ($(OS),SOLARIS)
491 $(call gb_LinkTarget_add_libs,$(1),\
492 -lnsl \
493 -lsocket \
495 endif
496 endif
498 endef
500 endif # SYSTEM_OPENSSL
503 ifeq ($(SYSTEM_LIBVISIO),YES)
505 define gb_LinkTarget__use_visio
506 $(call gb_LinkTarget_set_include,$(1),\
507 $$(INCLUDE) \
508 $(LIBVISIO_CFLAGS) \
510 $(call gb_LinkTarget_add_libs,$(1),$(LIBVISIO_LIBS))
512 endef
514 else # !SYSTEM_LIBVISIO
516 $(eval $(call gb_Helper_register_static_libraries,PLAINLIBS, \
517 visiolib \
520 define gb_LinkTarget__use_visio
521 $(call gb_LinkTarget_add_linked_static_libs,$(1),\
522 visiolib \
525 endef
527 endif # SYSTEM_LIBVISIO
530 ifeq ($(SYSTEM_LIBWPD),YES)
532 define gb_LinkTarget__use_wpd
533 $(call gb_LinkTarget_set_include,$(1),\
534 $$(INCLUDE) \
535 $(LIBWPD_CFLAGS) \
537 $(call gb_LinkTarget_add_libs,$(1),$(LIBWPD_LIBS))
539 endef
541 else # !SYSTEM_LIBWPD
543 $(eval $(call gb_Helper_register_static_libraries,PLAINLIBS, \
544 wpdlib \
547 define gb_LinkTarget__use_wpd
548 $(call gb_LinkTarget_add_linked_static_libs,$(1),\
549 wpdlib \
552 endef
554 endif # SYSTEM_LIBWPD
557 ifeq ($(SYSTEM_LIBWPG),YES)
559 define gb_LinkTarget__use_wpg
560 $(call gb_LinkTarget_set_include,$(1),\
561 $$(INCLUDE) \
562 $(LIBWPG_CFLAGS) \
564 $(call gb_LinkTarget_add_libs,$(1),$(LIBWPG_LIBS))
566 endef
568 else # !SYSTEM_LIBWPG
570 $(eval $(call gb_Helper_register_static_libraries,PLAINLIBS, \
571 wpglib \
574 define gb_LinkTarget__use_wpg
575 $(call gb_LinkTarget_add_linked_static_libs,$(1),\
576 wpglib \
579 endef
581 endif # SYSTEM_LIBWPG
584 ifeq ($(SYSTEM_LIBWPS),YES)
586 define gb_LinkTarget__use_wps
587 $(call gb_LinkTarget_set_include,$(1),\
588 $$(INCLUDE) \
589 $(LIBWPS_CFLAGS) \
591 $(call gb_LinkTarget_add_libs,$(1),$(LIBWPS_LIBS))
593 endef
595 else # !SYSTEM_LIBWPS
597 $(eval $(call gb_Helper_register_static_libraries,PLAINLIBS, \
598 wpslib \
601 define gb_LinkTarget__use_wps
602 $(call gb_LinkTarget_add_linked_static_libs,$(1),\
603 wpslib \
606 endef
608 endif # SYSTEM_LIBWPS
611 ifeq ($(SYSTEM_LPSOLVE),YES)
613 define gb_LinkTarget__use_lpsolve55
614 $(call gb_LinkTarget_add_libs,$(1),-llpsolve55)
616 endef
618 else # !SYSTEM_LPSOLVE
620 $(eval $(call gb_Helper_register_libraries,PLAINLIBS_OOO, \
621 lpsolve55 \
624 define gb_LinkTarget__use_lpsolve55
625 $(call gb_LinkTarget_add_linked_libs,$(1),\
626 lpsolve55 \
629 endef
631 endif # SYSTEM_LPSOLVE
634 define gb_LinkTarget__use_gtk
635 $(call gb_LinkTarget_set_include,$(1),\
636 $$(INCLUDE) \
637 $(GTK_CFLAGS) \
640 $(call gb_LinkTarget_add_libs,$(1),$(GTK_LIBS))
642 endef
644 define gb_LinkTarget__use_gthread
645 $(call gb_LinkTarget_add_libs,$(1),$(GTHREAD_LIBS))
647 endef
649 define gb_LinkTarget__use_dbusmenugtk
650 $(call gb_LinkTarget_set_include,$(1),\
651 $$(INCLUDE) \
652 $(DBUSMENUGTK_CFLAGS) \
655 $(call gb_LinkTarget_add_libs,$(1),$(DBUSMENUGTK_LIBS))
657 endef
659 # MacOSX-only frameworks
660 # (in alphabetical order)
662 define gb_LinkTarget__use_carbon
663 $(call gb_LinkTarget_add_libs,$(1), \
664 -framework Carbon \
667 endef
669 define gb_LinkTarget__use_cocoa
670 $(call gb_LinkTarget_add_libs,$(1), \
671 -framework Cocoa \
674 endef
676 define gb_LinkTarget__use_qtkit
677 $(call gb_LinkTarget_add_libs,$(1), \
678 -framework QTKit \
681 endef
683 define gb_LinkTarget__use_quicktime
684 $(call gb_LinkTarget_add_libs,$(1), \
685 -framework QuickTime \
688 endef
690 # Common MacOSX and iOS frameworks
692 define gb_LinkTarget__use_corefoundation
693 $(call gb_LinkTarget_add_libs,$(1), \
694 -framework CoreFoundation \
697 endef
699 define gb_LinkTarget__use_coregraphics
700 $(call gb_Library_add_libs,$(1), \
701 -framework CoreGraphics \
704 endef
706 define gb_LinkTarget__use_coretext
707 $(call gb_Library_add_libs,$(1), \
708 -framework CoreText \
711 endef
713 define gb_LinkTarget__use_foundation
714 $(call gb_LinkTarget_add_libs,$(1), \
715 -framework Foundation \
718 endef
720 # iOS-only frameworks
722 define gb_LinkTarget__use_uikit
723 $(call gb_LinkTarget_add_libs,$(1), \
724 -framework UIKit \
727 endef
729 ifeq ($(SYSTEM_MOZILLA),YES)
731 define gb_LinkTarget__use_plc4
732 $(call gb_LinkTarget_set_include,$(1),\
733 $$(INCLUDE) \
734 $(MOZ_NSS_CFLAGS) \
737 $(call gb_LinkTarget_add_libs,$(1),\
738 $(MOZ_NSS_LIBS) \
741 endef
743 else
745 $(eval $(call gb_Helper_register_libraries,PLAINLIBS_OOO,\
746 nspr4 \
747 nss3 \
748 plc4 \
751 define gb_LinkTarget__use_plc4
752 $(call gb_LinkTarget_add_linked_libs,$(1),\
753 plc4 \
756 endef
758 endif
760 # vim: set noet sw=4 ts=4: