RepositoryExternal.mk 84.7 KB
Newer Older
1
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
2
#
3
# This file is part of the LibreOffice project.
4
#
5 6 7
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
8
#
9
# This file incorporates work covered by the following license notice:
10
#
11 12 13 14 15 16 17
#   Licensed to the Apache Software Foundation (ASF) under one or more
#   contributor license agreements. See the NOTICE file distributed
#   with this work for additional information regarding copyright
#   ownership. The ASF licenses this file to you under the Apache
#   License, Version 2.0 (the "License"); you may not use this file
#   except in compliance with the License. You may obtain a copy of
#   the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 19 20 21 22 23
#

# this file describes all the external libraries
# depending on the configure options these may be taken from the system,
# or the internal/bundled copy may be built.

24
# for every external, a function gb_LinkTarget__use_FOO is defined,
25 26 27 28 29
# once for the system case, once for the internal case.

# in the system case, no libraries should be registered, but the target-local
# variable LIBS should be set to FOO_LIBS, and INCLUDES to FOO_CFLAGS.

30 31 32 33 34 35 36 37

ifeq ($(CPUNAME),X86_64)
wnt_arch_subdir_optional=x64/
wnt_arch_subdir_mandatory=x64
else ifeq ($(CPUNAME),INTEL)
wnt_arch_subdir_mandatory=Win32
endif

38 39
# External headers

40
ifneq ($(SYSTEM_ODBC_HEADERS),)
41 42 43 44 45 46 47 48

define gb_LinkTarget__use_odbc_headers
$(call gb_LinkTarget_add_defs,$(1),\
	-DSYSTEM_ODBC_HEADERS \
)

endef

49
else # !SYSTEM_ODBC_HEADERS
50 51

define gb_LinkTarget__use_odbc_headers
52
$(call gb_LinkTarget_set_include,$(1),\
53
	-I$(SRCDIR)/external/unixODBC/inc \
54 55
	$$(INCLUDE) \
)
56 57 58

endef

59
endif # SYSTEM_ODBC_HEADERS
60

61
ifneq ($(SYSTEM_MDDS),)
Matúš Kukan's avatar
Matúš Kukan committed
62

63 64
gb_ExternalProject__use_mdds_headers :=

65 66 67 68 69 70 71
define gb_LinkTarget__use_mdds_headers
$(call gb_LinkTarget_set_include,$(1),\
	$(MDDS_CFLAGS) \
	$$(INCLUDE) \
)

endef
Matúš Kukan's avatar
Matúš Kukan committed
72

73
else # !SYSTEM_MDDS
Matúš Kukan's avatar
Matúš Kukan committed
74

75
define gb_ExternalProject__use_mdds_headers
David Tardon's avatar
David Tardon committed
76
$(call gb_ExternalProject_use_unpacked,$(1),mdds)
77 78 79

endef

Matúš Kukan's avatar
Matúš Kukan committed
80 81 82
define gb_LinkTarget__use_mdds_headers
$(call gb_LinkTarget_use_unpacked,$(1),mdds)
$(call gb_LinkTarget_set_include,$(1),\
83
	$(MDDS_CFLAGS) \
Matúš Kukan's avatar
Matúš Kukan committed
84 85 86 87 88
	$$(INCLUDE) \
)

endef

89
endif # SYSTEM_MDDS
Matúš Kukan's avatar
Matúš Kukan committed
90

91
ifneq ($(SYSTEM_GLM),)
92 93

gb_LinkTarget__use_glm_headers :=
94
gb_ExternalProject__use_glm_headers :=
95 96 97 98 99 100

else

define gb_LinkTarget__use_glm_headers
$(call gb_LinkTarget_use_unpacked,$(1),glm)
$(call gb_LinkTarget_set_include,$(1),\
101
	$(GLM_CFLAGS) \
102 103 104 105 106
	$$(INCLUDE) \
)

endef

107
define gb_ExternalProject__use_glm_headers
David Tardon's avatar
David Tardon committed
108
$(call gb_ExternalProject_use_unpacked,$(1),glm)
109 110 111

endef

112 113
endif

114
ifeq (SANE,$(filter SANE,$(BUILD_TYPE)))
115 116

define gb_LinkTarget__use_sane_headers
Michael Stahl's avatar
Michael Stahl committed
117
$(call gb_LinkTarget_set_include,$(1),\
118 119 120 121
    $(if $(filter WNT,$(OS)), \
        -I$(call gb_UnpackedTarball_get_dir,twain_dsm/pub/include), \
        -I$(SRCDIR)/external/sane/inc) \
    $$(INCLUDE) \
122 123
)

124 125 126 127
ifeq ($(OS),WNT)
$(call gb_LinkTarget_use_unpacked,$(1),twain_dsm)
endif

128 129 130 131 132 133 134 135
endef

else

gb_LinkTarget__use_sane_headers :=

endif

136
ifneq ($(SYSTEM_BLUEZ),)
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151

gb_LinkTarget__use_bluez_bluetooth_headers :=

else # !SYSTEM_BLUEZ

define gb_LinkTarget__use_bluez_bluetooth_headers
$(call gb_LinkTarget_set_include,$(1),\
	-I$(SRCDIR)/external/bluez_bluetooth/inc \
	$$(INCLUDE) \
)

endef

endif # SYSTEM_BLUEZ

152 153
# External libraries

154
ifneq ($(SYSTEM_CPPUNIT),)
David Tardon's avatar
David Tardon committed
155 156 157 158 159 160 161 162 163 164

define gb_LinkTarget__use_cppunit
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
    $(CPPUNIT_CFLAGS) \
)

$(call gb_LinkTarget_add_libs,$(1),\
    $(CPPUNIT_LIBS) \
)
165

David Tardon's avatar
David Tardon committed
166 167
endef

168
else # !SYSTEM_CPPUNIT
David Tardon's avatar
David Tardon committed
169 170

define gb_LinkTarget__use_cppunit
171
$(call gb_LinkTarget_use_external_project,$(1),cppunit, full)
Peter Foley's avatar
Peter Foley committed
172 173

$(call gb_LinkTarget_set_include,$(1),\
174
	-I$(call gb_UnpackedTarball_get_dir,cppunit/include)\
Peter Foley's avatar
Peter Foley committed
175 176
	$$(INCLUDE) \
)
177

178 179 180 181 182 183 184 185 186 187
ifeq ($(COM),MSC)
$(call gb_LinkTarget_add_libs,$(1),\
	$(call gb_UnpackedTarball_get_dir,cppunit)/src/cppunit/$(if $(MSVC_USE_DEBUG_RUNTIME),DebugDll/cppunitd_dll.lib,ReleaseDll/cppunit_dll.lib) \
)
else
$(call gb_LinkTarget_add_libs,$(1),\
	-L$(call gb_UnpackedTarball_get_dir,cppunit)/src/cppunit/.libs -lcppunit \
)
endif

David Tardon's avatar
David Tardon committed
188 189
endef

190
endif # SYSTEM_CPPUNIT
191

192
ifneq ($(SYSTEM_EPOXY),)
David Tardon's avatar
David Tardon committed
193

194
define gb_LinkTarget__use_epoxy
David Tardon's avatar
David Tardon committed
195 196
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
197
    $(EPOXY_CFLAGS) \
David Tardon's avatar
David Tardon committed
198
)
199
$(call gb_LinkTarget_add_libs,$(1),$(EPOXY_LIBS))
David Tardon's avatar
David Tardon committed
200 201 202

endef

203
gb_ExternalProject__use_epoxy :=
204

205
else # !SYSTEM_EPOXY
David Tardon's avatar
David Tardon committed
206

207
define gb_LinkTarget__use_epoxy
David Tardon's avatar
David Tardon committed
208
$(call gb_LinkTarget_set_include,$(1),\
209 210
       -I$(call gb_UnpackedTarball_get_dir,epoxy/include) \
       $$(INCLUDE) \
David Tardon's avatar
David Tardon committed
211 212
)

213 214
$(call gb_LinkTarget_use_libraries,$(1),\
    epoxy \
David Tardon's avatar
David Tardon committed
215 216 217 218
)

endef

219 220 221 222 223 224
$(eval $(call gb_Helper_register_libraries_for_install,PLAINLIBS_OOO,ooo,\
	epoxy \
))

define gb_ExternalProject__use_epoxy
$(call gb_ExternalProject_use_external_project,$(1),epoxy)
225 226 227

endef

228
endif # SYSTEM_EPOXY
David Tardon's avatar
David Tardon committed
229

Tor Lillqvist's avatar
Tor Lillqvist committed
230
define gb_LinkTarget__use_iconv
231 232 233
ifeq ($(COM),MSC)
$(call gb_LinkTarget_add_libs,$(1),libiconv.lib)
else
Tor Lillqvist's avatar
Tor Lillqvist committed
234
$(call gb_LinkTarget_add_libs,$(1),-liconv)
235
endif
Tor Lillqvist's avatar
Tor Lillqvist committed
236 237
endef

238
ifneq ($(SYSTEM_MARIADB_CONNECTOR_C),)
239

240
define gb_LinkTarget__use_mariadb-connector-c
241 242 243 244 245 246 247
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
    $(MARIADB_CFLAGS) \
)
$(call gb_LinkTarget_add_libs,$(1),$(MARIADB_LIBS))

endef
248
gb_ExternalProject__use_mariadb-connector-c :=
249

250
else # !SYSTEM_MARIADB_CONNECTOR_C
251

252
define gb_LinkTarget__use_mariadb-connector-c
253 254 255 256 257
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
	$(MARIADB_CFLAGS) \
)
$(call gb_LinkTarget_use_static_libraries,$(1),\
258
	mariadb-connector-c \
259
)
260 261 262 263 264
ifeq ($(OS),MACOSX)
$(call gb_LinkTarget_add_libs,$(1),\
	-liconv \
)
endif
265 266

endef
267 268
define gb_ExternalProject__use_mariadb-connector-c
$(call gb_ExternalProject_use_static_libraries,$(1),mariadb-connector-c)
269 270 271

endef

272
endif # SYSTEM_MARIADB_CONNECTOR_C
273 274


275
ifneq ($(SYSTEM_MARIADB_CONNECTOR_C),)
276 277 278 279

define gb_LinkTarget__use_mysql

$(call gb_LinkTarget_add_defs,$(1),\
280
	-DSYSTEM_MARIADB \
281 282 283
)

$(call gb_LinkTarget_add_libs,$(1),\
284
	$(MARIADB_LIBS) \
285 286 287
)

$(call gb_LinkTarget_set_include,$(1),\
288
	$(MARIADB_CFLAGS) \
289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304
	$$(INCLUDE) \
)
endef

else

define gb_LinkTarget__use_mysql

$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
)

endef

endif

305
ifneq ($(SYSTEM_ZLIB),)
306 307

define gb_LinkTarget__use_zlib
308
$(call gb_LinkTarget_add_defs,$(1),\
309 310 311
	-DSYSTEM_ZLIB \
)
$(call gb_LinkTarget_add_libs,$(1),-lz)
312

313 314
endef

David Tardon's avatar
David Tardon committed
315 316 317 318 319
# nothing on system
define gb_LinkTarget__use_zlib_x64

endef

320 321
gb_ExternalProject__use_zlib :=

322 323
else # !SYSTEM_ZLIB

David Tardon's avatar
David Tardon committed
324 325 326
define gb_LinkTarget__use_zlib_multiarch
$(if $(2),,$(call gb_Output_error,gb_LinkTarget__use_zlib_multiarch needs two arguments))

327
$(call gb_LinkTarget_set_include,$(1),\
328
	$(ZLIB_CFLAGS) \
329 330
	$$(INCLUDE) \
)
David Tardon's avatar
David Tardon committed
331

Michael Stahl's avatar
Michael Stahl committed
332
$(call gb_LinkTarget_use_static_libraries,$(1),\
David Tardon's avatar
David Tardon committed
333
	$(2) \
334
)
335

336 337
endef

David Tardon's avatar
David Tardon committed
338 339 340 341 342 343 344 345 346 347
define gb_LinkTarget__use_zlib
$(call gb_LinkTarget__use_zlib_multiarch,$(1),zlib)

endef

define gb_LinkTarget__use_zlib_x64
$(call gb_LinkTarget__use_zlib_multiarch,$(1),zlib_x64)

endef

348 349 350 351 352
define gb_ExternalProject__use_zlib
$(call gb_ExternalProject_use_static_libraries,$(1),zlib)

endef

353 354 355
endif # SYSTEM_ZLIB


356
ifneq ($(SYSTEM_LIBJPEG),)
357

358
define gb_LinkTarget__use_libjpeg
359
$(call gb_LinkTarget_add_libs,$(1),$(LIBJPEG_LIBS))
360
$(call gb_LinkTarget_set_ldflags,$(1),\
361
	$$(filter-out -L/usr/lib/jvm%,$$(T_LDFLAGS)) \
362
)
363

364 365
endef

366
gb_ExternalProject__use_libjpeg :=
367

368
else
369

370
define gb_LinkTarget__use_libjpeg
371
$(call gb_LinkTarget_set_include,$(1),\
372
	$(LIBJPEG_CFLAGS) \
373 374
	$$(INCLUDE) \
)
375
$(call gb_LinkTarget_add_libs,$(1),$(LIBJPEG_LIBS))
376
$(call gb_LinkTarget_use_external_project,$(1),libjpeg-turbo,full)
377 378 379

endef

380 381
define gb_ExternalProject__use_libjpeg
$(call gb_ExternalProject_use_external_project,$(1),libjpeg-turbo)
382 383 384

endef

385
endif # SYSTEM_LIBJPEG
386

387
ifneq ($(SYSTEM_MYTHES),)
Peter Foley's avatar
Peter Foley committed
388 389

define gb_LinkTarget__use_mythes
390 391 392 393 394 395
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
	$(MYTHES_CFLAGS) \
)
$(call gb_LinkTarget_add_libs,$(1),$(MYTHES_LIBS))

Peter Foley's avatar
Peter Foley committed
396 397 398 399 400
endef

else # !SYSTEM_MYTHES

define gb_LinkTarget__use_mythes
401 402 403 404
$(call gb_LinkTarget_set_include,$(1),\
	-I$(call gb_UnpackedTarball_get_dir,mythes) \
	$$(INCLUDE) \
)
405 406

ifeq ($(COM),MSC)
407 408
$(call gb_LinkTarget_use_static_libraries,$(1),\
	mythes \
Peter Foley's avatar
Peter Foley committed
409
)
410 411 412 413
else
$(call gb_LinkTarget_add_libs,$(1),$(MYTHES_LIBS))
$(call gb_LinkTarget_use_external_project,$(1),mythes)
endif
414

Peter Foley's avatar
Peter Foley committed
415 416 417 418
endef

endif # SYSTEM_MYTHES

419

420
ifneq ($(SYSTEM_EXPAT),)
421

422 423
define gb_LinkTarget__use_expat_impl
$(if $(2),,$(error gb_LinkTarget__use_expat_impl needs additional parameter))
424

425
$(call gb_LinkTarget_add_defs,$(1),\
426 427 428 429
	-DSYSTEM_EXPAT \
)

$(call gb_LinkTarget_add_libs,$(1),-lexpat)
430

431 432
endef

433 434
gb_ExternalProject__use_expat :=

435 436
else # !SYSTEM_EXPAT

437 438
define gb_LinkTarget__use_expat_impl
$(if $(2),,$(error gb_LinkTarget__use_expat_impl needs additional parameter))
439

440
$(call gb_LinkTarget_set_include,$(1),\
441
	-I$(call gb_UnpackedTarball_get_dir,expat)/lib \
442 443 444
    $$(INCLUDE) \
)

Michael Stahl's avatar
Michael Stahl committed
445
$(call gb_LinkTarget_use_static_libraries,$(1),\
446 447
	$(2) \
)
448

449 450
endef

451 452 453 454 455
define gb_ExternalProject__use_expat
$(call gb_ExternalProject_use_static_libraries,$(1),expat)

endef

456 457
endif # SYSTEM_EXPAT

458 459
define gb_LinkTarget__use_expat
$(call gb_LinkTarget__use_expat_impl,$(1),expat)
460

461 462
endef

463 464
define gb_LinkTarget__use_expat_x64
$(call gb_LinkTarget__use_expat_impl,$(1),expat_x64)
465

466 467
endef

468
ifneq ($(SYSTEM_HYPH),)
Peter Foley's avatar
Peter Foley committed
469 470 471 472 473 474 475 476 477 478 479

define gb_LinkTarget__use_hyphen
$(call gb_LinkTarget_add_libs,$(1),$(HYPHEN_LIB))

endef

else # !SYSTEM_HYPH

define gb_LinkTarget__use_hyphen
$(call gb_LinkTarget_use_unpacked,$(1),hyphen)
$(call gb_LinkTarget_set_include,$(1),\
480
	-I$(call gb_UnpackedTarball_get_dir,hyphen)\
Peter Foley's avatar
Peter Foley committed
481 482
	$$(INCLUDE) \
)
483 484

ifeq ($(COM),MSC)
Peter Foley's avatar
Peter Foley committed
485 486 487
$(call gb_LinkTarget_use_static_libraries,$(1),\
	hyphen \
)
488 489 490 491
else
$(call gb_LinkTarget_add_libs,$(1),$(HYPHEN_LIB))
$(call gb_LinkTarget_use_external_project,$(1),hyphen)
endif
Peter Foley's avatar
Peter Foley committed
492 493 494 495 496

endef

endif # SYSTEM_HYPH

497
ifneq ($(SYSTEM_HUNSPELL),)
498 499 500 501 502 503 504 505 506 507

define gb_LinkTarget__use_hunspell
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
	$(HUNSPELL_CFLAGS) \
)
$(call gb_LinkTarget_add_libs,$(1),$(HUNSPELL_LIBS))

endef

508 509
gb_ExternalProject__use_hunspell :=

510 511 512 513 514 515
else # !SYSTEM_HUNSPELL

define gb_LinkTarget__use_hunspell
$(call gb_LinkTarget_add_defs,$(1),\
	-DHUNSPELL_STATIC \
)
516
$(call gb_LinkTarget_use_unpacked,$(1),hunspell)
517
$(call gb_LinkTarget_set_include,$(1),\
518
	-I$(call gb_UnpackedTarball_get_dir,hunspell/src/hunspell)\
519
	$$(INCLUDE) \
520
)
521 522

ifeq ($(COM),MSC)
Michael Stahl's avatar
Michael Stahl committed
523
$(call gb_LinkTarget_use_static_libraries,$(1),\
524
	hunspell \
525
)
526 527 528 529 530 531 532 533 534
else
$(call gb_LinkTarget_add_libs,$(1),$(HUNSPELL_LIBS))
$(call gb_LinkTarget_use_external_project,$(1),hunspell)
endif

endef

define gb_ExternalProject__use_hunspell
$(call gb_ExternalProject_use_external_project,$(1),hunspell)
535 536 537 538 539 540

endef

endif # SYSTEM_HUNSPELL


541
ifneq ($(SYSTEM_BOOST),)
542

David Tardon's avatar
David Tardon committed
543
define gb_LinkTarget__use_boost_lib
544 545 546 547 548 549 550 551 552
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
	$(BOOST_CPPFLAGS) \
)

$(call gb_LinkTarget_add_ldflags,$(1),\
	$(BOOST_LDFLAGS) \
)

David Tardon's avatar
David Tardon committed
553
$(call gb_LinkTarget_add_libs,$(1),$(2))
554

555 556
endef

557 558 559 560 561
define gb_LinkTarget__use_boost_locale
$(call gb_LinkTarget__use_boost_lib,$(1),$(BOOST_LOCALE_LIB))

endef

562
define gb_LinkTarget__use_boost_date_time
David Tardon's avatar
David Tardon committed
563
$(call gb_LinkTarget__use_boost_lib,$(1),$(BOOST_DATE_TIME_LIB))
Markus Mohrhard's avatar
Markus Mohrhard committed
564

David Tardon's avatar
David Tardon committed
565
endef
Markus Mohrhard's avatar
Markus Mohrhard committed
566

567 568 569 570 571 572 573
define gb_LinkTarget__use_boost_filesystem
$(call gb_LinkTarget__use_boost_lib,$(1),$(BOOST_FILESYSTEM_LIB))

endef

gb_ExternalProject__use_boost_filesystem :=

David Tardon's avatar
David Tardon committed
574 575
define gb_LinkTarget__use_boost_iostreams
$(call gb_LinkTarget__use_boost_lib,$(1),$(BOOST_IOSTREAMS_LIB))
Markus Mohrhard's avatar
Markus Mohrhard committed
576 577 578

endef

579 580
gb_ExternalProject__use_boost_iostreams :=

Markus Mohrhard's avatar
Markus Mohrhard committed
581
define gb_LinkTarget__use_boost_system
David Tardon's avatar
David Tardon committed
582
$(call gb_LinkTarget__use_boost_lib,$(1),$(BOOST_SYSTEM_LIB))
583 584 585

endef

Markus Mohrhard's avatar
Markus Mohrhard committed
586
gb_ExternalProject__use_boost_system :=
587

588 589 590 591 592 593 594 595
define gb_LinkTarget__use_boost_headers
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
	$(BOOST_CPPFLAGS) \
)

endef

Peter Foley's avatar
Peter Foley committed
596 597
gb_ExternalProject__use_boost_headers:=

598 599
else # !SYSTEM_BOOST

David Tardon's avatar
David Tardon committed
600
define gb_LinkTarget__use_boost_lib
601 602 603 604
$(call gb_LinkTarget_add_defs,$(1),\
	-DBOOST_ALL_NO_LIB \
)

David Tardon's avatar
David Tardon committed
605 606 607 608
$(call gb_LinkTarget_use_static_libraries,$(1),$(2))

endef

609 610 611 612 613 614 615 616
define gb_LinkTarget__use_boost_locale
$(call gb_LinkTarget__use_boost_lib,$(1),boost_locale)
$(call gb_LinkTarget_add_libs,$(1),\
	$(if $(filter $(OS),MACOSX),-liconv) \
)

endef

617 618
define gb_LinkTarget__use_boost_date_time
$(call gb_LinkTarget__use_boost_lib,$(1),boost_date_time)
619 620 621

endef

David Tardon's avatar
David Tardon committed
622
define gb_LinkTarget__use_boost_filesystem
David Tardon's avatar
David Tardon committed
623
$(call gb_LinkTarget__use_boost_lib,$(1),boost_filesystem)
David Tardon's avatar
David Tardon committed
624 625 626 627 628 629 630

endef

define gb_ExternalProject__use_boost_filesystem
$(call gb_ExternalProject_use_static_libraries,$(1),boost_filesystem)
endef

Markus Mohrhard's avatar
Markus Mohrhard committed
631
define gb_LinkTarget__use_boost_iostreams
David Tardon's avatar
David Tardon committed
632
$(call gb_LinkTarget__use_boost_lib,$(1),boost_iostreams)
Markus Mohrhard's avatar
Markus Mohrhard committed
633 634 635 636 637 638 639 640

endef

define gb_ExternalProject__use_boost_iostreams
$(call gb_ExternalProject_use_static_libraries,$(1),boost_iostreams)
endef

define gb_LinkTarget__use_boost_system
David Tardon's avatar
David Tardon committed
641
$(call gb_LinkTarget__use_boost_lib,$(1),boost_system)
642 643 644

endef

Markus Mohrhard's avatar
Markus Mohrhard committed
645 646
define gb_ExternalProject__use_boost_system
$(call gb_ExternalProject_use_static_libraries,$(1),boost_system)
647 648
endef

Peter Foley's avatar
Peter Foley committed
649
define gb_LinkTarget__use_boost_headers
650
$(call gb_LinkTarget_use_unpacked,$(1),boost)
651
$(call gb_LinkTarget_set_include,$(1),\
652
	$(BOOST_CPPFLAGS) \
653 654
	$$(INCLUDE) \
)
Peter Foley's avatar
Peter Foley committed
655 656 657

endef

Peter Foley's avatar
Peter Foley committed
658
define gb_ExternalProject__use_boost_headers
David Tardon's avatar
David Tardon committed
659
$(call gb_ExternalProject_use_unpacked,$(1),boost)
Peter Foley's avatar
Peter Foley committed
660 661

endef
David Tardon's avatar
David Tardon committed
662

663 664 665
endif # SYSTEM_BOOST


666
ifneq ($(SYSTEM_LIBCMIS),)
667

668
define gb_LinkTarget__use_libcmis
669 670
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
671
	$(LIBCMIS_CFLAGS) \
672
)
673
$(call gb_LinkTarget_add_libs,$(1),$(LIBCMIS_LIBS))
674 675 676

endef

677
else # !SYSTEM_LIBCMIS
678

679
define gb_LinkTarget__use_libcmis
680
$(call gb_LinkTarget_set_include,$(1),\
David Tardon's avatar
David Tardon committed
681
	-I$(call gb_UnpackedTarball_get_dir,libcmis)/inc \
682 683
	$$(INCLUDE) \
)
Michael Stahl's avatar
Michael Stahl committed
684
$(call gb_LinkTarget_use_static_libraries,$(1),\
685
	libcmis \
686 687 688 689
)

endef

690
endif # SYSTEM_LIBCMIS
691

David Tardon's avatar
David Tardon committed
692
ifeq ($(ENABLE_JAVA),TRUE)
693

Peter Foley's avatar
Peter Foley committed
694
define gb_LinkTarget__use_jawt
David Tardon's avatar
David Tardon committed
695
$(call gb_LinkTarget_add_libs,$(1),\
696
	$(JAWTLIB) \
Peter Foley's avatar
Peter Foley committed
697 698 699 700
)

endef

701 702 703 704 705
else # !ENABLE_JAVA

gb_LinkTarget__use_jawt :=

endif # ENABLE_JAVA
706

707
ifneq ($(SYSTEM_LIBATOMIC_OPS),)
708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726

define gb_LinkTarget__use_libatomic_ops
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
	$(LIBATOMIC_OPS_CFLAGS) \
)
$(call gb_LinkTarget_add_libs,$(1), $(LIBATOMIC_OPS_LIBS))

endef
gb_ExternalProject__use_libatomic_ops :=

else # !SYSTEM_LIBATOMIC_OPS

define gb_LinkTarget__use_libatomic_ops
$(call gb_LinkTarget_set_include,$(1),\
$(LIBATOMIC_OPS_CFLAGS) \
	$$(INCLUDE) \
	$(LIBATOMIC_OPS_CFLAGS) \
)
727
$(call gb_LinkTarget_use_external_project,$(1),\
728 729
	libatomic_ops \
)
730

731
$(call gb_LinkTarget_add_libs,$(1),\
732
	-L$(call gb_UnpackedTarball_get_dir,libatomic_ops)/src/lib -latomic_ops \
733
)
734 735 736 737

endef

define gb_ExternalProject__use_libatomic_ops
738
$(call gb_ExternalProject_use_external_project,$(1),libatomic_ops)
739 740 741 742 743 744

endef

endif # SYSTEM_LIBATOMIC_OPS


745
ifneq ($(SYSTEM_LIBEXTTEXTCAT),)
746 747 748 749 750 751

define gb_LinkTarget__use_libexttextcat
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
	$(LIBEXTTEXTCAT_CFLAGS) \
)
752 753 754
$(call gb_LinkTarget_add_defs,$(1),\
	-DSYSTEM_LIBEXTTEXTCAT \
)
755 756 757 758 759 760 761
$(call gb_LinkTarget_add_libs,$(1),$(LIBEXTTEXTCAT_LIBS))

endef

else # !SYSTEM_LIBEXTTEXTCAT

define gb_LinkTarget__use_libexttextcat
762
$(call gb_LinkTarget_set_include,$(1),\
763
	-I$(call gb_UnpackedTarball_get_dir,libexttextcat/src) \
764
	$$(INCLUDE) \
765 766
)

767 768
ifeq ($(COM),MSC)
$(call gb_LinkTarget_use_static_libraries,$(1),\
769
	libexttextcat \
770 771 772
)
else
$(call gb_LinkTarget_add_libs,$(1),\
773
	$(call gb_UnpackedTarball_get_dir,libexttextcat)/src/.libs/libexttextcat-2.0.a\
774
)
775
$(call gb_LinkTarget_use_external_project,$(1),libexttextcat)
776 777 778
endif


779 780 781 782 783
endef

endif # SYSTEM_LIBEXTTEXTCAT


784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801
ifneq ($(SYSTEM_LIBNUMBERTEXT),)

define gb_LinkTarget__use_libnumbertext
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
	$(LIBNUMBERTEXT_CFLAGS) \
)
$(call gb_LinkTarget_add_defs,$(1),\
	-DSYSTEM_LIBNUMBERTEXT \
)
$(call gb_LinkTarget_add_libs,$(1),$(LIBNUMBERTEXT_LIBS))

endef

else # !SYSTEM_LIBNUMBERTEXT

ifneq ($(ENABLE_LIBNUMBERTEXT),)

802 803 804 805
$(eval $(call gb_Helper_register_packages_for_install,ooo, \
	libnumbertext_numbertext \
))

806
define gb_LinkTarget__use_libnumbertext
807
$(call gb_LinkTarget_use_package,$(1),libnumbertext_numbertext)
808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824
$(call gb_LinkTarget_set_include,$(1),\
	-I$(call gb_UnpackedTarball_get_dir,libnumbertext/src) \
	$$(INCLUDE) \
)
$(call gb_LinkTarget_add_defs,$(1),\
	-DENABLE_LIBNUMBERTEXT \
)

ifeq ($(COM),MSC)
$(call gb_LinkTarget_use_static_libraries,$(1),\
	libnumbertext \
)
else

$(call gb_LinkTarget_add_libs,$(1),\
	$(call gb_UnpackedTarball_get_dir,libnumbertext)/src/.libs/libnumbertext-1.0.a\
)
825
$(call gb_LinkTarget_use_external_project,$(1),libnumbertext,full)
826 827 828 829 830 831 832 833 834 835 836 837 838 839 840

endif

endef

else # !ENABLE_LIBNUMBERTEXT

define gb_LinkTarget__use_libnumbertext
endef

endif # ENABLE_LIBNUMBERTEXT

endif # SYSTEM_LIBNUMBERTEXT


841
ifneq ($(SYSTEM_LIBXML),)
842 843

define gb_LinkTarget__use_libxml2
844
$(call gb_LinkTarget_add_defs,$(1),\
845 846 847 848 849 850 851
	-DSYSTEM_LIBXML \
)
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
	$(LIBXML_CFLAGS) \
)
$(call gb_LinkTarget_add_libs,$(1),$(LIBXML_LIBS))
852

853
endef
854
gb_ExternalProject__use_libxml2:=
855 856 857

else # !SYSTEM_LIBXML

858
$(eval $(call gb_Helper_register_packages_for_install,ure,\
859
	libxml2 \
860 861
))

862
define gb_LinkTarget__use_libxml2
863
$(call gb_LinkTarget_use_package,$(1),libxml2)
864 865
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
866
	$(LIBXML_CFLAGS) \
867 868
)

869
$(call gb_LinkTarget_add_libs,$(1),\
870
	$(LIBXML_LIBS) \
871
)
872 873 874

ifeq ($(COM),MSC)
$(call gb_LinkTarget_use_external,$(1),icu_headers)
875 876
endif

877 878
endef
define gb_ExternalProject__use_libxml2
879
$(call gb_ExternalProject_use_package,$(1),libxml2)
880

881
ifeq ($(COM),MSC)
882
$(call gb_ExternalProject_use_packages,$(1),icu icu_ure)
883 884
endif

885 886 887 888 889
endef

endif # SYSTEM_LIBXML


890
ifneq ($(SYSTEM_LIBXSLT),)
891 892 893 894 895 896 897

define gb_LinkTarget__use_libxslt
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
	$(LIBXSLT_CFLAGS) \
)
$(call gb_LinkTarget_add_libs,$(1),$(LIBXSLT_LIBS))
898

899 900
endef

901 902 903 904 905 906 907 908 909 910
define gb_LinkTarget__use_libexslt
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
	$(LIBEXSLT_CFLAGS) \
)

$(call gb_LinkTarget_add_libs,$(1),$(LIBEXSLT_LIBS))

endef

911 912
else # !SYSTEM_LIBXSLT

913
$(eval $(call gb_Helper_register_packages_for_install,ooo,\
914
	libxslt \
915 916
))

917
define gb_LinkTarget__use_libxslt
918
$(call gb_LinkTarget_use_package,$(1),libxslt)
919 920
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
921
	-I$(call gb_UnpackedTarball_get_dir,libxslt) \
922
)
923 924 925

ifeq ($(COM),MSC)
$(call gb_LinkTarget_add_libs,$(1),\
926
	$(call gb_UnpackedTarball_get_dir,libxslt)/win32/bin.msvc/libxslt.lib \
927
)
928 929
else
$(call gb_LinkTarget_add_libs,$(1),\
930
	-L$(call gb_UnpackedTarball_get_dir,libxslt)/libxslt/.libs -lxslt \
931 932
)
endif
933

934 935
endef

936
define gb_LinkTarget__use_libexslt
937
$(call gb_LinkTarget_use_package,$(1),libxslt)
938 939
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
940
	-I$(call gb_UnpackedTarball_get_dir,libxslt) \
941 942
)

943 944
ifeq ($(COM),MSC)
$(call gb_LinkTarget_add_libs,$(1),\
945
	$(call gb_UnpackedTarball_get_dir,libxslt)/win32/bin.msvc/libexslt.lib \
946
)
947 948
else
$(call gb_LinkTarget_add_libs,$(1),\
949
	-L$(call gb_UnpackedTarball_get_dir,libxslt)/libexslt/.libs -lexslt \
950 951
)
endif
952 953 954

endef

955 956
endif # SYSTEM_LIBXSLT

957

958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985
ifneq ($(SYSTEM_XMLSEC),)

define gb_LinkTarget__use_xmlsec
$(call gb_LinkTarget_add_defs,$(1),\
	-DSYSTEM_XMLSEC \
)
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
	$(XMLSEC_CFLAGS) \
)
$(call gb_LinkTarget_add_libs,$(1),$(XMLSEC_LIBS))

endef

gb_ExternalProject__use_xmlsec:=

else # !SYSTEM_XMLSEC

$(eval $(call gb_Helper_register_packages_for_install,ooo,\
	xmlsec \
))

define gb_LinkTarget__use_xmlsec

endef

endif # SYSTEM_XMLSEC

986
ifneq ($(SYSTEM_LIBLANGTAG),)
987 988 989 990 991 992 993 994 995 996 997

define gb_LinkTarget__use_liblangtag
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
	$(LIBLANGTAG_CFLAGS) \
)

$(call gb_LinkTarget_add_libs,$(1),$(LIBLANGTAG_LIBS))

endef

998 999
gb_ExternalProject__use_liblangtag :=

1000 1001
else # !SYSTEM_LIBLANGTAG

1002
$(eval $(call gb_Helper_register_packages_for_install,ure,\
1003 1004 1005
	liblangtag_data \
))

1006 1007
ifeq ($(COM),MSC)

1008
define gb_LinkTarget__use_liblangtag
1009
$(call gb_LinkTarget_set_include,$(1),\
1010
	$(LIBLANGTAG_CFLAGS) \
1011 1012
	$$(INCLUDE) \
)
1013
$(call gb_LinkTarget_add_libs,$(1),$(LIBLANGTAG_LIBS))
1014
$(call gb_LinkTarget_use_external_project,$(1),liblangtag)
1015 1016 1017

endef

1018 1019
else

1020
$(eval $(call gb_Helper_register_packages_for_install,ure,\
1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035
	liblangtag \
))

define gb_LinkTarget__use_liblangtag
$(call gb_LinkTarget_set_include,$(1),\
	$(LIBLANGTAG_CFLAGS) \
	$$(INCLUDE) \
)
$(call gb_LinkTarget_add_libs,$(1),$(LIBLANGTAG_LIBS))
$(call gb_LinkTarget_use_package,$(1),liblangtag)

endef

endif # MSC

1036
define gb_ExternalProject__use_liblangtag
1037
$(call gb_ExternalProject_use_external_project,$(1),liblangtag)
1038 1039 1040

endef

1041 1042
endif # SYSTEM_LIBLANGTAG

1043

1044 1045 1046
gb_ExternalProject__use_apr :=

ifeq ($(WITH_WEBDAV),serf)
1047 1048 1049 1050 1051 1052 1053 1054

define gb_LinkTarget__use_apr
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
	$(APR_CFLAGS) \
)
$(call gb_LinkTarget_add_libs,$(1),\
	$(APR_LIBS) \
1055 1056
	$(if $(filter $(OS),LINUX),-lpthread) \
	$(if $(filter $(OS),MACOSX),-liconv) \
1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095
)

ifeq ($(SYSTEM_APR),)
$(call gb_LinkTarget_use_system_win32_libs,$(1),\
	mswsock \
	rpcrt4 \
	shell32 \
)
$(call gb_LinkTarget_add_defs,$(1),\
	-DAPR_DECLARE_STATIC \
	-DAPU_DECLARE_STATIC \
)
$(call gb_LinkTarget_use_external_project,$(1),apr_util)
endif

endef

define gb_ExternalProject__use_apr
ifeq ($(SYSTEM_APR),)
$(call gb_ExternalProject_use_external_project,$(1),apr_util)
endif

endef

define gb_LinkTarget__use_serf
$(call gb_LinkTarget_set_include,$(1),\
	$(SERF_CFLAGS) \
	$$(INCLUDE) \
)
$(call gb_LinkTarget_add_libs,$(1),\
	$(SERF_LIBS) \
)

ifeq ($(SYSTEM_SERF),)
$(call gb_LinkTarget_use_external_project,$(1),serf)
endif

endef

1096
else ifeq ($(WITH_WEBDAV),neon)
1097

1098
ifneq ($(SYSTEM_NEON),)
1099 1100 1101 1102

define gb_LinkTarget__use_neon
$(call gb_LinkTarget_add_defs,$(1),\
	-DNEON_VERSION=0x$(NEON_VERSION) \
1103
	-DSYSTEM_NEON \
1104 1105 1106
)
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
1107
	$(NEON_CFLAGS) \
1108 1109 1110 1111 1112 1113 1114 1115
)

$(call gb_LinkTarget_add_libs,$(1),$(NEON_LIBS))

endef

else # !SYSTEM_NEON

1116
$(eval $(call gb_Helper_register_libraries_for_install,PLAINLIBS_OOO,ooo,\
1117 1118 1119 1120
	neon \
))

define gb_LinkTarget__use_neon
1121
$(call gb_LinkTarget_use_unpacked,$(1),neon)
1122
$(call gb_LinkTarget_set_include,$(1),\
1123
	-I$(call gb_UnpackedTarball_get_dir,neon/src) \
1124 1125
	$$(INCLUDE) \
)
Michael Stahl's avatar
Michael Stahl committed
1126
$(call gb_LinkTarget_use_libraries,$(1),\
1127 1128 1129 1130 1131 1132 1133
	neon \
)

endef

endif # SYSTEM_NEON

1134
endif # WITH_WEBDAV
1135

1136
ifneq ($(SYSTEM_REDLAND),)
1137 1138

define gb_LinkTarget__use_librdf
1139
$(call gb_LinkTarget_add_defs,$(1),\
1140 1141 1142 1143 1144 1145 1146
	-DSYSTEM_REDLAND \
)
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
	$(REDLAND_CFLAGS) \
)
$(call gb_LinkTarget_add_libs,$(1),$(REDLAND_LIBS))
1147

1148 1149
endef

1150 1151 1152 1153 1154 1155
gb_LinkTarget__use_redland_headers:=

gb_LinkTarget__use_raptor_headers:=

gb_LinkTarget__use_rasqal_headers:=

1156 1157
else # !SYSTEM_REDLAND

1158 1159
define gb_LinkTarget__use_redland_headers
$(call gb_LinkTarget_set_include,$(1),\
1160
	-I$(call gb_UnpackedTarball_get_dir,redland)/src \
1161 1162 1163 1164 1165 1166 1167
	$$(INCLUDE) \
)

endef

define gb_LinkTarget__use_raptor_headers
$(call gb_LinkTarget_set_include,$(1),\
1168
	-I$(call gb_UnpackedTarball_get_dir,raptor)/src \
1169 1170 1171 1172 1173 1174 1175
	$$(INCLUDE) \
)

endef

define gb_LinkTarget__use_rasqal_headers
$(call gb_LinkTarget_set_include,$(1),\
1176
	-I$(call gb_UnpackedTarball_get_dir,rasqal)/src \
1177 1178 1179 1180 1181
	$$(INCLUDE) \
)

endef

1182 1183
ifneq ($(OS),ANDROID)

1184
ifeq ($(COM),MSC)
Michael Stahl's avatar
Michael Stahl committed
1185
$(eval $(call gb_Helper_register_libraries_for_install,PLAINLIBS_OOO,ooo, \
1186 1187
	raptor2 \
	rasqal \
1188 1189
	rdf \
))
1190 1191 1192 1193 1194 1195
else
$(eval $(call gb_Helper_register_packages_for_install,ooo, \
	raptor \
	rasqal \
	redland \
))
1196
endif
1197 1198

define gb_LinkTarget__use_librdf
1199 1200 1201 1202 1203 1204
ifeq ($(COM),MSC)
$(call gb_LinkTarget_use_libraries,$(1),\
	raptor2 \
	rdf \
)
else
1205
$(call gb_LinkTarget_use_packages,$(1),redland raptor rasqal)
1206

1207 1208
$(call gb_LinkTarget_add_libs,$(1),\
	-L$(call gb_UnpackedTarball_get_dir,redland)/src/.libs -lrdf \
1209 1210
	-L$(call gb_UnpackedTarball_get_dir,raptor)/src/.libs -lraptor2 \
	-L$(call gb_UnpackedTarball_get_dir,rasqal)/src/.libs -lrasqal \
1211
)
1212
endif
1213

1214 1215
endef

1216 1217 1218
else # ANDROID

define gb_LinkTarget__use_librdf
1219
$(call gb_LinkTarget_use_packages,$(1),redland raptor rasqal)
1220 1221 1222 1223 1224

endef

endif # ANDROID

1225 1226 1227
endif # SYSTEM_REDLAND


1228
ifneq ($(USING_X11)$(ENABLE_CAIRO_CANVAS)$(DISABLE_GUI),) # or
1229

1230
ifneq ($(SYSTEM_CAIRO),)
1231 1232 1233 1234 1235 1236

define gb_LinkTarget__use_cairo
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
	$(CAIRO_CFLAGS) \
)
1237
$(call gb_LinkTarget_use_external,$(1),freetype_headers)
1238
$(call gb_LinkTarget_add_libs,$(1),$(CAIRO_LIBS))
1239

1240 1241
endef

1242
else # !SYSTEM_CAIRO
1243

1244 1245 1246 1247 1248
$(eval $(call gb_Helper_register_packages_for_install,ooo,\
	cairo \
	$(if $(filter $(OS),WNT),,pixman) \
))

1249
define gb_LinkTarget__use_cairo
1250 1251
$(call gb_LinkTarget_use_package,$(1),cairo)
$(call gb_LinkTarget_use_package,$(1),pixman)
1252
$(call gb_LinkTarget_use_external,$(1),freetype_headers)
1253
$(call gb_LinkTarget_set_include,$(1),\
1254 1255
	-I$(call gb_UnpackedTarball_get_dir,cairo) \
	-I$(call gb_UnpackedTarball_get_dir,cairo)/src \
Matúš Kukan's avatar
Matúš Kukan committed
1256
	$$(INCLUDE) \
1257
)
1258 1259
$(call gb_LinkTarget_add_libs,$(1),\
	-L$(call gb_UnpackedTarball_get_dir,cairo)/src/.libs -lcairo \
Matúš Kukan's avatar
Matúš Kukan committed
1260
	$(if $(filter-out MACOSX WNT,$(OS)), \
1261
		-L$(call gb_UnpackedTarball_get_dir,pixman)/pixman/.libs -lpixman-1 \
Matúš Kukan's avatar
Matúš Kukan committed
1262
	) \
1263
)
1264

1265 1266 1267 1268
endef

endif # SYSTEM_CAIRO

1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286
else ifeq ($(OS),ANDROID)

define gb_LinkTarget__use_cairo
$(call gb_LinkTarget_use_package,$(1),cairo)
$(call gb_LinkTarget_use_package,$(1),pixman)
$(call gb_LinkTarget_use_external,$(1),freetype_headers)
$(call gb_LinkTarget_set_include,$(1),\
	-I$(call gb_UnpackedTarball_get_dir,cairo) \
	-I$(call gb_UnpackedTarball_get_dir,cairo)/src \
	$$(INCLUDE) \
)
$(call gb_LinkTarget_add_libs,$(1),\
	-L$(call gb_UnpackedTarball_get_dir,cairo)/src/.libs -lcairo \
	-L$(call gb_UnpackedTarball_get_dir,pixman)/pixman/.libs -lpixman-1 \
)

endef

1287 1288
endif # CAIRO

1289
ifneq ($(SYSTEM_FREETYPE),)
1290 1291

define gb_LinkTarget__use_freetype_headers
1292 1293 1294 1295
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
	$(FREETYPE_CFLAGS) \
)
1296

1297 1298
endef

1299 1300
gb_ExternalProject__use_freetype :=

1301
else
1302 1303

define gb_LinkTarget__use_freetype_headers
1304
$(call gb_LinkTarget_use_external_project,$(1),freetype)
1305
$(call gb_LinkTarget_set_include,$(1),\
1306
	$(FREETYPE_CFLAGS) \
1307 1308 1309
	$$(INCLUDE) \
)

David Tardon's avatar
David Tardon committed
1310 1311
endef

1312
define gb_ExternalProject__use_freetype
1313
$(call gb_ExternalProject_use_external_project,$(1),freetype)
1314 1315 1316

endef

1317 1318
endif # SYSTEM_FREETYPE

1319 1320 1321 1322 1323 1324
define gb_LinkTarget__use_freetype
$(call gb_LinkTarget_use_external,$(1),freetype_headers)
$(call gb_LinkTarget_add_libs,$(1),$(FREETYPE_LIBS))

endef

1325
ifneq ($(SYSTEM_FONTCONFIG),)
1326

1327 1328 1329 1330 1331
define gb_LinkTarget__use_fontconfig
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
	$(FONTCONFIG_CFLAGS) \
)
1332

1333
$(call gb_LinkTarget_add_libs,$(1),$(FONTCONFIG_LIBS))
1334 1335 1336

endef

1337
else
1338 1339

define gb_LinkTarget__use_fontconfig
1340
$(call gb_LinkTarget_use_external_project,$(1),fontconfig)
1341 1342 1343 1344 1345
$(call gb_LinkTarget_set_include,$(1),\
	-I$(call gb_UnpackedTarball_get_dir,fontconfig) \
	$$(INCLUDE) \
)

1346 1347 1348
$(call gb_LinkTarget_add_libs,$(1),\
    -L$(call gb_UnpackedTarball_get_dir,fontconfig)/src/.libs -lfontconfig \
)
1349

1350
endef
1351

1352 1353
endif # SYSTEM_FONTCONFIG

1354
ifneq ($(SYSTEM_GRAPHITE),)
1355 1356 1357 1358 1359 1360 1361

define gb_LinkTarget__use_graphite
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
	$(GRAPHITE_CFLAGS) \
)
$(call gb_LinkTarget_add_libs,$(1),$(GRAPHITE_LIBS))
1362

1363 1364
endef

1365 1366
gb_ExternalProject__use_graphite:=

1367
else # !SYSTEM_GRAPHITE
1368 1369

define gb_LinkTarget__use_graphite
1370
$(call gb_LinkTarget_use_unpacked,$(1),graphite)
1371
$(call gb_LinkTarget_set_include,$(1),\
1372
	-I$(call gb_UnpackedTarball_get_dir,graphite/include) \
1373 1374
	$$(INCLUDE) \
)
Michael Stahl's avatar
Michael Stahl committed
1375
$(call gb_LinkTarget_use_static_libraries,$(1),\
1376
    graphite \
1377
)
1378

1379 1380
endef

1381
define gb_ExternalProject__use_graphite
1382 1383 1384
$(call gb_ExternalProject_use_static_libraries,$(1),\
	graphite \
)
1385 1386

endef
1387 1388
endif # SYSTEM_GRAPHITE

1389
ifneq ($(SYSTEM_ICU),)
1390

1391
gb_LinkTarget__use_icu_headers:=
1392
gb_ExternalProject__use_icu:=
1393

1394 1395 1396 1397
define gb_LinkTarget__use_icudata
$(call gb_LinkTarget_add_libs,$(1),-licudata)

endef
1398 1399
define gb_LinkTarget__use_icui18n
$(call gb_LinkTarget_add_libs,$(1),-licui18n)
1400

1401
endef
1402 1403
define gb_LinkTarget__use_icuuc
$(call gb_LinkTarget_add_libs,$(1),-licuuc)
1404

1405 1406 1407 1408
endef

else # !SYSTEM_ICU

1409 1410 1411 1412
$(eval $(call gb_Helper_register_packages_for_install,ure, \
	icu_ure \
))

1413 1414 1415 1416
$(eval $(call gb_Helper_register_packages_for_install,ooo, \
	icu \
))

1417
ifeq ($(OS)$(DISABLE_DYNLOADING),ANDROID)
1418 1419 1420 1421 1422
gb_ICU_suffix:=lo
else
gb_ICU_suffix:=
endif

1423
define gb_LinkTarget__use_icu_headers
Peter Foley's avatar
Peter Foley committed
1424
$(call gb_LinkTarget_use_unpacked,$(1),icu)
1425
$(call gb_LinkTarget_set_include,$(1),\
1426 1427 1428
	-I$(call gb_UnpackedTarball_get_dir,icu)/source \
	-I$(call gb_UnpackedTarball_get_dir,icu)/source/i18n \
	-I$(call gb_UnpackedTarball_get_dir,icu)/source/common \
1429 1430 1431 1432 1433
	$$(INCLUDE) \
)

endef

1434 1435
define gb_ExternalProject__use_icu
$(call gb_ExternalProject_use_package,$(1),icu)
1436 1437 1438

endef

Peter Foley's avatar
Peter Foley committed
1439
# icudata and icui18n is called icudt and icuin when built with MSVC :-/
1440
define gb_LinkTarget__use_icudata
1441
$(call gb_LinkTarget_use_package,$(1),icu_ure)
1442 1443 1444 1445 1446 1447 1448 1449

ifeq ($(OS),WNT)
$(call gb_LinkTarget_add_libs,$(1),\
	$(call gb_UnpackedTarball_get_dir,icu)/source/lib/icudt$(if $(MSVC_USE_DEBUG_RUNTIME),d).lib \
)
else
$(call gb_LinkTarget_add_libs,$(1),\
	-L$(call gb_UnpackedTarball_get_dir,icu)/source/lib -licudata$(gb_ICU_suffix) \
1450
)
1451
endif
1452 1453

endef
1454

1455
define gb_LinkTarget__use_icui18n
Peter Foley's avatar
Peter Foley committed
1456
$(call gb_LinkTarget_use_package,$(1),icu)
<