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 $(call gb_ExternalProject_get_state_target
,icu
,build
) :
21 $(call gb_Trace_StartRange
,icu
,EXTERNAL
)
22 $(call gb_ExternalProject_run
,build
,\
24 && export LIB
="$(ILIB)" PYTHONWARNINGS
="default" \
25 gb_ICU_XFLAGS
="-FS $(SOLARINC) $(gb_DEBUGINFO_FLAGS) $(if $(MSVC_USE_DEBUG_RUNTIME),-MDd,-MD -Gy)" \
26 && CFLAGS
="$${gb_ICU_XFLAGS}" CPPFLAGS
="$(SOLARINC)" CXXFLAGS
="$${gb_ICU_XFLAGS} $(CXXFLAGS_CXX11)" \
27 INSTALL
=`cygpath -m /usr/bin/install` $(if
$(MSVC_USE_DEBUG_RUNTIME
),LDFLAGS
="-DEBUG") \
28 $(gb_RUN_CONFIGURE
) .
/configure \
29 $(if
$(MSVC_USE_DEBUG_RUNTIME
),--enable-debug
--disable-release
) \
30 $(gb_CONFIGURE_PLATFORMS
) \
31 $(if
$(CROSS_COMPILING
), \
32 --with-cross-build
=$(WORKDIR_FOR_BUILD
)/UnpackedTarball
/icu
/source \
33 --disable-tools
--disable-extras
) \
34 && $(MAKE
) $(if
$(CROSS_COMPILING
),DATASUBDIR
=data
) $(if
$(verbose
),VERBOSE
=1) \
36 $(call gb_Trace_EndRange
,icu
,EXTERNAL
)
40 icu_CFLAGS
:="$(CFLAGS) \
41 $(if $(filter iOS,$(OS)),-DUCONFIG_NO_FILE_IO) \
42 $(if $(SYSBASE),-I$(SYSBASE)/usr/include) \
43 $(call gb_ExternalProject_get_build_flags,icu) \
44 $(if $(ENABLE_LTO),$(gb_LTOFLAGS)) \
45 $(if $(filter GCC,$(COM)),-fno-strict-aliasing) \
46 $(if $(filter FUZZERS,$(BUILD_TYPE)),-DU_USE_STRTOD_L=0) \
47 $(if $(filter ANDROID,$(OS)),-fvisibility=hidden -fno-omit-frame-pointer)"
48 icu_CXXFLAGS
:="$(CXXFLAGS) $(CXXFLAGS_CXX11) \
49 $(if $(filter iOS,$(OS)),-DUCONFIG_NO_FILE_IO) \
50 $(call gb_ExternalProject_get_build_flags,icu) \
51 $(if $(ENABLE_LTO),$(gb_LTOFLAGS)) \
52 $(if $(filter GCC,$(COM)),-fno-strict-aliasing) \
53 $(if $(filter FUZZERS,$(BUILD_TYPE)),-DU_USE_STRTOD_L=0) \
54 $(if $(filter ANDROID,$(OS)),-fvisibility=hidden -fno-omit-frame-pointer -I$(SRCDIR)/include)"
56 $(if $(ENABLE_LTO),$(gb_LTOFLAGS)) \
57 $(call gb_ExternalProject_get_link_flags,icu) \
58 $(if $(filter TRUE,$(HAVE_LD_HASH_STYLE)),-Wl$(COMMA)--hash-style=$(WITH_LINKER_HASH_STYLE)) \
59 $(if $(SYSBASE),-L../lib -L../../lib -L../stubdata -L../../stubdata -L$(SYSBASE)/usr/lib) \
60 $(if $(filter TRUE,$(HAVE_LD_BSYMBOLIC_FUNCTIONS)), -Wl$(COMMA)-Bsymbolic-functions) \
61 $(if $(filter ANDROID,$(OS)),$(gb_STDLIBS))"
63 # DATASUBDIR=data in cross-compiling case, because --disable-tools completely skips the
64 # data directory/doesn't build the requested library in that case (icu/source/Makefile.in)
65 # so we need to add it back to the list of subdirectories to build
66 $(call gb_ExternalProject_get_state_target
,icu
,build
) :
67 $(call gb_Trace_StartRange
,icu
,EXTERNAL
)
68 $(call gb_ExternalProject_run
,build
,\
70 CPPFLAGS
=$(icu_CPPFLAGS
) CFLAGS
=$(icu_CFLAGS
) \
71 CXXFLAGS
=$(icu_CXXFLAGS
) LDFLAGS
=$(icu_LDFLAGS
) \
72 PYTHONWARNINGS
="default" \
73 $(gb_RUN_CONFIGURE
) .
/configure \
74 --disable-layout
--disable-samples \
75 $(if
$(filter FUZZERS
,$(BUILD_TYPE
)),--disable-release
) \
76 $(if
$(filter EMSCRIPTEN ANDROID
,$(OS
)),--disable-strict ac_cv_c_bigendian
=no
) \
77 $(if
$(filter SOLARIS
,$(OS
)),--disable-64bit-libs
) \
78 $(if
$(filter TRUE
,$(DISABLE_DYNLOADING
)),\
79 --with-data-packaging
=static
--enable-static
--disable-shared
--disable-dyload
,\
80 --disable-static
--enable-shared
$(if
$(filter ANDROID
,$(OS
)),--with-library-suffix
=lo
)) \
81 $(gb_CONFIGURE_PLATFORMS
) \
82 $(if
$(CROSS_COMPILING
), \
83 --with-cross-build
=$(WORKDIR_FOR_BUILD
)/UnpackedTarball
/icu
/source \
84 --disable-tools
--disable-extras
) \
85 AR
="$(AR)" RANLIB
="$(RANLIB)" \
86 && $(MAKE
) $(if
$(CROSS_COMPILING
),DATASUBDIR
=data
) $(if
$(verbose
),VERBOSE
=1) \
87 $(if
$(filter MACOSX
,$(OS
)), \
88 && $(PERL
) $(SRCDIR
)/solenv
/bin
/macosx-change-install-names.pl shl \
90 $(EXTERNAL_WORKDIR
)/source
/lib
/libicuuc
$(gb_Library_DLLEXT
).
$(icu_VERSION
) \
91 $(EXTERNAL_WORKDIR
)/source
/lib
/libicui18n
$(gb_Library_DLLEXT
).
$(icu_VERSION
) \
92 && $(PERL
) $(SRCDIR
)/solenv
/bin
/macosx-change-install-names.pl shl \
94 $(EXTERNAL_WORKDIR
)/source
/lib
/libicudata
$(gb_Library_DLLEXT
).
$(icu_VERSION
)) \
96 $(call gb_Trace_EndRange
,icu
,EXTERNAL
)
100 # vim: set noet sw=4 ts=4: