blob: 28e4a33387e4059e08a6616c16666918d0192d83 [file] [log] [blame]
Tor Lillqvistad4a4672011-05-27 18:29:43 +03001Cross-compiling LibreOffice
Tor Lillqvist30fded62013-03-18 09:24:41 +02002***************************
Tor Lillqvistad4a4672011-05-27 18:29:43 +03003
Tor Lillqvist30fded62013-03-18 09:24:41 +02004Cross-compilation works, to various degree, to the following
Tor Lillqvist7aa6f1b2013-04-03 21:04:16 +03005platforms: Windows, iOS, Android, and Raspbian.
Tor Lillqvistad4a4672011-05-27 18:29:43 +03006
Tor Lillqvistad4a4672011-05-27 18:29:43 +03007
8General
9-------
10
11In GNU Autoconf terminology, "build" is the platform on which you are
Tor Lillqvistbc229ca2012-05-17 22:57:46 +030012running a build of some software and "host" is the platform on which
Tor Lillqvistad4a4672011-05-27 18:29:43 +030013the software you are building will run. Only in the specific case of
14building compilers and other programming tools is the term "target"
15used to indicate the platform for which the tools your are building
16will produce code. As LibreOffice is not a compiler, the "target" term
17should not be used in the context of cross-compilation.
18
19(For a case where all three of "build", "host" and "target" are
20different: consider a gcc cross-compiler running on Windows, producing
21code for Android, where the cross-compiler itself was built on
22Linux. (This is a real case.) An interesting tidbit is that such
23configurations are called "Canadian Cross".)
24
25Even though the LibreOffice build mechanism is highly unorthodox, the
26configure script takes the normal --build and --host options like any
27GNU Autoconf -based configure script. To cross-compile, you basically
28need just to specify a suitable --host option and things should work
Tor Lillqvist30fded62013-03-18 09:24:41 +020029out nicely. In practice, many details need to be handled. See examples
30below.
31
32Note that in the case of LibreOffice, it is uncommon to run the
33configure script directly. Normally one uses the autogen.sh script.
Tor Lillqvist5011f4c2013-05-01 20:47:02 +030034The autogen.sh script reads command-line options from file called
Chris Sherlock91b27bc2013-05-16 00:49:50 +100035autogen.input if it exists. The typical way of working is to keep
Tor Lillqvist5011f4c2013-05-01 20:47:02 +030036the configure parameters in that file and edit it as needed.
Tor Lillqvistad4a4672011-05-27 18:29:43 +030037
38
39What is so hard, then?
40----------------------
41
42Despite the fact that the configure script takes normal --build and
Tor Lillqvist30fded62013-03-18 09:24:41 +020043--host options, that is just the beginning. It was necessary to
44separate tests for "host" and "build" platforms in the configure
45script. See the git log for details. And the reasonably "standard"
46configure.in is just the top level; when we get down to the actual
47makefilery used to build the bits of LibreOffice, it gets much worse.
Tor Lillqvistad4a4672011-05-27 18:29:43 +030048
49
50Windows
Tor Lillqvist30fded62013-03-18 09:24:41 +020051*******
Tor Lillqvistad4a4672011-05-27 18:29:43 +030052
Tor Lillqvist30fded62013-03-18 09:24:41 +020053There was some support in LibreOffice already from OpenOffice.org days
54for building it locally on Windows with the GNU tool-chain (MinGW).
55Apparently, those doing that work never attempted cross-compilation.
Tor Lillqvistad4a4672011-05-27 18:29:43 +030056
Tor Lillqvist30fded62013-03-18 09:24:41 +020057This OOo-originated MinGW support attempts to be for both running the
58Cygwin gcc in its -mno-cygwin mode, and a Windows-native MinGW
59compiler. The -mno-cygwin mechanism in the Cygwin gcc is rapidly being
60obsoleted, if it isn't already, and we have not attempted to try to
Chris Sherlock91b27bc2013-05-16 00:49:50 +100061keep it working; in fact we have actively cleaned out mechanisms
Tor Lillqvist30fded62013-03-18 09:24:41 +020062related to this. Ditto for native MinGW. If one compiles natively on
63Windows, just use a version of Microsoft's compiler. OpenOffice.org
64and LibreOffice have been built for Windows all the time using that.
Tor Lillqvist297a2df2011-06-18 11:31:50 +030065
Chris Sherlock91b27bc2013-05-16 00:49:50 +100066The only case where it makes sense to use MinGW is for
Tor Lillqvist30fded62013-03-18 09:24:41 +020067cross-compilation. There is just too much crack involved on Windows
68anyway, and it is a semi-miracle that the MSVC build under Cygwin
69works as nicely as it does.
Tor Lillqvistad4a4672011-05-27 18:29:43 +030070
71MinGW is available as cross-build toolchains pre-packaged in more or
Tor Lillqvist30fded62013-03-18 09:24:41 +020072less official packages for many Linux distros including Debian, Fedora
Chris Sherlock91b27bc2013-05-16 00:49:50 +100073and openSUSE. For instance, the mingw32 packages in the Open Build
Tor Lillqvist30fded62013-03-18 09:24:41 +020074Service, running on openSUSE, can be found at:
Jan Holesovsky81ca6d82011-08-19 15:01:17 +020075
76http://download.opensuse.org/repositories/windows:/mingw:/win32/
77
Fridrich Štrba06fa2d52011-10-20 13:27:08 +020078For example, you can install it like this:
Jan Holesovsky81ca6d82011-08-19 15:01:17 +020079
Fridrich Štrba06fa2d52011-10-20 13:27:08 +020080zypper ar http://download.opensuse.org/repositories/windows:/mingw:/win32/<your_os>/windows:mingw:win32.repo
81
Miklos Vajna42960dc2013-04-19 18:26:03 +020082where <your_os> is one of SLE_11, SLE_11_SP1, openSUSE_XX.Y, or
Fridrich Štrba06fa2d52011-10-20 13:27:08 +020083openSUSE_Factory.
84
Jan Holesovsky91a8ef22011-08-24 10:26:11 +020085zypper in mingw32-cross-gcc mingw32-cross-gcc-c++ mingw32-python-devel \
Jan Holesovsky4533b4b2012-11-25 11:07:44 +010086 mingw32-python mingw32-libboost_date_time \
Jan Holesovsky91a8ef22011-08-24 10:26:11 +020087 mingw32-libexpat-devel mingw32-libexpat mingw32-boost-devel \
88 mingw32-libhyphen-devel mingw32-libhyphen mingw32-hyphen-en \
89 mingw32-liblpsolve mingw32-liblpsolve-devel \
Jan Holesovskyc0111fd2011-08-24 01:09:03 +020090 mingw32-libxml2-devel mingw32-libxslt-devel mingw32-libicu \
91 mingw32-libicu-devel mingw32-libgraphite2 mingw32-libgraphite2-devel \
Fridrich Štrba06fa2d52011-10-20 13:27:08 +020092 mingw32-libcairo2 mingw32-cairo-devel mingw32-librsvg mingw32-librsvg-devel \
Jan Holesovskyc0111fd2011-08-24 01:09:03 +020093 mingw32-hunspell mingw32-hunspell-devel mingw32-libcurl \
Jan Holesovsky2f33c162011-08-24 01:18:36 +020094 mingw32-libcurl-devel mingw32-libneon mingw32-libneon-devel \
Fridrich Štrba06fa2d52011-10-20 13:27:08 +020095 mingw32-libopenssl mingw32-libopenssl-devel mingw32-libexttextcat \
96 mingw32-libexttextcat-devel mingw32-libdb mingw32-libdb-devel \
Jan Holesovsky91a8ef22011-08-24 10:26:11 +020097 mingw32-cross-pkg-config mingw32-pkg-config mingw32-libcppunit \
98 mingw32-libcppunit-devel mingw32-libredland mingw32-libredland-devel \
Jan Holesovsky4533b4b2012-11-25 11:07:44 +010099 mingw32-libmythes mingw32-libmythes-devel mingw32-mozilla-nss \
Jan Holesovsky7861bf02012-11-25 12:46:10 +0100100 mingw32-mozilla-nss-devel mingw32-mozilla-nspr \
101 mingw32-mozilla-nspr-devel mingw32-libpoppler mingw32-libpoppler-devel
Jan Holesovsky81ca6d82011-08-19 15:01:17 +0200102
Jan Holesovsky063afe52012-07-23 18:16:46 +0200103You also need wine, ideally:
104
105zypper ar http://download.opensuse.org/repositories/Emulators:/Wine/<your_os>/Emulators:Wine.repo
106
107zypper in wine wine-devel wine-devel-32bit
108
109And in order to be able to use 'winegcc -m32', also
110
111zypper in glibc-devel-32bit gcc-32bit
112
Jan Holesovsky81ca6d82011-08-19 15:01:17 +0200113There might be more that are missing, please read carefully what autogen.sh
114tells you, and either remove one of the --with-system-*, or install the
Jan Holesovskyc0111fd2011-08-24 01:09:03 +0200115missing dependency.
116
117It also looks like graphite2.pc needs tweaking in order to work right; but
Tor Lillqvist7974c4f2011-08-28 11:14:47 +0300118that's likely to be fixed in the openSUSE project.
Tor Lillqvistad4a4672011-05-27 18:29:43 +0300119
120It is somewhat unclear how well thought-out the conditionals and code
Tor Lillqvist297a2df2011-06-18 11:31:50 +0300121for MinGW inside the OOo-originated code in LibreOffice actually
Tor Lillqvistc4feba92012-01-22 10:18:47 +0200122are. It often seems a bit randomish, with copy-pasting having been
123preferred to factoring out differences.
Tor Lillqvistad4a4672011-05-27 18:29:43 +0300124
Tor Lillqvistee4fc402012-01-17 19:06:26 +0200125Most of the configuration settings are maintained in the
Tor Lillqvist5011f4c2013-05-01 20:47:02 +0300126distro-configs/LibreOfficeMinGW.conf file, so in your autogen.input,
Tor Lillqvistee4fc402012-01-17 19:06:26 +0200127you can use:
Jan Holesovsky9d65c8932011-11-03 21:06:33 +0100128
129CC=ccache i686-w64-mingw32-gcc
130CXX=ccache i686-w64-mingw32-g++
131CC_FOR_BUILD=ccache gcc
132CXX_FOR_BUILD=ccache g++
133--with-distro=LibreOfficeMinGW
134
Tor Lillqvistee4fc402012-01-17 19:06:26 +0200135Alternatively, you can use something like the following; but the
136preferred way is to keep the LibreOfficeMinGW.conf file up-to-date.
Tor Lillqvistad4a4672011-05-27 18:29:43 +0300137
138CC=ccache i686-w64-mingw32-gcc
139CXX=ccache i686-w64-mingw32-g++
140CC_FOR_BUILD=ccache gcc
141CXX_FOR_BUILD=ccache g++
142--build=x86_64-unknown-linux-gnu
143--host=i686-w64-mingw32
144--with-distro=LibreOfficeWin32
Tor Lillqvist5166d6e2011-08-31 10:37:33 +0300145--disable-activex
Tor Lillqvistd0ab6802011-07-21 09:49:26 +0300146--disable-directx
Tor Lillqvistad4a4672011-05-27 18:29:43 +0300147--disable-ext-nlpsolver
Tor Lillqvistad4a4672011-05-27 18:29:43 +0300148--disable-ext-presenter-minimizer
149--disable-ext-report-builder
150--disable-ext-scripting-beanshell
151--disable-ext-scripting-javascript
152--disable-ext-wiki-publisher
153--disable-ext-wiki-publisher
Stephan Bergmann7bf64a52012-11-24 22:58:01 +0100154--disable-pdfimport
Tor Lillqvistc565e5d2011-06-13 15:46:26 +0300155--enable-python=system
Tor Lillqvistad4a4672011-05-27 18:29:43 +0300156--with-system-altlinuxhyph
157--with-system-boost
Tor Lillqvist297a2df2011-06-18 11:31:50 +0300158--with-system-cairo
Tor Lillqvistd0ab6802011-07-21 09:49:26 +0300159--with-system-cppunit
Tor Lillqvistad4a4672011-05-27 18:29:43 +0300160--with-system-curl
Tor Lillqvistad4a4672011-05-27 18:29:43 +0300161--with-system-expat
162--with-system-hunspell
163--with-system-icu
Tor Lillqvist297a2df2011-06-18 11:31:50 +0300164--with-system-libpng
Tor Lillqvistc565e5d2011-06-13 15:46:26 +0300165--with-system-libwpd
166--with-system-libwpg
167--with-system-libwps
168--with-system-libxml
Tor Lillqvistad4a4672011-05-27 18:29:43 +0300169--with-system-lpsolve
Tor Lillqvistc565e5d2011-06-13 15:46:26 +0300170--with-system-mythes
Tor Lillqvistad4a4672011-05-27 18:29:43 +0300171--with-system-neon
172--with-system-openssl
173--with-system-redland
Tor Lillqvistad4a4672011-05-27 18:29:43 +0300174--with-vendor=no
Tor Lillqvist5166d6e2011-08-31 10:37:33 +0300175--without-help
176--without-helppack-integration
177--without-myspell-dicts
Tor Lillqvistad4a4672011-05-27 18:29:43 +0300178
Tor Lillqvistbc229ca2012-05-17 22:57:46 +0300179Once you have compiled it, you may want to try to run it, for instance
180using Wine:
Jan Holesovsky07a7e3a2011-09-27 12:02:01 +0200181
Jan Holesovsky004820b2011-09-29 15:25:54 +0200182$ cd /tmp
Jan Holesovskyef88d772013-03-01 11:55:15 +0100183$ tar xf <your-build-dir>/workdir/wntgcci.pro/installation/LibreOffice_Dev/archive/install/en-US/LibO-Dev_4.1.0.0.alpha0_Win_x86_archive.tar.gz
184$ cd LibO-Dev_4.1.0.0.alpha0_Win_x86_archive/LOdev\ 4.1/program/
Jan Holesovsky07a7e3a2011-09-27 12:02:01 +0200185$ wine soffice.exe
186
Jan Holesovsky004820b2011-09-29 15:25:54 +0200187NB. it is important to unpack somewhere low in the hierarchy structure (like
188in /tmp as advised above), otherwise you'll get BerkeleyDB errors on startup.
189
Jan Holesovsky07a7e3a2011-09-27 12:02:01 +0200190And if you are brave enough, you can even debug it. First you have to add the
191URE dll's to the wine's PATH using 'wine regedit' - see
192http://www.winehq.org/docs/wineusr-guide/environment-variables, and add
Jan Holesovsky256c4de2013-03-01 11:57:04 +0100193Z:\tmp\LibO-Dev_4.1.0.0.alpha0_Win_x86_archive/LOdev\ 4.1\URE\bin
Jan Holesovsky004820b2011-09-29 15:25:54 +0200194to "Path" in My Computer->HKEY_CURRENT_USER->Environment.
Jan Holesovsky07a7e3a2011-09-27 12:02:01 +0200195
196Then run linkoo, so that when you rebuild something, you can directly see the
197changes the next time you run it:
198
Jan Holesovsky256c4de2013-03-01 11:57:04 +0100199solenv/bin/linkoo '/tmp/LibO-Dev_4.1.0.0.alpha0_Win_x86_archive/LOdev\ 4.1' <your_clone_dir>
Jan Holesovsky07a7e3a2011-09-27 12:02:01 +0200200
201And start debugging:
202
203$ winedbg soffice.bin
204
205Would be great to be able to use winedbg --gdb, but it was crashing here :-( -
206but maybe you'll be more lucky.
207
Jan Holesovskye0c17f42012-03-19 15:27:25 +0100208Tricks of some use with winedbg:
209--------------------------------
210
211To examine OUStrings, you might want to use the following trick (prints 50
212unicode characters of rLibName OUString - the +10 is where the buffer starts):
213
214Wine-dbg>x /50u rLibName->pData+10
2150x0909b6c8: vnd.sun.star.expand:$LO_LIB_DIR/abplo.dll
216
Jan Holesovsky41e2ab32011-08-25 13:11:26 +0200217TODO:
218
Jan Holesovsky538b4492012-06-19 09:22:29 +0200219- make the debugging more convenient on (native) Windows
220 - check possibilities like WinGDB - http://www.wingdb.com/
221 - or find / write a MSVS / WinDBG extension that can read MinGW debugging
222 symbols natively; more info
223 http://windbg.info/forum/12-symbol-and-source-files-/21-debugging-mingwgcc-built-dll-in-visual-studio.html
224
Jan Holesovsky41e2ab32011-08-25 13:11:26 +0200225- installation
226 - so far the make_installer.pl calls makecab.exe, uuidgen.exe, and
227 others; would be best to avoid that if at all possible (using a free
228 cab implementation, part of Wine or something)
229 - MSI generation
230 - if at all possible, the make dev-install installation (with links
231 back to the build) should be done so that it would be directly
232 executable via wine after doing make dev-install :-)
233
234- runtime
235 - no idea if the entire thing works after the installation at all; I
236 suppose there will be runtime problems to look at too
237
238- cleanup
239 - enable & fix pieces that are currently disabled
240 - --without-myspell-dicts
241 - --disable-directx
242 - --disable-activex
Jan Holesovsky41e2ab32011-08-25 13:11:26 +0200243 - much of the stuff currently relies on --with-system-*, and
244 consequently on the mingw32-* openSUSE packages; might be good to be
245 able to build with as few dependencies as possible - but that is low
Tor Lillqvistc4feba92012-01-22 10:18:47 +0200246 prio
Jan Holesovsky41e2ab32011-08-25 13:11:26 +0200247
248- profiling
249 - when all the above is sorted out, we should look at the speed of
250 this vs. the speed of the MSVC version
251
Tor Lillqvistad4a4672011-05-27 18:29:43 +0300252
253iOS
Tor Lillqvist30fded62013-03-18 09:24:41 +0200254***
Tor Lillqvistad4a4672011-05-27 18:29:43 +0300255
Tor Lillqvist30fded62013-03-18 09:24:41 +0200256iOS is the operating system on Apple's mobile devices. Clearly for a
257device like the iPad it would not be acceptable to run a normal
258LibreOffice application with overlapping windows and mouse-oriented
259GUI widgets.
Tor Lillqvistad4a4672011-05-27 18:29:43 +0300260
Tor Lillqvist30fded62013-03-18 09:24:41 +0200261It makes sense to use only a part of LibreOffice's code for iOS. Lots
262of the GUI-oriented code should be left out. iOS apps that want to use
263the applicable LibreOffice code will handle all their GUI in a
264platform-dependent manner. How well it will be possible to do such a
265split remains to be seen.
Tor Lillqvistad4a4672011-05-27 18:29:43 +0300266
Tor Lillqvist30fded62013-03-18 09:24:41 +0200267Obviously we want it to be possible to eventually distribute apps
268using LibreOffice code through the App Store. Technically, one
269important special aspect of iOS is that apps in the App Store are not
Tor Lillqvistad4a4672011-05-27 18:29:43 +0300270allowed to load own dynamic libraries. (System libraries are used in
Tor Lillqvist30fded62013-03-18 09:24:41 +0200271the form of dynamic libraries, just like on Mac OS X, of which iOS is
272a variant.)
273
274Thus all the libraries in LibreOffice that normally are shared
Tor Lillqvistad4a4672011-05-27 18:29:43 +0300275libraries (DLLs on Windows, shared objects (.so) on Linux, dynamic
Tor Lillqvist30fded62013-03-18 09:24:41 +0200276libraries on Mac OS X (.dylib)) must be built as static archives
277instead. This has some interesting consequences for how UNO is
278implemented and used.
Tor Lillqvistad4a4672011-05-27 18:29:43 +0300279
Tor Lillqvist30fded62013-03-18 09:24:41 +0200280An iOS app is a "bundle" that contains a single executable, In an app
281using LibreOffice code, that eecutable then congtains the necessary
282LibreOffice libraries and UNO components statically linked.
Tor Lillqvistad4a4672011-05-27 18:29:43 +0300283
Tor Lillqvist30fded62013-03-18 09:24:41 +0200284The Apple tool-chain for iOS cross-building is available only for OS
285X. In order to be able to run and debug an app on an actual device
286(and not just the iOS Simulator) you need to be registered in the iOS
287Developer Program.
Tor Lillqvistad4a4672011-05-27 18:29:43 +0300288
Tor Lillqvist5011f4c2013-05-01 20:47:02 +0300289Here is an autogen.input for iOS (device) using Xcode 4.6, on OS X 10.8:
Tor Lillqvistbc229ca2012-05-17 22:57:46 +0300290
Tor Lillqvist5011f4c2013-05-01 20:47:02 +0300291--build=i386-apple-darwin10.7.0
292--host=arm-apple-darwin10
Tor Lillqvist30fded62013-03-18 09:24:41 +0200293--enable-dbgutil
294--enable-debug
Tor Lillqvist21aec7e2012-02-22 20:41:58 +0200295--enable-werror
Tor Lillqvist30fded62013-03-18 09:24:41 +0200296
297For the iOS Simulator:
298
Tor Lillqvist5011f4c2013-05-01 20:47:02 +0300299--build=i386-apple-darwin10.7.0
300--host=arm-apple-darwin10
301--enable-ios-simulator
Tor Lillqvist30fded62013-03-18 09:24:41 +0200302--enable-dbgutil
303--enable-debug
304--enable-werror
Tor Lillqvist21aec7e2012-02-22 20:41:58 +0200305
306Note that you will have to install autoconf and automake yourself
307before running autogen.sh. They are no longer included in Xcode 4.3
Tor Lillqvist30fded62013-03-18 09:24:41 +0200308and later (not even in the add-on "command line tools").
Tor Lillqvist21aec7e2012-02-22 20:41:58 +0200309
Tor Lillqvist30fded62013-03-18 09:24:41 +0200310The -mmacosx-version-min=10.7 is necessary when building for the iOS
Tor Lillqvistab4014e2012-06-04 11:19:36 +0300311simulator to avoid clang replacing simple calls to fprintf with calls
312to fwrite$UNIX2003 which Xcode then warns that doesn't exist on iOS.
313
Tor Lillqvist21aec7e2012-02-22 20:41:58 +0200314
Tor Lillqvistad4a4672011-05-27 18:29:43 +0300315Android
Tor Lillqvist30fded62013-03-18 09:24:41 +0200316*******
Tor Lillqvistad4a4672011-05-27 18:29:43 +0300317
Tor Lillqvist30fded62013-03-18 09:24:41 +0200318From a technical point of view the core Android OS (the kernel) is
319Linux, but everything else is different. Unlike iOS, an Android app
320can use shared objects just fine, so that aspect of UNO doesn't need
321special handling. Except that there is a silly low limit in the
322Android dynamic linker on the number of libraries you can dlopen. This
323is a limitation in user-level (but system-provided and not really
324replaceable) code, not the kernel.
Tor Lillqvistad4a4672011-05-27 18:29:43 +0300325
Tor Lillqvist30fded62013-03-18 09:24:41 +0200326Thus, just like for iOS, also for Android the LibreOffice libraries
327and UNO components are built as static archives. For Android, those
328static archives, and any app-specific native code, are linked into one
329single app-specific shared library, called liblo-native-code.so.
Tor Lillqvistad4a4672011-05-27 18:29:43 +0300330
Tor Lillqvist30fded62013-03-18 09:24:41 +0200331For the GUI, the same holds as said above for iOS. The GUI layer needs
332to be platform-specific, written in Java.
Tor Lillqvistad4a4672011-05-27 18:29:43 +0300333
Tor Lillqvist30fded62013-03-18 09:24:41 +0200334Android cross-compilation work has been done mainly on Linux (openSUSE
335in particular). Earlier also cross-compiling from OS X was tried. The
336Android cross-compilation tool-chain (the "Native Development Kit", or
337NDK) is available for Linux, OS X and Windows, but trying to
338cross-compile LibreOffice from Windows will probably drive you insane.
Tor Lillqvist0f9f8ef2012-09-10 14:28:34 +0300339
Tor Lillqvist30fded62013-03-18 09:24:41 +0200340You will also need the Android SDK as full "make" also builds a couple
341of Android apps where the upper layer is written in Java.
Tor Lillqvist199d2202012-01-03 13:01:47 +0200342
Tor Lillqvist30fded62013-03-18 09:24:41 +0200343Use the "android" tool from the SDK to install the SDK Tools, SDK
344Platform Tools, the API 14 SDK Platform and the Android Support
345Library. If you want to run the Android apps in the emulator, you of
346course need an appropriate system image for that.
347
Tor Lillqvist5011f4c2013-05-01 20:47:02 +0300348Here is an autogen.input for Android on ARM when cross-compiling
Tor Lillqvist30fded62013-03-18 09:24:41 +0200349from Linux:
350
351--build=x86_64-unknown-linux-gnu
352--enable-dbgutil
Tor Lillqvistab236e12012-08-09 12:59:08 +0300353--enable-debug
354--enable-werror
Tor Lillqvist30fded62013-03-18 09:24:41 +0200355--with-android-ndk=/home/tml/android-ndk-r8d
Tor Lillqvistab236e12012-08-09 12:59:08 +0300356--with-android-ndk-toolchain-version=4.6
Tor Lillqvist30fded62013-03-18 09:24:41 +0200357--with-android-sdk=/home/tml/adt-bundle-linux/sdk
Michael Meekse61e51a2012-08-03 16:39:20 +0100358--with-distro=LibreOfficeAndroid
Tor Lillqvist9a6beed2011-12-15 23:54:31 +0200359
Tor Lillqvist5011f4c2013-05-01 20:47:02 +0300360And here is an autogen.input for Android on X86:
Michael Meekse61e51a2012-08-03 16:39:20 +0100361
Michael Meekse61e51a2012-08-03 16:39:20 +0100362--with-android-ndk=/opt/libreoffice/android-ndk-r8b
363--with-android-ndk-toolchain-version=4.6
364--with-android-sdk=/opt/libreoffice/android-sdk-linux
365--build=i586-suse-linux
366--enable-ccache
Michael Meekse61e51a2012-08-03 16:39:20 +0100367--with-distro=LibreOfficeAndroidX86
368--with-num-cpus=6
369--with-max-jobs=6
Tor Lillqvistad4a4672011-05-27 18:29:43 +0300370
Tor Lillqvist886a2992012-09-10 16:21:30 +0300371There are a couple of (more or less) interactive apps that you can run
372on the emulator or on a device that use LibreOffice code. Look in
373android/experimental. DocumentLoader is just a testbench, really for
Miklos Vajnaa54e9272012-11-20 09:20:40 +0100374code to load a document (just Writer ones so far) and display one page
Tor Lillqvist886a2992012-09-10 16:21:30 +0300375at a time. LibreOffice4Android is what resulted from a Google Summer
Tor Lillqvist30fded62013-03-18 09:24:41 +0200376of Code project in 2012, a document viewer. desktop is a totally
Tor Lillqvistc43613b2013-03-18 09:50:46 +0200377different app, where the actual LibreOffice desktop GUI is present.
378Note that none of these apps in any way are claimed to be ready for
379end-users. No "beta testing" offers needed, it is painfully obvious
380what problems they have.
Tor Lillqvist3ef72932012-01-03 13:48:29 +0200381
Tor Lillqvist886a2992012-09-10 16:21:30 +0300382To run some of the apps, do "make install" followed by either "make
383run" or starting it from Android itself. You most likely want to have
384an "adb logcat" running in another window.
Tor Lillqvist199d2202012-01-03 13:01:47 +0200385
Tor Lillqvist30fded62013-03-18 09:24:41 +0200386To debug, do manually what "make run" would do and when the app has
387started, run ndk-gdb.
Tor Lillqvist7606616c2012-05-17 16:37:02 +0300388
Tor Lillqvistad4a4672011-05-27 18:29:43 +0300389
Matúš Kukan63a13212013-03-14 17:05:15 +0100390Raspbian
Tor Lillqvist30fded62013-03-18 09:24:41 +0200391********
Matúš Kukan63a13212013-03-14 17:05:15 +0100392
393It's now possible to cross-compile LibreOffice for Rapsberry Pi running Raspbian.
394You will need Raspbian's pkg-config files and system libraries to build against.
395Available at http://dev-www.libreoffice.org/src/raspbian_rootfs.tar.bz2
396$ wget http://dev-www.libreoffice.org/src/raspbian_rootfs.tar.bz2
397$ tar -axf raspbian_rootfs.tar.bz2
398
399You can build cross-compiler yourself or get the executables here:
400$ git clone git://github.com/raspberrypi/tools
401tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian is known to work.
402
403Then create pkg-config wrapper, something like:
404$ cat > pkg-config-wrapper-host << _EOF
405#!/bin/sh
406
407SYSROOT=<path-to-raspbian_rootfs>
408
409export PKG_CONFIG_DIR=
410export PKG_CONFIG_LIBDIR=\${SYSROOT}/usr/lib/pkgconfig:\${SYSROOT}/usr/lib/arm-linux-gnueabihf/pkgconfig:\${SYSROOT}/usr/share/pkgconfig
411export PKG_CONFIG_SYSROOT_DIR=\${SYSROOT}
412
413exec pkg-config "\$@"
414_EOF
415$ chmod +x pkg-config-wrapper-host
416This does not work with pkg-config 0.23. 0.26 is known to work.
417
Tor Lillqvist5011f4c2013-05-01 20:47:02 +0300418And you are ready to build with autogen.input similar to:
Matúš Kukan63a13212013-03-14 17:05:15 +0100419
420PKG_CONFIG=<path-to-pkg-config-wrapper-host>
421CC=<path-to-arm-linux-gnueabihf-gcc> --sysroot=<path-to-raspbian_rootfs>
422CXX=<path-to-arm-linux-gnueabihf-g++> --sysroot=<path-to-raspbian_rootfs>
423--build=x86_64-unknown-linux-gnu
424--host=arm-unknown-linux-gnueabihf
425--disable-linkoo
426--without-doxygen
427--disable-gnome-vfs
428--enable-python=system
429PYTHON_CFLAGS=-I<path-to-raspbian_rootfs>/usr/include/python2.7
430PYTHON_LIBS=-lpython2.7
431--with-java
432JAVAINC=-I<path-to-raspbian_rootfs>/usr/lib/jvm/java-6-openjdk-armhf/include
433JAVALIB=-L<path-to-raspbian_rootfs>/usr/lib/jvm/java-6-openjdk-armhf/jre/lib/arm
434--with-system-cairo
435--with-system-cppunit
436--with-system-icu
437--with-system-neon
438--with-system-nss
439--with-system-openldap
440--with-system-openssl
441--with-system-redland
442
443Finally, when you are ready to run the binaries in Raspbian,
444you may need to get more system libraries.
445Update your /etc/apt/sources.list as described in
446http://www.raspbian.org/RaspbianRepository and then:
447$ sudo apt-get update
448$ sudo apt-get build-dep libreoffice