Patchwork Added package v86d which provides a real-mode helper for uvesafb driver.

login
register
mail settings
Submitter Dimitry Golubovsky
Date May 9, 2012, 10:41 a.m.
Message ID <1336560101-29035-1-git-send-email-golubovsky@gmail.com>
Download mbox | patch
Permalink /patch/157896/
State Superseded
Headers show

Comments

Dimitry Golubovsky - May 9, 2012, 10:41 a.m.
Signed-off-by: Dmitry <golubovsky@gmail.com>
---
 package/Config.in      |    1 +
 package/v86d/Config.in |    9 +++++++++
 package/v86d/v86d.mk   |   30 ++++++++++++++++++++++++++++++
 3 files changed, 40 insertions(+), 0 deletions(-)
 create mode 100644 package/v86d/Config.in
 create mode 100644 package/v86d/v86d.mk
Arnout Vandecappelle - May 11, 2012, 10:39 p.m.
On 05/09/12 12:41, Dmitry wrote:
[snip]
> +# This flag to configure should be per target architecture rather than
> +# autodetected (or it will be per host architecture which may be
> +# not the same as target).
> +
> +X86EMU = $(if $(BR2_i386),n,y)

  This comment was not very clear to me.  I guess you mean
# The configure script autodetects the host architecture, so we must
# pass the target architecture explicitly.

> +
> +# v86d's configure script is not autoconf-based.
> +# GENTARGETS macro will be used rather than AUTOTARGETS.
> +
> +define V86D_CONFIGURE_CMDS
> +	(cd $(@D) ; ./configure --with-debug=n --with-klibc=n --with-x86emu=$(X86EMU))
> +endef
> +
> +# It is necessary to define __i386__ explicitly for successful compilation.
> +
> +define V86D_BUILD_CMDS
> +	$(MAKE) CC="$(TARGET_CC) -D__i386__" LD="$(TARGET_LD)" -C $(@D) all
> +endef

  When you use GENTARGETS, you must also specify the install commands.
However, you can probably keep using AUTOTARGETS.  Even when you use
AUTOTARGETS, it is possible to override the CONFIGURE_CMDS and BUILD_CMDS.
But you don't even need to override the BUILD_CMDS.  Instead, you can
pass additional options to the MAKE call, by defining

V86D_MAKE_OPT += CC="$(TARGET_CC) -D__i386__"

  (As Thomas mentioned, if you assign twice on the command line it is only
the last one that counts.)

  I can't guarantee that what I'm saying is correct, though, so be sure to
test with a clean build before resending.

  Regards,
  Arnout


> +
> +$(eval $(call GENTARGETS))
Dimitry Golubovsky - May 12, 2012, 5:01 a.m.
Arnout,

On Fri, May 11, 2012 at 6:39 PM, Arnout Vandecappelle <arnout@mind.be> wrote:
> On 05/09/12 12:41, Dmitry wrote:
> [snip]
>
>> +# This flag to configure should be per target architecture rather than
>> +# autodetected (or it will be per host architecture which may be
>> +# not the same as target).
>> +
>> +X86EMU = $(if $(BR2_i386),n,y)
>
>
>  This comment was not very clear to me.  I guess you mean
> # The configure script autodetects the host architecture, so we must
> # pass the target architecture explicitly.

Thanks for your feedback. Indeed, the configure script calls uname -m
by default, that is, assumes host architecture is same as target's.

>
>  When you use GENTARGETS, you must also specify the install commands.

And if I don't then standard "cd $(@D); make install" or anything
similar will be used? Somehow it works without explicit install
command specification.

> However, you can probably keep using AUTOTARGETS.  Even when you use
> AUTOTARGETS, it is possible to override the CONFIGURE_CMDS and BUILD_CMDS.

Due to the way v86d configure is written GENTARGETS seems to be more
proper - I got convinced.

> But you don't even need to override the BUILD_CMDS.  Instead, you can
> pass additional options to the MAKE call, by defining
>
> V86D_MAKE_OPT += CC="$(TARGET_CC) -D__i386__"

What I have in the patch I provided, was tested build-wise on i386 and
x86-64 targets (but the program itself was only tested in 32bit mode).
I tried that Thomas suggested (redefine CFLAGS), it did not work. I
don't see much sense in changing the working command from what is in
my patch.

Thanks.
Arnout Vandecappelle - May 12, 2012, 2:30 p.m.
On 05/12/12 07:01, Dmitry Golubovsky wrote:
> Arnout,
>
> On Fri, May 11, 2012 at 6:39 PM, Arnout Vandecappelle<arnout@mind.be>  wrote:
[snip]
>>   When you use GENTARGETS, you must also specify the install commands.
>
> And if I don't then standard "cd $(@D); make install" or anything
> similar will be used? Somehow it works without explicit install
> command specification.

  No, with GENTARGETS the install commands are empty by default.  Or you sure
it's not the old binary from a previous compilation that you see in your
target dir?

  I tried it with a clean build and there's no v86d or testvbe in the target
dir.


>> However, you can probably keep using AUTOTARGETS.  Even when you use
>> AUTOTARGETS, it is possible to override the CONFIGURE_CMDS and BUILD_CMDS.
>
> Due to the way v86d configure is written GENTARGETS seems to be more
> proper - I got convinced.

  The non-existent MAKETARGETS would be even better :-)


>> But you don't even need to override the BUILD_CMDS.  Instead, you can
>> pass additional options to the MAKE call, by defining
>>
>> V86D_MAKE_OPT += CC="$(TARGET_CC) -D__i386__"
>
> What I have in the patch I provided, was tested build-wise on i386 and
> x86-64 targets (but the program itself was only tested in 32bit mode).
> I tried that Thomas suggested (redefine CFLAGS), it did not work. I
> don't see much sense in changing the working command from what is in
> my patch.

  Sure, it's OK as it is (except for the install target of course).
Merely pointing out an alternative.

  Regards,
  Arnout
Dimitry Golubovsky - May 14, 2012, 3:54 a.m.
Forgot to copy the list.


---------- Forwarded message ----------
From: Dmitry Golubovsky <golubovsky@gmail.com>
Date: Sun, May 13, 2012 at 11:52 PM
Subject: Re: [Buildroot] [PATCH] Added package v86d which provides a
real-mode helper for uvesafb driver.
To: Arnout Vandecappelle <arnout@mind.be>


Arnout,

On Sat, May 12, 2012 at 10:30 AM, Arnout Vandecappelle <arnout@mind.be> wrote:
>  I tried it with a clean build and there's no v86d or testvbe in the target
> dir.

Indeed, my omission. Thanks for pointing me out.

>>> But you don't even need to override the BUILD_CMDS.  Instead, you can
>>> pass additional options to the MAKE call, by defining
>>>
>>> V86D_MAKE_OPT += CC="$(TARGET_CC) -D__i386__"

>  Sure, it's OK as it is (except for the install target of course).
> Merely pointing out an alternative.

Thanks, but I'll stay with what I have.

I am resending the patch - hopefully it is good t go now.

--
Dmitry Golubovsky

Anywhere on the Web

Patch

diff --git a/package/Config.in b/package/Config.in
index 34c0280..208e66f 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -230,6 +230,7 @@  source "package/unionfs/Config.in"
 source "package/usb_modeswitch/Config.in"
 source "package/usbmount/Config.in"
 source "package/usbutils/Config.in"
+source "package/v86d/Config.in"
 source "package/wipe/Config.in"
 source "package/xfsprogs/Config.in"
 endmenu
diff --git a/package/v86d/Config.in b/package/v86d/Config.in
new file mode 100644
index 0000000..ba1baca
--- /dev/null
+++ b/package/v86d/Config.in
@@ -0,0 +1,9 @@ 
+config BR2_PACKAGE_V86D
+	bool "v86d"
+	depends on (BR2_i386 || BR2_x86_64)
+	help
+	  v86d is the userspace helper that runs x86 code in an emulated
+	  environment. uvesafb will not work without v86d. v86d currently
+	  supports the x86 and amd64 (x86-64) architectures.
+
+	  http://dev.gentoo.org/~spock/projects/uvesafb/
diff --git a/package/v86d/v86d.mk b/package/v86d/v86d.mk
new file mode 100644
index 0000000..c909061
--- /dev/null
+++ b/package/v86d/v86d.mk
@@ -0,0 +1,30 @@ 
+############################################
+#
+# v86d
+# 
+############################################
+
+V86D_VERSION = 0.1.10
+V86D_SOURCE = v86d-$(V86D_VERSION).tar.bz2
+V86D_SITE = http://dev.gentoo.org/~spock/projects/uvesafb/archive
+
+# This flag to configure should be per target architecture rather than
+# autodetected (or it will be per host architecture which may be 
+# not the same as target).
+
+X86EMU = $(if $(BR2_i386),n,y)
+
+# v86d's configure script is not autoconf-based.
+# GENTARGETS macro will be used rather than AUTOTARGETS.
+
+define V86D_CONFIGURE_CMDS
+	(cd $(@D) ; ./configure --with-debug=n --with-klibc=n --with-x86emu=$(X86EMU))
+endef
+
+# It is necessary to define __i386__ explicitly for successful compilation.
+
+define V86D_BUILD_CMDS
+	$(MAKE) CC="$(TARGET_CC) -D__i386__" LD="$(TARGET_LD)" -C $(@D) all
+endef
+
+$(eval $(call GENTARGETS))