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
)
393 # icudata and icui18n is called icudt and icuin when built with MSVC :-(
394 ifeq ($(OS
)$(COM
),WNTMSC
)
395 $(eval
$(call gb_Helper_register_libraries
,PLAINLIBS_OOO
, \
403 define gb_LinkTarget__use_icudt
404 $(call gb_LinkTarget_add_linked_libs
,$(1),\
409 define gb_LinkTarget__use_icuin
410 $(call gb_LinkTarget_add_linked_libs
,$(1),\
416 $(eval
$(call gb_Helper_register_libraries
,PLAINLIBS_OOO
, \
417 icudata
$(gb_ICU_suffix
) \
418 icui18n
$(gb_ICU_suffix
) \
419 icule
$(gb_ICU_suffix
) \
420 icutu
$(gb_ICU_suffix
) \
421 icuuc
$(gb_ICU_suffix
) \
424 define gb_LinkTarget__use_icudata
425 $(call gb_LinkTarget_add_linked_libs
,$(1),\
426 icudata
$(gb_ICU_suffix
) \
430 define gb_LinkTarget__use_icui18n
431 $(call gb_LinkTarget_add_linked_libs
,$(1),\
432 icui18n
$(gb_ICU_suffix
) \
438 define gb_LinkTarget__use_icule
439 $(call gb_LinkTarget_add_linked_libs
,$(1),\
440 icule
$(gb_ICU_suffix
) \
444 define gb_LinkTarget__use_icutu
445 $(call gb_LinkTarget_add_linked_libs
,$(1),\
446 icutu
$(gb_ICU_suffix
) \
450 define gb_LinkTarget__use_icuuc
451 $(call gb_LinkTarget_add_linked_libs
,$(1),\
452 icuuc
$(gb_ICU_suffix
) \
460 ifeq ($(SYSTEM_OPENSSL
),YES
)
462 define gb_LinkTarget__use_openssl
463 $(call gb_LinkTarget_set_include
,$(1),\
467 $(call gb_LinkTarget_add_libs
,$(1),$(OPENSSL_LIBS
))
471 else # !SYSTEM_OPENSSL
474 $(eval
$(call gb_Helper_register_libraries
,PLAINLIBS_OOO
, \
479 $(eval
$(call gb_Helper_register_static_libraries
,PLAINLIBS
, \
485 define gb_LinkTarget__use_openssl
487 $(call gb_LinkTarget_add_linked_libs
,$(1),\
492 $(call gb_LinkTarget_add_linked_static_libs
,$(1),\
497 $(call gb_LinkTarget_add_libs
,$(1),\
506 endif # SYSTEM_OPENSSL
509 ifeq ($(SYSTEM_LIBVISIO
),YES
)
511 define gb_LinkTarget__use_visio
512 $(call gb_LinkTarget_set_include
,$(1),\
516 $(call gb_LinkTarget_add_libs
,$(1),$(VISIO_LIBS
))
520 else # !SYSTEM_LIBVISIO
522 $(eval
$(call gb_Helper_register_static_libraries
,PLAINLIBS
, \
526 define gb_LinkTarget__use_visio
527 $(call gb_LinkTarget_add_linked_static_libs
,$(1),\
533 endif # SYSTEM_LIBVISIO
536 ifeq ($(SYSTEM_LIBWPD
),YES
)
538 define gb_LinkTarget__use_wpd
539 $(call gb_LinkTarget_set_include
,$(1),\
543 $(call gb_LinkTarget_add_libs
,$(1),$(WPD_LIBS
))
547 else # !SYSTEM_LIBWPD
549 $(eval
$(call gb_Helper_register_static_libraries
,PLAINLIBS
, \
553 define gb_LinkTarget__use_wpd
554 $(call gb_LinkTarget_add_linked_static_libs
,$(1),\
560 endif # SYSTEM_LIBWPD
563 ifeq ($(SYSTEM_LIBWPG
),YES
)
565 define gb_LinkTarget__use_wpg
566 $(call gb_LinkTarget_set_include
,$(1),\
570 $(call gb_LinkTarget_add_libs
,$(1),$(WPG_LIBS
))
574 else # !SYSTEM_LIBWPG
576 $(eval
$(call gb_Helper_register_static_libraries
,PLAINLIBS
, \
580 define gb_LinkTarget__use_wpg
581 $(call gb_LinkTarget_add_linked_static_libs
,$(1),\
587 endif # SYSTEM_LIBWPG
590 ifeq ($(SYSTEM_LIBWPS
),YES
)
592 define gb_LinkTarget__use_wps
593 $(call gb_LinkTarget_set_include
,$(1),\
597 $(call gb_LinkTarget_add_libs
,$(1),$(WPS_LIBS
))
601 else # !SYSTEM_LIBWPS
603 $(eval
$(call gb_Helper_register_static_libraries
,PLAINLIBS
, \
607 define gb_LinkTarget__use_wps
608 $(call gb_LinkTarget_add_linked_static_libs
,$(1),\
614 endif # SYSTEM_LIBWPS
617 ifeq ($(SYSTEM_LPSOLVE
),YES
)
619 define gb_LinkTarget__use_lpsolve55
620 $(call gb_LinkTarget_add_libs
,$(1),-llpsolve55
)
624 else # !SYSTEM_LPSOLVE
626 $(eval
$(call gb_Helper_register_libraries
,PLAINLIBS_OOO
, \
630 define gb_LinkTarget__use_lpsolve55
631 $(call gb_LinkTarget_add_linked_libs
,$(1),\
637 endif # SYSTEM_LPSOLVE
640 define gb_LinkTarget__use_gtk
641 $(call gb_LinkTarget_set_include
,$(1),\
646 $(call gb_LinkTarget_add_libs
,$(1),$(GTK_LIBS
))
648 ifeq ($(ENABLE_GTK_PRINT
),TRUE
)
650 $(call gb_LinkTarget_add_defs
,$(1),-DENABLE_GTK_PRINT
)
652 $(call gb_LinkTarget_set_include
,$(1),\
654 $(GTK_PRINT_CFLAGS
) \
657 $(call gb_LinkTarget_add_libs
,$(1),$(GTK_PRINT_LIBS
))
663 define gb_LinkTarget__use_gthread
664 $(call gb_LinkTarget_add_libs
,$(1),$(GTHREAD_LIBS
))
669 ifeq ($(ENABLE_DBUS
),YES
)
671 define gb_LinkTarget__use_dbus
672 $(call gb_LinkTarget_set_include
,$(1),\
677 $(call gb_Library_add_defs
,$(1),\
681 $(call gb_LinkTarget_add_libs
,$(1),\
689 define gb_LinkTarget__use_dbus
696 define gb_LinkTarget__use_dbusmenugtk
697 $(call gb_LinkTarget_set_include
,$(1),\
699 $(DBUSMENUGTK_CFLAGS
) \
702 $(call gb_LinkTarget_add_libs
,$(1),$(DBUSMENUGTK_LIBS
))
706 ifeq ($(SYSTEM_DB
),YES
)
708 define gb_LinkTarget__use_berkeleydb
709 $(call gb_LinkTarget_set_include
,$(1),\
711 $(filter -I
%,$(SYSTEM_DB_CFLAGS
)) \
714 $(call gb_LinkTarget_add_defs
,$(1),\
715 $(filter -D
%,$(SYSTEM_DB_CFLAGS
)) \
718 $(call gb_LinkTarget_add_libs
,$(1),\
727 $(eval
$(call gb_Helper_register_libraries
,PLAINLIBS_OOO
,\
731 $(eval
$(call gb_Helper_register_libraries
,PLAINLIBS_OOO
,\
736 define gb_LinkTarget__use_berkeleydb
738 $(call gb_LinkTarget_add_linked_libs
,$(1),\
742 $(call gb_LinkTarget_add_linked_libs
,$(1),\
751 ifeq ($(SYSTEM_LIBPNG
),YES
)
753 define gb_LinkTarget__use_png
754 $(call gb_LinkTarget_set_include
,$(1),\
759 $(call gb_LinkTarget_add_libs
,$(1),\
765 else # !SYSTEM_LIBPNG
767 $(eval
$(call gb_Helper_register_libraries
,PLAINLIBS_OOO
,\
771 define gb_LinkTarget__use_png
772 $(call gb_LinkTarget_add_linked_libs
,$(1),\
778 endif # !SYSTEM_LIBPNG
780 # MacOSX-only frameworks
781 # (in alphabetical order)
783 define gb_LinkTarget__use_carbon
784 $(call gb_LinkTarget_add_libs
,$(1), \
790 define gb_LinkTarget__use_cocoa
791 $(call gb_LinkTarget_add_libs
,$(1), \
797 define gb_LinkTarget__use_qtkit
798 $(call gb_LinkTarget_add_libs
,$(1), \
804 define gb_LinkTarget__use_quicktime
805 $(call gb_LinkTarget_add_libs
,$(1), \
806 -framework QuickTime \
811 # Common MacOSX and iOS frameworks
813 define gb_LinkTarget__use_corefoundation
814 $(call gb_LinkTarget_add_libs
,$(1), \
815 -framework CoreFoundation \
820 define gb_LinkTarget__use_coregraphics
821 $(call gb_Library_add_libs
,$(1), \
822 -framework CoreGraphics \
827 define gb_LinkTarget__use_coretext
828 $(call gb_Library_add_libs
,$(1), \
829 -framework CoreText \
834 define gb_LinkTarget__use_foundation
835 $(call gb_LinkTarget_add_libs
,$(1), \
836 -framework Foundation \
841 # iOS-only frameworks
843 define gb_LinkTarget__use_uikit
844 $(call gb_LinkTarget_add_libs
,$(1), \
850 ifeq ($(SYSTEM_NSS
),YES
)
852 define gb_LinkTarget__use_plc4
853 $(call gb_LinkTarget_set_include
,$(1),\
858 $(call gb_LinkTarget_add_libs
,$(1),\
866 $(eval
$(call gb_Helper_register_libraries
,PLAINLIBS_OOO
,\
872 define gb_LinkTarget__use_plc4
873 $(call gb_LinkTarget_add_linked_libs
,$(1),\
881 ### Jars ############################################################
883 ifeq ($(SYSTEM_SAXON
),YES
)
885 define gb_JavaClassSet__use_saxon
886 $(call gb_JavaClassSet_add_system_jar
,$(1),$(SAXON_JAR
))
891 define gb_JavaClassSet__use_saxon
892 $(call gb_JavaClassSet_add_jar
,$(1),$(OUTDIR
)/bin
/saxon9.jar
)
897 ifeq ($(SYSTEM_BSH
),YES
)
899 define gb_JavaClassSet__use_bsh
900 $(call gb_JavaClassSet_add_system_jar
,$(1),$(BSH_JAR
))
905 define gb_JavaClassSet__use_bsh
906 $(call gb_JavaClassSet_add_jar
,$(1),$(OUTDIR
)/bin
/bsh.jar
)
912 # vim: set noet sw=4 ts=4: