xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] stubdom: support Mini-OS config for Mini-OS apps
@ 2016-08-30 11:52 Juergen Gross
  2016-08-30 13:52 ` Wei Liu
  0 siblings, 1 reply; 3+ messages in thread
From: Juergen Gross @ 2016-08-30 11:52 UTC (permalink / raw)
  To: xen-devel; +Cc: Juergen Gross, samuel.thibault, wei.liu2

Mini-OS apps need to be compiled with the appropriate config settings
of Mini-OS, as there are various dependencies on those settings in
header files included by the apps.

Enhance stubdom Makefile to set the appropriate CPPFLAGS when calling
the apps' make.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
 stubdom/Makefile            | 48 +++++++++++++++++++++++++++++++++------------
 stubdom/xenstore-minios.cfg |  1 +
 2 files changed, 36 insertions(+), 13 deletions(-)

diff --git a/stubdom/Makefile b/stubdom/Makefile
index 2044d76..d7a47f0 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -425,13 +425,16 @@ libxc-$(XEN_TARGET_ARCH)/libxenctrl.a: mk-headers-$(XEN_TARGET_ARCH) libxentooll
 # ioemu
 #######
 
+ioemu-minios-config.mk: $(CURDIR)/ioemu-minios.cfg
+	MINIOS_CONFIG="$<" CONFIG_FILE="$(CURDIR)/$@" $(MAKE) DESTDIR= -C $(MINI_OS) config
+
 .PHONY: ioemu
-ioemu: cross-zlib cross-libpci libxc
+ioemu: cross-zlib cross-libpci libxc ioemu-minios-config.mk
 	[ -f ioemu/config-host.mak ] || \
 	  ( $(buildmakevars2shellvars); \
 	    cd ioemu ; \
 	    LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) \
-	    TARGET_CPPFLAGS="$(TARGET_CPPFLAGS)" \
+	    TARGET_CPPFLAGS="$(TARGET_CPPFLAGS) $(shell cat ioemu-minios-config.mk)" \
 	    TARGET_CFLAGS="$(TARGET_CFLAGS)" \
 	    TARGET_LDFLAGS="$(TARGET_LDFLAGS)" \
 	    $(QEMU_ROOT)/xen-setup-stubdom )
@@ -441,33 +444,45 @@ ioemu: cross-zlib cross-libpci libxc
 # caml
 ######
 
+caml-minios-config.mk: $(CURDIR)/caml/minios.cfg
+	MINIOS_CONFIG="$<" CONFIG_FILE="$(CURDIR)/$@" $(MAKE) DESTDIR= -C $(MINI_OS) config
+
 .PHONY: caml
 caml: $(CROSS_ROOT)
-	CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C $@ LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) OCAMLC_CROSS_PREFIX=$(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/bin/
+	CPPFLAGS="$(TARGET_CPPFLAGS) $(shell cat caml-minios-config.mk)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C $@ LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) OCAMLC_CROSS_PREFIX=$(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/bin/
 
 ###
 # C
 ###
 
+c-minios-config.mk: $(CURDIR)/c/minios.cfg
+	MINIOS_CONFIG="$<" CONFIG_FILE="$(CURDIR)/$@" $(MAKE) DESTDIR= -C $(MINI_OS) config
+
 .PHONY: c
-c: $(CROSS_ROOT)
-	CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C $@ LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) 
+c: $(CROSS_ROOT) c-minios-config.mk
+	CPPFLAGS="$(TARGET_CPPFLAGS) $(shell cat c-minios-config.mk)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C $@ LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) 
 
 ######
 # VTPM
 ######
 
+vtpm-minios-config.mk: $(CURDIR)/vtpm/minios.cfg
+	MINIOS_CONFIG="$<" CONFIG_FILE="$(CURDIR)/$@" $(MAKE) DESTDIR= -C $(MINI_OS) config
+
 .PHONY: vtpm
-vtpm: cross-polarssl cross-tpmemu
-	XEN_TARGET_ARCH="$(XEN_TARGET_ARCH)" CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) -C $@
+vtpm: cross-polarssl cross-tpmemu vtpm-minios-config.mk
+	XEN_TARGET_ARCH="$(XEN_TARGET_ARCH)" CPPFLAGS="$(TARGET_CPPFLAGS) $(shell cat vtpm-minios-config.mk)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) -C $@
 
 ######
 # VTPMMGR
 ######
 
+vtpmmgr-minios-config.mk: $(CURDIR)/vtpmmgr/minios.cfg
+	MINIOS_CONFIG="$<" CONFIG_FILE="$(CURDIR)/$@" $(MAKE) DESTDIR= -C $(MINI_OS) config
+
 .PHONY: vtpmmgr
-vtpmmgr: cross-polarssl
-	XEN_TARGET_ARCH="$(XEN_TARGET_ARCH)" CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) -C $@
+vtpmmgr: cross-polarssl vtpmmgr-minios-config.mk
+	XEN_TARGET_ARCH="$(XEN_TARGET_ARCH)" CPPFLAGS="$(TARGET_CPPFLAGS) $(shell cat vtpmmgr-minios-config.mk)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) -C $@
 
 ######
 # Grub
@@ -483,18 +498,24 @@ grub-upstream: grub-$(GRUB_VERSION).tar.gz
 		patch -d $@ -p1 < $$i || exit 1; \
 	done
 
+grub-$(XEN_TARGET_ARCH)-minios-config.mk: $(CURDIR)/grub/minios.cfg
+	MINIOS_CONFIG="$<" CONFIG_FILE="$(CURDIR)/$@" $(MAKE) DESTDIR= -C $(MINI_OS) config
+
 .PHONY: grub
-grub: cross-polarssl grub-upstream $(CROSS_ROOT)
+grub: cross-polarssl grub-upstream $(CROSS_ROOT) grub-$(XEN_TARGET_ARCH)-minios-config.mk
 	mkdir -p grub-$(XEN_TARGET_ARCH)
-	CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C $@ OBJ_DIR=$(CURDIR)/grub-$(XEN_TARGET_ARCH)
+	CPPFLAGS="$(TARGET_CPPFLAGS) $(shell cat grub-$(XEN_TARGET_ARCH)-minios-config.mk)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C $@ OBJ_DIR=$(CURDIR)/grub-$(XEN_TARGET_ARCH)
 
 ##########
 # xenstore
 ##########
 
+xenstore-minios-config.mk: $(CURDIR)/xenstore-minios.cfg
+	MINIOS_CONFIG="$<" CONFIG_FILE="$(CURDIR)/$@" $(MAKE) DESTDIR= -C $(MINI_OS) config
+
 .PHONY: xenstore
-xenstore: $(CROSS_ROOT)
-	CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C $@ xenstored.a CONFIG_STUBDOM=y
+xenstore: $(CROSS_ROOT) xenstore-minios-config.mk
+	CPPFLAGS="$(TARGET_CPPFLAGS) $(shell cat xenstore-minios-config.mk)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C $@ xenstored.a CONFIG_STUBDOM=y
 
 ########
 # minios
@@ -586,6 +607,7 @@ clean:
 	$(MAKE) -C vtpmmgr clean
 	rm -fr grub-$(XEN_TARGET_ARCH)
 	rm -f $(STUBDOMPATH)
+	rm -f *-minios-config.mk
 	[ ! -e libs-$(XEN_TARGET_ARCH)/toollog/Makefile ] || $(MAKE) DESTDIR= -C libs-$(XEN_TARGET_ARCH)/toollog clean
 	[ ! -e libs-$(XEN_TARGET_ARCH)/evtchn/Makefile ] || $(MAKE) DESTDIR= -C libs-$(XEN_TARGET_ARCH)/evtchn clean
 	[ ! -e libs-$(XEN_TARGET_ARCH)/gnttab/Makefile ] || $(MAKE) DESTDIR= -C libs-$(XEN_TARGET_ARCH)/gnttab clean
diff --git a/stubdom/xenstore-minios.cfg b/stubdom/xenstore-minios.cfg
index 6a09cce..931caea 100644
--- a/stubdom/xenstore-minios.cfg
+++ b/stubdom/xenstore-minios.cfg
@@ -5,3 +5,4 @@ CONFIG_KBDFRONT=n
 CONFIG_CONSFRONT=n
 CONFIG_XENBUS=n
 CONFIG_LWIP=n
+XEN_INTERFACE_VERSION=__XEN_LATEST_INTERFACE_VERSION__
-- 
2.6.6


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

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

* Re: [PATCH] stubdom: support Mini-OS config for Mini-OS apps
  2016-08-30 11:52 [PATCH] stubdom: support Mini-OS config for Mini-OS apps Juergen Gross
@ 2016-08-30 13:52 ` Wei Liu
  2016-08-30 14:02   ` Juergen Gross
  0 siblings, 1 reply; 3+ messages in thread
From: Wei Liu @ 2016-08-30 13:52 UTC (permalink / raw)
  To: Juergen Gross; +Cc: xen-devel, wei.liu2, samuel.thibault

On Tue, Aug 30, 2016 at 01:52:40PM +0200, Juergen Gross wrote:
> Mini-OS apps need to be compiled with the appropriate config settings
> of Mini-OS, as there are various dependencies on those settings in
> header files included by the apps.
> 
> Enhance stubdom Makefile to set the appropriate CPPFLAGS when calling
> the apps' make.
> 
> Signed-off-by: Juergen Gross <jgross@suse.com>
> ---
>  stubdom/Makefile            | 48 +++++++++++++++++++++++++++++++++------------
>  stubdom/xenstore-minios.cfg |  1 +

Changes to gitignore is missing.

And, do I need to update mini-os commit in Config.mk here as well?

The code looks fine to me.

Wei.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

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

* Re: [PATCH] stubdom: support Mini-OS config for Mini-OS apps
  2016-08-30 13:52 ` Wei Liu
@ 2016-08-30 14:02   ` Juergen Gross
  0 siblings, 0 replies; 3+ messages in thread
From: Juergen Gross @ 2016-08-30 14:02 UTC (permalink / raw)
  To: Wei Liu; +Cc: xen-devel, samuel.thibault

On 30/08/16 15:52, Wei Liu wrote:
> On Tue, Aug 30, 2016 at 01:52:40PM +0200, Juergen Gross wrote:
>> Mini-OS apps need to be compiled with the appropriate config settings
>> of Mini-OS, as there are various dependencies on those settings in
>> header files included by the apps.
>>
>> Enhance stubdom Makefile to set the appropriate CPPFLAGS when calling
>> the apps' make.
>>
>> Signed-off-by: Juergen Gross <jgross@suse.com>
>> ---
>>  stubdom/Makefile            | 48 +++++++++++++++++++++++++++++++++------------
>>  stubdom/xenstore-minios.cfg |  1 +
> 
> Changes to gitignore is missing.

Right. And I thought of it in the corresponding Mini-OS patch. Going to
fetch some coffee...

> And, do I need to update mini-os commit in Config.mk here as well?

Yeah, I'll add that info.

> The code looks fine to me.

Thanks,

Juergen


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

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

end of thread, other threads:[~2016-08-30 14:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-30 11:52 [PATCH] stubdom: support Mini-OS config for Mini-OS apps Juergen Gross
2016-08-30 13:52 ` Wei Liu
2016-08-30 14:02   ` Juergen Gross

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).