1 # -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
2 #*************************************************************************
4 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
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
:=
45 define gb_LinkTarget__use_Mesa
46 $(eval
$(call gb_LinkTarget_add_external_headers
,$(1),Mesa_inc
))
51 ifeq ($(SYSTEM_CPPUNIT
),YES
)
53 define gb_LinkTarget__use_cppunit
54 $(call gb_LinkTarget_set_include
,$(1),\
59 $(call gb_LinkTarget_add_libs
,$(1),\
67 $(eval
$(call gb_Helper_register_libraries
,PLAINLIBS_OOO
,\
71 define gb_LinkTarget__use_cppunit
72 $(call gb_LinkTarget_add_linked_libs
,$(1),\
80 ifeq ($(SYSTEM_ZLIB
),YES
)
82 define gb_LinkTarget__use_zlib
83 $(call gb_LinkTarget_add_defs
,$(1),\
86 $(call gb_LinkTarget_add_libs
,$(1),-lz
)
92 $(eval
$(call gb_Helper_register_static_libraries
,PLAINLIBS
, \
96 define gb_LinkTarget__use_zlib
97 $(call gb_LinkTarget_add_linked_static_libs
,$(1),\
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
)) \
118 $(eval
$(call gb_Helper_register_static_libraries
,PLAINLIBS
, \
122 define gb_LinkTarget__use_jpeg
123 $(call gb_LinkTarget_add_linked_static_libs
,$(1),\
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),\
141 $(call gb_LinkTarget_add_libs
,$(1),-lexpat
)
147 $(eval
$(call gb_Helper_register_static_libraries
,PLAINLIBS
, \
148 ascii_expat_xmlparse \
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),\
161 $(call gb_LinkTarget_add_linked_static_libs
,$(1),\
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
)
176 define gb_LinkTarget__use_expat_utf16
177 $(call gb_LinkTarget__use_expat
,$(1),expat_xmlparse
)
182 ifeq ($(SYSTEM_LIBXML
),YES
)
184 define gb_LinkTarget__use_libxml2
185 $(call gb_LinkTarget_add_defs
,$(1),\
188 $(call gb_LinkTarget_set_include
,$(1),\
192 $(call gb_LinkTarget_add_libs
,$(1),$(LIBXML_LIBS
))
196 else # !SYSTEM_LIBXML
198 $(eval
$(call gb_Helper_register_libraries
,PLAINLIBS_URE
, \
202 define gb_LinkTarget__use_libxml2
203 $(call gb_LinkTarget_add_linked_libs
,$(1),\
209 endif # SYSTEM_LIBXML
212 ifeq ($(SYSTEM_LIBXSLT
),YES
)
214 define gb_LinkTarget__use_libxslt
215 $(call gb_LinkTarget_set_include
,$(1),\
219 $(call gb_LinkTarget_add_libs
,$(1),$(LIBXSLT_LIBS
))
223 else # !SYSTEM_LIBXSLT
225 $(eval
$(call gb_Helper_register_libraries
,PLAINLIBS_OOO
, \
229 define gb_LinkTarget__use_libxslt
230 $(call gb_LinkTarget_add_linked_libs
,$(1),\
236 endif # SYSTEM_LIBXSLT
239 ifeq ($(SYSTEM_REDLAND
),YES
)
241 define gb_LinkTarget__use_librdf
242 $(call gb_LinkTarget_add_defs
,$(1),\
245 $(call gb_LinkTarget_set_include
,$(1),\
249 $(call gb_LinkTarget_add_libs
,$(1),$(REDLAND_LIBS
))
253 else # !SYSTEM_REDLAND
255 $(eval
$(call gb_Helper_register_libraries
,PLAINLIBS_OOO
, \
259 define gb_LinkTarget__use_librdf
260 $(call gb_LinkTarget_add_linked_libs
,$(1),\
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),\
278 $(call gb_LinkTarget_add_libs
,$(1),$(CAIRO_LIBS
))
284 $(eval
$(call gb_Helper_register_libraries
,PLAINLIBS_OOO
, \
288 $(eval
$(call gb_Helper_register_libraries
,PLAINLIBS_OOO
, \
293 define gb_LinkTarget__use_cairo
294 $(call gb_LinkTarget_set_include
,$(1),\
296 -I
$(OUTDIR
)/inc
/cairo \
299 $(call gb_LinkTarget_add_linked_libs
,$(1),\
304 $(call gb_LinkTarget_add_static_libs
,$(1),\
308 $(call gb_LinkTarget_add_linked_libs
,$(1),\
318 define gb_LinkTarget__use_freetype
319 $(call gb_LinkTarget_set_include
,$(1),\
323 $(call gb_LinkTarget_add_libs
,$(1),$(FREETYPE_LIBS
))
327 define gb_LinkTarget__use_fontconfig
328 $(call gb_LinkTarget_set_include
,$(1),\
330 $(FONTCONFIG_CFLAGS
) \
332 $(call gb_LinkTarget_add_libs
,$(1),$(FONTCONFIG_LIBS
))
336 ifeq ($(SYSTEM_GRAPHITE
),YES
)
338 define gb_LinkTarget__use_graphite
339 $(call gb_LinkTarget_set_include
,$(1),\
343 $(call gb_LinkTarget_add_libs
,$(1),$(GRAPHITE_LIBS
))
347 else # !SYSTEM_GRAPHITE
349 $(eval
$(call gb_Helper_register_static_libraries
,PLAINLIBS
, \
352 define gb_LinkTarget__use_graphite
353 $(call gb_LinkTarget_add_linked_static_libs
,$(1),\
359 endif # SYSTEM_GRAPHITE
362 ifeq ($(SYSTEM_ICU
),YES
)
364 define gb_LinkTarget__use_icudata
365 $(call gb_LinkTarget_add_libs
,$(1),-licudata
)
368 define gb_LinkTarget__use_icui18n
369 $(call gb_LinkTarget_add_libs
,$(1),-licui18n
)
372 define gb_LinkTarget__use_icule
373 $(call gb_LinkTarget_add_libs
,$(1),-licule
)
376 define gb_LinkTarget__use_icutu
377 $(call gb_LinkTarget_add_libs
,$(1),-licutu
)
380 define gb_LinkTarget__use_icuuc
381 $(call gb_LinkTarget_add_libs
,$(1),-licuuc
)
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
, \
397 define gb_LinkTarget__use_icudt
398 $(call gb_LinkTarget_add_linked_libs
,$(1),\
403 define gb_LinkTarget__use_icuin
404 $(call gb_LinkTarget_add_linked_libs
,$(1),\
410 $(eval
$(call gb_Helper_register_libraries
,PLAINLIBS_OOO
, \
418 define gb_LinkTarget__use_icudata
419 $(call gb_LinkTarget_add_linked_libs
,$(1),\
424 define gb_LinkTarget__use_icui18n
425 $(call gb_LinkTarget_add_linked_libs
,$(1),\
432 define gb_LinkTarget__use_icule
433 $(call gb_LinkTarget_add_linked_libs
,$(1),\
438 define gb_LinkTarget__use_icutu
439 $(call gb_LinkTarget_add_linked_libs
,$(1),\
444 define gb_LinkTarget__use_icuuc
445 $(call gb_LinkTarget_add_linked_libs
,$(1),\
454 ifeq ($(SYSTEM_OPENSSL
),YES
)
456 define gb_LinkTarget__use_openssl
457 $(call gb_LinkTarget_set_include
,$(1),\
461 $(call gb_LinkTarget_add_libs
,$(1),$(OPENSSL_LIBS
))
465 else # !SYSTEM_OPENSSL
468 $(eval
$(call gb_Helper_register_libraries
,PLAINLIBS_OOO
, \
473 $(eval
$(call gb_Helper_register_static_libraries
,PLAINLIBS
, \
479 define gb_LinkTarget__use_openssl
481 $(call gb_LinkTarget_add_linked_libs
,$(1),\
486 $(call gb_LinkTarget_add_linked_static_libs
,$(1),\
491 $(call gb_LinkTarget_add_libs
,$(1),\
500 endif # SYSTEM_OPENSSL
503 ifeq ($(SYSTEM_LIBVISIO
),YES
)
505 define gb_LinkTarget__use_visio
506 $(call gb_LinkTarget_set_include
,$(1),\
510 $(call gb_LinkTarget_add_libs
,$(1),$(VISIO_LIBS
))
514 else # !SYSTEM_LIBVISIO
516 $(eval
$(call gb_Helper_register_static_libraries
,PLAINLIBS
, \
520 define gb_LinkTarget__use_visio
521 $(call gb_LinkTarget_add_linked_static_libs
,$(1),\
527 endif # SYSTEM_LIBVISIO
530 ifeq ($(SYSTEM_LIBWPD
),YES
)
532 define gb_LinkTarget__use_wpd
533 $(call gb_LinkTarget_set_include
,$(1),\
537 $(call gb_LinkTarget_add_libs
,$(1),$(WPD_LIBS
))
541 else # !SYSTEM_LIBWPD
543 $(eval
$(call gb_Helper_register_static_libraries
,PLAINLIBS
, \
547 define gb_LinkTarget__use_wpd
548 $(call gb_LinkTarget_add_linked_static_libs
,$(1),\
554 endif # SYSTEM_LIBWPD
557 ifeq ($(SYSTEM_LIBWPG
),YES
)
559 define gb_LinkTarget__use_wpg
560 $(call gb_LinkTarget_set_include
,$(1),\
564 $(call gb_LinkTarget_add_libs
,$(1),$(WPG_LIBS
))
568 else # !SYSTEM_LIBWPG
570 $(eval
$(call gb_Helper_register_static_libraries
,PLAINLIBS
, \
574 define gb_LinkTarget__use_wpg
575 $(call gb_LinkTarget_add_linked_static_libs
,$(1),\
581 endif # SYSTEM_LIBWPG
584 ifeq ($(SYSTEM_LIBWPS
),YES
)
586 define gb_LinkTarget__use_wps
587 $(call gb_LinkTarget_set_include
,$(1),\
591 $(call gb_LinkTarget_add_libs
,$(1),$(WPS_LIBS
))
595 else # !SYSTEM_LIBWPS
597 $(eval
$(call gb_Helper_register_static_libraries
,PLAINLIBS
, \
601 define gb_LinkTarget__use_wps
602 $(call gb_LinkTarget_add_linked_static_libs
,$(1),\
608 endif # SYSTEM_LIBWPS
611 ifeq ($(SYSTEM_LPSOLVE
),YES
)
613 define gb_LinkTarget__use_lpsolve55
614 $(call gb_LinkTarget_add_libs
,$(1),-llpsolve55
)
618 else # !SYSTEM_LPSOLVE
620 $(eval
$(call gb_Helper_register_libraries
,PLAINLIBS_OOO
, \
624 define gb_LinkTarget__use_lpsolve55
625 $(call gb_LinkTarget_add_linked_libs
,$(1),\
631 endif # SYSTEM_LPSOLVE
634 define gb_LinkTarget__use_gtk
635 $(call gb_LinkTarget_set_include
,$(1),\
640 $(call gb_LinkTarget_add_libs
,$(1),$(GTK_LIBS
))
644 define gb_LinkTarget__use_gthread
645 $(call gb_LinkTarget_add_libs
,$(1),$(GTHREAD_LIBS
))
649 define gb_LinkTarget__use_dbusmenugtk
650 $(call gb_LinkTarget_set_include
,$(1),\
652 $(DBUSMENUGTK_CFLAGS
) \
655 $(call gb_LinkTarget_add_libs
,$(1),$(DBUSMENUGTK_LIBS
))
659 ifeq ($(SYSTEM_DB
),YES
)
661 define gb_LinkTarget__use_berkeleydb
662 $(call gb_LinkTarget_set_include
,$(1),\
664 $(filter -I
%,$(SYSTEM_DB_CFLAGS
)) \
667 $(call gb_LinkTarget_add_defs
,$(1),\
668 $(filter -D
%,$(SYSTEM_DB_CFLAGS
)) \
671 $(call gb_LinkTarget_add_libs
,$(1),\
680 $(eval
$(call gb_Helper_register_libraries
,PLAINLIBS_OOO
,\
684 $(eval
$(call gb_Helper_register_libraries
,PLAINLIBS_OOO
,\
689 define gb_LinkTarget__use_berkeleydb
691 $(call gb_LinkTarget_add_linked_libs
,$(1),\
695 $(call gb_LinkTarget_add_linked_libs
,$(1),\
704 ifeq ($(SYSTEM_LIBPNG
),YES
)
706 define gb_LinkTarget__use_png
707 $(call gb_LinkTarget_set_include
,$(1),\
712 $(call gb_LinkTarget_add_libs
,$(1),\
718 else # !SYSTEM_LIBPNG
720 $(eval
$(call gb_Helper_register_libraries
,PLAINLIBS_OOO
,\
724 define gb_LinkTarget__use_png
725 $(call gb_LinkTarget_add_linked_libs
,$(1),\
731 endif # !SYSTEM_LIBPNG
733 # MacOSX-only frameworks
734 # (in alphabetical order)
736 define gb_LinkTarget__use_carbon
737 $(call gb_LinkTarget_add_libs
,$(1), \
743 define gb_LinkTarget__use_cocoa
744 $(call gb_LinkTarget_add_libs
,$(1), \
750 define gb_LinkTarget__use_qtkit
751 $(call gb_LinkTarget_add_libs
,$(1), \
757 define gb_LinkTarget__use_quicktime
758 $(call gb_LinkTarget_add_libs
,$(1), \
759 -framework QuickTime \
764 # Common MacOSX and iOS frameworks
766 define gb_LinkTarget__use_corefoundation
767 $(call gb_LinkTarget_add_libs
,$(1), \
768 -framework CoreFoundation \
773 define gb_LinkTarget__use_coregraphics
774 $(call gb_Library_add_libs
,$(1), \
775 -framework CoreGraphics \
780 define gb_LinkTarget__use_coretext
781 $(call gb_Library_add_libs
,$(1), \
782 -framework CoreText \
787 define gb_LinkTarget__use_foundation
788 $(call gb_LinkTarget_add_libs
,$(1), \
789 -framework Foundation \
794 # iOS-only frameworks
796 define gb_LinkTarget__use_uikit
797 $(call gb_LinkTarget_add_libs
,$(1), \
803 ifeq ($(SYSTEM_MOZILLA
),YES
)
805 define gb_LinkTarget__use_plc4
806 $(call gb_LinkTarget_set_include
,$(1),\
811 $(call gb_LinkTarget_add_libs
,$(1),\
819 $(eval
$(call gb_Helper_register_libraries
,PLAINLIBS_OOO
,\
825 define gb_LinkTarget__use_plc4
826 $(call gb_LinkTarget_add_linked_libs
,$(1),\
834 ### Jars ############################################################
836 ifeq ($(SYSTEM_SAXON
),YES
)
838 define gb_JavaClassSet__use_saxon
839 $(call gb_JavaClassSet_add_system_jar
,$(1),$(SAXON_JAR
))
844 define gb_JavaClassSet__use_saxon
845 $(call gb_JavaClassSet_add_jar
,$(1),$(OUTDIR
)/bin
/saxon9.jar
)
850 ifeq ($(SYSTEM_BSH
),YES
)
852 define gb_JavaClassSet__use_bsh
853 $(call gb_JavaClassSet_add_system_jar
,$(1),$(BSH_JAR
))
858 define gb_JavaClassSet__use_bsh
859 $(call gb_JavaClassSet_add_jar
,$(1),$(OUTDIR
)/bin
/bsh.jar
)
865 # vim: set noet sw=4 ts=4: