Hi,
attached patches make the emulation/qemu-x86 target build with kconfig on mingw. It also requires python in the path (for sconfig), and other boards might fail unless perl is around.
Specifically:
20091121-1-cbfstool-on-win32: * The LZMA code in cbfstool used a Win2003+ flag. It's merely an advice and our workloads aren't very large, so kill this, to make the tree work on Windows XP. * Implement ntohl/htonl. Less overhead than importing winsock2 (which would actually call functions for them, too, instead of defining them)
20091121-2-kconfig-on-win32: Basically what already happened in serialice: * work around the uname use * a copy of libregex, for cases where libc doesn't provide it * before rename()ing files, unlink the target. Win32 wants it that way (losing atomicity) * Makefile support for building and linking in libregex if necessary (ie. on mingw)
20091121-3-romcc-on-win32: Basically what already happened in serialice: * Use fopen/fseek/ftell/fread/fclose instead of open/stat/read/close * Handle {CR}{LF} properly * Handle absolute paths on Win32 (X:\ or X:/ prefixes) properly * Don't free() block, as it's read sometimes later. Windows guards against this
20091121-4-build_opt_tbl-on-win32: * Implement a crude mkstemp implementation for win32. Good enough to have multiple such files open in parallel, not good enough if security is relevant. * Unlink targets before renaming files. Loses atomicity, but makes it work on win32
20091121-5-xcompile-on-win32: * Alternative handling for mktemp(1) (fixed filename) * Drop use of dd(1)
20091121-6-use-relative-paths-in-ldscript-and-crt0_includes: * Use relative paths in ldscript.ld and crt0_includes.h
20091121-7-toplevel-Makefile-on-win32: * Handle CRLF in the awk snippet that generates ldoptions * Remove old code that was replaced by awk script a _long_ time ago * Add stack size linker option for romcc on mingw and cygwin
Signed-off-by: Patrick Georgi patrick.georgi@coresystems.de
Patrick
Patrick Georgi wrote:
+#ifndef WIN32 +#include <arpa/inet.h> +#else +#define ntohl(x) ((x>>24) | (x<<24) | ((x>>8)&0xff00) | ((x<<8)&0xff0000))
It's common to guard x in each use with () I guess in order to avoid ordering issues if x isn't a simple number.
+#ifdef WIN32 +#define mkdir(x,y) mkdir(x) +#define UNLINK(x) unlink(x) +#else +#define UNLINK(X) +#endif
Maybe name UNLINK() something else to show that it's not always being done?
- awk '/^#define ([^"])* ([^"])*$$/ {gsub("\r","",$$3); print $$2 " = " $$3 ";";}' $< > $@
This assumes that the macro expansion will never contain whitespace - is that true? If not, I suggest:
awk '/^#define ([^"])* ([^"])*$$/ {gsub("\r","",$$NF); exp=$$0; sub("^#define [^"]* ","",exp); print $$2 " = " exp ";";}' $< > $@
Other than that:
Acked-by: Peter Stuge peter@stuge.se
Am 21.11.2009 20:21, schrieb Peter Stuge:
It's common to guard x in each use with () I guess in order to avoid ordering issues if x isn't a simple number.
Fixed
Maybe name UNLINK() something else to show that it's not always being done?
UNLINK_IF_NECESSARY, then.
- awk '/^#define ([^"])* ([^"])*$$/ {gsub("\r","",$$3); print $$2 " = " $$3 ";";}' $< > $@
This assumes that the macro expansion will never contain whitespace - is that true? If not, I suggest:
It worked so far, and that part of the line didn't change. I'll test a bit more.
Acked-by: Peter Stugepeter@stuge.se
Thanks, r4952
Patrick