Kaydet (Commit) 2130deb2 authored tarafından Riccardo Magliocchetti's avatar Riccardo Magliocchetti Kaydeden (comit) Michael Meeks

Introduce headless switch for X / cairo / toolkit less build

The plan is to reduce dependencies to be easier to deploy
libreoffice server side in headless mode.
üst a818fa05
......@@ -733,6 +733,11 @@ AC_ARG_ENABLE(kde4,
both KDE3 and KDE4.]),
,)
AC_ARG_ENABLE(headless,
AS_HELP_STRING([--enable-headless],
[Disable building of GUIs to reduce dependencies. Useful for server usage.]),
,)
AC_ARG_ENABLE(unix-qstart-libpng,
AS_HELP_STRING([--disable-unix-qstart-libpng],
[On UNIX systems, we have a faster splash app, that can use libpng to
......@@ -3131,6 +3136,10 @@ solaris*)
;;
esac
if test "$enable_headless" = "yes"; then
GUIBASE=headless
fi
INPATH="${OUTPATH}${PROEXT}"
OUTDIR="$SRC_ROOT/solver/$INPATH"
SOLARINC="-I. -I$SRC_ROOT/solver/$INPATH/inc/external -I$SRC_ROOT/solver/$INPATH/inc -I$SRC_ROOT/solenv/inc $SOLARINC"
......@@ -3369,6 +3378,19 @@ else
fi
AC_SUBST(DISABLE_STRIP)
if test "$enable_headless" = "yes"; then
# be sure to do not mess with uneeded stuff
test_randr=no
test_xrender=no
test_cups=no
test_fontconfig=yes
test_gtk=no
build_gstreamer=no
test_kde=no
test_kde4=no
test_unix_quickstarter=no
fi
dnl check for cups support
dnl ===================================================================
if test "$test_cups" = "yes"; then
......@@ -7351,7 +7373,12 @@ AC_SUBST(ENABLE_NSPLUGIN)
dnl ***************************************
dnl testing for X libraries and includes...
dnl ***************************************
if test $_os != Darwin -a $_os != WINNT -a $_os != Android -a $_os != iOS; then
WANT_X11="no"
if test $_os != Darwin -a $_os != WINNT -a $_os != Android -a $_os != iOS -a "$enable_headless" != "yes"; then
WANT_X11="yes"
fi
if test WANT_X11 = "yes"; then
AC_PATH_X
AC_PATH_XTRA
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
......@@ -7404,7 +7431,7 @@ if test "$XINC" != "no_x_includes" -a "$XINC" != "/usr/include" ; then
fi
AC_SUBST(XLIB)
if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$_os" != "Android" -a "$_os" != "iOS"; then
if test WANT_X11 = "yes"; then
dnl ===================================================================
dnl Check for Composite.h for Mozilla plugin
dnl ===================================================================
......@@ -7424,7 +7451,7 @@ dnl ===================================================================
dnl Check for system Xrender
dnl ===================================================================
AC_MSG_CHECKING([whether to use Xrender])
if test "$test_xrender" = "yes"; then
if test WANT_X11 = "yes" -a "$test_xrender" = "yes"; then
AC_MSG_RESULT([yes])
AC_CHECK_LIB([Xrender], [XRenderQueryVersion], [:],
[AC_MSG_ERROR(libXrender not found or functional)], [])
......@@ -7442,7 +7469,7 @@ dnl ===================================================================
dnl Check for XRandr
dnl ===================================================================
AC_MSG_CHECKING([whether to enable RandR support])
if test "$test_randr" = "yes" -a \( "$enable_randr" = "yes" -o "$enable_randr" = "TRUE" \) ; then
if test WANT_X11 = "yes" -a "$test_randr" = "yes" -a \( "$enable_randr" = "yes" -o "$enable_randr" = "TRUE" \) ; then
if test -z "$enable_randr_link" -o "$enable_randr_link" = "no"; then
XRANDR_DLOPEN="TRUE"
AC_MSG_RESULT([configured to dlopen libXrandr at runtime])
......@@ -8080,6 +8107,16 @@ if test "x$enable_kde4" = "xyes"; then
fi
AC_SUBST(ENABLE_KDE4)
ENABLE_HEADLESS=""
if test "x$enable_headless" = "xyes"; then
ENABLE_HEADLESS="TRUE"
SCPDEFS="$SCPDEFS -DHEADLESS"
R="headless"
# this does not work see hack in Library_vcl.mk
AC_DEFINE(HEADLESS)
fi
AC_SUBST(ENABLE_HEADLESS)
if test -z "$R"; then
AC_MSG_RESULT([none])
else
......@@ -9739,7 +9776,7 @@ SYSTEM_CAIRO=""
AC_MSG_CHECKING([whether to use the system cairo])
if test "$with_system_cairo" = "yes"; then
if test "$enable_cairo_canvas" = "yes" -a "$with_system_cairo" = "yes"; then
SYSTEM_CAIRO=YES
AC_MSG_RESULT([yes])
......@@ -9770,8 +9807,10 @@ else
BUILD_TYPE="$BUILD_TYPE CAIRO"
fi
else
if test "$enable_cairo_canvas" = "yes"; then
BUILD_TYPE="$BUILD_TYPE CAIRO"
fi
fi
fi
AC_SUBST(SYSTEM_CAIRO)
......
......@@ -58,11 +58,13 @@ $(eval $(call gb_Executable_add_libs,oosplash,\
endif
ifneq ($(GUIBASE),headless)
ifeq ($(GUI),UNX)
$(eval $(call gb_Executable_add_libs,oosplash,\
-lX11 \
))
endif
endif
ifeq ($(ENABLE_QUICKSTART_LIBPNG),TRUE)
......
......@@ -114,6 +114,13 @@ else ifeq ($(OS),ANDROID)
else ifeq ($(OS),IOS)
else ifeq ($(GUIBASE),headless)
$(eval $(call gb_Module_add_targets,desktop,\
Executable_oosplash \
Library_spl_unx \
))
else
$(eval $(call gb_Module_add_targets,desktop,\
......
......@@ -199,7 +199,7 @@ my_components += \
my_components += pythonloader
.ENDIF
.IF "$(OS)" != "WNT" && "$(OS)" != "MACOSX" && "$(OS)" != "IOS" && "$(OS)" != "ANDROID"
.IF "$(OS)" != "WNT" && "$(OS)" != "MACOSX" && "$(OS)" != "IOS" && "$(OS)" != "ANDROID" && "$(GUIBASE)" != "headless"
my_components += component/desktop/unx/splash/splash
.ENDIF
......@@ -324,7 +324,12 @@ my_components += \
.END
.END
.IF "$(OS)" != "MACOSX" && "$(OS)" != "WNT" && "$(OS)" != "IOS" && "$(OS)" != "ANDROID"
.IF "$(GUIBASE)" == "headless"
my_components += \
component/vcl/vcl.headless
.END
.IF "$(OS)" != "MACOSX" && "$(OS)" != "WNT" && "$(OS)" != "IOS" && "$(OS)" != "ANDROID" && "$(GUIBASE)" != "headless"
my_components += \
desktopbe1 \
component/vcl/vcl.unx
......@@ -354,7 +359,7 @@ my_components += mozbootstrap
my_components += component/fpicker/source/unx/kde4/fps_kde4
.END
.IF "$(OS)" != "WNT" && "$(OS)" != "ANDROID" && "$(OS)" != "IOS"
.IF "$(OS)" != "WNT" && "$(OS)" != "ANDROID" && "$(OS)" != "IOS" && "$(OS)" != "headless"
my_components += cmdmail
.END
......
......@@ -312,6 +312,8 @@ MY_FILES_main += \
# ?
.ELIF "$(GUIBASE)" == "android"
# ?
.ELIF "$(GUIBASE)" == "headless"
# ?
.ELSE
ERROR : unknown-GUIBASE
.END
......
......@@ -522,7 +522,7 @@ File gid_Brand_File_Bin_Soffice
#endif
End
#if defined(UNX) && !defined(QUARTZ)
#if defined(UNX) && !defined(QUARTZ) && !defined(HEADLESS)
File gid_Brand_File_Bin_Spadmin
BIN_FILE_BODY;
Dir = gid_Brand_Dir_Program;
......
......@@ -548,6 +548,8 @@ SPECIAL_COMPONENT_LIB_FILE( gid_File_Lib_Fps_Office, fps_office.uno )
SPECIAL_COMPONENT_LIB_FILE( gid_File_Lib_Fpicker, fpicker.uno )
#ifndef HEADLESS
#ifndef SYSTEM_CAIRO
File gid_File_Lib_Cairo
......@@ -588,6 +590,8 @@ End
#endif
#endif
STD_LIB_FILE( gid_File_Lib_Frm , frm)
SPECIAL_COMPONENT_LIB_FILE( gid_File_Lib_Fsstorage, fsstorage.uno )
......@@ -930,7 +934,7 @@ STD_LIB_FILE(gid_File_Lib_DeploymentMisc, deploymentmisc)
STD_LIB_FILE( gid_File_Lib_Pl , pl)
#endif
#if defined(UNX) && ! defined(QUARTZ)
#if defined(UNX) && ! defined(QUARTZ) && ! defined(HEADLESS)
File gid_File_Lib_Desktop_Detector
Name = LIBNAME(desktop_detector);
LIB_FILE_BODY;
......@@ -1156,7 +1160,7 @@ End
STD_LIB_FILE( gid_File_Lib_Sot, sot )
#if defined(UNX) && !defined(QUARTZ)
#if defined(UNX) && !defined(QUARTZ) && !defined(HEADLESS)
File gid_File_Lib_Spa
Name = LIBNAME(spa);
......@@ -1174,9 +1178,11 @@ File gid_File_Lib_Spell
Dir = SCP2_OOO_BIN_DIR;
End
#if !defined HEADLESS
STD_LIB_FILE( gid_File_Lib_Spl, spl)
#endif
#if defined UNX && !defined MACOSX
#if defined UNX && !defined MACOSX && !defined HEADLESS
STD_LIB_FILE( gid_File_Lib_Spl_Unx, spl_unx)
#endif
......@@ -1697,6 +1703,7 @@ File gid_File_Lib_Libcroco
End
#endif
#if ! defined HEADLESS
#if ! defined SYSTEM_PANGO
File gid_File_Lib_Libpango
LIB_FILE_BODY;
......@@ -1727,6 +1734,7 @@ File gid_File_Lib_Libpangowin32
End
#endif
#endif
#endif
#if ! defined SYSTEM_LIBGSF
File gid_File_Lib_Libgsf
......
......@@ -223,7 +223,7 @@ File gid_File_Bin_Senddoc
#endif
End
#if defined(UNX) && !defined(QUARTZ)
#if defined(UNX) && !defined(QUARTZ) && !defined(HEADLESS)
File gid_File_Bin_Spadmin_Bin
BIN_FILE_BODY;
......
......@@ -76,7 +76,7 @@ STD_RES_FILE( gid_File_Res_Sd, sd )
STD_RES_FILE( gid_File_Res_Sfx, sfx )
#if defined(UNX) && !defined(QUARTZ)
#if defined(UNX) && !defined(QUARTZ) && !defined(HEADLESS)
STD_RES_FILE( gid_File_Res_Spa, spa )
......
......@@ -689,6 +689,7 @@ Module gid_Module_Root_Files_7
gid_File_Mozilla_Runtime);
End
#ifndef HEADLESS
Module gid_Module_Root_Files_Images
PackageInfo = "packinfo_office.txt";
ParentID = gid_Module_Root;
......@@ -719,6 +720,7 @@ Module gid_Module_Root_Files_Images
#endif
);
End
#endif
#ifndef WITHOUT_FONTS
Module gid_Module_Root_Fonts_OOo_Hidden
......
......@@ -141,10 +141,12 @@ $(eval $(call gb_Library_add_cxxflags,tk,\
$(gb_OBJCXXFLAGS)))
endif
ifneq ($(GUIBASE),headless)
ifneq (,$(filter LINUX DRAGONFLY OPENBSD FREEBSD NETBSD, $(OS)))
$(eval $(call gb_Library_add_linked_libs,tk,\
X11 \
))
endif
endif
# vim: set noet sw=4 ts=4:
......@@ -36,6 +36,8 @@ else ifeq ($(GUIBASE),android)
$(eval $(call gb_Library_set_componentfile,vcl,vcl/vcl.android))
else ifeq ($(OS),IOS)
$(eval $(call gb_Library_set_componentfile,vcl,vcl/vcl.ios))
else ifeq ($(GUIBASE),headless)
$(eval $(call gb_Library_set_componentfile,vcl,vcl/vcl.headless))
else
$(eval $(call gb_Library_set_componentfile,vcl,vcl/vcl.unx))
endif
......@@ -434,6 +436,64 @@ $(eval $(call gb_Library_use_externals,vcl,\
))
endif
ifeq ($(GUIBASE),headless)
$(eval $(call gb_Library_add_cxxflags,vcl,\
$$(FREETYPE_CFLAGS) \
))
$(eval $(call gb_Library_add_defs,vcl,\
-DHEADLESS \
-DSAL_DLLPREFIX=\"$(gb_Library_SYSPRE)\" \
-DSAL_DLLPOSTFIX=\"$(gb_Library_OOOEXT)\" \
-D_XSALSET_LIBNAME=\"$(call gb_Library_get_runtime_filename,spa)\" \
))
$(eval $(call gb_Library_add_exception_objects,vcl,\
vcl/generic/app/gensys \
vcl/generic/app/geninst \
vcl/generic/app/gendisp \
vcl/generic/print/bitmap_gfx \
vcl/generic/print/common_gfx \
vcl/generic/print/glyphset \
vcl/generic/print/printerjob \
vcl/generic/print/psputil \
vcl/generic/print/genpspgraphics \
vcl/generic/print/genprnpsp \
vcl/generic/print/text_gfx \
vcl/generic/fontmanager/fontsubst \
vcl/generic/glyphs/gcach_ftyp \
vcl/generic/glyphs/gcach_layout \
vcl/generic/glyphs/gcach_rbmp \
vcl/generic/glyphs/glyphcache \
vcl/generic/fontmanager/fontcache \
vcl/generic/fontmanager/fontconfig \
vcl/generic/fontmanager/fontmanager \
vcl/generic/fontmanager/helper \
vcl/generic/fontmanager/parseAFM \
vcl/unx/generic/printer/jobdata \
vcl/unx/generic/printer/ppdparser \
vcl/null/printerinfomanager \
vcl/headless/headlessinst \
vcl/headless/svpbmp \
vcl/headless/svpdummies \
vcl/headless/svpelement \
vcl/headless/svpframe \
vcl/headless/svpgdi \
vcl/headless/svpinst \
vcl/headless/svpdata \
vcl/headless/svpprn \
vcl/headless/svptext \
vcl/headless/svpvd \
))
$(eval $(call gb_Library_add_linked_libs,vcl,\
basebmp \
))
$(eval $(call gb_Library_use_externals,vcl,\
fontconfig \
freetype \
))
endif
ifeq ($(GUIBASE),android)
$(eval $(call gb_Library_add_libs,vcl,\
-llog \
......
......@@ -67,6 +67,12 @@ $(eval $(call gb_Module_add_targets,vcl,\
endif
endif
ifeq ($(GUIBASE),headless)
$(eval $(call gb_Module_add_targets,vcl,\
Library_vclplug_svp \
))
endif
ifeq ($(GUIBASE),aqua)
$(eval $(call gb_Module_add_targets,vcl,\
Package_osx \
......
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* Version: MPL 1.1 / GPLv3+ / LGPLv3+
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License or as specified alternatively below. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* Major Contributor(s):
* Copyright (C) 2012 Novell, Inc.
* Michael Meeks <michael.meeks@suse.com> (initial developer)
*
* All Rights Reserved.
*
* For minor contributions see the git repository.
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 3 or later (the "GPLv3+"), or
* the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
* in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
* instead of those above.
*/
#include <headless/svpinst.hxx>
#include <headless/svpdummies.hxx>
#include <generic/gendata.hxx>
class HeadlessSalInstance : public SvpSalInstance
{
public:
HeadlessSalInstance( SalYieldMutex *pMutex );
virtual ~HeadlessSalInstance();
virtual SalSystem* CreateSalSystem();
};
HeadlessSalInstance::HeadlessSalInstance( SalYieldMutex *pMutex ) :
SvpSalInstance( pMutex)
{
}
HeadlessSalInstance::~HeadlessSalInstance()
{
}
class HeadlessSalSystem : public SvpSalSystem {
#if 0
public:
AndroidSalSystem() : SvpSalSystem() {}
virtual ~AndroidSalSystem() {}
virtual int ShowNativeDialog( const rtl::OUString& rTitle,
const rtl::OUString& rMessage,
const std::list< rtl::OUString >& rButtons,
int nDefButton )
{
(void)rButtons; (void)nDefButton;
__android_log_print(ANDROID_LOG_INFO, "LibreOffice - dialog '%s': '%s'",
rtl::OUStringToOString(rTitle, RTL_TEXTENCODING_ASCII_US).getStr(),
rtl::OUStringToOString(rMessage, RTL_TEXTENCODING_ASCII_US).getStr());
return 0;
}
#endif
};
SalSystem *HeadlessSalInstance::CreateSalSystem()
{
return new HeadlessSalSystem();
}
class HeadlessSalData : public SalGenericData
{
public:
HeadlessSalData( SalInstance *pInstance ) : SalGenericData( SAL_DATA_HEADLESS, pInstance ) {}
virtual void ErrorTrapPush() {}
virtual bool ErrorTrapPop( bool ) { return false; }
};
// All the interesting stuff is slaved from the AndroidSalInstance
void InitSalData() {}
void DeInitSalData() {}
void InitSalMain() {}
void DeInitSalMain() {}
void SalAbort( const rtl::OUString& rErrorText, bool bDumpCore )
{
rtl::OUString aError( rErrorText );
if( aError.isEmpty() )
aError = rtl::OUString::createFromAscii("Unknown application error");
::fprintf( stderr, "%s\n", rtl::OUStringToOString(rErrorText, osl_getThreadTextEncoding()).getStr() );
::fprintf( stderr, "SalAbort: '%s'",
rtl::OUStringToOString(aError, RTL_TEXTENCODING_ASCII_US).getStr());
if( bDumpCore )
abort();
else
_exit(1);
}
const OUString& SalGetDesktopEnvironment()
{
static rtl::OUString aEnv( RTL_CONSTASCII_USTRINGPARAM( "headless" ) );
return aEnv;
}
SalData::SalData() :
m_pInstance( 0 ),
m_pPlugin( 0 ),
m_pPIManager(0 )
{
}
SalData::~SalData()
{
}
// This is our main entry point:
SalInstance *CreateSalInstance()
{
HeadlessSalInstance* pInstance = new HeadlessSalInstance( new SalYieldMutex() );
new HeadlessSalData( pInstance );
return pInstance;
}
void DestroySalInstance( SalInstance *pInst )
{
pInst->ReleaseYieldMutex();
delete pInst;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -40,7 +40,8 @@ class GtkSalDisplay;
enum SalGenericDataType { SAL_DATA_GTK, SAL_DATA_GTK3,
SAL_DATA_KDE3, SAL_DATA_KDE4,
SAL_DATA_UNX, SAL_DATA_SVP,
SAL_DATA_ANDROID, SAL_DATA_IOS };
SAL_DATA_ANDROID, SAL_DATA_IOS,
SAL_DATA_HEADLESS };
class VCL_DLLPUBLIC SalGenericData : public SalData
{
......
......@@ -39,6 +39,7 @@
#include "ios/svsys.h"
#elif defined ANDROID
#include "android/svsys.h"
#elif defined HEADLESS
#else
#include "unx/svsys.h"
#endif
......
......@@ -60,7 +60,11 @@ PrinterInfoManager::PrinterInfoManager( Type eType ) :
m_bUseIncludeFeature( false ),
m_bUseJobPatch( true ),
m_aSystemDefaultPaper( RTL_CONSTASCII_USTRINGPARAM( "A4" ) ),
#ifdef HEADLESS
m_bDisableCUPS( true )
#else
m_bDisableCUPS( false )
#endif
{
// initSystemDefaultPaper();
}
......
......@@ -53,7 +53,7 @@ static oslModule pCloseModule = NULL;
static SalInstance* tryInstance( const OUString& rModuleBase, bool bForce = false )
{
SalInstance* pInst = NULL;
#ifndef ANDROID
#if !defined(ANDROID) || !defined(HEADLESS)
// Disable gtk3 plugin load except in experimental mode for now.
if( !bForce &&
rModuleBase.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "gtk3" ) ) &&
......@@ -129,7 +129,7 @@ static SalInstance* tryInstance( const OUString& rModuleBase, bool bForce = fals
return pInst;
}
#ifndef ANDROID
#if !defined(ANDROID) || !defined(HEADLESS)
static DesktopType get_desktop_environment()
{
......
......@@ -655,7 +655,7 @@ const PPDParser* PPDParser::getParser( const String& rFile )
PrinterInfoManager& rMgr = PrinterInfoManager::get();
if( rMgr.getType() == PrinterInfoManager::CUPS )
{
#ifndef ANDROID
#if !defined(ANDROID) && !defined(HEADLESS)
pNewParser = const_cast<PPDParser*>(static_cast<CUPSManager&>(rMgr).createCUPSParser( aFile ));
#endif
}
......
<?xml version="1.0" encoding="UTF-8"?>
<!--**********************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
**********************************************************************-->
<component loader="com.sun.star.loader.SharedLibrary" prefix="vcl"
xmlns="http://openoffice.org/2010/uno-components">
<implementation name="com.sun.star.frame.VCLSessionManagerClient">
<service name="com.sun.star.frame.SessionManagerClient"/>
</implementation>
<implementation name="vcl::DisplayAccess">
<service name="com.sun.star.awt.DisplayAccess"/>
</implementation>
<implementation name="vcl::FontIdentificator">
<service name="com.sun.star.awt.FontIdentificator"/>
</implementation>
</component>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment