diff options
author | Yang Zhang <yang.z.zhang@intel.com> | 2015-08-28 09:58:54 +0800 |
---|---|---|
committer | Yang Zhang <yang.z.zhang@intel.com> | 2015-09-01 12:44:00 +0800 |
commit | e44e3482bdb4d0ebde2d8b41830ac2cdb07948fb (patch) | |
tree | 66b09f592c55df2878107a468a91d21506104d3f /qemu/roms/openbios/config/xml | |
parent | 9ca8dbcc65cfc63d6f5ef3312a33184e1d726e00 (diff) |
Add qemu 2.4.0
Change-Id: Ic99cbad4b61f8b127b7dc74d04576c0bcbaaf4f5
Signed-off-by: Yang Zhang <yang.z.zhang@intel.com>
Diffstat (limited to 'qemu/roms/openbios/config/xml')
-rw-r--r-- | qemu/roms/openbios/config/xml/config-c.xsl | 57 | ||||
-rw-r--r-- | qemu/roms/openbios/config/xml/config-forth.xsl | 41 | ||||
-rw-r--r-- | qemu/roms/openbios/config/xml/dictionary.xsl | 195 | ||||
-rw-r--r-- | qemu/roms/openbios/config/xml/fcode.xsl | 48 | ||||
-rw-r--r-- | qemu/roms/openbios/config/xml/makefile.xsl | 20 | ||||
-rw-r--r-- | qemu/roms/openbios/config/xml/object.xsl | 327 | ||||
-rw-r--r-- | qemu/roms/openbios/config/xml/rules.xml | 34 | ||||
-rw-r--r-- | qemu/roms/openbios/config/xml/util.xsl | 80 | ||||
-rw-r--r-- | qemu/roms/openbios/config/xml/xinclude.xsl | 43 |
9 files changed, 845 insertions, 0 deletions
diff --git a/qemu/roms/openbios/config/xml/config-c.xsl b/qemu/roms/openbios/config/xml/config-c.xsl new file mode 100644 index 000000000..62ed85446 --- /dev/null +++ b/qemu/roms/openbios/config/xml/config-c.xsl @@ -0,0 +1,57 @@ +<?xml version="1.0" encoding="ISO-8859-15" ?> + +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> + + <xsl:template match="/"> + <!-- add comment --> + <xsl:text>/* * Automatically generated C config: don't edit */ </xsl:text> + + <!-- scan all config options --> + <xsl:for-each select="config/option"> + <xsl:choose> + + <!-- config option "boolean" --> + <xsl:when test="@type='boolean'"> + <xsl:choose> + <xsl:when test="@value='true'"> + <xsl:text>#define </xsl:text> + <xsl:value-of select="@name"/> + <xsl:text> 1</xsl:text> + </xsl:when> + <xsl:when test="@value='false'"> + <xsl:text>#undef </xsl:text> + <xsl:value-of select="@name"/> + </xsl:when> + <xsl:otherwise> + <xsl:message terminate="yes"> ERROR: boolean configuration option '<xsl:value-of select="@name"/>' has unsupported value '<xsl:value-of select="@type"/>' instead of [true|false].</xsl:message> + </xsl:otherwise> + </xsl:choose> + </xsl:when> + + <!-- config option "integer" --> + <xsl:when test="@type='integer'"> + <xsl:text>#define </xsl:text> + <xsl:value-of select="@name"/><xsl:text> </xsl:text> + <xsl:value-of select="@value"/> + </xsl:when> + + <!-- config option "string" --> + <xsl:when test="@type='string'"> + <xsl:text>#define </xsl:text> + <xsl:value-of select="@name"/><xsl:text> </xsl:text> "<xsl:value-of select="@value"/>" </xsl:when> + + <!-- unsupported config option: bail out --> + <xsl:otherwise> + <xsl:message terminate="yes"> ERROR: configuration option '<xsl:value-of select="@name"/> has unsupported type '<xsl:value-of select="@type"/>'.</xsl:message> + </xsl:otherwise> + + </xsl:choose> + + <xsl:text> </xsl:text> + </xsl:for-each> + + </xsl:template> + + <xsl:output method="text" indent="no" encoding="iso-8859-15"/> + +</xsl:stylesheet> diff --git a/qemu/roms/openbios/config/xml/config-forth.xsl b/qemu/roms/openbios/config/xml/config-forth.xsl new file mode 100644 index 000000000..cace0deb9 --- /dev/null +++ b/qemu/roms/openbios/config/xml/config-forth.xsl @@ -0,0 +1,41 @@ +<?xml version="1.0" encoding="ISO-8859-15" ?> + +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> + + <xsl:template match="/"> + <xsl:for-each select="config/option"> + <xsl:choose> + <xsl:when test="@type='boolean'"> + <xsl:choose> + <xsl:when test="@value='true'"> + <xsl:text>[DEFINE] </xsl:text> + <xsl:value-of select="@name"/> + <xsl:text> </xsl:text> + </xsl:when> + <xsl:when test="@value='false'"> + <!-- nothing to do --> + </xsl:when> + <xsl:otherwise> + <xsl:message terminate="yes"> ERROR: boolean configuration option '<xsl:value-of select="@name"/>' has unsupported value '<xsl:value-of select="@type"/>' instead of [true|false].</xsl:message> + </xsl:otherwise> + </xsl:choose> + </xsl:when> + <xsl:when test="@type='integer'"> + <!-- this makes absolutely no sense but the old code did it as well --> + <xsl:text>[DEFINE] </xsl:text> + <xsl:value-of select="@name"/> + <xsl:text> </xsl:text> + </xsl:when> + <!-- config option "string" --> + <xsl:when test="@type='string'"> + </xsl:when> + <xsl:otherwise> + <xsl:message terminate="yes"> ERROR: configuration option '<xsl:value-of select="@name"/>' has unsupported type '<xsl:value-of select="@type"/>'.</xsl:message> + </xsl:otherwise> + </xsl:choose> + </xsl:for-each> + </xsl:template> + + <xsl:output method="text" indent="no" encoding="iso-8859-15"/> + +</xsl:stylesheet> diff --git a/qemu/roms/openbios/config/xml/dictionary.xsl b/qemu/roms/openbios/config/xml/dictionary.xsl new file mode 100644 index 000000000..61f62d84c --- /dev/null +++ b/qemu/roms/openbios/config/xml/dictionary.xsl @@ -0,0 +1,195 @@ +<?xml version="1.0" encoding="ISO-8859-15" ?> + +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> + + <xsl:template match="/" mode="dictionaries"> + + <xsl:text> # # dictionary rules # </xsl:text> + + <!-- Set all dictionary source lists empty --> + <xsl:for-each select="//dictionary"> + <xsl:sort select="@name"/> + + <xsl:variable name="conditions"> + <xsl:text>0</xsl:text> + <xsl:for-each select="(ancestor-or-self::*)[@condition!='']"> + <xsl:call-template name="resolve-condition"> + <xsl:with-param select="@condition" name="expression"/> + </xsl:call-template> + </xsl:for-each> + </xsl:variable> + + <xsl:if test="$conditions = 0"> + + <xsl:if test="not(preceding::dictionary/@name = @name)"> + <xsl:value-of select="@name"/> + <xsl:text>-DICTIONARY := </xsl:text> + </xsl:if> + </xsl:if> + </xsl:for-each> + + <!-- Add all forth source files to their dictionaries --> + <xsl:for-each select="//dictionary/object"> + + <xsl:variable name="path"> + <xsl:for-each select="ancestor::build"> + <xsl:call-template name="get-dirname"> + <xsl:with-param select="@base" name="path"/> + </xsl:call-template> + </xsl:for-each> + </xsl:variable> + + <xsl:variable name="conditions"> + <xsl:text>0</xsl:text> + <xsl:for-each select="(ancestor-or-self::*)[@condition!='']"> + <xsl:call-template name="resolve-condition"> + <xsl:with-param select="@condition" name="expression"/> + </xsl:call-template> + </xsl:for-each> + </xsl:variable> + + <xsl:variable name="dictname"> + <xsl:value-of select="parent::*/@name"/> + </xsl:variable> + + <xsl:if test="$conditions=0"> + + <xsl:variable name="source"><xsl:value-of select="@source" /></xsl:variable> + + <!-- Handle just Forth source, not FCode --> + <xsl:if test="not(@target = 'fcode')"> + <xsl:value-of select="$dictname"/><xsl:text>-DICTIONARY:=$(</xsl:text> + <xsl:value-of select="$dictname"/><xsl:text>-DICTIONARY) </xsl:text> + + <xsl:value-of select="$path"/> + <xsl:value-of select="$source"/> + <xsl:text> </xsl:text> + </xsl:if> + + </xsl:if> + </xsl:for-each> + + <xsl:text> </xsl:text> + + <!-- Create targets for all dictionaries --> + <xsl:for-each select="//dictionary"> + <xsl:sort select="@name"/> + + <xsl:variable name="outer-conditions"> + <xsl:text>0</xsl:text> + <xsl:for-each select="(ancestor-or-self::*)[@condition!='']"> + <xsl:call-template name="resolve-condition"> + <xsl:with-param select="@condition" name="expression"/> + </xsl:call-template> + </xsl:for-each> + </xsl:variable> + + <xsl:if test="$outer-conditions = 0"> + + <xsl:if test="not(preceding::dictionary/@name = @name)"> + <xsl:variable name="name"><xsl:value-of select="@name"/></xsl:variable> + <xsl:variable name="init"> + <xsl:value-of select="(//dictionary[@name=$name]/attribute::init)[last()]"/> + </xsl:variable> + <!-- dictionary name and dependencies --> + <xsl:text>$(ODIR)/</xsl:text> + <xsl:value-of select="@name"/><xsl:text>.dict: $(</xsl:text> + <xsl:value-of select="@name"/> + <xsl:text>-DICTIONARY) $(ODIR)/forthstrap</xsl:text> + <xsl:if test="$init!=''"> + <xsl:text> $(ODIR)/</xsl:text><xsl:value-of select="$init"/><xsl:text>.dict</xsl:text> + </xsl:if> + + <!-- Check for Fcode dependency --> + <xsl:for-each select="object[@target = 'fcode']"> + + <xsl:variable name="conditions"> + <xsl:text>0</xsl:text> + <xsl:for-each select="(ancestor-or-self::*)[@condition!='']"> + <xsl:call-template name="resolve-condition"> + <xsl:with-param select="@condition" name="expression"/> + </xsl:call-template> + </xsl:for-each> + </xsl:variable> + + <xsl:if test="$conditions = 0"> + + <xsl:text> $(ODIR)/</xsl:text> + <xsl:value-of select="@source"/> + + </xsl:if> + </xsl:for-each> + + <xsl:text> </xsl:text> + <!-- rule --> + <xsl:text>	$(call quiet-command,$(ODIR)/forthstrap</xsl:text> + <xsl:for-each select="//dictionary[@name = @name]"> + + <xsl:variable name="conditions"> + <xsl:text>0</xsl:text> + <xsl:for-each select="(ancestor-or-self::*)[@condition!='']"> + <xsl:call-template name="resolve-condition"> + <xsl:with-param select="@condition" name="expression"/> + </xsl:call-template> + </xsl:for-each> + </xsl:variable> + + <xsl:variable name="path"> + <xsl:for-each select="ancestor::build"> + <xsl:call-template name="get-dirname"> + <xsl:with-param select="@base" name="path"/> + </xsl:call-template> + </xsl:for-each> + </xsl:variable> + + <xsl:if test="$conditions = 0"> + <xsl:text> -I</xsl:text> + <xsl:text>$(SRCDIR)/</xsl:text> + <xsl:value-of select="$path"/> + </xsl:if> + </xsl:for-each> + + <!-- needed to locate files with full path --> + <xsl:text> -I$(SRCDIR)</xsl:text> + <!-- needed to include config and build date --> + <xsl:text> -I$(ODIR)/forth</xsl:text> + + <xsl:text> -D $@</xsl:text> + <xsl:text> -M $@.d</xsl:text> + <xsl:if test="$init!=''"> + <xsl:text> -d $(ODIR)/</xsl:text><xsl:value-of select="$init"/><xsl:text>.dict</xsl:text> + </xsl:if> + <xsl:text> -c $@-console.log</xsl:text> + <xsl:text> $(</xsl:text> + <xsl:value-of select="@name"/> + <xsl:text>-DICTIONARY)," GEN $(TARGET_DIR)$@") </xsl:text> + </xsl:if> + </xsl:if> + </xsl:for-each> + + <!-- Create dictionaries target containing all dictionaries --> + <xsl:text>dictionaries: </xsl:text> + <xsl:for-each select="//dictionary"> + <xsl:sort select="@name"/> + + <xsl:variable name="conditions"> + <xsl:text>0</xsl:text> + <xsl:for-each select="(ancestor-or-self::*)[@condition!='']"> + <xsl:call-template name="resolve-condition"> + <xsl:with-param select="@condition" name="expression"/> + </xsl:call-template> + </xsl:for-each> + </xsl:variable> + + <xsl:if test="$conditions = 0"> + + <xsl:if test="not(preceding::dictionary/@name = @name)"> + <xsl:text>$(ODIR)/</xsl:text> + <xsl:value-of select="@name"/><xsl:text>.dict </xsl:text> + </xsl:if> + </xsl:if> + </xsl:for-each> + <xsl:text> </xsl:text> + </xsl:template> + +</xsl:stylesheet> diff --git a/qemu/roms/openbios/config/xml/fcode.xsl b/qemu/roms/openbios/config/xml/fcode.xsl new file mode 100644 index 000000000..ccc7e6e84 --- /dev/null +++ b/qemu/roms/openbios/config/xml/fcode.xsl @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="ISO-8859-15" ?> + +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> + + <xsl:template match="/" mode="fcode"> + + <xsl:text> # # fcode rules # </xsl:text> + + <!-- Create linker targets for FCode roms --> + <xsl:for-each select="//fcode"> + <xsl:variable name="outer-conditions"> + <xsl:text>0</xsl:text> + <xsl:for-each select="(ancestor-or-self::*)[@condition!='']"> + <xsl:call-template name="resolve-condition"> + <xsl:with-param select="@condition" name="expression"/> + </xsl:call-template> + </xsl:for-each> + </xsl:variable> + + <xsl:if test="$outer-conditions = 0"> + <xsl:if test="(ancestor-or-self::*)"> + + <xsl:variable name="path"> + <xsl:for-each select="ancestor::build"> + <xsl:call-template name="get-dirname"> + <xsl:with-param select="@base" name="path"/> + </xsl:call-template> + </xsl:for-each> + </xsl:variable> + + <!-- Fcode name --> + <xsl:text>$(ODIR)/</xsl:text> + <xsl:value-of select="@name"/> + <xsl:text>:</xsl:text> + + <xsl:text> $(SRCDIR)/</xsl:text> + <xsl:value-of select="$path"/> + <xsl:value-of select="@source"/> + + <!-- FIXME this requires strict spaces in rules.xml --> + <xsl:value-of select="document('rules.xml',.)//rule[@target='host'][@entity='fcode']"/> + <xsl:text> </xsl:text> + </xsl:if> + </xsl:if> + </xsl:for-each> + + </xsl:template> +</xsl:stylesheet> diff --git a/qemu/roms/openbios/config/xml/makefile.xsl b/qemu/roms/openbios/config/xml/makefile.xsl new file mode 100644 index 000000000..56c494cc6 --- /dev/null +++ b/qemu/roms/openbios/config/xml/makefile.xsl @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="ISO-8859-15" ?> + +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> + + <xsl:include href="util.xsl"/> + <xsl:include href="dictionary.xsl"/> + <xsl:include href="object.xsl"/> + <xsl:include href="fcode.xsl"/> + + <xsl:template match="/"> + <xsl:value-of select="document('rules.xml',.)/rules/pre"/> + <xsl:apply-templates select="." mode="dictionaries"/> + <xsl:apply-templates select="." mode="fcode"/> + <xsl:apply-templates select="." mode="objects"/> + </xsl:template> + + <xsl:output method="text" indent="no" encoding="iso-8859-15"/> + +</xsl:stylesheet> + diff --git a/qemu/roms/openbios/config/xml/object.xsl b/qemu/roms/openbios/config/xml/object.xsl new file mode 100644 index 000000000..cf521f59f --- /dev/null +++ b/qemu/roms/openbios/config/xml/object.xsl @@ -0,0 +1,327 @@ +<?xml version="1.0" encoding="ISO-8859-15" ?> + +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> + + <!-- wrapper that calls "objects" with parameters --> + <xsl:template match="/" mode="objects"> + <xsl:call-template name="objects"> + <xsl:with-param name="target" select="'host'"/> + </xsl:call-template> + <xsl:call-template name="objects"> + <xsl:with-param name="target" select="'target'"/> + </xsl:call-template> + </xsl:template> + + <!-- main work happens here --> + <xsl:template name="objects"> + + <xsl:param name="target"/> + + <xsl:text> # # </xsl:text> + <xsl:value-of select="$target"/> + <xsl:text> compiler rules # </xsl:text> + + <!-- create rules for all compile objects --> + <xsl:for-each select="//object[(ancestor-or-self::*)[@target = $target]]"> + + <xsl:variable name="path"> + <xsl:for-each select="ancestor::build"> + <xsl:call-template name="get-dirname"> + <xsl:with-param select="@base" name="path"/> + </xsl:call-template> + </xsl:for-each> + </xsl:variable> + + <xsl:variable name="conditions"> + <xsl:text>0</xsl:text> + <xsl:for-each select="(ancestor-or-self::*)[@condition!='']"> + <xsl:call-template name="resolve-condition"> + <xsl:with-param select="@condition" name="expression"/> + </xsl:call-template> + </xsl:for-each> + </xsl:variable> + + <xsl:if test="$conditions=0"> + + <!-- full path of object file --> + <xsl:text>$(ODIR)/</xsl:text> + <xsl:value-of select="$target"/> + <xsl:text>/</xsl:text> + <xsl:value-of select="$path"/> + <xsl:value-of select="substring-before(@source,'.')"/> + <xsl:text>.o: </xsl:text> + + <!-- path of source file --> + <xsl:value-of select="$path"/> + <xsl:value-of select="@source"/> + + + <xsl:choose> + <xsl:when test="child::rule"> + <xsl:value-of select="child::rule"/> + <xsl:text> </xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:choose> + <xsl:when test="@flags!=''"> + <xsl:value-of select="document('rules.xml',.)//rule[@target=$target][@entity='object'][@extracflags='1']"/> + <xsl:text> </xsl:text> + <xsl:value-of select="@flags"/> + <xsl:text> </xsl:text> + <xsl:value-of select="document('rules.xml',.)//rule[@target=$target][@entity='object'][@extracflags='2']"/> + </xsl:when> + <xsl:otherwise> + <!-- FIXME this requires strict spaces in rules.xml --> + <xsl:value-of select="document('rules.xml',.)//rule[@target=$target][@entity='object']"/> + </xsl:otherwise> + </xsl:choose> + </xsl:otherwise> + </xsl:choose> + + </xsl:if> + </xsl:for-each> + + <!-- Create linker targets for all executables --> + <xsl:for-each select="//executable"> + + <xsl:variable name="outer-conditions"> + <xsl:text>0</xsl:text> + <xsl:for-each select="(ancestor-or-self::*)[@condition!='']"> + <xsl:call-template name="resolve-condition"> + <xsl:with-param select="@condition" name="expression"/> + </xsl:call-template> + </xsl:for-each> + </xsl:variable> + + <xsl:if test="$outer-conditions = 0"> + <xsl:if test="(ancestor-or-self::*)[@target = $target]"> + + <!-- executable name --> + <xsl:text>$(ODIR)/</xsl:text> + <xsl:value-of select="@name"/> + <xsl:text>:</xsl:text> + + <!-- add all objects --> + <xsl:for-each select="object"> + + <xsl:variable name="conditions"> + <xsl:text>0</xsl:text> + <xsl:for-each select="(ancestor-or-self::*)[@condition!='']"> + <xsl:call-template name="resolve-condition"> + <xsl:with-param select="@condition" name="expression"/> + </xsl:call-template> + </xsl:for-each> + </xsl:variable> + + <xsl:if test="$conditions=0"> + + <xsl:variable name="path"> + <xsl:for-each select="ancestor::build"> + <xsl:call-template name="get-dirname"> + <xsl:with-param select="@base" name="path"/> + </xsl:call-template> + </xsl:for-each> + </xsl:variable> + + <xsl:text> $(ODIR)/</xsl:text> + <xsl:value-of select="$target"/> + <xsl:text>/</xsl:text> + <xsl:value-of select="$path"/> + <xsl:value-of select="substring-before(@source,'.')"/> + <xsl:text>.o</xsl:text> + + </xsl:if> + </xsl:for-each> + + <!-- external objects last --> + <xsl:for-each select="external-object"> + + <xsl:variable name="conditions"> + <xsl:text>0</xsl:text> + <xsl:for-each select="(ancestor-or-self::*)[@condition!='']"> + <xsl:call-template name="resolve-condition"> + <xsl:with-param select="@condition" name="expression"/> + </xsl:call-template> + </xsl:for-each> + </xsl:variable> + + <xsl:if test="$conditions=0"> + <xsl:text> $(ODIR)/</xsl:text> + <xsl:value-of select="@source"/> + </xsl:if> + + </xsl:for-each> + + <!-- print executable rule --> + <xsl:choose> + <xsl:when test="child::rule"> + <xsl:value-of select="child::rule"/> + <xsl:text> </xsl:text> + </xsl:when> + <xsl:otherwise> + <!-- FIXME this requires strict spaces in rules.xml --> + <xsl:value-of select="document('rules.xml',.)//rule[@target=$target][@entity='executable']"/> + </xsl:otherwise> + </xsl:choose> + + </xsl:if> + </xsl:if> + </xsl:for-each> + + <!-- create linker targets for all libs --> + <xsl:for-each select="//library"> + <xsl:sort select="@name"/> + + <xsl:variable name="outer-conditions"> + <xsl:text>0</xsl:text> + <xsl:for-each select="(ancestor-or-self::*)[@condition!='']"> + <xsl:call-template name="resolve-condition"> + <xsl:with-param select="@condition" name="expression"/> + </xsl:call-template> + </xsl:for-each> + </xsl:variable> + + <xsl:if test="$outer-conditions = 0"> + + + <xsl:if test="(ancestor-or-self::*)[@target = $target]"> + + <xsl:if test="not(preceding::library/@name = @name)"> + + <!-- output library name --> + <xsl:text>$(ODIR)/lib</xsl:text> + <xsl:value-of select="@name"/> + + <xsl:choose> + <xsl:when test="@type='static'"> + <xsl:text>.a</xsl:text> + </xsl:when> + <xsl:when test="@type='dynamic'"> + <xsl:text>.so</xsl:text> + </xsl:when> + </xsl:choose> + <xsl:text>: </xsl:text> + + <xsl:variable name="name"><xsl:value-of select="@name"/></xsl:variable> + + <!-- enumerate all objects for library target --> + <xsl:for-each select="//library[@name=$name]/object"> + + <xsl:variable name="conditions"> + <xsl:text>0</xsl:text> + <xsl:for-each select="(ancestor-or-self::*)[@condition!='']"> + <xsl:call-template name="resolve-condition"> + <xsl:with-param select="@condition" name="expression"/> + </xsl:call-template> + </xsl:for-each> + </xsl:variable> + + <xsl:if test="$conditions=0"> + + <xsl:variable name="path"> + <xsl:for-each select="ancestor::build"> + <xsl:call-template name="get-dirname"> + <xsl:with-param select="@base" name="path"/> + </xsl:call-template> + </xsl:for-each> + </xsl:variable> + + <xsl:text>$(ODIR)/</xsl:text> + <xsl:value-of select="$target"/> + <xsl:text>/</xsl:text> + <xsl:value-of select="$path"/> + <xsl:value-of select="substring-before(@source,'.')"/> + <xsl:text>.o </xsl:text> + + </xsl:if> + + </xsl:for-each> + + <!-- external objects last --> + <xsl:for-each select="external-object"> + + <xsl:variable name="conditions"> + <xsl:text>0</xsl:text> + <xsl:for-each select="(ancestor-or-self::*)[@condition!='']"> + <xsl:call-template name="resolve-condition"> + <xsl:with-param select="@condition" name="expression"/> + </xsl:call-template> + </xsl:for-each> + </xsl:variable> + + <xsl:if test="$conditions=0"> + <xsl:text> $(ODIR)/</xsl:text> + <xsl:value-of select="@source"/> + </xsl:if> + + </xsl:for-each> + + + <!-- FIXME this requires strict spaces in rules.xml --> + <xsl:value-of select="document('rules.xml',.)//rule[@target=$target][@entity='library']"/> + + </xsl:if> + </xsl:if> + </xsl:if> + </xsl:for-each> + + <!-- create libs rule for all libraries --> + <xsl:value-of select="$target"/> + <xsl:text>-libraries: </xsl:text> + + <!-- don't build unused libraries + <xsl:for-each select="//library"> + <xsl:if test="object[(ancestor-or-self::*)[@target = $target]]"> + + <xsl:variable name="conditions"> + <xsl:text>0</xsl:text> + <xsl:for-each select="(ancestor-or-self::*)[@condition!='']"> + <xsl:call-template name="resolve-condition"> + <xsl:with-param select="@condition" name="expression"/> + </xsl:call-template> + </xsl:for-each> + </xsl:variable> + <xsl:if test="$conditions=0"> + <xsl:text> $(ODIR)/</xsl:text> + <xsl:text>lib</xsl:text> + <xsl:value-of select="@name"/> + <xsl:choose> + <xsl:when test="@type='static'"> + <xsl:text>.a</xsl:text> + </xsl:when> + <xsl:when test="@type='dynamic'"> + <xsl:text>.so</xsl:text> + </xsl:when> + </xsl:choose> + </xsl:if> + </xsl:if> + </xsl:for-each> + --> + <xsl:text> </xsl:text> + + <!-- create exe rule for all executables --> + <xsl:value-of select="$target"/> + <xsl:text>-executables: </xsl:text> + + <xsl:for-each select="//executable"> + <xsl:if test="(ancestor-or-self::*)[@target = $target]"> + + <xsl:variable name="conditions"> + <xsl:text>0</xsl:text> + <xsl:for-each select="(ancestor-or-self::*)[@condition!='']"> + <xsl:call-template name="resolve-condition"> + <xsl:with-param select="@condition" name="expression"/> + </xsl:call-template> + </xsl:for-each> + </xsl:variable> + <xsl:if test="$conditions=0"> + <xsl:text> $(ODIR)/</xsl:text> + <xsl:value-of select="@name"/> + </xsl:if> + </xsl:if> + </xsl:for-each> + <xsl:text> </xsl:text> + + </xsl:template> + +</xsl:stylesheet> diff --git a/qemu/roms/openbios/config/xml/rules.xml b/qemu/roms/openbios/config/xml/rules.xml new file mode 100644 index 000000000..29a720a06 --- /dev/null +++ b/qemu/roms/openbios/config/xml/rules.xml @@ -0,0 +1,34 @@ +<rules> + <!-- host compiler build rules --> +<rule target="host" entity="executable"> + $(call quiet-command,$(HOSTCC) $(HOSTCFLAGS) -o $@ $^," HOSTCC $(TARGET_DIR)$@") +</rule> +<rule target="host" entity="object"> + $(call quiet-command,$(HOSTCC) $(HOSTCFLAGS) $(HOSTINCLUDES) -c -o $@ $<," HOSTCC $(TARGET_DIR)$@") +</rule> +<rule target="host" entity="object" extracflags="1"> + $(call quiet-command,$(HOSTCC) $(HOSTCFLAGS) $(HOSTINCLUDES)</rule> +<rule target="host" entity="object" extracflags="2"> -c -o $@ $<," HOSTCC $(TARGET_DIR)$@") +</rule> +<rule target="host" entity="library"> + $(call quiet--command,$(AR) cru $@ $^; $(RANLIB) $@," HOSTAR $(TARGET_DIR)$@") +</rule> +<rule target="host" entity="fcode"> + $(call quiet-command,$(TOKE) -o $@ $^," TOKE $(TARGET_DIR)$@") +</rule> + + <!-- target/cross compiler build rules --> +<rule target="target" entity="executable"> + $(call quiet-command,$(CC) $(CFLAGS) -o $@ $^," CC $(TARGET_DIR)$@") +</rule> +<rule target="target" entity="object"> + $(call quiet-command,$(CC) $$EXTRACFLAGS $(CFLAGS) $(INCLUDES) -c -o $@ $<," CC $(TARGET_DIR)$@") +</rule> +<rule target="target" entity="object" extracflags="1"> + $(call quiet-command,$(CC) $$EXTRACFLAGS $(CFLAGS) $(INCLUDES)</rule> +<rule target="target" entity="object" extracflags="2"> -c -o $@ $<," CC $(TARGET_DIR)$@") +</rule> +<rule target="target" entity="library"> + $(call quiet-command,$(AR) cru $@ $^; $(RANLIB) $@," AR $(TARGET_DIR)$@") +</rule> +</rules> diff --git a/qemu/roms/openbios/config/xml/util.xsl b/qemu/roms/openbios/config/xml/util.xsl new file mode 100644 index 000000000..3b583b9ac --- /dev/null +++ b/qemu/roms/openbios/config/xml/util.xsl @@ -0,0 +1,80 @@ +<?xml version="1.0" encoding="ISO-8859-15" ?> + +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> + +<!-- get-dirname: get directory part of file $path--> + +<!-- call me with: + <xsl:param name="path"> + <xsl:for-each select="ancestor::build"> + <xsl:call-template name="get-dirname"> + <xsl:with-param select="@base" name="path"/> + </xsl:call-template> + </xsl:for-each> + </xsl:param> + --> + +<xsl:template name="get-dirname"> + <xsl:param name="path"/> + <xsl:choose> + <xsl:when test="contains($path, '/')"> + <xsl:choose> + <xsl:when test="substring($path, string-length($path)) != '/'"> + <xsl:call-template name="get-dirname"> + <xsl:with-param select="substring($path, 1, string-length($path)-1)" name="path"/> + </xsl:call-template> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$path"/> + </xsl:otherwise> + </xsl:choose> + </xsl:when> + <xsl:otherwise> + <xsl:message terminate="yes"> + No valid relative path + </xsl:message> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<!-- return value: 0=found, 1=not found --> +<xsl:template name="resolve-condition"> + <xsl:param name="expression"/> + <xsl:param name="confexpr">CONFIG_<xsl:value-of select="$expression"/></xsl:param> + + <xsl:choose> + <xsl:when test="$expression!=''"> + <xsl:variable name="value"><xsl:value-of select="document('config.xml',.)//option[@name=$confexpr]/attribute::value"/></xsl:variable> + <xsl:variable name="type"><xsl:value-of select="document('config.xml',.)//option[@name=$confexpr]/attribute::type"/></xsl:variable> + <xsl:choose> + <xsl:when test="$type='boolean'"> + <xsl:choose> + <xsl:when test="$value='true'"><xsl:text>0</xsl:text></xsl:when> + <xsl:when test="$value='false'"><xsl:text>1</xsl:text></xsl:when> + <!-- boolean but no value is false --> + <xsl:when test="$value=''"><xsl:text>1</xsl:text></xsl:when> + <xsl:otherwise> + <xsl:message terminate="yes">Error:<xsl:value-of select="$confexpr"/> has no valid value '<xsl:value-of select="$value"/>'.</xsl:message> + </xsl:otherwise> + + </xsl:choose> + </xsl:when> + <!-- if it doesn't exist, it is false --> + <xsl:when test="$type=''"><xsl:text>1</xsl:text></xsl:when> + <xsl:otherwise> + <xsl:message terminate="yes">Error:<xsl:value-of select="$confexpr"/> is not a boolean value ('<xsl:value-of select="$type"/>').</xsl:message> + </xsl:otherwise> + </xsl:choose> + <!-- debug - -> + <xsl:message> + <xsl:value-of select="$confexpr"/> = <xsl:value-of select="$value"/> + </xsl:message> + <!- - --> + </xsl:when> + <!-- if no expression is there we return true --> + <xsl:otherwise>0</xsl:otherwise> + </xsl:choose> +</xsl:template> + + +</xsl:stylesheet> diff --git a/qemu/roms/openbios/config/xml/xinclude.xsl b/qemu/roms/openbios/config/xml/xinclude.xsl new file mode 100644 index 000000000..5bcbf535e --- /dev/null +++ b/qemu/roms/openbios/config/xml/xinclude.xsl @@ -0,0 +1,43 @@ +<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + + <!-- + Stefans own xinclude implementation. + We really don't want to bother the users with namespaces + --> + + <xsl:output method="xml" indent="yes"/> + <xsl:strip-space elements="*"/> + + <xsl:template match="node() | @*"> + <xsl:copy> + <xsl:apply-templates select="@* | node()"/> + </xsl:copy> + </xsl:template> + + +<!-- <xsl:template match="xi:include" xmlns:xi="http://www.w3.org/2001/XInclude"> --> + <xsl:template match="include"> + <xsl:variable name="href"><xsl:value-of select="@href"/> + </xsl:variable> + <xsl:for-each select="document(@href)"> + <!-- + <xsl:copy><xsl:copy-of select="@*"/> + <xsl:attribute name="base"> + <xsl:value-of select="$href"/> + </xsl:attribute> + <xsl:apply-templates select="node()" /> + </xsl:copy> + --> + <xsl:element name="{local-name(*)}" namespace="{namespace-uri(..)}"> + <xsl:copy-of select="*/@*"/> + <xsl:attribute name="base"> + <xsl:value-of select="$href"/> + </xsl:attribute> + <xsl:for-each select="*"> + <xsl:apply-templates/> + </xsl:for-each> + </xsl:element> + </xsl:for-each> + </xsl:template> + +</xsl:stylesheet> |