1 # -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
3 # This file is part of the LibreOffice project.
5 # This Source Code Form is subject to the terms of the Mozilla Public
6 # License, v. 2.0. If a copy of the MPL was not distributed with this
7 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 $(eval
$(call gb_ExternalProject_ExternalProject
,icu
))
12 $(eval
$(call gb_ExternalProject_register_targets
,icu
,\
16 icu_CPPFLAGS
:="-DHAVE_GCC_ATOMICS=$(if $(filter TRUE,$(GCC_HAVE_BUILTIN_ATOMIC)),1,0)"
20 # Note: runConfigureICU ignores everything following the platform name!
21 $(call gb_ExternalProject_get_state_target
,icu
,build
) :
22 $(call gb_ExternalProject_run
,build
,\
23 export LIB
="$(ILIB)" \
24 && CFLAGS
="-FS -arch:SSE $(SOLARINC) $(gb_DEBUGINFO_FLAGS)" CPPFLAGS
="$(SOLARINC)" CXXFLAGS
="-FS -arch:SSE $(SOLARINC) $(gb_DEBUGINFO_FLAGS)" \
25 INSTALL
=`cygpath -m /usr/bin/install` \
27 $(if
$(MSVC_USE_DEBUG_RUNTIME
),--enable-debug
--disable-release
) \
28 Cygwin
/MSVC
--disable-extras \
35 $(if $(filter iOS,$(OS)),-DUCONFIG_NO_FILE_IO) \
36 $(if $(SYSBASE),-I$(SYSBASE)/usr/include) \
37 $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS)) \
38 $(if $(ENABLE_LTO),$(gb_LTOFLAGS)) \
39 $(if $(filter GCC,$(COM)),-fno-strict-aliasing) \
40 $(if $(call gb_Module__symbols_enabled,icu),$(gb_DEBUGINFO_FLAGS)) \
41 $(if $(filter FUZZERS,$(BUILD_TYPE)),-DU_USE_STRTOD_L=0) \
42 $(if $(filter ANDROID,$(OS)),-fvisibility=hidden -fno-omit-frame-pointer)"
43 icu_CXXFLAGS
:="$(CXXFLAGS) $(CXXFLAGS_CXX11) \
44 $(if $(filter iOS,$(OS)),-DUCONFIG_NO_FILE_IO) \
45 $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS)) \
46 $(if $(ENABLE_LTO),$(gb_LTOFLAGS)) \
47 $(if $(filter GCC,$(COM)),-fno-strict-aliasing) \
48 $(if $(call gb_Module__symbols_enabled,icu),$(gb_DEBUGINFO_FLAGS)) \
49 $(if $(filter FUZZERS,$(BUILD_TYPE)),-DU_USE_STRTOD_L=0) \
50 $(if $(filter ANDROID,$(OS)),-fvisibility=hidden -fno-omit-frame-pointer $(SOLARINC))"
52 $(if $(ENABLE_LTO),$(gb_LTOFLAGS)) \
53 $(if $(filter TRUE,$(HAVE_LD_HASH_STYLE)),-Wl$(COMMA)--hash-style=$(WITH_LINKER_HASH_STYLE)) \
54 $(if $(SYSBASE),-L../lib -L../../lib -L../stubdata -L../../stubdata -L$(SYSBASE)/usr/lib) \
55 $(if $(filter TRUE,$(HAVE_LD_BSYMBOLIC_FUNCTIONS)), -Wl$(COMMA)-Bsymbolic-functions) \
56 $(if $(filter ANDROID,$(OS)),$(gb_STDLIBS))"
58 # DATASUBDIR=data in cross-compiling case, because --disable-tools completely skips the
59 # data directory/doesn't build the requested library in that case (icu/source/Makefile.in)
60 # so we need to add it back to the list of subdirectories to build
61 $(call gb_ExternalProject_get_state_target
,icu
,build
) :
62 $(call gb_ExternalProject_run
,build
,\
63 CPPFLAGS
=$(icu_CPPFLAGS
) CFLAGS
=$(icu_CFLAGS
) \
64 CXXFLAGS
=$(icu_CXXFLAGS
) LDFLAGS
=$(icu_LDFLAGS
) \
66 --disable-layout
--disable-samples \
67 $(if
$(filter FUZZERS
,$(BUILD_TYPE
)),--disable-release
) \
68 $(if
$(CROSS_COMPILING
),--disable-tools
--disable-extras
) \
69 $(if
$(filter iOS ANDROID
,$(OS
)),--disable-dyload
) \
70 $(if
$(filter ANDROID
,$(OS
)),--disable-strict ac_cv_c_bigendian
=no
) \
71 $(if
$(filter SOLARIS AIX
,$(OS
)),--disable-64bit-libs
) \
72 $(if
$(filter TRUE
,$(DISABLE_DYNLOADING
)),\
73 --with-data-packaging
=static
--enable-static
--disable-shared
--disable-dyload
,\
74 --disable-static
--enable-shared
$(if
$(filter ANDROID
,$(OS
)),--with-library-suffix
=lo
)) \
75 $(if
$(CROSS_COMPILING
),--build
=$(BUILD_PLATFORM
) --host
=$(HOST_PLATFORM
)\
76 --with-cross-build
=$(WORKDIR_FOR_BUILD
)/UnpackedTarball
/icu
/source
) \
77 && $(MAKE
) $(if
$(CROSS_COMPILING
),DATASUBDIR
=data
) \
78 $(if
$(filter MACOSX
,$(OS
)), \
79 && $(PERL
) $(SRCDIR
)/solenv
/bin
/macosx-change-install-names.pl shl \
81 $(EXTERNAL_WORKDIR
)/source
/lib
/libicuuc
$(gb_Library_DLLEXT
).
$(icu_VERSION
) \
82 $(EXTERNAL_WORKDIR
)/source
/lib
/libicui18n
$(gb_Library_DLLEXT
).
$(icu_VERSION
) \
83 && $(PERL
) $(SRCDIR
)/solenv
/bin
/macosx-change-install-names.pl shl \
85 $(EXTERNAL_WORKDIR
)/source
/lib
/libicudata
$(gb_Library_DLLEXT
).
$(icu_VERSION
)) \
90 # vim: set noet sw=4 ts=4: