tdf#143858: sw: default value for nInclUpperLevels is 1
[LibreOffice.git] / external / liborcus / ExternalProject_liborcus.mk
blobc7dd76ebfee531d0e61608e5f374ea502491cdcf
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 ifeq ($(ENABLE_GDB_INDEX),TRUE)
86 liborcus_LDFLAGS+=-Wl,--gdb-index
87 liborcus_CXXFLAGS+=-ggnu-pubnames
88 ifneq ($(USE_LD),)
89 liborcus_LDFLAGS += $(USE_LD)
90 endif
91 endif
93 $(call gb_ExternalProject_get_state_target,liborcus,build) :
94 $(call gb_Trace_StartRange,liborcus,EXTERNAL)
95 $(call gb_ExternalProject_run,build,\
96 $(if $(liborcus_LIBS),LIBS='$(liborcus_LIBS)') \
97 $(if $(liborcus_CXXFLAGS),CXXFLAGS='$(liborcus_CXXFLAGS)') \
98 $(if $(liborcus_CPPFLAGS),CPPFLAGS='$(liborcus_CPPFLAGS) $(gb_EMSCRIPTEN_CPPFLAGS)') \
99 $(if $(liborcus_LDFLAGS),LDFLAGS='$(liborcus_LDFLAGS)') \
100 MDDS_CFLAGS='$(MDDS_CFLAGS)' \
101 MDDS_LIBS=' ' \
102 MAKE=$(MAKE) $(gb_RUN_CONFIGURE) ./configure \
103 --with-pic \
104 $(if $(DISABLE_DYNLOADING), \
105 --enable-static --disable-shared \
107 --enable-shared --disable-static \
109 $(if $(ENABLE_DEBUG),--enable-debug,--disable-debug) \
110 --disable-spreadsheet-model \
111 --without-tools \
112 --disable-python \
113 --disable-werror \
114 $(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________OOO) \
115 $(if $(SYSTEM_BOOST),,\
116 --with-boost=$(WORKDIR)/UnpackedTarball/boost \
117 boost_cv_lib_iostreams=yes \
118 boost_cv_lib_system=yes \
119 boost_cv_lib_filesystem=yes \
121 $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
122 && $(if $(verbose),V=1) \
123 $(MAKE) \
124 $(if $(filter MACOSX,$(OS)),\
125 && $(PERL) $(SRCDIR)/solenv/bin/macosx-change-install-names.pl shl OOO \
126 $(EXTERNAL_WORKDIR)/src/liborcus/.libs/liborcus-0.16.0.dylib \
127 $(EXTERNAL_WORKDIR)/src/parser/.libs/liborcus-parser-0.16.0.dylib \
130 $(call gb_Trace_EndRange,liborcus,EXTERNAL)
132 # vim: set noet sw=4 ts=4: