[Xquartz-changes] xserver: Branch 'server-1.11-apple' - 11 commits

Jeremy Huddleston jeremyhu at freedesktop.org
Tue Jun 28 13:08:06 PDT 2011


Rebased ref, commits from common ancestor:
commit 9efff538a8cab7f10934dd12cf8ef3ad299e434b
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Fri Feb 12 19:48:52 2010 -0800

    fb: Revert fb changes that broke XQuartz
    
    http://bugs.freedesktop.org/show_bug.cgi?id=26124
    
    Revert "Fix source pictures getting random transforms after 2d6a8f668342a5190cdf43b5."
    Revert "fb: Adjust transform or composite coordinates for pixman operations"
    
    http://bugs.freedesktop.org/26124
    
    This reverts commit a72c65e9176c51de95db2fdbf4c5d946a4911695.
    This reverts commit a6bd5d2e482a5aa84acb3d4932e2a166d8670ef1.
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/fb/fb.h b/fb/fb.h
index eaa21ad..e65a1c0 100644
--- a/fb/fb.h
+++ b/fb/fb.h
@@ -2049,11 +2049,8 @@ fbFillRegionSolid (DrawablePtr	pDrawable,
 		   FbBits	xor);
 
 extern _X_EXPORT pixman_image_t *
-image_from_pict (PicturePtr	pict,
-		 Bool		has_clip,
-		 int		*xoff,
-		 int		*yoff);
-
+image_from_pict (PicturePtr pict,
+		 Bool       has_clip);
 extern _X_EXPORT void free_pixman_pict (PicturePtr, pixman_image_t *);
 
 #endif /* _FB_H_ */
diff --git a/fb/fbpict.c b/fb/fbpict.c
index d1fd0cb..d2986c8 100644
--- a/fb/fbpict.c
+++ b/fb/fbpict.c
@@ -50,24 +50,19 @@ fbComposite (CARD8      op,
 	     CARD16     height)
 {
     pixman_image_t *src, *mask, *dest;
-    int src_xoff, src_yoff;
-    int msk_xoff, msk_yoff;
-    int dst_xoff, dst_yoff;
     
     miCompositeSourceValidate (pSrc);
     if (pMask)
 	miCompositeSourceValidate (pMask);
     
-    src = image_from_pict (pSrc, FALSE, &src_xoff, &src_yoff);
-    mask = image_from_pict (pMask, FALSE, &msk_xoff, &msk_yoff);
-    dest = image_from_pict (pDst, TRUE, &dst_xoff, &dst_yoff);
+    src = image_from_pict (pSrc, TRUE);
+    mask = image_from_pict (pMask, TRUE);
+    dest = image_from_pict (pDst, TRUE);
 
     if (src && dest && !(pMask && !mask))
     {
 	pixman_image_composite (op, src, mask, dest,
-				xSrc + src_xoff, ySrc + src_yoff,
-				xMask + msk_xoff, yMask + msk_yoff,
-				xDst + dst_xoff, yDst + dst_yoff,
+				xSrc, ySrc, xMask, yMask, xDst, yDst,
 				width, height);
     }
 
@@ -146,22 +141,22 @@ create_conical_gradient_image (PictGradient *gradient)
 
 static pixman_image_t *
 create_bits_picture (PicturePtr pict,
-		     Bool       has_clip,
-		     int	*xoff,
-		     int	*yoff)
+		     Bool       has_clip)
 {
-    PixmapPtr pixmap;
     FbBits *bits;
     FbStride stride;
-    int bpp;
+    int bpp, xoff, yoff;
     pixman_image_t *image;
     
-    fbGetDrawablePixmap (pict->pDrawable, pixmap, *xoff, *yoff);
-    fbGetPixmapBitsData(pixmap, bits, stride, bpp);
+    fbGetDrawable (pict->pDrawable, bits, stride, bpp, xoff, yoff);
+
+    bits = (FbBits*)((CARD8*)bits +
+		     (pict->pDrawable->y + yoff) * stride * sizeof(FbBits) +
+		     (pict->pDrawable->x + xoff) * (bpp / 8));
 
     image = pixman_image_create_bits (
 	(pixman_format_code_t)pict->format,
-	pixmap->drawable.width, pixmap->drawable.height,
+	pict->pDrawable->width, pict->pDrawable->height,
 	(uint32_t *)bits, stride * sizeof (FbStride));
     
     
@@ -187,55 +182,33 @@ create_bits_picture (PicturePtr pict,
 	if (pict->clientClipType != CT_NONE)
 	    pixman_image_set_has_client_clip (image, TRUE);
 
-	if (*xoff || *yoff)
-	    pixman_region_translate (pict->pCompositeClip, *xoff, *yoff);
+	pixman_region_translate (pict->pCompositeClip, - pict->pDrawable->x, - pict->pDrawable->y);
 
 	pixman_image_set_clip_region (image, pict->pCompositeClip);
 
-	if (*xoff || *yoff)
-	    pixman_region_translate (pict->pCompositeClip, -*xoff, -*yoff);
+	pixman_region_translate (pict->pCompositeClip, pict->pDrawable->x, pict->pDrawable->y);
     }
     
     /* Indexed table */
     if (pict->pFormat->index.devPrivate)
 	pixman_image_set_indexed (image, pict->pFormat->index.devPrivate);
 
-    /* Add in drawable origin to position within the image */
-    *xoff += pict->pDrawable->x;
-    *yoff += pict->pDrawable->y;
-
     return image;
 }
 
 static pixman_image_t *
-image_from_pict_internal (PicturePtr pict, Bool has_clip, int *xoff, int *yoff, Bool is_alpha_map);
+image_from_pict_internal (PicturePtr pict, Bool has_clip, Bool is_alpha_map);
 
 static void
-set_image_properties (pixman_image_t *image, PicturePtr pict, Bool has_clip, int *xoff, int *yoff, Bool is_alpha_map)
+set_image_properties (pixman_image_t *image, PicturePtr pict, Bool is_alpha_map)
 {
     pixman_repeat_t repeat;
     pixman_filter_t filter;
     
     if (pict->transform)
     {
-	/* For source images, adjust the transform to account
-	 * for the drawable offset within the pixman image,
-	 * then set the offset to 0 as it will be used
-	 * to compute positions within the transformed image.
-	 */
-	if (!has_clip) {
-	    struct pixman_transform	adjusted;
-
-	    adjusted = *pict->transform;
-	    pixman_transform_translate(&adjusted,
-				       NULL,
-				       pixman_int_to_fixed(*xoff),
-				       pixman_int_to_fixed(*yoff));
-	    pixman_image_set_transform (image, &adjusted);
-	    *xoff = 0;
-	    *yoff = 0;
-	} else
-	    pixman_image_set_transform (image, pict->transform);
+	pixman_image_set_transform (
+	    image, (pixman_transform_t *)pict->transform);
     }
     
     switch (pict->repeatType)
@@ -265,8 +238,7 @@ set_image_properties (pixman_image_t *image, PicturePtr pict, Bool has_clip, int
      */
     if (pict->alphaMap && !is_alpha_map)
     {
-	int alpha_xoff, alpha_yoff;
-	pixman_image_t *alpha_map = image_from_pict_internal (pict->alphaMap, FALSE, &alpha_xoff, &alpha_yoff, TRUE);
+	pixman_image_t *alpha_map = image_from_pict_internal (pict->alphaMap, TRUE, TRUE);
 	
 	pixman_image_set_alpha_map (
 	    image, alpha_map, pict->alphaOrigin.x, pict->alphaOrigin.y);
@@ -299,7 +271,8 @@ set_image_properties (pixman_image_t *image, PicturePtr pict, Bool has_clip, int
 }
 
 static pixman_image_t *
-image_from_pict_internal (PicturePtr pict, Bool has_clip, int *xoff, int *yoff, Bool is_alpha_map)
+image_from_pict_internal (PicturePtr pict,
+		 Bool has_clip, Bool is_alpha_map)
 {
     pixman_image_t *image = NULL;
 
@@ -308,7 +281,7 @@ image_from_pict_internal (PicturePtr pict, Bool has_clip, int *xoff, int *yoff,
 
     if (pict->pDrawable)
     {
-	image = create_bits_picture (pict, has_clip, xoff, yoff);
+	image = create_bits_picture (pict, has_clip);
     }
     else if (pict->pSourcePict)
     {
@@ -329,19 +302,18 @@ image_from_pict_internal (PicturePtr pict, Bool has_clip, int *xoff, int *yoff,
 	    else if (sp->type == SourcePictTypeConical)
 		image = create_conical_gradient_image (gradient);
 	}
-	*xoff = *yoff = 0;
     }
     
     if (image)
-	set_image_properties (image, pict, has_clip, xoff, yoff, is_alpha_map);
+	set_image_properties (image, pict, is_alpha_map);
     
     return image;
 }
 
 pixman_image_t *
-image_from_pict (PicturePtr pict, Bool has_clip, int *xoff, int *yoff)
+image_from_pict (PicturePtr pict, Bool has_clip)
 {
-    return image_from_pict_internal (pict, has_clip, xoff, yoff, FALSE);
+    return image_from_pict_internal (pict, has_clip, FALSE);
 }
 
 void
diff --git a/fb/fbtrap.c b/fb/fbtrap.c
index 0b5a638..fbe2647 100644
--- a/fb/fbtrap.c
+++ b/fb/fbtrap.c
@@ -39,12 +39,11 @@ fbAddTraps (PicturePtr	pPicture,
 	    xTrap	*traps)
 {
     pixman_image_t *image;
-    int dst_xoff, dst_yoff;
 
-    if (!(image = image_from_pict (pPicture, FALSE, &dst_xoff, &dst_yoff)))
+    if (!(image = image_from_pict (pPicture, FALSE)))
 	return;
     
-    pixman_add_traps (image, x_off + dst_xoff, y_off + dst_yoff,
+    pixman_add_traps (image, x_off, y_off,
 		      ntrap, (pixman_trap_t *)traps);
 
     free_pixman_pict (pPicture, image);
@@ -57,14 +56,13 @@ fbRasterizeTrapezoid (PicturePtr    pPicture,
 		      int	    y_off)
 {
     pixman_image_t *image;
-    int	dst_xoff, dst_yoff;
 
-    if (!(image = image_from_pict (pPicture, FALSE, &dst_xoff, &dst_yoff)))
+    if (!(image = image_from_pict (pPicture, FALSE)))
 	return;
 
     pixman_rasterize_trapezoid (image, (pixman_trapezoid_t *)trap,
-				x_off + dst_xoff,
-				y_off + dst_yoff);
+				x_off,
+				y_off);
 
     free_pixman_pict (pPicture, image);
 }
@@ -77,13 +75,12 @@ fbAddTriangles (PicturePtr  pPicture,
 		xTriangle *tris)
 {
     pixman_image_t *image;
-    int dst_xoff, dst_yoff;
 
-    if (!(image = image_from_pict (pPicture, FALSE, &dst_xoff, &dst_yoff)))
+    if (!(image = image_from_pict (pPicture, FALSE)))
 	return;
     
     pixman_add_triangles (image,
-			  dst_xoff + x_off, dst_yoff + y_off,
+			  x_off, y_off,
 			  ntri, (pixman_triangle_t *)tris);
 
     free_pixman_pict (pPicture, image);
@@ -110,13 +107,11 @@ fbShapes (CompositeShapesFunc	composite,
 	  const uint8_t *	shapes)
 {
     pixman_image_t *src, *dst;
-    int src_xoff, src_yoff;
-    int dst_xoff, dst_yoff;
 
     miCompositeSourceValidate (pSrc);
 
-    src = image_from_pict (pSrc, FALSE, &src_xoff, &src_yoff);
-    dst = image_from_pict (pDst, TRUE, &dst_xoff, &dst_yoff);
+    src = image_from_pict (pSrc, FALSE);
+    dst = image_from_pict (pDst, TRUE);
 
     if (src && dst)
     {
@@ -136,10 +131,10 @@ fbShapes (CompositeShapesFunc	composite,
 	    for (i = 0; i < nshapes; ++i)
 	    {
 		composite (op, src, dst, format,
-			   xSrc + src_xoff,
-			   ySrc + src_yoff,
-			   dst_xoff,
-			   dst_yoff,
+			   xSrc,
+			   ySrc,
+			   0,
+			   0,
 			   1, shapes + i * shape_size);
 	    }
 	}
@@ -162,10 +157,10 @@ fbShapes (CompositeShapesFunc	composite,
 	    }
 	    
 	    composite (op, src, dst, format,
-		       xSrc + src_xoff,
-		       ySrc + src_yoff,
-		       dst_xoff,
-		       dst_yoff,
+		       xSrc,
+		       ySrc,
+		       0,
+		       0,
 		       nshapes, shapes);
 	}
 
commit 697a66f8e0955274a6fc0c301710a9641e474f69
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Fri Apr 30 13:08:25 2010 -0700

    Workaround the GC clipping problem in miPaintWindow and add some debugging output.
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/mi/miexpose.c b/mi/miexpose.c
index 94258b8..4f25c23 100644
--- a/mi/miexpose.c
+++ b/mi/miexpose.c
@@ -521,6 +521,7 @@ void RootlessSetPixmapOfAncestors(WindowPtr pWin);
 void RootlessStartDrawing(WindowPtr pWin);
 void RootlessDamageRegion(WindowPtr pWin, RegionPtr prgn);
 Bool IsFramedWindow(WindowPtr pWin);
+#include "../fb/fb.h"
 #endif 
 
 void
@@ -548,24 +549,37 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
     Bool	solid = TRUE;
     DrawablePtr	drawable = &pWin->drawable;
 
+#ifdef XQUARTZ_CLIP_DEBUG
+    ErrorF("START %d BS %d (pR = %ld)\n", what, pWin->backgroundState, ParentRelative);
+    ErrorF("      Rgn: %d %d %d %d\n", prgn->extents.x1, prgn->extents.y1,
+	                               prgn->extents.x2 - prgn->extents.x1,
+	                               prgn->extents.y2 - prgn->extents.y1);
+    ErrorF("      Win: %d %d (%d %d) %d %d\n", pWin->origin.x, pWin->origin.y,
+	                                       pWin->winSize.extents.x1, pWin->winSize.extents.y1,
+	                                       pWin->winSize.extents.x2 - pWin->winSize.extents.x1,
+					       pWin->winSize.extents.y2 - pWin->winSize.extents.y1);
+    ErrorF("     Draw: %d %d %d %d\n", pWin->drawable.x, pWin->drawable.y,
+				       pWin->drawable.width, pWin->drawable.height);
+#endif
+
 #ifdef ROOTLESS
     if(!drawable || drawable->type == UNDRAWABLE_WINDOW)
 	return;
-
-    if(IsFramedWindow(pWin)) {
-        RootlessStartDrawing(pWin);
-        RootlessDamageRegion(pWin, prgn);
-    
-        if(pWin->backgroundState == ParentRelative) {
-            if((what == PW_BACKGROUND) || 
-               (what == PW_BORDER && !pWin->borderIsPixel))
-                RootlessSetPixmapOfAncestors(pWin);
-        }
-    }
 #endif
     
     if (what == PW_BACKGROUND)
     {
+#ifdef ROOTLESS
+	if(IsFramedWindow(pWin)) {
+	    RootlessStartDrawing(pWin);
+	    RootlessDamageRegion(pWin, prgn);
+
+	    if(pWin->backgroundState == ParentRelative) {
+		RootlessSetPixmapOfAncestors(pWin);
+	    }
+	}
+#endif
+
 	while (pWin->backgroundState == ParentRelative)
 	    pWin = pWin->parent;
 
@@ -587,6 +601,18 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
     {
 	PixmapPtr   pixmap;
 
+#ifdef ROOTLESS
+	if(IsFramedWindow(pWin)) {
+	    RootlessStartDrawing(pWin);
+	    RootlessDamageRegion(pWin, prgn);
+	    
+	    if(!pWin->borderIsPixel &&
+		pWin->backgroundState == ParentRelative) {
+		RootlessSetPixmapOfAncestors(pWin);
+	    }
+	}
+#endif
+
 	tile_x_off = drawable->x;
 	tile_y_off = drawable->y;
 	
@@ -595,6 +621,12 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
 	    return;
 	pixmap = (*pScreen->GetWindowPixmap) ((WindowPtr) drawable);
 	drawable = &pixmap->drawable;
+
+#ifdef XQUARTZ_CLIP_DEBUG
+	ErrorF("     Draw: %d %d %d %d\n",
+	       drawable->x, drawable->y, drawable->width, drawable->height);    
+#endif
+	
 #ifdef COMPOSITE
 	draw_x_off = pixmap->screen_x;
 	draw_y_off = pixmap->screen_y;
@@ -657,6 +689,57 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
     ChangeGC (NullClient, pGC, gcmask, gcval);
     ValidateGC (drawable, pGC);
 
+#ifdef XQUARTZ_CLIP_DEBUG
+    ErrorF("       GC: %d %d %d %d\n",
+	   pGC->pCompositeClip->extents.x1, pGC->pCompositeClip->extents.y1,
+	   pGC->pCompositeClip->extents.x2 - pGC->pCompositeClip->extents.x1,
+	   pGC->pCompositeClip->extents.y2 - pGC->pCompositeClip->extents.y1);
+#endif
+    
+#ifdef XQUARTZ
+    /* Looks like our clipping isn't set right for some reason:
+     * http://xquartz.macosforge.org/trac/ticket/290
+     */
+    if(what == PW_BORDER) {
+
+#if 0
+	if(solid) {
+#if 1
+	    fbFillRegionSolid(&pWin->drawable,
+			      prgn,
+			      0,
+			      fbReplicatePixel(fill.pixel,
+					       pWin->drawable.bitsPerPixel));
+#else
+	    fbFillRegionSolid(drawable,
+			      prgn,
+			      0,
+			      fbReplicatePixel(fill.pixel,
+					       drawable->bitsPerPixel));
+#endif
+	    return;
+	}
+#endif
+    
+	pGC->pCompositeClip->extents.x1 += prgn->extents.x1;
+	pGC->pCompositeClip->extents.y1 += prgn->extents.y1;
+	pGC->pCompositeClip->extents.x2 += prgn->extents.x1;
+	pGC->pCompositeClip->extents.y2 += prgn->extents.y1;
+	
+	if(pGC->pCompositeClip->extents.x2 > drawable->pScreen->width)
+	    pGC->pCompositeClip->extents.x2 = drawable->pScreen->width;
+	if(pGC->pCompositeClip->extents.y2 > drawable->pScreen->height)
+	    pGC->pCompositeClip->extents.y2 = drawable->pScreen->height;
+    }
+#endif
+
+#ifdef XQUARTZ_CLIP_DEBUG
+    ErrorF("       GC: %d %d %d %d\n",
+	   pGC->pCompositeClip->extents.x1, pGC->pCompositeClip->extents.y1,
+	   pGC->pCompositeClip->extents.x2 - pGC->pCompositeClip->extents.x1,
+	   pGC->pCompositeClip->extents.y2 - pGC->pCompositeClip->extents.y1);    
+#endif
+
     numRects = RegionNumRects(prgn);
     pbox = RegionRects(prgn);
     for (i= numRects; --i >= 0; pbox++, prect++)
commit 96f102410e6ecdfe801ef57241ab930f19f1e00f
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Sat Oct 30 14:55:06 2010 -0700

    configure.ac: Add -fno-strict-aliasing to CFLAGS
    
    This should address https://bugs.freedesktop.org/show_bug.cgi?id=31238
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/configure.ac b/configure.ac
index 6ced61b..ec7724c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -87,6 +87,12 @@ XORG_PROG_RAWCPP
 # easier overrides at build time.
 XSERVER_CFLAGS='$(CWARNFLAGS)'
 
+dnl Explicitly add -fno-strict-aliasing since this option should disappear
+dnl from util-macros CWARNFLAGS
+if  test "x$GCC" = xyes ; then
+    XSERVER_CFLAGS="$XSERVER_CFLAGS -fno-strict-aliasing"
+fi
+
 dnl Check for dtrace program (needed to build Xserver dtrace probes)
 dnl Also checks for <sys/sdt.h>, since some Linux distros have an 
 dnl ISDN trace program named dtrace
commit 38d55f06cfbf4b05fee0aef8f97f90e835beaacb
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Mon Jun 27 15:06:16 2011 +0100

    Guard use of backtrace() with HAVE_BACKTRACE
    
    Guard the use of backtrace() with HAVE_BACKTRACE, since we already
    have the autoconf machinery for setting that.
    
    For the moment, assume dladdr() is available when backtrace() is
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/glx/glapi_gentable.c b/glx/glapi_gentable.c
index a9ba3af..b49ae20 100644
--- a/glx/glapi_gentable.c
+++ b/glx/glapi_gentable.c
@@ -31,7 +31,10 @@
 #include <dix-config.h>
 #endif
 
+#ifdef HAVE_BACKTRACE
 #include <execinfo.h>
+#endif
+
 #include <dlfcn.h>
 #include <stdlib.h>
 #include <stdio.h>
@@ -46,6 +49,8 @@
 static void
 __glapi_gentable_NoOp(void) {
     const char *fstr = "Unknown";
+
+#ifdef HAVE_BACKTRACE
     void *frames[2];
 
     if(backtrace(frames, 2) == 2) {
@@ -54,6 +59,7 @@ __glapi_gentable_NoOp(void) {
         if(info.dli_sname)
             fstr = info.dli_sname;
     }
+#endif
 
     LogMessage(X_ERROR, "GLX: Call to unimplemented API: %s\n", fstr);
 }
commit bea57392c724f439987832b422941ae897953e4a
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Sat Jun 25 11:29:53 2011 -0700

    XQuartz: Fix Makefile dependencies
    
    automake generates _DEPENDENCIES from _LIBADD, but it strips out variables.
    This resulted in not relinking if some components were rebuilt (like
    libdix, libos, etc).
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/configure.ac b/configure.ac
index 67a7f13..6ced61b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1889,8 +1889,8 @@ if test "x$XQUARTZ" = xyes; then
 	AC_DEFINE(XQUARTZ,1,[Have Quartz])
 	AC_DEFINE(ROOTLESS,1,[Build Rootless code])
 
-	DARWIN_LIBS="$MI_LIB $OS_LIB $DIX_LIB $MAIN_LIB $FB_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $XPSTUBS_LIB"
-	AC_SUBST([DARWIN_LIBS])
+	XQUARTZ_LIBS="$MAIN_LIB $FB_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $XPSTUBS_LIB"
+	AC_SUBST([XQUARTZ_LIBS])
 
 	AC_CHECK_LIB([Xplugin],[xp_init],[:])
 
diff --git a/hw/xquartz/mach-startup/Makefile.am b/hw/xquartz/mach-startup/Makefile.am
index 8e49ea8..0b1f897 100644
--- a/hw/xquartz/mach-startup/Makefile.am
+++ b/hw/xquartz/mach-startup/Makefile.am
@@ -22,7 +22,7 @@ X11_bin_LDADD = \
 	$(top_builddir)/dix/dixfonts.lo \
 	$(top_builddir)/miext/rootless/librootless.la \
 	$(top_builddir)/hw/xquartz/pbproxy/libxpbproxy.la \
-	$(DARWIN_LIBS) $(MAIN_LIB) $(XSERVER_LIBS)
+	$(XQUARTZ_LIBS) $(XSERVER_LIBS)
 
 X11_bin_LDFLAGS =  \
 	$(XSERVER_SYS_LIBS) -lXplugin \
@@ -52,6 +52,8 @@ X11_bin_LDADD += \
 	$(top_builddir)/record/librecord.la
 endif
 
+X11_bin_DEPENDENCIES = $(X11_bin_LDADD)
+
 bin_PROGRAMS = Xquartz
 
 dist_Xquartz_SOURCES = \
commit c8b80a82d97d92d445c1c0af6dba42c9de7c56cd
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Tue Jun 21 21:14:46 2011 -0700

    XQuartz: Make a call to activateIgnoringOtherApps in our NSApplicationActivatedEventType handler
    
    In addition, this change will not call into the X11 activation unless an X11
    window was active when we deactivated.  We can't rely on the event and current
    key windows because the key window will be nil until activated, and the event
    will only reference the window if the window was clicked (whereas it will be
    nil if we activated via dock or cmd-tab).
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m
index 31aa9b9..3973110 100644
--- a/hw/xquartz/X11Application.m
+++ b/hw/xquartz/X11Application.m
@@ -338,18 +338,21 @@ static void message_kit_thread (SEL selector, NSObject *arg) {
             
         case NSAppKitDefined:
             switch ([e subtype]) {
+                static BOOL x_was_active = NO;
+
                 case NSApplicationActivatedEventType:
                     for_x = NO;
-                    if ([self modalWindow] == nil) {
+                    if ([e window] == nil && x_was_active) {
                         BOOL order_all_windows = YES, workspaces, ok;
                         for_appkit = NO;
-                        
-                        /* FIXME: hack to avoid having to pass the event to appkit,
-                         which would cause it to raise one of its windows. */
+
+                        /* FIXME: This is a hack to avoid passing the event to AppKit which
+                         *        would result in it raising one of its windows.
+                         */
                         _appFlags._active = YES;
-                        
-                        [self activateX:YES];
-                        
+
+                        X11ApplicationSetFrontProcess();
+
                         /* Get the Spaces preference for SwitchOnActivate */
                         (void)CFPreferencesAppSynchronize(CFSTR("com.apple.dock"));
                         workspaces = CFPreferencesGetAppBooleanValue(CFSTR("workspaces"), CFSTR("com.apple.dock"), &ok);
@@ -370,8 +373,9 @@ static void message_kit_thread (SEL selector, NSObject *arg) {
                          *       If there are no active windows, and there are minimized windows, we should
                          *       be restoring one of them.
                          */
-                        if ([e data2] & 0x10) // 0x10 is set when we use cmd-tab or the dock icon
+                        if ([e data2] & 0x10) { // 0x10 (bfCPSOrderAllWindowsForward) is set when we use cmd-tab or the dock icon
                             DarwinSendDDXEvent(kXquartzBringAllToFront, 1, order_all_windows);
+                        }
                     }
                     break;
                     
@@ -381,7 +385,10 @@ static void message_kit_thread (SEL selector, NSObject *arg) {
                     
                 case NSApplicationDeactivatedEventType:
                     for_x = NO;
-                    [self activateX:NO];
+
+                    x_was_active = _x_active;
+                    if(_x_active)
+                        [self activateX:NO];
                     break;
             }
             break;
commit 9d568450b1319e9057319ebb37e76003bcba447d
Author: Keith Packard <keithp at keithp.com>
Date:   Tue Jun 28 09:33:25 2011 -0700

    Create sdksyms.dep in the right place at configure time
    
    sdksyms moved from hw/xfree86/loader to hw/xfree86, so the
    configure-time create of sdksyms.dep needs to reflect that
    change. Otherwise, make might be confused by a missing file and (more
    importantly to me) hw/xfree86/loader/sdksyms.dep will be left around
    after 'make clean' causing 'make distcheck' to fail.

diff --git a/configure.ac b/configure.ac
index a53ab50..67a7f13 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2144,7 +2144,7 @@ AC_SUBST([libdir])
 AC_SUBST([exec_prefix])
 AC_SUBST([prefix])
 
-AC_CONFIG_COMMANDS([sdksyms], [touch hw/xfree86/loader/sdksyms.dep])
+AC_CONFIG_COMMANDS([sdksyms], [touch hw/xfree86/sdksyms.dep])
 
 AC_OUTPUT([
 Makefile
commit f968f4ace9410d827fb6b68c4e38ea9516641309
Merge: 4dbed26... 163441f...
Author: Keith Packard <keithp at keithp.com>
Date:   Tue Jun 28 09:10:14 2011 -0700

    Merge remote-tracking branch 'dbn/no-libxorg'

commit 163441fe531a77f7fa54bfa59c5ab49c78f44306
Author: Dan Nicholson <dbn.lists at gmail.com>
Date:   Tue Jun 14 20:03:06 2011 -0700

    xfree86: Remove libxorg convenience library to speed up build
    
    libxorg.la served to collect all the Xorg convenience libraries into one
    massive archive to link into Xorg. This made things easy for symbol
    resolution, but it tremendously slowed down the build since each change
    caused libxorg.la to be rebuilt. This is an extremely slow process of
    extracting all the objects from the sub-libraries and recombining them.
    
    Instead, the archives are linked directly into Xorg. The order of the
    libraries had to be tweaked a bit to make symbols resolve correctly with
    the lower level code moving later in the link command.
    
    As a side effect, since the dtrace objects are now being linked
    directly into Xorg, we don't need the SPECIAL_DTRACE_OBJECTS hack to
    add them twice.
    
    Signed-off-by: Dan Nicholson <dbn.lists at gmail.com>
    Tested-by: Jamey Sharp <jamey at minilop.net>
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>
    Tested-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/hw/xfree86/Makefile.am b/hw/xfree86/Makefile.am
index 6580e8d..e3ef14f 100644
--- a/hw/xfree86/Makefile.am
+++ b/hw/xfree86/Makefile.am
@@ -44,13 +44,12 @@ AM_CFLAGS = $(DIX_CFLAGS) @XORG_CFLAGS@
 INCLUDES = $(XORG_INCS) -I$(srcdir)/parser -I$(top_srcdir)/miext/cw \
 	-I$(srcdir)/ddc -I$(srcdir)/i2c -I$(srcdir)/modes -I$(srcdir)/ramdac
 
-noinst_LTLIBRARIES = libxorg.la
-libxorg_la_SOURCES =
-libxorg_la_LIBADD = \
+LOCAL_LIBS = \
+            $(MAIN_LIB) \
             $(XSERVER_LIBS) \
             loader/libloader.la \
-            os-support/libxorgos.la \
             common/libcommon.la \
+            os-support/libxorgos.la \
             parser/libxf86config_internal.la \
             dixmods/libdixmods.la \
             modes/libxf86modes.la \
@@ -58,14 +57,14 @@ libxorg_la_LIBADD = \
             ddc/libddc.la \
             i2c/libi2c.la \
             dixmods/libxorgxkb.la \
+            $(XORG_LIBS) \
             $(top_builddir)/mi/libmi.la \
-            $(top_builddir)/os/libos.la \
-            @XORG_LIBS@
-
-libxorg_la_DEPENDENCIES = $(libxorg_la_LIBADD)
-
-Xorg_DEPENDENCIES = libxorg.la
-Xorg_LDADD = $(MAIN_LIB) libxorg.la $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS)
+            $(top_builddir)/os/libos.la
+Xorg_LDADD = \
+            $(LOCAL_LIBS) \
+            $(XORG_SYS_LIBS) \
+            $(XSERVER_SYS_LIBS)
+Xorg_DEPENDENCIES = $(LOCAL_LIBS)
 
 Xorg_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG)
 
@@ -73,11 +72,6 @@ BUILT_SOURCES = xorg.conf.example
 DISTCLEANFILES = xorg.conf.example
 EXTRA_DIST = xorgconf.cpp
 
-if SPECIAL_DTRACE_OBJECTS
-# Re-add dtrace object code that gets lost when building static libraries
-Xorg_LDADD += $(XSERVER_LIBS)
-endif
-
 if SOLARIS_ASM_INLINE
 # Needs to be built before any files are compiled when using Sun compilers
 # so in*/out* inline definitions are properly processed.
diff --git a/test/Makefile.am b/test/Makefile.am
index 04c255b..370e09a 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -37,7 +37,6 @@ libxservertest_la_LIBADD = \
             $(top_builddir)/hw/xfree86/ddc/libddc.la \
             $(top_builddir)/hw/xfree86/i2c/libi2c.la \
             $(top_builddir)/hw/xfree86/dixmods/libxorgxkb.la \
-            $(top_builddir)/hw/xfree86/libxorg.la \
             $(top_builddir)/mi/libmi.la \
             $(top_builddir)/os/libos.la \
             @XORG_LIBS@
commit 6259b30111f568ec3d1b32dc6382bce46d8e6ccc
Author: Dan Nicholson <dbn.lists at gmail.com>
Date:   Tue Jun 14 19:47:02 2011 -0700

    xfree86: Move sdksyms generation to ddx toplevel
    
    The symbols in sdksyms.c cover the entire source tree. In order to make
    them resolve when libxorg.la goes away, move the objects from libloader
    to Xorg. Unfortunately, this means sdksyms needs to get built again for
    the test code.
    
    Signed-off-by: Dan Nicholson <dbn.lists at gmail.com>
    Tested-by: Jamey Sharp <jamey at minilop.net>
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>
    Tested-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/hw/xfree86/.gitignore b/hw/xfree86/.gitignore
index f9b3f4a..997a94e 100644
--- a/hw/xfree86/.gitignore
+++ b/hw/xfree86/.gitignore
@@ -1,2 +1,4 @@
 Xorg
 xorg.conf.example
+sdksyms.c
+sdksyms.dep
diff --git a/hw/xfree86/Makefile.am b/hw/xfree86/Makefile.am
index 697571e..6580e8d 100644
--- a/hw/xfree86/Makefile.am
+++ b/hw/xfree86/Makefile.am
@@ -38,10 +38,11 @@ DIST_SUBDIRS = common ddc i2c x86emu int10 fbdevhw os-support \
 	       utils doc man
 
 bin_PROGRAMS = Xorg
-Xorg_SOURCES =
+nodist_Xorg_SOURCES = sdksyms.c
 
 AM_CFLAGS = $(DIX_CFLAGS) @XORG_CFLAGS@
-INCLUDES = @XORG_INCS@ 
+INCLUDES = $(XORG_INCS) -I$(srcdir)/parser -I$(top_srcdir)/miext/cw \
+	-I$(srcdir)/ddc -I$(srcdir)/i2c -I$(srcdir)/modes -I$(srcdir)/ramdac
 
 noinst_LTLIBRARIES = libxorg.la
 libxorg_la_SOURCES =
@@ -111,3 +112,12 @@ xorg.conf.example: xorgconf.cpp
 
 relink:
 	$(AM_V_at)rm -f Xorg && $(MAKE) Xorg
+
+CLEANFILES = sdksyms.c sdksyms.dep
+EXTRA_DIST += sdksyms.sh
+
+sdksyms.dep sdksyms.c: sdksyms.sh
+	CPP='$(CPP)' AWK='$(AWK)' $(srcdir)/sdksyms.sh $(top_srcdir) $(CFLAGS) $(AM_CFLAGS) $(INCLUDES)
+
+SDKSYMS_DEP = sdksyms.dep
+include $(SDKSYMS_DEP)
diff --git a/hw/xfree86/loader/.gitignore b/hw/xfree86/loader/.gitignore
deleted file mode 100644
index 6b38d9e..0000000
--- a/hw/xfree86/loader/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-#		Add & Override for this directory and it's subdirectories
-sdksyms.c
-sdksyms.dep
diff --git a/hw/xfree86/loader/Makefile.am b/hw/xfree86/loader/Makefile.am
index 0e5b304..ebe0c81 100644
--- a/hw/xfree86/loader/Makefile.am
+++ b/hw/xfree86/loader/Makefile.am
@@ -9,11 +9,7 @@ AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS)
 
 EXTRA_DIST = \
 	loader.h \
-	loaderProcs.h \
-	sdksyms.sh
-
-nodist_libloader_la_SOURCES = \
-	sdksyms.c
+	loaderProcs.h
 
 libloader_la_SOURCES = \
 	loader.c \
@@ -23,11 +19,3 @@ libloader_la_SOURCES = \
 	os.c
 
 libloader_la_LIBADD = $(DLOPEN_LIBS)
-
-CLEANFILES = sdksyms.c sdksyms.dep
-
-sdksyms.dep sdksyms.c: sdksyms.sh $(top_builddir)/include/do-not-use-config.h
-	CPP='$(CPP)' AWK='$(AWK)' $(srcdir)/sdksyms.sh $(top_srcdir) $(AM_CFLAGS) $(CFLAGS) $(INCLUDES)
-
-SDKSYMS_DEP = sdksyms.dep
-include $(SDKSYMS_DEP)
diff --git a/hw/xfree86/loader/sdksyms.sh b/hw/xfree86/loader/sdksyms.sh
deleted file mode 100755
index 18bb735..0000000
--- a/hw/xfree86/loader/sdksyms.sh
+++ /dev/null
@@ -1,425 +0,0 @@
-#!/bin/sh
-
-cat > sdksyms.c << EOF
-/* This file is automatically generated by sdksyms.sh. */
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-
-/* These must be included first */
-#include "misc.h"
-#include "miscstruct.h"
-
-
-/* render/Makefile.am */
-#include "picture.h"
-#include "mipict.h"
-#include "glyphstr.h"
-#include "picturestr.h"
-
-
-/* fb/Makefile.am -- module */
-/*
-#include "fb.h"
-#include "fbrop.h"
-#include "fboverlay.h"
-#include "wfbrename.h"
-#include "fbpict.h"
- */
-
-
-/* miext/shadow/Makefile.am -- module */
-/*
-#include "shadow.h"
- */
-
-
-/* miext/damage/Makefile.am */
-#include "damage.h"
-#include "damagestr.h"
-
-/* miext/sync/Makefile.am */
-#include "misync.h"
-#include "misyncstr.h"
-
-/* Xext/Makefile.am -- half is module, half is builtin */
-/*
-#include "xvdix.h"
-#include "xvmcext.h"
- */
-#include "geext.h"
-#include "geint.h"
-#include "shmint.h"
-#include "syncsdk.h"
-#if XINERAMA
-# include "panoramiXsrv.h"
-# include "panoramiX.h"
-#endif
-
-
-/* hw/xfree86/int10/Makefile.am -- module */
-/*
-#include "xf86int10.h"
- */
-
-
-/* hw/xfree86/i2c/Makefile.am -- "mostly" modules */
-#include "xf86i2c.h"
-/*
-#include "bt829.h"
-#include "fi1236.h"
-#include "msp3430.h"
-#include "tda8425.h"
-#include "tda9850.h"
-#include "tda9885.h"
-#include "uda1380.h"
-#include "i2c_def.h"
- */
-
-
-/* hw/xfree86/modes/Makefile.am */
-#include "xf86Crtc.h"
-#include "xf86Modes.h"
-#include "xf86RandR12.h"
-/* #include "xf86Rename.h" */
-
-
-/* hw/xfree86/ddc/Makefile.am */
-#include "edid.h"
-#include "xf86DDC.h"
-
-
-/* hw/xfree86/dri2/Makefile.am -- module */
-/*
-#if DRI2
-# include "dri2.h"
-#endif
- */
-
-
-/* hw/xfree86/vgahw/Makefile.am -- module */
-/*
-#include "vgaHW.h"
- */
-
-
-/* hw/xfree86/fbdevhw/Makefile.am -- module */
-/*
-#include "fbdevhw.h"
- */
-
-
-/* hw/xfree86/common/Makefile.am */
-#include "compiler.h"
-#include "fourcc.h"
-#include "xf86.h"
-#include "xf86Module.h"
-#include "xf86Opt.h"
-#include "xf86PciInfo.h"
-#include "xf86Priv.h"
-#include "xf86Privstr.h"
-#include "xf86cmap.h"
-#include "xf86fbman.h"
-#include "xf86str.h"
-#include "xf86Xinput.h"
-#include "xf86VGAarbiter.h"
-#include "xisb.h"
-#if XV
-# include "xf86xv.h"
-# include "xf86xvmc.h"
-# include "xf86xvpriv.h"
-#endif
-/* XF86VidMode code is in libextmod module */
-/*
-#if XF86VIDMODE
-# include "vidmodeproc.h"
-#endif
- */
-#include "xorgVersion.h"
-#if defined(__sparc__) || defined(__sparc)
-# include "xf86sbusBus.h"
-#endif
-
-
-/* hw/xfree86/ramdac/Makefile.am */
-#include "BT.h"
-#include "IBM.h"
-#include "TI.h"
-#include "xf86Cursor.h"
-#include "xf86RamDac.h"
-
-
-/* hw/xfree86/shadowfb/Makefile.am -- module */
-/*
-#include "shadowfb.h"
- */
-
-
-/* hw/xfree86/os-support/solaris/Makefile.am */
-#if defined(sun386)
-# include "agpgart.h"
-#endif
-
-
-/* hw/xfree86/os-support/Makefile.am */
-#include "xf86_OSproc.h"
-#include "xf86_OSlib.h"
-
-
-/* hw/xfree86/os-support/bus/Makefile.am */
-#include "xf86Pci.h"
-#if defined(__sparc__) || defined(__sparc)
-# include "xf86Sbus.h"
-#endif
-
-
-/* hw/xfree86/xaa/Makefile.am -- module */
-/*
-#include "xaa.h"
-#include "xaalocal.h"
-#include "xaarop.h"
- */
-
-
-/* hw/xfree86/dixmods/extmod/Makefile.am -- module */
-/*
-#include "dgaproc.h"
- */
-
-
-/* hw/xfree86/parser/Makefile.am */
-#include "xf86Parser.h"
-#include "xf86Optrec.h"
-
-
-/* hw/xfree86/vbe/Makefile.am -- module */
-/*
-#include "vbe.h"
-#include "vbeModes.h"
- */
-
-
-/* hw/xfree86/dri/Makefile.am -- module */
-/*
-#if XF86DRI
-# include "dri.h"
-# include "sarea.h"
-# include "dristruct.h"
-#endif
- */
-
-
-/* mi/Makefile.am */
-#include "micmap.h"
-#include "miline.h"
-#include "mipointer.h"
-#include "mi.h"
-#include "mibstore.h"
-#include "migc.h"
-#include "mipointrst.h"
-#include "mizerarc.h"
-#include "micoord.h"
-#include "mifillarc.h"
-#include "mispans.h"
-#include "miwideline.h"
-#include "mistruct.h"
-#include "mifpoly.h"
-#include "mioverlay.h"
-
-
-/* randr/Makefile.am */
-#include "randrstr.h"
-#include "rrtransform.h"
-
-
-/* dbe/Makefile.am -- module */
-/*
-#include "dbestruct.h"
- */
-
-
-/* exa/Makefile.am -- module */
-/*
-#include "exa.h"
- */
-
-
-/* xfixes/Makefile.am */
-#include "xfixes.h"
-
-
-/* include/Makefile.am */
-#include "XIstubs.h"
-#include "Xprintf.h"
-#include "closestr.h"
-#include "closure.h"
-#include "colormap.h"
-#include "colormapst.h"
-#include "hotplug.h"
-#include "client.h"
-#include "cursor.h"
-#include "cursorstr.h"
-#include "dix.h"
-#include "dixaccess.h"
-#include "dixevents.h"
-#include "dixfont.h"
-#include "dixfontstr.h"
-#include "dixgrabs.h"
-#include "dixstruct.h"
-#include "exevents.h"
-#include "extension.h"
-#include "extinit.h"
-#include "extnsionst.h"
-#include "gc.h"
-#include "gcstruct.h"
-#include "globals.h"
-#include "input.h"
-#include "inputstr.h"
-/* already included */
-/*
-#include "misc.h"
-#include "miscstruct.h"
- */
-#include "opaque.h"
-#include "os.h"
-#include "pixmap.h"
-#include "pixmapstr.h"
-#include "privates.h"
-#include "property.h"
-#include "propertyst.h"
-#include "ptrveloc.h"
-#include "region.h"
-#include "regionstr.h"
-#include "registry.h"
-#include "resource.h"
-#include "rgb.h"
-#include "screenint.h"
-#include "scrnintstr.h"
-#include "selection.h"
-#include "servermd.h"
-#include "site.h"
-#include "swaprep.h"
-#include "swapreq.h"
-#include "validate.h"
-#include "window.h"
-#include "windowstr.h"
-#include "xace.h"
-#include "xkbfile.h"
-#include "xkbsrv.h"
-#include "xkbstr.h"
-#include "xkbrules.h"
-#include "xserver-properties.h"
-
-EOF
-
-topdir=$1
-shift
-LC_ALL=C
-export LC_ALL
-${CPP:-cpp} "$@" -DXorgLoader sdksyms.c | ${AWK:-awk} -v topdir=$topdir '
-BEGIN {
-    sdk = 0;
-    print("/*");
-    print(" * These symbols are referenced to ensure they");
-    print(" * will be available in the X Server binary.");
-    print(" */");
-    printf("/* topdir=%s */\n", topdir);
-    print("_X_HIDDEN void *xorg_symbols[] = {");
-
-    printf("sdksyms.c:") > "sdksyms.dep";
-}
-/^# [0-9]+ "/ {
-    #   Process text after a include in a relative path or when the
-    # processed file has a basename matching $top_srcdir.
-    #   Note that indexing starts at 1; 0 means no match, and there
-    # is a starting ".
-    sdk = $3 !~ /^"\// || index($3, topdir) == 2;
-
-    if (sdk && $3 ~ /\.h"$/) {
-	# remove quotes
-	gsub(/"/, "", $3);
-	line = $2;
-	header = $3;
-	if (! headers[$3]) {
-	    printf(" \\\n  %s", $3) >> "sdksyms.dep";
-	    headers[$3] = 1;
-	}
-    }
-    next;
-}
-
-/^extern[ 	]/  {
-    if (sdk) {
-	n = 3;
-
-	# skip attribute, if any
-	while ($n ~ /^(__attribute__|__global)/ ||
-	    # skip modifiers, if any
-	    $n ~ /^\*?(unsigned|const|volatile|struct)$/ ||
-	    # skip pointer
-	    $n ~ /^[a-zA-Z0-9_]*\*$/)
-	    n++;
-
-	# type specifier may not be set, as in
-	#   extern _X_EXPORT unsigned name(...)
-	if ($n !~ /[^a-zA-Z0-9_]/)
-	    n++;
-
-	# go back if we are at the parameter list already
-	if ($n ~ /^[(]([^*].*)?$/)
-	    n--;
-
-	# match
-	#    extern _X_EXPORT type (* name[])(...)
-	if ($n ~ /^[^a-zA-Z0-9_]+$/)
-	    n++;
-
-	# match
-	#	extern _X_EXPORT const name *const ...
-	if ($n ~ /^([^a-zA-Z0-9_]+)?const$/)
-	    n++;
-
-	# actual name may be in the next line, as in
-	#   extern _X_EXPORT type
-	# possibly ending with a *
-	#   name(...)
-	if ($n == "" || $n ~ /^\*+$/) {
-	    getline;
-	    n = 1;
-	}
-
-	# dont modify $0 or $n
-	symbol = $n;
-
-	# remove starting non word chars
-	sub(/^[^a-zA-Z0-9_]+/, "",symbol);
-
-	# remove from first non word to end of line
-	sub(/[^a-zA-Z0-9_].*/, "", symbol);
-
-	#print;
-	printf("    (void *) &%-50s /* %s:%s */\n", symbol ",", header, line);
-    }
-}
-
-{
-    line++;
-}
-
-END {
-    print("};");
-
-    print("") >> "sdksyms.dep";
-}' > _sdksyms.c
-
-STATUS=$?
-
-cat _sdksyms.c >> sdksyms.c
-rm _sdksyms.c
-
-[ $? != 0 ] && exit $?
-
-exit $STATUS
diff --git a/hw/xfree86/sdksyms.sh b/hw/xfree86/sdksyms.sh
new file mode 100755
index 0000000..18bb735
--- /dev/null
+++ b/hw/xfree86/sdksyms.sh
@@ -0,0 +1,425 @@
+#!/bin/sh
+
+cat > sdksyms.c << EOF
+/* This file is automatically generated by sdksyms.sh. */
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+
+/* These must be included first */
+#include "misc.h"
+#include "miscstruct.h"
+
+
+/* render/Makefile.am */
+#include "picture.h"
+#include "mipict.h"
+#include "glyphstr.h"
+#include "picturestr.h"
+
+
+/* fb/Makefile.am -- module */
+/*
+#include "fb.h"
+#include "fbrop.h"
+#include "fboverlay.h"
+#include "wfbrename.h"
+#include "fbpict.h"
+ */
+
+
+/* miext/shadow/Makefile.am -- module */
+/*
+#include "shadow.h"
+ */
+
+
+/* miext/damage/Makefile.am */
+#include "damage.h"
+#include "damagestr.h"
+
+/* miext/sync/Makefile.am */
+#include "misync.h"
+#include "misyncstr.h"
+
+/* Xext/Makefile.am -- half is module, half is builtin */
+/*
+#include "xvdix.h"
+#include "xvmcext.h"
+ */
+#include "geext.h"
+#include "geint.h"
+#include "shmint.h"
+#include "syncsdk.h"
+#if XINERAMA
+# include "panoramiXsrv.h"
+# include "panoramiX.h"
+#endif
+
+
+/* hw/xfree86/int10/Makefile.am -- module */
+/*
+#include "xf86int10.h"
+ */
+
+
+/* hw/xfree86/i2c/Makefile.am -- "mostly" modules */
+#include "xf86i2c.h"
+/*
+#include "bt829.h"
+#include "fi1236.h"
+#include "msp3430.h"
+#include "tda8425.h"
+#include "tda9850.h"
+#include "tda9885.h"
+#include "uda1380.h"
+#include "i2c_def.h"
+ */
+
+
+/* hw/xfree86/modes/Makefile.am */
+#include "xf86Crtc.h"
+#include "xf86Modes.h"
+#include "xf86RandR12.h"
+/* #include "xf86Rename.h" */
+
+
+/* hw/xfree86/ddc/Makefile.am */
+#include "edid.h"
+#include "xf86DDC.h"
+
+
+/* hw/xfree86/dri2/Makefile.am -- module */
+/*
+#if DRI2
+# include "dri2.h"
+#endif
+ */
+
+
+/* hw/xfree86/vgahw/Makefile.am -- module */
+/*
+#include "vgaHW.h"
+ */
+
+
+/* hw/xfree86/fbdevhw/Makefile.am -- module */
+/*
+#include "fbdevhw.h"
+ */
+
+
+/* hw/xfree86/common/Makefile.am */
+#include "compiler.h"
+#include "fourcc.h"
+#include "xf86.h"
+#include "xf86Module.h"
+#include "xf86Opt.h"
+#include "xf86PciInfo.h"
+#include "xf86Priv.h"
+#include "xf86Privstr.h"
+#include "xf86cmap.h"
+#include "xf86fbman.h"
+#include "xf86str.h"
+#include "xf86Xinput.h"
+#include "xf86VGAarbiter.h"
+#include "xisb.h"
+#if XV
+# include "xf86xv.h"
+# include "xf86xvmc.h"
+# include "xf86xvpriv.h"
+#endif
+/* XF86VidMode code is in libextmod module */
+/*
+#if XF86VIDMODE
+# include "vidmodeproc.h"
+#endif
+ */
+#include "xorgVersion.h"
+#if defined(__sparc__) || defined(__sparc)
+# include "xf86sbusBus.h"
+#endif
+
+
+/* hw/xfree86/ramdac/Makefile.am */
+#include "BT.h"
+#include "IBM.h"
+#include "TI.h"
+#include "xf86Cursor.h"
+#include "xf86RamDac.h"
+
+
+/* hw/xfree86/shadowfb/Makefile.am -- module */
+/*
+#include "shadowfb.h"
+ */
+
+
+/* hw/xfree86/os-support/solaris/Makefile.am */
+#if defined(sun386)
+# include "agpgart.h"
+#endif
+
+
+/* hw/xfree86/os-support/Makefile.am */
+#include "xf86_OSproc.h"
+#include "xf86_OSlib.h"
+
+
+/* hw/xfree86/os-support/bus/Makefile.am */
+#include "xf86Pci.h"
+#if defined(__sparc__) || defined(__sparc)
+# include "xf86Sbus.h"
+#endif
+
+
+/* hw/xfree86/xaa/Makefile.am -- module */
+/*
+#include "xaa.h"
+#include "xaalocal.h"
+#include "xaarop.h"
+ */
+
+
+/* hw/xfree86/dixmods/extmod/Makefile.am -- module */
+/*
+#include "dgaproc.h"
+ */
+
+
+/* hw/xfree86/parser/Makefile.am */
+#include "xf86Parser.h"
+#include "xf86Optrec.h"
+
+
+/* hw/xfree86/vbe/Makefile.am -- module */
+/*
+#include "vbe.h"
+#include "vbeModes.h"
+ */
+
+
+/* hw/xfree86/dri/Makefile.am -- module */
+/*
+#if XF86DRI
+# include "dri.h"
+# include "sarea.h"
+# include "dristruct.h"
+#endif
+ */
+
+
+/* mi/Makefile.am */
+#include "micmap.h"
+#include "miline.h"
+#include "mipointer.h"
+#include "mi.h"
+#include "mibstore.h"
+#include "migc.h"
+#include "mipointrst.h"
+#include "mizerarc.h"
+#include "micoord.h"
+#include "mifillarc.h"
+#include "mispans.h"
+#include "miwideline.h"
+#include "mistruct.h"
+#include "mifpoly.h"
+#include "mioverlay.h"
+
+
+/* randr/Makefile.am */
+#include "randrstr.h"
+#include "rrtransform.h"
+
+
+/* dbe/Makefile.am -- module */
+/*
+#include "dbestruct.h"
+ */
+
+
+/* exa/Makefile.am -- module */
+/*
+#include "exa.h"
+ */
+
+
+/* xfixes/Makefile.am */
+#include "xfixes.h"
+
+
+/* include/Makefile.am */
+#include "XIstubs.h"
+#include "Xprintf.h"
+#include "closestr.h"
+#include "closure.h"
+#include "colormap.h"
+#include "colormapst.h"
+#include "hotplug.h"
+#include "client.h"
+#include "cursor.h"
+#include "cursorstr.h"
+#include "dix.h"
+#include "dixaccess.h"
+#include "dixevents.h"
+#include "dixfont.h"
+#include "dixfontstr.h"
+#include "dixgrabs.h"
+#include "dixstruct.h"
+#include "exevents.h"
+#include "extension.h"
+#include "extinit.h"
+#include "extnsionst.h"
+#include "gc.h"
+#include "gcstruct.h"
+#include "globals.h"
+#include "input.h"
+#include "inputstr.h"
+/* already included */
+/*
+#include "misc.h"
+#include "miscstruct.h"
+ */
+#include "opaque.h"
+#include "os.h"
+#include "pixmap.h"
+#include "pixmapstr.h"
+#include "privates.h"
+#include "property.h"
+#include "propertyst.h"
+#include "ptrveloc.h"
+#include "region.h"
+#include "regionstr.h"
+#include "registry.h"
+#include "resource.h"
+#include "rgb.h"
+#include "screenint.h"
+#include "scrnintstr.h"
+#include "selection.h"
+#include "servermd.h"
+#include "site.h"
+#include "swaprep.h"
+#include "swapreq.h"
+#include "validate.h"
+#include "window.h"
+#include "windowstr.h"
+#include "xace.h"
+#include "xkbfile.h"
+#include "xkbsrv.h"
+#include "xkbstr.h"
+#include "xkbrules.h"
+#include "xserver-properties.h"
+
+EOF
+
+topdir=$1
+shift
+LC_ALL=C
+export LC_ALL
+${CPP:-cpp} "$@" -DXorgLoader sdksyms.c | ${AWK:-awk} -v topdir=$topdir '
+BEGIN {
+    sdk = 0;
+    print("/*");
+    print(" * These symbols are referenced to ensure they");
+    print(" * will be available in the X Server binary.");
+    print(" */");
+    printf("/* topdir=%s */\n", topdir);
+    print("_X_HIDDEN void *xorg_symbols[] = {");
+
+    printf("sdksyms.c:") > "sdksyms.dep";
+}
+/^# [0-9]+ "/ {
+    #   Process text after a include in a relative path or when the
+    # processed file has a basename matching $top_srcdir.
+    #   Note that indexing starts at 1; 0 means no match, and there
+    # is a starting ".
+    sdk = $3 !~ /^"\// || index($3, topdir) == 2;
+
+    if (sdk && $3 ~ /\.h"$/) {
+	# remove quotes
+	gsub(/"/, "", $3);
+	line = $2;
+	header = $3;
+	if (! headers[$3]) {
+	    printf(" \\\n  %s", $3) >> "sdksyms.dep";
+	    headers[$3] = 1;
+	}
+    }
+    next;
+}
+
+/^extern[ 	]/  {
+    if (sdk) {
+	n = 3;
+
+	# skip attribute, if any
+	while ($n ~ /^(__attribute__|__global)/ ||
+	    # skip modifiers, if any
+	    $n ~ /^\*?(unsigned|const|volatile|struct)$/ ||
+	    # skip pointer
+	    $n ~ /^[a-zA-Z0-9_]*\*$/)
+	    n++;
+
+	# type specifier may not be set, as in
+	#   extern _X_EXPORT unsigned name(...)
+	if ($n !~ /[^a-zA-Z0-9_]/)
+	    n++;
+
+	# go back if we are at the parameter list already
+	if ($n ~ /^[(]([^*].*)?$/)
+	    n--;
+
+	# match
+	#    extern _X_EXPORT type (* name[])(...)
+	if ($n ~ /^[^a-zA-Z0-9_]+$/)
+	    n++;
+
+	# match
+	#	extern _X_EXPORT const name *const ...
+	if ($n ~ /^([^a-zA-Z0-9_]+)?const$/)
+	    n++;
+
+	# actual name may be in the next line, as in
+	#   extern _X_EXPORT type
+	# possibly ending with a *
+	#   name(...)
+	if ($n == "" || $n ~ /^\*+$/) {
+	    getline;
+	    n = 1;
+	}
+
+	# dont modify $0 or $n
+	symbol = $n;
+
+	# remove starting non word chars
+	sub(/^[^a-zA-Z0-9_]+/, "",symbol);
+
+	# remove from first non word to end of line
+	sub(/[^a-zA-Z0-9_].*/, "", symbol);
+
+	#print;
+	printf("    (void *) &%-50s /* %s:%s */\n", symbol ",", header, line);
+    }
+}
+
+{
+    line++;
+}
+
+END {
+    print("};");
+
+    print("") >> "sdksyms.dep";
+}' > _sdksyms.c
+
+STATUS=$?
+
+cat _sdksyms.c >> sdksyms.c
+rm _sdksyms.c
+
+[ $? != 0 ] && exit $?
+
+exit $STATUS
diff --git a/test/Makefile.am b/test/Makefile.am
index 29e483a..04c255b 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -7,7 +7,10 @@ check_LTLIBRARIES = libxservertest.la
 TESTS=$(noinst_PROGRAMS)
 
 AM_CFLAGS = $(DIX_CFLAGS) @XORG_CFLAGS@
-INCLUDES = @XORG_INCS@
+INCLUDES = $(XORG_INCS) -I$(top_srcdir)/hw/xfree86/parser \
+	-I$(top_srcdir)/miext/cw -I$(top_srcdir)/hw/xfree86/ddc \
+	-I$(top_srcdir)/hw/xfree86/i2c -I$(top_srcdir)/hw/xfree86/modes \
+	-I$(top_srcdir)/hw/xfree86/ramdac
 TEST_LDADD=libxservertest.la $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS)
 
 if SPECIAL_DTRACE_OBJECTS
@@ -21,7 +24,7 @@ list_LDADD=$(TEST_LDADD)
 misc_LDADD=$(TEST_LDADD)
 fixes_LDADD=$(TEST_LDADD)
 
-libxservertest_la_SOURCES =
+nodist_libxservertest_la_SOURCES = $(top_builddir)/hw/xfree86/sdksyms.c
 libxservertest_la_LIBADD = \
             $(XSERVER_LIBS) \
             $(top_builddir)/hw/xfree86/loader/libloader.la \
commit 7d5c8a12cbc295b3e33e1b60bd7330e2bc93a966
Author: Dan Nicholson <dbn.lists at gmail.com>
Date:   Tue Jun 14 17:21:48 2011 -0700

    Don't use empty source files
    
    When an empty _SOURCES variable is declared, automake will recognize that
    only linking is needed.
    
    Signed-off-by: Dan Nicholson <dbn.lists at gmail.com>
    Tested-by: Jamey Sharp <jamey at minilop.net>
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>
    Tested-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/dix/.gitignore b/dix/.gitignore
index 63ee767..c1b4f20 100644
--- a/dix/.gitignore
+++ b/dix/.gitignore
@@ -1,3 +1,2 @@
 #		Add & Override for this directory and it's subdirectories
-dix.c
 Xserver-dtrace.h
diff --git a/dix/Makefile.am b/dix/Makefile.am
index 5435546..f5af619 100644
--- a/dix/Makefile.am
+++ b/dix/Makefile.am
@@ -64,11 +64,9 @@ dtrace-dix.o: $(top_srcdir)/dix/Xserver.d $(am_libdix_la_OBJECTS)
 
 noinst_PROGRAMS = dix.O
 
+dix_O_SOURCES =
 dix.O: dtrace-dix.o $(am_libdix_la_OBJECTS)
 	$(AM_V_GEN)ld -r -o $@ $(am_libdix_la_OBJECTS:%.lo=.libs/%.o)
 endif
 
-dix.c:
-	touch $@
-
-CLEANFILES = dix.c Xserver-dtrace.h
+CLEANFILES = Xserver-dtrace.h
diff --git a/hw/xfree86/.gitignore b/hw/xfree86/.gitignore
index 2ddca49..f9b3f4a 100644
--- a/hw/xfree86/.gitignore
+++ b/hw/xfree86/.gitignore
@@ -1,4 +1,2 @@
-libxorg.c
 Xorg
-xorg.c
 xorg.conf.example
diff --git a/hw/xfree86/Makefile.am b/hw/xfree86/Makefile.am
index f1a759a..697571e 100644
--- a/hw/xfree86/Makefile.am
+++ b/hw/xfree86/Makefile.am
@@ -38,13 +38,13 @@ DIST_SUBDIRS = common ddc i2c x86emu int10 fbdevhw os-support \
 	       utils doc man
 
 bin_PROGRAMS = Xorg
-Xorg_SOURCES = xorg.c
+Xorg_SOURCES =
 
 AM_CFLAGS = $(DIX_CFLAGS) @XORG_CFLAGS@
 INCLUDES = @XORG_INCS@ 
 
 noinst_LTLIBRARIES = libxorg.la
-libxorg_la_SOURCES = libxorg.c
+libxorg_la_SOURCES =
 libxorg_la_LIBADD = \
             $(XSERVER_LIBS) \
             loader/libloader.la \
@@ -63,18 +63,13 @@ libxorg_la_LIBADD = \
 
 libxorg_la_DEPENDENCIES = $(libxorg_la_LIBADD)
 
-libxorg.c xorg.c:
-	touch $@
-
-DISTCLEANFILES = libxorg.c xorg.c
-
 Xorg_DEPENDENCIES = libxorg.la
 Xorg_LDADD = $(MAIN_LIB) libxorg.la $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS)
 
 Xorg_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG)
 
 BUILT_SOURCES = xorg.conf.example
-DISTCLEANFILES += xorg.conf.example
+DISTCLEANFILES = xorg.conf.example
 EXTRA_DIST = xorgconf.cpp
 
 if SPECIAL_DTRACE_OBJECTS
diff --git a/hw/xfree86/os-support/.gitignore b/hw/xfree86/os-support/.gitignore
deleted file mode 100644
index f2206cd..0000000
--- a/hw/xfree86/os-support/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-#		Add & Override for this directory and it's subdirectories
-xorgos.c
diff --git a/hw/xfree86/os-support/Makefile.am b/hw/xfree86/os-support/Makefile.am
index 3af4328..348b7ff 100644
--- a/hw/xfree86/os-support/Makefile.am
+++ b/hw/xfree86/os-support/Makefile.am
@@ -9,18 +9,13 @@ EXTRA_DIST = int10Defines.h xf86OSpriv.h
 # as one library, otherwise libtool will actively defeat your attempts to
 # list them multiple times on the link line.
 noinst_LTLIBRARIES = libxorgos.la
-libxorgos_la_SOURCES = xorgos.c
+libxorgos_la_SOURCES =
 libxorgos_la_LIBADD = @XORG_OS_SUBDIR@/lib at XORG_OS_SUBDIR@.la \
                       bus/libbus.la \
                       misc/libmisc.la
 
 AM_CFLAGS = $(DIX_CFLAGS) 
 
-xorgos.c:
-	touch $@
-
-DISTCLEANFILES = xorgos.c
-
 # FIXME: These don't seem to be used anywhere
 EXTRA_DIST += \
 	shared/bios_devmem.c
diff --git a/os/.gitignore b/os/.gitignore
deleted file mode 100644
index 74b1d14..0000000
--- a/os/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-#		Add & Override for this directory and it's subdirectories
-os.c
diff --git a/os/Makefile.am b/os/Makefile.am
index 91ca110..ef9ecdd 100644
--- a/os/Makefile.am
+++ b/os/Makefile.am
@@ -51,11 +51,7 @@ dtrace.o: $(top_srcdir)/dix/Xserver.d $(am_libos_la_OBJECTS)
 
 noinst_PROGRAMS = os.O
 
+os_O_SOURCES =
 os.O: dtrace.o $(am_libos_la_OBJECTS)
 	$(AM_V_GEN)ld -r -o $@ dtrace.o .libs/*.o
 endif
-
-os.c:
-	touch $@
-
-CLEANFILES = os.c
diff --git a/test/.gitignore b/test/.gitignore
index 48e8abe..0e1ed42 100644
--- a/test/.gitignore
+++ b/test/.gitignore
@@ -1,4 +1,3 @@
-libxservertest.c
 xkb
 input
 xtest
diff --git a/test/Makefile.am b/test/Makefile.am
index 5574e7d..29e483a 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -21,6 +21,7 @@ list_LDADD=$(TEST_LDADD)
 misc_LDADD=$(TEST_LDADD)
 fixes_LDADD=$(TEST_LDADD)
 
+libxservertest_la_SOURCES =
 libxservertest_la_LIBADD = \
             $(XSERVER_LIBS) \
             $(top_builddir)/hw/xfree86/loader/libloader.la \
@@ -39,8 +40,3 @@ libxservertest_la_LIBADD = \
             @XORG_LIBS@
 endif
 endif
-
-CLEANFILES=libxservertest.c
-
-libxservertest.c:
-	touch $@


More information about the Xquartz-changes mailing list