From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Ehrhardt Subject: Re: [PATCH 1/5] Enable top level configure script for cross compile Date: Mon, 08 Oct 2007 09:49:01 +0200 Message-ID: <4709E0ED.7010709@linux.vnet.ibm.com> References: <1191820205.8106.25.camel@laptop> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Cc: kvm-devel To: jyoung5-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org Return-path: In-Reply-To: <1191820205.8106.25.camel@laptop> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org Hi, I saw that you derive $target_cpu from arch as I know it from your older in= ternal and external patches. Now you added the configure command line option --target-cpu to allow to ov= erwrite that $arch derived target. a) do you have some use cases in mind where you need an overwritten target = instead the one derived from $arch ? b) if it is needed, please add a small description to the usage() output Kind regards, = Christian Ehrhardt Jerone Young wrote: > This patch adds cross compile capability to the top level configure > script. > = > Signed-off-by: Jerone Young > = > = > ------------------------------------------------------------------------ > = > diff -r f48e521e0add configure > --- a/configure Wed Oct 03 21:00:03 2007 -0500 > +++ b/configure Thu Oct 04 14:59:16 2007 -0500 > @@ -5,13 +5,17 @@ want_module=3D1 > want_module=3D1 > qemu_cc=3D$(ls /usr/bin/gcc3* /usr/bin/gcc-3* 2>/dev/null | tail -n1) > disable_gcc_check=3D > +cross_prefix=3D > +arch=3D`uname -m` > +target_cpu=3D > = > usage() { > cat <<-EOF > Usage: $0 [options] > = > Options include: > - > + --arch=3DARCH architecture to compile for ($arch) > + --cross-prefix=3DPREFIX prefix for cross compiler > --prefix=3DPREFIX where to install things ($prefix) > --with-patched-kernel don't use external module > --kerneldir=3DDIR kernel build directory ($kerneldir) > @@ -53,6 +57,15 @@ while [[ "$1" =3D -* ]]; do > --disable-gcc-check) > disable_gcc_check=3D1 > ;; > + --arch) > + arch=3D"$arg" > + ;; > + --cross-prefix) > + cross_prefix=3D"$arg" > + ;; > + --target-cpu) > + target_cpu=3D"$arg" > + ;; = > --help) > usage > ;; > @@ -62,7 +75,7 @@ while [[ "$1" =3D -* ]]; do > esac > done > = > -if [[ -z "$qemu_cc" ]]; then > +if [[ -z "$qemu_cc" ]] && [[ -z "$cross_prefix" ]]; then > echo "$0: cannot locate gcc 3.x. please install it or specify with -= -qemu-cc" > exit 1 > fi > @@ -72,29 +85,48 @@ if (( want_module )); then > libkvm_kerneldir=3D$(readlink -f kernel) > fi > = > -target_cpu() { > - if [[ $(uname -m) =3D i?86 ]]; then > - echo x86_64 > - else > - uname -m > +#if arch is an x86 arch set to i386 > +if [[ $arch =3D i?86 ]]; then > + arch=3D"i386" > +fi > + > +#see if using a cross compiler or not > +compiler=3D > +qemu_opts=3D > +user_opts=3D > +if [[ -z $cross_prefix ]]; then > + qemu_opts+=3D" --cc=3D$qemu_cc" > + user_opts+=3D" --cc=3D$qemu_cc" > +else > + qemu_opts+=3D" --cross-prefix=3D$cross_prefix" > + user_opts+=3D" --cross-prefix=3D$cross_prefix" > +fi > + > +#set parameters compiling > +if [ "$arch" =3D "i386" -o "$arch" =3D "x86_64" ]; then > + if [[ -z $target_cpu ]]; then > + target_cpu=3D"x86_64" > fi > -} > + qemu_opts+=3D" --enable-alsa" > +fi > = > -(cd user; ./configure --prefix=3D"$prefix" --kerneldir=3D"$libkvm_kernel= dir") > -(cd qemu; ./configure --target-list=3D$(target_cpu)-softmmu --cc=3D"$qem= u_cc" \ > +#configure user dir > +(cd user; ./configure --prefix=3D"$prefix" --kerneldir=3D"$libkvm_kernel= dir" \ > + $user_opts --arch=3D"$arch") > +(cd qemu; ./configure --target-list=3D$target_cpu-softmmu \ > --disable-kqemu --extra-cflags=3D"-I $PWD/../user" \ > --extra-ldflags=3D"-L $PWD/../user" \ > --enable-kvm --kernel-path=3D"$libkvm_kerneldir" \ > - --enable-alsa \ > ${disable_gcc_check:+"--disable-gcc-check"} \ > - --prefix=3D"$prefix" > + --prefix=3D"$prefix" \ > + $qemu_opts --cpu=3D"$arch" > ) > = > = > - > cat < config.mak > +ARCH=3D$arch > PREFIX=3D$prefix > KERNELDIR=3D$kerneldir > WANT_MODULE=3D$want_module > +CC=3D$cross_prefix$qemu_cc > 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/ > = > = > ------------------------------------------------------------------------ > = > _______________________________________________ > kvm-devel mailing list > kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org > https://lists.sourceforge.net/lists/listinfo/kvm-devel -- = Gr=FCsse / regards, = Christian Ehrhardt IBM Linux Technology Center, Open Virtualization +49 7031/16-3385 Ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org Ehrhardt-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org IBM Deutschland Entwicklung GmbH Vorsitzender des Aufsichtsrats: Johann Weihen = Gesch=E4ftsf=FChrung: Herbert Kircher = Sitz der Gesellschaft: B=F6blingen Registergericht: Amtsgericht Stuttgart, HRB 243294 ------------------------------------------------------------------------- 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/