android: use unified headers and llvm-c++ STL (x86) with NDK 16
[LibreOffice.git] / external / liborcus / ExternalProject_liborcus.mk
blob928c78e3a267aadfc61b4b1e2b7cdbf0618a62ca
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_CPPCLAGS=$(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 ifneq (,$(filter ANDROID DRAGONFLY FREEBSD IOS LINUX NETBSD OPENBSD,$(OS)))
62 ifneq (,$(gb_ENABLE_DBGUTIL))
63 liborcus_CPPFLAGS+=-D_GLIBCXX_DEBUG
64 endif
65 endif
67 liborcus_CXXFLAGS=$(CXXFLAGS) $(gb_VISIBILITY_FLAGS) $(gb_VISIBILITY_FLAGS_CXX) $(CXXFLAGS_CXX11) -DBOOST_SYSTEM_NO_DEPRECATED
68 liborcus_LDFLAGS=$(LDFLAGS) $(gb_LTOFLAGS)
69 ifeq ($(COM),MSC)
70 liborcus_CXXFLAGS+=$(BOOST_CXXFLAGS)
71 endif
72 ifeq ($(SYSTEM_BOOST),)
73 liborcus_CXXFLAGS+=${BOOST_CPPFLAGS}
74 else
75 liborcus_LDFLAGS+=$(BOOST_LDFLAGS)
76 endif
77 ifneq (,$(PTHREAD_LIBS))
78 liborcus_LDFLAGS+=$(PTHREAD_LIBS)
79 endif
81 ifeq ($(OS),LINUX)
82 liborcus_LDFLAGS+=-Wl,-z,origin -Wl,-rpath,\$$$$ORIGIN
83 endif
85 $(call gb_ExternalProject_get_state_target,liborcus,build) :
86 $(call gb_ExternalProject_run,build,\
87 $(if $(liborcus_LIBS),LIBS='$(liborcus_LIBS)') \
88 $(if $(liborcus_CXXFLAGS),CXXFLAGS='$(liborcus_CXXFLAGS)') \
89 $(if $(liborcus_CPPFLAGS),CPPFLAGS='$(liborcus_CPPFLAGS)') \
90 $(if $(liborcus_LDFLAGS),LDFLAGS='$(liborcus_LDFLAGS)') \
91 MDDS_CFLAGS='$(MDDS_CFLAGS)' \
92 MDDS_LIBS=' ' \
93 MAKE=$(MAKE) ./configure \
94 --with-pic \
95 $(if $(DISABLE_DYNLOADING), \
96 --enable-static --disable-shared \
97 , \
98 --enable-shared --disable-static \
99 ) \
100 $(if $(ENABLE_DEBUG),--enable-debug,--disable-debug) \
101 --disable-spreadsheet-model \
102 --without-tools \
103 --disable-python \
104 --disable-werror \
105 $(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________OOO) \
106 $(if $(SYSTEM_BOOST),,\
107 --with-boost=$(WORKDIR)/UnpackedTarball/boost \
108 boost_cv_lib_iostreams=yes \
109 boost_cv_lib_system=yes \
110 boost_cv_lib_filesystem=yes \
112 $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
113 && $(if $(verbose),V=1) \
114 $(MAKE) \
115 $(if $(filter MACOSX,$(OS)),\
116 && $(PERL) $(SRCDIR)/solenv/bin/macosx-change-install-names.pl shl OOO \
117 $(EXTERNAL_WORKDIR)/src/liborcus/.libs/liborcus-0.13.0.dylib \
118 $(EXTERNAL_WORKDIR)/src/parser/.libs/liborcus-parser-0.13.0.dylib \
122 # vim: set noet sw=4 ts=4: