RepositoryExternal.mk 84.5 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
	-I$(SRCDIR)/external/$(if $(filter WNT,$(OS)),twain,sane)/inc \
Michael Stahl's avatar
Michael Stahl committed
119
	$$(INCLUDE) \
120 121 122 123 124 125 126 127 128 129
)

endef

else

gb_LinkTarget__use_sane_headers :=

endif

130
ifneq ($(SYSTEM_BLUEZ),)
131 132 133 134 135 136 137 138 139 140 141 142 143 144 145

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

146 147
# External libraries

148
ifneq ($(SYSTEM_CPPUNIT),)
David Tardon's avatar
David Tardon committed
149 150 151 152 153 154 155 156 157 158

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

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

David Tardon's avatar
David Tardon committed
160 161
endef

162
else # !SYSTEM_CPPUNIT
David Tardon's avatar
David Tardon committed
163 164

define gb_LinkTarget__use_cppunit
165
$(call gb_LinkTarget_use_external_project,$(1),cppunit, full)
Peter Foley's avatar
Peter Foley committed
166 167

$(call gb_LinkTarget_set_include,$(1),\
168
	-I$(call gb_UnpackedTarball_get_dir,cppunit/include)\
Peter Foley's avatar
Peter Foley committed
169 170
	$$(INCLUDE) \
)
171

172 173 174 175 176 177 178 179 180 181
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
182 183
endef

184
endif # SYSTEM_CPPUNIT
185

186
ifneq ($(SYSTEM_EPOXY),)
David Tardon's avatar
David Tardon committed
187

188
define gb_LinkTarget__use_epoxy
David Tardon's avatar
David Tardon committed
189 190
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
191
    $(EPOXY_CFLAGS) \
David Tardon's avatar
David Tardon committed
192
)
193
$(call gb_LinkTarget_add_libs,$(1),$(EPOXY_LIBS))
David Tardon's avatar
David Tardon committed
194 195 196

endef

197
gb_ExternalProject__use_epoxy :=
198

199
else # !SYSTEM_EPOXY
David Tardon's avatar
David Tardon committed
200

201
define gb_LinkTarget__use_epoxy
David Tardon's avatar
David Tardon committed
202
$(call gb_LinkTarget_set_include,$(1),\
203 204
       -I$(call gb_UnpackedTarball_get_dir,epoxy/include) \
       $$(INCLUDE) \
David Tardon's avatar
David Tardon committed
205 206
)

207 208
$(call gb_LinkTarget_use_libraries,$(1),\
    epoxy \
David Tardon's avatar
David Tardon committed
209 210 211 212
)

endef

213 214 215 216 217 218
$(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)
219 220 221

endef

222
endif # SYSTEM_EPOXY
David Tardon's avatar
David Tardon committed
223

Tor Lillqvist's avatar
Tor Lillqvist committed
224 225 226 227 228
define gb_LinkTarget__use_iconv
$(call gb_LinkTarget_add_libs,$(1),-liconv)

endef

229
ifneq ($(SYSTEM_MARIADB_CONNECTOR_C),)
230

231
define gb_LinkTarget__use_mariadb-connector-c
232 233 234 235 236 237 238
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
    $(MARIADB_CFLAGS) \
)
$(call gb_LinkTarget_add_libs,$(1),$(MARIADB_LIBS))

endef
239
gb_ExternalProject__use_mariadb-connector-c :=
240

241
else # !SYSTEM_MARIADB_CONNECTOR_C
242

243
define gb_LinkTarget__use_mariadb-connector-c
244 245 246 247 248
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
	$(MARIADB_CFLAGS) \
)
$(call gb_LinkTarget_use_static_libraries,$(1),\
249
	mariadb-connector-c \
250 251 252
)

endef
253 254
define gb_ExternalProject__use_mariadb-connector-c
$(call gb_ExternalProject_use_static_libraries,$(1),mariadb-connector-c)
255 256 257

endef

258
endif # SYSTEM_MARIADB_CONNECTOR_C
259 260


261
ifneq ($(SYSTEM_MARIADB_CONNECTOR_C),)
262 263 264 265

define gb_LinkTarget__use_mysql

$(call gb_LinkTarget_add_defs,$(1),\
266
	-DSYSTEM_MARIADB \
267 268 269
)

$(call gb_LinkTarget_add_libs,$(1),\
270
	$(MARIADB_LIBS) \
271 272 273
)

$(call gb_LinkTarget_set_include,$(1),\
274
	$(MARIADB_CFLAGS) \
275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290
	$$(INCLUDE) \
)
endef

else

define gb_LinkTarget__use_mysql

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

endef

endif

291
ifneq ($(SYSTEM_MYSQL_CONNECTOR_CPP),)
292

293
define gb_LinkTarget__use_mysql-connector-cpp
294 295 296 297 298
$(call gb_LinkTarget_add_libs,$(1),\
	-lmysqlcppconn \
)

$(call gb_LinkTarget_add_defs,$(1),\
299
	-DSYSTEM_MYSQL_CPPCONN \
300 301 302 303 304
)
endef

else

305
$(eval $(call gb_Helper_register_libraries,PLAINLIBS_OXT,\
306 307 308
	mysqlcppconn \
))

309
# note: this does not link mysqlcppconn, it is loaded via osl_loadModuleRelative
310
define gb_LinkTarget__use_mysql-connector-cpp
311

312
$(call gb_LinkTarget_use_unpacked,$(1),mysql-connector-cpp)
313

314 315 316 317
$(call gb_LinkTarget_add_defs,$(1),\
	-DCPPCONN_LIB_BUILD \
)

318
$(call gb_LinkTarget_set_include,$(1),\
319 320
	-I$(call gb_UnpackedTarball_get_dir,mysql-connector-cpp) \
	-I$(call gb_UnpackedTarball_get_dir,mysql-connector-cpp)/cppconn \
321 322 323 324 325 326 327
	$$(INCLUDE) \
)

endef

endif

328
ifneq ($(SYSTEM_ZLIB),)
329 330

define gb_LinkTarget__use_zlib
331
$(call gb_LinkTarget_add_defs,$(1),\
332 333 334
	-DSYSTEM_ZLIB \
)
$(call gb_LinkTarget_add_libs,$(1),-lz)
335

336 337
endef

David Tardon's avatar
David Tardon committed
338 339 340 341 342
# nothing on system
define gb_LinkTarget__use_zlib_x64

endef

343 344
gb_ExternalProject__use_zlib :=

345 346
else # !SYSTEM_ZLIB

David Tardon's avatar
David Tardon committed
347 348 349
define gb_LinkTarget__use_zlib_multiarch
$(if $(2),,$(call gb_Output_error,gb_LinkTarget__use_zlib_multiarch needs two arguments))

350
$(call gb_LinkTarget_set_include,$(1),\
351
	$(ZLIB_CFLAGS) \
352 353
	$$(INCLUDE) \
)
David Tardon's avatar
David Tardon committed
354

Michael Stahl's avatar
Michael Stahl committed
355
$(call gb_LinkTarget_use_static_libraries,$(1),\
David Tardon's avatar
David Tardon committed
356
	$(2) \
357
)
358

359 360
endef

David Tardon's avatar
David Tardon committed
361 362 363 364 365 366 367 368 369 370
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

371 372 373 374 375
define gb_ExternalProject__use_zlib
$(call gb_ExternalProject_use_static_libraries,$(1),zlib)

endef

376 377 378
endif # SYSTEM_ZLIB


379
ifneq ($(SYSTEM_LIBJPEG),)
380

381
define gb_LinkTarget__use_libjpeg
382
$(call gb_LinkTarget_add_libs,$(1),$(LIBJPEG_LIBS))
383
$(call gb_LinkTarget_set_ldflags,$(1),\
384
	$$(filter-out -L/usr/lib/jvm%,$$(T_LDFLAGS)) \
385
)
386

387 388
endef

389
gb_ExternalProject__use_libjpeg :=
390

391
else
392

393
define gb_LinkTarget__use_libjpeg
394
$(call gb_LinkTarget_set_include,$(1),\
395
	$(LIBJPEG_CFLAGS) \
396 397
	$$(INCLUDE) \
)
398
$(call gb_LinkTarget_add_libs,$(1),$(LIBJPEG_LIBS))
399
$(call gb_LinkTarget_use_external_project,$(1),libjpeg-turbo,full)
400 401 402

endef

403 404
define gb_ExternalProject__use_libjpeg
$(call gb_ExternalProject_use_external_project,$(1),libjpeg-turbo)
405 406 407

endef

408
endif # SYSTEM_LIBJPEG
409

410
ifneq ($(SYSTEM_MYTHES),)
Peter Foley's avatar
Peter Foley committed
411 412

define gb_LinkTarget__use_mythes
413 414 415 416 417 418
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
	$(MYTHES_CFLAGS) \
)
$(call gb_LinkTarget_add_libs,$(1),$(MYTHES_LIBS))

Peter Foley's avatar
Peter Foley committed
419 420 421 422 423
endef

else # !SYSTEM_MYTHES

define gb_LinkTarget__use_mythes
424 425 426 427
$(call gb_LinkTarget_set_include,$(1),\
	-I$(call gb_UnpackedTarball_get_dir,mythes) \
	$$(INCLUDE) \
)
428 429

ifeq ($(COM),MSC)
430 431
$(call gb_LinkTarget_use_static_libraries,$(1),\
	mythes \
Peter Foley's avatar
Peter Foley committed
432
)
433 434 435 436
else
$(call gb_LinkTarget_add_libs,$(1),$(MYTHES_LIBS))
$(call gb_LinkTarget_use_external_project,$(1),mythes)
endif
437

Peter Foley's avatar
Peter Foley committed
438 439 440 441
endef

endif # SYSTEM_MYTHES

442

443
ifneq ($(SYSTEM_EXPAT),)
444

445 446
define gb_LinkTarget__use_expat_impl
$(if $(2),,$(error gb_LinkTarget__use_expat_impl needs additional parameter))
447

448
$(call gb_LinkTarget_add_defs,$(1),\
449 450 451 452
	-DSYSTEM_EXPAT \
)

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

454 455
endef

456 457
gb_ExternalProject__use_expat :=

458 459
else # !SYSTEM_EXPAT

460 461
define gb_LinkTarget__use_expat_impl
$(if $(2),,$(error gb_LinkTarget__use_expat_impl needs additional parameter))
462

463
$(call gb_LinkTarget_set_include,$(1),\
464
	-I$(call gb_UnpackedTarball_get_dir,expat)/lib \
465 466 467
    $$(INCLUDE) \
)

Michael Stahl's avatar
Michael Stahl committed
468
$(call gb_LinkTarget_use_static_libraries,$(1),\
469 470
	$(2) \
)
471

472 473
endef

474 475 476 477 478
define gb_ExternalProject__use_expat
$(call gb_ExternalProject_use_static_libraries,$(1),expat)

endef

479 480
endif # SYSTEM_EXPAT

481 482
define gb_LinkTarget__use_expat
$(call gb_LinkTarget__use_expat_impl,$(1),expat)
483

484 485
endef

486 487
define gb_LinkTarget__use_expat_x64
$(call gb_LinkTarget__use_expat_impl,$(1),expat_x64)
488

489 490
endef

491
ifneq ($(SYSTEM_HYPH),)
Peter Foley's avatar
Peter Foley committed
492 493 494 495 496 497 498 499 500 501 502

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),\
503
	-I$(call gb_UnpackedTarball_get_dir,hyphen)\
Peter Foley's avatar
Peter Foley committed
504 505
	$$(INCLUDE) \
)
506 507

ifeq ($(COM),MSC)
Peter Foley's avatar
Peter Foley committed
508 509 510
$(call gb_LinkTarget_use_static_libraries,$(1),\
	hyphen \
)
511 512 513 514
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
515 516 517 518 519

endef

endif # SYSTEM_HYPH

520
ifneq ($(SYSTEM_HUNSPELL),)
521 522 523 524 525 526 527 528 529 530

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

endef

531 532
gb_ExternalProject__use_hunspell :=

533 534 535 536 537 538
else # !SYSTEM_HUNSPELL

define gb_LinkTarget__use_hunspell
$(call gb_LinkTarget_add_defs,$(1),\
	-DHUNSPELL_STATIC \
)
539
$(call gb_LinkTarget_use_unpacked,$(1),hunspell)
540
$(call gb_LinkTarget_set_include,$(1),\
541
	-I$(call gb_UnpackedTarball_get_dir,hunspell/src/hunspell)\
542
	$$(INCLUDE) \
543
)
544 545

ifeq ($(COM),MSC)
Michael Stahl's avatar
Michael Stahl committed
546
$(call gb_LinkTarget_use_static_libraries,$(1),\
547
	hunspell \
548
)
549 550 551 552 553 554 555 556 557
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)
558 559 560 561 562 563

endef

endif # SYSTEM_HUNSPELL


564
ifneq ($(SYSTEM_BOOST),)
565

David Tardon's avatar
David Tardon committed
566
define gb_LinkTarget__use_boost_lib
567 568 569 570 571 572 573 574 575
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
	$(BOOST_CPPFLAGS) \
)

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

David Tardon's avatar
David Tardon committed
576
$(call gb_LinkTarget_add_libs,$(1),$(2))
577

578 579
endef

580 581 582 583 584
define gb_LinkTarget__use_boost_locale
$(call gb_LinkTarget__use_boost_lib,$(1),$(BOOST_LOCALE_LIB))

endef

585
define gb_LinkTarget__use_boost_date_time
David Tardon's avatar
David Tardon committed
586
$(call gb_LinkTarget__use_boost_lib,$(1),$(BOOST_DATE_TIME_LIB))
Markus Mohrhard's avatar
Markus Mohrhard committed
587

David Tardon's avatar
David Tardon committed
588
endef
Markus Mohrhard's avatar
Markus Mohrhard committed
589

590 591 592 593 594 595 596
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
597 598
define gb_LinkTarget__use_boost_iostreams
$(call gb_LinkTarget__use_boost_lib,$(1),$(BOOST_IOSTREAMS_LIB))
Markus Mohrhard's avatar
Markus Mohrhard committed
599 600 601

endef

602 603
gb_ExternalProject__use_boost_iostreams :=

Markus Mohrhard's avatar
Markus Mohrhard committed
604
define gb_LinkTarget__use_boost_system
David Tardon's avatar
David Tardon committed
605
$(call gb_LinkTarget__use_boost_lib,$(1),$(BOOST_SYSTEM_LIB))
606 607 608

endef

Markus Mohrhard's avatar
Markus Mohrhard committed
609
gb_ExternalProject__use_boost_system :=
610

611 612 613 614 615 616 617 618
define gb_LinkTarget__use_boost_headers
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
	$(BOOST_CPPFLAGS) \
)

endef

Peter Foley's avatar
Peter Foley committed
619 620
gb_ExternalProject__use_boost_headers:=

621 622
else # !SYSTEM_BOOST

David Tardon's avatar
David Tardon committed
623
define gb_LinkTarget__use_boost_lib
624 625 626 627
$(call gb_LinkTarget_add_defs,$(1),\
	-DBOOST_ALL_NO_LIB \
)

David Tardon's avatar
David Tardon committed
628 629 630 631
$(call gb_LinkTarget_use_static_libraries,$(1),$(2))

endef

632 633 634 635 636 637 638 639
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

640 641
define gb_LinkTarget__use_boost_date_time
$(call gb_LinkTarget__use_boost_lib,$(1),boost_date_time)
642 643 644

endef

David Tardon's avatar
David Tardon committed
645
define gb_LinkTarget__use_boost_filesystem
David Tardon's avatar
David Tardon committed
646
$(call gb_LinkTarget__use_boost_lib,$(1),boost_filesystem)
David Tardon's avatar
David Tardon committed
647 648 649 650 651 652 653

endef

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

Markus Mohrhard's avatar
Markus Mohrhard committed
654
define gb_LinkTarget__use_boost_iostreams
David Tardon's avatar
David Tardon committed
655
$(call gb_LinkTarget__use_boost_lib,$(1),boost_iostreams)
Markus Mohrhard's avatar
Markus Mohrhard committed
656 657 658 659 660 661 662 663

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
664
$(call gb_LinkTarget__use_boost_lib,$(1),boost_system)
665 666 667

endef

Markus Mohrhard's avatar
Markus Mohrhard committed
668 669
define gb_ExternalProject__use_boost_system
$(call gb_ExternalProject_use_static_libraries,$(1),boost_system)
670 671
endef

Peter Foley's avatar
Peter Foley committed
672
define gb_LinkTarget__use_boost_headers
673
$(call gb_LinkTarget_use_unpacked,$(1),boost)
674
$(call gb_LinkTarget_set_include,$(1),\
675
	$(BOOST_CPPFLAGS) \
676 677
	$$(INCLUDE) \
)
Peter Foley's avatar
Peter Foley committed
678 679 680

endef

Peter Foley's avatar
Peter Foley committed
681
define gb_ExternalProject__use_boost_headers
David Tardon's avatar
David Tardon committed
682
$(call gb_ExternalProject_use_unpacked,$(1),boost)
Peter Foley's avatar
Peter Foley committed
683 684

endef
David Tardon's avatar
David Tardon committed
685

686 687 688
endif # SYSTEM_BOOST


689
ifneq ($(SYSTEM_LIBCMIS),)
690

691
define gb_LinkTarget__use_libcmis
692 693
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
694
	$(LIBCMIS_CFLAGS) \
695
)
696
$(call gb_LinkTarget_add_libs,$(1),$(LIBCMIS_LIBS))
697 698 699

endef

700
else # !SYSTEM_LIBCMIS
701

702
define gb_LinkTarget__use_libcmis
703
$(call gb_LinkTarget_set_include,$(1),\
704
	-I$(call gb_UnpackedTarball_get_dir,libcmis)/src \
705 706
	$$(INCLUDE) \
)
Michael Stahl's avatar
Michael Stahl committed
707
$(call gb_LinkTarget_use_static_libraries,$(1),\
708
	libcmis \
709 710 711 712
)

endef

713
endif # SYSTEM_LIBCMIS
714

David Tardon's avatar
David Tardon committed
715
ifeq ($(ENABLE_JAVA),TRUE)
716

Peter Foley's avatar
Peter Foley committed
717
define gb_LinkTarget__use_jawt
David Tardon's avatar
David Tardon committed
718
$(call gb_LinkTarget_add_libs,$(1),\
719
	$(JAWTLIB) \
Peter Foley's avatar
Peter Foley committed
720 721 722 723
)

endef

724 725 726 727 728
else # !ENABLE_JAVA

gb_LinkTarget__use_jawt :=

endif # ENABLE_JAVA
729

730
ifneq ($(SYSTEM_LIBATOMIC_OPS),)
731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749

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) \
)
750
$(call gb_LinkTarget_use_external_project,$(1),\
751 752
	libatomic_ops \
)
753

754
$(call gb_LinkTarget_add_libs,$(1),\
755
	-L$(call gb_UnpackedTarball_get_dir,libatomic_ops)/src/lib -latomic_ops \
756
)
757 758 759 760

endef

define gb_ExternalProject__use_libatomic_ops
761
$(call gb_ExternalProject_use_external_project,$(1),libatomic_ops)
762 763 764 765 766 767

endef

endif # SYSTEM_LIBATOMIC_OPS


768
ifneq ($(SYSTEM_LIBEXTTEXTCAT),)
769 770 771 772 773 774

define gb_LinkTarget__use_libexttextcat
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
	$(LIBEXTTEXTCAT_CFLAGS) \
)
775 776 777
$(call gb_LinkTarget_add_defs,$(1),\
	-DSYSTEM_LIBEXTTEXTCAT \
)
778 779 780 781 782 783 784
$(call gb_LinkTarget_add_libs,$(1),$(LIBEXTTEXTCAT_LIBS))

endef

else # !SYSTEM_LIBEXTTEXTCAT

define gb_LinkTarget__use_libexttextcat
785
$(call gb_LinkTarget_set_include,$(1),\
786
	-I$(call gb_UnpackedTarball_get_dir,libexttextcat/src) \
787
	$$(INCLUDE) \
788 789
)

790 791
ifeq ($(COM),MSC)
$(call gb_LinkTarget_use_static_libraries,$(1),\
792
	libexttextcat \
793 794 795
)
else
$(call gb_LinkTarget_add_libs,$(1),\
796
	$(call gb_UnpackedTarball_get_dir,libexttextcat)/src/.libs/libexttextcat-2.0.a\
797
)
798
$(call gb_LinkTarget_use_external_project,$(1),libexttextcat)
799 800 801
endif


802 803 804 805 806
endef

endif # SYSTEM_LIBEXTTEXTCAT


807
ifneq ($(SYSTEM_LIBXML),)
808 809

define gb_LinkTarget__use_libxml2
810
$(call gb_LinkTarget_add_defs,$(1),\
811 812 813 814 815 816 817
	-DSYSTEM_LIBXML \
)
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
	$(LIBXML_CFLAGS) \
)
$(call gb_LinkTarget_add_libs,$(1),$(LIBXML_LIBS))
818

819
endef
820
gb_ExternalProject__use_libxml2:=
821 822 823

else # !SYSTEM_LIBXML

824
$(eval $(call gb_Helper_register_packages_for_install,ure,\
825
	libxml2 \
826 827
))

828
define gb_LinkTarget__use_libxml2
829
$(call gb_LinkTarget_use_package,$(1),libxml2)
830 831
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
832
	$(LIBXML_CFLAGS) \
833 834
)

835
$(call gb_LinkTarget_add_libs,$(1),\
836
	$(LIBXML_LIBS) \
837
)
838 839 840

ifeq ($(COM),MSC)
$(call gb_LinkTarget_use_external,$(1),icu_headers)
841 842
endif

843 844
endef
define gb_ExternalProject__use_libxml2
845
$(call gb_ExternalProject_use_package,$(1),libxml2)
846

847
ifeq ($(COM),MSC)
848
$(call gb_ExternalProject_use_packages,$(1),icu icu_ure)
849 850
endif

851 852 853 854 855
endef

endif # SYSTEM_LIBXML


856
ifneq ($(SYSTEM_LIBXSLT),)
857 858 859 860 861 862 863

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

865 866
endef

867 868 869 870 871 872 873 874 875 876
define gb_LinkTarget__use_libexslt
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
	$(LIBEXSLT_CFLAGS) \
)

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

endef

877 878
else # !SYSTEM_LIBXSLT

879
$(eval $(call gb_Helper_register_packages_for_install,ooo,\
880
	libxslt \
881 882
))

883
define gb_LinkTarget__use_libxslt
884
$(call gb_LinkTarget_use_package,$(1),libxslt)
885 886
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
887
	-I$(call gb_UnpackedTarball_get_dir,libxslt) \
888
)
889 890 891

ifeq ($(COM),MSC)
$(call gb_LinkTarget_add_libs,$(1),\
892
	$(call gb_UnpackedTarball_get_dir,libxslt)/win32/bin.msvc/libxslt.lib \
893
)
894 895
else
$(call gb_LinkTarget_add_libs,$(1),\
896
	-L$(call gb_UnpackedTarball_get_dir,libxslt)/libxslt/.libs -lxslt \
897 898
)
endif
899

900 901
endef

902
define gb_LinkTarget__use_libexslt
903
$(call gb_LinkTarget_use_package,$(1),libxslt)
904 905
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
906
	-I$(call gb_UnpackedTarball_get_dir,libxslt) \
907 908
)

909 910
ifeq ($(COM),MSC)
$(call gb_LinkTarget_add_libs,$(1),\
911
	$(call gb_UnpackedTarball_get_dir,libxslt)/win32/bin.msvc/libexslt.lib \
912
)
913 914
else
$(call gb_LinkTarget_add_libs,$(1),\
915
	-L$(call gb_UnpackedTarball_get_dir,libxslt)/libexslt/.libs -lexslt \
916 917
)
endif
918 919 920

endef

921 922
endif # SYSTEM_LIBXSLT

923

924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951
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

952
ifneq ($(SYSTEM_LIBLANGTAG),)
953 954 955 956 957 958 959 960 961 962 963

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

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

endef

964 965
gb_ExternalProject__use_liblangtag :=

966 967
else # !SYSTEM_LIBLANGTAG

968
$(eval $(call gb_Helper_register_packages_for_install,ure,\
969 970 971
	liblangtag_data \
))

972 973
ifeq ($(COM),MSC)

974
define gb_LinkTarget__use_liblangtag
975
$(call gb_LinkTarget_set_include,$(1),\
976
	$(LIBLANGTAG_CFLAGS) \
977 978
	$$(INCLUDE) \
)
979
$(call gb_LinkTarget_add_libs,$(1),$(LIBLANGTAG_LIBS))
980
$(call gb_LinkTarget_use_external_project,$(1),liblangtag)
981 982 983

endef

984 985
else

986
$(eval $(call gb_Helper_register_packages_for_install,ure,\
987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001
	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

1002
define gb_ExternalProject__use_liblangtag
1003
$(call gb_ExternalProject_use_external_project,$(1),liblangtag)
1004 1005 1006

endef

1007 1008
endif # SYSTEM_LIBLANGTAG

1009

1010 1011 1012
gb_ExternalProject__use_apr :=

ifeq ($(WITH_WEBDAV),serf)
1013 1014 1015 1016 1017 1018 1019 1020

define gb_LinkTarget__use_apr
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
	$(APR_CFLAGS) \
)
$(call gb_LinkTarget_add_libs,$(1),\
	$(APR_LIBS) \
1021 1022
	$(if $(filter $(OS),LINUX),-lpthread) \
	$(if $(filter $(OS),MACOSX),-liconv) \
1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061
)

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

1062
else ifeq ($(WITH_WEBDAV),neon)
1063

1064
ifneq ($(SYSTEM_NEON),)
1065 1066 1067 1068

define gb_LinkTarget__use_neon
$(call gb_LinkTarget_add_defs,$(1),\
	-DNEON_VERSION=0x$(NEON_VERSION) \
1069
	-DSYSTEM_NEON \
1070 1071 1072
)
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
1073
	$(NEON_CFLAGS) \
1074 1075 1076 1077 1078 1079 1080 1081
)

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

endef

else # !SYSTEM_NEON

1082
$(eval $(call gb_Helper_register_libraries_for_install,PLAINLIBS_OOO,ooo,\
1083 1084 1085 1086
	neon \
))

define gb_LinkTarget__use_neon
1087
$(call gb_LinkTarget_use_unpacked,$(1),neon)
1088
$(call gb_LinkTarget_set_include,$(1),\
1089
	-I$(call gb_UnpackedTarball_get_dir,neon/src) \
1090 1091
	$$(INCLUDE) \
)
Michael Stahl's avatar
Michael Stahl committed
1092
$(call gb_LinkTarget_use_libraries,$(1),\
1093 1094 1095 1096 1097 1098 1099
	neon \
)

endef

endif # SYSTEM_NEON

1100
endif # WITH_WEBDAV
1101

1102
ifneq ($(SYSTEM_REDLAND),)
1103 1104

define gb_LinkTarget__use_librdf
1105
$(call gb_LinkTarget_add_defs,$(1),\
1106 1107 1108 1109 1110 1111 1112
	-DSYSTEM_REDLAND \
)
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
	$(REDLAND_CFLAGS) \
)
$(call gb_LinkTarget_add_libs,$(1),$(REDLAND_LIBS))
1113

1114 1115
endef

1116 1117 1118 1119 1120 1121
gb_LinkTarget__use_redland_headers:=

gb_LinkTarget__use_raptor_headers:=

gb_LinkTarget__use_rasqal_headers:=

1122 1123
else # !SYSTEM_REDLAND

1124 1125
define gb_LinkTarget__use_redland_headers
$(call gb_LinkTarget_set_include,$(1),\
1126
	-I$(call gb_UnpackedTarball_get_dir,redland)/src \
1127 1128 1129 1130 1131 1132 1133
	$$(INCLUDE) \
)

endef

define gb_LinkTarget__use_raptor_headers
$(call gb_LinkTarget_set_include,$(1),\
1134
	-I$(call gb_UnpackedTarball_get_dir,raptor)/src \
1135 1136 1137 1138 1139 1140 1141
	$$(INCLUDE) \
)

endef

define gb_LinkTarget__use_rasqal_headers
$(call gb_LinkTarget_set_include,$(1),\
1142
	-I$(call gb_UnpackedTarball_get_dir,rasqal)/src \
1143 1144 1145 1146 1147
	$$(INCLUDE) \
)

endef

1148 1149
ifneq ($(OS),ANDROID)

1150
ifeq ($(COM),MSC)
Michael Stahl's avatar
Michael Stahl committed
1151
$(eval $(call gb_Helper_register_libraries_for_install,PLAINLIBS_OOO,ooo, \
1152 1153
	raptor2 \
	rasqal \
1154 1155
	rdf \
))
1156 1157 1158 1159 1160 1161
else
$(eval $(call gb_Helper_register_packages_for_install,ooo, \
	raptor \
	rasqal \
	redland \
))
1162
endif
1163 1164

define gb_LinkTarget__use_librdf
1165 1166 1167 1168 1169 1170
ifeq ($(COM),MSC)
$(call gb_LinkTarget_use_libraries,$(1),\
	raptor2 \
	rdf \
)
else
1171
$(call gb_LinkTarget_use_packages,$(1),redland raptor rasqal)
1172

1173 1174
$(call gb_LinkTarget_add_libs,$(1),\
	-L$(call gb_UnpackedTarball_get_dir,redland)/src/.libs -lrdf \
1175 1176
	-L$(call gb_UnpackedTarball_get_dir,raptor)/src/.libs -lraptor2 \
	-L$(call gb_UnpackedTarball_get_dir,rasqal)/src/.libs -lrasqal \
1177
)
1178
endif
1179

1180 1181
endef

1182 1183 1184
else # ANDROID

define gb_LinkTarget__use_librdf
1185
$(call gb_LinkTarget_use_packages,$(1),redland raptor rasqal)
1186 1187 1188 1189 1190

endef

endif # ANDROID

1191 1192 1193
endif # SYSTEM_REDLAND


1194
ifneq ($(USING_X11)$(ENABLE_CAIRO_CANVAS)$(ENABLE_HEADLESS),) # or
1195

1196
ifneq ($(SYSTEM_CAIRO),)
1197 1198 1199 1200 1201 1202

define gb_LinkTarget__use_cairo
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
	$(CAIRO_CFLAGS) \
)
1203
$(call gb_LinkTarget_use_external,$(1),freetype_headers)
1204
$(call gb_LinkTarget_add_libs,$(1),$(CAIRO_LIBS))
1205

1206 1207
endef

1208
else # !SYSTEM_CAIRO
1209

1210 1211 1212 1213 1214
$(eval $(call gb_Helper_register_packages_for_install,ooo,\
	cairo \
	$(if $(filter $(OS),WNT),,pixman) \
))

1215
define gb_LinkTarget__use_cairo
1216 1217
$(call gb_LinkTarget_use_package,$(1),cairo)
$(call gb_LinkTarget_use_package,$(1),pixman)
1218
$(call gb_LinkTarget_use_external,$(1),freetype_headers)
1219
$(call gb_LinkTarget_set_include,$(1),\
1220 1221
	-I$(call gb_UnpackedTarball_get_dir,cairo) \
	-I$(call gb_UnpackedTarball_get_dir,cairo)/src \
Matúš Kukan's avatar
Matúš Kukan committed
1222
	$$(INCLUDE) \
1223
)
1224 1225
$(call gb_LinkTarget_add_libs,$(1),\
	-L$(call gb_UnpackedTarball_get_dir,cairo)/src/.libs -lcairo \
Matúš Kukan's avatar
Matúš Kukan committed
1226
	$(if $(filter-out MACOSX WNT,$(OS)), \
1227
		-L$(call gb_UnpackedTarball_get_dir,pixman)/pixman/.libs -lpixman-1 \
Matúš Kukan's avatar
Matúš Kukan committed
1228
	) \
1229
)
1230

1231 1232 1233 1234
endef

endif # SYSTEM_CAIRO

1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252
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

1253 1254
endif # CAIRO

1255
ifneq ($(SYSTEM_FREETYPE),)
1256 1257

define gb_LinkTarget__use_freetype_headers
1258 1259 1260 1261
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
	$(FREETYPE_CFLAGS) \
)
1262

1263 1264
endef

1265 1266
gb_ExternalProject__use_freetype :=

1267
else
1268 1269

define gb_LinkTarget__use_freetype_headers
1270
$(call gb_LinkTarget_use_external_project,$(1),freetype)
1271
$(call gb_LinkTarget_set_include,$(1),\
1272
	$(FREETYPE_CFLAGS) \
1273 1274 1275
	$$(INCLUDE) \
)

David Tardon's avatar
David Tardon committed
1276 1277
endef

1278
define gb_ExternalProject__use_freetype
1279
$(call gb_ExternalProject_use_external_project,$(1),freetype)
1280 1281 1282

endef

1283 1284
endif # SYSTEM_FREETYPE

1285 1286 1287 1288 1289 1290
define gb_LinkTarget__use_freetype
$(call gb_LinkTarget_use_external,$(1),freetype_headers)
$(call gb_LinkTarget_add_libs,$(1),$(FREETYPE_LIBS))

endef

1291
ifneq ($(SYSTEM_FONTCONFIG),)
1292

1293 1294 1295 1296 1297
define gb_LinkTarget__use_fontconfig
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
	$(FONTCONFIG_CFLAGS) \
)
1298

1299
$(call gb_LinkTarget_add_libs,$(1),$(FONTCONFIG_LIBS))
1300 1301 1302

endef

1303
else
1304 1305

define gb_LinkTarget__use_fontconfig
1306
$(call gb_LinkTarget_use_external_project,$(1),fontconfig)
1307 1308 1309 1310 1311
$(call gb_LinkTarget_set_include,$(1),\
	-I$(call gb_UnpackedTarball_get_dir,fontconfig) \
	$$(INCLUDE) \
)

1312 1313 1314
$(call gb_LinkTarget_add_libs,$(1),\
    -L$(call gb_UnpackedTarball_get_dir,fontconfig)/src/.libs -lfontconfig \
)
1315

1316
endef
1317

1318 1319
endif # SYSTEM_FONTCONFIG

1320
ifneq ($(SYSTEM_GRAPHITE),)
1321 1322 1323 1324 1325 1326 1327

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

1329 1330
endef

1331 1332
gb_ExternalProject__use_graphite:=

1333
else # !SYSTEM_GRAPHITE
1334 1335

define gb_LinkTarget__use_graphite
1336
$(call gb_LinkTarget_use_unpacked,$(1),graphite)
1337
$(call gb_LinkTarget_set_include,$(1),\
1338
	-I$(call gb_UnpackedTarball_get_dir,graphite/include) \
1339 1340
	$$(INCLUDE) \
)
Michael Stahl's avatar
Michael Stahl committed
1341
$(call gb_LinkTarget_use_static_libraries,$(1),\
1342
    graphite \
1343
)
1344

1345 1346
endef

1347
define gb_ExternalProject__use_graphite
1348 1349 1350
$(call gb_ExternalProject_use_static_libraries,$(1),\
	graphite \
)
1351 1352

endef
1353 1354
endif # SYSTEM_GRAPHITE

1355
ifneq ($(SYSTEM_ICU),)
1356

1357
gb_LinkTarget__use_icu_headers:=
1358
gb_ExternalProject__use_icu:=
1359

1360 1361 1362 1363
define gb_LinkTarget__use_icudata
$(call gb_LinkTarget_add_libs,$(1),-licudata)

endef
1364 1365
define gb_LinkTarget__use_icui18n
$(call gb_LinkTarget_add_libs,$(1),-licui18n)
1366

1367
endef
1368 1369
define gb_LinkTarget__use_icuuc
$(call gb_LinkTarget_add_libs,$(1),-licuuc)
1370

1371 1372 1373 1374
endef

else # !SYSTEM_ICU

1375 1376 1377 1378
$(eval $(call gb_Helper_register_packages_for_install,ure, \
	icu_ure \
))

1379 1380 1381 1382
$(eval $(call gb_Helper_register_packages_for_install,ooo, \
	icu \
))

1383
ifeq ($(OS)$(DISABLE_DYNLOADING),ANDROID)
1384 1385 1386 1387 1388
gb_ICU_suffix:=lo
else
gb_ICU_suffix:=
endif

1389
define gb_LinkTarget__use_icu_headers
Peter Foley's avatar
Peter Foley committed
1390
$(call gb_LinkTarget_use_unpacked,$(1),icu)
1391
$(call gb_LinkTarget_set_include,$(1),\
1392 1393 1394
	-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 \
1395 1396 1397 1398 1399
	$$(INCLUDE) \
)

endef

1400 1401
define gb_ExternalProject__use_icu
$(call gb_ExternalProject_use_package,$(1),icu)
1402 1403 1404

endef

Peter Foley's avatar
Peter Foley committed
1405
# icudata and icui18n is called icudt and icuin when built with MSVC :-/
1406
define gb_LinkTarget__use_icudata
1407
$(call gb_LinkTarget_use_package,$(1),icu_ure)
1408 1409 1410 1411 1412 1413 1414 1415

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) \
1416
)
1417
endif
1418 1419

endef
1420

1421
define gb_LinkTarget__use_icui18n
Peter Foley's avatar
Peter Foley committed
1422
$(call gb_LinkTarget_use_package,$(1),icu)
1423

1424 1425 1426 1427 1428 1429 1430 1431
ifeq ($(OS),WNT)
$(call gb_LinkTarget_add_libs,$(1),\
	$(call gb_UnpackedTarball_get_dir,icu)/source/lib/icuin$(if $(MSVC_USE_DEBUG_RUNTIME),d).lib \
)
else