On Qua, 2014-03-12 at 17:19 +0000, Sérgio Basto wrote:
> On Qua, 2014-03-12 at 16:16 +0100, Michael Thayer wrote: 
> > On 12/03/14 15:16, Michael Thayer wrote:
> > > On 07/03/14 18:05, Sérgio Basto wrote:
> > >   > when I try to compile VBOX with VBOX_USE_SYSTEM_XORG_HEADERS=1 , fails
> > >   > on build guests , on Linux Fedora 20 and rawhide .
> > >   > No doubt that you change thing in Linux guests ... also
> > >   > VBOX_USE_SYSTEM_XORG_HEADERS=1 assumes that we have Xorg 7  => xserver
> > >   > 1.1 , when we have xserver 1.15 , so IMHO we can drop support to 
> > > xserver
> > >   > < 1.6 or 1.8 or 1.10 at least .
> > >
> > > Could you please try this patch?
> > >
> > > Regards,
> > >
> > > Michael
> > >
> > > Index: src/VBox/Additions/x11/vboxvideo/Makefile.kmk
> > > ===================================================================
> > > --- src/VBox/Additions/x11/vboxvideo/Makefile.kmk    (revision 92751)
> > > +++ src/VBox/Additions/x11/vboxvideo/Makefile.kmk    (working copy)
> > > @@ -377,7 +377,7 @@
> > >            /usr/include/libdrm \
> > >            /usr/include/xorg \
> > >            /usr/include/pixman-1
> > > - vboxvideo_drv_system_SOURCES := $(vboxvideo_drv_15_SOURCES)
> > > + vboxvideo_drv_system_SOURCES := $(vboxvideo_drv_17_SOURCES)
> > >    endif
> > 
> > I see someone else has noticed this:
> > 
> > https://www.virtualbox.org/ticket/12803
> 
> 
> Great, many thanks, I will test it tonight, and I will give you
> feedback. 

It works. 
I'd like communicate my newest patch also to compile guest additions for
Fedora 19, 20 and 21, only with X11 and Mesa system sources, the patch
is also available on cvs of rpmfusion [1] 

We have some tricks there :
1 - ./src/VBox/Additions/common/crOpenGL/fakedri_drv.c have some code
that depends on internals of X11 source code and that code have been
removed for X-server 1.15 in Fedora rawhide (21), therefore we couldn't
compile it. Afterward I found that code is just need to one function : 
    vboxPatchMesaGLAPITable(); 
Comment that function and all code that depends on that, make it
possible (again) compile with system source code and also dropped the
need of xorg-x11-server-source, now just need "normal" devel packages.

2nd trick is #define HAVE_STRNDUP 1 , I don't understand why is need,
but is need, for more information, see bug report on freedesktop.org [2]

Other thing that I evaluate, is compile with libXcomposite , libXdamage,
libXfixes and libXext of the system . 

If you could add VBOX_USE_SYSTEM_XORG_HEADERS=1
for ./src/VBox/Additions/ and other cases will be great.


Thanks,

[1]
http://cvs.rpmfusion.org/viewvc/*checkout*/rpms/VirtualBox/devel/VirtualBox-4.3.6-mesa.patch?root=free&revision=1.3&content-type=text%2Fplain

[2] https://bugs.freedesktop.org/show_bug.cgi?id=47971
-- 
Sérgio M. B.

fakedri_drv.c,h:
Just compile with X11 system source and we may remove bundle X11 source code.

--- ./Config.kmk	2012-03-13 13:14:01.000000000 +0000
+++ ./Config.kmk	2012-03-27 23:55:28.070630137 +0100
@@ -2003,15 +2003,7 @@ ifdef VBOX_WITH_CROGL
  endif
 
  if1of ($(KBUILD_TARGET), freebsd linux solaris)
- # VBOX_PATH_MESA_SOURCE = $(PATH_ROOT)/src/libs/mesa-7.2
-  VBOX_PATH_MESA_SOURCE = $(VBOX_PATH_X11_ROOT)/mesa-7.2
-  VBOX_MESA_INCS = \
-        $(VBOX_PATH_MESA_SOURCE) \
-        $(VBOX_PATH_MESA_SOURCE)/include \
-        $(VBOX_PATH_MESA_SOURCE)/src/mesa/ \
-        $(VBOX_PATH_MESA_SOURCE)/src/mesa/glapi \
-        $(VBOX_PATH_MESA_SOURCE)/src/mesa/main \
-        $(VBOX_PATH_MESA_SOURCE)/src/mesa/drivers/dri/common
+  VBOX_MESA_INCS = 
  endif
 
  VBOX_DARWIN_OPENGL_INST     = obj/VBoxOGL/GL/
--- ./src/VBox/Additions/common/crOpenGL/Makefile.kmk.mesa	2012-09-13 09:26:18.000000000 +0100
+++ ./src/VBox/Additions/common/crOpenGL/Makefile.kmk	2012-09-23 01:08:36.032101751 +0100
@@ -82,18 +82,12 @@ VBoxOGL_TEMPLATE       = VBOXCROGLR3GUES
 VBoxOGL_INCS           = .
 if1of ($(KBUILD_TARGET), linux solaris freebsd)
  VBoxOGL_INCS     += \
-	$(VBOX_PATH_X11_ROOT)/libXdamage-1.1 \
-	$(VBOX_PATH_X11_ROOT)/libXcomposite-0.4.0 \
-	$(VBOX_PATH_X11_ROOT)/libXext-1.3.1 \
-	$(VBOX_PATH_X11_ROOT)/libXfixes-4.0.3 \
-	$(VBOX_PATH_X11_ROOT)/damageproto-1.1.0 \
-	$(VBOX_PATH_X11_ROOT)/compositeproto-0.4 \
-	$(VBOX_PATH_X11_ROOT)/fixesproto-4.0 \
-	$(VBOX_PATH_X11_ROOT)/libx11-1.1.5-other \
-	$(VBOX_PATH_X11_ROOT)/xextproto-7.1.1 \
-	$(VBOX_PATH_X11_ROOT)/xproto-7.0.18 \
+	/usr/include/x11 \
+	/usr/include/xorg \
+	/usr/include/pixman-1 \
 	$(VBOX_MESA_INCS) \
-	$(PATH_ROOT)/src/VBox/Additions/x11/x11include/libdrm-2.4.13
+	/usr/include/drm \
+	/usr/include/libdrm
  VBoxOGL_DEFS     += VBOX_NO_NATIVEGL
 endif
 
@@ -222,11 +216,20 @@ VBoxOGL_LIBS = \
 	$(VBOX_LIB_OGL_CRUTIL) \
 	$(PATH_STAGE_LIB)/additions/VBoxOGLspuload$(VBOX_SUFF_LIB)
 if1of ($(KBUILD_TARGET), linux solaris freebsd)
- VBoxOGL_LIBS += \
- 	$(PATH_STAGE_LIB)/libXcomposite.so \
- 	$(PATH_STAGE_LIB)/libXdamage.so \
- 	$(PATH_STAGE_LIB)/libXfixes.so \
- 	$(PATH_STAGE_LIB)/libXext.so
+ if1of ($(KBUILD_TARGET).$(KBUILD_TARGET_ARCH),linux.x86 )
+  VBoxOGL_LIBS += \
+ 	/usr/lib/libXcomposite.so \
+ 	/usr/lib/libXdamage.so \
+ 	/usr/lib/libXfixes.so \
+ 	/usr/lib/libXext.so
+ endif
+ if1of ($(KBUILD_TARGET).$(KBUILD_TARGET_ARCH),linux.amd64 )
+  VBoxOGL_LIBS += \
+ 	/usr/lib64/libXcomposite.so \
+ 	/usr/lib64/libXdamage.so \
+ 	/usr/lib64/libXfixes.so \
+ 	/usr/lib64/libXext.so
+ endif
  ifdef VBoxOGL_FAKEDRI
   ifeq ($(KBUILD_TARGET), freebsd)
     VBoxOGL_LIBS += \
--- ./src/VBox/Additions/common/crOpenGL/fakedri_drv.h.mesa	2013-12-18 16:06:06.000000000 +0000
+++ ./src/VBox/Additions/common/crOpenGL/fakedri_drv.h	2013-12-24 17:01:55.086948605 +0000
@@ -20,13 +20,6 @@
 #ifndef ___CROPENGL_FAKEDRIDRV_H
 #define ___CROPENGL_FAKEDRIDRV_H
 
-#include "src/mesa/main/mtypes.h"
-#include "src/mesa/main/dd.h"
-#include "src/mesa/glapi/dispatch.h"
-#include "src/mesa/glapi/glapi.h"
-#include "src/mesa/glapi/glapitable.h"
-#include "src/mesa/glapi/glapioffsets.h"
-#include "src/mesa/drivers/dri/common/dri_util.h"
 #include "GL/internal/dri_interface.h"
 
 #include "glx_proto.h"
--- ./src/VBox/Additions/common/crOpenGL/fakedri_drv.c.mesa	2013-12-18 16:06:06.000000000 +0000
+++ ./src/VBox/Additions/common/crOpenGL/fakedri_drv.c	2013-12-24 19:56:30.880070340 +0000
@@ -17,7 +17,12 @@
  */
 
 #define _GNU_SOURCE 1
+#define HAVE_STRNDUP 1
 
+#include <xf86.h>
+#include <xf86drm.h>
+#include <GL/gl.h>
+#include <GL/glext.h>
 #include "cr_error.h"
 #include "cr_gl.h"
 #include "cr_mem.h"
@@ -38,20 +42,6 @@
 #include <string.h>
 #endif
 
-/** X server message type definitions. */
-typedef enum {
-    X_PROBED,			/* Value was probed */
-    X_CONFIG,			/* Value was given in the config file */
-    X_DEFAULT,			/* Value is a default */
-    X_CMDLINE,			/* Value was given on the command line */
-    X_NOTICE,			/* Notice */
-    X_ERROR,			/* Error message */
-    X_WARNING,			/* Warning message */
-    X_INFO,			/* Informational message */
-    X_NONE,			/* No prefix */
-    X_NOT_IMPLEMENTED,		/* Not implemented */
-    X_UNKNOWN = -1		/* unknown -- this must always be last */
-} MessageType;
 
 #define VBOX_NO_MESA_PATCH_REPORTS
 
@@ -127,7 +117,6 @@ typedef struct _FAKEDRI_PatchNode
 static FAKEDRI_PatchNode *g_pFreeList=NULL, *g_pRepatchList=NULL;
 #endif
 
-static struct _glapi_table* vbox_glapi_table = NULL;
 fakedri_glxapi_table glxim;
 
 static const __DRIextension **gppSwDriExternsion = NULL;
@@ -136,54 +125,6 @@ static const __DRIswrastExtension *gpSwD
 
 extern const __DRIextension * __driDriverExtensions[];
 
-#define VBOX_SET_MESA_FUNC(table, name, func) \
-    if (_glapi_get_proc_offset(name)>=0) SET_by_offset(table, _glapi_get_proc_offset(name), func); \
-    else crWarning("%s not found in mesa table", name)
-
-#define GLAPI_ENTRY(Func) VBOX_SET_MESA_FUNC(vbox_glapi_table, "gl"#Func, cr_gl##Func);
-
-static void
-vboxPatchMesaExport(const char* psFuncName, const void *pStart, const void *pEnd);
-
-static void
-vboxPatchMesaGLAPITable()
-{
-    void *pGLTable;
-
-    pGLTable = (void *)_glapi_get_dispatch();
-    vbox_glapi_table = crAlloc(_glapi_get_dispatch_table_size() * sizeof (void *));
-    if (!vbox_glapi_table)
-    {
-        crError("Not enough memory to allocate dispatch table");
-    }
-    crMemcpy(vbox_glapi_table, pGLTable, _glapi_get_dispatch_table_size() * sizeof (void *));
-
-    #include "fakedri_glfuncsList.h"
-
-    VBOX_SET_MESA_FUNC(vbox_glapi_table, "glBlendEquationSeparateEXT", cr_glBlendEquationSeparate);
-    VBOX_SET_MESA_FUNC(vbox_glapi_table, "glSampleMaskSGIS", cr_glSampleMaskEXT);
-    VBOX_SET_MESA_FUNC(vbox_glapi_table, "glSamplePatternSGIS", cr_glSamplePatternEXT);
-    VBOX_SET_MESA_FUNC(vbox_glapi_table, "glWindowPos2dMESA", cr_glWindowPos2d);
-    VBOX_SET_MESA_FUNC(vbox_glapi_table, "glWindowPos2dvMESA", cr_glWindowPos2dv);
-    VBOX_SET_MESA_FUNC(vbox_glapi_table, "glWindowPos2fMESA", cr_glWindowPos2f);
-    VBOX_SET_MESA_FUNC(vbox_glapi_table, "glWindowPos2fvMESA", cr_glWindowPos2fv);
-    VBOX_SET_MESA_FUNC(vbox_glapi_table, "glWindowPos2iMESA", cr_glWindowPos2i);
-    VBOX_SET_MESA_FUNC(vbox_glapi_table, "glWindowPos2ivMESA", cr_glWindowPos2iv);
-    VBOX_SET_MESA_FUNC(vbox_glapi_table, "glWindowPos2sMESA", cr_glWindowPos2s);
-    VBOX_SET_MESA_FUNC(vbox_glapi_table, "glWindowPos2svMESA", cr_glWindowPos2sv);
-    VBOX_SET_MESA_FUNC(vbox_glapi_table, "glWindowPos3dMESA", cr_glWindowPos3d);
-    VBOX_SET_MESA_FUNC(vbox_glapi_table, "glWindowPos3dvMESA", cr_glWindowPos3dv);
-    VBOX_SET_MESA_FUNC(vbox_glapi_table, "glWindowPos3fMESA", cr_glWindowPos3f);
-    VBOX_SET_MESA_FUNC(vbox_glapi_table, "glWindowPos3fvMESA", cr_glWindowPos3fv);
-    VBOX_SET_MESA_FUNC(vbox_glapi_table, "glWindowPos3iMESA", cr_glWindowPos3i);
-    VBOX_SET_MESA_FUNC(vbox_glapi_table, "glWindowPos3ivMESA", cr_glWindowPos3iv);
-    VBOX_SET_MESA_FUNC(vbox_glapi_table, "glWindowPos3sMESA", cr_glWindowPos3s);
-    VBOX_SET_MESA_FUNC(vbox_glapi_table, "glWindowPos3svMESA", cr_glWindowPos3sv);
-
-    _glapi_set_dispatch(vbox_glapi_table);
-};
-#undef GLAPI_ENTRY
-
 #define GLXAPI_ENTRY(Func) pGLXTable->Func = VBOXGLXTAG(glX##Func);
 static void
 vboxFillGLXAPITable(fakedri_glxapi_table *pGLXTable)
@@ -686,7 +627,7 @@ void __attribute__ ((constructor)) vbox_
      * Note, we don't need to install extension functions via _glapi_add_dispatch, because we'd override glXGetProcAddress.
      */
     /* Mesa's dispatch table is different across library versions, have to modify mesa's table using offset info functions*/
-    vboxPatchMesaGLAPITable();
+    //vboxPatchMesaGLAPITable();
 
     /* Handle glx api.
      * In the end application call would look like this:
_______________________________________________
vbox-dev mailing list
vbox-dev@virtualbox.org
https://www.virtualbox.org/mailman/listinfo/vbox-dev

Reply via email to