RepositoryExternal.mk 85.8 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 231 232 233 234
define gb_LinkTarget__use_iconv
$(call gb_LinkTarget_add_libs,$(1),-liconv)

endef

235
ifneq ($(SYSTEM_MARIADB_CONNECTOR_C),)
236

237
define gb_LinkTarget__use_mariadb-connector-c
238 239 240 241 242 243 244
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
    $(MARIADB_CFLAGS) \
)
$(call gb_LinkTarget_add_libs,$(1),$(MARIADB_LIBS))

endef
245
gb_ExternalProject__use_mariadb-connector-c :=
246

247
else # !SYSTEM_MARIADB_CONNECTOR_C
248

249
define gb_LinkTarget__use_mariadb-connector-c
250 251 252 253 254
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
	$(MARIADB_CFLAGS) \
)
$(call gb_LinkTarget_use_static_libraries,$(1),\
255
	mariadb-connector-c \
256 257 258
)

endef
259 260
define gb_ExternalProject__use_mariadb-connector-c
$(call gb_ExternalProject_use_static_libraries,$(1),mariadb-connector-c)
261 262 263

endef

264
endif # SYSTEM_MARIADB_CONNECTOR_C
265 266


267
ifneq ($(SYSTEM_MARIADB_CONNECTOR_C),)
268 269 270 271

define gb_LinkTarget__use_mysql

$(call gb_LinkTarget_add_defs,$(1),\
272
	-DSYSTEM_MARIADB \
273 274 275
)

$(call gb_LinkTarget_add_libs,$(1),\
276
	$(MARIADB_LIBS) \
277 278 279
)

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

else

define gb_LinkTarget__use_mysql

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

endef

endif

297
ifneq ($(SYSTEM_MYSQL_CONNECTOR_CPP),)
298

299
define gb_LinkTarget__use_mysql-connector-cpp
300 301 302 303 304
$(call gb_LinkTarget_add_libs,$(1),\
	-lmysqlcppconn \
)

$(call gb_LinkTarget_add_defs,$(1),\
305
	-DSYSTEM_MYSQL_CPPCONN \
306 307 308 309 310
)
endef

else

311
$(eval $(call gb_Helper_register_libraries,PLAINLIBS_OXT,\
312 313 314
	mysqlcppconn \
))

315
# note: this does not link mysqlcppconn, it is loaded via osl_loadModuleRelative
316
define gb_LinkTarget__use_mysql-connector-cpp
317

318
$(call gb_LinkTarget_use_unpacked,$(1),mysql-connector-cpp)
319

320 321 322 323
$(call gb_LinkTarget_add_defs,$(1),\
	-DCPPCONN_LIB_BUILD \
)

324
$(call gb_LinkTarget_set_include,$(1),\
325 326
	-I$(call gb_UnpackedTarball_get_dir,mysql-connector-cpp) \
	-I$(call gb_UnpackedTarball_get_dir,mysql-connector-cpp)/cppconn \
327 328 329 330 331 332 333
	$$(INCLUDE) \
)

endef

endif

334
ifneq ($(SYSTEM_ZLIB),)
335 336

define gb_LinkTarget__use_zlib
337
$(call gb_LinkTarget_add_defs,$(1),\
338 339 340
	-DSYSTEM_ZLIB \
)
$(call gb_LinkTarget_add_libs,$(1),-lz)
341

342 343
endef

David Tardon's avatar
David Tardon committed
344 345 346 347 348
# nothing on system
define gb_LinkTarget__use_zlib_x64

endef

349 350
gb_ExternalProject__use_zlib :=

351 352
else # !SYSTEM_ZLIB

David Tardon's avatar
David Tardon committed
353 354 355
define gb_LinkTarget__use_zlib_multiarch
$(if $(2),,$(call gb_Output_error,gb_LinkTarget__use_zlib_multiarch needs two arguments))

356
$(call gb_LinkTarget_set_include,$(1),\
357
	$(ZLIB_CFLAGS) \
358 359
	$$(INCLUDE) \
)
David Tardon's avatar
David Tardon committed
360

Michael Stahl's avatar
Michael Stahl committed
361
$(call gb_LinkTarget_use_static_libraries,$(1),\
David Tardon's avatar
David Tardon committed
362
	$(2) \
363
)
364

365 366
endef

David Tardon's avatar
David Tardon committed
367 368 369 370 371 372 373 374 375 376
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

377 378 379 380 381
define gb_ExternalProject__use_zlib
$(call gb_ExternalProject_use_static_libraries,$(1),zlib)

endef

382 383 384
endif # SYSTEM_ZLIB


385
ifneq ($(SYSTEM_LIBJPEG),)
386

387
define gb_LinkTarget__use_libjpeg
388
$(call gb_LinkTarget_add_libs,$(1),$(LIBJPEG_LIBS))
389
$(call gb_LinkTarget_set_ldflags,$(1),\
390
	$$(filter-out -L/usr/lib/jvm%,$$(T_LDFLAGS)) \
391
)
392

393 394
endef

395
gb_ExternalProject__use_libjpeg :=
396

397
else
398

399
define gb_LinkTarget__use_libjpeg
400
$(call gb_LinkTarget_set_include,$(1),\
401
	$(LIBJPEG_CFLAGS) \
402 403
	$$(INCLUDE) \
)
404
$(call gb_LinkTarget_add_libs,$(1),$(LIBJPEG_LIBS))
405
$(call gb_LinkTarget_use_external_project,$(1),libjpeg-turbo,full)
406 407 408

endef

409 410
define gb_ExternalProject__use_libjpeg
$(call gb_ExternalProject_use_external_project,$(1),libjpeg-turbo)
411 412 413

endef

414
endif # SYSTEM_LIBJPEG
415

416
ifneq ($(SYSTEM_MYTHES),)
Peter Foley's avatar
Peter Foley committed
417 418

define gb_LinkTarget__use_mythes
419 420 421 422 423 424
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
	$(MYTHES_CFLAGS) \
)
$(call gb_LinkTarget_add_libs,$(1),$(MYTHES_LIBS))

Peter Foley's avatar
Peter Foley committed
425 426 427 428 429
endef

else # !SYSTEM_MYTHES

define gb_LinkTarget__use_mythes
430 431 432 433
$(call gb_LinkTarget_set_include,$(1),\
	-I$(call gb_UnpackedTarball_get_dir,mythes) \
	$$(INCLUDE) \
)
434 435

ifeq ($(COM),MSC)
436 437
$(call gb_LinkTarget_use_static_libraries,$(1),\
	mythes \
Peter Foley's avatar
Peter Foley committed
438
)
439 440 441 442
else
$(call gb_LinkTarget_add_libs,$(1),$(MYTHES_LIBS))
$(call gb_LinkTarget_use_external_project,$(1),mythes)
endif
443

Peter Foley's avatar
Peter Foley committed
444 445 446 447
endef

endif # SYSTEM_MYTHES

448

449
ifneq ($(SYSTEM_EXPAT),)
450

451 452
define gb_LinkTarget__use_expat_impl
$(if $(2),,$(error gb_LinkTarget__use_expat_impl needs additional parameter))
453

454
$(call gb_LinkTarget_add_defs,$(1),\
455 456 457 458
	-DSYSTEM_EXPAT \
)

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

460 461
endef

462 463
gb_ExternalProject__use_expat :=

464 465
else # !SYSTEM_EXPAT

466 467
define gb_LinkTarget__use_expat_impl
$(if $(2),,$(error gb_LinkTarget__use_expat_impl needs additional parameter))
468

469
$(call gb_LinkTarget_set_include,$(1),\
470
	-I$(call gb_UnpackedTarball_get_dir,expat)/lib \
471 472 473
    $$(INCLUDE) \
)

Michael Stahl's avatar
Michael Stahl committed
474
$(call gb_LinkTarget_use_static_libraries,$(1),\
475 476
	$(2) \
)
477

478 479
endef

480 481 482 483 484
define gb_ExternalProject__use_expat
$(call gb_ExternalProject_use_static_libraries,$(1),expat)

endef

485 486
endif # SYSTEM_EXPAT

487 488
define gb_LinkTarget__use_expat
$(call gb_LinkTarget__use_expat_impl,$(1),expat)
489

490 491
endef

492 493
define gb_LinkTarget__use_expat_x64
$(call gb_LinkTarget__use_expat_impl,$(1),expat_x64)
494

495 496
endef

497
ifneq ($(SYSTEM_HYPH),)
Peter Foley's avatar
Peter Foley committed
498 499 500 501 502 503 504 505 506 507 508

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),\
509
	-I$(call gb_UnpackedTarball_get_dir,hyphen)\
Peter Foley's avatar
Peter Foley committed
510 511
	$$(INCLUDE) \
)
512 513

ifeq ($(COM),MSC)
Peter Foley's avatar
Peter Foley committed
514 515 516
$(call gb_LinkTarget_use_static_libraries,$(1),\
	hyphen \
)
517 518 519 520
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
521 522 523 524 525

endef

endif # SYSTEM_HYPH

526
ifneq ($(SYSTEM_HUNSPELL),)
527 528 529 530 531 532 533 534 535 536

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

endef

537 538
gb_ExternalProject__use_hunspell :=

539 540 541 542 543 544
else # !SYSTEM_HUNSPELL

define gb_LinkTarget__use_hunspell
$(call gb_LinkTarget_add_defs,$(1),\
	-DHUNSPELL_STATIC \
)
545
$(call gb_LinkTarget_use_unpacked,$(1),hunspell)
546
$(call gb_LinkTarget_set_include,$(1),\
547
	-I$(call gb_UnpackedTarball_get_dir,hunspell/src/hunspell)\
548
	$$(INCLUDE) \
549
)
550 551

ifeq ($(COM),MSC)
Michael Stahl's avatar
Michael Stahl committed
552
$(call gb_LinkTarget_use_static_libraries,$(1),\
553
	hunspell \
554
)
555 556 557 558 559 560 561 562 563
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)
564 565 566 567 568 569

endef

endif # SYSTEM_HUNSPELL


570
ifneq ($(SYSTEM_BOOST),)
571

David Tardon's avatar
David Tardon committed
572
define gb_LinkTarget__use_boost_lib
573 574 575 576 577 578 579 580 581
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
	$(BOOST_CPPFLAGS) \
)

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

David Tardon's avatar
David Tardon committed
582
$(call gb_LinkTarget_add_libs,$(1),$(2))
583

584 585
endef

586 587 588 589 590
define gb_LinkTarget__use_boost_locale
$(call gb_LinkTarget__use_boost_lib,$(1),$(BOOST_LOCALE_LIB))

endef

591
define gb_LinkTarget__use_boost_date_time
David Tardon's avatar
David Tardon committed
592
$(call gb_LinkTarget__use_boost_lib,$(1),$(BOOST_DATE_TIME_LIB))
Markus Mohrhard's avatar
Markus Mohrhard committed
593

David Tardon's avatar
David Tardon committed
594
endef
Markus Mohrhard's avatar
Markus Mohrhard committed
595

596 597 598 599 600 601 602
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
603 604
define gb_LinkTarget__use_boost_iostreams
$(call gb_LinkTarget__use_boost_lib,$(1),$(BOOST_IOSTREAMS_LIB))
Markus Mohrhard's avatar
Markus Mohrhard committed
605 606 607

endef

608 609
gb_ExternalProject__use_boost_iostreams :=

Markus Mohrhard's avatar
Markus Mohrhard committed
610
define gb_LinkTarget__use_boost_system
David Tardon's avatar
David Tardon committed
611
$(call gb_LinkTarget__use_boost_lib,$(1),$(BOOST_SYSTEM_LIB))
612 613 614

endef

Markus Mohrhard's avatar
Markus Mohrhard committed
615
gb_ExternalProject__use_boost_system :=
616

617 618 619 620 621 622 623 624
define gb_LinkTarget__use_boost_headers
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
	$(BOOST_CPPFLAGS) \
)

endef

Peter Foley's avatar
Peter Foley committed
625 626
gb_ExternalProject__use_boost_headers:=

627 628
else # !SYSTEM_BOOST

David Tardon's avatar
David Tardon committed
629
define gb_LinkTarget__use_boost_lib
630 631 632 633
$(call gb_LinkTarget_add_defs,$(1),\
	-DBOOST_ALL_NO_LIB \
)

David Tardon's avatar
David Tardon committed
634 635 636 637
$(call gb_LinkTarget_use_static_libraries,$(1),$(2))

endef

638 639 640 641 642 643 644 645
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

646 647
define gb_LinkTarget__use_boost_date_time
$(call gb_LinkTarget__use_boost_lib,$(1),boost_date_time)
648 649 650

endef

David Tardon's avatar
David Tardon committed
651
define gb_LinkTarget__use_boost_filesystem
David Tardon's avatar
David Tardon committed
652
$(call gb_LinkTarget__use_boost_lib,$(1),boost_filesystem)
David Tardon's avatar
David Tardon committed
653 654 655 656 657 658 659

endef

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

Markus Mohrhard's avatar
Markus Mohrhard committed
660
define gb_LinkTarget__use_boost_iostreams
David Tardon's avatar
David Tardon committed
661
$(call gb_LinkTarget__use_boost_lib,$(1),boost_iostreams)
Markus Mohrhard's avatar
Markus Mohrhard committed
662 663 664 665 666 667 668 669

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
670
$(call gb_LinkTarget__use_boost_lib,$(1),boost_system)
671 672 673

endef

Markus Mohrhard's avatar
Markus Mohrhard committed
674 675
define gb_ExternalProject__use_boost_system
$(call gb_ExternalProject_use_static_libraries,$(1),boost_system)
676 677
endef

Peter Foley's avatar
Peter Foley committed
678
define gb_LinkTarget__use_boost_headers
679
$(call gb_LinkTarget_use_unpacked,$(1),boost)
680
$(call gb_LinkTarget_set_include,$(1),\
681
	$(BOOST_CPPFLAGS) \
682 683
	$$(INCLUDE) \
)
Peter Foley's avatar
Peter Foley committed
684 685 686

endef

Peter Foley's avatar
Peter Foley committed
687
define gb_ExternalProject__use_boost_headers
David Tardon's avatar
David Tardon committed
688
$(call gb_ExternalProject_use_unpacked,$(1),boost)
Peter Foley's avatar
Peter Foley committed
689 690

endef
David Tardon's avatar
David Tardon committed
691

692 693 694
endif # SYSTEM_BOOST


695
ifneq ($(SYSTEM_LIBCMIS),)
696

697
define gb_LinkTarget__use_libcmis
698 699
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
700
	$(LIBCMIS_CFLAGS) \
701
)
702
$(call gb_LinkTarget_add_libs,$(1),$(LIBCMIS_LIBS))
703 704 705

endef

706
else # !SYSTEM_LIBCMIS
707

708
define gb_LinkTarget__use_libcmis
709
$(call gb_LinkTarget_set_include,$(1),\
710
	-I$(call gb_UnpackedTarball_get_dir,libcmis)/src \
711 712
	$$(INCLUDE) \
)
Michael Stahl's avatar
Michael Stahl committed
713
$(call gb_LinkTarget_use_static_libraries,$(1),\
714
	libcmis \
715 716 717 718
)

endef

719
endif # SYSTEM_LIBCMIS
720

David Tardon's avatar
David Tardon committed
721
ifeq ($(ENABLE_JAVA),TRUE)
722

Peter Foley's avatar
Peter Foley committed
723
define gb_LinkTarget__use_jawt
David Tardon's avatar
David Tardon committed
724
$(call gb_LinkTarget_add_libs,$(1),\
725
	$(JAWTLIB) \
Peter Foley's avatar
Peter Foley committed
726 727 728 729
)

endef

730 731 732 733 734
else # !ENABLE_JAVA

gb_LinkTarget__use_jawt :=

endif # ENABLE_JAVA
735

736
ifneq ($(SYSTEM_LIBATOMIC_OPS),)
737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755

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) \
)
756
$(call gb_LinkTarget_use_external_project,$(1),\
757 758
	libatomic_ops \
)
759

760
$(call gb_LinkTarget_add_libs,$(1),\
761
	-L$(call gb_UnpackedTarball_get_dir,libatomic_ops)/src/lib -latomic_ops \
762
)
763 764 765 766

endef

define gb_ExternalProject__use_libatomic_ops
767
$(call gb_ExternalProject_use_external_project,$(1),libatomic_ops)
768 769 770 771 772 773

endef

endif # SYSTEM_LIBATOMIC_OPS


774
ifneq ($(SYSTEM_LIBEXTTEXTCAT),)
775 776 777 778 779 780

define gb_LinkTarget__use_libexttextcat
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
	$(LIBEXTTEXTCAT_CFLAGS) \
)
781 782 783
$(call gb_LinkTarget_add_defs,$(1),\
	-DSYSTEM_LIBEXTTEXTCAT \
)
784 785 786 787 788 789 790
$(call gb_LinkTarget_add_libs,$(1),$(LIBEXTTEXTCAT_LIBS))

endef

else # !SYSTEM_LIBEXTTEXTCAT

define gb_LinkTarget__use_libexttextcat
791
$(call gb_LinkTarget_set_include,$(1),\
792
	-I$(call gb_UnpackedTarball_get_dir,libexttextcat/src) \
793
	$$(INCLUDE) \
794 795
)

796 797
ifeq ($(COM),MSC)
$(call gb_LinkTarget_use_static_libraries,$(1),\
798
	libexttextcat \
799 800 801
)
else
$(call gb_LinkTarget_add_libs,$(1),\
802
	$(call gb_UnpackedTarball_get_dir,libexttextcat)/src/.libs/libexttextcat-2.0.a\
803
)
804
$(call gb_LinkTarget_use_external_project,$(1),libexttextcat)
805 806 807
endif


808 809 810 811 812
endef

endif # SYSTEM_LIBEXTTEXTCAT


813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849
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),)

define gb_LinkTarget__use_libnumbertext

$(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\
)
850
$(call gb_LinkTarget_use_external_project,$(1),libnumbertext,full)
851 852 853 854 855 856 857 858 859 860 861 862 863 864 865

endif

endef

else # !ENABLE_LIBNUMBERTEXT

define gb_LinkTarget__use_libnumbertext
endef

endif # ENABLE_LIBNUMBERTEXT

endif # SYSTEM_LIBNUMBERTEXT


866
ifneq ($(SYSTEM_LIBXML),)
867 868

define gb_LinkTarget__use_libxml2
869
$(call gb_LinkTarget_add_defs,$(1),\
870 871 872 873 874 875 876
	-DSYSTEM_LIBXML \
)
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
	$(LIBXML_CFLAGS) \
)
$(call gb_LinkTarget_add_libs,$(1),$(LIBXML_LIBS))
877

878
endef
879
gb_ExternalProject__use_libxml2:=
880 881 882

else # !SYSTEM_LIBXML

883
$(eval $(call gb_Helper_register_packages_for_install,ure,\
884
	libxml2 \
885 886
))

887
define gb_LinkTarget__use_libxml2
888
$(call gb_LinkTarget_use_package,$(1),libxml2)
889 890
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
891
	$(LIBXML_CFLAGS) \
892 893
)

894
$(call gb_LinkTarget_add_libs,$(1),\
895
	$(LIBXML_LIBS) \
896
)
897 898 899

ifeq ($(COM),MSC)
$(call gb_LinkTarget_use_external,$(1),icu_headers)
900 901
endif

902 903
endef
define gb_ExternalProject__use_libxml2
904
$(call gb_ExternalProject_use_package,$(1),libxml2)
905

906
ifeq ($(COM),MSC)
907
$(call gb_ExternalProject_use_packages,$(1),icu icu_ure)
908 909
endif

910 911 912 913 914
endef

endif # SYSTEM_LIBXML


915
ifneq ($(SYSTEM_LIBXSLT),)
916 917 918 919 920 921 922

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

924 925
endef

926 927 928 929 930 931 932 933 934 935
define gb_LinkTarget__use_libexslt
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
	$(LIBEXSLT_CFLAGS) \
)

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

endef

936 937
else # !SYSTEM_LIBXSLT

938
$(eval $(call gb_Helper_register_packages_for_install,ooo,\
939
	libxslt \
940 941
))

942
define gb_LinkTarget__use_libxslt
943
$(call gb_LinkTarget_use_package,$(1),libxslt)
944 945
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
946
	-I$(call gb_UnpackedTarball_get_dir,libxslt) \
947
)
948 949 950

ifeq ($(COM),MSC)
$(call gb_LinkTarget_add_libs,$(1),\
951
	$(call gb_UnpackedTarball_get_dir,libxslt)/win32/bin.msvc/libxslt.lib \
952
)
953 954
else
$(call gb_LinkTarget_add_libs,$(1),\
955
	-L$(call gb_UnpackedTarball_get_dir,libxslt)/libxslt/.libs -lxslt \
956 957
)
endif
958

959 960
endef

961
define gb_LinkTarget__use_libexslt
962
$(call gb_LinkTarget_use_package,$(1),libxslt)
963 964
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
965
	-I$(call gb_UnpackedTarball_get_dir,libxslt) \
966 967
)

968 969
ifeq ($(COM),MSC)
$(call gb_LinkTarget_add_libs,$(1),\
970
	$(call gb_UnpackedTarball_get_dir,libxslt)/win32/bin.msvc/libexslt.lib \
971
)
972 973
else
$(call gb_LinkTarget_add_libs,$(1),\
974
	-L$(call gb_UnpackedTarball_get_dir,libxslt)/libexslt/.libs -lexslt \
975 976
)
endif
977 978 979

endef

980 981
endif # SYSTEM_LIBXSLT

982

983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010
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

1011
ifneq ($(SYSTEM_LIBLANGTAG),)
1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022

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

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

endef

1023 1024
gb_ExternalProject__use_liblangtag :=

1025 1026
else # !SYSTEM_LIBLANGTAG

1027
$(eval $(call gb_Helper_register_packages_for_install,ure,\
1028 1029 1030
	liblangtag_data \
))

1031 1032
ifeq ($(COM),MSC)

1033
define gb_LinkTarget__use_liblangtag
1034
$(call gb_LinkTarget_set_include,$(1),\
1035
	$(LIBLANGTAG_CFLAGS) \
1036 1037
	$$(INCLUDE) \
)
1038
$(call gb_LinkTarget_add_libs,$(1),$(LIBLANGTAG_LIBS))
1039
$(call gb_LinkTarget_use_external_project,$(1),liblangtag)
1040 1041 1042

endef

1043 1044
else

1045
$(eval $(call gb_Helper_register_packages_for_install,ure,\
1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060
	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

1061
define gb_ExternalProject__use_liblangtag
1062
$(call gb_ExternalProject_use_external_project,$(1),liblangtag)
1063 1064 1065

endef

1066 1067
endif # SYSTEM_LIBLANGTAG

1068

1069 1070 1071
gb_ExternalProject__use_apr :=

ifeq ($(WITH_WEBDAV),serf)
1072 1073 1074 1075 1076 1077 1078 1079

define gb_LinkTarget__use_apr
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
	$(APR_CFLAGS) \
)
$(call gb_LinkTarget_add_libs,$(1),\
	$(APR_LIBS) \
1080 1081
	$(if $(filter $(OS),LINUX),-lpthread) \
	$(if $(filter $(OS),MACOSX),-liconv) \
1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120
)

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

1121
else ifeq ($(WITH_WEBDAV),neon)
1122

1123
ifneq ($(SYSTEM_NEON),)
1124 1125 1126 1127

define gb_LinkTarget__use_neon
$(call gb_LinkTarget_add_defs,$(1),\
	-DNEON_VERSION=0x$(NEON_VERSION) \
1128
	-DSYSTEM_NEON \
1129 1130 1131
)
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
1132
	$(NEON_CFLAGS) \
1133 1134 1135 1136 1137 1138 1139 1140
)

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

endef

else # !SYSTEM_NEON

1141
$(eval $(call gb_Helper_register_libraries_for_install,PLAINLIBS_OOO,ooo,\
1142 1143 1144 1145
	neon \
))

define gb_LinkTarget__use_neon
1146
$(call gb_LinkTarget_use_unpacked,$(1),neon)
1147
$(call gb_LinkTarget_set_include,$(1),\
1148
	-I$(call gb_UnpackedTarball_get_dir,neon/src) \
1149 1150
	$$(INCLUDE) \
)
Michael Stahl's avatar
Michael Stahl committed
1151
$(call gb_LinkTarget_use_libraries,$(1),\
1152 1153 1154 1155 1156 1157 1158
	neon \
)

endef

endif # SYSTEM_NEON

1159
endif # WITH_WEBDAV
1160

1161
ifneq ($(SYSTEM_REDLAND),)
1162 1163

define gb_LinkTarget__use_librdf
1164
$(call gb_LinkTarget_add_defs,$(1),\
1165 1166 1167 1168 1169 1170 1171
	-DSYSTEM_REDLAND \
)
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
	$(REDLAND_CFLAGS) \
)
$(call gb_LinkTarget_add_libs,$(1),$(REDLAND_LIBS))
1172

1173 1174
endef

1175 1176 1177 1178 1179 1180
gb_LinkTarget__use_redland_headers:=

gb_LinkTarget__use_raptor_headers:=

gb_LinkTarget__use_rasqal_headers:=

1181 1182
else # !SYSTEM_REDLAND

1183 1184
define gb_LinkTarget__use_redland_headers
$(call gb_LinkTarget_set_include,$(1),\
1185
	-I$(call gb_UnpackedTarball_get_dir,redland)/src \
1186 1187 1188 1189 1190 1191 1192
	$$(INCLUDE) \
)

endef

define gb_LinkTarget__use_raptor_headers
$(call gb_LinkTarget_set_include,$(1),\
1193
	-I$(call gb_UnpackedTarball_get_dir,raptor)/src \
1194 1195 1196 1197 1198 1199 1200
	$$(INCLUDE) \
)

endef

define gb_LinkTarget__use_rasqal_headers
$(call gb_LinkTarget_set_include,$(1),\
1201
	-I$(call gb_UnpackedTarball_get_dir,rasqal)/src \
1202 1203 1204 1205 1206
	$$(INCLUDE) \
)

endef

1207 1208
ifneq ($(OS),ANDROID)

1209
ifeq ($(COM),MSC)
Michael Stahl's avatar
Michael Stahl committed
1210
$(eval $(call gb_Helper_register_libraries_for_install,PLAINLIBS_OOO,ooo, \
1211 1212
	raptor2 \
	rasqal \
1213 1214
	rdf \
))
1215 1216 1217 1218 1219 1220
else
$(eval $(call gb_Helper_register_packages_for_install,ooo, \
	raptor \
	rasqal \
	redland \
))
1221
endif
1222 1223

define gb_LinkTarget__use_librdf
1224 1225 1226 1227 1228 1229
ifeq ($(COM),MSC)
$(call gb_LinkTarget_use_libraries,$(1),\
	raptor2 \
	rdf \
)
else
1230
$(call gb_LinkTarget_use_packages,$(1),redland raptor rasqal)
1231

1232 1233
$(call gb_LinkTarget_add_libs,$(1),\
	-L$(call gb_UnpackedTarball_get_dir,redland)/src/.libs -lrdf \
1234 1235
	-L$(call gb_UnpackedTarball_get_dir,raptor)/src/.libs -lraptor2 \
	-L$(call gb_UnpackedTarball_get_dir,rasqal)/src/.libs -lrasqal \
1236
)
1237
endif
1238

1239 1240
endef

1241 1242 1243
else # ANDROID

define gb_LinkTarget__use_librdf
1244
$(call gb_LinkTarget_use_packages,$(1),redland raptor rasqal)
1245 1246 1247 1248 1249

endef

endif # ANDROID

1250 1251 1252
endif # SYSTEM_REDLAND


1253
ifneq ($(USING_X11)$(ENABLE_CAIRO_CANVAS)$(ENABLE_HEADLESS),) # or
1254

1255
ifneq ($(SYSTEM_CAIRO),)
1256 1257 1258 1259 1260 1261

define gb_LinkTarget__use_cairo
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
	$(CAIRO_CFLAGS) \
)
1262
$(call gb_LinkTarget_use_external,$(1),freetype_headers)
1263
$(call gb_LinkTarget_add_libs,$(1),$(CAIRO_LIBS))
1264

1265 1266
endef

1267
else # !SYSTEM_CAIRO
1268

1269 1270 1271 1272 1273
$(eval $(call gb_Helper_register_packages_for_install,ooo,\
	cairo \
	$(if $(filter $(OS),WNT),,pixman) \
))

1274
define gb_LinkTarget__use_cairo
1275 1276
$(call gb_LinkTarget_use_package,$(1),cairo)
$(call gb_LinkTarget_use_package,$(1),pixman)
1277
$(call gb_LinkTarget_use_external,$(1),freetype_headers)
1278
$(call gb_LinkTarget_set_include,$(1),\
1279 1280
	-I$(call gb_UnpackedTarball_get_dir,cairo) \
	-I$(call gb_UnpackedTarball_get_dir,cairo)/src \
Matúš Kukan's avatar
Matúš Kukan committed
1281
	$$(INCLUDE) \
1282
)
1283 1284
$(call gb_LinkTarget_add_libs,$(1),\
	-L$(call gb_UnpackedTarball_get_dir,cairo)/src/.libs -lcairo \
Matúš Kukan's avatar
Matúš Kukan committed
1285
	$(if $(filter-out MACOSX WNT,$(OS)), \
1286
		-L$(call gb_UnpackedTarball_get_dir,pixman)/pixman/.libs -lpixman-1 \
Matúš Kukan's avatar
Matúš Kukan committed
1287
	) \
1288
)
1289

1290 1291 1292 1293
endef

endif # SYSTEM_CAIRO

1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311
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

1312 1313
endif # CAIRO

1314
ifneq ($(SYSTEM_FREETYPE),)
1315 1316

define gb_LinkTarget__use_freetype_headers
1317 1318 1319 1320
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
	$(FREETYPE_CFLAGS) \
)
1321

1322 1323
endef

1324 1325
gb_ExternalProject__use_freetype :=

1326
else
1327 1328

define gb_LinkTarget__use_freetype_headers
1329
$(call gb_LinkTarget_use_external_project,$(1),freetype)
1330
$(call gb_LinkTarget_set_include,$(1),\
1331
	$(FREETYPE_CFLAGS) \
1332 1333 1334
	$$(INCLUDE) \
)

David Tardon's avatar
David Tardon committed
1335 1336
endef

1337
define gb_ExternalProject__use_freetype
1338
$(call gb_ExternalProject_use_external_project,$(1),freetype)
1339 1340 1341

endef

1342 1343
endif # SYSTEM_FREETYPE

1344 1345 1346 1347 1348 1349
define gb_LinkTarget__use_freetype
$(call gb_LinkTarget_use_external,$(1),freetype_headers)
$(call gb_LinkTarget_add_libs,$(1),$(FREETYPE_LIBS))

endef

1350
ifneq ($(SYSTEM_FONTCONFIG),)
1351

1352 1353 1354 1355 1356
define gb_LinkTarget__use_fontconfig
$(call gb_LinkTarget_set_include,$(1),\
	$$(INCLUDE) \
	$(FONTCONFIG_CFLAGS) \
)
1357

1358
$(call gb_LinkTarget_add_libs,$(1),$(FONTCONFIG_LIBS))
1359 1360 1361

endef

1362
else
1363 1364

define gb_LinkTarget__use_fontconfig
1365
$(call gb_LinkTarget_use_external_project,$(1),fontconfig)
1366 1367 1368 1369 1370
$(call gb_LinkTarget_set_include,$(1),\
	-I$(call gb_UnpackedTarball_get_dir,fontconfig) \
	$$(INCLUDE) \
)

1371 1372 1373
$(call gb_LinkTarget_add_libs,$(1),\
    -L$(call gb_UnpackedTarball_get_dir,fontconfig)/src/.libs -lfontconfig \
)
1374

1375
endef
1376

1377 1378
endif # SYSTEM_FONTCONFIG

1379
ifneq ($(SYSTEM_GRAPHITE),)
1380 1381 1382 1383 1384 1385 1386

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

1388 1389
endef

1390 1391
gb_ExternalProject__use_graphite:=

1392
else # !SYSTEM_GRAPHITE
1393 1394

define gb_LinkTarget__use_graphite
1395
$(call gb_LinkTarget_use_unpacked,$(1),graphite)
1396
$(call gb_LinkTarget_set_include,$(1),\
1397
	-I$(call gb_UnpackedTarball_get_dir,graphite/include) \
1398 1399
	$$(INCLUDE) \
)
Michael Stahl's avatar
Michael Stahl committed
1400
$(call gb_LinkTarget_use_static_libraries,$(1),\
1401
    graphite \
1402
)
1403

1404 1405
endef

1406
define gb_ExternalProject__use_graphite
1407 1408 1409
$(call gb_ExternalProject_use_static_libraries,$(1),\
	graphite \
)
1410 1411

endef
1412 1413
endif # SYSTEM_GRAPHITE

1414
ifneq ($(SYSTEM_ICU),)
1415

1416
gb_LinkTarget__use_icu_headers:=
1417
gb_ExternalProject__use_icu:=
1418

1419 1420 1421 1422
define gb_LinkTarget__use_icudata
$(call gb_LinkTarget_add_libs,$(1),-licudata)

endef
1423 1424
define gb_LinkTarget__use_icui18n
$(call gb_LinkTarget_add_libs,$(1),-licui18n)
1425

1426
endef
1427 1428
define gb_LinkTarget__use_icuuc
$(call gb_LinkTarget_add_libs,$(1),-licuuc)
1429

1430 1431 1432 1433
endef

else # !SYSTEM_ICU

1434 1435 1436 1437
$(eval $(call gb_Helper_register_packages_for_install,ure, \
	icu_ure \
))

1438 1439 1440 1441
$(eval $(call gb_Helper_register_packages_for_install,ooo, \
	icu \
))

1442
ifeq ($(OS)$(DISABLE_DYNLOADING),ANDROID)
1443 1444 1445 1446 1447
gb_ICU_suffix:=lo
else
gb_ICU_suffix:=
endif

1448
define gb_LinkTarget__use_icu_headers
Peter Foley's avatar
Peter Foley committed
1449
$(call gb_LinkTarget_use_unpacked,$(1),icu)
1450
$(call gb_LinkTarget_set_include,$(1),\
1451 1452 1453
	-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 \
1454 1455 1456 1457 1458
	$$(INCLUDE) \
)

endef

1459 1460
define gb_ExternalProject__use_icu
$(call gb_ExternalProject_use_package,$(1),icu)
1461 1462 1463

endef

Peter Foley's avatar
Peter Foley committed
1464
# icudata and icui18n is called icudt and icuin when built with MSVC :-/