Fixup --without-x build

Accept gl linkage in hope of future offscreen mesa support.
Avoid linking with GLX though.

Change-Id: I4e666f60e74fe34075a8da9eeba95807cf8fe38c
Signed-off-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/13452
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>
This commit is contained in:
Riccardo Magliocchetti
2014-12-22 19:10:59 +01:00
committed by Michael Stahl
parent 7ce1e0e1ec
commit b9a847b78c
14 changed files with 63 additions and 32 deletions

View File

@@ -10210,6 +10210,7 @@ else
fi
AC_SUBST(ENABLE_VLC)
# this is for opengl transitions in impress slideshow
ENABLE_OPENGL=
if test $_os = iOS -o $_os = Android; then
: # disable
@@ -10226,7 +10227,9 @@ elif test $_os = WINNT; then
SYSTEM_MESA_HEADERS=
BUILD_TYPE="$BUILD_TYPE MESA"
else
ENABLE_OPENGL=TRUE
if test "$with_x" != "no"; then
ENABLE_OPENGL=TRUE
fi
ENABLE_OPENGL_CANVAS=TRUE
dnl ===================================================================

View File

@@ -91,6 +91,13 @@ $(eval $(call gb_Library_add_exception_objects,sofficeapp,\
desktop/source/migration/migration \
))
ifeq ($(ENABLE_HEADLESS),TRUE)
$(eval $(call gb_Library_add_libs,sofficeapp,\
-lm \
-ldl \
-lpthread \
))
else
ifeq ($(OS),LINUX)
$(eval $(call gb_Library_use_static_libraries,sofficeapp,\
glxtest \
@@ -105,6 +112,7 @@ $(eval $(call gb_Library_add_libs,sofficeapp,\
-lX11 \
))
endif
endif
# LibreOfficeKit bits
ifneq ($(filter $(OS),ANDROID IOS),)

View File

@@ -193,7 +193,7 @@ OUString ReplaceStringHookProc(const OUString& rStr);
}
#if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID
#if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID && !defined LIBO_HEADLESS
bool fire_glxtest_process();
#endif

View File

@@ -51,7 +51,7 @@
extern "C" int DESKTOP_DLLPUBLIC soffice_main()
{
#if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID
#if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID && !defined(LIBO_HEADLESS)
/* Run test for OpenGL support in own process to avoid crash with broken
* OpenGL drivers. Start process as early as possible.
*/

View File

@@ -17,6 +17,7 @@
#if defined( MACOSX )
#elif defined( IOS )
#elif defined( ANDROID )
#elif defined( LIBO_HEADLESS )
#elif defined( UNX )
# include <prex.h>
# include "GL/glxew.h"
@@ -42,6 +43,7 @@ class NSOpenGLView;
#endif
#elif defined( IOS )
#elif defined( ANDROID )
#elif defined( LIBO_HEADLESS )
#elif defined( UNX )
#include <GL/glext.h>
#define GLX_GLXEXT_PROTOTYPES 1
@@ -110,6 +112,7 @@ struct GLWindow
#elif defined( MACOSX )
#elif defined( IOS )
#elif defined( ANDROID )
#elif defined( LIBO_HEADLESS )
#elif defined( UNX )
Display* dpy;
int screen;
@@ -137,6 +140,7 @@ struct GLWindow
#elif defined( MACOSX )
#elif defined( IOS )
#elif defined( ANDROID )
#elif defined( LIBO_HEADLESS )
#elif defined( UNX )
dpy(NULL),
screen(0),
@@ -176,7 +180,7 @@ public:
// these methods are for the deep platform layer, don't use them in normal code
// only in vcl's platform code
#if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID
#if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID && !defined(LIBO_HEADLESS)
bool init(Display* dpy, Window win, int screen);
bool init(Display* dpy, Pixmap pix, unsigned int width, unsigned int height, int nScreen);
#elif defined( _WIN32 )
@@ -237,7 +241,7 @@ private:
SAL_DLLPRIVATE bool InitGLEW();
SAL_DLLPRIVATE bool initWindow();
SAL_DLLPRIVATE bool ImplInit();
#if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID
#if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID && !defined(LIBO_HEADLESS)
SAL_DLLPRIVATE void initGLWindow(Visual* pVisual);
#endif
@@ -255,7 +259,7 @@ private:
bool mbRequestLegacyContext;
bool mbUseDoubleBufferedRendering;
bool mbRequestVirtualDevice;
#if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID
#if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID && !defined(LIBO_HEADLESS)
bool mbPixmap; // is a pixmap instead of a window
#endif

View File

@@ -16,7 +16,7 @@
#include <rtl/ustring.hxx>
#if defined UNX && !defined MACOSX && !defined IOS && !defined ANDROID
#if defined UNX && !defined MACOSX && !defined IOS && !defined ANDROID && !defined(LIBO_HEADLESS)
# include <prex.h>
# include "GL/glxew.h"
# include <postx.h>
@@ -67,7 +67,7 @@ public:
*/
static bool isVCLOpenGLEnabled();
#if defined UNX && !defined MACOSX && !defined IOS && !defined ANDROID
#if defined UNX && !defined MACOSX && !defined IOS && !defined ANDROID && !defined(LIBO_HEADLESS)
static bool GetVisualInfo(Display* pDisplay, int nScreen, XVisualInfo& rVI);
static GLXFBConfig GetPixmapFBConfig( Display* pDisplay, bool& bInverted );
#endif

View File

@@ -61,6 +61,12 @@ $(eval $(call gb_Executable_use_system_win32_libs,gengal,\
))
endif
ifeq ($(ENABLE_HEADLESS),TRUE)
$(eval $(call gb_Executable_add_libs,gengal,\
-ldl \
-lpthread \
))
else
ifeq ($(OS),LINUX)
$(eval $(call gb_Executable_add_libs,gengal,\
-ldl \
@@ -74,5 +80,6 @@ $(eval $(call gb_Executable_use_static_libraries,gengal,\
glxtest \
))
endif
endif
# vim: set noet sw=4 ts=4:

View File

@@ -20,7 +20,8 @@
$(eval $(call gb_Module_Module,sw))
$(eval $(call gb_Module_add_targets,sw,\
$(call gb_Helper_optional,DESKTOP,Executable_tiledrendering) \
$(if $(ENABLE_HEADLESS),, \
$(call gb_Helper_optional,DESKTOP,Executable_tiledrendering)) \
CustomTarget_generated \
Library_msword \
Library_sw \

View File

@@ -459,7 +459,7 @@ DECLARE_ODFIMPORT_TEST(testFdo37606Copy, "fdo37606.odt")
// Previously copy&paste failed to copy the table in case it was the document-starting one.
uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY);
uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY);
#if !defined(MACOSX) && !defined(ENABLE_HEADLESS) // FIXME
#if !defined(MACOSX) && !defined(LIBO_HEADLESS) // FIXME
CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xTables->getCount());
#endif
}

View File

@@ -26,7 +26,6 @@ $(eval $(call gb_Executable_use_static_libraries,icontest,\
))
ifeq ($(OS),LINUX)
$(eval $(call gb_Executable_add_libs,icontest,\
-lm \
-ldl \
@@ -39,7 +38,6 @@ $(eval $(call gb_Executable_add_libs,icontest,\
$(eval $(call gb_Executable_use_static_libraries,icontest,\
glxtest \
))
else ifeq ($(OS),WNT)
$(eval $(call gb_Executable_use_system_win32_libs,icontest,\

View File

@@ -25,12 +25,14 @@ $(eval $(call gb_Module_add_targets,vcl,\
Package_opengl \
$(if $(filter DESKTOP,$(BUILD_TYPE)), \
StaticLibrary_vclmain \
Executable_ui-previewer \
$(if $(ENABLE_HEADLESS),, \
Executable_ui-previewer) \
$(if $(filter LINUX MACOSX WNT,$(OS)), \
Executable_icontest \
Executable_outdevgrind \
Executable_vcldemo \
Executable_mtfdemo )) \
$(if $(ENABLE_HEADLESS),, \
Executable_vcldemo \
Executable_icontest \
Executable_mtfdemo ))) \
$(if $(filter-out ANDROID IOS WNT,$(OS)), \
Executable_svdemo \
Executable_svptest \
@@ -48,7 +50,7 @@ $(eval $(call gb_Module_add_targets,vcl,\
Library_vclplug_gen \
Library_desktop_detector \
StaticLibrary_headless \
StaticLibrary_glxtest \
StaticLibrary_glxtest \
Package_fontunxppds \
Package_fontunxpsprint \
))
@@ -107,10 +109,16 @@ $(eval $(call gb_Module_add_check_targets,vcl,\
CppunitTest_vcl_wmf_test \
))
ifeq ($(GUIBASE),unx)
$(eval $(call gb_Module_add_check_targets,vcl,\
CppunitTest_vcl_timer \
))
endif
ifeq ($(ENABLE_HEADLESS),TRUE)
$(eval $(call gb_Module_add_check_targets,vcl,\
CppunitTest_vcl_timer \
))
endif
# vim: set noet sw=4 ts=4:

View File

@@ -38,7 +38,7 @@ using namespace com::sun::star;
#define MAX_FRAMEBUFFER_COUNT 30
// TODO use rtl::Static instead of 'static'
#if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID
#if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID && !defined(LIBO_HEADLESS)
static std::vector<GLXContext> g_vShareList;
#elif defined(WNT)
static std::vector<HGLRC> g_vShareList;
@@ -46,7 +46,7 @@ static std::vector<HGLRC> g_vShareList;
GLWindow::~GLWindow()
{
#if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID
#if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID && !defined(LIBO_HEADLESS)
XFree(vi);
#endif
}
@@ -69,7 +69,7 @@ OpenGLContext::OpenGLContext():
mpNextContext(NULL)
{
SAL_INFO("vcl.opengl", "new context: " << this);
#if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID
#if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID && !defined(LIBO_HEADLESS)
mbPixmap = false;
#endif
@@ -450,7 +450,7 @@ debug_callback(GLenum source, GLenum type, GLuint id,
#endif
#if defined UNX && !defined MACOSX && !defined IOS && !defined ANDROID
#if defined UNX && !defined MACOSX && !defined IOS && !defined ANDROID && !defined(LIBO_HEADLESS)
namespace {
@@ -679,7 +679,7 @@ bool OpenGLContext::init(SystemChildWindow* pChildWindow)
return ImplInit();
}
#if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID
#if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID && !defined(LIBO_HEADLESS)
bool OpenGLContext::init(Display* dpy, Window win, int screen)
{
if(mbInitialized)
@@ -1125,7 +1125,7 @@ bool OpenGLContext::initWindow()
return true;
}
#elif defined( IOS ) || defined( ANDROID )
#elif defined( IOS ) || defined( ANDROID ) || defined(LIBO_HEADLESS)
bool OpenGLContext::initWindow()
{
@@ -1245,7 +1245,7 @@ void OpenGLContext::reset()
}
#elif defined( MACOSX )
OpenGLWrapper::resetCurrent();
#elif defined( IOS ) || defined( ANDROID )
#elif defined( IOS ) || defined( ANDROID ) || defined(LIBO_HEADLESS)
// nothing
#elif defined( UNX )
if(m_aGLWin.ctx)
@@ -1289,6 +1289,7 @@ SystemWindowData OpenGLContext::generateWinData(vcl::Window* pParent, bool)
aWinData.nSize = sizeof(aWinData);
aWinData.pVisual = NULL;
#if !defined(LIBO_HEADLESS)
const SystemEnvData* sysData(pParent->GetSystemData());
Display *dpy = reinterpret_cast<Display*>(sysData->pDisplay);
@@ -1316,6 +1317,7 @@ SystemWindowData OpenGLContext::generateWinData(vcl::Window* pParent, bool)
SAL_INFO("vcl.opengl", "using VisualID " << vi->visualid);
aWinData.pVisual = (void*)(vi->visual);
}
#endif
return aWinData;
}
@@ -1329,7 +1331,7 @@ bool OpenGLContext::isCurrent()
wglGetCurrentDC() == m_aGLWin.hDC);
#elif defined( MACOSX )
return false;
#elif defined( IOS ) || defined( ANDROID )
#elif defined( IOS ) || defined( ANDROID ) || defined(LIBO_HEADLESS)
return false;
#elif defined( UNX )
GLXDrawable nDrawable = mbPixmap ? m_aGLWin.glPix : m_aGLWin.win;
@@ -1367,7 +1369,7 @@ void OpenGLContext::makeCurrent()
#elif defined( MACOSX )
NSOpenGLView* pView = getOpenGLView();
OpenGLWrapper::makeCurrent(pView);
#elif defined( IOS ) || defined( ANDROID )
#elif defined( IOS ) || defined( ANDROID ) || defined(LIBO_HEADLESS)
// nothing
#elif defined( UNX )
#ifdef DBG_UTIL
@@ -1408,7 +1410,7 @@ void OpenGLContext::resetCurrent()
wglMakeCurrent( m_aGLWin.hDC, 0 );
#elif defined( MACOSX )
OpenGLWrapper::resetCurrent();
#elif defined( IOS ) || defined( ANDROID )
#elif defined( IOS ) || defined( ANDROID ) || defined(LIBO_HEADLESS)
// nothing
#elif defined( UNX )
glXMakeCurrent(m_aGLWin.dpy, None, NULL);
@@ -1422,7 +1424,7 @@ void OpenGLContext::swapBuffers()
#elif defined( MACOSX )
NSOpenGLView* pView = getOpenGLView();
OpenGLWrapper::swapBuffers(pView);
#elif defined( IOS ) || defined( ANDROID )
#elif defined( IOS ) || defined( ANDROID ) || defined(LIBO_HEADLESS)
// nothing
#elif defined( UNX )
glXSwapBuffers(m_aGLWin.dpy, mbPixmap ? m_aGLWin.glPix : m_aGLWin.win);
@@ -1433,7 +1435,7 @@ void OpenGLContext::sync()
{
#if defined( WNT )
// nothing
#elif defined( MACOSX ) || defined( IOS ) || defined( ANDROID )
#elif defined( MACOSX ) || defined( IOS ) || defined( ANDROID ) || defined(LIBO_HEADLESS)
// nothing
#elif defined( UNX )
glXWaitGL();

View File

@@ -480,7 +480,7 @@ bool OpenGLHelper::isVCLOpenGLEnabled()
return bEnable;
}
#if defined UNX && !defined MACOSX && !defined IOS && !defined ANDROID
#if defined UNX && !defined MACOSX && !defined IOS && !defined ANDROID && !defined(LIBO_HEADLESS)
bool OpenGLHelper::GetVisualInfo(Display* pDisplay, int nScreen, XVisualInfo& rVI)
{

View File

@@ -28,12 +28,12 @@
#include "salinst.hxx"
#if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID
#if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID && !defined LIBO_HEADLESS
#include <vcl/opengl/glxtest.hxx>
#endif
SAL_IMPLEMENT_MAIN() {
#if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID
#if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID && !defined LIBO_HEADLESS
fire_glxtest_process();
#endif
tools::extendApplicationEnvironment();