bump product version to 4.2.0.1
[LibreOffice.git] / external / liborcus / ExternalProject_liborcus.mk
blob171ea5981c839e7e47e8512fb01e0c22ab062a37
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 boostsystem \
17 zlib \
20 $(eval $(call gb_ExternalProject_register_targets,liborcus,\
21 build \
24 # Must be built with debug GNU C++ library if --enable-dbgutil has
25 # caused the LO code to be built thusly.
27 # The LIBS setting for Android is needed to get the orcus-xml-dump
28 # executable to build successfully. We obviously don't actually need
29 # that executable on Android, but we don't want to bother with
30 # patching out building it for Android.
32 #$(if $(filter MSC,$(COM)),CPPFLAGS+="-DBOOST_ALL_NO_LIB") CXXFLAGS+="$(BOOST_CXXFLAGS))
34 liborcus_LIBS=
35 ifeq ($(SYSTEM_ZLIB),YES)
36 liborcus_LIBS+=-lz
37 endif
38 ifeq ($(SYSTEM_BOOST),YES)
39 liborcus_LIBS+=$(BOOST_SYSTEM_LIB)
40 else
41 liborcus_LIBS+=-L$(gb_StaticLibrary_WORKDIR) -lboostsystem
42 endif
43 ifeq ($(OS),ANDROID)
44 liborcus_LIBS+=-lgnustl_shared -lm
45 endif
47 liborcus_CPPCLAGS=$(CPPFLAGS)
48 ifeq ($(COM),MSC)
49 liborcus_CPPFLAGS+=-DBOOST_ALL_NO_LIB
50 endif
51 ifeq ($(SYSTEM_ZLIB),NO)
52 liborcus_CPPFLAGS+=$(ZLIB_CFLAGS)
53 endif
54 # patched boost needs to find config_global.h
55 ifeq ($(SYSTEM_BOOST),NO)
56 liborcus_CPPFLAGS += -I$(BUILDDIR)/config_$(gb_Side)
57 endif
59 # OSes that use the GNU C++ library need to use -D_GLIBCXX_DEBUG in
60 # sync with the rest of LibreOffice, i.e. depending on
61 # --enable-dbgutil. Note that although Android doesn't use the GNU C
62 # library (glibc), the NDK does offer the GNU C++ library as one of
63 # the C++ libraries available, and we use it.
65 ifneq (,$(filter ANDROID DRAGONFLY FREEBSD LINUX NETBSD OPENBSD,$(OS)))
66 ifneq (,$(gb_ENABLE_DBGUTIL))
67 liborcus_CPPFLAGS+=-D_GLIBCXX_DEBUG
68 endif
69 endif
71 liborcus_CXXFLAGS=$(CXXFLAGS)
72 liborcus_LDFLAGS=$(LDFLAGS)
73 ifeq ($(COM),MSC)
74 liborcus_CXXFLAGS+=$(BOOST_CXXFLAGS)
75 endif
76 ifeq ($(SYSTEM_BOOST),NO)
77 liborcus_CXXFLAGS+=-I$(WORKDIR)/UnpackedTarball/boost
78 else
79 liborcus_LDFLAGS+=$(BOOST_LDFLAGS)
80 endif
81 ifneq (,$(PTHREAD_LIBS))
82 liborcus_LDFLAGS+=$(PTHREAD_LIBS)
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 ./configure \
92 --with-pic \
93 --enable-static \
94 --disable-shared \
95 $(if $(filter TRUE,$(ENABLE_DEBUG)),--enable-debug,--disable-debug) \
96 --disable-spreadsheet-model \
97 --disable-werror \
98 $(if $(filter YES,$(CROSS_COMPILING)),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
99 $(if $(filter NO,$(SYSTEM_BOOST)),--with-boost-system=boostsystem) \
100 && $(if $(VERBOSE)$(verbose),V=1) \
101 $(MAKE) \
104 # vim: set noet sw=4 ts=4: