Build problem: _XkbStrCaseCmp

Wang Zhenyu zhenyu.z.wang at intel.com
Mon Mar 27 23:36:54 PST 2006


On 2006.03.27 15:33:29 +0000, Robert Spanton wrote:
> 
>    Hi,
>    I'm  attempting  to  build  Xorg from CVS. I'm using the modular build script in
>    util/modular/build.sh. However, I get a build error about undefined references to
>    _XkbStrCaseCmp. I've looked around the source a bit, and can't actually find the
>    function itself in the source, only its prototype.
>    The build error I'm getting follows:
>    ===*snip*===
>    make[1]: Entering directory `/usr/src/aiglx/cvs/app/setxkbmap'
>    if    gcc   -DHAVE_CONFIG_H   -I.   -I.   -I.      -I/home/rob/usr-aiglx/include
>    -D__XKBDEFRULES__='"xorg"'
>    -DDFLT_XKB_CONFIG_ROOT=\"/home/rob/usr-aiglx/share/X11/xkb\"    -g    -O2    -MT
>    setxkbmap-setxkbmap.o   -MD   -MP   -MF  ".deps/setxkbmap-setxkbmap.Tpo"  -c  -o
>    setxkbmap-setxkbmap.o `test -f 'setxkbmap.c' || echo './'`setxkbmap.c; \
>    then mv -f ".deps/setxkbmap-setxkbmap.Tpo" ".deps/setxkbmap-setxkbmap.Po"; else rm -f
>    ".deps/setxkbmap-setxkbmap.Tpo"; exit 1; fi
>    gcc  -g -O2   -o setxkbmap  setxkbmap-setxkbmap.o -L/home/rob/usr-aiglx/lib -lxkbfile
>    -lX11
>    /home/rob/usr-aiglx/lib/libxkbfile.so: undefined reference to `_XkbStrCaseCmp'
>    collect2: ld returned 1 exit status
>    make[1]: *** [setxkbmap] Error 1
>    make[1]: Leaving directory `/usr/src/aiglx/cvs/app/setxkbmap'
>    make: *** [all] Error 2
>    ===*snip*===

I've also seen this, here's a patch to compile xorg without xnest ok. 
Hope Daniel will clean it up at last. 

zhen

---
--- lib/xkbfile/src/maprules.c.orig	2006-03-28 12:17:38.000000000 +0800
+++ lib/xkbfile/src/maprules.c	2006-03-28 11:51:43.000000000 +0800
@@ -1119,7 +1119,7 @@ int			len,headingtype,extra_ndx = 0;
 		headingtype = HEAD_EXTRA;
 		extra_ndx= -1;
 		for (i=0;(i<rules->num_extra)&&(extra_ndx<0);i++) {
-		    if (_XkbStrCaseCmp(tolower(tok),rules->extra_names[i]))
+		    if (_XkbStrCaseEqual(tok,rules->extra_names[i]))
 			extra_ndx= i;
 		}
 		if (extra_ndx<0) {
--- lib/xkbui/src/XKBui.c.orig	2006-03-28 13:01:05.000000000 +0800
+++ lib/xkbui/src/XKBui.c	2006-03-28 13:02:18.000000000 +0800
@@ -46,12 +46,6 @@
 #  define M_PI	3.141592653589793238462
 #endif
 
-/* This function is an internal function in the xkbfile library */
-extern int	_XkbStrCaseCmp(
-	char *	/* str1 */,
-	char *	/* str2 */
-);
-
 
 static XkbUI_ViewOptsRec dfltOpts = { 
 	XkbUI_AllViewOptsMask	/* present */,
@@ -550,7 +544,7 @@ Bool		dfltBorder;
 		continue;
 	    }
 	    name= XkbAtomGetString(view->dpy,draw->u.doodad->any.name);
-	    if ((name!=NULL)&&(_XkbStrCaseCmp(name,"edges")==0)) {
+	    if ((name!=NULL)&&(strcmp(name,"edges")==0)) {
 		dfltBorder= False;
 		break;
 	    }
--- proto/KB/XKBsrv.h.orig	2006-03-28 13:08:11.000000000 +0800
+++ proto/KB/XKBsrv.h	2006-03-28 14:11:31.000000000 +0800
@@ -1170,10 +1170,7 @@ extern XPointer XkbDDXPreloadConfig(
 	DeviceIntPtr		/* dev */
 );
 
-extern	int _XkbStrCaseCmp(
-	char *			/* str1 */,
-	char *			/* str2 */
-);
+#define _XkbStrCaseEqual(s1,s2) (strcmp(tolower(s1),tolower(s2))==0)
 
 #endif /* XKBSRV_NEED_FILE_FUNCS */
 
--- xserver/xorg/xkb/maprules.c.orig	2006-03-28 13:08:44.000000000 +0800
+++ xserver/xorg/xkb/maprules.c	2006-03-28 14:09:50.000000000 +0800
@@ -1119,7 +1119,7 @@ int			len,headingtype,extra_ndx = 0;
 		headingtype = HEAD_EXTRA;
 		extra_ndx= -1;
 		for (i=0;(i<rules->num_extra)&&(extra_ndx<0);i++) {
-		    if (!_XkbStrCaseCmp(tok,rules->extra_names[i]))
+		    if (_XkbStrCaseEqual(tok,rules->extra_names[i]))
 			extra_ndx= i;
 		}
 		if (extra_ndx<0) {
--- xserver/xorg/xkb/ddxPrivate.c.orig	2006-03-28 13:06:09.000000000 +0800
+++ xserver/xorg/xkb/ddxPrivate.c	2006-03-28 13:06:31.000000000 +0800
@@ -29,13 +29,13 @@ XkbDDXPrivate(DeviceIntPtr dev,KeyCode k
     if (xf86act->type == XkbSA_XFree86Private) {
 	memcpy(msgbuf, xf86act->data, XkbAnyActionDataSize);
 	msgbuf[XkbAnyActionDataSize]= '\0';
-	if (_XkbStrCaseCmp(msgbuf, "-vmode")==0)
+	if (strcmp(msgbuf, "-vmode")==0)
 	    xf86ProcessActionEvent(ACTION_PREV_MODE, NULL);
-	else if (_XkbStrCaseCmp(msgbuf, "+vmode")==0)
+	else if (strcmp(msgbuf, "+vmode")==0)
 	    xf86ProcessActionEvent(ACTION_NEXT_MODE, NULL);
-	else if (_XkbStrCaseCmp(msgbuf, "ungrab")==0)
+	else if (strcmp(msgbuf, "ungrab")==0)
 	    xf86ProcessActionEvent(ACTION_DISABLEGRAB, NULL);
-	else if (_XkbStrCaseCmp(msgbuf, "clsgrb")==0)
+	else if (strcmp(msgbuf, "clsgrb")==0)
 	    xf86ProcessActionEvent(ACTION_CLOSECLIENT, NULL);
 	else
 	    xf86ProcessActionEvent(ACTION_MESSAGE, (void *) msgbuf);



More information about the xorg mailing list