INCFILES =\
$(INCFILEDIR)\cmd.h
+HEIMDAL = ..\external\heimdal\krb5
+
# build afscmd.lib
LIBFILE = $(DESTDIR)\lib\afs\afscmd.lib
$(OUT)\cmd_errors.obj \
$(OUT)\cmd.obj \
$(OUT)\AFS_component_version_number.obj
-
+
+HEIMOBJS =\
+ $(OUT)\config_file.obj \
+ $(OUT)\expand_path.obj
+
$(LIBOBJS): $$(@B).c
$(C2OBJ) $**
-$(LIBFILE): $(LIBOBJS)
+$(OUT)\expand_path.obj: $(HEIMDAL)\$$(@B).c
+ $(C2OBJ) -I$(HEIMDAL) -DEXPAND_PATH_HEADER $**
+
+$(OUT)\config_file.obj: $(HEIMDAL)\$$(@B).c
+ $(C2OBJ) -I$(HEIMDAL) -DKRB5_USE_PATH_TOKENS $**
+
+$(LIBFILE): $(LIBOBJS) $(HEIMOBJS)
$(LIBARCH)
$(INCFILES):$$(@F)
#include <afsconfig.h>
#include <afs/stds.h>
+#include <roken.h>
+
#include <assert.h>
#include <ctype.h>
-#include <errno.h>
-#include <pwd.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <time.h>
-#include <unistd.h>
-
-#include <roken.h>
#include "cmd.h"
+#define PACKAGE "openafs"
+
#ifndef TRUE
# define TRUE 1
#endif
#define KRB5_DEPRECATED_FUNCTION(x)
-#define KRB5_CONFIG_BADFORMAT CMD_BADFORMAT
-
#define N_(X,Y) X
typedef struct cmd_config_binding krb5_config_binding;
typedef int krb5_boolean;
typedef time_t krb5_deltat;
+static void krb5_set_error_message(krb5_context context, krb5_error_code ret,
+ const char *fmt, ...) {
+ return;
+}
+
+#ifdef EXPAND_PATH_HEADER
+
+#include <shlobj.h>
+
+static int _krb5_expand_path_tokens(krb5_context, const char *, char**);
+
+int
+_cmd_ExpandPathTokens(krb5_context context, const char *in, char **out) {
+ return _krb5_expand_path_tokens(context, in, out);
+}
+
+HINSTANCE _krb5_hInstance = NULL;
+
+/* This bodge avoids the need for everything linking against cmd to also
+ * link against the shell library on Windows */
+#undef SHGetFolderPath
+#define SHGetFolderPath internal_getpath
+
+HRESULT internal_getpath(void *a, int b, void *c, DWORD d, LPTSTR out) {
+ return E_INVALIDARG;
+}
+
+#else
+
+#define KRB5_CONFIG_BADFORMAT CMD_BADFORMAT
+
+#define _krb5_expand_path_tokens _cmd_ExpandPathTokens
+
+extern int _cmd_ExpandPathTokens(krb5_context, const char *, char **);
+
static const void *_krb5_config_vget(krb5_context,
const krb5_config_section *, int,
va_list);
return;
}
-static void krb5_set_error_message(krb5_context context, krb5_error_code ret,
- const char *fmt, ...) {
- return;
-}
static int _krb5_homedir_access(krb5_context context) {
return 0;
/* Wrappers */
+
int
cmd_RawConfigParseFileMulti(const char *fname, cmd_config_section **res) {
return krb5_config_parse_file_multi(NULL, fname, res);
return ret;
}
+#endif