Bump for 4.0-7
[LibreOffice.git] / RepositoryExternal.mk
blobe153b74b1ea48e8cbea19e823798571f7a8cbf8c
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 # External headers
41 ifeq ($(SYSTEM_MESA_HEADERS),YES)
43 gb_LinkTarget__use_mesa_headers :=
45 else
47 define gb_LinkTarget__use_mesa_headers
48 $(eval $(call gb_LinkTarget_use_package,$(1),Mesa_inc))
50 endef
52 endif
54 ifeq ($(SYSTEM_NPAPI_HEADERS),YES)
56 define gb_LinkTarget__use_npapi_headers
57 $(call gb_LinkTarget_set_include,$(1),\
58 $(NPAPI_HEADERS_CFLAGS) \
59 $$(INCLUDE) \
62 endef
64 else #!SYSTEM_NPAPI_HEADERS
66 define gb_LinkTarget__use_npapi_headers
67 $(call gb_LinkTarget_use_package,$(1),npapi)
68 $(call gb_LinkTarget_set_include,$(1),\
69 -I$(OUTDIR)/inc/external/npsdk \
70 $$(INCLUDE) \
73 endef
75 endif #SYSTEM_NPAPI_HEADERS
77 ifeq ($(SYSTEM_ODBC_HEADERS),YES)
79 define gb_LinkTarget__use_odbc_headers
80 $(call gb_LinkTarget_add_defs,$(1),\
81 -DSYSTEM_ODBC_HEADERS \
84 endef
86 else
88 define gb_LinkTarget__use_odbc_headers
89 $(call gb_LinkTarget_use_package,$(1),odbc_inc)
91 endef
93 endif
95 ifeq ($(SYSTEM_VIGRA),YES)
97 gb_LinkTarget__use_vigra_headers :=
99 else
101 define gb_LinkTarget__use_vigra_headers
102 $(call gb_LinkTarget_use_unpacked,$(1),vigra)
103 $(call gb_LinkTarget_set_include,$(1),\
104 -I$(call gb_UnpackedTarball_get_dir,vigra/include) \
105 $$(INCLUDE) \
108 endef
110 endif
112 ifeq ($(SYSTEM_MDDS),YES)
114 gb_LinkTarget__use_mdds_headers :=
116 else
118 define gb_LinkTarget__use_mdds_headers
119 $(call gb_LinkTarget_use_unpacked,$(1),mdds)
120 $(call gb_LinkTarget_set_include,$(1),\
121 -I$(call gb_UnpackedTarball_get_dir,mdds/include) \
122 $$(INCLUDE) \
125 endef
127 endif
129 # External libraries
131 ifeq ($(SYSTEM_CPPUNIT),YES)
133 define gb_LinkTarget__use_cppunit
134 $(call gb_LinkTarget_set_include,$(1),\
135 $$(INCLUDE) \
136 $(CPPUNIT_CFLAGS) \
139 $(call gb_LinkTarget_add_libs,$(1),\
140 $(CPPUNIT_LIBS) \
143 endef
145 else
147 $(eval $(call gb_Helper_register_libraries,PLAINLIBS_OOO,\
148 cppunit \
151 define gb_LinkTarget__use_cppunit
152 $(call gb_LinkTarget_use_libraries,$(1),\
153 cppunit \
156 endef
158 endif
160 ifeq ($(SYSTEM_ZLIB),YES)
162 define gb_LinkTarget__use_zlib
163 $(call gb_LinkTarget_add_defs,$(1),\
164 -DSYSTEM_ZLIB \
166 $(call gb_LinkTarget_add_libs,$(1),-lz)
168 endef
170 # nothing on system
171 define gb_LinkTarget__use_zlib_x64
173 endef
175 else # !SYSTEM_ZLIB
177 $(eval $(call gb_Helper_register_static_libraries,PLAINLIBS, \
178 zlib \
179 zlib_x64 \
182 define gb_LinkTarget__use_zlib_multiarch
183 $(if $(2),,$(call gb_Output_error,gb_LinkTarget__use_zlib_multiarch needs two arguments))
185 $(call gb_LinkTarget_use_packages,$(1),\
186 zlib_inc \
189 $(call gb_LinkTarget_set_include,$(1),\
190 -I$(OUTDIR)/inc/external/zlib \
191 $$(INCLUDE) \
194 $(call gb_LinkTarget_use_static_libraries,$(1),\
195 $(2) \
198 endef
200 define gb_LinkTarget__use_zlib
201 $(call gb_LinkTarget__use_zlib_multiarch,$(1),zlib)
203 endef
205 define gb_LinkTarget__use_zlib_x64
206 $(call gb_LinkTarget__use_zlib_multiarch,$(1),zlib_x64)
208 endef
210 endif # SYSTEM_ZLIB
213 ifeq ($(SYSTEM_JPEG),YES)
215 define gb_LinkTarget__use_jpeg
216 $(call gb_LinkTarget_add_libs,$(1),-ljpeg)
217 $(call gb_LinkTarget_set_ldflags,$(1),\
218 $$(filter-out -L/usr/lib/jvm%,$$(T_LDFLAGS)) \
221 endef
223 else # !SYSTEM_JPEG
225 $(eval $(call gb_Helper_register_static_libraries,PLAINLIBS, \
226 jpeg \
229 define gb_LinkTarget__use_jpeg
230 $(call gb_LinkTarget_set_include,$(1),\
231 $$(INCLUDE) \
232 -I$(OUTDIR)/inc/external/jpeg \
235 $(call gb_LinkTarget_use_static_libraries,$(1),\
236 jpeg \
239 endef
241 endif # SYSTEM_JPEG
243 ifeq ($(SYSTEM_MYTHES),YES)
245 define gb_LinkTarget__use_mythes
246 $(call gb_LinkTarget_set_include,$(1),\
247 $$(INCLUDE) \
248 $(MYTHES_CFLAGS) \
250 $(call gb_LinkTarget_add_libs,$(1),$(MYTHES_LIBS))
252 endef
254 else # !SYSTEM_MYTHES
256 $(eval $(call gb_Helper_register_static_libraries,PLAINLIBS, \
257 mythes \
260 define gb_LinkTarget__use_mythes
261 $(call gb_LinkTarget_use_package,$(1),\
262 mythes \
264 $(call gb_LinkTarget_use_static_libraries,$(1),\
265 mythes \
268 endef
270 endif # SYSTEM_MYTHES
273 ifeq ($(SYSTEM_EXPAT),YES)
275 define gb_LinkTarget__use_expat
276 $(if $(2),,$(error gb_LinkTarget__use_expat needs additional parameter))
278 $(call gb_LinkTarget_add_defs,$(1),\
279 -DSYSTEM_EXPAT \
282 $(call gb_LinkTarget_add_libs,$(1),-lexpat)
284 endef
286 gb_ExternalProject__use_expat :=
288 else # !SYSTEM_EXPAT
290 $(eval $(call gb_Helper_register_static_libraries,PLAINLIBS, \
291 expat \
292 expat_x64 \
295 define gb_LinkTarget__use_expat
296 $(if $(2),,$(error gb_LinkTarget__use_expat needs additional parameter))
298 $(call gb_LinkTarget_set_include,$(1),\
299 -I$(OUTDIR)/inc/external/expat \
300 $$(INCLUDE) \
303 $(call gb_LinkTarget_use_static_libraries,$(1),\
304 $(2) \
307 endef
309 define gb_ExternalProject__use_expat
310 $(call gb_ExternalProject_use_package,$(1),expat_inc)
311 $(call gb_ExternalProject_use_static_libraries,$(1),expat)
313 endef
315 endif # SYSTEM_EXPAT
317 define gb_LinkTarget__use_expat_utf8
318 $(call gb_LinkTarget__use_expat,$(1),expat)
320 endef
322 define gb_LinkTarget__use_expat_utf8_x64
323 $(call gb_LinkTarget__use_expat,$(1),expat_x64)
325 endef
327 ifeq ($(OS),ANDROID)
328 $(eval $(call gb_Helper_register_static_libraries,PLAINLIBS, \
329 fontconfig \
330 freetype \
332 endif
334 ifeq ($(SYSTEM_HYPH),YES)
336 define gb_LinkTarget__use_hyphen
337 $(call gb_LinkTarget_add_libs,$(1),$(HYPHEN_LIB))
339 endef
341 else # !SYSTEM_HYPH
343 $(eval $(call gb_Helper_register_static_libraries,PLAINLIBS, \
344 hyphen \
347 define gb_LinkTarget__use_hyphen
348 $(call gb_LinkTarget_use_unpacked,$(1),hyphen)
349 $(call gb_LinkTarget_set_include,$(1),\
350 -I$(call gb_UnpackedTarball_get_dir,hyphen)\
351 $$(INCLUDE) \
353 $(call gb_LinkTarget_use_static_libraries,$(1),\
354 hyphen \
357 endef
359 endif # SYSTEM_HYPH
361 ifeq ($(SYSTEM_HUNSPELL),YES)
363 define gb_LinkTarget__use_hunspell
364 $(call gb_LinkTarget_set_include,$(1),\
365 $$(INCLUDE) \
366 $(HUNSPELL_CFLAGS) \
368 $(call gb_LinkTarget_add_libs,$(1),$(HUNSPELL_LIBS))
370 endef
372 else # !SYSTEM_HUNSPELL
374 $(eval $(call gb_Helper_register_static_libraries,PLAINLIBS, \
375 hunspell \
378 define gb_LinkTarget__use_hunspell
379 $(call gb_LinkTarget_add_defs,$(1),\
380 -DHUNSPELL_STATIC \
382 $(call gb_LinkTarget_use_unpacked,$(1),hunspell)
383 $(call gb_LinkTarget_set_include,$(1),\
384 -I$(call gb_UnpackedTarball_get_dir,hunspell/src/hunspell)\
385 $$(INCLUDE) \
387 $(call gb_LinkTarget_use_static_libraries,$(1),\
388 hunspell \
391 endef
393 endif # SYSTEM_HUNSPELL
396 ifeq ($(SYSTEM_BOOST),YES)
398 define gb_LinkTarget__use_boostdatetime
399 $(call gb_LinkTarget_set_include,$(1),\
400 $$(INCLUDE) \
401 $(BOOST_CPPFLAGS) \
404 $(call gb_LinkTarget_add_ldflags,$(1),\
405 $(BOOST_LDFLAGS) \
408 $(call gb_LinkTarget_add_libs,$(1),\
409 $(BOOST_DATE_TIME_LIB) \
412 endef
414 gb_LinkTarget__use_boost_headers:=
415 gb_ExternalProject__use_boost_headers:=
417 else # !SYSTEM_BOOST
419 $(eval $(call gb_Helper_register_static_libraries,PLAINLIBS, \
420 boostdatetime \
423 ifeq ($(OS),WNT)
424 $(eval $(call gb_Helper_register_static_libraries,PLAINLIBS, \
425 boostthread \
428 define gb_LinkTarget__use_boostthread
429 $(call gb_LinkTarget_add_defs,$(1),\
430 -DBOOST_ALL_NO_LIB \
433 $(call gb_LinkTarget_use_static_libraries,$(1),\
434 boostthread \
436 endef
438 endif # WNT
440 define gb_LinkTarget__use_boostdatetime
441 $(call gb_LinkTarget_add_defs,$(1),\
442 -DBOOST_ALL_NO_LIB \
445 $(call gb_LinkTarget_use_static_libraries,$(1),\
446 boostdatetime \
449 endef
451 define gb_LinkTarget__use_boost_headers
452 $(call gb_LinkTarget_use_unpacked,$(1),boost)
454 endef
456 define gb_ExternalProject__use_boost_headers
457 $(call gb_ExternalProject_get_preparation_target,$(1)) :| $(call gb_UnpackedTarball_get_final_target,boost)
459 endef
460 endif # SYSTEM_BOOST
463 ifeq ($(SYSTEM_LIBCMIS),YES)
465 define gb_LinkTarget__use_cmis
466 $(call gb_LinkTarget_set_include,$(1),\
467 $$(INCLUDE) \
468 $(CMIS_CFLAGS) \
470 $(call gb_LinkTarget_add_libs,$(1),$(CMIS_LIBS))
472 endef
474 else # !SYSTEM_LIBCMIS
476 $(eval $(call gb_Helper_register_static_libraries,PLAINLIBS, \
477 cmislib \
480 define gb_LinkTarget__use_cmis
481 $(call gb_LinkTarget_use_static_libraries,$(1),\
482 cmislib \
485 endef
487 endif # SYSTEM_LIBCMIS
490 ifeq ($(SYSTEM_LIBEXTTEXTCAT),YES)
492 define gb_LinkTarget__use_libexttextcat
493 $(call gb_LinkTarget_set_include,$(1),\
494 $$(INCLUDE) \
495 $(LIBEXTTEXTCAT_CFLAGS) \
497 $(call gb_LinkTarget_add_defs,$(1),\
498 -DSYSTEM_LIBEXTTEXTCAT \
500 $(call gb_LinkTarget_add_libs,$(1),$(LIBEXTTEXTCAT_LIBS))
502 endef
504 else # !SYSTEM_LIBEXTTEXTCAT
506 $(eval $(call gb_Helper_register_static_libraries,PLAINLIBS,\
507 exttextcat \
510 define gb_LinkTarget__use_libexttextcat
511 $(call gb_LinkTarget_use_static_libraries,$(1),\
512 exttextcat \
515 $(call gb_LinkTarget_set_include,$(1),\
516 -I$(call gb_UnpackedTarball_get_dir,exttextcat/src) \
517 $$(INCLUDE) \
520 endef
522 endif # SYSTEM_LIBEXTTEXTCAT
525 ifeq ($(SYSTEM_LIBXML),YES)
527 define gb_LinkTarget__use_libxml2
528 $(call gb_LinkTarget_add_defs,$(1),\
529 -DSYSTEM_LIBXML \
531 $(call gb_LinkTarget_set_include,$(1),\
532 $$(INCLUDE) \
533 $(LIBXML_CFLAGS) \
535 $(call gb_LinkTarget_add_libs,$(1),$(LIBXML_LIBS))
537 endef
539 else # !SYSTEM_LIBXML
541 $(eval $(call gb_Helper_register_libraries,PLAINLIBS_URE, \
542 xml2 \
545 define gb_LinkTarget__use_libxml2
546 $(call gb_LinkTarget_use_libraries,$(1),\
547 xml2 \
550 endef
552 endif # SYSTEM_LIBXML
555 ifeq ($(SYSTEM_LIBXSLT),YES)
557 define gb_LinkTarget__use_libxslt
558 $(call gb_LinkTarget_set_include,$(1),\
559 $$(INCLUDE) \
560 $(LIBXSLT_CFLAGS) \
562 $(call gb_LinkTarget_add_libs,$(1),$(LIBXSLT_LIBS))
564 endef
566 define gb_LinkTarget__use_libexslt
567 $(call gb_LinkTarget_set_include,$(1),\
568 $$(INCLUDE) \
569 $(LIBEXSLT_CFLAGS) \
572 $(call gb_LinkTarget_add_libs,$(1),$(LIBEXSLT_LIBS))
574 endef
576 else # !SYSTEM_LIBXSLT
578 $(eval $(call gb_Helper_register_libraries,PLAINLIBS_OOO, \
579 exslt \
580 xslt \
583 define gb_LinkTarget__use_libxslt
584 $(call gb_LinkTarget_use_libraries,$(1),\
585 xslt \
588 endef
590 define gb_LinkTarget__use_libexslt
591 $(call gb_LinkTarget_use_libraries,$(1),\
592 exslt \
595 endef
597 endif # SYSTEM_LIBXSLT
599 define gb_LinkTarget__use_glib
600 $(error gb_LinkTarget__use_glib should not be called any more)
601 endef
603 ifeq ($(ENABLE_LIBLANGTAG),YES)
605 ifeq ($(SYSTEM_LIBLANGTAG),YES)
607 define gb_LinkTarget__use_liblangtag
608 $(call gb_LinkTarget_set_include,$(1),\
609 $$(INCLUDE) \
610 $(LIBLANGTAG_CFLAGS) \
613 $(call gb_LinkTarget_add_libs,$(1),$(LIBLANGTAG_LIBS))
615 endef
617 else # !SYSTEM_LIBLANGTAG
619 $(eval $(call gb_Helper_register_static_libraries,PLAINLIBS, \
620 langtag \
623 define gb_LinkTarget__use_liblangtag
624 $(call gb_LinkTarget_use_unpacked,$(1),langtag)
625 $(call gb_LinkTarget_set_include,$(1),\
626 -I$(call gb_UnpackedTarball_get_dir,langtag) \
627 $$(INCLUDE) \
629 $(call gb_LinkTarget_use_static_libraries,$(1),\
630 langtag \
633 endef
635 endif # SYSTEM_LIBLANGTAG
637 endif # ENABLE_LIBLANGTAG
640 ifeq ($(SYSTEM_NEON),YES)
642 define gb_LinkTarget__use_neon
643 $(call gb_LinkTarget_add_defs,$(1),\
644 -DNEON_VERSION=0x$(NEON_VERSION) \
646 $(call gb_LinkTarget_set_include,$(1),\
647 $$(INCLUDE) \
648 $(NEON_CFLAGS) \
651 $(call gb_LinkTarget_add_libs,$(1),$(NEON_LIBS))
653 endef
655 else # !SYSTEM_NEON
657 $(eval $(call gb_Helper_register_libraries,PLAINLIBS_OOO,\
658 neon \
661 define gb_LinkTarget__use_neon
662 $(call gb_LinkTarget_use_unpacked,$(1),neon)
663 $(call gb_LinkTarget_set_include,$(1),\
664 -I$(call gb_UnpackedTarball_get_dir,neon/src) \
665 $$(INCLUDE) \
667 $(call gb_LinkTarget_use_libraries,$(1),\
668 neon \
671 endef
673 endif # SYSTEM_NEON
676 ifeq ($(SYSTEM_REDLAND),YES)
678 define gb_LinkTarget__use_librdf
679 $(call gb_LinkTarget_add_defs,$(1),\
680 -DSYSTEM_REDLAND \
682 $(call gb_LinkTarget_set_include,$(1),\
683 $$(INCLUDE) \
684 $(REDLAND_CFLAGS) \
686 $(call gb_LinkTarget_add_libs,$(1),$(REDLAND_LIBS))
688 endef
690 else # !SYSTEM_REDLAND
692 ifneq ($(OS),ANDROID)
694 $(eval $(call gb_Helper_register_libraries,PLAINLIBS_OOO, \
695 rdf \
698 define gb_LinkTarget__use_librdf
699 $(call gb_LinkTarget_use_libraries,$(1),\
700 rdf \
703 ifeq ($(OS),MACOSX)
705 $(call gb_LinkTarget_add_libs,$(1),$(foreach replaceme,librasqal-lo.1 libraptor-lo.1,-dylib_file @loader_path/$(replaceme).dylib:$(gb_Library_OUTDIRLOCATION)/$(replaceme).dylib))
707 endif
709 endef
711 else # ANDROID
713 $(eval $(call gb_Helper_register_static_libraries,PLAINLIBS, \
714 rdf \
715 rasqal \
716 raptor \
719 define gb_LinkTarget__use_librdf
720 $(call gb_LinkTarget_use_static_libraries,$(1),\
721 rdf \
722 rasqal \
723 raptor \
724 crypto \
727 endef
729 endif # ANDROID
731 endif # SYSTEM_REDLAND
734 ifeq ($(SYSTEM_CAIRO),YES)
736 # FREETYPE_CLAGS from environment if ENABLE_CAIRO is used
737 define gb_LinkTarget__use_cairo
738 $(call gb_LinkTarget_set_include,$(1),\
739 $$(INCLUDE) \
740 $(FREETYPE_CFLAGS) \
741 $(CAIRO_CFLAGS) \
743 $(call gb_LinkTarget_add_libs,$(1),$(CAIRO_LIBS))
745 endef
747 else ifeq ($(SYSTEM_CAIRO),NO)
749 $(eval $(call gb_Helper_register_libraries,PLAINLIBS_OOO, \
750 cairo \
751 $(if $(filter-out MACOSX WNT,$(OS)), \
752 pixman-1 \
756 define gb_LinkTarget__use_cairo
757 $(call gb_LinkTarget_use_package,$(1),cairo)
758 $(call gb_LinkTarget_use_package,$(1),pixman)
759 $(call gb_LinkTarget_set_include,$(1),\
760 -I$(call gb_UnpackedTarball_get_dir,cairo) \
761 -I$(call gb_UnpackedTarball_get_dir,cairo)/src \
762 $(FREETYPE_CFLAGS) \
763 $$(INCLUDE) \
765 $(call gb_LinkTarget_use_libraries,$(1),\
766 cairo \
767 $(if $(filter-out MACOSX WNT,$(OS)), \
768 pixman-1 \
772 endef
774 endif # SYSTEM_CAIRO
776 define gb_LinkTarget__use_freetype
777 $(call gb_LinkTarget_set_include,$(1),\
778 $$(INCLUDE) \
779 $(FREETYPE_CFLAGS) \
782 ifneq ($(OS),ANDROID)
783 $(call gb_LinkTarget_add_libs,$(1),$(FREETYPE_LIBS))
784 else
785 $(call gb_LinkTarget_use_static_libraries,$(1),freetype)
786 endif
788 endef
790 define gb_LinkTarget__use_fontconfig
791 $(call gb_LinkTarget_set_include,$(1),\
792 $$(INCLUDE) \
793 $(FONTCONFIG_CFLAGS) \
796 ifneq ($(OS),ANDROID)
797 $(call gb_LinkTarget_add_libs,$(1),$(FONTCONFIG_LIBS))
798 else
799 $(call gb_LinkTarget_use_static_libraries,$(1),fontconfig)
800 endif
802 endef
804 ifeq ($(SYSTEM_GRAPHITE),YES)
806 define gb_LinkTarget__use_graphite
807 $(call gb_LinkTarget_set_include,$(1),\
808 $$(INCLUDE) \
809 $(GRAPHITE_CFLAGS) \
811 $(call gb_LinkTarget_add_libs,$(1),$(GRAPHITE_LIBS))
813 endef
815 else ifeq ($(SYSTEM_GRAPHITE),NO)
817 $(eval $(call gb_Helper_register_static_libraries,PLAINLIBS, \
818 graphite \
820 define gb_LinkTarget__use_graphite
821 $(call gb_LinkTarget_use_unpacked,$(1),graphite)
822 $(call gb_LinkTarget_set_include,$(1),\
823 -I$(call gb_UnpackedTarball_get_dir,graphite/include) \
824 $$(INCLUDE) \
826 $(call gb_LinkTarget_use_static_libraries,$(1),\
827 graphite \
830 endef
832 else # DISABLED GRAPHITE
834 gb_LinkTarget__use_graphite :=
836 endif # SYSTEM_GRAPHITE
838 ifeq ($(SYSTEM_ICU),YES)
840 define gb_LinkTarget__use_icudata
841 $(call gb_LinkTarget_add_libs,$(1),-licudata)
843 endef
844 define gb_LinkTarget__use_icui18n
845 $(call gb_LinkTarget_add_libs,$(1),-licui18n)
847 endef
848 define gb_LinkTarget__use_icule
849 $(call gb_LinkTarget_add_libs,$(1),-licule)
851 endef
852 define gb_LinkTarget__use_icutu
853 $(call gb_LinkTarget_add_libs,$(1),-licutu)
855 endef
856 define gb_LinkTarget__use_icuuc
857 $(call gb_LinkTarget_add_libs,$(1),-licuuc)
859 endef
861 else # !SYSTEM_ICU
863 ifeq ($(OS)$(DISABLE_DYNLOADING),ANDROID)
864 gb_ICU_suffix:=lo
865 else
866 gb_ICU_suffix:=
867 endif
869 # icudata and icui18n is called icudt and icuin when built with MSVC :-/
870 ifeq ($(OS)$(COM),WNTMSC)
871 $(eval $(call gb_Helper_register_libraries,PLAINLIBS_OOO, \
872 icudt \
873 icuin \
876 define gb_LinkTarget__use_icudata
877 $(call gb_LinkTarget_use_libraries,$(1),\
878 icudt \
881 endef
882 define gb_LinkTarget__use_icui18n
883 $(call gb_LinkTarget_use_libraries,$(1),\
884 icuin \
887 endef
888 else
889 $(eval $(call gb_Helper_register_libraries,PLAINLIBS_OOO, \
890 icudata$(gb_ICU_suffix) \
891 icui18n$(gb_ICU_suffix) \
894 define gb_LinkTarget__use_icudata
895 $(call gb_LinkTarget_use_libraries,$(1),\
896 icudata$(gb_ICU_suffix) \
899 endef
900 define gb_LinkTarget__use_icui18n
901 $(call gb_LinkTarget_use_libraries,$(1),\
902 icui18n$(gb_ICU_suffix) \
905 endef
906 endif
908 $(eval $(call gb_Helper_register_libraries,PLAINLIBS_OOO, \
909 icule$(gb_ICU_suffix) \
910 icutu$(gb_ICU_suffix) \
911 icuuc$(gb_ICU_suffix) \
914 define gb_LinkTarget__use_icule
915 $(call gb_LinkTarget_use_libraries,$(1),\
916 icule$(gb_ICU_suffix) \
919 endef
920 define gb_LinkTarget__use_icutu
921 $(call gb_LinkTarget_use_libraries,$(1),\
922 icutu$(gb_ICU_suffix) \
925 endef
926 define gb_LinkTarget__use_icuuc
927 $(call gb_LinkTarget_use_libraries,$(1),\
928 icuuc$(gb_ICU_suffix) \
931 endef
933 endif # SYSTEM_ICU
936 ifeq ($(SYSTEM_OPENSSL),YES)
938 define gb_LinkTarget__use_openssl
939 $(call gb_LinkTarget_set_include,$(1),\
940 $$(INCLUDE) \
941 $(OPENSSL_CFLAGS) \
943 $(call gb_LinkTarget_add_libs,$(1),$(OPENSSL_LIBS))
945 endef
947 else # !SYSTEM_OPENSSL
949 ifeq ($(OS),WNT)
950 $(eval $(call gb_Helper_register_libraries,PLAINLIBS_OOO, \
951 crypto \
952 ssl \
954 else
955 $(eval $(call gb_Helper_register_static_libraries,PLAINLIBS, \
956 crypto \
957 ssl \
959 endif
961 define gb_LinkTarget__use_openssl
962 ifeq ($(OS),WNT)
963 $(call gb_LinkTarget_use_libraries,$(1),\
964 crypto \
965 ssl \
967 else
968 $(call gb_LinkTarget_use_static_libraries,$(1),\
969 crypto \
970 ssl \
972 ifeq ($(OS),SOLARIS)
973 $(call gb_LinkTarget_add_libs,$(1),\
974 -lnsl \
975 -lsocket \
977 endif
978 endif
980 endef
982 endif # SYSTEM_OPENSSL
985 ifeq ($(SYSTEM_LIBCDR),YES)
987 define gb_LinkTarget__use_cdr
988 $(call gb_LinkTarget_set_include,$(1),\
989 $$(INCLUDE) \
990 $(CDR_CFLAGS) \
992 $(call gb_LinkTarget_add_libs,$(1),$(CDR_LIBS))
994 endef
996 else # !SYSTEM_LIBCDR
998 $(eval $(call gb_Helper_register_static_libraries,PLAINLIBS, \
999 cdr-0.0 \
1002 define gb_LinkTarget__use_cdr
1003 $(call gb_LinkTarget_use_package,$(1),\
1004 libcdr \
1006 $(call gb_LinkTarget_use_static_libraries,$(1),\
1007 cdr-0.0 \
1010 endef
1012 endif # SYSTEM_LIBCDR
1015 ifeq ($(SYSTEM_LIBMSPUB),YES)
1017 define gb_LinkTarget__use_mspub
1018 $(call gb_LinkTarget_set_include,$(1),\
1019 $$(INCLUDE) \
1020 $(MSPUB_CFLAGS) \
1022 $(call gb_LinkTarget_add_libs,$(1),$(MSPUB_LIBS))
1024 endef
1026 else # !SYSTEM_LIBMSPUB
1028 $(eval $(call gb_Helper_register_static_libraries,PLAINLIBS, \
1029 mspub-0.0 \
1032 define gb_LinkTarget__use_mspub
1033 $(call gb_LinkTarget_use_package,$(1),\
1034 libmspub \
1036 $(call gb_LinkTarget_use_static_libraries,$(1),\
1037 mspub-0.0 \
1040 endef
1042 endif # SYSTEM_LIBMSPUB
1045 ifeq ($(SYSTEM_LIBVISIO),YES)
1047 define gb_LinkTarget__use_visio
1048 $(call gb_LinkTarget_set_include,$(1),\
1049 $$(INCLUDE) \
1050 $(VISIO_CFLAGS) \
1052 $(call gb_LinkTarget_add_libs,$(1),$(VISIO_LIBS))
1054 endef
1056 else # !SYSTEM_LIBVISIO
1058 $(eval $(call gb_Helper_register_static_libraries,PLAINLIBS, \
1059 visio-0.0 \
1062 define gb_LinkTarget__use_visio
1063 $(call gb_LinkTarget_use_package,$(1),\
1064 libvisio \
1066 $(call gb_LinkTarget_use_static_libraries,$(1),\
1067 visio-0.0 \
1070 endef
1072 endif # SYSTEM_LIBVISIO
1075 ifeq ($(SYSTEM_LIBWPD),YES)
1077 define gb_LinkTarget__use_wpd
1078 $(call gb_LinkTarget_set_include,$(1),\
1079 $$(INCLUDE) \
1080 $(WPD_CFLAGS) \
1082 $(call gb_LinkTarget_add_libs,$(1),$(WPD_LIBS))
1084 endef
1085 gb_ExternalProject__use_wpd :=
1087 else # !SYSTEM_LIBWPD
1089 $(eval $(call gb_Helper_register_static_libraries,PLAINLIBS, \
1090 wpd-0.9 \
1093 define gb_LinkTarget__use_wpd
1094 $(call gb_LinkTarget_use_package,$(1),\
1095 libwpd \
1097 $(call gb_LinkTarget_use_static_libraries,$(1),\
1098 wpd-0.9 \
1101 endef
1102 define gb_ExternalProject__use_wpd
1103 $(call gb_ExternalProject_use_package,$(1),libwpd)
1105 endef
1107 endif # SYSTEM_LIBWPD
1110 ifeq ($(SYSTEM_LIBWPG),YES)
1112 define gb_LinkTarget__use_wpg
1113 $(call gb_LinkTarget_set_include,$(1),\
1114 $$(INCLUDE) \
1115 $(WPG_CFLAGS) \
1117 $(call gb_LinkTarget_add_libs,$(1),$(WPG_LIBS))
1119 endef
1120 gb_ExternalProject__use_wpg :=
1122 else # !SYSTEM_LIBWPG
1124 $(eval $(call gb_Helper_register_static_libraries,PLAINLIBS, \
1125 wpglib \
1128 define gb_LinkTarget__use_wpg
1129 $(call gb_LinkTarget_use_package,$(1),\
1130 libwpg_inc \
1132 $(call gb_LinkTarget_use_static_libraries,$(1),\
1133 wpglib \
1136 endef
1137 define gb_ExternalProject__use_wpg
1138 $(call gb_ExternalProject_use_package,$(1),libwpg_inc)
1139 $(call gb_ExternalProject_use_static_libraries,$(1),wpglib)
1141 endef
1143 endif # SYSTEM_LIBWPG
1146 ifeq ($(SYSTEM_LIBWPS),YES)
1148 define gb_LinkTarget__use_wps
1149 $(call gb_LinkTarget_set_include,$(1),\
1150 $$(INCLUDE) \
1151 $(WPS_CFLAGS) \
1153 $(call gb_LinkTarget_add_libs,$(1),$(WPS_LIBS))
1155 endef
1156 gb_ExternalProject__use_wps :=
1158 else # !SYSTEM_LIBWPS
1160 $(eval $(call gb_Helper_register_static_libraries,PLAINLIBS, \
1161 wpslib \
1164 define gb_LinkTarget__use_wps
1165 $(call gb_LinkTarget_use_static_libraries,$(1),\
1166 wpslib \
1169 endef
1170 define gb_ExternalProject__use_wps
1171 $(call gb_ExternalProject_use_package,$(1),libwps_inc)
1172 $(call gb_ExternalProject_use_static_libraries,$(1),wpslib)
1174 endef
1176 endif # SYSTEM_LIBWPS
1179 ifeq ($(SYSTEM_LCMS2),YES)
1181 define gb_LinkTarget__use_lcms2
1182 $(call gb_LinkTarget_set_include,$(1),\
1183 $$(INCLUDE) \
1184 $(LCMS2_CFLAGS) \
1186 $(call gb_LinkTarget_add_libs,$(1),$(LCMS2_LIBS))
1188 endef
1190 gb_ExternalProject__use_lcms2 :=
1192 else # !SYSTEM_LCMS2
1194 define gb_ExternalProject__use_lcms2
1195 $(call gb_ExternalProject_use_package,$(1),lcms2)
1197 endef
1199 ifeq ($(OS),ANDROID)
1201 $(eval $(call gb_Helper_register_static_libraries,PLAINLIBS, \
1202 lcms2 \
1205 define gb_LinkTarget__use_lcms2
1206 $(call gb_LinkTarget_use_package,$(1),lcms2)
1207 $(call gb_LinkTarget_set_include,$(1),\
1208 -I$(call gb_UnpackedTarball_get_dir,lcms2/include) \
1209 $$(INCLUDE) \
1211 $(call gb_LinkTarget_use_static_libraries,$(1),\
1212 lcms2 \
1215 endef
1217 else
1219 $(eval $(call gb_Helper_register_libraries,PLAINLIBS_OOO, \
1220 lcms2 \
1223 define gb_LinkTarget__use_lcms2
1224 $(call gb_LinkTarget_use_package,$(1),lcms2)
1225 $(call gb_LinkTarget_set_include,$(1),\
1226 -I$(call gb_UnpackedTarball_get_dir,lcms2/include) \
1227 $$(INCLUDE) \
1229 $(call gb_LinkTarget_use_libraries,$(1),\
1230 lcms2 \
1233 endef
1235 endif # ANDROID
1236 endif # SYSTEM_LCMS2
1239 ifeq ($(SYSTEM_LPSOLVE),YES)
1241 define gb_LinkTarget__use_lpsolve
1242 $(call gb_LinkTarget_add_libs,$(1),-llpsolve55)
1243 $(call gb_LinkTarget_add_defs,$(1),\
1244 -DSYSTEM_LPSOLVE \
1247 endef
1249 else # !SYSTEM_LPSOLVE
1251 $(eval $(call gb_Helper_register_libraries,PLAINLIBS_OOO, \
1252 lpsolve55 \
1255 define gb_LinkTarget__use_lpsolve
1256 $(call gb_LinkTarget_use_unpacked,$(1),lpsolve)
1257 $(call gb_LinkTarget_use_libraries,$(1),\
1258 lpsolve55 \
1260 $(call gb_LinkTarget_set_include,$(1),\
1261 -I$(call gb_UnpackedTarball_get_dir,lpsolve) \
1262 $$(INCLUDE) \
1265 endef
1267 endif # SYSTEM_LPSOLVE
1269 ifeq ($(ENABLE_GIO),TRUE)
1271 define gb_LinkTarget__use_gio
1272 $(call gb_LinkTarget_set_include,$(1),\
1273 $$(INCLUDE) \
1274 $(GIO_CFLAGS) \
1277 $(call gb_LinkTarget_add_defs,$(1),\
1278 -DENABLE_GIO \
1281 $(call gb_LinkTarget_add_libs,$(1),$(GIO_LIBS))
1283 endef
1285 else # ENABLE_GIO
1287 define gb_LinkTarget__use_gio
1289 endef
1291 endif # ENABLE_GIO
1293 define gb_LinkTarget__use_gtk
1294 $(call gb_LinkTarget_set_include,$(1),\
1295 $$(INCLUDE) \
1296 $(GTK_CFLAGS) \
1299 $(call gb_LinkTarget_add_libs,$(1),$(GTK_LIBS))
1301 ifeq ($(ENABLE_GTK_PRINT),TRUE)
1303 $(call gb_LinkTarget_add_defs,$(1),-DENABLE_GTK_PRINT)
1305 $(call gb_LinkTarget_set_include,$(1),\
1306 $$(INCLUDE) \
1307 $(GTK_PRINT_CFLAGS) \
1310 $(call gb_LinkTarget_add_libs,$(1),$(GTK_PRINT_LIBS))
1312 endif
1314 endef
1316 define gb_LinkTarget__use_gthread
1317 $(call gb_LinkTarget_add_libs,$(1),$(GTHREAD_LIBS))
1318 endef
1320 ifeq ($(ENABLE_CUPS),TRUE)
1322 define gb_LinkTarget__use_cups
1323 $(call gb_LinkTarget_add_defs,$(1),\
1324 -DENABLE_CUPS \
1327 $(call gb_LinkTarget_add_libs,$(1),\
1328 -lcups \
1331 endef
1333 else # ENABLE_CUPS
1335 define gb_LinkTarget__use_cups
1337 endef
1339 endif # ENABLE_DBUS
1341 ifeq ($(ENABLE_DBUS),TRUE)
1343 define gb_LinkTarget__use_dbus
1344 $(call gb_LinkTarget_set_include,$(1),\
1345 $$(INCLUDE) \
1346 $(DBUS_CFLAGS) \
1349 $(call gb_LinkTarget_add_defs,$(1),\
1350 -DENABLE_DBUS \
1353 ifeq ($(ENABLE_PACKAGEKIT),YES)
1354 $(call gb_LinkTarget_add_defs,$(1),\
1355 -DENABLE_PACKAGEKIT \
1357 endif # ENABLE_PACKAGEKIT
1359 $(call gb_LinkTarget_add_libs,$(1),\
1360 $(DBUS_LIBS) \
1363 endef
1365 else # ENABLE_DBUS
1367 define gb_LinkTarget__use_dbus
1369 endef
1371 endif # ENABLE_DBUS
1374 define gb_LinkTarget__use_dbusmenugtk
1375 $(call gb_LinkTarget_set_include,$(1),\
1376 $$(INCLUDE) \
1377 $(DBUSMENUGTK_CFLAGS) \
1380 $(call gb_LinkTarget_add_libs,$(1),$(DBUSMENUGTK_LIBS))
1382 endef
1385 ifeq ($(ENABLE_TELEPATHY),TRUE)
1387 define gb_LinkTarget__use_telepathy
1388 $(call gb_LinkTarget_set_include,$(1),\
1389 $$(INCLUDE) \
1390 $(TELEPATHY_CFLAGS) \
1393 $(call gb_LinkTarget_add_libs,$(1),\
1394 $(TELEPATHY_LIBS) \
1397 endef
1399 else # !ENABLE_TELEPATHY
1401 gb_LinkTarget__use_telepathy :=
1403 endif # ENABLE_TELEPATHY
1405 define gb_LinkTarget__use_croco
1406 $(error gb_LinkTarget__use_croco should not be used any more)
1407 endef
1409 define gb_LinkTarget__use_pango
1410 $(error gb_LinkTarget__use_pango should not be used any more)
1411 endef
1413 define gb_LinkTarget__use_gsf
1414 $(error gb_LinkTarget__use_gsf should not be used any more)
1415 endef
1417 define gb_LinkTarget__use_pixbuf
1418 $(error gb_LinkTarget__use_pixbuf should not be used any more)
1419 endef
1421 ifeq ($(SYSTEM_LIBPNG),YES)
1423 define gb_LinkTarget__use_png
1424 $(call gb_LinkTarget_set_include,$(1),\
1425 $$(INCLUDE) \
1426 $(LIBPNG_CFLAGS) \
1429 $(call gb_LinkTarget_add_libs,$(1),\
1430 $(LIBPNG_LIBS) \
1433 endef
1435 else # !SYSTEM_LIBPNG
1437 $(eval $(call gb_Helper_register_static_libraries,PLAINLIBS,\
1438 png \
1441 define gb_LinkTarget__use_png
1442 $(call gb_LinkTarget_use_static_libraries,$(1),\
1443 png \
1445 $(call gb_LinkTarget__use_zlib,$(1))
1447 endef
1449 endif # !SYSTEM_LIBPNG
1452 ifeq ($(SYSTEM_CURL),YES)
1454 define gb_LinkTarget__use_curl
1455 $(call gb_LinkTarget_set_include,$(1),\
1456 $$(INCLUDE) \
1457 $(CURL_CFLAGS) \
1459 $(call gb_LinkTarget_add_libs,$(1),$(CURL_LIBS))
1461 endef
1463 else # !SYSTEM_CURL
1465 $(eval $(call gb_Helper_register_libraries,PLAINLIBS_OOO, \
1466 curl \
1469 define gb_LinkTarget__use_curl
1470 $(call gb_LinkTarget_use_package,$(1),curl)
1471 $(call gb_LinkTarget_set_include,$(1),\
1472 -I$(call gb_UnpackedTarball_get_dir,curl/include) \
1473 $$(INCLUDE) \
1475 $(call gb_LinkTarget_use_libraries,$(1),\
1476 curl \
1479 endef
1481 endif # SYSTEM_CURL
1483 ifeq ($(ENABLE_VALGRIND),TRUE)
1485 define gb_LinkTarget__use_valgrind
1486 $(call gb_LinkTarget_add_defs,$(1),\
1487 -DHAVE_VALGRIND_HEADERS \
1490 $(call gb_LinkTarget_set_include,$(1),\
1491 $$(INCLUDE) \
1492 $(VALGRIND_CFLAGS) \
1495 endef
1497 else # !ENABLE_VALGRIND
1499 define gb_LinkTarget__use_valgrind
1501 endef
1503 endif # ENABLE_VALGRIND
1505 ifeq ($(SYSTEM_POPPLER),YES)
1507 define gb_LinkTarget__use_poppler
1508 $(call gb_LinkTarget_add_defs,$(1),\
1509 -DSYSTEM_POPPLER \
1512 $(call gb_LinkTarget_set_include,$(1),\
1513 $(POPPLER_CFLAGS) \
1514 $$(INCLUDE) \
1517 $(call gb_LinkTarget_add_libs,$(1),\
1518 $(POPPLER_LIBS) \
1521 endef
1523 else # !SYSTEM_POPPLER
1525 $(eval $(call gb_Helper_register_static_libraries,PLAINLIBS,\
1526 fofi \
1527 Goo \
1528 xpdf \
1531 define gb_LinkTarget__use_poppler
1532 $(call gb_LinkTarget_set_include,$(1),\
1533 -I$(OUTDIR)/inc/xpdf \
1534 $$(INCLUDE) \
1537 $(call gb_LinkTarget_use_static_libraries,$(1),\
1538 fofi \
1539 Goo \
1540 xpdf \
1543 ifeq ($(OS),MACOSX)
1544 $(call gb_LinkTarget_add_libs,$(1),\
1545 -lobjc \
1547 else ifeq ($(OS),WNT)
1548 $(call gb_LinkTarget_use_system_win32_libs,$(1),\
1549 advapi32 \
1550 gdi32 \
1552 endif
1554 endef
1556 endif # SYSTEM_POPPLER
1559 ifeq ($(SYSTEM_CLUCENE),YES)
1561 define gb_LinkTarget__use_clucene
1562 $(call gb_LinkTarget_add_defs,$(1),\
1563 $(filter-out -I%,$(CLUCENE_CFLAGS)) \
1566 $(call gb_LinkTarget_set_include,$(1),\
1567 $(filter -I%,$(CLUCENE_CFLAGS)) \
1568 $$(INCLUDE) \
1571 $(call gb_LinkTarget_add_libs,$(1),\
1572 $(CLUCENE_LIBS) \
1575 endef
1577 else # !SYSTEM_CLUCENE
1579 define gb_LinkTarget__use_clucene
1580 $(call gb_LinkTarget_use_libraries,$(1),\
1581 clucene \
1584 endef
1586 $(eval $(call gb_Helper_register_libraries,PLAINLIBS_OOO,\
1587 clucene \
1590 endif # SYSTEM_CLUCENE
1592 define gb_LinkTarget__use_gobject
1593 $(call gb_LinkTarget_add_libs,$(1),\
1594 $(GOBJECT_LIBS) \
1597 $(call gb_LinkTarget_set_include,$(1),\
1598 $$(INCLUDE) \
1599 $(GOBJECT_CFLAGS) \
1601 endef
1603 ifeq ($(SYSTEM_HSQLDB),YES)
1605 define gb_LinkTarget__use_hsqldb
1607 $(call gb_LinkTarget_add_defs,$(1),\
1608 -DSYSTEM_HSQLDB \
1609 -DHSQLDB_JAR=\""file://$(HSQLDB_JAR)"\" \
1612 endef
1614 else # !SYSTEM_HSQLDB
1616 define gb_LinkTarget__use_hsqldb
1618 endef
1620 endif # SYSTEM_HSQLDB
1623 ifeq ($(SYSTEM_OPENLDAP),YES)
1625 define gb_LinkTarget__use_openldap
1627 $(call gb_LinkTarget_add_libs,$(1),\
1628 -lldap \
1629 -llber \
1632 endef
1634 else # !SYSTEM_OPENLDAP
1636 $(eval $(call gb_Helper_register_static_libraries,PLAINLIBS,\
1637 ldap \
1638 lber \
1641 define gb_LinkTarget__use_openldap
1642 $(call gb_LinkTarget_use_unpacked,$(1),openldap)
1643 $(call gb_LinkTarget_set_include,$(1),\
1644 -I$(call gb_UnpackedTarball_get_dir,openldap/include) \
1645 $$(INCLUDE) \
1647 $(call gb_LinkTarget_use_package,$(1),openldap)
1648 $(call gb_LinkTarget_use_static_libraries,$(1),\
1649 ldap \
1650 lber \
1653 endef
1655 endif # SYSTEM_OPENLDAP
1658 ifeq ($(SYSTEM_POSTGRESQL),YES)
1660 define gb_LinkTarget__use_postgresql
1662 $(call gb_LinkTarget_set_include,$(1),\
1663 $(POSTGRESQL_INC) \
1664 $$(INCLUDE) \
1667 $(call gb_LinkTarget_add_libs,$(1),\
1668 -lpq \
1671 $(call gb_LinkTarget_add_ldflags,$(1),\
1672 $(POSTGRESQL_LIB) \
1675 endef
1677 else # !SYSTEM_POSTGRESQL
1679 define gb_LinkTarget__use_postgresql
1681 $(call gb_LinkTarget_use_packages,$(1),\
1682 postgresql \
1685 $(call gb_LinkTarget_set_include,$(1),\
1686 -I$(OUTDIR)/inc/postgresql \
1687 $$(INCLUDE) \
1690 $(call gb_LinkTarget_use_static_libraries,$(1),\
1691 $(if $(filter MSC,$(COM)),lib)pq \
1694 ifeq ($(GUI)$(COM),WNTMSC)
1695 $(call gb_LinkTarget_use_external,$(1),openssl)
1697 $(call gb_LinkTarget_use_system_win32_libs,$(1),\
1698 secur32 \
1699 ws2_32 \
1702 endif
1704 endef
1706 $(eval $(call gb_Helper_register_static_libraries,PLAINLIBS,\
1707 $(if $(filter MSC,$(COM)),lib)pq \
1710 endif # SYSTEM_POSTGRESQL
1712 ifneq (,$(filter DESKTOP,$(BUILD_TYPE)))
1713 ifeq ($(SYSTEM_MOZILLA),YES)
1715 # Nothing needed here ATM
1716 define gb_LinkTarget__use_mozilla
1718 endef
1720 else # !SYSTEM_MOZILLA
1722 define gb_LinkTarget__use_mozilla
1724 $(call gb_LinkTarget_add_defs,$(1),\
1725 -DMOZILLA_INTERNAL_API \
1728 $(call gb_LinkTarget_set_include,$(1),\
1729 $$(INCLUDE) \
1730 -I$(OUTDIR)/inc/mozilla/moz \
1731 -I$(OUTDIR)/inc/mozilla/nspr \
1734 $(call gb_LinkTarget_use_libraries,$(1),\
1735 nspr4 \
1736 xpcom \
1737 xpcom_core \
1740 $(call gb_LinkTarget_use_static_libraries,$(1),\
1741 embed_base_s \
1742 mozreg_s \
1745 ifeq ($(GUI),WNT)
1747 $(call gb_LinkTarget_add_defs,$(1),\
1748 -DMOZILLA_CLIENT \
1749 -DMOZ_REFLOW_PERF \
1750 -DMOZ_REFLOW_PERF_DSP \
1751 -DMOZ_XUL \
1752 -DOJI \
1753 -DWIN32 \
1754 -DXP_PC \
1755 -DXP_WIN \
1756 -DXP_WIN32 \
1757 -D_WINDOWS \
1760 ifeq ($(COM),GCC)
1762 $(call gb_LinkTarget_add_cxxflags,$(1),\
1763 -Wall \
1764 -Wcast-align \
1765 -Wconversion \
1766 -Wno-long-long \
1767 -Woverloaded-virtual \
1768 -Wpointer-arith \
1769 -Wsynth \
1770 -fno-rtti \
1773 else
1775 ifneq ($(DBG_LEVEL),0)
1776 $(call gb_LinkTarget_add_defs,$(1),\
1777 -D_STL_NOFORCE_MANIFEST \
1779 endif
1781 $(call gb_LinkTarget_add_libs,$(1),\
1782 $(OUTDIR)/lib/embed_base_s.lib \
1783 $(OUTDIR)/lib/mozreg_s.lib \
1786 endif # !GCC
1788 else ifeq ($(GUI),UNX)
1790 $(call gb_LinkTarget_add_defs,$(1),\
1791 -DMOZILLA_CLIENT \
1792 -DXP_UNIX \
1793 $(if $(filter LINUX,$(OS)),-DOJI) \
1794 $(if $(filter LINUX MACOSX NETBSD,$(OS)),-DTRACING) \
1797 $(call gb_LinkTarget_add_cflags,$(1),\
1798 $(if $(filter LINUX,$(OS)),-g) \
1799 $(if $(filter LINUX MACOSX NETBSD,$(OS)),-fPIC) \
1802 $(call gb_LinkTarget_add_cxxflags,$(1),\
1803 -Wcast-align \
1804 -Wconversion \
1805 -Wno-long-long \
1806 -Woverloaded-virtual \
1807 -Wpointer-arith \
1808 -Wsynth \
1809 $(if $(filter LINUX,$(OS)),-pthread) \
1810 $(if $(filter MACOSX NETBSD,$(OS)),-Wno-deprecated) \
1813 endif # UNX
1815 endef
1817 $(eval $(call gb_Helper_register_libraries,PLAINLIBS_NONE,\
1818 xpcom \
1819 xpcom_core \
1822 $(eval $(call gb_Helper_register_static_libraries,PLAINLIBS,\
1823 embed_base_s \
1824 mozreg_s \
1827 endif # SYSTEM_MOZILLA
1828 endif # DESKTOP
1830 ifeq ($(ENABLE_KDE),TRUE)
1832 define gb_LinkTarget__use_kde
1833 $(call gb_LinkTarget_set_include,$(1),\
1834 $(filter -I%,$(KDE_CFLAGS)) \
1835 $$(INCLUDE) \
1838 $(call gb_LinkTarget_add_defs,$(1),\
1839 $(filter-out -I%,$(KDE_CFLAGS)) \
1842 $(call gb_LinkTarget_add_libs,$(1),\
1843 $(KDE_LIBS) \
1846 ifeq ($(COM),GCC)
1847 $(call gb_LinkTarget_add_cxxflags,$(1),\
1848 -Wno-shadow \
1850 endif
1852 endef
1854 else # !ENABLE_KDE
1856 define gb_LinkTarget__use_kde
1858 endef
1860 endif # ENABLE_KDE
1863 ifeq ($(ENABLE_KDE4),TRUE)
1865 define gb_LinkTarget__use_kde4
1866 $(call gb_LinkTarget_set_include,$(1),\
1867 $(filter -I%,$(KDE4_CFLAGS)) \
1868 $$(INCLUDE) \
1871 $(call gb_LinkTarget_add_defs,$(1),\
1872 $(filter-out -I%,$(KDE4_CFLAGS)) \
1875 $(call gb_LinkTarget_add_libs,$(1),\
1876 $(KDE4_LIBS) \
1879 ifeq ($(COM),GCC)
1880 $(call gb_LinkTarget_add_cxxflags,$(1),\
1881 -Wno-shadow \
1883 endif
1885 endef
1887 else # !ENABLE_KDE4
1889 define gb_LinkTarget__use_kde4
1891 endef
1893 endif # ENABLE_KDE4
1896 ifeq ($(ENABLE_TDE),TRUE)
1898 define gb_LinkTarget__use_tde
1899 $(call gb_LinkTarget_add_libs,$(1),\
1900 $(TDE_LIBS) \
1903 $(call gb_LinkTarget_set_include,$(1),\
1904 $$(INCLUDE) \
1905 $(TDE_CFLAGS) \
1907 endef
1909 else # ! ENABLE_TDE
1911 define gb_LinkTarget__use_tde
1913 endef
1915 endif # ENABLE_TDE
1918 ifeq ($(ENABLE_GCONF),TRUE)
1920 define gb_LinkTarget__use_gconf
1921 $(call gb_LinkTarget_set_include,$(1),\
1922 $(filter -I%,$(GCONF_CFLAGS)) \
1923 $$(INCLUDE) \
1926 $(call gb_LinkTarget_add_defs,$(1),\
1927 $(filter-out -I%,$(GCONF_CFLAGS)) \
1930 $(call gb_LinkTarget_add_libs,$(1),\
1931 $(GCONF_LIBS) \
1934 endef
1936 else # !ENABLE_GCONF
1938 define gb_LinkTarget__use_gconf
1940 endef
1942 endif # ENABLE_GCONF
1945 # PYTHON
1946 # extra python_headers external because pyuno wrapper must not link python
1947 ifeq ($(SYSTEM_PYTHON),YES)
1949 define gb_LinkTarget__use_python_headers
1950 $(call gb_LinkTarget_add_defs,$(1),\
1951 $(filter-out -I%,$(PYTHON_CFLAGS)) \
1954 $(call gb_LinkTarget_set_include,$(1),\
1955 $(filter -I%,$(PYTHON_CFLAGS)) \
1956 $$(INCLUDE) \
1959 endef
1961 define gb_LinkTarget__use_python
1962 $(call gb_LinkTarget__use_python_headers,$(1))
1964 $(call gb_LinkTarget_add_libs,$(1),\
1965 $(PYTHON_LIBS) \
1968 endef
1970 else # !SYSTEM_PYTHON
1972 # depend on external project because on MACOSX the Package is disabled...
1973 define gb_LinkTarget__use_python_headers
1974 $(call gb_LinkTarget_use_package,$(1),python3)
1975 $(call gb_LinkTarget_use_external_project,$(1),python3)
1976 $(call gb_LinkTarget_set_include,$(1),\
1977 -I$(call gb_UnpackedTarball_get_dir,python3) \
1978 -I$(call gb_UnpackedTarball_get_dir,python3)/PC \
1979 -I$(call gb_UnpackedTarball_get_dir,python3)/Include \
1980 $$(INCLUDE) \
1983 endef
1985 define gb_LinkTarget__use_python
1986 $(call gb_LinkTarget__use_python_headers,$(1))
1988 ifeq ($(OS),WNT)
1989 $(call gb_LinkTarget_add_libs,$(1),\
1990 python$(PYTHON_VERSION_MAJOR)$(PYTHON_VERSION_MINOR).lib \
1992 else ifeq ($(OS),MACOSX)
1993 $(call gb_LinkTarget_add_libs,$(1),\
1994 -dylib_file @loader_path/LibreOfficePython.framework/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/LibreOfficePython:$(call gb_UnpackedTarball_get_dir,python3)/python-inst/@__________________________________________________OOO/LibreOfficePython.framework/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/LibreOfficePython \
1995 -F$(call gb_UnpackedTarball_get_dir,python3)/python-inst/@__________________________________________________OOO -framework LibreOfficePython \
1997 else
1998 $(call gb_LinkTarget_use_libraries,$(1),\
1999 python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m \
2001 endif
2003 endef
2005 $(eval $(call gb_Helper_register_libraries,PLAINLIBS_OOO,\
2006 python$(PYTHON_VERSION_MAJOR) \
2007 python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m \
2010 endif # SYSTEM_PYTHON
2012 # ORCUS
2013 ifeq ($(SYSTEM_LIBORCUS),YES)
2015 define gb_LinkTarget__use_orcus
2016 $(call gb_LinkTarget_set_include,$(1),\
2017 $$(INCLUDE) \
2018 $(ORCUS_CFLAGS) \
2020 $(call gb_LinkTarget_add_libs,$(1),$(ORCUS_LIBS))
2022 endef
2024 else # !SYSTEM_LIBORCUS
2026 $(eval $(call gb_Helper_register_static_libraries,PLAINLIBS,\
2027 orcus \
2030 define gb_LinkTarget__use_orcus
2031 $(call gb_LinkTarget_use_unpacked,$(1),orcus)
2032 $(call gb_LinkTarget_set_include,$(1),\
2033 -I$(call gb_UnpackedTarball_get_dir,orcus/include) \
2034 $$(INCLUDE) \
2036 $(call gb_LinkTarget_use_static_libraries,$(1),orcus)
2038 $(if $(filter YES,$(SYSTEM_BOOST)),$(call gb_LinkTarget_add_libs,$(1),$(BOOST_SYSTEM_LIB)))
2040 endef
2042 endif # SYSTEM_LIBORCUS
2045 ### X11 stuff ###
2047 ifeq ($(GUIBASE),unx)
2049 # TODO: do we really need these X11 headers in the repo?
2050 ifneq ($(filter X11_EXTENSIONS,$(BUILD_TYPE)),)
2052 define gb_LinkTarget__use_x11extensions
2053 $(call gb_LinkTarget_use_packages,$(1),\
2054 x11_extensions_inc \
2056 endef
2058 else # !X11_EXTENSIONS
2060 gb_LinkTarget__use_x11extensions :=
2062 endif # X11_EXTENSIONS
2064 ifeq ($(XRANDR_DLOPEN),FALSE)
2066 define gb_LinkTarget__use_Xrandr
2067 $(call gb_LinkTarget__use_x11extensions,$(1))
2069 $(call gb_LinkTarget_set_include,$(1),\
2070 $$(INCLUDE) \
2071 $(XRANDR_CFLAGS) \
2074 $(call gb_LinkTarget_add_libs,$(1),\
2075 $(XRANDR_LIBS) \
2077 endef
2079 else # XRANDR_DLOPEN
2081 define gb_LinkTarget__use_Xrandr
2082 $(call gb_LinkTarget__use_x11extensions,$(1))
2084 $(call gb_LinkTarget_add_defs,$(1),\
2085 -DXRANDR_DLOPEN \
2087 endef
2089 endif # XRANDR_DLOPEN
2091 define gb_LinkTarget__use_Xrender
2092 $(call gb_LinkTarget__use_x11extensions,$(1))
2094 $(call gb_LinkTarget_set_include,$(1),\
2095 $$(INCLUDE) \
2096 $(XRENDER_CFLAGS) \
2099 $(call gb_LinkTarget_add_libs,$(1),\
2100 $(XRENDER_LIBS) \
2102 endef
2104 endif # GUIBASE=unx
2107 ifeq (,$(filter DESKTOP,$(BUILD_TYPE)))
2109 define gb_LinkTarget__use_nss3
2111 endef
2113 else
2115 ifeq ($(SYSTEM_NSS),YES)
2117 define gb_LinkTarget__use_nss3
2118 $(call gb_LinkTarget_add_defs,$(1),\
2119 -DSYSTEM_NSS \
2122 $(call gb_LinkTarget_set_include,$(1),\
2123 $$(INCLUDE) \
2124 $(NSS_CFLAGS) \
2127 $(call gb_LinkTarget_add_libs,$(1),\
2128 $(NSS_LIBS) \
2131 endef
2133 define gb_LinkTarget__use_plc4
2134 $(call gb_LinkTarget__use_nss3,$(1))
2136 endef
2138 else
2140 $(eval $(call gb_Helper_register_libraries,PLAINLIBS_OOO,\
2141 nspr4 \
2142 nss3 \
2143 plc4 \
2144 smime3 \
2147 define gb_LinkTarget__use_nss3
2148 $(call gb_LinkTarget_set_include,$(1),\
2149 $$(INCLUDE) \
2150 -I$(OUTDIR)/inc/mozilla/nspr \
2151 -I$(OUTDIR)/inc/mozilla/nss \
2154 $(call gb_LinkTarget_use_libraries,$(1),\
2155 nspr4 \
2156 nss3 \
2157 smime3 \
2160 endef
2162 define gb_LinkTarget__use_plc4
2163 $(call gb_LinkTarget_use_libraries,$(1),\
2164 plc4 \
2167 endef
2169 endif
2170 endif # DESKTOP
2172 ### Jars ############################################################
2174 ifeq ($(SYSTEM_HSQLDB),YES)
2176 define gb_Jar__use_hsqldb
2177 $(call gb_Jar_use_system_jar,$(1),$(HSQLDB_JAR))
2178 endef
2179 define gb_JunitTest__use_hsqldb
2180 $(call gb_JunitTest_use_system_jar,$(1),$(HSQLDB_JAR))
2181 endef
2183 else # !SYSTEM_HSQLDB
2185 $(eval $(call gb_Helper_register_jars,OOO,\
2186 hsqldb \
2189 define gb_Jar__use_hsqldb
2190 $(call gb_Jar_use_jar,$(1),hsqldb)
2191 endef
2192 define gb_JunitTest__use_hsqldb
2193 $(call gb_JunitTest_use_jar,$(1),hsqldb)
2194 endef
2196 endif # SYSTEM_HSQLDB
2199 ifeq ($(SYSTEM_BSH),YES)
2201 define gb_Jar__use_bsh
2202 $(call gb_Jar_use_system_jar,$(1),$(BSH_JAR))
2203 endef
2205 else # !SYSTEM_BSH
2207 $(eval $(call gb_Helper_register_jars,OOO,\
2208 bsh \
2211 define gb_Jar__use_bsh
2212 $(call gb_Jar_use_jar,$(1),bsh)
2213 endef
2215 endif # SYSTEM_BSH
2218 ifeq ($(SYSTEM_RHINO),YES)
2220 define gb_Jar__use_rhino
2221 $(call gb_Jar_use_system_jar,$(1),$(RHINO_JAR))
2222 endef
2224 else # !SYSTEM_RHINO
2226 $(eval $(call gb_Helper_register_jars,OOO,\
2227 js \
2230 define gb_Jar__use_rhino
2231 $(call gb_Jar_use_jar,$(1),js)
2232 endef
2234 endif # SYSTEM_RHINO
2236 ifeq ($(SYSTEM_APACHE_COMMONS),YES)
2238 define gb_Jar__use_commons-codec
2239 $(call gb_Jar_use_system_jar,$(1),$(COMMONS_CODEC_JAR))
2240 endef
2241 gb_ExternalProject__use_commons-codec :=
2243 define gb_Jar__use_commons-httpclient
2244 $(call gb_Jar_use_system_jar,$(1),$(COMMONS_HTTPCLIENT_JAR))
2245 endef
2246 gb_ExternalProject__use_commons-httpclient :=
2248 define gb_Jar__use_commons-lang
2249 $(call gb_Jar_usadd_linked_libse_system_jar,$(1),$(COMMONS_LANG_JAR))
2250 endef
2251 gb_ExternalProject__use_commons-lang :=
2253 define gb_Jar__use_commons-logging
2254 $(call gb_Jar_use_system_jar,$(1),$(COMMONS_LOGGING_JAR))
2255 endef
2256 gb_ExternalProject__use_commons-logging :=
2258 else # !SYSTEM_APACHE_COMMONS
2260 $(eval $(call gb_Helper_register_jars,OXT,\
2261 commons-codec-1.3 \
2262 commons-httpclient-3.1 \
2263 commons-lang-2.3 \
2264 commons-logging-1.1.1 \
2267 define gb_Jar__use_commons-codec
2268 $(call gb_Jar_use_jar,$(1),commons-codec-1.3)
2269 endef
2270 define gb_ExternalProject__use_commons-codec
2271 $(call gb_ExternalProject_use_external_project,$(1),apache_commons_codec)
2272 endef
2274 define gb_Jar__use_commons-httpclient
2275 $(call gb_Jar_use_jar,$(1),commons-httpclient-3.1)
2276 endef
2277 define gb_ExternalProject__use_commons-httpclient
2278 $(call gb_ExternalProject_use_external_project,$(1),apache_commons_httpclient)
2279 endef
2281 define gb_Jar__use_commons-lang
2282 $(call gb_Jar_use_jar,$(1),commons-lang-2.3)
2283 endef
2284 define gb_ExternalProject__use_commons-lang
2285 $(call gb_ExternalProject_use_external_project,$(1),apache_commons_lang)
2286 endef
2288 define gb_Jar__use_commons-logging
2289 $(call gb_Jar_use_jar,$(1),commons-logging-1.1.1)
2290 endef
2291 define gb_ExternalProject__use_commons-logging
2292 $(call gb_ExternalProject_use_external_project,$(1),apache_commons_logging)
2293 endef
2295 endif # SYSTEM_APACHE_COMMONS
2298 ifeq ($(SYSTEM_JFREEREPORT),YES)
2300 define gb_Jar__use_flow-engine
2301 $(call gb_Jar_use_system_jar,$(1),$(JFREEREPORT_JAR))
2302 endef
2304 define gb_Jar__use_flute
2305 $(call gb_Jar_use_system_jar,$(1),$(FLUTE_JAR))
2306 endef
2308 define gb_Jar__use_libbase
2309 $(call gb_Jar_use_system_jar,$(1),$(LIBBASE_JAR))
2310 endef
2312 define gb_Jar__use_libfonts
2313 $(call gb_Jar_use_system_jar,$(1),$(LIBFONTS_JAR))
2314 endef
2316 define gb_Jar__use_libformula
2317 $(call gb_Jar_use_system_jar,$(1),$(LIBFORMULA_JAR))
2318 endef
2320 define gb_Jar__use_liblayout
2321 $(call gb_Jar_use_system_jar,$(1),$(LIBLAYOUT_JAR))
2322 endef
2324 define gb_Jar__use_libloader
2325 $(call gb_Jar_use_system_jar,$(1),$(LIBLOADER_JAR))
2326 endef
2328 define gb_Jar__use_librepository
2329 $(call gb_Jar_use_system_jar,$(1),$(LIBREPOSITORY_JAR))
2330 endef
2332 define gb_Jar__use_libserializer
2333 $(call gb_Jar_use_system_jar,$(1),$(LIBSERIALIZER_JAR))
2334 endef
2336 define gb_Jar__use_libxml
2337 $(call gb_Jar_use_system_jar,$(1),$(LIBXML_JAR))
2338 endef
2340 define gb_Jar__use_sac
2341 $(call gb_Jar_use_system_jar,$(1),$(SAC_JAR))
2342 endef
2344 else # !SYSTEM_JFREEREPORT
2346 $(eval $(call gb_Helper_register_jars,OXT,\
2347 flow-engine-0.9.4 \
2348 flute-1.1.6 \
2349 libbase-1.1.6 \
2350 libfonts-1.1.6 \
2351 libformula-1.1.7 \
2352 liblayout-0.2.10 \
2353 libloader-1.1.6 \
2354 librepository-1.1.6 \
2355 libserializer-1.1.6 \
2356 libxml-1.1.7 \
2357 sac \
2360 define gb_Jar__use_flow-engine
2361 $(call gb_Jar_use_jar,$(1),flow-engine-0.9.4)
2362 endef
2364 define gb_Jar__use_flute
2365 $(call gb_Jar_use_jar,$(1),flute-1.1.6)
2366 endef
2368 define gb_Jar__use_libbase
2369 $(call gb_Jar_use_jar,$(1),libbase-1.1.6)
2370 endef
2372 define gb_Jar__use_libfonts
2373 $(call gb_Jar_use_jar,$(1),libfonts-1.1.6)
2374 endef
2376 define gb_Jar__use_libformula
2377 $(call gb_Jar_use_jar,$(1),libformula-1.1.7)
2378 endef
2380 define gb_Jar__use_liblayout
2381 $(call gb_Jar_use_jar,$(1),liblayout-0.2.10)
2382 endef
2384 define gb_Jar__use_libloader
2385 $(call gb_Jar_use_jar,$(1),libloader-1.1.6)
2386 endef
2388 define gb_Jar__use_librepository
2389 $(call gb_Jar_use_jar,$(1),librepository-1.1.6)
2390 endef
2392 define gb_Jar__use_libserializer
2393 $(call gb_Jar_use_jar,$(1),libserializer-1.1.6)
2394 endef
2396 define gb_Jar__use_libxml
2397 $(call gb_Jar_use_jar,$(1),libxml-1.1.7)
2398 endef
2400 define gb_Jar__use_sac
2401 $(call gb_Jar_use_jar,$(1),sac)
2402 endef
2404 endif # SYSTEM_JFREEREPORT
2407 # Executables
2409 ifneq ($(SYSTEM_LIBXML_FOR_BUILD),YES)
2411 gb_ExternalExecutable__register_xmllint :=
2413 else # ! SYSTEM_LIBXML_FOR_BUILD
2415 define gb_ExternalExecutable__register_xmllint
2416 $(call gb_ExternalExecutable_set_internal,xmllint)
2418 endef
2420 endif # SYSTEM_LIBXML_FOR_BUILD
2422 ifeq ($(SYSTEM_LIBXSLT_FOR_BUILD),YES)
2424 gb_ExternalExecutable__register_xsltproc :=
2426 else # ! SYSTEM_LIBXSLT_FOR_BUILD
2428 define gb_ExternalExecutable__register_xsltproc
2429 $(call gb_ExternalExecutable_set_internal,xsltproc)
2431 endef
2433 endif # SYSTEM_LIBXSLT_FOR_BUILD
2435 ifneq (,$(SYSTEM_UCPP))
2437 gb_ExternalExecutable__register_ucpp :=
2439 else # ! SYSTEM_UCPP
2441 define gb_ExternalExecutable__register_ucpp
2442 $(call gb_ExternalExecutable_set_internal,ucpp)
2444 endef
2446 endif # SYSTEM_UCPP
2448 # TODO what do do with gb_PYTHON_PRECOMMAND? Move here?
2449 ifeq ($(SYSTEM_PYTHON),YES)
2451 define gb_ExternalExecutable__register_python
2452 $(call gb_ExternalExecutable_set_external,python,$(PYTHON))
2454 endef
2456 else ifeq ($(OS),MACOSX)
2458 #fixme: remove this MACOSX ifeq branch by filling in gb_PYTHON_PRECOMMAND in
2459 #gbuild/platform/macosx.mk correctly for mac, e.g. PYTHONPATH and PYTHONHOME
2460 #dirs for in-tree internal python
2461 define gb_ExternalExecutable__register_python
2462 $(call gb_ExternalExecutable_set_external,python,$(PYTHON))
2464 endef
2466 else ifeq ($(DISABLE_PYTHON),TRUE)
2468 # Build-time python
2469 gb_ExternalExecutable__register_python :=
2471 else # ! SYSTEM_PYTHON
2473 # internal python
2474 define gb_ExternalExecutable__register_python
2475 $(call gb_ExternalExecutable_set_internal,python)
2476 $(call gb_ExternalExecutable_set_precommand,python,$(gb_PYTHON_PRECOMMAND))
2477 $(call gb_ExternalExecutable_add_dependencies,python,\
2478 $(call gb_Package_get_target,python3) \
2481 endef
2483 endif # SYSTEM_PYTHON
2485 # vim: set noet sw=4 ts=4: