[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Patches] Patches to support cross-compile with cygwin host
- To: patches@xxxxxxxxxx
- Subject: [Patches] Patches to support cross-compile with cygwin host
- From: Ryan Johnson <ryan.johnson@xxxxxxxxxxxxxx>
- Date: Tue, 27 Mar 2012 17:54:21 -0400
Hi all,
At the request of the folks at crosstool-ng.org, I'm attaching three
small patches for eglibc-2.12 that allowed me to bring up an
x86_64-unknown-linux-gnu toolchain (gcc-4.5.3 and 4.6.1) on both
cygwin-1.5 and 1.7 hosts. I suspect the patches will work for other
eglibc versions as well, but I haven't tested that.
Regards,
Ryan
P.S. Please CC my PM on any replies: I'm not a list subscriber
--- eglibc-2_9/timezone/Makefile.org 2011-02-08 10:46:29.000000000 +0100
+++ eglibc-2_9/timezone/Makefile 2011-02-08 10:45:34.000000000 +0100
@@ -176,6 +176,22 @@
$(zic-cmd) -p $(posixrules)
endif
+OS?= $(shell uname)
+ifeq ($(OS),Darwin)
+CROSSZICLDFLAGS=-L/opt/local/lib -lintl
+endif
+ifneq (,$(findstring Windows_NT,$(OS)))
+# cygwin!
+CROSSZICLDFLAGS=-L/usr/lib -lintl
+endif
+ifneq (,$(findstring CYGWIN_NT,$(OS)))
+# cygwin!
+CROSSZICLDFLAGS=-L/usr/lib -lintl
+endif
+ifeq ($(OS),FreeBSD)
+CROSSZICLDFLAGS=-L/usr/local/lib -lintl
+endif
+
zic-objs = zic.o ialloc.o scheck.o
$(objpfx)zic: $(addprefix $(objpfx), $(zic-objs))
@@ -185,7 +193,7 @@
-DCROSS_ZIC $(compile-mkdep-flags)
$(objpfx)cross-zic: $(addprefix $(objpfx)cross-,$(zic-objs))
- gcc $(addprefix $(objpfx)cross-,$(zic-objs)) -o $@
+ gcc $(addprefix $(objpfx)cross-,$(zic-objs)) $(CROSSZICLDFLAGS) -o $@
tz-cflags = -DTZDIR='"$(zonedir)"' \
-DTZDEFAULT='"$(localtime-file)"' \
--- eglibc-2_12/sunrpc/rpc/types.h.org 2011-02-07 20:48:29.000000000 +0100
+++ eglibc-2_12/sunrpc/rpc/types.h 2011-02-08 01:25:34.000000000 +0100
@@ -69,6 +69,7 @@
#endif
#ifndef __u_char_defined
+#if !defined(__APPLE__) && !defined(__BSD__) && !defined(_BSDTYPES_DEFINED)
typedef __u_char u_char;
typedef __u_short u_short;
typedef __u_int u_int;
@@ -76,11 +77,14 @@
typedef __quad_t quad_t;
typedef __u_quad_t u_quad_t;
typedef __fsid_t fsid_t;
+#endif
# define __u_char_defined
#endif
#ifndef __daddr_t_defined
+#if !defined(__APPLE__) && !defined(__BSD__) && !defined(_BSDTYPES_DEFINED)
typedef __daddr_t daddr_t;
typedef __caddr_t caddr_t;
+#endif
# define __daddr_t_defined
#endif
--- eglibc-2_9/sunrpc/Makefile.org 2011-02-08 01:02:15.000000000 +0100
+++ eglibc-2_9/sunrpc/Makefile 2011-02-08 01:21:03.000000000 +0100
@@ -138,6 +138,22 @@
include ../Rules
+OS?= $(shell uname)
+ifeq ($(OS),Darwin)
+CROSSRPCLDFLAGS=-L/opt/local/lib -lintl
+endif
+ifneq (,$(findstring Windows_NT,$(OS)))
+# cygwin!
+CROSSRPCLDFLAGS=-L/usr/lib -lintl
+endif
+ifneq (,$(findstring CYGWIN_NT,$(OS)))
+# cygwin!
+CROSSRPCLDFLAGS=-L/usr/lib -lintl
+endif
+ifeq ($(OS),FreeBSD)
+CROSSRPCLDFLAGS=-L/usr/local/lib -lintl
+endif
+
$(objpfx)rpcgen: $(addprefix $(objpfx),$(rpcgen-objs)) \
$(sort $(filter $(common-objpfx)libc%,$(link-libc))) \
$(addprefix $(csu-objpfx),start.o) $(+preinit) $(+postinit)
@@ -148,7 +156,7 @@
$(OUTPUT_OPTION) $(compile-mkdep-flags)
$(objpfx)cross-rpcgen: $(addprefix $(objpfx)cross-,$(rpcgen-objs))
- gcc $^ -o $@
+ gcc $^ $(CROSSRPCLDFLAGS) -o $@
# This makes sure -DNOT_IN_libc is passed for all these modules.
cpp-srcs-left := $(rpcgen-objs:.o=.c)
_______________________________________________
Patches mailing list
Patches@xxxxxxxxxx
http://eglibc.org/cgi-bin/mailman/listinfo/patches