[PATCH] Filter out -l parameters when setting dependencies

Gustavo Noronha Silva gustavo.noronha at collabora.com
Wed May 8 15:57:42 PDT 2013


Newer make (Fedora 19) gets confused when it finds a -l parameter in a
dependency, and tries to make it as a target, causing the build to fail.

Signed-off-by: Gustavo Noronha Silva <gustavo.noronha at collabora.com>
---
 configure.ac                        |   2 +-
 fb/fb.h                             |   3 +
 fb/fbpict.c                         | 149 +++++++++++++++++++++++++++++++++++-
 fb/fbscreen.c                       |   1 +
 hw/dmx/Makefile.am                  |   2 +-
 hw/vfb/Makefile.am                  |   2 +-
 hw/xfree86/Makefile.am              |   2 +-
 hw/xnest/Makefile.am                |   2 +-
 hw/xquartz/mach-startup/Makefile.am |  11 +--
 hw/xwin/Makefile.am                 |   2 +-
 test/Makefile.am                    |   2 +-
 11 files changed, 165 insertions(+), 13 deletions(-)

diff --git a/configure.ac b/configure.ac
index 5f8dd56..89a7a9d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -818,7 +818,7 @@ LIBPCIACCESS="pciaccess >= 0.12.901"
 LIBUDEV="libudev >= 143"
 LIBSELINUX="libselinux >= 2.0.86"
 LIBDBUS="dbus-1 >= 1.0"
-LIBPIXMAN="pixman-1 >= 0.21.8"
+LIBPIXMAN="pixman-1 >= 0.27.2"
 
 dnl Pixman is always required, but we separate it out so we can link
 dnl specific modules against it
diff --git a/fb/fb.h b/fb/fb.h
index 75596c5..b869d12 100644
--- a/fb/fb.h
+++ b/fb/fb.h
@@ -1344,6 +1344,9 @@ extern _X_EXPORT void
 extern _X_EXPORT Bool
  fbPictureInit(ScreenPtr pScreen, PictFormatPtr formats, int nformats);
 
+extern _X_EXPORT void
+fbDestroyGlyphCache(void);
+
 /*
  * fbpixmap.c
  */
diff --git a/fb/fbpict.c b/fb/fbpict.c
index 097a1a6..b503858 100644
--- a/fb/fbpict.c
+++ b/fb/fbpict.c
@@ -70,6 +70,152 @@ fbComposite(CARD8 op,
     free_pixman_pict(pDst, dest);
 }
 
+static pixman_glyph_cache_t *glyphCache;
+
+void
+fbDestroyGlyphCache(void)
+{
+    if (glyphCache)
+    {
+	pixman_glyph_cache_destroy (glyphCache);
+	glyphCache = NULL;
+    }
+}
+
+static void
+fbUnrealizeGlyph(ScreenPtr pScreen,
+		 GlyphPtr pGlyph)
+{
+    if (glyphCache)
+	pixman_glyph_cache_remove (glyphCache, pGlyph, NULL);
+}
+
+static void
+fbGlyphs(CARD8 op,
+	 PicturePtr pSrc,
+	 PicturePtr pDst,
+	 PictFormatPtr maskFormat,
+	 INT16 xSrc,
+	 INT16 ySrc, int nlist,
+	 GlyphListPtr list,
+	 GlyphPtr *glyphs)
+{
+#define N_STACK_GLYPHS 512
+    ScreenPtr pScreen = pDst->pDrawable->pScreen;
+    pixman_glyph_t stack_glyphs[N_STACK_GLYPHS];
+    pixman_glyph_t *pglyphs = stack_glyphs;
+    pixman_image_t *srcImage, *dstImage;
+    int srcXoff, srcYoff, dstXoff, dstYoff;
+    GlyphPtr glyph;
+    int n_glyphs;
+    int x, y;
+    int i, n;
+    int xDst = list->xOff, yDst = list->yOff;
+
+    miCompositeSourceValidate(pSrc);
+    
+    n_glyphs = 0;
+    for (i = 0; i < nlist; ++i)
+	n_glyphs += list[i].len;
+
+    if (!glyphCache)
+	glyphCache = pixman_glyph_cache_create();
+
+    pixman_glyph_cache_freeze (glyphCache);
+    
+    if (n_glyphs > N_STACK_GLYPHS) {
+	if (!(pglyphs = malloc (n_glyphs * sizeof (pixman_glyph_t))))
+	    goto out;
+    }
+    
+    i = 0;
+    x = y = 0;
+    while (nlist--) {
+        x += list->xOff;
+        y += list->yOff;
+        n = list->len;
+        while (n--) {
+	    const void *g;
+
+            glyph = *glyphs++;
+
+	    if (!(g = pixman_glyph_cache_lookup (glyphCache, glyph, NULL))) {
+		pixman_image_t *glyphImage;
+		PicturePtr pPicture;
+		int xoff, yoff;
+
+		pPicture = GetGlyphPicture(glyph, pScreen);
+		if (!pPicture) {
+		    n_glyphs--;
+		    goto next;
+		}
+
+		if (!(glyphImage = image_from_pict(pPicture, FALSE, &xoff, &yoff)))
+		    goto out;
+
+		g = pixman_glyph_cache_insert(glyphCache, glyph, NULL,
+					      glyph->info.x,
+					      glyph->info.y,
+					      glyphImage);
+
+		free_pixman_pict(pPicture, glyphImage);
+
+		if (!g)
+		    goto out;
+	    }
+
+	    pglyphs[i].x = x;
+	    pglyphs[i].y = y;
+	    pglyphs[i].glyph = g;
+	    i++;
+
+	next:
+            x += glyph->info.xOff;
+            y += glyph->info.yOff;
+	}
+	list++;
+    }
+
+    if (!(srcImage = image_from_pict(pSrc, FALSE, &srcXoff, &srcYoff)))
+	goto out;
+
+    if (!(dstImage = image_from_pict(pDst, TRUE, &dstXoff, &dstYoff)))
+	goto out_free_src;
+
+    if (maskFormat) {
+	pixman_format_code_t format;
+	pixman_box32_t extents;
+
+	format = maskFormat->format | (maskFormat->depth << 24);
+
+	pixman_glyph_get_extents(glyphCache, n_glyphs, pglyphs, &extents);
+
+	pixman_composite_glyphs(op, srcImage, dstImage, format,
+				xSrc + srcXoff + xDst, ySrc + srcYoff + yDst,
+				extents.x1, extents.y1,
+				extents.x1 + dstXoff, extents.y1 + dstYoff,
+				extents.x2 - extents.x1,
+				extents.y2 - extents.y1,
+				glyphCache, n_glyphs, pglyphs);
+    }
+    else {
+	pixman_composite_glyphs_no_mask(op, srcImage, dstImage,
+					xSrc + srcXoff - xDst, ySrc + srcYoff - yDst,
+					dstXoff, dstYoff,
+					glyphCache, n_glyphs, pglyphs);
+    }
+
+    free_pixman_pict(pDst, dstImage);
+
+out_free_src:
+    free_pixman_pict(pSrc, srcImage);
+
+out:
+    pixman_glyph_cache_thaw(glyphCache);
+    if (pglyphs != stack_glyphs)
+	free(pglyphs);
+}
+
 static pixman_image_t *
 create_solid_fill_image(PicturePtr pict)
 {
@@ -357,7 +503,8 @@ fbPictureInit(ScreenPtr pScreen, PictFormatPtr formats, int nformats)
         return FALSE;
     ps = GetPictureScreen(pScreen);
     ps->Composite = fbComposite;
-    ps->Glyphs = miGlyphs;
+    ps->Glyphs = fbGlyphs;
+    ps->UnrealizeGlyph = fbUnrealizeGlyph;
     ps->CompositeRects = miCompositeRects;
     ps->RasterizeTrapezoid = fbRasterizeTrapezoid;
     ps->Trapezoids = fbTrapezoids;
diff --git a/fb/fbscreen.c b/fb/fbscreen.c
index 7c7d656..f9080a4 100644
--- a/fb/fbscreen.c
+++ b/fb/fbscreen.c
@@ -32,6 +32,7 @@ fbCloseScreen(ScreenPtr pScreen)
     int d;
     DepthPtr depths = pScreen->allowedDepths;
 
+    fbDestroyGlyphCache();
     for (d = 0; d < pScreen->numDepths; d++)
         free(depths[d].vids);
     free(depths);
diff --git a/hw/dmx/Makefile.am b/hw/dmx/Makefile.am
index fb727e6..62a6bbe 100644
--- a/hw/dmx/Makefile.am
+++ b/hw/dmx/Makefile.am
@@ -82,7 +82,7 @@ XDMX_LIBS = \
         config/libdmxconfig.a
 
 Xdmx_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG)
-Xdmx_DEPENDENCIES= $(XDMX_LIBS)
+Xdmx_DEPENDENCIES= $(filter-out -l%,$(XDMX_LIBS))
 Xdmx_LDADD = $(XDMX_LIBS) $(XDMX_SYS_LIBS) $(XSERVER_SYS_LIBS)
 
 relink:
diff --git a/hw/vfb/Makefile.am b/hw/vfb/Makefile.am
index 9f4992c..06830ae 100644
--- a/hw/vfb/Makefile.am
+++ b/hw/vfb/Makefile.am
@@ -25,7 +25,7 @@ XVFB_LIBS = \
 	$(XSERVER_LIBS)
 
 Xvfb_LDADD = $(XVFB_LIBS) $(XVFB_SYS_LIBS) $(XSERVER_SYS_LIBS)
-Xvfb_DEPENDENCIES = $(XVFB_LIBS)
+Xvfb_DEPENDENCIES = $(filter-out -l%,$(XVFB_LIBS))
 Xvfb_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG)
 
 relink:
diff --git a/hw/xfree86/Makefile.am b/hw/xfree86/Makefile.am
index c3899b5..82bac1d 100644
--- a/hw/xfree86/Makefile.am
+++ b/hw/xfree86/Makefile.am
@@ -65,7 +65,7 @@ Xorg_LDADD = \
             $(LOCAL_LIBS) \
             $(XORG_SYS_LIBS) \
             $(XSERVER_SYS_LIBS)
-Xorg_DEPENDENCIES = $(LOCAL_LIBS)
+Xorg_DEPENDENCIES = $(filter-out -l%,$(LOCAL_LIBS))
 
 Xorg_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG)
 
diff --git a/hw/xnest/Makefile.am b/hw/xnest/Makefile.am
index 3c099cd..180d62c 100644
--- a/hw/xnest/Makefile.am
+++ b/hw/xnest/Makefile.am
@@ -55,7 +55,7 @@ XNEST_LIBS = \
 
 Xnest_SOURCES = $(SRCS)
 
-Xnest_DEPENDENCIES = $(XNEST_LIBS)
+Xnest_DEPENDENCIES = $(filter-out -l%,$(XNEST_LIBS))
 Xnest_LDADD = $(XNEST_LIBS) $(XNEST_SYS_LIBS) $(XSERVER_SYS_LIBS)
 Xnest_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG)
 
diff --git a/hw/xquartz/mach-startup/Makefile.am b/hw/xquartz/mach-startup/Makefile.am
index 77962b1..c8626cc 100644
--- a/hw/xquartz/mach-startup/Makefile.am
+++ b/hw/xquartz/mach-startup/Makefile.am
@@ -23,17 +23,18 @@ nodist_X11_bin_SOURCES = \
 	mach_startupServer.c \
 	mach_startupUser.c
 
-X11_bin_DEPENDENCIES = \
+# $(XSERVER_SYS_LIBS) is placed here in order to set command line ordering
+# to work around build issues on Tiger.
+X11_bin_LDADD =\
 	$(top_builddir)/hw/xquartz/libXquartz.la \
 	$(top_builddir)/hw/xquartz/xpr/libXquartzXpr.la \
 	$(top_builddir)/dix/dixfonts.lo \
 	$(top_builddir)/miext/rootless/librootless.la \
 	$(top_builddir)/hw/xquartz/pbproxy/libxpbproxy.la \
-	$(XQUARTZ_LIBS) $(XSERVER_LIBS)
+	$(XQUARTZ_LIBS) $(XSERVER_LIBS) \
+	$(XSERVER_SYS_LIBS)
 
-# $(XSERVER_SYS_LIBS) is placed here in order to set command line ordering
-# to work around build issues on Tiger.
-X11_bin_LDADD = $(X11_bin_DEPENDENCIES) $(XSERVER_SYS_LIBS)
+X11_bin_DEPENDENCIES = $(subst $(XSERVER_SYS_LIBS),, $(filter-out -l%,$(X11_bin_LDADD)))
 
 X11_bin_LDFLAGS =  \
 	-lXplugin \
diff --git a/hw/xwin/Makefile.am b/hw/xwin/Makefile.am
index 93ce570..a33c3f1 100644
--- a/hw/xwin/Makefile.am
+++ b/hw/xwin/Makefile.am
@@ -153,7 +153,7 @@ INCLUDES = -I$(top_srcdir)/miext/rootless
 
 XWIN_SYS_LIBS += -ldxguid
 
-XWin_DEPENDENCIES = $(MULTIWINDOWEXTWM_LIBS) $(XWIN_GLX_LIBS) $(XWIN_LIBS) $(MAIN_LIB) $(XSERVER_LIBS)
+XWin_DEPENDENCIES = $(filter-out -l%,$(MULTIWINDOWEXTWM_LIBS) $(XWIN_GLX_LIBS) $(XWIN_LIBS) $(MAIN_LIB) $(XSERVER_LIBS))
 XWin_LDADD = $(MULTIWINDOW_LIBS) $(MULTIWINDOWEXTWM_LIBS) $(XWIN_GLX_LIBS) $(XWIN_GLX_LINK_FLAGS) $(XWIN_LIBS) $(MAIN_LIB) $(XSERVER_LIBS) $(XSERVER_SYS_LIBS) $(XWIN_SYS_LIBS)
 XWin_LDFLAGS = -mwindows -static
 
diff --git a/test/Makefile.am b/test/Makefile.am
index 34f53fc..3509306 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -117,7 +117,7 @@ libxservertest_la_LIBADD += \
 endif
 endif
 
-libxservertest_la_DEPENDENCIES = $(libxservertest_la_LIBADD)
+libxservertest_la_DEPENDENCIES = $(filter-out -l%,$(libxservertest_la_LIBADD))
 endif
 
 EXTRA_DIST = ddxstubs.c
-- 
1.8.2



More information about the xorg-devel mailing list