@@ -71,6 +71,8 @@
export LIBS := @LIBS@
export curses_hdr := @ac_ct_curses_hdr@
export gettext := @gettext@
+export mkdir_one_arg := @ac_cv_mkdir_takes_one_arg@
+export build_os := @build_os@
# config options to push down to kconfig
KCONFIG:= @kconfig_options@
@@ -82,6 +82,7 @@
# ... but refuse --target
AS_IF([test -n "$target_alias"],
AC_MSG_ERROR([--target is not allowed]))
+AC_SUBST([build_os])
# Allow program name tranformation (--program-{prefix,suffix,transform-name})
AC_ARG_PROGRAM
@@ -370,6 +371,22 @@
[sublibdir="/ct-ng.\${VERSION}"
subdocdir="/ct-ng.\${VERSION}"])
+#----------------------------------------
+# Check whether mkdir takes one argument
+AC_SUBST([ac_cv_mkdir_takes_one_arg])
+AC_CACHE_VAL([ac_cv_mkdir_takes_one_arg],
+ [AC_CHECK_FUNCS([mkdir _mkdir])
+ AC_CACHE_CHECK([whether mkdir takes one argument],
+ [ac_cv_mkdir_takes_one_arg],
+ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#include <sys/stat.h>
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+ ]],
+ [[mkdir (".");]])],
+ [ac_cv_mkdir_takes_one_arg=yes],[ac_cv_mkdir_takes_one_arg=no])])])
+
#--------------------------------------------------------------------
# Finally, generate the output file(s)
#--------------------------------------------------------------------
@@ -7,6 +7,15 @@
# Build flags
CFLAGS = -DCONFIG_=\"CT_\" -DPACKAGE="\"crosstool-NG $(VERSION)\""
+
+ifeq ($(mkdir_one_arg),yes)
+CFLAGS += -DMKDIR_TAKES_ONE_ARG
+endif
+
+ifeq ($(build_os),mingw32)
+MCONF_MINGW32_LDFLAGS = -lintl -lregex -liconv
+endif
+
LDFLAGS =
# Compiler flags to use gettext
@@ -41,7 +50,7 @@
mconf_OBJ = $(patsubst %.c,%.o,$(mconf_SRC))
mconf_DEP = $(patsubst %.c,%.dep,$(mconf_SRC))
$(mconf_OBJ) $(mconf_DEP): CFLAGS += $(NCURSES_CFLAGS) $(INTL_CFLAGS)
-mconf: LDFLAGS += $(NCURSES_LDFLAGS)
+mconf: LDFLAGS += $(NCURSES_LDFLAGS) $(MCONF_MINGW32_LDFLAGS)
# What's needed to build 'nconf'
nconf_SRC = nconf.c nconf.gui.c
@@ -16,6 +16,10 @@
#define LKC_DIRECT_LINK
#include "lkc.h"
+#ifdef MKDIR_TAKES_ONE_ARG
+#define mkdir(_n,_p) mkdir((_n))
+#endif
+
static void conf_warning(const char *fmt, ...)
__attribute__ ((format (printf, 1, 2)));
@@ -7,7 +7,12 @@
#include <stdlib.h>
#include <string.h>
#include <regex.h>
-#include <sys/utsname.h>
+#if defined(__MINGW32__)
+# define UTS_RELEASE "1.0.17(0.48/3/2)"
+#else
+# include <sys/utsname.h>
+# define UTS_RELEASE uts.release
+#endif
#define LKC_DIRECT_LINK
#include "lkc.h"
@@ -46,19 +51,23 @@
void sym_init(void)
{
struct symbol *sym;
+#ifndef __MINGW32__
struct utsname uts;
+#endif
static bool inited = false;
if (inited)
return;
inited = true;
- uname(&uts);
+#ifndef __MINGW32__
+ uname(&uts);
+#endif
sym = sym_lookup("UNAME_RELEASE", 0);
sym->type = S_STRING;
sym->flags |= SYMBOL_AUTO;
- sym_add_default(sym, uts.release);
+ sym_add_default(sym, UTS_RELEASE);
}
enum symbol_type sym_get_type(struct symbol *sym)