[PATCH] Fix Xdmx build on Linux to work with strlcpy changes

Alan Coopersmith alan.coopersmith at oracle.com
Tue Nov 22 19:22:35 PST 2011


Include strlcpy.c in the  libdmxconfig.a library with the other functions
shared among the xdmx configuration programs.

Also add a prototype to the scanner.l file that now calls strlcpy but
does not include $(top_srcdir)/include/os.h where the main prototype is.

(To be squashed into
http://cgit.freedesktop.org/~alanc/xserver/commit/?id=c19f0ff5223d428f8ad2ab3c563c974c96a521ba
before next PULL request to avoid breaking bisection.)

Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
---
 hw/dmx/config/Makefile.am |    4 ++++
 hw/dmx/config/scanner.l   |    3 +++
 2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/hw/dmx/config/Makefile.am b/hw/dmx/config/Makefile.am
index de4ce31..7518143 100644
--- a/hw/dmx/config/Makefile.am
+++ b/hw/dmx/config/Makefile.am
@@ -22,6 +22,10 @@ MAINTAINERCLEANFILES = $(BUILT_SOURCES)
 
 libdmxconfig_a_SOURCES = $(LIBSRCS)
 
+if NEED_STRLCAT
+libdmxconfig_a_SOURCES += $(top_srcdir)/os/strlcpy.c
+endif
+
 if GLX
 GLX_DEFS = @GL_CFLAGS@
 endif	    
diff --git a/hw/dmx/config/scanner.l b/hw/dmx/config/scanner.l
index 5ce268d..ff5ecd9 100644
--- a/hw/dmx/config/scanner.l
+++ b/hw/dmx/config/scanner.l
@@ -47,6 +47,9 @@ static int getstring(int token, const char *text, int leng);
 static int gettoken(int token, const char *text, int leng);
 static int getcomment(int token, const char *text, int leng);
 static int lineno = 1;
+#ifndef HAS_STRLCPY
+extern size_t strlcpy(char *dst, const char *src, size_t siz);
+#endif
 %}
 %s OTHER
 comment         #.*
-- 
1.7.3.2



More information about the xorg-devel mailing list