RepositoryExternal.mk 85 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
)

endef
262 263
define gb_ExternalProject__use_mariadb-connector-c
$(call gb_ExternalProject_use_static_libraries,$(1),mariadb-connector-c)
264 265 266

endef

267
endif # SYSTEM_MARIADB_CONNECTOR_C
268 269


270
ifneq ($(SYSTEM_MARIADB_CONNECTOR_C),)
271 272 273 274

define gb_LinkTarget__use_mysql

$(call gb_LinkTarget_add_defs,$(1),\
275
	-DSYSTEM_MARIADB \
276 277 278
)

$(call gb_LinkTarget_add_libs,$(1),\
279
	$(MARIADB_LIBS) \
280 281 282
)

$(call gb_LinkTarget_set_include,$(1),\
283
	$(MARIADB_CFLAGS) \
284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299
	$$(INCLUDE) \
)
endef

else

define gb_LinkTarget__use_mysql

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

endef

endif

300
ifneq ($(SYSTEM_ZLIB),)
301 302

define gb_LinkTarget__use_zlib
303
$(call gb_LinkTarget_add_defs,$(1),\
304 305 306
	-DSYSTEM_ZLIB \
)
$(call gb_LinkTarget_add_libs,$(1),-lz)
307

308 309
endef

David Tardon's avatar
David Tardon committed
310 311 312 313 314
# nothing on system
define gb_LinkTarget__use_zlib_x64

endef

315 316
gb_ExternalProject__use_zlib :=

317 318
else # !SYSTEM_ZLIB

David Tardon's avatar
David Tardon committed
319 320 321
define gb_LinkTarget__use_zlib_multiarch
$(if $(2),,$(call gb_Output_error,gb_LinkTarget__use_zlib_multiarch needs two arguments))

322
$(call gb_LinkTarget_set_include,$(1),\
323
	$(ZLIB_CFLAGS) \
324 325
	$$(INCLUDE) \
)
David Tardon's avatar
David Tardon committed
326

Michael Stahl's avatar
Michael Stahl committed
327
$(call gb_LinkTarget_use_static_libraries,$(1),\
David Tardon's avatar
David Tardon committed
328
	$(2) \
329
)
330

331 332
endef

David Tardon's avatar
David Tardon committed
333 334 335 336 337 338 339 340 341 342
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

343 344 345 346 347
define gb_ExternalProject__use_zlib
$(call gb_ExternalProject_use_static_libraries,$(1),zlib)

endef

348 349 350
endif # SYSTEM_ZLIB


351
ifneq ($(SYSTEM_LIBJPEG),)
352

353
define gb_LinkTarget__use_libjpeg
354
$(call gb_LinkTarget_add_libs,$(1),$(LIBJPEG_LIBS))
355
$(call gb_LinkTarget_set_ldflags,$(1),\
356
	$$(filter-out -L/usr/lib/jvm%,$$(T_LDFLAGS)) \
357
)
358

359 360
endef

361
gb_ExternalProject__use_libjpeg :=
362

363
else
364

365
define gb_LinkTarget__use_libjpeg
366
$(call gb_LinkTarget_set_include,$(1),\
367
	$(LIBJPEG_CFLAGS) \
368 369
	$$(INCLUDE) \
)
370
$(call gb_LinkTarget_add_libs,$(1),$(LIBJPEG_LIBS))
371
$(call gb_LinkTarget_use_external_project,$(1),libjpeg-turbo,full)
372 373 374

endef

375 376
define gb_ExternalProject__use_libjpeg
$(call gb_ExternalProject_use_external_project,$(1),libjpeg-turbo)
377 378 379

endef

380
endif # SYSTEM_LIBJPEG
381

382
ifneq ($(SYSTEM_MYTHES),)
Peter Foley's avatar
Peter Foley committed
383 384

define gb_LinkTarget__use_mythes
385 386 387 388 389 390
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
	$(MYTHES_CFLAGS) \
)
$(call gb_LinkTarget_add_libs,$(1),$(MYTHES_LIBS))

Peter Foley's avatar
Peter Foley committed
391 392 393 394 395
endef

else # !SYSTEM_MYTHES

define gb_LinkTarget__use_mythes
396 397 398 399
$(call gb_LinkTarget_set_include,$(1),\
	-I$(call gb_UnpackedTarball_get_dir,mythes) \
	$$(INCLUDE) \
)
400 401

ifeq ($(COM),MSC)
402 403
$(call gb_LinkTarget_use_static_libraries,$(1),\
	mythes \
Peter Foley's avatar
Peter Foley committed
404
)
405 406 407 408
else
$(call gb_LinkTarget_add_libs,$(1),$(MYTHES_LIBS))
$(call gb_LinkTarget_use_external_project,$(1),mythes)
endif
409

Peter Foley's avatar
Peter Foley committed
410 411 412 413
endef

endif # SYSTEM_MYTHES

414

415
ifneq ($(SYSTEM_EXPAT),)
416

417 418
define gb_LinkTarget__use_expat_impl
$(if $(2),,$(error gb_LinkTarget__use_expat_impl needs additional parameter))
419

420
$(call gb_LinkTarget_add_defs,$(1),\
421 422 423 424
	-DSYSTEM_EXPAT \
)

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

426 427
endef

428 429
gb_ExternalProject__use_expat :=

430 431
else # !SYSTEM_EXPAT

432 433
define gb_LinkTarget__use_expat_impl
$(if $(2),,$(error gb_LinkTarget__use_expat_impl needs additional parameter))
434

435
$(call gb_LinkTarget_set_include,$(1),\
436
	-I$(call gb_UnpackedTarball_get_dir,expat)/lib \
437 438 439
    $$(INCLUDE) \
)

Michael Stahl's avatar
Michael Stahl committed
440
$(call gb_LinkTarget_use_static_libraries,$(1),\
441 442
	$(2) \
)
443

444 445
endef

446 447 448 449 450
define gb_ExternalProject__use_expat
$(call gb_ExternalProject_use_static_libraries,$(1),expat)

endef

451 452
endif # SYSTEM_EXPAT

453 454
define gb_LinkTarget__use_expat
$(call gb_LinkTarget__use_expat_impl,$(1),expat)
455

456 457
endef

458 459
define gb_LinkTarget__use_expat_x64
$(call gb_LinkTarget__use_expat_impl,$(1),expat_x64)
460

461 462
endef

463
ifneq ($(SYSTEM_HYPH),)
Peter Foley's avatar
Peter Foley committed
464 465 466 467 468 469 470 471 472 473 474

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),\
475
	-I$(call gb_UnpackedTarball_get_dir,hyphen)\
Peter Foley's avatar
Peter Foley committed
476 477
	$$(INCLUDE) \
)
478 479

ifeq ($(COM),MSC)
Peter Foley's avatar
Peter Foley committed
480 481 482
$(call gb_LinkTarget_use_static_libraries,$(1),\
	hyphen \
)
483 484 485 486
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
487 488 489 490 491

endef

endif # SYSTEM_HYPH

492
ifneq ($(SYSTEM_HUNSPELL),)
493 494 495 496 497 498 499 500 501 502

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

endef

503 504
gb_ExternalProject__use_hunspell :=

505 506 507 508 509 510
else # !SYSTEM_HUNSPELL

define gb_LinkTarget__use_hunspell
$(call gb_LinkTarget_add_defs,$(1),\
	-DHUNSPELL_STATIC \
)
511
$(call gb_LinkTarget_use_unpacked,$(1),hunspell)
512
$(call gb_LinkTarget_set_include,$(1),\
513
	-I$(call gb_UnpackedTarball_get_dir,hunspell/src/hunspell)\
514
	$$(INCLUDE) \
515
)
516 517

ifeq ($(COM),MSC)
Michael Stahl's avatar
Michael Stahl committed
518
$(call gb_LinkTarget_use_static_libraries,$(1),\
519
	hunspell \
520
)
521 522 523 524 525 526 527 528 529
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)
530 531 532 533 534 535

endef

endif # SYSTEM_HUNSPELL


536
ifneq ($(SYSTEM_BOOST),)
537

David Tardon's avatar
David Tardon committed
538
define gb_LinkTarget__use_boost_lib
539 540 541 542 543 544 545 546 547
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
	$(BOOST_CPPFLAGS) \
)

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

David Tardon's avatar
David Tardon committed
548
$(call gb_LinkTarget_add_libs,$(1),$(2))
549

550 551
endef

552 553 554 555 556
define gb_LinkTarget__use_boost_locale
$(call gb_LinkTarget__use_boost_lib,$(1),$(BOOST_LOCALE_LIB))

endef

557
define gb_LinkTarget__use_boost_date_time
David Tardon's avatar
David Tardon committed
558
$(call gb_LinkTarget__use_boost_lib,$(1),$(BOOST_DATE_TIME_LIB))
Markus Mohrhard's avatar
Markus Mohrhard committed
559

David Tardon's avatar
David Tardon committed
560
endef
Markus Mohrhard's avatar
Markus Mohrhard committed
561

562 563 564 565 566 567 568
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
569 570
define gb_LinkTarget__use_boost_iostreams
$(call gb_LinkTarget__use_boost_lib,$(1),$(BOOST_IOSTREAMS_LIB))
Markus Mohrhard's avatar
Markus Mohrhard committed
571 572 573

endef

574 575
gb_ExternalProject__use_boost_iostreams :=

Markus Mohrhard's avatar
Markus Mohrhard committed
576
define gb_LinkTarget__use_boost_system
David Tardon's avatar
David Tardon committed
577
$(call gb_LinkTarget__use_boost_lib,$(1),$(BOOST_SYSTEM_LIB))
578 579 580

endef

Markus Mohrhard's avatar
Markus Mohrhard committed
581
gb_ExternalProject__use_boost_system :=
582

583 584 585 586 587 588 589 590
define gb_LinkTarget__use_boost_headers
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
	$(BOOST_CPPFLAGS) \
)

endef

Peter Foley's avatar
Peter Foley committed
591 592
gb_ExternalProject__use_boost_headers:=

593 594
else # !SYSTEM_BOOST

David Tardon's avatar
David Tardon committed
595
define gb_LinkTarget__use_boost_lib
596 597 598 599
$(call gb_LinkTarget_add_defs,$(1),\
	-DBOOST_ALL_NO_LIB \
)

David Tardon's avatar
David Tardon committed
600 601 602 603
$(call gb_LinkTarget_use_static_libraries,$(1),$(2))

endef

604 605 606 607 608 609 610 611
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

612 613
define gb_LinkTarget__use_boost_date_time
$(call gb_LinkTarget__use_boost_lib,$(1),boost_date_time)
614 615 616

endef

David Tardon's avatar
David Tardon committed
617
define gb_LinkTarget__use_boost_filesystem
David Tardon's avatar
David Tardon committed
618
$(call gb_LinkTarget__use_boost_lib,$(1),boost_filesystem)
David Tardon's avatar
David Tardon committed
619 620 621 622 623 624 625

endef

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

Markus Mohrhard's avatar
Markus Mohrhard committed
626
define gb_LinkTarget__use_boost_iostreams
David Tardon's avatar
David Tardon committed
627
$(call gb_LinkTarget__use_boost_lib,$(1),boost_iostreams)
Markus Mohrhard's avatar
Markus Mohrhard committed
628 629 630 631 632 633 634 635

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
636
$(call gb_LinkTarget__use_boost_lib,$(1),boost_system)
637 638 639

endef

Markus Mohrhard's avatar
Markus Mohrhard committed
640 641
define gb_ExternalProject__use_boost_system
$(call gb_ExternalProject_use_static_libraries,$(1),boost_system)
642 643
endef

Peter Foley's avatar
Peter Foley committed
644
define gb_LinkTarget__use_boost_headers
645
$(call gb_LinkTarget_use_unpacked,$(1),boost)
646
$(call gb_LinkTarget_set_include,$(1),\
647
	$(BOOST_CPPFLAGS) \
648 649
	$$(INCLUDE) \
)
Peter Foley's avatar
Peter Foley committed
650 651 652

endef

Peter Foley's avatar
Peter Foley committed
653
define gb_ExternalProject__use_boost_headers
David Tardon's avatar
David Tardon committed
654
$(call gb_ExternalProject_use_unpacked,$(1),boost)
Peter Foley's avatar
Peter Foley committed
655 656

endef
David Tardon's avatar
David Tardon committed
657

658 659 660
endif # SYSTEM_BOOST


661
ifneq ($(SYSTEM_LIBCMIS),)
662

663
define gb_LinkTarget__use_libcmis
664 665
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
666
	$(LIBCMIS_CFLAGS) \
667
)
668
$(call gb_LinkTarget_add_libs,$(1),$(LIBCMIS_LIBS))
669 670 671

endef

672
else # !SYSTEM_LIBCMIS
673

674
define gb_LinkTarget__use_libcmis
675
$(call gb_LinkTarget_set_include,$(1),\
676
	-I$(call gb_UnpackedTarball_get_dir,libcmis)/src \
677 678
	$$(INCLUDE) \
)
Michael Stahl's avatar
Michael Stahl committed
679
$(call gb_LinkTarget_use_static_libraries,$(1),\
680
	libcmis \
681 682 683 684
)

endef

685
endif # SYSTEM_LIBCMIS
686

David Tardon's avatar
David Tardon committed
687
ifeq ($(ENABLE_JAVA),TRUE)
688

Peter Foley's avatar
Peter Foley committed
689
define gb_LinkTarget__use_jawt
David Tardon's avatar
David Tardon committed
690
$(call gb_LinkTarget_add_libs,$(1),\
691
	$(JAWTLIB) \
Peter Foley's avatar
Peter Foley committed
692 693 694 695
)

endef

696 697 698 699 700
else # !ENABLE_JAVA

gb_LinkTarget__use_jawt :=

endif # ENABLE_JAVA
701

702
ifneq ($(SYSTEM_LIBATOMIC_OPS),)
703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721

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) \
)
722
$(call gb_LinkTarget_use_external_project,$(1),\
723 724
	libatomic_ops \
)
725

726
$(call gb_LinkTarget_add_libs,$(1),\
727
	-L$(call gb_UnpackedTarball_get_dir,libatomic_ops)/src/lib -latomic_ops \
728
)
729 730 731 732

endef

define gb_ExternalProject__use_libatomic_ops
733
$(call gb_ExternalProject_use_external_project,$(1),libatomic_ops)
734 735 736 737 738 739

endef

endif # SYSTEM_LIBATOMIC_OPS


740
ifneq ($(SYSTEM_LIBEXTTEXTCAT),)
741 742 743 744 745 746

define gb_LinkTarget__use_libexttextcat
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
	$(LIBEXTTEXTCAT_CFLAGS) \
)
747 748 749
$(call gb_LinkTarget_add_defs,$(1),\
	-DSYSTEM_LIBEXTTEXTCAT \
)
750 751 752 753 754 755 756
$(call gb_LinkTarget_add_libs,$(1),$(LIBEXTTEXTCAT_LIBS))

endef

else # !SYSTEM_LIBEXTTEXTCAT

define gb_LinkTarget__use_libexttextcat
757
$(call gb_LinkTarget_set_include,$(1),\
758
	-I$(call gb_UnpackedTarball_get_dir,libexttextcat/src) \
759
	$$(INCLUDE) \
760 761
)

762 763
ifeq ($(COM),MSC)
$(call gb_LinkTarget_use_static_libraries,$(1),\
764
	libexttextcat \
765 766 767
)
else
$(call gb_LinkTarget_add_libs,$(1),\
768
	$(call gb_UnpackedTarball_get_dir,libexttextcat)/src/.libs/libexttextcat-2.0.a\
769
)
770
$(call gb_LinkTarget_use_external_project,$(1),libexttextcat)
771 772 773
endif


774 775 776 777 778
endef

endif # SYSTEM_LIBEXTTEXTCAT


779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796
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),)

797 798 799 800
$(eval $(call gb_Helper_register_packages_for_install,ooo, \
	libnumbertext_numbertext \
))

801
define gb_LinkTarget__use_libnumbertext
802
$(call gb_LinkTarget_use_package,$(1),libnumbertext_numbertext)
803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819
$(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\
)
820
$(call gb_LinkTarget_use_external_project,$(1),libnumbertext,full)
821 822 823 824 825 826 827 828 829 830 831 832 833 834 835

endif

endef

else # !ENABLE_LIBNUMBERTEXT

define gb_LinkTarget__use_libnumbertext
endef

endif # ENABLE_LIBNUMBERTEXT

endif # SYSTEM_LIBNUMBERTEXT


836
ifneq ($(SYSTEM_LIBXML),)
837 838

define gb_LinkTarget__use_libxml2
839
$(call gb_LinkTarget_add_defs,$(1),\
840 841 842 843 844 845 846
	-DSYSTEM_LIBXML \
)
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
	$(LIBXML_CFLAGS) \
)
$(call gb_LinkTarget_add_libs,$(1),$(LIBXML_LIBS))
847

848
endef
849
gb_ExternalProject__use_libxml2:=
850 851 852

else # !SYSTEM_LIBXML

853
$(eval $(call gb_Helper_register_packages_for_install,ure,\
854
	libxml2 \
855 856
))

857
define gb_LinkTarget__use_libxml2
858
$(call gb_LinkTarget_use_package,$(1),libxml2)
859 860
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
861
	$(LIBXML_CFLAGS) \
862 863
)

864
$(call gb_LinkTarget_add_libs,$(1),\
865
	$(LIBXML_LIBS) \
866
)
867 868 869

ifeq ($(COM),MSC)
$(call gb_LinkTarget_use_external,$(1),icu_headers)
870 871
endif

872 873
endef
define gb_ExternalProject__use_libxml2
874
$(call gb_ExternalProject_use_package,$(1),libxml2)
875

876
ifeq ($(COM),MSC)
877
$(call gb_ExternalProject_use_packages,$(1),icu icu_ure)
878 879
endif

880 881 882 883 884
endef

endif # SYSTEM_LIBXML


885
ifneq ($(SYSTEM_LIBXSLT),)
886 887 888 889 890 891 892

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

894 895
endef

896 897 898 899 900 901 902 903 904 905
define gb_LinkTarget__use_libexslt
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
	$(LIBEXSLT_CFLAGS) \
)

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

endef

906 907
else # !SYSTEM_LIBXSLT

908
$(eval $(call gb_Helper_register_packages_for_install,ooo,\
909
	libxslt \
910 911
))

912
define gb_LinkTarget__use_libxslt
913
$(call gb_LinkTarget_use_package,$(1),libxslt)
914 915
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
916
	-I$(call gb_UnpackedTarball_get_dir,libxslt) \
917
)
918 919 920

ifeq ($(COM),MSC)
$(call gb_LinkTarget_add_libs,$(1),\
921
	$(call gb_UnpackedTarball_get_dir,libxslt)/win32/bin.msvc/libxslt.lib \
922
)
923 924
else
$(call gb_LinkTarget_add_libs,$(1),\
925
	-L$(call gb_UnpackedTarball_get_dir,libxslt)/libxslt/.libs -lxslt \
926 927
)
endif
928

929 930
endef

931
define gb_LinkTarget__use_libexslt
932
$(call gb_LinkTarget_use_package,$(1),libxslt)
933 934
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
935
	-I$(call gb_UnpackedTarball_get_dir,libxslt) \
936 937
)

938 939
ifeq ($(COM),MSC)
$(call gb_LinkTarget_add_libs,$(1),\
940
	$(call gb_UnpackedTarball_get_dir,libxslt)/win32/bin.msvc/libexslt.lib \
941
)
942 943
else
$(call gb_LinkTarget_add_libs,$(1),\
944
	-L$(call gb_UnpackedTarball_get_dir,libxslt)/libexslt/.libs -lexslt \
945 946
)
endif
947 948 949

endef

950 951
endif # SYSTEM_LIBXSLT

952

953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980
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

981
ifneq ($(SYSTEM_LIBLANGTAG),)
982 983 984 985 986 987 988 989 990 991 992

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

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

endef

993 994
gb_ExternalProject__use_liblangtag :=

995 996
else # !SYSTEM_LIBLANGTAG

997
$(eval $(call gb_Helper_register_packages_for_install,ure,\
998 999 1000
	liblangtag_data \
))

1001 1002
ifeq ($(COM),MSC)

1003
define gb_LinkTarget__use_liblangtag
1004
$(call gb_LinkTarget_set_include,$(1),\
1005
	$(LIBLANGTAG_CFLAGS) \
1006 1007
	$$(INCLUDE) \
)
1008
$(call gb_LinkTarget_add_libs,$(1),$(LIBLANGTAG_LIBS))
1009
$(call gb_LinkTarget_use_external_project,$(1),liblangtag)
1010 1011 1012

endef

1013 1014
else

1015
$(eval $(call gb_Helper_register_packages_for_install,ure,\
1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030
	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

1031
define gb_ExternalProject__use_liblangtag
1032
$(call gb_ExternalProject_use_external_project,$(1),liblangtag)
1033 1034 1035

endef

1036 1037
endif # SYSTEM_LIBLANGTAG

1038

1039 1040 1041
gb_ExternalProject__use_apr :=

ifeq ($(WITH_WEBDAV),serf)
1042 1043 1044 1045 1046 1047 1048 1049

define gb_LinkTarget__use_apr
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
	$(APR_CFLAGS) \
)
$(call gb_LinkTarget_add_libs,$(1),\
	$(APR_LIBS) \
1050 1051
	$(if $(filter $(OS),LINUX),-lpthread) \
	$(if $(filter $(OS),MACOSX),-liconv) \
1052 1053 1054 1055 1056 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
)

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

1091
else ifeq ($(WITH_WEBDAV),neon)
1092

1093
ifneq ($(SYSTEM_NEON),)
1094 1095 1096 1097

define gb_LinkTarget__use_neon
$(call gb_LinkTarget_add_defs,$(1),\
	-DNEON_VERSION=0x$(NEON_VERSION) \
1098
	-DSYSTEM_NEON \
1099 1100 1101
)
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
1102
	$(NEON_CFLAGS) \
1103 1104 1105 1106 1107 1108 1109 1110
)

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

endef

else # !SYSTEM_NEON

1111
$(eval $(call gb_Helper_register_libraries_for_install,PLAINLIBS_OOO,ooo,\
1112 1113 1114 1115
	neon \
))

define gb_LinkTarget__use_neon
1116
$(call gb_LinkTarget_use_unpacked,$(1),neon)
1117
$(call gb_LinkTarget_set_include,$(1),\
1118
	-I$(call gb_UnpackedTarball_get_dir,neon/src) \
1119 1120
	$$(INCLUDE) \
)
Michael Stahl's avatar
Michael Stahl committed
1121
$(call gb_LinkTarget_use_libraries,$(1),\
1122 1123 1124 1125 1126 1127 1128
	neon \
)

endef

endif # SYSTEM_NEON

1129
endif # WITH_WEBDAV
1130

1131
ifneq ($(SYSTEM_REDLAND),)
1132 1133

define gb_LinkTarget__use_librdf
1134
$(call gb_LinkTarget_add_defs,$(1),\
1135 1136 1137 1138 1139 1140 1141
	-DSYSTEM_REDLAND \
)
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
	$(REDLAND_CFLAGS) \
)
$(call gb_LinkTarget_add_libs,$(1),$(REDLAND_LIBS))
1142

1143 1144
endef

1145 1146 1147 1148 1149 1150
gb_LinkTarget__use_redland_headers:=

gb_LinkTarget__use_raptor_headers:=

gb_LinkTarget__use_rasqal_headers:=

1151 1152
else # !SYSTEM_REDLAND

1153 1154
define gb_LinkTarget__use_redland_headers
$(call gb_LinkTarget_set_include,$(1),\
1155
	-I$(call gb_UnpackedTarball_get_dir,redland)/src \
1156 1157 1158 1159 1160 1161 1162
	$$(INCLUDE) \
)

endef

define gb_LinkTarget__use_raptor_headers
$(call gb_LinkTarget_set_include,$(1),\
1163
	-I$(call gb_UnpackedTarball_get_dir,raptor)/src \
1164 1165 1166 1167 1168 1169 1170
	$$(INCLUDE) \
)

endef

define gb_LinkTarget__use_rasqal_headers
$(call gb_LinkTarget_set_include,$(1),\
1171
	-I$(call gb_UnpackedTarball_get_dir,rasqal)/src \
1172 1173 1174 1175 1176
	$$(INCLUDE) \
)

endef

1177 1178
ifneq ($(OS),ANDROID)

1179
ifeq ($(COM),MSC)
Michael Stahl's avatar
Michael Stahl committed
1180
$(eval $(call gb_Helper_register_libraries_for_install,PLAINLIBS_OOO,ooo, \
1181 1182
	raptor2 \
	rasqal \
1183 1184
	rdf \
))
1185 1186 1187 1188 1189 1190
else
$(eval $(call gb_Helper_register_packages_for_install,ooo, \
	raptor \
	rasqal \
	redland \
))
1191
endif
1192 1193

define gb_LinkTarget__use_librdf
1194 1195 1196 1197 1198 1199
ifeq ($(COM),MSC)
$(call gb_LinkTarget_use_libraries,$(1),\
	raptor2 \
	rdf \
)
else
1200
$(call gb_LinkTarget_use_packages,$(1),redland raptor rasqal)
1201

1202 1203
$(call gb_LinkTarget_add_libs,$(1),\
	-L$(call gb_UnpackedTarball_get_dir,redland)/src/.libs -lrdf \
1204 1205
	-L$(call gb_UnpackedTarball_get_dir,raptor)/src/.libs -lraptor2 \
	-L$(call gb_UnpackedTarball_get_dir,rasqal)/src/.libs -lrasqal \
1206
)
1207
endif
1208

1209 1210
endef

1211 1212 1213
else # ANDROID

define gb_LinkTarget__use_librdf
1214
$(call gb_LinkTarget_use_packages,$(1),redland raptor rasqal)
1215 1216 1217 1218 1219

endef

endif # ANDROID

1220 1221 1222
endif # SYSTEM_REDLAND


1223
ifneq ($(USING_X11)$(ENABLE_CAIRO_CANVAS)$(DISABLE_GUI),) # or
1224

1225
ifneq ($(SYSTEM_CAIRO),)
1226 1227 1228 1229 1230 1231

define gb_LinkTarget__use_cairo
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
	$(CAIRO_CFLAGS) \
)
1232
$(call gb_LinkTarget_use_external,$(1),freetype_headers)
1233
$(call gb_LinkTarget_add_libs,$(1),$(CAIRO_LIBS))
1234

1235 1236
endef

1237
else # !SYSTEM_CAIRO
1238

1239 1240 1241 1242 1243
$(eval $(call gb_Helper_register_packages_for_install,ooo,\
	cairo \
	$(if $(filter $(OS),WNT),,pixman) \
))

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

1260 1261 1262 1263
endef

endif # SYSTEM_CAIRO

1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281
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

1282 1283
endif # CAIRO

1284
ifneq ($(SYSTEM_FREETYPE),)
1285 1286

define gb_LinkTarget__use_freetype_headers
1287 1288 1289 1290
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
	$(FREETYPE_CFLAGS) \
)
1291

1292 1293
endef

1294 1295
gb_ExternalProject__use_freetype :=

1296
else
1297 1298

define gb_LinkTarget__use_freetype_headers
1299
$(call gb_LinkTarget_use_external_project,$(1),freetype)
1300
$(call gb_LinkTarget_set_include,$(1),\
1301
	$(FREETYPE_CFLAGS) \
1302 1303 1304
	$$(INCLUDE) \
)

David Tardon's avatar
David Tardon committed
1305 1306
endef

1307
define gb_ExternalProject__use_freetype
1308
$(call gb_ExternalProject_use_external_project,$(1),freetype)
1309 1310 1311

endef

1312 1313
endif # SYSTEM_FREETYPE

1314 1315 1316 1317 1318 1319
define gb_LinkTarget__use_freetype
$(call gb_LinkTarget_use_external,$(1),freetype_headers)
$(call gb_LinkTarget_add_libs,$(1),$(FREETYPE_LIBS))

endef

1320
ifneq ($(SYSTEM_FONTCONFIG),)
1321

1322 1323 1324 1325 1326
define gb_LinkTarget__use_fontconfig
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
	$(FONTCONFIG_CFLAGS) \
)
1327

1328
$(call gb_LinkTarget_add_libs,$(1),$(FONTCONFIG_LIBS))
1329 1330 1331

endef

1332
else
1333 1334

define gb_LinkTarget__use_fontconfig
1335
$(call gb_LinkTarget_use_external_project,$(1),fontconfig)
1336 1337 1338 1339 1340
$(call gb_LinkTarget_set_include,$(1),\
	-I$(call gb_UnpackedTarball_get_dir,fontconfig) \
	$$(INCLUDE) \
)

1341 1342 1343
$(call gb_LinkTarget_add_libs,$(1),\
    -L$(call gb_UnpackedTarball_get_dir,fontconfig)/src/.libs -lfontconfig \
)
1344

1345
endef
1346

1347 1348
endif # SYSTEM_FONTCONFIG

1349
ifneq ($(SYSTEM_GRAPHITE),)
1350 1351 1352 1353 1354 1355 1356

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

1358 1359
endef

1360 1361
gb_ExternalProject__use_graphite:=

1362
else # !SYSTEM_GRAPHITE
1363 1364

define gb_LinkTarget__use_graphite
1365
$(call gb_LinkTarget_use_unpacked,$(1),graphite)
1366
$(call gb_LinkTarget_set_include,$(1),\
1367
	-I$(call gb_UnpackedTarball_get_dir,graphite/include) \
1368 1369
	$$(INCLUDE) \
)
Michael Stahl's avatar
Michael Stahl committed
1370
$(call gb_LinkTarget_use_static_libraries,$(1),\
1371
    graphite \
1372
)
1373

1374 1375
endef

1376
define gb_ExternalProject__use_graphite
1377 1378 1379
$(call gb_ExternalProject_use_static_libraries,$(1),\
	graphite \
)
1380 1381

endef
1382 1383
endif # SYSTEM_GRAPHITE

1384
ifneq ($(SYSTEM_ICU),)
1385

1386
gb_LinkTarget__use_icu_headers:=
1387
gb_ExternalProject__use_icu:=
1388

1389 1390 1391 1392
define gb_LinkTarget__use_icudata
$(call gb_LinkTarget_add_libs,$(1),-licudata)

endef
1393 1394
define gb_LinkTarget__use_icui18n
$(call gb_LinkTarget_add_libs,$(1),-licui18n)
1395

1396
endef
1397 1398
define gb_LinkTarget__use_icuuc
$(call gb_LinkTarget_add_libs,$(1),-licuuc)
1399

1400 1401 1402 1403
endef

else # !SYSTEM_ICU

1404 1405 1406 1407
$(eval $(call gb_Helper_register_packages_for_install,ure, \
	icu_ure \
))

1408 1409 1410 1411
$(eval $(call gb_Helper_register_packages_for_install,ooo, \
	icu \
))

1412
ifeq ($(OS)$(DISABLE_DYNLOADING),ANDROID)
1413 1414 1415 1416 1417
gb_ICU_suffix:=lo
else
gb_ICU_suffix:=
endif

1418
define gb_LinkTarget__use_icu_headers
Peter Foley's avatar
Peter Foley committed
1419
$(call gb_LinkTarget_use_unpacked,$(1),icu)
1420
$(call gb_LinkTarget_set_include,$(1),\
1421 1422 1423
	-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 \
1424 1425 1426 1427 1428
	$$(INCLUDE) \
)

endef

1429 1430
define gb_ExternalProject__use_icu
$(call gb_ExternalProject_use_package,$(1),icu)
1431 1432 1433

endef

Peter Foley's avatar
Peter Foley committed
1434
# icudata and icui18n is called icudt and icuin when built with MSVC :-/
1435
define gb_LinkTarget__use_icudata
1436
$(call gb_LinkTarget_use_package,$(1),icu_ure)
1437 1438 1439 1440 1441 1442 1443 1444

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) \
1445
)
1446
endif
1447 1448

endef
1449

1450
define gb_LinkTarget__use_icui18n
Peter Foley's avatar
Peter Foley committed
1451
$(call gb_LinkTarget_use_package,$(1),icu)
1452

1453 1454 1455 1456 1457 1458