Software Development Kit %PRODUCT_RELEASE%

Installation Guide

The LibreOffice %PRODUCT_RELEASE% SDK comes with a set of development tools, base libraries, header files and helper class files that can be used to develop Java/C++ components, to embed the LibreOffice %PRODUCT_RELEASE% application in your own programs, or to use the API (scripting or remote control the office). For a complete working environment, we have some additional requirements:

LibreOffice %PRODUCT_RELEASE% installation

The SDK works on top of an existing LibreOffice installation and uses the same libraries as the LibreOffice installation.

Download the SDK from the same source as your LibreOffice packages.

  • If you have installed an official The Document Foundation LibreOffice release, download and install the corresponding SDK release for your platform from https://www.libreoffice.org/download
  • If you have installed a downstream LibreOffice release via your operating system's package management tools, use the same package management tools to install the corresponding downstream SDK package(s).

Note: Do not mix and match The Document Foundation LibreOffice releases with downstream SDK packages or vice versa!

JDK (1.5 or higher)

A JDK is necessary for developing Java components or applications. An appropriate Java SDK can be found on http://java.sun.com/products.

Recommendation is to use Java 7 or later for 64bit, and Java 6 for 32bit.

Note: The Java compiler is optional!

C++ compiler A C++ compiler is necessary for developing C++ components or applications. UNO depends on a compiler dependent language binding, so that we use the appropriate compiler where a language binding exists:
Linux GNU C++ compiler, gcc version 4.1 or later
macOS Xcode
Windows Microsoft C++ Compiler, Microsoft Visual Studio 2010 or later, or the Express edition thereof

Note: The C++ compiler is optional! If you use the Express edition you have to ensure that the Microsoft Visual Studio 2008 Redistributable Package is also installed. You can download this package from Microsoft directly.

Microsoft .NET Framework SDK version 1.0 or higher The SDK is required for building CLI applications. That is, programs written in languages, such as C# or VB.NET.

Note: The .NET Framework is optional!

GNU make (3.79.1 or higher)

GNU make is used to build the examples of the SDK. GNU make is available from http://www.gnu.org. It can be ftped via ftp://ftp.gnu.org/gnu/make

Note: Windows user can find an executable of gnu make under http://www.mingw.org/wiki/Getting_Started (see the mingw32-make link under "Manual Installation"). Do not use the Cygwin make, because it does not work well. On Solaris gnu make can be found often under /usr/sfw/bin/gmake, but keep in mind that you have to use 'gmake' then. Or you can find gnu make also under http://www.sunfreeware.com/.

zip tool (2.3 or higher) The zip tool is used to create UNO packages. zip is a new requirement to make the SDK independent of a Java SDK.
If you do not have these already, you can download them from http://www.info-zip.org. Note: The cygwin zip.exe does not work for the build under the 4NT shell. You have to use the native w32 version.
cat and sed tools The cat and set tools are used to create some extensions.

Note for Windows users: If you do not have these already, you can download them from http://sourceforge.net/projects/unxutils/files/latest/download.

The SDK provides a mechanism which configures the SDK build environment to your personal needs the first time you use the SDK environment. This configuration step creates a new setsdkenv_XXX script in the user's home directory:

  • $HOME/$OO_SDK_NAME/setsdkenv_unix.sh  -> for Unix-like systems
  • C:\Documents and Settings\<username>\Application Data\%OO_SDK_NAME%\setsdkenv_windows.bat  -> for Windows

To start the configure script, change into the SDK root directory and run:

  • ./setsdkenv_unix  -> for Unix-like systems
  • setsdkenv_windows.bat  -> for Windows

The configure script requests relevant information and directories (SDK, LibreOffice, GNU make, Java, C++), in order to prepare a working SDK environment. (On Unix-like systems, the configure script recursively starts a new interactive shell with the relevant environment variables set; this is not needed on Windows.) After completing the configure script once, the newly created script is always used to set the necessary environment variables for using the SDK and the required tools.

On Unix-like systems, the configure script uses Perl. Linux systems should have installed a working Perl version, and on Solaris you can find a working Perl version under http://www.sunfreeware.com/ if necessary. On Windows, the configure script uses Windows Script and a JScript. If you have problems with Windows Script, you can download a newer version of Windows Script.

If you use the template batch file, edit and set the following variables:

OFFICE_HOME Path to an existing LibreOffice installation, e.g. "/opt/libreoffice8".
OO_SDK_NAME The configuration uses the directory name of the SDK, but you can use another name as well. It is important that the name does not contain spaces, because of a limitation of gnu make which cannot handle spaces correctly. This name is, for example, used to create an output directory in the users home directory for any generated output when you use the SDK build environment.
OO_SDK_HOME Path to the SDK root directory, e.g. "/opt/libreoffice/sdk"
OO_SDK_JAVA_HOME Path to a JDK root directory. The JDK is optional and only necessary if you like to run the Java examples or if you like to use the SDK environment to develop your own Java solution.
OO_SDK_CPP_HOME Path to the C++ compiler (on Windows, the directory where the "vcvar32.bat" file can be found). The C++ compiler is optional and only necessary for building the C++ examples.
OO_SDK_CLI_HOME Path to the C# compiler and VB.NET compiler (on Windows, this directory can be found under the system directory (e.g. c:\WINXP\Microsoft.NET\Framework\v1.0.3705). The compilers are optional and only necessary for building the CLI examples.
Note: Windows only!
OO_SDK_MAKE_HOME Path to GNU make.
OO_SDK_ZIP_HOME Path to the 'zip' tool.
OO_SDK_CAT_HOME Path to the 'cat' tool.
OO_SDK_SED_HOME Path to the 'sed' tool.
OO_SDK_OUTPUT_DIR Path to an existing directory where the example output is generated. The output directory is optional, by default the output is generated in the SDK directory itself. If an output directory is specified, the output is generated in an SDK dependent subdirectory in this directory (e.g. <OO_SDK_OUTPUT_DIR> /LibreOffice %PRODUCT_RELEASE%/LINUXExample.out)
SDK_AUTO_DEPLOYMENT If this variable is set, the component examples are automatically deployed into the LibreOffice installation referenced by OFFICE_HOME. See also section "Extension Manager - unopkg" from the Developer's Guide.

You must run the setsdkenv_XXX script every time you want to use the configured SDK environment. The settings are local for the current shell on Windows or the new started shell on Unix-like systems. On Unix-like systems you can now source the prepared environment script file ("setsdkenv_unix.sh") to prepare your current shell instead of starting a new shell.

Manual Setting

If you do not want to use the script to set your working environment, you must set the appropriate environment variables yourself. The script sets the following environment variables:

Common Environment Variables

OO_SDK_NAME See description above.
OO_SDK_URE_BIN_DIR The path within the chosen LibreOffice URE installation where binary executables are located.
OO_SDK_URE_LIB_DIR The path within the chosen LibreOffice URE installation where dynamic libraries are located.
OO_SDK_URE_JAVA_DIR The path within the chosen LibreOffice URE installation where Java JARs are located.
CLASSPATH =$OO_SDK_URE_JAVA_DIR/libreoffice.jar; $OO_SDK_URE_JAVA_DIR/unoloader.jar; $CLASSPATH

The classpath will be set or extended to the necessary jar files of the specified LibreOffice installation.

OFFICE_PROGRAM_PATH =$OFFICE_HOME/program

This variable is used to find, for example, the office type library and the UNO package deployment tool.

UNO_PATH =$OFFICE_PROGRAM_PATH

This variable is used to ensure that the new C++ UNO bootstrap mechanism uses the configured LibreOffice installation of the SDK. Normally the bootstrap mechanism finds the default office installation for the user on the system. This variable is optional but is set from the scripts to ensure a homogeneous environment. Especially useful during development where you might have more than one office installation installed.

Environment Variables for Unix-like systems

Solaris

LD_LIBRARY_PATH =$OO_SDK_URE_LIB_DIR: $OO_SDK_HOME/(solsparc|solintel)/lib: $LD_LIBRARY_PATH

The LD_LIBRARY_PATH will be set or will be extended by the office/URE library path, the platform dependent lib directory for several additional libraries.

PATH =$OO_SDK_HOME/(solsparc|solintel)/bin:$OO_SDK_MAKE_HOME: $OO_SDK_ZIP_HOME: [$OO_SDK_CPP_HOME:] [$OO_SDK_JAVA_HOME/bin:] $OO_SDK_URE_BIN_DIR: $PATH

The PATH variable will be extended by the paths for the SDK development tools, the compiler, the JDK, GNU make, the zip tool and the OO_SDK_URE_BIN_DIR, where the compiler or the JDK are optional.

The script additionally creates symbolic links to the public dynamic libraries of the URE in $OO_SDK_HOME/(solsparc|solintel)/lib, which are needed for linking.

Linux

LD_LIBRARY_PATH =$OO_SDK_URE_LIB_DIR: $SDK_HOME/linux/lib: $LD_LIBRARY_PATH

The LD_LIBRARY_PATH will be set or will be extended by the office/URE library path, the platform dependent lib directory for some additional libraries.

PATH =$OO_SDK_HOME/linux/bin:$OO_SDK_MAKE_HOME: $OO_SDK_ZIP_HOME: [$OO_SDK_CPP_HOME:] [$OO_SDK_JAVA_HOME/bin:] $OO_SDK_URE_BIN_DIR: $PATH

The PATH variable will be extended by the paths for the SDK development tools, the compiler, the JDK, GNU make, the zip tool and the OO_SDK_URE_BIN_DIR, where the compiler and the JDK are optional.

The script additionally creates symbolic links to the public dynamic libraries of the URE in $OO_SDK_HOME/linux/lib, which are needed for linking.

Environment Variables for Windows

PATH =%OO_SDK_HOME%\windows\bin; %OO_SDK_MAKE_HOME%; %OO_SDK_ZIP_HOME%; [%OO_SDK_CLI_HOME%;] [%OO_SDK_CPP_HOME%;] [%OO_SDK_JAVA_HOME%\bin;] %OO_SDK_URE_BIN_DIR%; %PATH%

The PATH variable will be extended by the paths for the SDK development tools, the compiler, the JDK, GNU make, the zip tool and the OO_SDK_URE_BIN_DIR.

LIB =%OO_SDK_HOME%\windows\lib; %LIB%

The LIB variable will be extended by the path to the import libraries that are necessary for Windows.

In addition to setting these environment variables, the script calls the "vcvar32.bat" batch file which is provided by the Microsoft Developer Studio to set the necessary environment variables for the compiler.