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),$(LIBVISIO_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),$(LIBWPD_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),$(LIBWPG_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),$(LIBWPS_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 # MacOSX-only frameworks
660 # (in alphabetical order)
662 define gb_LinkTarget__use_carbon
663 $(call gb_LinkTarget_add_libs
,$(1), \
669 define gb_LinkTarget__use_cocoa
670 $(call gb_LinkTarget_add_libs
,$(1), \
676 define gb_LinkTarget__use_qtkit
677 $(call gb_LinkTarget_add_libs
,$(1), \
683 define gb_LinkTarget__use_quicktime
684 $(call gb_LinkTarget_add_libs
,$(1), \
685 -framework QuickTime \
690 # Common MacOSX and iOS frameworks
692 define gb_LinkTarget__use_corefoundation
693 $(call gb_LinkTarget_add_libs
,$(1), \
694 -framework CoreFoundation \
699 define gb_LinkTarget__use_coregraphics
700 $(call gb_Library_add_libs
,$(1), \
701 -framework CoreGraphics \
706 define gb_LinkTarget__use_coretext
707 $(call gb_Library_add_libs
,$(1), \
708 -framework CoreText \
713 define gb_LinkTarget__use_foundation
714 $(call gb_LinkTarget_add_libs
,$(1), \
715 -framework Foundation \
720 # iOS-only frameworks
722 define gb_LinkTarget__use_uikit
723 $(call gb_LinkTarget_add_libs
,$(1), \
729 ifeq ($(SYSTEM_MOZILLA
),YES
)
731 define gb_LinkTarget__use_plc4
732 $(call gb_LinkTarget_set_include
,$(1),\
737 $(call gb_LinkTarget_add_libs
,$(1),\
745 $(eval
$(call gb_Helper_register_libraries
,PLAINLIBS_OOO
,\
751 define gb_LinkTarget__use_plc4
752 $(call gb_LinkTarget_add_linked_libs
,$(1),\
760 # vim: set noet sw=4 ts=4: