From: Ben Kaduk Date: Tue, 5 Aug 2014 15:11:45 +0000 (-0400) Subject: Fix the build on windows X-Git-Tag: krb5-1.13-alpha1~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=58312ae8beb0499ac3a06196164eb833e9f8975e;p=thirdparty%2Fkrb5.git Fix the build on windows Windows does not provide the glob() functionality used to implement the /etc/gss/mechs.d/ feature, so we must avoid compiling the relevant code for windows. (It would never have been called, anyway.) Adjust the ccache/Makefile.in rules to not use '-' or '@' in make variable names that are processed by nmake. Also in ccache/Makefile.in, remove some latent leading whitespace that had been previously hidden by the previous rule; this exposed some flawed dependencies that are now removed. Windows does not provide sys/socket.h or sys/un.h, so don't try to include them in cc_kcm.c. The commit which moved the KKDCP TLS support to a plugin left some dangling references to checkhost.c byproducts in os/Makefile.in, which can be safely removed. Use k5-platform.h in support/json.c instead of a set of system includes; this lets windows build the static inline helper functions therein. --- diff --git a/src/lib/gssapi/mechglue/g_initialize.c b/src/lib/gssapi/mechglue/g_initialize.c index 04ba87958c..85810a9c12 100644 --- a/src/lib/gssapi/mechglue/g_initialize.c +++ b/src/lib/gssapi/mechglue/g_initialize.c @@ -41,7 +41,9 @@ #include #include #include +#ifndef _WIN32 #include +#endif #define M_DEFAULT "default" @@ -418,6 +420,7 @@ load_if_changed(const char *pathname, time_t last, time_t *highest) loadConfigFile(pathname); } +#ifndef _WIN32 /* Try to load any config files which have changed since the last call. Config * files are MECH_CONF and any files matching MECH_CONF_PATTERN. */ static void @@ -442,6 +445,7 @@ loadConfigFiles() g_confFileModTime = highest; } +#endif /* * determines if the mechList needs to be updated from file diff --git a/src/lib/krb5/ccache/Makefile.in b/src/lib/krb5/ccache/Makefile.in index 898dfe79cc..7e1fd74e9b 100644 --- a/src/lib/krb5/ccache/Makefile.in +++ b/src/lib/krb5/ccache/Makefile.in @@ -15,11 +15,17 @@ LOCALINCLUDES = -I$(srcdir)$(S)ccapi -I$(srcdir) -I. $(WIN_INCLUDES) ##WIN32##MSLSA_OBJ = $(OUTPRE)cc_mslsa.$(OBJEXT) ##WIN32##MSLSA_SRC = $(srcdir)/cc_mslsa.c +##WIN32##!if 0 KCMRPC_DEPS-osx = kcmrpc.h kcmrpc_types.h KCMRPC_OBJ-osx = kcmrpc.o KCMRPC_DEPS-no = # empty KCMRPC_OBJ-no = # empty +KCMRPC_DEPS = $(KCMRPC_DEPS-@OSX@) +KCMRPC_OBJS = $(KCMRPC_OBJS-@OSX@) +##WIN32##!endif + + STLIBOBJS= \ ccbase.o \ cccopy.o \ @@ -37,7 +43,7 @@ STLIBOBJS= \ cc_memory.o \ cc_keyring.o \ ccfns.o \ - ser_cc.o $(KCMRPC_OBJ-@OSX@) + ser_cc.o $(KCMRPC_OBJ) OBJS= $(OUTPRE)ccbase.$(OBJEXT) \ $(OUTPRE)cccopy.$(OBJEXT) \ @@ -144,11 +150,11 @@ clean-unix:: $(RM) t_cc t_cc.o t_cccursor t_cccursor.o t_cccol t_cccol.o $(RM) t_marshal t_marshal.o testcache -depend:: $(KCMRPC_DEPS-@OSX@) +depend:: $(KCMRPC_DEPS) -##WIN32## $(OUTPRE)cc_mslsa.$(OBJEXT): cc_mslsa.c $(top_srcdir)/include/k5-int.h $(BUILDTOP)/include/krb5/osconf.h $(BUILDTOP)/include/krb5/autoconf.h $(BUILDTOP)/include/krb5.h $(COM_ERR_DEPS) +##WIN32##$(OUTPRE)cc_mslsa.$(OBJEXT): cc_mslsa.c $(top_srcdir)/include/k5-int.h $(BUILDTOP)/include/krb5.h $(COM_ERR_DEPS) -cc_kcm.so cc_kcm.o: $(KCMRPC_DEPS-@OSX@) +cc_kcm.so cc_kcm.o: $(KCMRPC_DEPS) kcmrpc.so kcmrpc.o: kcmrpc.h kcmrpc_types.h @libobj_frag@ diff --git a/src/lib/krb5/ccache/cc_kcm.c b/src/lib/krb5/ccache/cc_kcm.c index 891ce3ac0b..b763ea4a6d 100644 --- a/src/lib/krb5/ccache/cc_kcm.c +++ b/src/lib/krb5/ccache/cc_kcm.c @@ -37,6 +37,7 @@ * sockets are used instead. */ +#ifndef _WIN32 #include "k5-int.h" #include "k5-input.h" #include "cc-int.h" @@ -49,8 +50,6 @@ #include "kcmrpc.h" #endif -#ifndef _WIN32 - #define MAX_REPLY_SIZE (10 * 1024 * 1024) const krb5_cc_ops krb5_kcm_ops; diff --git a/src/lib/krb5/os/Makefile.in b/src/lib/krb5/os/Makefile.in index ea68990124..e8155beb19 100644 --- a/src/lib/krb5/os/Makefile.in +++ b/src/lib/krb5/os/Makefile.in @@ -59,7 +59,6 @@ OBJS= \ $(OUTPRE)c_ustime.$(OBJEXT) \ $(OUTPRE)ccdefname.$(OBJEXT) \ $(OUTPRE)changepw.$(OBJEXT) \ - $(OUTPRE)checkhost.$(OBJEXT) \ $(OUTPRE)dnsglue.$(OBJEXT) \ $(OUTPRE)dnssrv.$(OBJEXT) \ $(OUTPRE)expand_path.$(OBJEXT) \ @@ -106,7 +105,6 @@ SRCS= \ $(srcdir)/c_ustime.c \ $(srcdir)/ccdefname.c \ $(srcdir)/changepw.c \ - $(srcdir)/checkhost.c \ $(srcdir)/dnsglue.c \ $(srcdir)/dnssrv.c \ $(srcdir)/expand_path.c \ diff --git a/src/util/support/json.c b/src/util/support/json.c index 98f6568b24..ae2feae974 100644 --- a/src/util/support/json.c +++ b/src/util/support/json.c @@ -70,10 +70,7 @@ * Heimdal. */ -#include -#include -#include -#include +#include #include #include #include