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
, \
23 $(eval
$(call gb_ExternalProject_register_targets
,liborcus
,\
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))
38 ifneq ($(SYSTEM_ZLIB
),)
41 ifneq ($(SYSTEM_BOOST
),)
42 liborcus_LIBS
+=$(BOOST_SYSTEM_LIB
) $(BOOST_IOSTREAMS_LIB
) $(BOOST_FILESYSTEM_LIB
)
44 liborcus_LIBS
+=-L
$(gb_StaticLibrary_WORKDIR
) -lboost_system
-lboost_iostreams
-lboost_filesystem
47 liborcus_LIBS
+=$(gb_STDLIBS
)
50 liborcus_CPPCLAGS
=$(CPPFLAGS
)
51 ifeq ($(SYSTEM_ZLIB
),)
52 liborcus_CPPFLAGS
+=$(ZLIB_CFLAGS
)
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
67 liborcus_CXXFLAGS
=$(CXXFLAGS
) $(gb_VISIBILITY_FLAGS
) $(gb_VISIBILITY_FLAGS_CXX
) $(CXXFLAGS_CXX11
) -DBOOST_SYSTEM_NO_DEPRECATED
68 liborcus_LDFLAGS
=$(LDFLAGS
) $(gb_LTOFLAGS
)
70 liborcus_CXXFLAGS
+=$(BOOST_CXXFLAGS
)
72 ifeq ($(SYSTEM_BOOST
),)
73 liborcus_CXXFLAGS
+=${BOOST_CPPFLAGS}
75 liborcus_LDFLAGS
+=$(BOOST_LDFLAGS
)
77 ifneq (,$(PTHREAD_LIBS
))
78 liborcus_LDFLAGS
+=$(PTHREAD_LIBS
)
82 liborcus_LDFLAGS
+=-Wl
,-z
,origin -Wl
,-rpath
,\
$$$$ORIGIN
85 ifeq ($(ENABLE_GDB_INDEX
),TRUE
)
86 liborcus_LDFLAGS
+=-Wl
,--gdb-index
87 liborcus_CXXFLAGS
+=-ggnu-pubnames
89 liborcus_LDFLAGS
+= $(USE_LD
)
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)' \
102 MAKE
=$(MAKE
) $(gb_RUN_CONFIGURE
) .
/configure \
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 \
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) \
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: