aboutsummaryrefslogtreecommitdiff
path: root/xkbcomp
diff options
context:
space:
mode:
Diffstat (limited to 'xkbcomp')
-rw-r--r--xkbcomp/keycodes.c2
-rw-r--r--xkbcomp/listing.c10
-rw-r--r--xkbcomp/makefile59
-rw-r--r--xkbcomp/xkbcomp.c8
-rw-r--r--xkbcomp/xkbcomp.h1
-rw-r--r--xkbcomp/xkbparse.y4
-rw-r--r--xkbcomp/xkbpath.c3
-rw-r--r--xkbcomp/xkbscan.c2
8 files changed, 85 insertions, 4 deletions
diff --git a/xkbcomp/keycodes.c b/xkbcomp/keycodes.c
index 3517586c7..0cffa8131 100644
--- a/xkbcomp/keycodes.c
+++ b/xkbcomp/keycodes.c
@@ -297,6 +297,8 @@ InitKeyNamesInfo(KeyNamesInfo * info)
info->name = NULL;
info->leds = NULL;
info->aliases = NULL;
+ info->fileID=-1;
+ info->merge=0;
ClearKeyNamesInfo(info);
info->errorCount = 0;
return;
diff --git a/xkbcomp/listing.c b/xkbcomp/listing.c
index 146ecbab3..d62e39b21 100644
--- a/xkbcomp/listing.c
+++ b/xkbcomp/listing.c
@@ -75,6 +75,7 @@ SOFTWARE.
#include <sys/types.h>
#include <sys/stat.h>
#include <X11/keysym.h>
+#include <X11/Xwindows.h>
#if defined(sgi)
#include <malloc.h>
@@ -123,6 +124,14 @@ SOFTWARE.
#include "tokens.h"
#include <X11/extensions/XKBgeom.h>
+#ifndef S_ISDIR
+# if defined(_S_IFMT) && defined(_S_IFDIR)
+# define S_ISDIR(a) (((a) & _S_IFMT) == _S_IFDIR)
+# else
+# define S_ISDIR(a) (((a) & S_IFMT) == S_IFDIR)
+# endif
+#endif
+
#define lowbit(x) ((x) & (-(x)))
unsigned int listingDebug;
@@ -289,6 +298,7 @@ AddDirectory(char *head, char *ptrn, char *rest, char *map)
#ifdef WIN32
if ((dirh = FindFirstFile("*.*", &file)) == INVALID_HANDLE_VALUE)
return 0;
+ nMatch = 0;
#else
if ((dirp = opendir((head ? head : "."))) == NULL)
return 0;
diff --git a/xkbcomp/makefile b/xkbcomp/makefile
new file mode 100644
index 000000000..6625ac5ba
--- /dev/null
+++ b/xkbcomp/makefile
@@ -0,0 +1,59 @@
+INCLUDELIBFILES = $(MHMAKECONF)\libx11\src\$(OBJDIR)\libx11.lib \
+ $(MHMAKECONF)\libx11\src\xkb\$(OBJDIR)\libxkb.lib \
+ $(MHMAKECONF)\libx11\src\xlibi18n\$(OBJDIR)\libi18n.lib \
+ $(MHMAKECONF)\libx11\modules\lc\xlocale\$(OBJDIR)\libxlocale.lib \
+ $(MHMAKECONF)\libx11\modules\lc\utf8\$(OBJDIR)\libxlcUTF8Load.lib \
+ $(MHMAKECONF)\libx11\modules\lc\def\$(OBJDIR)\libxlcDef.lib \
+ $(MHMAKECONF)\libx11\modules\om\generic\$(OBJDIR)\libxomGeneric.lib \
+ $(MHMAKECONF)\libx11\modules\lc\gen\$(OBJDIR)\liblcGenConvLoad.lib \
+ $(MHMAKECONF)\libx11\modules\im\ximcp\$(OBJDIR)\libximcp.lib \
+ $(MHMAKECONF)\libxcb\src\$(OBJDIR)\libxcb.lib \
+ $(MHMAKECONF)\libxau\$(OBJDIR)\libxau.lib \
+ $(MHMAKECONF)\libxkbfile\src\$(OBJDIR)\libxkbfile.lib
+
+LIBDIRS=$(dir $(INCLUDELIBFILES))
+
+load_makefile $(LIBDIRS:%$(OBJDIR)\=%makefile MAKESERVER=$(MAKESERVER) DEBUG=$(DEBUG);)
+
+ifeq $(DEBUG),1
+TTYAPP = xkbcomp
+else
+WINAPP = xkbcomp
+endif
+
+DEFINES += DFLT_XKB_CONFIG_ROOT="\".\""
+
+INCLUDES += $(OBJDIR)
+
+CSRCS = action.c \
+ alias.c \
+ compat.c \
+ expr.c \
+ geometry.c \
+ indicators.c \
+ keycodes.c \
+ keymap.c \
+ keytypes.c \
+ listing.c \
+ misc.c \
+ parseutils.c \
+ symbols.c \
+ utils.c \
+ vmod.c \
+ xkbcomp.c \
+ xkbparse.c \
+ xkbpath.c \
+ xkbscan.c
+
+LINKLIBS += $(MHMAKECONF)\openssl\out32\libeay32.lib
+
+ifeq ($(DEBUG),1)
+LINKLIBS += $(MHMAKECONF)\freetype\lib\freetype242MT_D.lib \
+ $(MHMAKECONF)\pthreads\pthreadVC2d.lib
+else
+LINKLIBS += $(MHMAKECONF)\freetype\lib\freetype242MT.lib \
+ $(MHMAKECONF)\pthreads\pthreadVC2.lib
+endif
+
+$(OBJDIR)\xkbparse.c $(OBJDIR)\xkbparse.h: xkbparse.y
+ bison -d -o$(OBJDIR)\xkbparse.c $<
diff --git a/xkbcomp/xkbcomp.c b/xkbcomp/xkbcomp.c
index c8caf59c5..31badbf58 100644
--- a/xkbcomp/xkbcomp.c
+++ b/xkbcomp/xkbcomp.c
@@ -547,8 +547,8 @@ parseArgs(int argc, char *argv[])
{
WARN1("Changing root directory to \"%s\"\n", rootDir);
}
- if ((chdir(rootDir) < 0) && (warningLevel > 0))
- {
+ XkbAddDirectoryToPath(rootDir);
+ if (!XkbAddDirectoryToPath(rootDir) && (warningLevel>0)) {
WARN1("Couldn't change directory to \"%s\"\n", rootDir);
ACTION("Root directory (-R) option ignored\n");
rootDir = NULL;
@@ -1139,10 +1139,14 @@ main(int argc, char *argv[])
break;
}
#endif
+#ifdef _MSC_VER
+ outputFileFd= open(outputFile, O_WRONLY|O_CREAT|O_EXCL|binMode,_S_IREAD | _S_IWRITE);
+#else
outputFileFd =
open(outputFile, O_WRONLY | O_CREAT | O_EXCL,
S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH
| S_IWOTH | binMode);
+#endif
if (outputFileFd < 0)
{
ERROR1
diff --git a/xkbcomp/xkbcomp.h b/xkbcomp/xkbcomp.h
index 800780fc0..938b16d3a 100644
--- a/xkbcomp/xkbcomp.h
+++ b/xkbcomp/xkbcomp.h
@@ -31,6 +31,7 @@
#define DEBUG_VAR debugFlags
#endif
+#include <unistd.h>
#include <X11/Xlib.h>
#include <X11/XKBlib.h>
diff --git a/xkbcomp/xkbparse.y b/xkbcomp/xkbparse.y
index 1918f6b72..15fa4e949 100644
--- a/xkbcomp/xkbparse.y
+++ b/xkbcomp/xkbparse.y
@@ -92,6 +92,10 @@
#ifdef DEBUG
#define YYDEBUG 1
#endif
+
+#define YYMALLOC malloc
+#define YYFREE free
+
#define DEBUG_VAR parseDebug
#include "parseutils.h"
#include <X11/keysym.h>
diff --git a/xkbcomp/xkbpath.c b/xkbcomp/xkbpath.c
index 68020129e..f5b21e6b8 100644
--- a/xkbcomp/xkbpath.c
+++ b/xkbcomp/xkbpath.c
@@ -30,11 +30,12 @@
#define DEBUG_VAR debugFlags
#include "utils.h"
#include <stdlib.h>
+#include <unistd.h>
#include <X11/extensions/XKM.h>
#include "xkbpath.h"
#ifndef DFLT_XKB_CONFIG_ROOT
-#define DFLT_XKB_CONFIG_ROOT "/usr/lib/X11/xkb"
+#define DFLT_XKB_CONFIG_ROOT "xkbdata"
#endif
#ifndef PATH_MAX
diff --git a/xkbcomp/xkbscan.c b/xkbcomp/xkbscan.c
index 802598818..caf9f7ef0 100644
--- a/xkbcomp/xkbscan.c
+++ b/xkbcomp/xkbscan.c
@@ -31,7 +31,7 @@
#include <X11/XKBlib.h>
#include "tokens.h"
-#define DEBUG_VAR scanDebug
+
#include "utils.h"
#include "parseutils.h"