ooo-build r12914 - in trunk: . distro-configs patches/dev300
- From: thorstenb svn gnome org
- To: svn-commits-list gnome org
- Subject: ooo-build r12914 - in trunk: . distro-configs patches/dev300
- Date: Tue, 17 Jun 2008 14:28:10 +0000 (UTC)
Author: thorstenb
Date: Tue Jun 17 14:28:10 2008
New Revision: 12914
URL: http://svn.gnome.org/viewvc/ooo-build?rev=12914&view=rev
Log:
* patches/dev300/vcl-linking-randr.diff:
* patches/dev300/apply: make vcl link against libXrandr by
default, instead of dlopening it at runtime. The old behaviour is
still optionally available
* distro-configs/Common.conf.in: enabled RandR support again
Added:
trunk/patches/dev300/vcl-linking-randr.diff
Modified:
trunk/ChangeLog
trunk/distro-configs/Common.conf.in
trunk/patches/dev300/apply
Modified: trunk/distro-configs/Common.conf.in
==============================================================================
--- trunk/distro-configs/Common.conf.in (original)
+++ trunk/distro-configs/Common.conf.in Tue Jun 17 14:28:10 2008
@@ -1,6 +1,5 @@
--disable-binfilter
--disable-crashdump
---disable-randr
--with-lang=\"@OOO_LANGS \"
--with-use-shell=bash
--without-gpc
Modified: trunk/patches/dev300/apply
==============================================================================
--- trunk/patches/dev300/apply (original)
+++ trunk/patches/dev300/apply Tue Jun 17 14:28:10 2008
@@ -2195,6 +2195,7 @@
[ Fixes ]
cppcanvas-fix-roundcorners.diff, rodo
slideshow-media-control.diff, thorsten
+vcl-linking-randr.diff, i#89718, n#398244, thorsten
[ LocalizeFixes ]
Added: trunk/patches/dev300/vcl-linking-randr.diff
==============================================================================
--- (empty file)
+++ trunk/patches/dev300/vcl-linking-randr.diff Tue Jun 17 14:28:10 2008
@@ -0,0 +1,327 @@
+ config_office/configure.in | 57 ++++++++++++++--------
+ config_office/set_soenv.in | 3 +
+ vcl/unx/source/app/makefile.mk | 5 ++
+ vcl/unx/source/app/randrwrapper.cxx | 90 ++++++++++++++++++++++++++++++++++-
+ vcl/unx/source/app/saldisp.cxx | 6 +-
+ vcl/util/makefile.mk | 21 ++++++++
+ 6 files changed, 154 insertions(+), 28 deletions(-)
+
+diff --git a/config_office/configure.in b/config_office/configure.in
+index 8b8e6cf..232ffc3 100644
+--- config_office/configure.in
++++ config_office/configure.in
+@@ -272,8 +272,12 @@ AC_ARG_ENABLE(xrender-link,
+ [ --enable-xrender-link link with libXrender instead of dynamically open it
+ ],,)
+ AC_ARG_ENABLE(randr,
+-[ --disable-randr disable RandR support in the vcl project
++[ --disable-randr disable RandR support in the vcl project
+ ],,enable_randr=yes)
++AC_ARG_ENABLE(randr-link,
++[ --disable-randr-link disable linking with libXrandr, instead dynamically
++ open it at runtime
++],,enable_randr_link=yes)
+ AC_ARG_WITH(myspell-dicts,
+ [ --without-myspell-dicts Removes myspell dictionaries from openoffice.org
+ installation set, for people building for specific
+@@ -1167,18 +1171,6 @@ else
+ fi
+ AC_SUBST(ENABLE_FONTCONFIG)
+
+-dnl ===================================================================
+-dnl Build options
+-dnl ===================================================================
+-AC_MSG_CHECKING([whether to enable RandR support])
+-if test "$test_randr" = "yes" -a \( "$enable_randr" = "yes" -o "$enable_randr" = "TRUE" \) ; then
+- ENABLE_RANDR="TRUE"
+- AC_MSG_RESULT([yes])
+-else
+- ENABLE_RANDR=""
+- AC_MSG_RESULT([no])
+-fi
+-AC_SUBST(ENABLE_RANDR)
+
+ dnl ===================================================================
+ dnl Disable legacy binary file formats filters
+@@ -2004,14 +1996,6 @@ if test "$test_cups" = "yes" -a "$ENABLE_CUPS" = "TRUE" ; then
+ fi
+
+ dnl ===================================================================
+-dnl Check if X11/extensions/Xrandr.h is available
+-dnl ===================================================================
+-if test "$test_randr" = "yes" -a "$ENABLE_RANDR" = "TRUE" ; then
+- AC_CHECK_HEADER(X11/extensions/Xrandr.h, [],
+- [AC_MSG_ERROR([X11/extensions/Xrandr.h could not be found. X11 dev missing?])], [])
+-fi
+-
+-dnl ===================================================================
+ dnl Check if PAM/pam_appl.h is available on Linux or FreeBSD
+ dnl ===================================================================
+ if test "$_os" = "Linux" -o "$_os" = "FreeBSD" -o "$_os" = "GNU"; then
+@@ -4564,6 +4548,37 @@ AC_SUBST(SYSTEM_XRENDER_HEADERS)
+ AC_SUBST(XRENDER_LINK)
+
+ 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 -z "$enable_randr_link" -o "$enable_randr_link" = "no"; then
++ XRANDR_DLOPEN="TRUE"
++ AC_MSG_RESULT([resorting to dlopen libXrandr at runtime])
++ else
++ XRANDR_DLOPEN="FALSE"
++ PKG_CHECK_MODULES(XRANDR, xrandr >= 1.2, ENABLE_RANDR="TRUE", ENABLE_RANDR="")
++ if test "$ENABLE_RANDR" != "TRUE"; then
++ AC_CHECK_HEADER(X11/extensions/Xrandr.h, [],
++ [AC_MSG_ERROR([X11/extensions/Xrandr.h could not be found. X11 dev missing?])], [])
++ XRANDR_CFLAGS=" "
++ AC_CHECK_LIB(Xrandr, XRRQueryExtension, [],
++ [ AC_MSG_ERROR(libXrandr not found or functional) ], [])
++ XRANDR_LIBS="-lXrandr "
++ ENABLE_RANDR="TRUE"
++ AC_MSG_RESULT([enabling RandR support])
++ fi
++ fi
++else
++ ENABLE_RANDR=""
++ AC_MSG_RESULT([no])
++fi
++AC_SUBST(XRANDR_DLOPEN)
++AC_SUBST(XRANDR_CFLAGS)
++AC_SUBST(XRANDR_LIBS)
++AC_SUBST(ENABLE_RANDR)
++
++dnl ===================================================================
+ dnl Check for system Mesa
+ dnl ===================================================================
+ AC_MSG_CHECKING([which Mesa headers to use])
+diff --git a/config_office/set_soenv.in b/config_office/set_soenv.in
+index 0ff9874..2ee36f5 100644
+--- config_office/set_soenv.in
++++ config_office/set_soenv.in
+@@ -1966,6 +1966,9 @@ ToFile( "FREETYPE_LIBS", "@FREETYPE_LIBS@", "e" );
+ ToFile( "SYSTEM_CAIRO", "@SYSTEM_CAIRO@", "e" );
+ ToFile( "CAIRO_CFLAGS", "@CAIRO_CFLAGS@", "e" );
+ ToFile( "CAIRO_LIBS", "@CAIRO_LIBS@", "e" );
++ToFile( "XRANDR_CFLAGS", "@XRANDR_CFLAGS@", "e" );
++ToFile( "XRANDR_LIBS", "@XRANDR_LIBS@", "e" );
++ToFile( "XRANDR_DLOPEN", "@XRANDR_DLOPEN@", "e" );
+ ToFile( "SYSTEM_LIBWPD", "@SYSTEM_LIBWPD@", "e" );
+ ToFile( "LIBWPD_CFLAGS", "@LIBWPD_CFLAGS@", "e" );
+ ToFile( "LIBWPD_LIBS", "@LIBWPD_LIBS@", "e" );
+diff --git a/vcl/unx/source/app/makefile.mk b/vcl/unx/source/app/makefile.mk
+index 8520ea2..0a24c44 100644
+--- vcl/unx/source/app/makefile.mk
++++ vcl/unx/source/app/makefile.mk
+@@ -79,8 +79,11 @@ EXCEPTIONSFILES=\
+
+
+ .IF "$(ENABLE_RANDR)" != ""
+-.IF "$(OS)" != "SOLARIS"
+ CDEFS+=-DUSE_RANDR
++.IF "$(XRANDR_DLOPEN)" == "FALSE"
++CDEFS+=$(XRANDR_CFLAGS)
++.ELSE
++CDEFS+=-DXRANDR_DLOPEN
+ .ENDIF
+ .ENDIF
+
+diff --git a/vcl/unx/source/app/randrwrapper.cxx b/vcl/unx/source/app/randrwrapper.cxx
+index 9b9b347..aceeacb 100644
+--- vcl/unx/source/app/randrwrapper.cxx
++++ vcl/unx/source/app/randrwrapper.cxx
+@@ -40,6 +40,9 @@
+
+ namespace
+ {
++
++# ifdef XRANDR_DLOPEN
++
+ class RandRWrapper
+ {
+ oslModule m_pRandRLib;
+@@ -107,7 +110,6 @@ public:
+ return m_bValid ? m_pXRRConfigCurrentConfiguration( i_pConfig, o_pRot ) : 0;
+ }
+ };
+-}
+
+ void RandRWrapper::initFromModule()
+ {
+@@ -183,8 +185,89 @@ void RandRWrapper::releaseWrapper()
+ pWrapper = NULL;
+ }
+
+-#endif
++# else
+
++class RandRWrapper
++{
++ bool m_bValid;
++
++ RandRWrapper(Display*);
++public:
++ static RandRWrapper& get(Display*);
++ static void releaseWrapper();
++
++ Bool XRRQueryExtension(Display* i_pDisp, int* o_event_base, int* o_error_base )
++ {
++ Bool bRet = False;
++ if( m_bValid )
++ bRet = ::XRRQueryExtension( i_pDisp, o_event_base, o_error_base );
++ return bRet;
++ }
++ Status XRRQueryVersion( Display* i_pDisp, int* o_major, int* o_minor )
++ {
++ return m_bValid ? ::XRRQueryVersion( i_pDisp, o_major, o_minor ) : 0;
++ }
++ XRRScreenConfiguration* XRRGetScreenInfo( Display* i_pDisp, Drawable i_aDrawable )
++ {
++ return m_bValid ? ::XRRGetScreenInfo( i_pDisp, i_aDrawable ) : NULL;
++ }
++ void XRRFreeScreenConfigInfo( XRRScreenConfiguration* i_pConfig )
++ {
++ if( m_bValid )
++ ::XRRFreeScreenConfigInfo( i_pConfig );
++ }
++ void XRRSelectInput( Display* i_pDisp, XLIB_Window i_window, int i_nMask )
++ {
++ if( m_bValid )
++ ::XRRSelectInput( i_pDisp, i_window, i_nMask );
++ }
++ int XRRUpdateConfiguration( XEvent* i_pEvent )
++ {
++ return m_bValid ? ::XRRUpdateConfiguration( i_pEvent ) : 0;
++ }
++ XRRScreenSize* XRRSizes( Display* i_pDisp, int i_screen, int* o_nscreens )
++ {
++ return m_bValid ? ::XRRSizes( i_pDisp, i_screen, o_nscreens ) : NULL;
++ }
++ XRRScreenSize* XRRConfigSizes( XRRScreenConfiguration* i_pConfig, int* o_nSizes )
++ {
++ return m_bValid ? ::XRRConfigSizes( i_pConfig, o_nSizes ) : NULL;
++ }
++ SizeID XRRConfigCurrentConfiguration( XRRScreenConfiguration* i_pConfig, Rotation* o_pRot )
++ {
++ return m_bValid ? ::XRRConfigCurrentConfiguration( i_pConfig, o_pRot ) : 0;
++ }
++};
++
++RandRWrapper::RandRWrapper( Display* pDisplay ) :
++ m_bValid( false )
++{
++ int nEventBase = 0, nErrorBase = 0;
++ if( ! XRRQueryExtension( pDisplay, &nEventBase, &nErrorBase ) )
++ m_bValid = false;
++}
++
++static RandRWrapper* pWrapper = NULL;
++
++RandRWrapper& RandRWrapper::get( Display* i_pDisplay )
++{
++ if( ! pWrapper )
++ pWrapper = new RandRWrapper( i_pDisplay );
++ return *pWrapper;
++}
++
++void RandRWrapper::releaseWrapper()
++{
++ delete pWrapper;
++ pWrapper = NULL;
++}
++
++ #endif
++
++} // namespace
++
++#endif
++
+ #include "saldisp.hxx"
+
+ void SalDisplay::InitRandR( XLIB_Window aRoot ) const
+@@ -200,6 +283,9 @@ void SalDisplay::DeInitRandR()
+ {
+ #ifdef USE_RANDR
+ RandRWrapper::releaseWrapper();
++#if OSL_DEBUG_LEVEL > 1
++ fprintf( stderr, "SalDisplay::DeInitRandR()\n" );
++#endif
+ #endif
+ }
+
+diff --git a/vcl/unx/source/app/saldisp.cxx b/vcl/unx/source/app/saldisp.cxx
+index fe852d8..2960711 100644
+--- vcl/unx/source/app/saldisp.cxx
++++ vcl/unx/source/app/saldisp.cxx
+@@ -556,6 +556,9 @@ SalDisplay::~SalDisplay( )
+ #endif
+ pDisp_ = NULL;
+ }
++ // don't do this in doDestruct since RandR extension adds hooks into Display
++ // that is XCloseDisplay still needs the RandR library if it was used
++ DeInitRandR();
+ }
+
+ void SalDisplay::doDestruct()
+@@ -682,9 +685,6 @@ SalX11Display::~SalX11Display()
+ XCloseDisplay( pDisp_ );
+ pDisp_ = NULL;
+ }
+- // don't do this in doDestruct since RandR extension adds hooks into Display
+- // that is XCloseDisplay still needs the RandR library if it was used
+- DeInitRandR();
+ }
+
+ void SalDisplay::initScreen( int nScreen ) const
+diff --git a/vcl/util/makefile.mk b/vcl/util/makefile.mk
+index a3452d3..e97908d 100644
+--- vcl/util/makefile.mk
++++ vcl/util/makefile.mk
+@@ -301,12 +301,18 @@ SHL2STDLIBS+=`pkg-config --libs xrender`
+
+ .IF "$(GUIBASE)"=="unx"
+
+-SHL2STDLIBS += -lXext -lXtst -lSM -lICE -lX11
++SHL2STDLIBS += -lXext -lXtst -lSM -lICE -lX11
+ .IF "$(OS)"!="MACOSX" && "$(OS)"!="FREEBSD"
+ # needed by salprnpsp.cxx
+ SHL2STDLIBS+= -ldl
+ .ENDIF
+
++.IF "$(ENABLE_RANDR)" != ""
++.IF "$(XRANDR_DLOPEN)" == "FALSE"
++SHL2STDLIBS+= $(XRANDR_LIBS)
++.ENDIF
++.ENDIF
++
+ .ENDIF # "$(GUIBASE)"=="unx"
+
+ # gtk plugin
+@@ -351,6 +357,12 @@ SHL4STDLIBS+=\
+ $(VOSLIB) \
+ $(SALLIB)
+
++.IF "$(ENABLE_RANDR)" != ""
++.IF "$(XRANDR_DLOPEN)" == "FALSE"
++SHL4STDLIBS+= $(XRANDR_LIBS)
++.ENDIF
++.ENDIF
++
+ .ENDIF # "$(ENABLE_GTK)" != ""
+
+ # KDE plugin
+@@ -373,6 +385,13 @@ SHL5STDLIBS+=\
+ $(TOOLSLIB) \
+ $(VOSLIB) \
+ $(SALLIB)
++
++.IF "$(ENABLE_RANDR)" != ""
++.IF "$(XRANDR_DLOPEN)" == "FALSE"
++SHL5STDLIBS+= $(XRANDR_LIBS)
++.ENDIF
++.ENDIF
++
+ .ENDIF # "$(ENABLE_KDE)" != ""
+
+ .ENDIF # UNX
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]