summaryrefslogtreecommitdiffstats
path: root/trunk/bitbake-ng
diff options
context:
space:
mode:
Diffstat (limited to 'trunk/bitbake-ng')
-rw-r--r--trunk/bitbake-ng/ChangeLog36
-rw-r--r--trunk/bitbake-ng/Makefile.am19
-rw-r--r--trunk/bitbake-ng/acinclude.m411
-rw-r--r--trunk/bitbake-ng/bitbake-0.0.pc.in10
-rwxr-xr-xtrunk/bitbake-ng/config/autogen.sh3
-rw-r--r--trunk/bitbake-ng/config/version.m416
-rw-r--r--trunk/bitbake-ng/configure.ac114
-rw-r--r--trunk/bitbake-ng/doc/Makefile.am11
-rw-r--r--trunk/bitbake-ng/doc/design_spec/Makefile.am20
-rw-r--r--trunk/bitbake-ng/doc/design_spec/design_spec.xml156
-rw-r--r--trunk/bitbake-ng/doc/design_spec/html.css281
-rw-r--r--trunk/bitbake-ng/doc/doxygen.am186
-rw-r--r--trunk/bitbake-ng/doc/doxygen.cfg212
-rw-r--r--trunk/bitbake-ng/doc/ramblings/bbtree.txt39
-rw-r--r--trunk/bitbake-ng/doc/ramblings/bitbakeng-metadata.txt103
-rw-r--r--trunk/bitbake-ng/doc/ramblings/bitbakeng-parser-frontend.txt21
-rw-r--r--trunk/bitbake-ng/include/Makefile.am2
-rw-r--r--trunk/bitbake-ng/include/bitbake.h40
-rw-r--r--trunk/bitbake-ng/include/bitbake/common.h82
-rw-r--r--trunk/bitbake-ng/include/bitbake/data-private.h139
-rw-r--r--trunk/bitbake-ng/include/bitbake/data.h183
-rw-r--r--trunk/bitbake-ng/include/bitbake/recipe-modules.h50
-rw-r--r--trunk/bitbake-ng/include/bitbake/recipe.h58
-rw-r--r--trunk/bitbake-ng/m4/external/check.m4133
-rw-r--r--trunk/bitbake-ng/m4/internal/binreloc.m476
-rw-r--r--trunk/bitbake-ng/m4/internal/doxygen.m4312
-rw-r--r--trunk/bitbake-ng/m4/internal/visibility.m474
-rw-r--r--trunk/bitbake-ng/src/Makefile.am12
-rw-r--r--trunk/bitbake-ng/src/binreloc.c436
-rw-r--r--trunk/bitbake-ng/src/binreloc.h121
-rw-r--r--trunk/bitbake-ng/src/data.c173
-rw-r--r--trunk/bitbake-ng/tests/Makefile.am19
-rw-r--r--trunk/bitbake-ng/tests/check_bitbake_data.c125
33 files changed, 3273 insertions, 0 deletions
diff --git a/trunk/bitbake-ng/ChangeLog b/trunk/bitbake-ng/ChangeLog
new file mode 100644
index 000000000..3c8fc2d0b
--- /dev/null
+++ b/trunk/bitbake-ng/ChangeLog
@@ -0,0 +1,36 @@
+2005-01-17 Chris Larson <kergoth@handhelds.org>
+
+ * design_spec.xml: Add specification of the metadata component,
+ update vim modeline to set the filetype to 'docbk'.
+
+2005-01-13 Chris Larson <kergoth@handhelds.org>
+
+ * Minor rearranging.. now we have m4/internal and m4/external,
+ to make it possible to run autoreconf in this tree even on
+ machines without 'check' installed.
+
+2005-01-10 Chris Larson <kergoth@handhelds.org>
+
+ * Update library linking so that the dev symlink is
+ libbitbake-[release].so rather than libbitbake.so.
+
+2005-01-09 Chris Larson <kergoth@handhelds.org>
+
+ * Correct library linking to set libtool's versioning.
+ * Add 'test' target to makefiles, which runs the 'check' unit tests.
+ * Add pkgconfig .pc file.
+
+2005-01-08 Chris Larson <kergoth@handhelds.org>
+
+ * Improve documentation generation. Use a decent set of
+ autoconf macros to handle selection of the types of
+ doxygen output (taken from the "doxample" project).
+ * Use 'check' (http://check.sourceforge.net/) for unit testing.
+ * Add basic variable insert/remove/lookup implementations for the
+ bitbake metadata (RAM backed for now).
+
+2004-12-30 Chris Larson <kergoth@handhelds.org>
+
+ * Create initial tree for bitbake-ng.
+ * Add autoconf macros for gcc 4.0 (and patched 3.4.x) symbol visibility.
+ * Add initial BitBake-ng Design Specification document.
diff --git a/trunk/bitbake-ng/Makefile.am b/trunk/bitbake-ng/Makefile.am
new file mode 100644
index 000000000..fe77f381d
--- /dev/null
+++ b/trunk/bitbake-ng/Makefile.am
@@ -0,0 +1,19 @@
+SUBDIRS = include src tests doc
+
+ACLOCAL_AMFLAGS = -I m4/internal -I m4/external
+AUTOMAKE_OPTIONS = foreign 1.6
+
+MAINT_CLEAN_FILES_AUX = config.guess config.sub depcomp \
+ install-sh missing ltmain.sh \
+ compile mkinstalldirs
+MAINT_CLEAN_FILES_TOP = config.h.in aclocal.m4 \
+ configure Makefile.in stamp-h.in
+MAINT_CLEAN_FILES = $(foreach f,$(MAINT_CLEAN_FILES_TOP),$(top_srcdir)/$(f) $(top_srcdir)/$(f)\~) \
+ $(foreach f,$(MAINT_CLEAN_FILES_AUX),$(auxdir)/$(f) $(auxdir)/$(f)\~)
+
+maintainer-clean-local:
+ rm -f $(MAINT_CLEAN_FILES)
+
+.PHONY: test
+test:
+ @$(MAKE) -C tests $@
diff --git a/trunk/bitbake-ng/acinclude.m4 b/trunk/bitbake-ng/acinclude.m4
new file mode 100644
index 000000000..41bc14038
--- /dev/null
+++ b/trunk/bitbake-ng/acinclude.m4
@@ -0,0 +1,11 @@
+# BB_DEFAULT_FLAGS
+# ----------
+# Set our default FLAGS variables.
+# Remember to call before the AC_PROG_ variables, otherwise those
+# defaults will be used instead of ours.
+AC_DEFUN([BB_DEFAULT_FLAGS],
+[
+ if test x"$CFLAGS" = "x"; then
+ CFLAGS="-O2 -Wall -W"
+ fi
+]) # BB_DEFAULT_FLAGS
diff --git a/trunk/bitbake-ng/bitbake-0.0.pc.in b/trunk/bitbake-ng/bitbake-0.0.pc.in
new file mode 100644
index 000000000..9ed4c60a2
--- /dev/null
+++ b/trunk/bitbake-ng/bitbake-0.0.pc.in
@@ -0,0 +1,10 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: @PACKAGE@
+Description: @PACKAGE_DESCRIPTION@
+Version: @PACKAGE_VERSION@
+Libs: -L${libdir} -lbitbake-@LT_RELEASE@
+Cflags: -I${includedir}/bitbake-@LT_RELEASE@
diff --git a/trunk/bitbake-ng/config/autogen.sh b/trunk/bitbake-ng/config/autogen.sh
new file mode 100755
index 000000000..adb32b638
--- /dev/null
+++ b/trunk/bitbake-ng/config/autogen.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+autoreconf -f -i -I `pwd`/m4
diff --git a/trunk/bitbake-ng/config/version.m4 b/trunk/bitbake-ng/config/version.m4
new file mode 100644
index 000000000..fa0421320
--- /dev/null
+++ b/trunk/bitbake-ng/config/version.m4
@@ -0,0 +1,16 @@
+dnl bitbake-ng package version
+m4_define([BITBAKE_VER], [0.1])
+
+dnl bitbake-ng library "release" version
+dnl "0.0" in bitbake-ng-0.0.so
+dnl Increment on API break.
+m4_define([BITBAKE_LT_REL], [0.0])
+
+dnl bitbake-ng libtool library version
+
+dnl Current, increment on ABI break
+m4_define([BITBAKE_LT_CUR], [0])
+dnl Revision, increment at release
+m4_define([BITBAKE_LT_REV], [0])
+dnl Age
+m4_define([BITBAKE_LT_AGE], [0])
diff --git a/trunk/bitbake-ng/configure.ac b/trunk/bitbake-ng/configure.ac
new file mode 100644
index 000000000..39d826192
--- /dev/null
+++ b/trunk/bitbake-ng/configure.ac
@@ -0,0 +1,114 @@
+# get our package versions
+m4_include([config/version.m4])
+
+
+# initialization
+AC_INIT(bitbake-ng, BITBAKE_VER, bitbake-dev@lists.berlios.de)
+AC_PREREQ(2.57)
+
+AC_CONFIG_SRCDIR([include/bitbake.h])
+AC_CONFIG_AUX_DIR(config)
+AM_CONFIG_HEADER([config.h])
+
+AM_INIT_AUTOMAKE
+
+
+PACKAGE_DESCRIPTION="A library for the execution of recipes."
+AC_SUBST([PACKAGE_DESCRIPTION])
+
+# library versioning
+LT_RELEASE=BITBAKE_LT_REL
+AC_SUBST([LT_RELEASE])
+
+LT_CURRENT=BITBAKE_LT_CUR
+AC_SUBST([LT_CURRENT])
+
+LT_REVISION=BITBAKE_LT_REV
+AC_SUBST([LT_REVISION])
+
+LT_AGE=BITBAKE_LT_AGE
+AC_SUBST([LT_AGE])
+
+
+# system
+AC_CANONICAL_SYSTEM
+
+
+# paths
+auxdir="\$(top_srcdir)/$ac_aux_dir"
+AC_SUBST(auxdir)
+
+reldatadir="\$(datadir)/bitbake-\$(LT_RELEASE)"
+rellibdir="\$(libdir)/bitbake-\$(LT_RELEASE)"
+relincludedir="\$(includedir)/bitbake-\$(LT_RELEASE)"
+AC_SUBST([reldatadir])
+AC_SUBST([rellibdir])
+AC_SUBST([relincludedir])
+
+
+# programs
+BB_DEFAULT_FLAGS
+
+AC_PROG_CC
+BB_CC_HIDDEN_VISIBILITY
+
+AC_PROG_LIBTOOL
+AC_SUBST(LIBTOOL_DEPS)
+
+
+
+# dependencies
+PKG_CHECK_MODULES([GLIB2], [glib-2.0])
+
+
+# docbook documentation
+AC_CHECK_PROGS([XMLLINT], [xmllint])
+AC_CHECK_PROGS([XSLTPROC], [xsltproc])
+
+# doxygen documentation
+DX_HTML_FEATURE(ON)
+DX_CHM_FEATURE(OFF)
+DX_CHI_FEATURE(OFF)
+DX_MAN_FEATURE(ON)
+DX_RTF_FEATURE(OFF)
+DX_XML_FEATURE(OFF)
+DX_PDF_FEATURE(ON)
+DX_PS_FEATURE(OFF)
+DX_INIT_DOXYGEN($PACKAGE, [doc/doxygen.cfg], [doc/doxygen])
+
+
+# options
+AC_MSG_CHECKING([whether user requested building tests])
+AC_ARG_ENABLE(tests,
+ AS_HELP_STRING([--enable-tests],
+ [Enable building of tests (default=no)]),
+ [enable_tests=$enableval],
+ [enable_tests=no])
+AC_MSG_RESULT($enable_tests)
+AM_CONDITIONAL(BB_TESTS, test "$enable_tests" = "yes")
+
+# see if 'check', the unit testing framework, is installed
+if test x"$enable_tests" != "xno"; then
+ AM_PATH_CHECK
+fi
+
+
+# other
+AM_BINRELOC
+
+
+# This variable is used to indicate whether we're compiling
+# a part of our library itself, or external binaries.
+BBDLL_EXPORTS="-DBBDLL_EXPORTS"
+AC_SUBST([BBDLL_EXPORTS])
+
+
+# output
+AC_CONFIG_FILES([Makefile
+ include/Makefile
+ src/Makefile
+ tests/Makefile
+ doc/Makefile
+ doc/design_spec/Makefile
+ bitbake-0.0.pc])
+AC_OUTPUT
diff --git a/trunk/bitbake-ng/doc/Makefile.am b/trunk/bitbake-ng/doc/Makefile.am
new file mode 100644
index 000000000..914cc4149
--- /dev/null
+++ b/trunk/bitbake-ng/doc/Makefile.am
@@ -0,0 +1,11 @@
+SUBDIRS = design_spec
+
+MOSTLYCLEANFILES = $(DX_CLEANFILES)
+EXTRA_DIST = $(DX_CONFIG)
+
+include doxygen.am
+
+all: doxygen-doc
+
+maintainer-clean-local:
+ rm -f $(srcdir)/Makefile.in
diff --git a/trunk/bitbake-ng/doc/design_spec/Makefile.am b/trunk/bitbake-ng/doc/design_spec/Makefile.am
new file mode 100644
index 000000000..92fd80171
--- /dev/null
+++ b/trunk/bitbake-ng/doc/design_spec/Makefile.am
@@ -0,0 +1,20 @@
+BUILT_SOURCES = html/index.html
+xmldoc = design_spec.xml
+cssfile = html.css
+docbooktypes = html
+
+
+html/index.html: $(xmldoc) html/docbook.css
+ $(XMLLINT) --xinclude --postvalid --noout $(xmldoc)
+ $(XSLTPROC) --stringparam base.dir html/ --stringparam html.stylesheet docbook.css http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl $(xmldoc)
+
+html/docbook.css:
+ install -d html
+ install -m 0644 $(cssfile) $@
+
+install-hook: install-design-spec
+install-design-spec:
+ install -d $(docdir)/design_spec/html
+ install -m 0644 html/*.html $(docdir)/design_spec/html
+
+CLEANFILES = html/*
diff --git a/trunk/bitbake-ng/doc/design_spec/design_spec.xml b/trunk/bitbake-ng/doc/design_spec/design_spec.xml
new file mode 100644
index 000000000..00fa10c5f
--- /dev/null
+++ b/trunk/bitbake-ng/doc/design_spec/design_spec.xml
@@ -0,0 +1,156 @@
+<?xml version="1.0"?>
+<!--
+ ex:ts=4:sw=4:sts=4:et:ft=docbk
+ -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+-->
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
+<book>
+ <bookinfo>
+ <title>BitBake-Ng Design Specification</title>
+ <authorgroup>
+ <corpauthor>BitBake Team</corpauthor>
+ </authorgroup>
+ <copyright>
+ <year>2004</year>
+ <year>2005</year>
+ <holder>Chris Larson</holder>
+ </copyright>
+ <legalnotice>
+ <para>This work is licensed under the Creative Commons Attribution License. To view a copy of this license, visit <ulink url="http://creativecommons.org/licenses/by/2.0/">http://creativecommons.org/licenses/by/2.0/</ulink> or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.</para>
+ </legalnotice>
+ </bookinfo>
+ <preface>
+ <title>Introduction</title>
+ <para>It is said that a developer should always plan on at least one rewrite in a given project. Such is the case here. This document outlines the design of bitbake 2.0, the upcoming rewrite of the BitBake project. It is expected that the reader will have at least a passing familiarity with the bitbake project. I would recommend perusing the <ulink url="http://bitbake.berlios.de/manual/">bitbake users manual</ulink> if this is not the case.</para>
+ </preface>
+ <preface>
+ <title>Terminology</title>
+ <table><title>Terminology</title>
+ <tgroup cols='2'>
+ <colspec colname='term'/>
+ <colspec colname='definition'/>
+ <tbody>
+ <row>
+ <entry>Recipe</entry>
+ <entry>A set of directions with a list of ingredients for making or preparing something. In this context, an ordered sequence of steps to be executed, with associated metadata.</entry>
+ </row>
+ <row>
+ <entry>Recipe Box</entry>
+ <entry>The bitbake component that manages the available recipes.</entry>
+ </row>
+ <row>
+ <entry>Metadata</entry>
+ <entry>The bitbake component that manages the metadata for bitbake recipes. The <quote>ingredients</quote>, as it were.</entry>
+ </row>
+ <row>
+ <entry>Bakers</entry>
+ <entry>The bitbake component consisting of the threads that execute recipes, obeying recipe interdependencies.</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </preface>
+ <chapter>
+ <title>General Requirements</title>
+ <itemizedlist>
+ <listitem><para><emphasis>MUST</emphasis> be thread-safe.</para></listitem>
+ </itemizedlist>
+ </chapter>
+ <chapter>
+ <title>Components</title>
+ <section>
+ <title>Metadata</title>
+ <section>
+ <title>Overview</title>
+ <para>The <quote>metadata</quote> component governs the backend datastore for bitbake. It will store all the metadata associated with bitbake's recipes. This may or may not include actual functions, depending on the nature of the recipes being used.</para>
+ </section>
+ <section>
+ <title>Requirements</title>
+ <itemizedlist>
+ <listitem><para>The metadata is expected to be in the form of key/value pairs.</para></listitem>
+ <listitem><para>There needs to be a means of specifying metadata about other metadata (key/value pairs that correspond to a specific existing key).</para></listitem>
+ <listitem><para>We know from the previous implementation that it is very important that we keep memory usage down, and ensure that we do not have multiple copies of the same metadata in RAM at any given time.</para></listitem>
+ </itemizedlist>
+ </section>
+ <section>
+ <title>Component Architecture</title>
+ <para>The metadata for a given recipe will be laid out as a hash table. Each key (UTF-8 string) in the table will be associated with a <quote>BitBake variable</quote>. A BitBake variable consists of the following:</para>
+ <para>
+ <itemizedlist>
+ <listitem><para>linked list of variables that refer to this one</para></listitem>
+ <listitem><para>linked list of <quote>variable chunks</quote></para></listitem>
+ <listitem><para>a cached value (UTF-8 string), which is the resolved form of the variable chunks</para></listitem>
+ <listitem><para><quote>dirty</quote> flag to indicate whether the cached value is current</para></listitem>
+ </itemizedlist>
+ </para>
+ <para>Variable chunks are independent, ordered, components of the value of a given piece of metadata. A chunk can take the form of a string or a reference to another variable. The cached form will be updated automatically whenever a variable that we refer to changes.</para>
+ </section>
+ </section>
+ <section>
+ <title>Recipes</title>
+ <section>
+ <title>Overview</title>
+ <para>The <quote>recipe</quote> component governs the parsing, storing, and execution of individual bitbake recipes. A bitbake recipe consists of an ordered sequence of steps to be executed and the associated metadata.</para>
+ </section>
+ <section>
+ <title>Requirements</title>
+ <itemizedlist>
+ <listitem><para>The parsers should be token-based rather than regular expression based.</para></listitem>
+ <listitem>
+ <para>We need to support multiple file formats for our metadata:</para>
+ <itemizedlist>
+ <listitem><para>.conf</para></listitem>
+ <listitem><para>.bb</para></listitem>
+ <listitem><para>.inc</para></listitem>
+ <listitem><para>.bbclass</para></listitem>
+ </itemizedlist>
+ </listitem>
+ <listitem><para>The file formats need to be well defined and have a BNF syntax.</para></listitem>
+ <listitem><para>The file formats need to be easily editable by a user.</para></listitem>
+ <listitem><para>We should ensure that very little escaping is necessary in the use of our metadata for the common case (avoid using ${} for variable expansion, for example, because that's what the shell uses).</para></listitem>
+ <listitem><para>The parser must do a good job of detecting and reporting syntax errors.</para></listitem>
+ <listitem><para>The valid escape sequences (i.e. \n, \r) and anything else that needs escaping must be well defined and documented.</para></listitem>
+ <listitem><para>We must have well defined namespaces/scopes, with defined rules for merging them (inheritence/inclusion).</para></listitem>
+ </itemizedlist>
+ </section>
+ <section>
+ <title>Component Architecture</title>
+ <para>A bitbake recipe consists of a number of individual pieces. Naturally, being a recipe, it has a set of ordered steps to be followed. It also has a set of ingredients (associated bitbake metadata). The first of the bitbake specific aspects of the recipe is that it has links to its <quote>parents</quote>. The parents of a given bitbake recipe are essentially the context for the recipe, or the <quote>scope</quote> the recipe is in. This may be global user specified configuration parameters, or <quote>classes</quote> to abstract out common parts of the recipe. To give a real world example, you might have a recipe class for cookies. Each recipe has its own unique steps, but for the most part, the steps involved in making cookies are the same.</para>
+ </section>
+ </section>
+ <section>
+ <title>Recipe Box</title>
+ <para><emphasis>Insert content here.</emphasis></para>
+ </section>
+ <section>
+ <title>Bakers</title>
+ <section>
+ <title>Requirements</title>
+ <itemizedlist>
+ <listitem><para>We must be able to build .bb files in dependency order (package A depends on package B).</para></listitem>
+ <listitem><para>We must handle inter-task dependency for a single .bb.</para></listitem>
+ <listitem><para>We <emphasis>MAY</emphasis> want to allow inter-task dependencies across package boundaries (package A's configure and compile tasks depend on package B's staging task).</para></listitem>
+ <listitem><para>We must handle PROVIDES, and multiple-provides situations (the user must be able to extert control over what providers they would prefer and/or require).</para></listitem>
+ <listitem><para>We should support multiple interpreters for the executed code (python, shell, etc).</para></listitem>
+ <listitem><para>We need to handle package version comparisons when selecting providers, and again, the user needs to be able to extert control over this.</para></listitem>
+ <listitem><para>It would be useful if there was a way to depend on a condition regarding another package's metadata. In other words, package A depends on package B being built in a certain way.</para></listitem>
+ </itemizedlist>
+ </section>
+ <section>
+ <title>Possible Solutions</title>
+ <itemizedlist>
+ <listitem><para><emphasis>Insert content here.</emphasis></para></listitem>
+ </itemizedlist>
+ </section>
+ <section>
+ <title>Implementation Decision</title>
+ <para><emphasis>Insert content here.</emphasis></para>
+ </section>
+ </section>
+ </chapter>
+ <chapter>
+ <title>Component Relationships</title>
+ <para><emphasis>Insert content here.</emphasis></para>
+ </chapter>
+</book>
diff --git a/trunk/bitbake-ng/doc/design_spec/html.css b/trunk/bitbake-ng/doc/design_spec/html.css
new file mode 100644
index 000000000..6eedfd318
--- /dev/null
+++ b/trunk/bitbake-ng/doc/design_spec/html.css
@@ -0,0 +1,281 @@
+/* Feuille de style DocBook du projet Traduc.org */
+/* DocBook CSS stylesheet of the Traduc.org project */
+
+/* (c) Jean-Philippe Guérard - 14 août 2004 */
+/* (c) Jean-Philippe Guérard - 14 August 2004 */
+
+/* Cette feuille de style est libre, vous pouvez la */
+/* redistribuer et la modifier selon les termes de la Licence */
+/* Art Libre. Vous trouverez un exemplaire de cette Licence sur */
+/* http://tigreraye.org/Petit-guide-du-traducteur.html#licence-art-libre */
+
+/* This work of art is free, you can redistribute it and/or */
+/* modify it according to terms of the Free Art license. You */
+/* will find a specimen of this license on the Copyleft */
+/* Attitude web site: http://artlibre.org as well as on other */
+/* sites. */
+/* Please note that the French version of this licence as shown */
+/* on http://tigreraye.org/Petit-guide-du-traducteur.html#licence-art-libre */
+/* is only official licence of this document. The English */
+/* is only provided to help you understand this licence. */
+
+/* La dernière version de cette feuille de style est toujours */
+/* disponible sur : http://tigreraye.org/style.css */
+/* Elle est également disponible sur : */
+/* http://www.traduc.org/docs/HOWTO/lecture/style.css */
+
+/* The latest version of this stylesheet is available from: */
+/* http://tigreraye.org/style.css */
+/* It is also available on: */
+/* http://www.traduc.org/docs/HOWTO/lecture/style.css */
+
+/* N'hésitez pas à envoyer vos commentaires et corrections à */
+/* Jean-Philippe Guérard <jean-philippe.guerard@tigreraye.org> */
+
+/* Please send feedback and bug reports to */
+/* Jean-Philippe Guérard <jean-philippe.guerard@tigreraye.org> */
+
+/* $Id: style.css,v 1.14 2004/09/10 20:12:09 fevrier Exp fevrier $ */
+
+/* Présentation générale du document */
+/* Overall document presentation */
+
+body {
+ /*
+ font-family: Apolline, "URW Palladio L", Garamond, jGaramond,
+ "Bitstream Cyberbit", "Palatino Linotype", serif;
+ */
+ margin: 7%;
+ background-color: white;
+}
+
+/* Taille du texte */
+/* Text size */
+
+* { font-size: 100%; }
+
+/* Gestion des textes mis en relief imbriqués */
+/* Embedded emphasis */
+
+em { font-style: italic; }
+em em { font-style: normal; }
+em em em { font-style: italic; }
+
+/* Titres */
+/* Titles */
+
+h1 { font-size: 200%; font-weight: 900; }
+h2 { font-size: 160%; font-weight: 900; }
+h3 { font-size: 130%; font-weight: bold; }
+h4 { font-size: 115%; font-weight: bold; }
+h5 { font-size: 108%; font-weight: bold; }
+h6 { font-weight: bold; }
+
+/* Nom de famille en petites majuscules (uniquement en français) */
+/* Last names in small caps (for French only) */
+
+*[class~="surname"]:lang(fr) { font-variant: small-caps; }
+
+/* Blocs de citation */
+/* Quotation blocs */
+
+div[class~="blockquote"] {
+ border: solid 2px #AAA;
+ padding: 5px;
+ margin: 5px;
+}
+
+div[class~="blockquote"] > table {
+ border: none;
+}
+
+/* Blocs litéraux : fond gris clair */
+/* Literal blocs: light gray background */
+
+*[class~="literallayout"] {
+ background: #f0f0f0;
+ padding: 5px;
+ margin: 5px;
+}
+
+/* Programmes et captures texte : fond bleu clair */
+/* Listing and text screen snapshots: light blue background */
+
+*[class~="programlisting"], *[class~="screen"] {
+ background: #f0f0ff;
+ padding: 5px;
+ margin: 5px;
+}
+
+/* Les textes à remplacer sont surlignés en vert pâle */
+/* Replaceable text in highlighted in pale green */
+
+*[class~="replaceable"] {
+ background-color: #98fb98;
+ font-style: normal; }
+
+/* Tables : fonds gris clair & bords simples */
+/* Tables: light gray background and solid borders */
+
+*[class~="table"] *[class~="title"] { width:100%; border: 0px; }
+
+table {
+ border: 1px solid #aaa;
+ border-collapse: collapse;
+ padding: 2px;
+ margin: 5px;
+}
+
+/* Listes simples en style table */
+/* Simples lists in table presentation */
+
+table[class~="simplelist"] {
+ background-color: #F0F0F0;
+ margin: 5px;
+ border: solid 1px #AAA;
+}
+
+table[class~="simplelist"] td {
+ border: solid 1px #AAA;
+}
+
+/* Les tables */
+/* Tables */
+
+*[class~="table"] table {
+ background-color: #F0F0F0;
+ border: solid 1px #AAA;
+}
+*[class~="informaltable"] table { background-color: #F0F0F0; }
+
+th,td {
+ vertical-align: baseline;
+ text-align: left;
+ padding: 0.1em 0.3em;
+ empty-cells: show;
+}
+
+/* Alignement des colonnes */
+/* Colunms alignment */
+
+td[align=center] , th[align=center] { text-align: center; }
+td[align=right] , th[align=right] { text-align: right; }
+td[align=left] , th[align=left] { text-align: left; }
+td[align=justify] , th[align=justify] { text-align: justify; }
+
+/* Pas de marge autour des images */
+/* No inside margins for images */
+
+img { border: 0; }
+
+/* Les liens ne sont pas soulignés */
+/* No underlines for links */
+
+:link , :visited , :active { text-decoration: none; }
+
+/* Prudence : cadre jaune et fond jaune clair */
+/* Caution: yellow border and light yellow background */
+
+*[class~="caution"] {
+ border: solid 2px yellow;
+ background-color: #ffffe0;
+ padding: 1em 6px 1em ;
+ margin: 5px;
+}
+
+*[class~="caution"] th {
+ vertical-align: middle
+}
+
+*[class~="caution"] table {
+ background-color: #ffffe0;
+ border: none;
+}
+
+/* Note importante : cadre jaune et fond jaune clair */
+/* Important: yellow border and light yellow background */
+
+*[class~="important"] {
+ border: solid 2px yellow;
+ background-color: #ffffe0;
+ padding: 1em 6px 1em;
+ margin: 5px;
+}
+
+*[class~="important"] th {
+ vertical-align: middle
+}
+
+*[class~="important"] table {
+ background-color: #ffffe0;
+ border: none;
+}
+
+/* Mise en évidence : texte légèrement plus grand */
+/* Highlights: slightly larger texts */
+
+*[class~="highlights"] {
+ font-size: 110%;
+}
+
+/* Note : cadre bleu et fond bleu clair */
+/* Notes: blue border and light blue background */
+
+*[class~="note"] {
+ border: solid 2px #7099C5;
+ background-color: #f0f0ff;
+ padding: 1em 6px 1em ;
+ margin: 5px;
+}
+
+*[class~="note"] th {
+ vertical-align: middle
+}
+
+*[class~="note"] table {
+ background-color: #f0f0ff;
+ border: none;
+}
+
+/* Astuce : cadre vert et fond vert clair */
+/* Tip: green border and light green background */
+
+*[class~="tip"] {
+ border: solid 2px #00ff00;
+ background-color: #f0ffff;
+ padding: 1em 6px 1em ;
+ margin: 5px;
+}
+
+*[class~="tip"] th {
+ vertical-align: middle;
+}
+
+*[class~="tip"] table {
+ background-color: #f0ffff;
+ border: none;
+}
+
+/* Avertissement : cadre rouge et fond rouge clair */
+/* Warning: red border and light red background */
+
+*[class~="warning"] {
+ border: solid 2px #ff0000;
+ background-color: #fff0f0;
+ padding: 1em 6px 1em ;
+ margin: 5px;
+}
+
+*[class~="warning"] th {
+ vertical-align: middle;
+}
+
+
+*[class~="warning"] table {
+ background-color: #fff0f0;
+ border: none;
+}
+
+/* Fin */
+/* The End */
+
diff --git a/trunk/bitbake-ng/doc/doxygen.am b/trunk/bitbake-ng/doc/doxygen.am
new file mode 100644
index 000000000..420049eca
--- /dev/null
+++ b/trunk/bitbake-ng/doc/doxygen.am
@@ -0,0 +1,186 @@
+# Copyright (C) 2004 Oren Ben-Kiki
+# This file is distributed under the same terms as the Automake macro files.
+
+# Generate automatic documentation using Doxygen. Goals and variables values
+# are controlled by the various DX_COND_??? conditionals set by autoconf.
+#
+# The provided goals are:
+# doxygen-doc: Generate all doxygen documentation.
+# doxygen-run: Run doxygen, which will generate some of the documentation
+# (HTML, CHM, CHI, MAN, RTF, XML) but will not do the post
+# processing required for the rest of it (PS, PDF, and some MAN).
+# doxygen-man: Rename some doxygen generated man pages.
+# doxygen-ps: Generate doxygen PostScript documentation.
+# doxygen-pdf: Generate doxygen PDF documentation.
+#
+# Note that by default these are not integrated into the automake goals. If
+# doxygen is used to generate man pages, you can achieve this integration by
+# setting man3_MANS to the list of man pages generated and then adding the
+# dependency:
+#
+# $(man3_MANS): doxygen-doc
+#
+# This will cause make to run doxygen and generate all the documentation.
+#
+# The following variable is intended for use in Makefile.am:
+#
+# DX_CLEANFILES = everything to clean.
+#
+# This is usually added to MOSTLYCLEANFILES.
+
+## --------------------------------- ##
+## Format-independent Doxygen rules. ##
+## --------------------------------- ##
+
+if DX_COND_doc
+
+## ------------------------------- ##
+## Rules specific for HTML output. ##
+## ------------------------------- ##
+
+if DX_COND_html
+
+DX_CLEAN_HTML = @DX_DOCDIR@/html
+
+endif DX_COND_html
+
+## ------------------------------ ##
+## Rules specific for CHM output. ##
+## ------------------------------ ##
+
+if DX_COND_chm
+
+DX_CLEAN_CHM = @DX_DOCDIR@/chm
+
+if DX_COND_chi
+
+DX_CLEAN_CHI = @DX_DOCDIR@/@PACKAGE@.chi
+
+endif DX_COND_chi
+
+endif DX_COND_chm
+
+## ------------------------------ ##
+## Rules specific for MAN output. ##
+## ------------------------------ ##
+
+if DX_COND_man
+
+DX_CLEAN_MAN = @DX_DOCDIR@/man
+
+endif DX_COND_man
+
+## ------------------------------ ##
+## Rules specific for RTF output. ##
+## ------------------------------ ##
+
+if DX_COND_rtf
+
+DX_CLEAN_RTF = @DX_DOCDIR@/rtf
+
+endif DX_COND_rtf
+
+## ------------------------------ ##
+## Rules specific for XML output. ##
+## ------------------------------ ##
+
+if DX_COND_xml
+
+DX_CLEAN_XML = @DX_DOCDIR@/xml
+
+endif DX_COND_xml
+
+## ----------------------------- ##
+## Rules specific for PS output. ##
+## ----------------------------- ##
+
+if DX_COND_ps
+
+DX_CLEAN_PS = @DX_DOCDIR@/@PACKAGE@.ps
+
+DX_PS_GOAL = doxygen-ps
+
+doxygen-ps: @DX_DOCDIR@/@PACKAGE@.ps
+
+@DX_DOCDIR@/@PACKAGE@.ps: @DX_DOCDIR@/@PACKAGE@.tag
+ cd @DX_DOCDIR@/latex; \
+ rm -f *.aux *.toc *.idx *.ind *.ilg *.log *.out; \
+ $(DX_LATEX) refman.tex; \
+ $(MAKEINDEX_PATH) refman.idx; \
+ $(DX_LATEX) refman.tex; \
+ countdown=5; \
+ while $(DX_EGREP) 'Rerun (LaTeX|to get cross-references right)' \
+ refman.log > /dev/null 2>&1 \
+ && test $$countdown -gt 0; do \
+ $(DX_LATEX) refman.tex; \
+ countdown=`expr $$countdown - 1`; \
+ done; \
+ $(DX_DVIPS) -o ../@PACKAGE@.ps refman.dvi
+
+endif DX_COND_ps
+
+## ------------------------------ ##
+## Rules specific for PDF output. ##
+## ------------------------------ ##
+
+if DX_COND_pdf
+
+DX_CLEAN_PDF = @DX_DOCDIR@/@PACKAGE@.pdf
+
+DX_PDF_GOAL = doxygen-pdf
+
+doxygen-pdf: @DX_DOCDIR@/@PACKAGE@.pdf
+
+@DX_DOCDIR@/@PACKAGE@.pdf: @DX_DOCDIR@/@PACKAGE@.tag
+ cd @DX_DOCDIR@/latex; \
+ rm -f *.aux *.toc *.idx *.ind *.ilg *.log *.out; \
+ $(DX_PDFLATEX) refman.tex; \
+ $(DX_MAKEINDEX) refman.idx; \
+ $(DX_PDFLATEX) refman.tex; \
+ countdown=5; \
+ while $(DX_EGREP) 'Rerun (LaTeX|to get cross-references right)' \
+ refman.log > /dev/null 2>&1 \
+ && test $$countdown -gt 0; do \
+ $(DX_PDFLATEX) refman.tex; \
+ countdown=`expr $$countdown - 1`; \
+ done; \
+ mv refman.pdf ../@PACKAGE@.pdf
+
+endif DX_COND_pdf
+
+## ------------------------------------------------- ##
+## Rules specific for LaTeX (shared for PS and PDF). ##
+## ------------------------------------------------- ##
+
+if DX_COND_latex
+
+DX_CLEAN_LATEX = @DX_DOCDIR@/latex
+
+endif DX_COND_latex
+
+.PHONY: doxygen-run doxygen-doc $(DX_PS_GOAL) $(DX_PDF_GOAL)
+
+.INTERMEDIATE: doxygen-run $(DX_PS_GOAL) $(DX_PDF_GOAL)
+
+doxygen-run: @DX_DOCDIR@/@PACKAGE@.tag
+
+doxygen-doc: doxygen-run $(DX_PS_GOAL) $(DX_PDF_GOAL)
+
+@DX_DOCDIR@/@PACKAGE@.tag: $(DX_CONFIG) $(pkginclude_HEADERS)
+ rm -rf @DX_DOCDIR@
+ $(DX_ENV) $(DX_DOXYGEN) $(srcdir)/$(DX_CONFIG)
+
+DX_CLEANFILES = \
+ @DX_DOCDIR@/@PACKAGE@.tag \
+ -r \
+ $(DX_CLEAN_HTML) \
+ $(DX_CLEAN_CHM) \
+ $(DX_CLEAN_CHI) \
+ $(DX_CLEAN_MAN) \
+ $(DX_CLEAN_RTF) \
+ $(DX_CLEAN_XML) \
+ $(DX_CLEAN_PS) \
+ $(DX_CLEAN_PDF) \
+ $(DX_CLEAN_LATEX)
+
+endif DX_COND_doc
diff --git a/trunk/bitbake-ng/doc/doxygen.cfg b/trunk/bitbake-ng/doc/doxygen.cfg
new file mode 100644
index 000000000..73f408337
--- /dev/null
+++ b/trunk/bitbake-ng/doc/doxygen.cfg
@@ -0,0 +1,212 @@
+# Doxyfile 1.3.7
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+PROJECT_NAME = $(PROJECT)-$(VERSION)
+PROJECT_NUMBER =
+OUTPUT_DIRECTORY = $(DOCDIR)
+CREATE_SUBDIRS = NO
+OUTPUT_LANGUAGE = English
+USE_WINDOWS_ENCODING = NO
+BRIEF_MEMBER_DESC = YES
+REPEAT_BRIEF = YES
+ABBREVIATE_BRIEF =
+ALWAYS_DETAILED_SEC = NO
+INLINE_INHERITED_MEMB = NO
+STRIP_FROM_INC_PATH = $(SRCDIR)
+FULL_PATH_NAMES = YES
+STRIP_FROM_PATH = $(SRCDIR)/include $(SRCDIR)
+SHORT_NAMES = NO
+JAVADOC_AUTOBRIEF = YES
+MULTILINE_CPP_IS_BRIEF = NO
+DETAILS_AT_TOP = YES
+INHERIT_DOCS = YES
+DISTRIBUTE_GROUP_DOC = NO
+TAB_SIZE = 8
+ALIASES =
+OPTIMIZE_OUTPUT_FOR_C = YES
+OPTIMIZE_OUTPUT_JAVA = NO
+SUBGROUPING = YES
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+EXTRACT_ALL = YES
+EXTRACT_PRIVATE = NO
+EXTRACT_STATIC = NO
+EXTRACT_LOCAL_CLASSES = YES
+EXTRACT_LOCAL_METHODS = NO
+HIDE_UNDOC_MEMBERS = YES
+HIDE_UNDOC_CLASSES = YES
+HIDE_FRIEND_COMPOUNDS = NO
+HIDE_IN_BODY_DOCS = YES
+INTERNAL_DOCS = NO
+CASE_SENSE_NAMES = NO
+HIDE_SCOPE_NAMES = NO
+SHOW_INCLUDE_FILES = YES
+INLINE_INFO = YES
+SORT_MEMBER_DOCS = YES
+SORT_BRIEF_DOCS = NO
+SORT_BY_SCOPE_NAME = NO
+GENERATE_TODOLIST = YES
+GENERATE_TESTLIST = YES
+GENERATE_BUGLIST = YES
+GENERATE_DEPRECATEDLIST= YES
+ENABLED_SECTIONS =
+MAX_INITIALIZER_LINES = 30
+SHOW_USED_FILES = YES
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+QUIET = YES
+WARNINGS = YES
+WARN_IF_UNDOCUMENTED = YES
+WARN_IF_DOC_ERROR = YES
+WARN_FORMAT = "$file:$line: $text"
+WARN_LOGFILE =
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+INPUT = $(SRCDIR)/include
+FILE_PATTERNS = *.c *.h
+RECURSIVE = YES
+EXCLUDE =
+EXCLUDE_SYMLINKS = NO
+EXCLUDE_PATTERNS = *-private*
+EXAMPLE_PATH = $(SRCDIR)
+EXAMPLE_PATTERNS =
+EXAMPLE_RECURSIVE = NO
+IMAGE_PATH =
+INPUT_FILTER =
+FILTER_SOURCE_FILES = NO
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+SOURCE_BROWSER = NO
+INLINE_SOURCES = NO
+STRIP_CODE_COMMENTS = YES
+REFERENCED_BY_RELATION = YES
+REFERENCES_RELATION = YES
+VERBATIM_HEADERS = NO
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+ALPHABETICAL_INDEX = NO
+COLS_IN_ALPHA_INDEX = 5
+IGNORE_PREFIX =
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+GENERATE_HTML = $(GENERATE_HTML)
+HTML_OUTPUT = html
+HTML_FILE_EXTENSION = .html
+HTML_HEADER =
+HTML_FOOTER =
+HTML_STYLESHEET =
+HTML_ALIGN_MEMBERS = YES
+GENERATE_HTMLHELP = $(GENERATE_CHM)
+CHM_FILE = ../$(PROJECT).chm
+HHC_LOCATION = $(HHC_PATH)
+GENERATE_CHI = $(GENERATE_CHI)
+BINARY_TOC = NO
+TOC_EXPAND = NO
+DISABLE_INDEX = NO
+ENUM_VALUES_PER_LINE = 4
+GENERATE_TREEVIEW = YES
+TREEVIEW_WIDTH = 250
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+GENERATE_LATEX = $(GENERATE_LATEX)
+LATEX_OUTPUT = latex
+LATEX_CMD_NAME = latex
+MAKEINDEX_CMD_NAME = makeindex
+COMPACT_LATEX = NO
+PAPER_TYPE = $(PAPER_SIZE)
+EXTRA_PACKAGES =
+LATEX_HEADER =
+PDF_HYPERLINKS = NO
+USE_PDFLATEX = NO
+LATEX_BATCHMODE = YES
+LATEX_HIDE_INDICES = NO
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+GENERATE_RTF = $(GENERATE_RTF)
+RTF_OUTPUT = rtf
+COMPACT_RTF = NO
+RTF_HYPERLINKS = NO
+RTF_STYLESHEET_FILE =
+RTF_EXTENSIONS_FILE =
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+GENERATE_MAN = $(GENERATE_MAN)
+MAN_OUTPUT = man
+MAN_EXTENSION = .1
+MAN_LINKS = NO
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+GENERATE_XML = $(GENERATE_XML)
+XML_OUTPUT = xml
+XML_SCHEMA =
+XML_DTD =
+XML_PROGRAMLISTING = YES
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+GENERATE_AUTOGEN_DEF = NO
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+GENERATE_PERLMOD = NO
+PERLMOD_LATEX = NO
+PERLMOD_PRETTY = YES
+PERLMOD_MAKEVAR_PREFIX =
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+ENABLE_PREPROCESSING = YES
+MACRO_EXPANSION = YES
+EXPAND_ONLY_PREDEF = NO
+SEARCH_INCLUDES = NO
+INCLUDE_PATH =
+INCLUDE_FILE_PATTERNS =
+PREDEFINED =
+EXPAND_AS_DEFINED =
+SKIP_FUNCTION_MACROS = YES
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+TAGFILES =
+GENERATE_TAGFILE = $(DOCDIR)/$(PROJECT).tag
+ALLEXTERNALS = NO
+EXTERNAL_GROUPS = YES
+PERL_PATH = $(PERL_PATH)
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+CLASS_DIAGRAMS = YES
+HIDE_UNDOC_RELATIONS = YES
+HAVE_DOT = $(HAVE_DOT)
+CLASS_GRAPH = YES
+COLLABORATION_GRAPH = YES
+UML_LOOK = NO
+TEMPLATE_RELATIONS = NO
+INCLUDE_GRAPH = YES
+INCLUDED_BY_GRAPH = YES
+CALL_GRAPH = NO
+GRAPHICAL_HIERARCHY = YES
+DOT_IMAGE_FORMAT = png
+DOT_PATH = $(DOT_PATH)
+DOTFILE_DIRS =
+MAX_DOT_GRAPH_WIDTH = 1024
+MAX_DOT_GRAPH_HEIGHT = 1024
+MAX_DOT_GRAPH_DEPTH = 0
+GENERATE_LEGEND = YES
+DOT_CLEANUP = YES
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine
+#---------------------------------------------------------------------------
+SEARCHENGINE = NO
diff --git a/trunk/bitbake-ng/doc/ramblings/bbtree.txt b/trunk/bitbake-ng/doc/ramblings/bbtree.txt
new file mode 100644
index 000000000..dfff8d13c
--- /dev/null
+++ b/trunk/bitbake-ng/doc/ramblings/bbtree.txt
@@ -0,0 +1,39 @@
+F = Fetch
+P = Patch
+Cf = Configure
+Cp = Compile
+S = Stage
+Pk = Package
+
+
+
+F1 <-- P1 <-- Cf1 <-- Cp1 <-- S1 <-- Pk1
+ ^
+ ---------------|
+ |
+F2 <-- P2 <-- Cf2 <-- Cp2 <-- S2 <-- Pk2
+ ^
+ ---------------|
+ |
+F3 <-- P3 <-- Cf3 <-- Cp3 <-- S3 <-- Pk3
+
+
+Counts (start at the end products and work backwards)
+Pk1 - 1
+Pk2 - 1
+Pk3 - 1
+S1 - 3
+S2 - 2
+S3 - 1
+Cp1 - 3
+Cp2 - 2
+Cp3 - 1
+Cf1 - 3
+Cf2 - 2
+Cf3 - 1
+P1 - 3
+P2 - 2
+P3 - 1
+F1 - 3
+F2 - 2
+F3 - 1 \ No newline at end of file
diff --git a/trunk/bitbake-ng/doc/ramblings/bitbakeng-metadata.txt b/trunk/bitbake-ng/doc/ramblings/bitbakeng-metadata.txt
new file mode 100644
index 000000000..ac02d16a8
--- /dev/null
+++ b/trunk/bitbake-ng/doc/ramblings/bitbakeng-metadata.txt
@@ -0,0 +1,103 @@
+NOTE: this doc is slightly coherent mumbling and psuedo code. I'll make it
+have actual implementations of the structures, and more coherent outlining of
+the design, shortly.
+
+struct var_chunk {
+ type;
+ data;
+ condition; /* A in B .. any chunk of a var can be conditional, to
+ facilitate conditional prepend/append */
+}
+
+struct var_chunk_set {
+ list of var_chunks;
+ condition; /* A in B .. any var itself's value can be conditional */
+}
+
+struct var {
+ name;
+ cached_val; /* expanded version of the value */
+ list of var_chunk_sets; /* unexpanded version of the value */
+ bool dirty; /* dbbs it need re-expansion due to the referees changing? */
+ list of vars; /* referrers */
+}
+
+enum bb_opcode {
+ BB_VAR_SET,
+ BB_VAR_APPEND,
+ BB_VAR_APPEND_NOSPACE,
+ BB_VAR_PREPEND,
+ BB_VAR_PREPEND_NOSPACE,
+ BB_VAR_DEL
+ BB_VAR_ATTR_SET,
+ BB_VAR_ATTR_APPEND,
+ BB_VAR_ATTR_APPEND_NOSPACE,
+ BB_VAR_ATTR_PREPEND
+ BB_VAR_ATTR_PREPEND_NOSPACE,
+ BB_VAR_ATTR_DEL
+};
+
+struct bb_cmd {
+ enum bb_opcode;
+ list of data;
+};
+
+struct bb_compiled {
+ list of struct bbc's;
+}
+
+struct pre_metadata_set {
+ list of:
+ {
+ if resolved -> struct var
+ if unresolved -> bbc
+ }
+}
+
+struct metadata_set {
+ parents; /* links to higher scopes */
+ hash table of var name -> struct var;
+}
+
+NOTE: we track variable referrers (who has me in their var chunks?)
+
+example:
+A := ${B} /* unresolved */
+C := a /* resolved */
+D := ${A} /* unresolved */
+C += ${B} /* unresolved */
+E := ${C} /* resolved */
+F = ${B} /* unresolved, but its contents can be a struct var, not an bbc */
+
+Then, when you link a metadata set to another (set our scope under his),
+all the unresolved bbc's can be immediately executed, producing a new
+metadata set which is entirely struct var's.
+
+Once a pre metadata set is executed / attached to its parent scopes, we know
+that the pre_metadata_set -> metadata_set needs to occur again whenever one of
+its parents is dirtied. Technically, we know which variables in its parents
+affect which variables of ours, but unless we track which bbc's affected which
+variables, we'll have to rerun the pre metadata set -> metadata set operation
+whenever its parents change.
+
+In conclusion, precompiling the .bb with bbc's, and using the pre metadata set,
+enables us to avoid reparsing files that depend on their context in each possible
+context, and when its context changes. For example, this will enable us to
+avoid reparsing all the .bb files when bb.conf or local.conf changes.
+
+Caching the pre metadata set as well as the compiled bb reduces the number of
+bbc executions necessary when attaching to a new parent scope (i.e. taking
+base.bbclass and attaching it to each and every .bb).
+
+Caching the metadata set allows us to avoid reexecution of any bbc's when
+context hasn't changed, and the compiled bb isnt dirty.
+
+bbmake runs:
+ reparse any changed/new files
+ re execution bbc's whereever someone was affected by the reparses
+ store the metadata sets in an sqlite db
+
+ Now, after this, we know that the db contains the current metadata sets for
+ all existing files. We can issue sql queries to obtain all the dependency
+ information to construct our build paths, and can obtain the package data
+ whenever we're ready for it.
diff --git a/trunk/bitbake-ng/doc/ramblings/bitbakeng-parser-frontend.txt b/trunk/bitbake-ng/doc/ramblings/bitbakeng-parser-frontend.txt
new file mode 100644
index 000000000..52ec47f2c
--- /dev/null
+++ b/trunk/bitbake-ng/doc/ramblings/bitbakeng-parser-frontend.txt
@@ -0,0 +1,21 @@
+enum metadata_source_type {
+ OE_METADATA_ENV,
+ OE_METADATA_FILE
+}
+
+struct metadata_source {
+ enum metadata_source_type;
+ gcchar *location;
+ struct oe_metadata *data;
+ void *private;
+}
+
+#if 0
+/* this probably belongs in whomever is doing the parsing and
+ storing of the metadata */
+struct metadata_sources {
+ hash of metadata_source's, keyed by location?;
+}
+#endif
+
+struct metadata_source_type *oe_getmetadata_sync(enum metadata_source_type, location);
diff --git a/trunk/bitbake-ng/include/Makefile.am b/trunk/bitbake-ng/include/Makefile.am
new file mode 100644
index 000000000..babda4833
--- /dev/null
+++ b/trunk/bitbake-ng/include/Makefile.am
@@ -0,0 +1,2 @@
+noinst_HEADERS = bitbake/data-private.h
+nobase_relinclude_HEADERS = bitbake/common.h bitbake/data.h bitbake.h
diff --git a/trunk/bitbake-ng/include/bitbake.h b/trunk/bitbake-ng/include/bitbake.h
new file mode 100644
index 000000000..35d1eff5e
--- /dev/null
+++ b/trunk/bitbake-ng/include/bitbake.h
@@ -0,0 +1,40 @@
+/* ex:ts=4:sw=4:sts=4:et
+ * -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+ *
+ * Copyright (C) 2004, 2005 Chris Larson <kergoth@handhelds.org>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#ifndef _BITBAKE_H
+# define _BITBAKE_H
+
+#include <bitbake/common.h>
+#include <bitbake/data.h>
+#include <bitbake/recipe.h>
+#include <bitbake/recipe-modules.h>
+
+BITBAKE_HDR_BEGIN
+
+/** @file bitbake.h
+ * @brief Bitbake primary header file */
+
+BITBAKE_HDR_END
+
+#endif /* _BITBAKE_H */
diff --git a/trunk/bitbake-ng/include/bitbake/common.h b/trunk/bitbake-ng/include/bitbake/common.h
new file mode 100644
index 000000000..516b72e94
--- /dev/null
+++ b/trunk/bitbake-ng/include/bitbake/common.h
@@ -0,0 +1,82 @@
+/* ex:ts=4:sw=4:sts=4:et
+ * -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+ *
+ * Copyright (C) 2004, 2005 Chris Larson <kergoth@handhelds.org>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#ifndef _BB_COMMON_H
+# define _BB_COMMON_H
+
+# ifdef __cplusplus
+# define BITBAKE_HDR_BEGIN extern "C" {
+# define BITBAKE_HDR_END }
+# else
+# define BITBAKE_HDR_BEGIN
+# define BITBAKE_HDR_END
+# endif /* __cplusplus */
+
+BITBAKE_HDR_BEGIN
+
+/** @file common.h
+ * @brief Header for bitbake's commonly used macros */
+
+/* Shared library support */
+# ifdef WIN32
+# define BBIMPORT __declspec(dllimport)
+# define BBEXPORT __declspec(dllexport)
+# define BBDLLLOCAL
+# define BBDLLPUBLIC
+# else
+# define BBIMPORT
+# ifdef GCC_HASCLASSVISIBILITY
+# define BBEXPORT __attribute__ ((visibility("default")))
+# define BBDLLLOCAL __attribute__ ((visibility("hidden")))
+# define BBDLLPUBLIC __attribute__ ((visibility("default")))
+# else
+# define BBEXPORT
+# define BBDLLLOCAL
+# define BBDLLPUBLIC
+# endif
+# endif
+
+/* Define BBAPI for DLL builds */
+# ifdef BBDLL
+# ifdef BBDLL_EXPORTS
+# define BBAPI BBEXPORT
+# else
+# define BBAPI BBIMPORT
+# endif /* BBDLL_EXPORTS */
+# else
+# define BBAPI
+# endif /* BBDLL */
+
+/* Throwable classes must always be visible on GCC in all binaries */
+# ifdef WIN32
+# define BBEXCEPTIONAPI(api) api
+# elif defined(GCC_HASCLASSVISIBILITY)
+# define BBEXCEPTIONAPI(api) BBEXPORT
+# else
+# define BBEXCEPTIONAPI(api)
+# endif
+
+BITBAKE_HDR_END
+
+#endif /* _BITBAKE_H */
diff --git a/trunk/bitbake-ng/include/bitbake/data-private.h b/trunk/bitbake-ng/include/bitbake/data-private.h
new file mode 100644
index 000000000..fbe4fb83b
--- /dev/null
+++ b/trunk/bitbake-ng/include/bitbake/data-private.h
@@ -0,0 +1,139 @@
+/* ex:ts=4:sw=4:sts=4:et
+ * -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+ *
+ * Copyright (C) 2004, 2005 Chris Larson <kergoth@handhelds.org>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#ifndef _BB_DATA_PRIVATE_H
+# define _BB_DATA_PRIVATE_H
+# ifdef BBDLL_EXPORTS
+
+# include <bitbake/common.h>
+# include <glib.h>
+
+BITBAKE_HDR_BEGIN
+
+
+/** @file data-private.h
+ * @brief Private header for bitbake metadata handling */
+
+/**
+ * Bitbake variable chunk types
+ */
+enum bb_var_chunk_type {
+ /**
+ * Indicates that the variable chunk in question is a string
+ */
+ BB_VAR_STR,
+
+ /**
+ * Indicates that the variable chunk in question is a
+ * reference to another bitbake variable.
+ */
+ BB_VAR_REF,
+};
+
+
+/**
+ * \brief BitBake variable chunk
+ *
+ * BitBake variables consist of multiple pieces, including, but not
+ * limited to, strings and references to other variables.
+ */
+struct bb_var_chunk {
+ /**
+ * Type of chunk (i.e. BB_VAR_REF, BBVAR_STR, etc)
+ */
+ enum bb_var_chunk_type type;
+
+ /**
+ * Pointer to this chunk's data
+ */
+ gpointer *data;
+};
+
+
+/**
+ * BitBake variable
+ */
+struct bb_var {
+ /**
+ * Variable name
+ */
+ gchar *key;
+
+ /**
+ * Cached value (post-expansion)
+ */
+ gchar *val;
+
+ /**
+ * Uncached value (pre-expansion)
+ */
+ gchar *orig_val;
+
+ /**
+ * List of variable chunks (of type struct bb_var_chunk)
+ */
+ GList *chunks;
+
+ /**
+ * Dirty flag -- indicates whether the cached value needs to
+ * be updated, most likely due to referees changing.
+ */
+ int dirty;
+
+ /**
+ * List of variables that refer to this variable
+ */
+ GList *referrers;
+
+ /**
+ * Hash table of bitbake variable "attributes". Bitbake variable
+ * attributes are metadata about our metadata. This allows us to
+ * set flags about the metadata. For example, we can specify the
+ * interpreter for a given block of executable code.
+ *
+ * The hash table is attribute name -> gcchar *.
+ */
+ GHashTable *attributes;
+};
+
+/**
+ * BitBake Datastore
+ */
+struct bb_data {
+ /**
+ * Links to context / higher scopes
+ */
+ GList *parents;
+
+ /**
+ * Hash table of variable name -> struct bb_var
+ */
+ GHashTable *data;
+};
+
+
+BITBAKE_HDR_BEGIN
+
+#endif /* BBDLL_EXPORTS */
+#endif /* _BB_DATA_PRIVATE_H */
diff --git a/trunk/bitbake-ng/include/bitbake/data.h b/trunk/bitbake-ng/include/bitbake/data.h
new file mode 100644
index 000000000..24357dbae
--- /dev/null
+++ b/trunk/bitbake-ng/include/bitbake/data.h
@@ -0,0 +1,183 @@
+/* ex:ts=4:sw=4:sts=4:et
+ * -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+ *
+ * Copyright (C) 2004, 2005 Chris Larson <kergoth@handhelds.org>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#ifndef _BB_DATA_H
+# define _BB_DATA_H
+
+# include <bitbake/common.h>
+# include <glib/gtypes.h>
+
+BITBAKE_HDR_BEGIN
+
+
+/** @file data.h
+ * @brief Header for bitbake metadata handling */
+
+/**
+ *@brief Creates a new bitbake metadata store
+ *
+ *@return An empty bitbake metadata store
+ */
+BBAPI gpointer bb_data_new(void);
+
+/**
+ *Obtains the value of an bitbake variable
+ *
+ *@param data The bitbake metadata store in question.
+ *@param var The variable name.
+ *
+ *@return The variable's value.
+ */
+BBAPI gchar *bb_data_lookup(gconstpointer data, gchar *var);
+
+
+/**
+ *Sets the value of an bitbake variable
+ *
+ *@param data The bitbake metadata store in question.
+ *@param var The variable name.
+ *@param val The value to be set the variable to.
+ *
+ *@return TRUE if succeeded, FALSE if failed.
+ */
+BBAPI gboolean bb_data_insert(gpointer data, gchar *var, gchar *val);
+
+
+/**
+ *Deletes an bitbake variable
+ *
+ *@param data The bitbake metadata store in question.
+ *@param var The variable name.
+ *
+ *@return TRUE if succeeded, FALSE if failed.
+ */
+BBAPI gboolean bb_data_remove(gpointer data, gchar *var);
+
+
+#if 0
+/**
+ *Obtains a certain conditional value associated with an bitbake variable.
+ *
+ *An bitbake variable has a default value (that which is
+ *accessed by the usual bb_data_insert api), and any
+ *number of possible values which are bound to conditions.
+ *
+ *This function obtains one of those conditional values.
+ *
+ *@param data The bitbake metadata store in question.
+ *@param var The variable name.
+ *@param conditions The conditions which apply to the value we're
+ * attempting to get.
+ *
+ *@return The conditional value.
+ */
+BBAPI gchar *bb_data_lookup_cond(gconstpointer data, gchar *var, gchar *conditions[2]);
+
+
+/**
+ *Sets a certain conditional value associated with an bitbake variable.
+ *
+ *An bitbake variable has a default value (that which is
+ *accessed by the usual bb_data_insert api), and any
+ *number of possible values which are bound to conditions.
+ *
+ *This function removes one of those conditional values.
+ *
+ *@param data The bitbake metadata store in question.
+ *@param var The variable name.
+ *@param val The value to set this variable to when these conditions are true.
+ *@param conditions The conditions which apply to the value we're
+ * attempting to remove.
+ *
+ *@return TRUE if succeeded, FALSE if failed.
+ */
+BBAPI gboolean bb_data_insert_cond(gpointer data, gchar *var, gchar *val, gchar *conditions[2]);
+
+
+/**
+ *Deletes a certain conditional value associated with an bitbake variable.
+ *
+ *An bitbake variable has a default value (that which is
+ *accessed by the usual bb_data_insert api), and any
+ *number of possible values which are bound to conditions.
+ *
+ *This function removes one of those conditional values.
+ *
+ *@param data The bitbake metadata store in question.
+ *@param var The variable name.
+ *@param conditions The conditions which apply to the value we're
+ * attempting to remove.
+ *
+ *@return TRUE if succeeded, FALSE if failed.
+ */
+BBAPI gboolean bb_data_remove_cond(gpointer data, gchar *var, gchar *conditions[2]);
+#endif
+
+
+/**
+ *Obtains the value of one of the attributes of an bitbake variable.
+ *
+ *@param data The bitbake metadata store in question.
+ *@param var The variable name.
+ *@param attr The attribute name.
+ *
+ *@return The attribute in question.
+ */
+BBAPI gchar *bb_data_lookup_attr(gconstpointer data, gchar *var, gchar *attr);
+
+
+/**
+ *Sets the value of one of the attributes of an bitbake variable.
+ *
+ *@param data The bitbake metadata store in question.
+ *@param var The variable name.
+ *@param val The value to set this attribute to.
+ *@param attr The attribute name.
+ *
+ *@return TRUE if succeeded, FALSE if failed.
+ */
+BBAPI gboolean bb_data_insert_attr(gpointer data, gchar *var, gchar *attr, gchar *val);
+
+
+/**
+ *Deletes a given attribute from an bitbake variable
+ *
+ *@param data The bitbake metadata store in question.
+ *@param var The variable name.
+ *@param attr The attribute name.
+ *
+ *@return TRUE if succeeded, FALSE if failed.
+ */
+BBAPI gboolean bb_data_remove_attr(gpointer data, gchar *var, gchar *attr);
+
+/**
+ *Destroys a bitbake metadata store and all of its variables
+ *
+ */
+BBAPI void bb_data_destroy(gpointer data);
+
+
+BITBAKE_HDR_END
+
+#endif /*_BB_DATA_H */
diff --git a/trunk/bitbake-ng/include/bitbake/recipe-modules.h b/trunk/bitbake-ng/include/bitbake/recipe-modules.h
new file mode 100644
index 000000000..e8045ae09
--- /dev/null
+++ b/trunk/bitbake-ng/include/bitbake/recipe-modules.h
@@ -0,0 +1,50 @@
+/* ex:ts=4:sw=4:sts=4:et
+ * -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+ *
+ * Copyright (C) 2004, 2005 Chris Larson <kergoth@handhelds.org>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#ifndef _BB_RECIPE_MODULES_H
+# define _BB_RECIPE_MODULES_H
+
+# include <bitbake/common.h>
+# include <glib/gtypes.h>
+
+BITBAKE_HDR_BEGIN
+
+
+/** @file recipe-modules.h
+ * @brief Header for bitbake recipe handling (backend modules) */
+
+BBAPI gboolean bb_recipe_load_parsers();
+BBAPI gboolean bb_recipe_register_parser();
+BBAPI void bb_recipe_unregister_parser();
+BBAPI void bb_recipe_unload_parsers();
+
+BBAPI gboolean bb_recipe_load_workers();
+BBAPI gboolean bb_recipe_register_worker();
+BBAPI void bb_recipe_unregister_worker();
+BBAPI void bb_recipe_unload_workers();
+
+
+BITBAKE_HDR_END
+
+#endif /* _BB_RECIPE_MODULES_H */
diff --git a/trunk/bitbake-ng/include/bitbake/recipe.h b/trunk/bitbake-ng/include/bitbake/recipe.h
new file mode 100644
index 000000000..f815fd910
--- /dev/null
+++ b/trunk/bitbake-ng/include/bitbake/recipe.h
@@ -0,0 +1,58 @@
+/* ex:ts=4:sw=4:sts=4:et
+ * -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+ *
+ * Copyright (C) 2004, 2005 Chris Larson <kergoth@handhelds.org>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#ifndef _BB_RECIPE_H
+# define _BB_RECIPE_H
+
+# include <bitbake/common.h>
+# include <glib/gtypes.h>
+
+BITBAKE_HDR_BEGIN
+
+
+/** @file recipe.h
+ * @brief Header for bitbake recipe handling (frontend) */
+
+BBAPI gpointer bb_recipe_new(void);
+
+BBAPI gboolean bb_recipe_load(gpointer recipe, gchar *location);
+BBAPI gboolean bb_recipe_load_into_box(gpointer recipe, gpointer recipe_box, gchar *location);
+BBAPI gboolean bb_recipe_sync(gpointer recipe);
+
+BBAPI gboolean bb_recipe_add_parent(gpointer recipe, gpointer parent);
+BBAPI gpointer bb_recipe_foreach_parent(gpointer recipe, char *callback);
+BBAPI gboolean bb_recipe_remove_parent(gpointer recipe, gchar *parent_loc);
+
+gchar *bb_recipe_lookup_var(gpointer recipe, gchar *var);
+BBAPI gpointer bb_recipe_get_metadata(gpointer recipe);
+
+BBAPI gboolean bb_recipe_can_execute(gpointer recipe);
+BBAPI gboolean bb_recipe_execute(gpointer recipe);
+
+BBAPI void bb_recipe_destroy(gpointer recipe);
+
+
+BITBAKE_HDR_END
+
+#endif /* _BB_RECIPE_H */
diff --git a/trunk/bitbake-ng/m4/external/check.m4 b/trunk/bitbake-ng/m4/external/check.m4
new file mode 100644
index 000000000..97bfd9c47
--- /dev/null
+++ b/trunk/bitbake-ng/m4/external/check.m4
@@ -0,0 +1,133 @@
+dnl AM_PATH_CHECK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
+dnl Test for check, and define CHECK_CFLAGS and CHECK_LIBS
+dnl
+
+AC_DEFUN(AM_PATH_CHECK,
+[
+ AC_ARG_WITH(check,
+ [ --with-check=PATH prefix where check is installed [default=auto]])
+
+ min_check_version=ifelse([$1], ,0.8.2,$1)
+
+ AC_MSG_CHECKING(for check - version >= $min_check_version)
+
+ if test x$with_check = xno; then
+ AC_MSG_RESULT(disabled)
+ ifelse([$3], , AC_MSG_ERROR([disabling check is not supported]), [$3])
+ else
+ if test "x$with_check" != x; then
+ CHECK_CFLAGS="-I$with_check/include"
+ CHECK_LIBS="-L$with_check/lib -lcheck"
+ else
+ CHECK_CFLAGS=""
+ CHECK_LIBS="-lcheck"
+ fi
+
+ ac_save_CFLAGS="$CFLAGS"
+ ac_save_LIBS="$LIBS"
+
+ CFLAGS="$CFLAGS $CHECK_CFLAGS"
+ LIBS="$CHECK_LIBS $LIBS"
+
+ rm -f conf.check-test
+ AC_TRY_RUN([
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <check.h>
+
+int main ()
+{
+ int major, minor, micro;
+ char *tmp_version;
+
+ system ("touch conf.check-test");
+
+ /* HP/UX 9 (%@#!) writes to sscanf strings */
+ tmp_version = strdup("$min_check_version");
+ if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
+ printf("%s, bad version string\n", "$min_check_version");
+ return 1;
+ }
+
+ if ((CHECK_MAJOR_VERSION != check_major_version) ||
+ (CHECK_MINOR_VERSION != check_minor_version) ||
+ (CHECK_MICRO_VERSION != check_micro_version))
+ {
+ printf("\n*** The check header file (version %d.%d.%d) does not match\n",
+ CHECK_MAJOR_VERSION, CHECK_MINOR_VERSION, CHECK_MICRO_VERSION);
+ printf("*** the check library (version %d.%d.%d).\n",
+ check_major_version, check_minor_version, check_micro_version);
+ return 1;
+ }
+
+ if ((check_major_version > major) ||
+ ((check_major_version == major) && (check_minor_version > minor)) ||
+ ((check_major_version == major) && (check_minor_version == minor) && (check_micro_version >= micro)))
+ {
+ return 0;
+ }
+ else
+ {
+ printf("\n*** An old version of check (%d.%d.%d) was found.\n",
+ check_major_version, check_minor_version, check_micro_version);
+ printf("*** You need a version of check being at least %d.%d.%d.\n", major, minor, micro);
+ printf("***\n");
+ printf("*** If you have already installed a sufficiently new version, this error\n");
+ printf("*** probably means that the wrong copy of the check library and header\n");
+ printf("*** file is being found. Rerun configure with the --with-check=PATH option\n");
+ printf("*** to specify the prefix where the correct version was installed.\n");
+ }
+
+ return 1;
+}
+],, no_check=yes, [echo $ac_n "cross compiling; assumed OK... $ac_c"])
+
+ CFLAGS="$ac_save_CFLAGS"
+ LIBS="$ac_save_LIBS"
+
+ if test "x$no_check" = x ; then
+ AC_MSG_RESULT(yes)
+ ifelse([$2], , :, [$2])
+ else
+ AC_MSG_RESULT(no)
+ if test -f conf.check-test ; then
+ :
+ else
+ echo "*** Could not run check test program, checking why..."
+ CFLAGS="$CFLAGS $CHECK_CFLAGS"
+ LIBS="$CHECK_LIBS $LIBS"
+ AC_TRY_LINK([
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <check.h>
+], , [ echo "*** The test program compiled, but did not run. This usually means"
+ echo "*** that the run-time linker is not finding check. You'll need to set your"
+ echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
+ echo "*** to the installed location Also, make sure you have run ldconfig if that"
+ echo "*** is required on your system"
+ echo "***"
+ echo "*** If you have an old version installed, it is best to remove it, although"
+ echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
+ [ echo "*** The test program failed to compile or link. See the file config.log for"
+ echo "*** the exact error that occured." ])
+
+ CFLAGS="$ac_save_CFLAGS"
+ LIBS="$ac_save_LIBS"
+ fi
+
+ CHECK_CFLAGS=""
+ CHECK_LIBS=""
+
+ rm -f conf.check-test
+ ifelse([$3], , AC_MSG_ERROR([check not found]), [$3])
+ fi
+
+ AC_SUBST(CHECK_CFLAGS)
+ AC_SUBST(CHECK_LIBS)
+
+ rm -f conf.check-test
+
+ fi
+])
diff --git a/trunk/bitbake-ng/m4/internal/binreloc.m4 b/trunk/bitbake-ng/m4/internal/binreloc.m4
new file mode 100644
index 000000000..c569de498
--- /dev/null
+++ b/trunk/bitbake-ng/m4/internal/binreloc.m4
@@ -0,0 +1,76 @@
+# Check for binary relocation support
+# Hongli Lai
+# http://autopackage.org/
+
+AC_DEFUN([AM_BINRELOC],
+[
+ AC_ARG_ENABLE(binreloc,
+ [ --enable-binreloc compile with binary relocation support
+ (default=enable when available)],
+ enable_binreloc=$enableval,enable_binreloc=auto)
+
+ AC_ARG_ENABLE(binreloc-threads,
+ [ --enable-binreloc-threads compile binary relocation with threads support
+ (default=yes)],
+ enable_binreloc_threads=$enableval,enable_binreloc_threads=yes)
+
+ BINRELOC_CFLAGS=
+ BINRELOC_LIBS=
+ if test "x$enable_binreloc" = "xauto"; then
+ AC_CHECK_FILE([/proc/self/maps])
+ AC_CACHE_CHECK([whether everything is installed to the same prefix],
+ [br_cv_valid_prefixes], [
+ if test "$bindir" = '${exec_prefix}/bin' -a "$sbindir" = '${exec_prefix}/sbin' -a \
+ "$datadir" = '${prefix}/share' -a "$libdir" = '${exec_prefix}/lib' -a \
+ "$libexecdir" = '${exec_prefix}/libexec' -a "$sysconfdir" = '${prefix}/etc'
+ then
+ br_cv_valid_prefixes=yes
+ else
+ br_cv_valid_prefixes=no
+ fi
+ ])
+ fi
+ AC_CACHE_CHECK([whether binary relocation support should be enabled],
+ [br_cv_binreloc],
+ [if test "x$enable_binreloc" = "xyes"; then
+ br_cv_binreloc=yes
+ elif test "x$enable_binreloc" = "xauto"; then
+ if test "x$br_cv_valid_prefixes" = "xyes" -a \
+ "x$ac_cv_file__proc_self_maps" = "xyes"; then
+ br_cv_binreloc=yes
+ else
+ br_cv_binreloc=no
+ fi
+ else
+ br_cv_binreloc=no
+ fi])
+
+ if test "x$br_cv_binreloc" = "xyes"; then
+ BINRELOC_CFLAGS="-DENABLE_BINRELOC"
+ if test "x$enable_binreloc_threads" = "xyes"; then
+ safe_LIBS=$LIBS
+ AC_CHECK_LIB([pthread], [pthread_getspecific])
+ LIBS=$safe_LIBS
+ fi
+
+ AC_CACHE_CHECK([whether binary relocation should use threads],
+ [br_cv_binreloc_threads],
+ [if test "x$enable_binreloc_threads" = "xyes"; then
+ if test "x$ac_cv_lib_pthread_pthread_getspecific" = "xyes"; then
+ br_cv_binreloc_threads=yes
+ else
+ br_cv_binreloc_threads=no
+ fi
+ else
+ br_cv_binreloc_threads=no
+ fi])
+
+ if test "x$br_cv_binreloc_threads" = "xyes"; then
+ BINRELOC_LIBS="-lpthread"
+ else
+ BINRELOC_CFLAGS="$BINRELOC_CFLAGS -DBR_PTHREAD=0"
+ fi
+ fi
+ AC_SUBST(BINRELOC_CFLAGS)
+ AC_SUBST(BINRELOC_LIBS)
+])
diff --git a/trunk/bitbake-ng/m4/internal/doxygen.m4 b/trunk/bitbake-ng/m4/internal/doxygen.m4
new file mode 100644
index 000000000..877c8fdf9
--- /dev/null
+++ b/trunk/bitbake-ng/m4/internal/doxygen.m4
@@ -0,0 +1,312 @@
+# This file is part of Autoconf. -*- Autoconf -*-
+
+# Copyright (C) 2004 Oren Ben-Kiki
+# This file is distributed under the same terms as the Autoconf macro files.
+
+# Generate automatic documentation using Doxygen. Works in concert with the
+# aminclude.m4 file and a compatible doxygen configuration file. Defines the
+# following public macros:
+#
+# DX_???_FEATURE(ON|OFF) - control the default setting fo a Doxygen feature.
+# Supported features are 'DOXYGEN' itself, 'DOT' for generating graphics,
+# 'HTML' for plain HTML, 'CHM' for compressed HTML help (for MS users), 'CHI'
+# for generating a seperate .chi file by the .chm file, and 'MAN', 'RTF',
+# 'XML', 'PDF' and 'PS' for the appropriate output formats. The environment
+# variable DOXYGEN_PAPER_SIZE may be specified to override the default 'a4wide'
+# paper size.
+#
+# By default, HTML, PDF and PS documentation is generated as this seems to be
+# the most popular and portable combination. MAN pages created by Doxygen are
+# usually problematic, though by picking an appropriate subset and doing some
+# massaging they might be better than nothing. CHM and RTF are specific for MS
+# (note that you can't generate both HTML and CHM at the same time). The XML is
+# rather useless unless you apply specialized post-processing to it.
+#
+# The macro mainly controls the default state of the feature. The use can
+# override the default by specifying --enable or --disable. The macros ensure
+# that contradictory flags are not given (e.g., --enable-doxygen-html and
+# --enable-doxygen-chm, --enable-doxygen-anything with --disable-doxygen, etc.)
+# Finally, each feature will be automatically disabled (with a warning) if the
+# required programs are missing.
+#
+# Once all the feature defaults have been specified, call DX_INIT_DOXYGEN with
+# the following parameters: a one-word name for the project for use as a
+# filename base etc., an optional configuration file name (the default is
+# 'Doxyfile', the same as Doxygen's default), and an optional output directory
+# name (the default is 'doxygen-doc').
+
+## ----------##
+## Defaults. ##
+## ----------##
+
+DX_ENV=""
+AC_DEFUN([DX_FEATURE_doc], ON)
+AC_DEFUN([DX_FEATURE_dot], ON)
+AC_DEFUN([DX_FEATURE_man], OFF)
+AC_DEFUN([DX_FEATURE_html], ON)
+AC_DEFUN([DX_FEATURE_chm], OFF)
+AC_DEFUN([DX_FEATURE_chi], OFF)
+AC_DEFUN([DX_FEATURE_rtf], OFF)
+AC_DEFUN([DX_FEATURE_xml], OFF)
+AC_DEFUN([DX_FEATURE_pdf], ON)
+AC_DEFUN([DX_FEATURE_ps], ON)
+
+## --------------- ##
+## Private macros. ##
+## --------------- ##
+
+# DX_ENV_APPEND(VARIABLE, VALUE)
+# ------------------------------
+# Append VARIABLE="VALUE" to DX_ENV for invoking doxygen.
+AC_DEFUN([DX_ENV_APPEND], [AC_SUBST([DX_ENV], ["$DX_ENV $1='$2'"])])
+
+# DX_DIRNAME_EXPR
+# ---------------
+# Expand into a shell expression prints the directory part of a path.
+AC_DEFUN([DX_DIRNAME_EXPR],
+ [[expr ".$1" : '\(\.\)[^/]*$' \| "x$1" : 'x\(.*\)/[^/]*$']])
+
+# DX_IF_FEATURE(FEATURE, IF-ON, IF-OFF)
+# -------------------------------------
+# Expands according to the M4 (static) status of the feature.
+AC_DEFUN([DX_IF_FEATURE], [ifelse(DX_FEATURE_$1, ON, [$2], [$3])])
+
+# DX_REQUIRE_PROG(VARIABLE, PROGRAM)
+# ----------------------------------
+# Require the specified program to be found for the DX_CURRENT_FEATURE to work.
+AC_DEFUN([DX_REQUIRE_PROG], [
+AC_PATH_TOOL([$1], [$2])
+if test "$DX_FLAG_[]DX_CURRENT_FEATURE$$1" = 1; then
+ AC_MSG_WARN([$2 not found - will not DX_CURRENT_DESCRIPTION])
+ AC_SUBST([DX_FLAG_[]DX_CURRENT_FEATURE], 0)
+fi
+])
+
+# DX_TEST_FEATURE(FEATURE)
+# ------------------------
+# Expand to a shell expression testing whether the feature is active.
+AC_DEFUN([DX_TEST_FEATURE], [test "$DX_FLAG_$1" = 1])
+
+# DX_CHECK_DEPEND(REQUIRED_FEATURE, REQUIRED_STATE)
+# -------------------------------------------------
+# Verify that a required features has the right state before trying to turn on
+# the DX_CURRENT_FEATURE.
+AC_DEFUN([DX_CHECK_DEPEND], [
+test "$DX_FLAG_$1" = "$2" \
+|| AC_MSG_ERROR([doxygen-DX_CURRENT_FEATURE ifelse([$2], 1,
+ requires, contradicts) doxygen-DX_CURRENT_FEATURE])
+])
+
+# DX_CLEAR_DEPEND(FEATURE, REQUIRED_FEATURE, REQUIRED_STATE)
+# ----------------------------------------------------------
+# Turn off the DX_CURRENT_FEATURE if the required feature is off.
+AC_DEFUN([DX_CLEAR_DEPEND], [
+test "$DX_FLAG_$1" = "$2" || AC_SUBST([DX_FLAG_[]DX_CURRENT_FEATURE], 0)
+])
+
+# DX_FEATURE_ARG(FEATURE, DESCRIPTION,
+# CHECK_DEPEND, CLEAR_DEPEND,
+# REQUIRE, DO-IF-ON, DO-IF-OFF)
+# --------------------------------------------
+# Parse the command-line option controlling a feature. CHECK_DEPEND is called
+# if the user explicitly turns the feature on (and invokes DX_CHECK_DEPEND),
+# otherwise CLEAR_DEPEND is called to turn off the default state if a required
+# feature is disabled (using DX_CLEAR_DEPEND). REQUIRE performs additional
+# requirement tests (DX_REQUIRE_PROG). Finally, an automake flag is set and
+# DO-IF-ON or DO-IF-OFF are called according to the final state of the feature.
+AC_DEFUN([DX_ARG_ABLE], [
+ AC_DEFUN([DX_CURRENT_FEATURE], [$1])
+ AC_DEFUN([DX_CURRENT_DESCRIPTION], [$2])
+ AC_ARG_ENABLE(doxygen-$1,
+ [AS_HELP_STRING(DX_IF_FEATURE([$1], [--disable-doxygen-$1],
+ [--enable-doxygen-$1]),
+ DX_IF_FEATURE([$1], [don't $2], [$2]))],
+ [
+case "$enableval" in
+#(
+y|Y|yes|Yes|YES)
+ AC_SUBST([DX_FLAG_$1], 1)
+ $3
+;; #(
+n|N|no|No|NO)
+ AC_SUBST([DX_FLAG_$1], 0)
+;; #(
+*)
+ AC_MSG_ERROR([invalid value '$enableval' given to doxygen-$1])
+;;
+esac
+], [
+AC_SUBST([DX_FLAG_$1], [DX_IF_FEATURE([$1], 1, 0)])
+$4
+])
+if DX_TEST_FEATURE([$1]); then
+ $5
+ :
+fi
+if DX_TEST_FEATURE([$1]); then
+ AM_CONDITIONAL(DX_COND_$1, :)
+ $6
+ :
+else
+ AM_CONDITIONAL(DX_COND_$1, false)
+ $7
+ :
+fi
+])
+
+## -------------- ##
+## Public macros. ##
+## -------------- ##
+
+# DX_XXX_FEATURE(DEFAULT_STATE)
+# -----------------------------
+AC_DEFUN([DX_DOXYGEN_FEATURE], [AC_DEFUN([DX_FEATURE_doc], [$1])])
+AC_DEFUN([DX_MAN_FEATURE], [AC_DEFUN([DX_FEATURE_man], [$1])])
+AC_DEFUN([DX_HTML_FEATURE], [AC_DEFUN([DX_FEATURE_html], [$1])])
+AC_DEFUN([DX_CHM_FEATURE], [AC_DEFUN([DX_FEATURE_chm], [$1])])
+AC_DEFUN([DX_CHI_FEATURE], [AC_DEFUN([DX_FEATURE_chi], [$1])])
+AC_DEFUN([DX_RTF_FEATURE], [AC_DEFUN([DX_FEATURE_rtf], [$1])])
+AC_DEFUN([DX_XML_FEATURE], [AC_DEFUN([DX_FEATURE_xml], [$1])])
+AC_DEFUN([DX_XML_FEATURE], [AC_DEFUN([DX_FEATURE_xml], [$1])])
+AC_DEFUN([DX_PDF_FEATURE], [AC_DEFUN([DX_FEATURE_pdf], [$1])])
+AC_DEFUN([DX_PS_FEATURE], [AC_DEFUN([DX_FEATURE_ps], [$1])])
+
+# DX_INIT_DOXYGEN(PROJECT, [CONFIG-FILE], [OUTPUT-DOC-DIR])
+# ---------------------------------------------------------
+# PROJECT also serves as the base name for the documentation files.
+# The default CONFIG-FILE is "Doxyfile" and OUTPUT-DOC-DIR is "doxygen-doc".
+AC_DEFUN([DX_INIT_DOXYGEN], [
+
+# Files:
+AC_SUBST([DX_PROJECT], [$1])
+AC_SUBST([DX_CONFIG], [[\$\(top_srcdir\)/]ifelse([$2], [], Doxyfile, [$2])])
+AC_SUBST([DX_DOCDIR], [[\$\(top_srcdir\)/]ifelse([$3], [], doxygen-doc, [$3])])
+
+# Environment variables used inside doxygen.cfg:
+DX_ENV_APPEND(SRCDIR, [\$(top_srcdir)])
+DX_ENV_APPEND(PROJECT, $DX_PROJECT)
+DX_ENV_APPEND(DOCDIR, $DX_DOCDIR)
+DX_ENV_APPEND(VERSION, $PACKAGE_VERSION)
+
+# Doxygen itself:
+DX_ARG_ABLE(doc, [generate any doxygen documentation],
+ [],
+ [],
+ [DX_REQUIRE_PROG([DX_DOXYGEN], doxygen)
+ DX_REQUIRE_PROG([DX_PERL], perl)],
+ [DX_ENV_APPEND(PERL_PATH, $DX_PERL)])
+
+# Dot for graphics:
+DX_ARG_ABLE(dot, [generate graphics for doxygen documentation],
+ [DX_CHECK_DEPEND(doc, 1)],
+ [DX_CLEAR_DEPEND(doc, 1)],
+ [DX_REQUIRE_PROG([DX_DOT], dot)],
+ [DX_ENV_APPEND(HAVE_DOT, YES)
+ DX_ENV_APPEND(DOT_PATH, [`DX_DIRNAME_EXPR($DX_DOT)`])],
+ [DX_ENV_APPEND(HAVE_DOT, NO)])
+
+# Man pages generation:
+DX_ARG_ABLE(man, [generate doxygen manual pages],
+ [DX_CHECK_DEPEND(doc, 1)],
+ [DX_CLEAR_DEPEND(doc, 1)],
+ [],
+ [DX_ENV_APPEND(GENERATE_MAN, YES)],
+ [DX_ENV_APPEND(GENERATE_MAN, NO)])
+
+# RTF file generation:
+DX_ARG_ABLE(rtf, [generate doxygen RTF documentation],
+ [DX_CHECK_DEPEND(doc, 1)],
+ [DX_CLEAR_DEPEND(doc, 1)],
+ [],
+ [DX_ENV_APPEND(GENERATE_RTF, YES)],
+ [DX_ENV_APPEND(GENERATE_RTF, NO)])
+
+# XML file generation:
+DX_ARG_ABLE(xml, [generate doxygen XML documentation],
+ [DX_CHECK_DEPEND(doc, 1)],
+ [DX_CLEAR_DEPEND(doc, 1)],
+ [],
+ [DX_ENV_APPEND(GENERATE_XML, YES)],
+ [DX_ENV_APPEND(GENERATE_XML, NO)])
+
+# (Compressed) HTML help generation:
+DX_ARG_ABLE(chm, [generate doxygen compressed HTML help documentation],
+ [DX_CHECK_DEPEND(doc, 1)],
+ [DX_CLEAR_DEPEND(doc, 1)],
+ [DX_REQUIRE_PROG([DX_HHC], hhc)],
+ [DX_ENV_APPEND(HHC_PATH, $DX_HHC)
+ DX_ENV_APPEND(GENERATE_HTML, YES)
+ DX_ENV_APPEND(GENERATE_HTMLHELP, YES)],
+ [DX_ENV_APPEND(GENERATE_HTMLHELP, NO)])
+
+# Seperate CHI file generation.
+DX_ARG_ABLE(chi, [generate doxygen seperate compressed HTML help index file],
+ [DX_CHECK_DEPEND(chm, 1)],
+ [DX_CLEAR_DEPEND(chm, 1)],
+ [],
+ [DX_ENV_APPEND(GENERATE_CHI, YES)],
+ [DX_ENV_APPEND(GENERATE_CHI, NO)])
+
+# Plain HTML pages generation:
+DX_ARG_ABLE(html, [generate doxygen plain HTML documentation],
+ [DX_CHECK_DEPEND(doc, 1) DX_CHECK_DEPEND(chm, 0)],
+ [DX_CLEAR_DEPEND(doc, 1) DX_CLEAR_DEPEND(chm, 0)],
+ [],
+ [DX_ENV_APPEND(GENERATE_HTML, YES)],
+ [DX_TEST_FEATURE(chm) || DX_ENV_APPEND(GENERATE_HTML, NO)])
+
+# PostScript file generation:
+DX_ARG_ABLE(ps, [generate doxygen PostScript documentation],
+ [DX_CHECK_DEPEND(doc, 1)],
+ [DX_CLEAR_DEPEND(doc, 1)],
+ [DX_REQUIRE_PROG([DX_LATEX], latex)
+ DX_REQUIRE_PROG([DX_MAKEINDEX], makeindex)
+ DX_REQUIRE_PROG([DX_DVIPS], dvips)
+ DX_REQUIRE_PROG([DX_EGREP], egrep)])
+
+# PDF file generation:
+DX_ARG_ABLE(pdf, [generate doxygen PDF documentation],
+ [DX_CHECK_DEPEND(doc, 1)],
+ [DX_CLEAR_DEPEND(doc, 1)],
+ [DX_REQUIRE_PROG([DX_PDFLATEX], pdflatex)
+ DX_REQUIRE_PROG([DX_MAKEINDEX], makeindex)
+ DX_REQUIRE_PROG([DX_EGREP], egrep)])
+
+# LaTeX generation for PS and/or PDF:
+if DX_TEST_FEATURE(ps) || DX_TEST_FEATURE(pdf); then
+ AM_CONDITIONAL(DX_COND_latex, :)
+ DX_ENV_APPEND(GENERATE_LATEX, YES)
+else
+ AM_CONDITIONAL(DX_COND_latex, false)
+ DX_ENV_APPEND(GENERATE_LATEX, NO)
+fi
+
+# Paper size for PS and/or PDF:
+AC_ARG_VAR(DOXYGEN_PAPER_SIZE,
+ [a4wide (default), a4, letter, legal or executive])
+case "$DOXYGEN_PAPER_SIZE" in
+#(
+"")
+ AC_SUBST(DOXYGEN_PAPER_SIZE, "")
+;; #(
+a4wide|a4|letter|legal|executive)
+ DX_ENV_APPEND(PAPER_SIZE, $DOXYGEN_PAPER_SIZE)
+;; #(
+*)
+ AC_MSG_ERROR([unknown DOXYGEN_PAPER_SIZE='$DOXYGEN_PAPER_SIZE'])
+;;
+esac
+
+#For debugging:
+#echo DX_FLAG_doc=$DX_FLAG_doc
+#echo DX_FLAG_dot=$DX_FLAG_dot
+#echo DX_FLAG_man=$DX_FLAG_man
+#echo DX_FLAG_html=$DX_FLAG_html
+#echo DX_FLAG_chm=$DX_FLAG_chm
+#echo DX_FLAG_chi=$DX_FLAG_chi
+#echo DX_FLAG_rtf=$DX_FLAG_rtf
+#echo DX_FLAG_xml=$DX_FLAG_xml
+#echo DX_FLAG_pdf=$DX_FLAG_pdf
+#echo DX_FLAG_ps=$DX_FLAG_ps
+#echo DX_ENV=$DX_ENV
+])
diff --git a/trunk/bitbake-ng/m4/internal/visibility.m4 b/trunk/bitbake-ng/m4/internal/visibility.m4
new file mode 100644
index 000000000..eb2c8f923
--- /dev/null
+++ b/trunk/bitbake-ng/m4/internal/visibility.m4
@@ -0,0 +1,74 @@
+# BB_CXX_SUPPORTS_HIDDEN_VISIBILITY_INLINES
+# ----------
+# Check the C++ compiler for support for -fvisibility-inlines-hidden.
+AC_DEFUN([BB_CXX_SUPPORTS_HIDDEN_VISIBILITY_INLINES],
+[AC_REQUIRE([AC_PROG_CXX])
+ bb_save_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS="-fvisibility-inlines-hidden $bb_save_CXXFLAGS"
+ AC_CACHE_CHECK([whether the C++ compiler supports -fvisibility-inlines-hidden],
+ [bb_cv_cc_supports_hidden_visibility_inlines], [
+ AC_LANG_PUSH(C++)
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], [bb_cv_cc_supports_hidden_visibility_inlines=yes], [bb_cv_cc_supports_hidden_visibility_inlines=no])
+ AC_LANG_POP(C++)
+ ])
+ CXXFLAGS="$bb_save_CXXFLAGS"
+]) # BB_CXX_SUPPORTS_HIDDEN_VISIBILITY_INLINES
+
+
+# BB_CXX_HIDDEN_VISIBILITY_INLINES
+# ----------
+# Decide whether or not to use -fvisibility-inlines-hidden for c++ applications.
+AC_DEFUN([BB_CXX_HIDDEN_VISIBILITY_INLINES],
+[AC_REQUIRE([BB_CXX_SUPPORTS_HIDDEN_VISIBILITY_INLINES])
+ AC_MSG_CHECKING([whether to use -fvisibility-inlines-hidden])
+ AC_ARG_WITH([hidden_visibility_inlines],
+ AC_HELP_STRING([--with-hidden_visibility_inlines=VAL],
+ [use -fvisibility-inlines-hidden (default VAL is 'auto')]),
+ [bb_with_hidden_visibility_inlines=$withval], [bb_with_hidden_visibility_inlines=auto])
+
+ if test "x$bb_with_hidden_visibility_inlines" != "xno" && \
+ test "x$bb_cv_cc_supports_hidden_visibility_inlines" != "xno"; then
+ AC_MSG_RESULT([yes])
+ CXXFLAGS="-fvisibility-inlines-hidden $CXXFLAGS"
+ AC_MSG_NOTICE([prepending -fvisibility-inlines-hidden to CXXFLAGS])
+ else
+ AC_MSG_RESULT([no])
+ fi
+]) # BB_CXX_HIDDEN_VISIBILITY_INLINES
+
+
+# BB_CC_SUPPORTS_HIDDEN_VISIBILITY
+# ----------
+# Check the C compiler for support for -fvisibility=hidden.
+AC_DEFUN([BB_CC_SUPPORTS_HIDDEN_VISIBILITY],
+[AC_REQUIRE([AC_PROG_CC])
+ bb_save_CFLAGS="$CFLAGS"
+ CFLAGS="-fvisibility=hidden $bb_save_CFLAGS"
+ AC_CACHE_CHECK([whether the C compiler supports -fvisibility=hidden],
+ [bb_cv_cc_supports_hidden_visibility], [
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], [bb_cv_cc_supports_hidden_visibility=yes], [bb_cv_cc_supports_hidden_visibility=no])
+ ])
+ CFLAGS="$bb_save_CFLAGS"
+]) # BB_CC_SUPPORTS_HIDDEN_VISIBILITY
+
+
+# BB_CC_HIDDEN_VISIBILITY
+# ----------
+# Decide whether or not to use -fvisibility=hidden.
+AC_DEFUN([BB_CC_HIDDEN_VISIBILITY],
+[AC_REQUIRE([BB_CC_SUPPORTS_HIDDEN_VISIBILITY])
+ AC_MSG_CHECKING([whether to use -fvisibility=hidden])
+ AC_ARG_WITH([hidden_visibility],
+ AC_HELP_STRING([--with-hidden_visibility=VAL],
+ [use -fvisibility=hidden (default VAL is 'auto')]),
+ [bb_with_hidden_visibility=$withval], [bb_with_hidden_visibility=auto])
+
+ if test "x$bb_with_hidden_visibility" != "xno" && \
+ test "x$bb_cv_cc_supports_hidden_visibility" != "xno"; then
+ AC_MSG_RESULT([yes])
+ CFLAGS="-DGCC_HASCLASSVISIBILITY -fvisibility=hidden $CFLAGS"
+ AC_MSG_NOTICE([prepending -DGCC_HASCLASSVISIBILITY -fvisibility=hidden to CFLAGS])
+ else
+ AC_MSG_RESULT([no])
+ fi
+]) # BB_CC_HIDDEN_VISIBILITY
diff --git a/trunk/bitbake-ng/src/Makefile.am b/trunk/bitbake-ng/src/Makefile.am
new file mode 100644
index 000000000..953fa5dbf
--- /dev/null
+++ b/trunk/bitbake-ng/src/Makefile.am
@@ -0,0 +1,12 @@
+AM_CPPFLAGS = -I$(top_srcdir)/include \
+ $(BBDLL_EXPORTS)
+
+lib_LTLIBRARIES = libbitbake-0.0.la
+libbitbake_0_0_la_SOURCES = data.c
+libbitbake_0_0_la_CFLAGS = $(GLIB2_CFLAGS)
+libbitbake_0_0_la_LIBADD = $(GLIB2_LIBS)
+libbitbake_0_0_la_LDFLAGS = -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
+ -export-dynamic
+
+maintainer-clean-local:
+ rm -f $(srcdir)/Makefile.in
diff --git a/trunk/bitbake-ng/src/binreloc.c b/trunk/bitbake-ng/src/binreloc.c
new file mode 100644
index 000000000..a392297bc
--- /dev/null
+++ b/trunk/bitbake-ng/src/binreloc.c
@@ -0,0 +1,436 @@
+/*
+ * BinReloc - a library for creating relocatable executables
+ * Written by: Mike Hearn <mike@theoretic.com>
+ * Hongli Lai <h.lai@chello.nl>
+ * http://autopackage.org/
+ *
+ * This source code is public domain. You can relicense this code
+ * under whatever license you want.
+ *
+ * NOTE: if you're using C++ and are getting "undefined reference
+ * to br_*", try renaming prefix.c to prefix.cpp
+ */
+
+/* WARNING, BEFORE YOU MODIFY PREFIX.C:
+ *
+ * If you make changes to any of the functions in prefix.c, you MUST
+ * change the BR_NAMESPACE macro (in prefix.h).
+ * This way you can avoid symbol table conflicts with other libraries
+ * that also happen to use BinReloc.
+ *
+ * Example:
+ * #define BR_NAMESPACE(funcName) foobar_ ## funcName
+ * --> expands br_locate to foobar_br_locate
+ */
+
+#ifndef _PREFIX_C_
+#define _PREFIX_C_
+
+#ifndef BR_PTHREADS
+ /* Change 1 to 0 if you don't want pthread support */
+ #define BR_PTHREADS 1
+#endif /* BR_PTHREADS */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <pthread.h>
+#include <limits.h>
+#include <string.h>
+#include "binreloc.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+#undef NULL
+#define NULL ((void *) 0)
+
+#ifdef __GNUC__
+ #define br_return_val_if_fail(expr,val) if (!(expr)) {fprintf (stderr, "** BinReloc (%s): assertion %s failed\n", __PRETTY_FUNCTION__, #expr); return val;}
+#else
+ #define br_return_val_if_fail(expr,val) if (!(expr)) return val
+#endif /* __GNUC__ */
+
+
+#ifdef ENABLE_BINRELOC
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/param.h>
+#include <unistd.h>
+
+
+/**
+ * br_locate:
+ * symbol: A symbol that belongs to the app/library you want to locate.
+ * Returns: A newly allocated string containing the full path of the
+ * app/library that func belongs to, or NULL on error. This
+ * string should be freed when not when no longer needed.
+ *
+ * Finds out to which application or library symbol belongs, then locate
+ * the full path of that application or library.
+ * Note that symbol cannot be a pointer to a function. That will not work.
+ *
+ * Example:
+ * --> main.c
+ * #include "prefix.h"
+ * #include "bitbake-ng.h"
+ *
+ * int main (int argc, char *argv[]) {
+ * printf ("Full path of this app: %s\n", br_locate (&argc));
+ * bitbake-ng_start ();
+ * return 0;
+ * }
+ *
+ * --> bitbake-ng.c starts here
+ * #include "prefix.h"
+ *
+ * void bitbake-ng_start () {
+ * --> "" is a symbol that belongs to bitbake-ng (because it's called
+ * --> from bitbake-ng_start()); that's why this works.
+ * printf ("bitbake-ng is located in: %s\n", br_locate (""));
+ * }
+ */
+char *
+br_locate (void *symbol)
+{
+ char line[5000];
+ FILE *f;
+ char *path;
+
+ br_return_val_if_fail (symbol != NULL, NULL);
+
+ f = fopen ("/proc/self/maps", "r");
+ if (!f)
+ return NULL;
+
+ while (!feof (f))
+ {
+ unsigned int start, end;
+
+ if (!fgets (line, sizeof (line), f))
+ continue;
+ if (!strstr (line, " r-xp ") || !strchr (line, '/'))
+ continue;
+
+ sscanf (line, "%x-%x ", &start, &end);
+ if (((unsigned int) symbol) >= start && ((unsigned int) symbol) < end)
+ {
+ char *tmp;
+ size_t len;
+
+ /* Extract the filename; it is always an absolute path */
+ path = strchr (line, '/');
+
+ /* Get rid of the newline */
+ tmp = strrchr (path, '\n');
+ if (tmp) *tmp = 0;
+
+ /* Get rid of "(deleted)" */
+ len = strlen (path);
+ if (len > 10 && strcmp (path + len - 10, " (deleted)") == 0)
+ {
+ tmp = path + len - 10;
+ *tmp = 0;
+ }
+
+ fclose(f);
+ return strdup (path);
+ }
+ }
+
+ fclose (f);
+ return NULL;
+}
+
+
+/**
+ * br_locate_prefix:
+ * symbol: A symbol that belongs to the app/library you want to locate.
+ * Returns: A prefix. This string should be freed when no longer needed.
+ *
+ * Locates the full path of the app/library that symbol belongs to, and return
+ * the prefix of that path, or NULL on error.
+ * Note that symbol cannot be a pointer to a function. That will not work.
+ *
+ * Example:
+ * --> This application is located in /usr/bin/foo
+ * br_locate_prefix (&argc); --> returns: "/usr"
+ */
+char *
+br_locate_prefix (void *symbol)
+{
+ char *path, *prefix;
+
+ br_return_val_if_fail (symbol != NULL, NULL);
+
+ path = br_locate (symbol);
+ if (!path) return NULL;
+
+ prefix = br_extract_prefix (path);
+ free (path);
+ return prefix;
+}
+
+
+/**
+ * br_prepend_prefix:
+ * symbol: A symbol that belongs to the app/library you want to locate.
+ * path: The path that you want to prepend the prefix to.
+ * Returns: The new path, or NULL on error. This string should be freed when no
+ * longer needed.
+ *
+ * Gets the prefix of the app/library that symbol belongs to. Prepend that prefix to path.
+ * Note that symbol cannot be a pointer to a function. That will not work.
+ *
+ * Example:
+ * --> The application is /usr/bin/foo
+ * br_prepend_prefix (&argc, "/share/foo/data.png"); --> Returns "/usr/share/foo/data.png"
+ */
+char *
+br_prepend_prefix (void *symbol, char *path)
+{
+ char *tmp, *newpath;
+
+ br_return_val_if_fail (symbol != NULL, NULL);
+ br_return_val_if_fail (path != NULL, NULL);
+
+ tmp = br_locate_prefix (symbol);
+ if (!tmp) return NULL;
+
+ if (strcmp (tmp, "/") == 0)
+ newpath = strdup (path);
+ else
+ newpath = br_strcat (tmp, path);
+
+ /* Get rid of compiler warning ("br_prepend_prefix never used") */
+ if (0) br_prepend_prefix (NULL, NULL);
+
+ free (tmp);
+ return newpath;
+}
+
+#endif /* ENABLE_BINRELOC */
+
+
+/* Pthread stuff for thread safetiness */
+#if BR_PTHREADS
+
+static pthread_key_t br_thread_key;
+static pthread_once_t br_thread_key_once = PTHREAD_ONCE_INIT;
+
+
+static void
+br_thread_local_store_fini ()
+{
+ char *specific;
+
+ specific = (char *) pthread_getspecific (br_thread_key);
+ if (specific)
+ {
+ free (specific);
+ pthread_setspecific (br_thread_key, NULL);
+ }
+ pthread_key_delete (br_thread_key);
+ br_thread_key = 0;
+}
+
+
+static void
+br_str_free (void *str)
+{
+ if (str)
+ free (str);
+}
+
+
+static void
+br_thread_local_store_init ()
+{
+ if (pthread_key_create (&br_thread_key, br_str_free) == 0)
+ atexit (br_thread_local_store_fini);
+}
+
+#else /* BR_PTHREADS */
+
+static char *br_last_value = NULL;
+
+static void
+br_free_last_value ()
+{
+ if (br_last_value)
+ free (br_last_value);
+}
+
+#endif /* BR_PTHREADS */
+
+
+/**
+ * br_thread_local_store:
+ * str: A dynamically allocated string.
+ * Returns: str. This return value must not be freed.
+ *
+ * Store str in a thread-local variable and return str. The next
+ * you run this function, that variable is freed too.
+ * This function is created so you don't have to worry about freeing
+ * strings.
+ *
+ * Example:
+ * char *foo;
+ * foo = thread_local_store (strdup ("hello")); --> foo == "hello"
+ * foo = thread_local_store (strdup ("world")); --> foo == "world"; "hello" is now freed.
+ */
+const char *
+br_thread_local_store (char *str)
+{
+ #if BR_PTHREADS
+ char *specific;
+
+ pthread_once (&br_thread_key_once, br_thread_local_store_init);
+
+ specific = (char *) pthread_getspecific (br_thread_key);
+ br_str_free (specific);
+ pthread_setspecific (br_thread_key, str);
+
+ #else /* BR_PTHREADS */
+ static int initialized = 0;
+
+ if (!initialized)
+ {
+ atexit (br_free_last_value);
+ initialized = 1;
+ }
+
+ if (br_last_value)
+ free (br_last_value);
+ br_last_value = str;
+ #endif /* BR_PTHREADS */
+
+ return (const char *) str;
+}
+
+
+/**
+ * br_strcat:
+ * str1: A string.
+ * str2: Another string.
+ * Returns: A newly-allocated string. This string should be freed when no longer needed.
+ *
+ * Concatenate str1 and str2 to a newly allocated string.
+ */
+char *
+br_strcat (const char *str1, const char *str2)
+{
+ char *result;
+
+ if (!str1) str1 = "";
+ if (!str2) str2 = "";
+
+ result = (char *) calloc (sizeof (char), strlen (str1) + strlen (str2) + 1);
+ result = strcpy (result, str1);
+ result = strcat (result, str2);
+ return result;
+}
+
+
+/* Emulates glibc's strndup() */
+static char *
+br_strndup (char *str, size_t size)
+{
+ char *result = NULL;
+ size_t len;
+
+ br_return_val_if_fail (str != NULL, NULL);
+
+ len = strlen (str);
+ if (!len) return strdup ("");
+
+ result = (char *) calloc (sizeof (char), len + 1);
+ memcpy (result, str, size);
+ return result;
+}
+
+
+/**
+ * br_extract_dir:
+ * path: A path.
+ * Returns: A directory name. This string should be freed when no longer needed.
+ *
+ * Extracts the directory component of path. Similar to g_dirname() or the dirname
+ * commandline application.
+ *
+ * Example:
+ * br_extract_dir ("/usr/local/foobar"); --> Returns: "/usr/local"
+ */
+char *
+br_extract_dir (const char *path)
+{
+ char *end, *result;
+
+ br_return_val_if_fail (path != NULL, NULL);
+
+ end = strrchr (path, '/');
+ if (!end) return strdup (".");
+
+ while (end > path && *end == '/')
+ end--;
+ result = br_strndup ((char *) path, end - path + 1);
+ if (!*result)
+ {
+ free (result);
+ return strdup ("/");
+ } else
+ return result;
+}
+
+
+/**
+ * br_extract_prefix:
+ * path: The full path of an executable or library.
+ * Returns: The prefix, or NULL on error. This string should be freed when no longer needed.
+ *
+ * Extracts the prefix from path. This function assumes that your executable
+ * or library is installed in an LSB-compatible directory structure.
+ *
+ * Example:
+ * br_extract_prefix ("/usr/bin/gnome-panel"); --> Returns "/usr"
+ * br_extract_prefix ("/usr/local/bitbake-ng.so"); --> Returns "/usr/local"
+ */
+char *
+br_extract_prefix (const char *path)
+{
+ char *end, *tmp, *result;
+
+ br_return_val_if_fail (path != NULL, NULL);
+
+ if (!*path) return strdup ("/");
+ end = strrchr (path, '/');
+ if (!end) return strdup (path);
+
+ tmp = br_strndup ((char *) path, end - path);
+ if (!*tmp)
+ {
+ free (tmp);
+ return strdup ("/");
+ }
+ end = strrchr (tmp, '/');
+ if (!end) return tmp;
+
+ result = br_strndup (tmp, end - tmp);
+ free (tmp);
+
+ if (!*result)
+ {
+ free (result);
+ result = strdup ("/");
+ }
+
+ return result;
+}
+
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* _PREFIX_C */
diff --git a/trunk/bitbake-ng/src/binreloc.h b/trunk/bitbake-ng/src/binreloc.h
new file mode 100644
index 000000000..9c450c60e
--- /dev/null
+++ b/trunk/bitbake-ng/src/binreloc.h
@@ -0,0 +1,121 @@
+/*
+ * BinReloc - a library for creating relocatable executables
+ * Written by: Mike Hearn <mike@theoretic.com>
+ * Hongli Lai <h.lai@chello.nl>
+ * http://autopackage.org/
+ *
+ * This source code is public domain. You can relicense this code
+ * under whatever license you want.
+ *
+ * See http://autopackage.org/docs/binreloc/ for
+ * more information and how to use this.
+ *
+ * NOTE: if you're using C++ and are getting "undefined reference
+ * to br_*", try renaming prefix.c to prefix.cpp
+ */
+
+#ifndef _PREFIX_H_
+#define _PREFIX_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/* WARNING, BEFORE YOU MODIFY PREFIX.C:
+ *
+ * If you make changes to any of the functions in prefix.c, you MUST
+ * change the BR_NAMESPACE macro.
+ * This way you can avoid symbol table conflicts with other libraries
+ * that also happen to use BinReloc.
+ *
+ * Example:
+ * #define BR_NAMESPACE(funcName) foobar_ ## funcName
+ * --> expands br_locate to foobar_br_locate
+ */
+#undef BR_NAMESPACE
+#define BR_NAMESPACE(funcName) funcName
+
+
+#ifdef ENABLE_BINRELOC
+
+#define br_thread_local_store BR_NAMESPACE(br_thread_local_store)
+#define br_locate BR_NAMESPACE(br_locate)
+#define br_locate_prefix BR_NAMESPACE(br_locate_prefix)
+#define br_prepend_prefix BR_NAMESPACE(br_prepend_prefix)
+
+#ifndef BR_NO_MACROS
+ /* These are convience macros that replace the ones usually used
+ in Autoconf/Automake projects */
+ #undef SELFPATH
+ #undef PREFIX
+ #undef PREFIXDIR
+ #undef BINDIR
+ #undef SBINDIR
+ #undef DATADIR
+ #undef LIBDIR
+ #undef LIBEXECDIR
+ #undef ETCDIR
+ #undef SYSCONFDIR
+ #undef CONFDIR
+ #undef LOCALEDIR
+
+ #define SELFPATH (br_thread_local_store (br_locate ((void *) "")))
+ #define PREFIX (br_thread_local_store (br_locate_prefix ((void *) "")))
+ #define PREFIXDIR (br_thread_local_store (br_locate_prefix ((void *) "")))
+ #define BINDIR (br_thread_local_store (br_prepend_prefix ((void *) "", "/bin")))
+ #define SBINDIR (br_thread_local_store (br_prepend_prefix ((void *) "", "/sbin")))
+ #define DATADIR (br_thread_local_store (br_prepend_prefix ((void *) "", "/share")))
+ #define LIBDIR (br_thread_local_store (br_prepend_prefix ((void *) "", "/lib")))
+ #define LIBEXECDIR (br_thread_local_store (br_prepend_prefix ((void *) "", "/libexec")))
+ #define ETCDIR (br_thread_local_store (br_prepend_prefix ((void *) "", "/etc")))
+ #define SYSCONFDIR (br_thread_local_store (br_prepend_prefix ((void *) "", "/etc")))
+ #define CONFDIR (br_thread_local_store (br_prepend_prefix ((void *) "", "/etc")))
+ #define LOCALEDIR (br_thread_local_store (br_prepend_prefix ((void *) "", "/share/locale")))
+#endif /* BR_NO_MACROS */
+
+
+/* The following functions are used internally by BinReloc
+ and shouldn't be used directly in applications. */
+
+const char *br_thread_local_store (char *str);
+char *br_locate (void *symbol);
+char *br_locate_prefix (void *symbol);
+char *br_prepend_prefix (void *symbol, char *path);
+
+
+#endif /* ENABLE_BINRELOC */
+
+
+/* These macros and functions are not guarded by the ENABLE_BINRELOC
+ * macro because they are portable. You can use these functions.
+ */
+
+#define br_strcat BR_NAMESPACE(br_strcat)
+#define br_extract_dir BR_NAMESPACE(br_extract_dir)
+#define br_extract_prefix BR_NAMESPACE(br_extract_prefix)
+
+#ifndef BR_NO_MACROS
+ /* Convenience functions for concatenating paths */
+ #define BR_SELFPATH(suffix) (br_thread_local_store (br_strcat (SELFPATH, suffix)))
+ #define BR_PREFIX(suffix) (br_thread_local_store (br_strcat (PREFIX, suffix)))
+ #define BR_PREFIXDIR(suffix) (br_thread_local_store (br_strcat (BR_PREFIX, suffix)))
+ #define BR_BINDIR(suffix) (br_thread_local_store (br_strcat (BINDIR, suffix)))
+ #define BR_SBINDIR(suffix) (br_thread_local_store (br_strcat (SBINDIR, suffix)))
+ #define BR_DATADIR(suffix) (br_thread_local_store (br_strcat (DATADIR, suffix)))
+ #define BR_LIBDIR(suffix) (br_thread_local_store (br_strcat (LIBDIR, suffix)))
+ #define BR_ETCDIR(suffix) (br_thread_local_store (br_strcat (ETCDIR, suffix)))
+ #define BR_SYSCONFDIR(suffix) (br_thread_local_store (br_strcat (SYSCONFDIR, suffix)))
+ #define BR_CONFDIR(suffix) (br_thread_local_store (br_strcat (CONFDIR, suffix)))
+ #define BR_LOCALEDIR(suffix) (br_thread_local_store (br_strcat (LOCALEDIR, suffix)))
+#endif
+
+char *br_strcat (const char *str1, const char *str2);
+char *br_extract_dir (const char *path);
+char *br_extract_prefix(const char *path);
+
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* _PREFIX_H_ */
diff --git a/trunk/bitbake-ng/src/data.c b/trunk/bitbake-ng/src/data.c
new file mode 100644
index 000000000..c563c5b6e
--- /dev/null
+++ b/trunk/bitbake-ng/src/data.c
@@ -0,0 +1,173 @@
+/* ex:ts=4:sw=4:sts=4:et
+ * -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+ *
+ * Copyright (C) 2004, 2005 Chris Larson <kergoth@handhelds.org>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+/** @file data.c
+ * @brief Bitbake Metadata Handling Code */
+
+# include <bitbake/common.h>
+# include <bitbake/data.h>
+# include <bitbake/data-private.h>
+# include <glib.h>
+
+static void _bb_data_destroy_element(gpointer data)
+{
+ g_free(data);
+}
+
+static void _bb_data_var_list_free(gpointer data, gpointer user_data)
+{
+ user_data=user_data;
+ g_free(data);
+}
+
+static void _bb_data_destroy_var(gpointer data)
+{
+ struct bb_var *var = data;
+ g_free(var->key);
+ g_free(var->val);
+ g_list_foreach(var->chunks, _bb_data_var_list_free, NULL);
+ g_list_free(var->chunks);
+ g_list_foreach(var->referrers, _bb_data_var_list_free, NULL);
+ g_list_free(var->referrers);
+ g_hash_table_destroy(var->attributes);
+}
+
+gpointer bb_data_new(void)
+{
+ struct bb_data *data;
+
+ data = g_new0(struct bb_data, 1);
+ data->data = g_hash_table_new_full(g_str_hash, g_str_equal, _bb_data_destroy_element, _bb_data_destroy_var);
+
+ return data;
+}
+
+gchar *bb_data_lookup(gconstpointer ptr, gchar *var)
+{
+ const struct bb_data *data = ptr;
+ const struct bb_var *bbvar;
+
+ g_return_val_if_fail(G_LIKELY(data != NULL), FALSE);
+ g_return_val_if_fail(G_LIKELY(data->data != NULL), FALSE);
+ g_return_val_if_fail(G_LIKELY(var != NULL), FALSE);
+
+ bbvar = g_hash_table_lookup(data->data, var);
+ return bbvar->val;
+}
+
+gboolean bb_data_insert(gpointer ptr, gchar *var, gchar *val)
+{
+ struct bb_data *data = ptr;
+ struct bb_var *bbvar;
+ struct bb_var_chunk *main_chunk;
+
+ g_return_val_if_fail(G_LIKELY(data != NULL), FALSE);
+ g_return_val_if_fail(G_LIKELY(data->data != NULL), FALSE);
+ g_return_val_if_fail(G_LIKELY(var != NULL), FALSE);
+
+ bbvar = g_new0(struct bb_var, 1);
+ bbvar->attributes = g_hash_table_new_full(g_str_hash, g_str_equal, _bb_data_destroy_element, _bb_data_destroy_element);
+ bbvar->key = var;
+
+ /* FIXME: rip apart the string into its chunks, and update our referrers
+ * list based on our chunks which are variable references */
+ main_chunk = g_new0(struct bb_var_chunk, 1);
+ main_chunk->data = (void *)val;
+ main_chunk->type = BB_VAR_STR;
+ g_list_append(bbvar->chunks, main_chunk);
+
+ /* FIXME: set our cached value correctly, using the values of the vars
+ * that we reference */
+ bbvar->val = val;
+
+ /* FIXME: need to check the hash table before inserting. if this key
+ * already exists, then we need to update its value and update
+ * the cached value of any variables that reference us */
+ g_hash_table_insert(data->data, var, bbvar);
+
+ return TRUE;
+}
+
+gboolean bb_data_remove(gpointer ptr, gchar *var)
+{
+ struct bb_data *data = ptr;
+
+ g_return_val_if_fail(G_LIKELY(data != NULL), FALSE);
+ g_return_val_if_fail(G_LIKELY(data->data != NULL), FALSE);
+ g_return_val_if_fail(G_LIKELY(var != NULL), FALSE);
+
+ g_hash_table_remove(data->data, var);
+ return TRUE;
+}
+
+gchar *bb_data_lookup_attr(gconstpointer ptr, gchar *var, gchar *attr)
+{
+ const struct bb_data *data = ptr;
+
+ g_return_val_if_fail(G_LIKELY(data != NULL), FALSE);
+ g_return_val_if_fail(G_LIKELY(data->data != NULL), FALSE);
+ g_return_val_if_fail(G_LIKELY(var != NULL), FALSE);
+ g_return_val_if_fail(G_LIKELY(attr != NULL), FALSE);
+
+ return NULL;
+}
+
+gboolean bb_data_insert_attr(gpointer ptr, gchar *var, gchar *attr, gchar *val)
+{
+ struct bb_data *data = ptr;
+
+ g_return_val_if_fail(G_LIKELY(data != NULL), FALSE);
+ g_return_val_if_fail(G_LIKELY(data->data != NULL), FALSE);
+ g_return_val_if_fail(G_LIKELY(var != NULL), FALSE);
+ g_return_val_if_fail(G_LIKELY(attr != NULL), FALSE);
+ g_return_val_if_fail(G_LIKELY(val != NULL), FALSE);
+
+ g_assert_not_reached(); /* unimplemented */
+
+ return FALSE;
+}
+
+gboolean bb_data_remove_attr(gpointer ptr, gchar *var, gchar *attr)
+{
+ struct bb_data *data = ptr;
+
+ g_return_val_if_fail(G_LIKELY(data != NULL), FALSE);
+ g_return_val_if_fail(G_LIKELY(data->data != NULL), FALSE);
+ g_return_val_if_fail(G_LIKELY(var != NULL), FALSE);
+ g_return_val_if_fail(G_LIKELY(attr != NULL), FALSE);
+
+ g_assert_not_reached(); /* unimplemented */
+
+ return FALSE;
+}
+
+void bb_data_destroy(gpointer ptr)
+{
+ struct bb_data *data = ptr;
+
+ g_return_if_fail(G_LIKELY(data != NULL));
+
+ g_hash_table_destroy(data->data);
+ g_free(ptr);
+}
diff --git a/trunk/bitbake-ng/tests/Makefile.am b/trunk/bitbake-ng/tests/Makefile.am
new file mode 100644
index 000000000..2984f1225
--- /dev/null
+++ b/trunk/bitbake-ng/tests/Makefile.am
@@ -0,0 +1,19 @@
+AM_CPPFLAGS = -I$(top_srcdir)/include \
+ $(BBDLL_EXPORTS)
+AM_LDFLAGS = -L$(top_srcdir)/src
+
+.PHONY: test
+if BB_TESTS
+noinst_PROGRAMS = check_bitbake_data
+check_bitbake_data_SOURCES = check_bitbake_data.c
+check_bitbake_data_CFLAGS = $(GLIB2_CFLAGS) $(CHECK_CFLAGS)
+check_bitbake_data_LDADD = $(GLIB2_LIBS) $(CHECK_LIBS) -lbitbake-0.0
+
+test:
+ @./check_bitbake_data
+else
+test:
+endif
+
+maintainer-clean-local:
+ rm -f $(srcdir)/Makefile.in
diff --git a/trunk/bitbake-ng/tests/check_bitbake_data.c b/trunk/bitbake-ng/tests/check_bitbake_data.c
new file mode 100644
index 000000000..016dfb81d
--- /dev/null
+++ b/trunk/bitbake-ng/tests/check_bitbake_data.c
@@ -0,0 +1,125 @@
+/* ex:ts=4:sw=4:sts=4:et
+ * -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+ *
+ * Copyright (C) 2004, 2005 Chris Larson <kergoth@handhelds.org>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+/** @file check_bitbake_data.c
+ * @brief First group of metadata tests */
+
+#include <stdlib.h>
+#include <string.h>
+#include <glib.h>
+#include <check.h>
+#include <bitbake.h>
+
+/**
+ * Test the creation and destruction of a struct bb_data
+ * using the bb_data_new() and bb_data_destroy() functions.
+ */
+
+START_TEST (test_data_create_destroy)
+{
+ gpointer data;
+
+ data = bb_data_new();
+ if (data == NULL)
+ fail("Metadata store allocation returned a NULL pointer");
+ bb_data_destroy(data);
+}
+END_TEST
+
+START_TEST (test_data_var_insert)
+{
+ gpointer data;
+ gchar *var, *val;
+
+ data = bb_data_new();
+ var = g_strdup("CC");
+ val = g_strdup("gcc");
+
+ bb_data_insert(data, var, val);
+}
+END_TEST
+
+START_TEST (test_data_var_lookup)
+{
+ gpointer data;
+ gchar *var, *val;
+
+ data = bb_data_new();
+
+ var = g_strdup("CC");
+ val = g_strdup("gcc");
+ bb_data_insert(data, var, val);
+
+ val = bb_data_lookup(data, "CC");
+ if (strcmp(val, "gcc") != 0)
+ fail("CC does not have the correct value");
+
+ bb_data_destroy(data);
+}
+END_TEST
+
+START_TEST (test_data_var_remove)
+{
+ gpointer data;
+ gchar *var, *val;
+
+ data = bb_data_new();
+
+ var = g_strdup("CC");
+ val = g_strdup("gcc");
+ bb_data_insert(data, var, val);
+
+ bb_data_remove(data, var);
+
+ bb_data_destroy(data);
+}
+END_TEST
+
+Suite *bitbake_data_suite(void)
+{
+ Suite *s = suite_create("Bitbake Data");
+ TCase *tc_core = tcase_create("Core");
+ TCase *tc_var = tcase_create("Variable");
+
+ suite_add_tcase (s, tc_core);
+ suite_add_tcase (s, tc_var);
+
+ tcase_add_test(tc_core, test_data_create_destroy);
+
+ tcase_add_test(tc_var, test_data_var_insert);
+ tcase_add_test(tc_var, test_data_var_lookup);
+ tcase_add_test(tc_var, test_data_var_remove);
+ return s;
+}
+
+int main(void)
+{
+ int nf;
+ Suite *s = bitbake_data_suite();
+ SRunner *sr = srunner_create(s);
+ srunner_run_all(sr, CK_NORMAL);
+ nf = srunner_ntests_failed(sr);
+ srunner_free(sr);
+ return (nf == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
+}