public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] enable user configure script for cross compile even more
@ 2007-10-09 19:44 Jerone Young
       [not found] ` <1191959084-24322-1-git-send-email-jyoung5-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Jerone Young @ 2007-10-09 19:44 UTC (permalink / raw)
  To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f; +Cc: Jerone Young, Avi Kivity

This patch patch applies on the latest git tree. 
This adds more cross compile capability to the user diretory
configure script.

Patch created with git this time :-)

Signed-off-by: Jerone Young <jyoung5-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>


diff --git a/user/configure b/user/configure
index 20b9367..ff10268 100755
--- a/user/configure
+++ b/user/configure
@@ -4,7 +4,8 @@ prefix=/usr/local
 kerneldir=/lib/modules/$(uname -r)/build
 cc=gcc
 ld=ld
-arch=`uname -m | sed -e s/i.86/x86/`
+arch=`uname -m | sed -e s/i.86/i386/`
+cross_prefix=
 
 usage() {
     cat <<-EOF
@@ -12,6 +13,7 @@ usage() {
 
 	Options include:
 	    --arch=ARCH            architecture to compile for ($arch)
+	    --cross-prefix=PREFIX  cross compiler prefix
 	    --cc=CC		   c compiler to use ($cc)
 	    --ld=LD		   ld linker to use ($ld)
 	    --prefix=PREFIX        where to install things ($prefix)
@@ -37,6 +39,9 @@ while [[ "$1" = -* ]]; do
         --arch)
 	    arch="$arg"
 	    ;;
+	--cross-prefix)
+	    cross_prefix="$arg"
+	    ;;
 	--cc)
 	    cc="$arg"
 	    ;;
@@ -56,6 +61,6 @@ cat <<EOF > config.mak
 PREFIX=$prefix
 KERNELDIR=$(readlink -f $kerneldir)
 ARCH=$arch
-CC=$cc
-LD=$ld
+CC=$cross_prefix$cc
+LD=$cross_prefix$ld
 EOF

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] [FIXED] enable user makefile for cross compile
       [not found] ` <1191959084-24322-1-git-send-email-jyoung5-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
@ 2007-10-09 19:44   ` Jerone Young
       [not found]     ` <1191959084-24322-2-git-send-email-jyoung5-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Jerone Young @ 2007-10-09 19:44 UTC (permalink / raw)
  To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f; +Cc: Jerone Young, Avi Kivity

This patch enables enable makefile in user for cross compile.
This time is a proper git formatted patch.

Signed-off-by: Joerone Young <jyoung5-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>

diff --git a/user/Makefile b/user/Makefile
index 26eb530..522874b 100644
--- a/user/Makefile
+++ b/user/Makefile
@@ -1,14 +1,22 @@
 
 include config.mak
 
+DESTDIR :=
+
+#make sure env CFLAGS variable is not used
+CFLAGS =
+
+#include architecure specific make rules
+include config-$(ARCH).mak
+
 # cc-option
 # Usage: OP_CFLAGS+=$(call cc-option, -falign-functions=0, -malign-functions=0)
 
 cc-option = $(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null \
               > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;)
 
-CFLAGS = -I $(KERNELDIR)/include $(autodepend-flags) -g -fomit-frame-pointer \
-	-Wall -m$(bits)
+CFLAGS += -I $(KERNELDIR)/include $(autodepend-flags) -g -fomit-frame-pointer \
+	-Wall
 CFLAGS += $(call cc-option, -fno-stack-protector, "")
 CFLAGS += $(call cc-option, -fno-stack-protector-all, "")
 
@@ -18,20 +26,6 @@ CXXFLAGS = $(autodepend-flags)
 
 autodepend-flags = -MMD -MF $(dir $*).$(notdir $*).d
 
-DESTDIR = 
-
-ifeq ($(shell uname -m), x86_64)
-LIBDIR = /lib64
-cstart.o = test/cstart64.o
-bits = 64
-ldarch = elf64-x86-64
-else
-LIBDIR = /lib
-cstart.o = test/cstart.o
-bits = 32
-ldarch = elf32-i386
-endif
-
 all: kvmctl libkvm.a flatfiles
 
 kvmctl: LDFLAGS += -pthread -lrt
@@ -45,11 +39,7 @@ libkvm.a: kvmctl.o
 
 flatfiles-common = test/bootstrap test/vmexit.flat test/smp.flat
 
-flatfiles-32 =
-
-flatfiles-64 = test/access.flat test/irq.flat test/sieve.flat test/simple.flat test/stringio.flat test/memtest1.flat
-
-flatfiles: $(flatfiles-common) $(flatfiles-$(bits))
+flatfiles: $(flatfiles-common) $(flatfiles)
 
 install:
 	install -D kvmctl.h $(DESTDIR)/$(PREFIX)/include/kvmctl.h
@@ -60,13 +50,13 @@ install:
 	install -D libkvm.a $(DESTDIR)/$(PREFIX)/$(LIBDIR)/libkvm.a
 
 %.flat: %.o
-	gcc $(CFLAGS) -nostdlib -o $@ -Wl,-T,flat.lds $^
+	$(CC) $(CFLAGS) -nostdlib -o $@ -Wl,-T,flat.lds $^
 
 test/bootstrap: test/bootstrap.o
-	gcc -nostdlib -o $@ -Wl,-T,bootstrap.lds $^
+	$(CC) -nostdlib -o $@ -Wl,-T,bootstrap.lds $^
 
 %.o: %.S
-	gcc $(CFLAGS) -c -nostdlib -o $@ $^
+	$(CC) $(CFLAGS) -c -nostdlib -o $@ $^
 
 test/irq.flat: test/print.o
 
diff --git a/user/config-i386.mak b/user/config-i386.mak
new file mode 100644
index 0000000..d2d181b
--- /dev/null
+++ b/user/config-i386.mak
@@ -0,0 +1,7 @@
+LIBDIR = /lib
+cstart.o = test/cstart.o
+bits = 32
+ldarch = elf32-i386
+CFLAGS += -m32
+
+flatfiles=
diff --git a/user/config-x86_64.mak b/user/config-x86_64.mak
new file mode 100644
index 0000000..19ebc46
--- /dev/null
+++ b/user/config-x86_64.mak
@@ -0,0 +1,7 @@
+LIBDIR = /lib64
+cstart.o = test/cstart64.o
+bits = 64
+ldarch = elf64-x86-64
+CFLAGS += -m64
+
+flatfiles = test/access.flat test/irq.flat test/sieve.flat test/simple.flat test/stringio.flat test/memtest1.flat

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 2/2] [FIXED] enable user makefile for cross compile
       [not found]     ` <1191959084-24322-2-git-send-email-jyoung5-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
@ 2007-10-11 14:25       ` Avi Kivity
  0 siblings, 0 replies; 3+ messages in thread
From: Avi Kivity @ 2007-10-11 14:25 UTC (permalink / raw)
  To: Jerone Young; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Jerone Young wrote:
> This patch enables enable makefile in user for cross compile.
> This time is a proper git formatted patch.
>
>   

Thanks, applied both.

-- 
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-10-11 14:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-09 19:44 [PATCH 1/2] enable user configure script for cross compile even more Jerone Young
     [not found] ` <1191959084-24322-1-git-send-email-jyoung5-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2007-10-09 19:44   ` [PATCH 2/2] [FIXED] enable user makefile for cross compile Jerone Young
     [not found]     ` <1191959084-24322-2-git-send-email-jyoung5-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2007-10-11 14:25       ` Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox