cid#1607171 Data race condition
[LibreOffice.git] / external / liborcus / ExternalProject_liborcus.mk
blob7f2e5f24083f96c2d8a1da9991f98c38605378a0
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,liborcus))
12 $(eval $(call gb_ExternalProject_use_autoconf,liborcus,build))
14 $(eval $(call gb_ExternalProject_use_externals,liborcus, \
15 boost_headers \
16 boost_filesystem \
17 boost_iostreams \
18 boost_system \
19 mdds_headers \
20 zlib \
23 $(eval $(call gb_ExternalProject_register_targets,liborcus,\
24 build \
27 # Must be built with debug GNU C++ library if --enable-dbgutil has
28 # caused the LO code to be built thus.
30 # The LIBS setting for Android is needed to get the orcus-xml-dump
31 # executable to build successfully. We obviously don't actually need
32 # that executable on Android, but we don't want to bother with
33 # patching out building it for Android.
35 #$(if $(filter MSC,$(COM)),CPPFLAGS+="-DBOOST_ALL_NO_LIB") CXXFLAGS+="$(BOOST_CXXFLAGS))
37 liborcus_LIBS=
38 ifneq ($(SYSTEM_ZLIB),)
39 liborcus_LIBS+=-lz
40 endif
41 ifneq ($(SYSTEM_BOOST),)
42 liborcus_LIBS+=$(BOOST_SYSTEM_LIB) $(BOOST_IOSTREAMS_LIB) $(BOOST_FILESYSTEM_LIB)
43 else
44 liborcus_LIBS+=-L$(gb_StaticLibrary_WORKDIR) -lboost_system -lboost_iostreams -lboost_filesystem
45 endif
46 ifeq ($(OS),ANDROID)
47 liborcus_LIBS+=$(gb_STDLIBS)
48 endif
50 liborcus_CPPFLAGS=$(CPPFLAGS)
51 ifeq ($(SYSTEM_ZLIB),)
52 liborcus_CPPFLAGS+=$(ZLIB_CFLAGS)
53 endif
55 # OSes that use the GNU C++ library need to use -D_GLIBCXX_DEBUG in
56 # sync with the rest of LibreOffice, i.e. depending on
57 # --enable-dbgutil. Note that although Android doesn't use the GNU C
58 # library (glibc), the NDK does offer the GNU C++ library as one of
59 # the C++ libraries available, and we use it.
61 liborcus_CPPFLAGS+=$(gb_COMPILERDEFS_STDLIB_DEBUG)
63 liborcus_CXXFLAGS=$(CXXFLAGS) $(gb_VISIBILITY_FLAGS) $(gb_VISIBILITY_FLAGS_CXX) $(CXXFLAGS_CXX11) -DBOOST_SYSTEM_NO_DEPRECATED
64 liborcus_LDFLAGS=$(LDFLAGS) $(gb_LTOFLAGS)
65 liborcus_CXXFLAGS+=$(call gb_ExternalProject_get_build_flags,liborcus)
66 liborcus_LDFLAGS+=$(call gb_ExternalProject_get_link_flags,liborcus)
67 ifeq ($(COM),MSC)
68 liborcus_CXXFLAGS+=$(BOOST_CXXFLAGS)
69 endif
70 ifeq ($(SYSTEM_BOOST),)
71 liborcus_CXXFLAGS+=${BOOST_CPPFLAGS}
72 else
73 liborcus_LDFLAGS+=$(BOOST_LDFLAGS)
74 endif
75 ifneq (,$(PTHREAD_LIBS))
76 liborcus_LDFLAGS+=$(PTHREAD_LIBS)
77 endif
79 ifeq ($(OS),LINUX)
80 liborcus_LDFLAGS+=-Wl,-z,origin -Wl,-rpath,\$$$$ORIGIN
81 endif
83 $(call gb_ExternalProject_get_state_target,liborcus,build) :
84 $(call gb_Trace_StartRange,liborcus,EXTERNAL)
85 $(call gb_ExternalProject_run,build,\
86 $(if $(liborcus_LIBS),LIBS='$(liborcus_LIBS)') \
87 $(if $(liborcus_CXXFLAGS),CXXFLAGS='$(liborcus_CXXFLAGS)') \
88 $(if $(liborcus_CPPFLAGS),CPPFLAGS='$(liborcus_CPPFLAGS) $(gb_EMSCRIPTEN_CPPFLAGS)') \
89 $(if $(liborcus_LDFLAGS),LDFLAGS='$(liborcus_LDFLAGS)') \
90 MDDS_CFLAGS='$(MDDS_CFLAGS)' \
91 MDDS_LIBS=' ' \
92 MAKE=$(MAKE) $(gb_RUN_CONFIGURE) ./configure \
93 --with-pic \
94 $(if $(DISABLE_DYNLOADING), \
95 --enable-static --disable-shared \
96 , \
97 --enable-shared --disable-static \
98 ) \
99 $(if $(ENABLE_DEBUG),--enable-debug,--disable-debug) \
100 --disable-spreadsheet-model \
101 --without-tools \
102 --without-benchmark \
103 --without-doc-example \
104 --disable-python \
105 --disable-werror \
106 $(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________OOO) \
107 $(if $(SYSTEM_BOOST),,\
108 --with-boost=$(WORKDIR)/UnpackedTarball/boost \
109 boost_cv_lib_iostreams=yes \
110 boost_cv_lib_system=yes \
111 boost_cv_lib_filesystem=yes \
113 $(gb_CONFIGURE_PLATFORMS) \
114 && $(if $(verbose),V=1) \
115 $(MAKE) \
116 $(if $(filter MACOSX,$(OS)),\
117 && $(PERL) $(SRCDIR)/solenv/bin/macosx-change-install-names.pl shl OOO \
118 $(EXTERNAL_WORKDIR)/src/liborcus/.libs/liborcus-0.18.0.dylib \
119 $(EXTERNAL_WORKDIR)/src/parser/.libs/liborcus-parser-0.18.0.dylib \
122 $(call gb_Trace_EndRange,liborcus,EXTERNAL)
124 # vim: set noet sw=4 ts=4: