Description: Upstream changes introduced in version 2.0-3.1
 This patch has been created by dpkg-source during the package build.
 Here's the last changelog entry, hopefully it gives details on why
 those changes were made:
 .
 scratchbox2 (2.0-3.1) unstable; urgency=low
 .
   [Jari Aalto]
   * Non-maintainer upload.
     - Move to packaging format "3.0 (quilt)" due to patch.
   * debian/control
     - (Vcs-*): Remove obsolete XS-* prefix.
     - (Build-Depends): Add hardening-wrapper because the option syntax of
       /usr/bin/ld.gold.real and GNU ld(1) differ in option --retain-symbols-file
   * debian/patches
     - (Number 10): Add patch to fix Gcc 4.4 error: conflicting type
       for scandir. Patch thanks to Lucas Nussbaum <lucas@lucas-nussbaum.net>.
       (RC bug FTBFS serious; Closes: #552893).
     - (Number 20): Fix binutils gold ld(1) calls.
     - (Number 30): Fix errors: implicit declaration of functions.
   * debian/source/format
     - New file.
 .
 The person named in the Author field signed this changelog entry.
Author: Jari Aalto <jari.aalto@cante.net>
Bug-Debian: http://bugs.debian.org/552893

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: http://bugs.debian.org/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: <YYYY-MM-DD>

--- scratchbox2-2.0.orig/Makefile
+++ scratchbox2-2.0/Makefile
@@ -35,7 +35,7 @@ endif
 CC = gcc
 CXX = g++
 LD = ld
-PACKAGE_VERSION = 2.0
+PACKAGE_VERSION = 2.0-lta101
 
 ifeq ($(shell if [ -d $(SRCDIR)/.git ]; then echo y; fi),y)
 GIT_PV_COMMIT := $(shell git --git-dir=$(SRCDIR)/.git log -1 --pretty="format:%h" $(PACKAGE_VERSION) -- 2>/dev/null)
@@ -137,6 +137,7 @@ install-noarch: regular
 	$(Q)install -d -m 755 $(prefix)/share/scratchbox2/lua_scripts/pathmaps/tools
 	$(Q)install -d -m 755 $(prefix)/share/scratchbox2/lua_scripts/pathmaps/simple
 	$(Q)install -d -m 755 $(prefix)/share/scratchbox2/lua_scripts/pathmaps/devel
+	$(Q)install -d -m 755 $(prefix)/share/scratchbox2/lua_scripts/pathmaps/accel
 	$(Q)install -d -m 755 $(prefix)/share/scratchbox2/lua_scripts/pathmaps/nomap
 	$(Q)install -d -m 755 $(prefix)/share/scratchbox2/lua_scripts/pathmaps/install
 
@@ -183,6 +184,7 @@ install-noarch: regular
 	$(Q)install -c -m 644 $(SRCDIR)/lua_scripts/pathmaps/tools/*.lua $(prefix)/share/scratchbox2/lua_scripts/pathmaps/tools/
 	$(Q)install -c -m 644 $(SRCDIR)/lua_scripts/pathmaps/simple/*.lua $(prefix)/share/scratchbox2/lua_scripts/pathmaps/simple/
 	$(Q)install -c -m 644 $(SRCDIR)/lua_scripts/pathmaps/devel/*.lua $(prefix)/share/scratchbox2/lua_scripts/pathmaps/devel/
+	$(Q)install -c -m 644 $(SRCDIR)/lua_scripts/pathmaps/accel/*.lua $(prefix)/share/scratchbox2/lua_scripts/pathmaps/accel/
 	$(Q)install -c -m 644 $(SRCDIR)/lua_scripts/pathmaps/nomap/*.lua $(prefix)/share/scratchbox2/lua_scripts/pathmaps/nomap/
 	$(Q)install -c -m 644 $(SRCDIR)/lua_scripts/pathmaps/install/*.lua $(prefix)/share/scratchbox2/lua_scripts/pathmaps/install/
 	$(Q)(set -e; cd $(prefix)/share/scratchbox2/lua_scripts/pathmaps; ln -sf devel maemo)
--- scratchbox2-2.0.orig/README
+++ scratchbox2-2.0/README
@@ -43,7 +43,7 @@ pretty well.
 
 Latest Qemu can be retrieved with: 
 
-$ svn co svn://svn.savannah.nongnu.org/qemu/trunk qemu
+$ git clone git://git.savannah.nongnu.org/qemu.git
 $ cd qemu
 $ ./configure --prefix=$HOME/sb2 --target-list=arm-linux-user
 $ make && make install
--- scratchbox2-2.0.orig/lua_scripts/argvenvp_gcc.lua
+++ scratchbox2-2.0/lua_scripts/argvenvp_gcc.lua
@@ -60,16 +60,28 @@ function register_gcc_component_path(tmp
 	-- 2. note that cross_gcc_dir is not empty, this file
 	--    won't be loaded at all if it is (see argvenvp.lua),
 	-- 3. Wrappers for host-* tools live in /sb2/wrappers.
-	if gccrule == nil or gccrule.cross_gcc_dir == nil then
-		tmp.path_prefixes = generic_gcc_tools_path_prefixes
-	else
-		local gcc_tools_path_prefixes = {
-			"/usr/bin/",
-			gccrule.cross_gcc_dir,
-			"/sb2/"
-		}
-		tmp.path_prefixes = gcc_tools_path_prefixes
+	local gcc_tools_path_prefixes = {}
+
+    -- lua array copy wtf
+	for j,x in ipairs(generic_gcc_tools_path_prefixes) do
+		table.insert(gcc_tools_path_prefixes, x)
+	end
+
+	if gccrule == nil then
+		return
+	end
+
+	if gccrule.cross_gcc_dir ~= nil then
+		table.insert(gcc_tools_path_prefixes, gccrule.cross_gcc_dir)
+	end
+
+	if gccrule.cross_gcc_progs_path ~= nil then
+		for path in string.gmatch(gccrule.cross_gcc_progs_path,"[^:]+") do
+			table.insert(gcc_tools_path_prefixes, path)
+		end
 	end
+
+	tmp.path_prefixes = gcc_tools_path_prefixes
 	argvmods[tmp.name] = tmp
 end
 
--- /dev/null
+++ scratchbox2-2.0/lua_scripts/pathmaps/accel/00_default.lua
@@ -0,0 +1,681 @@
+-- Author: Lauri T. Aarnio
+-- Copyright (C) 2007 Lauri Leukkunen <lle@rahina.org>
+-- Copyright (c) 2009 Nokia Corporation.
+-- Licensed under MIT license.
+--
+-- "accel" mode = build accelerator mode, to be used for software 
+-- development & building when the rootstrap and the tools are "twins":
+-- Built from the same sources, but tools contains native binaries while
+-- the rootstrap contains target binaries.
+
+
+-- Rule file interface version, mandatory.
+--
+rule_file_interface_version = "21"
+----------------------------------
+
+tools = tools_root
+if (not tools) then
+	tools = "/"
+end
+
+sb2_share_dir = sbox_user_home_dir.."/.scratchbox2/"..sbox_target.."/share"
+
+-- =========== Exec policies:  ===========
+--
+-- For tools: If tools_root is set and libsb2 has been installed there,
+-- then dynamic libraries can be used from tools_root (otherwise we'll
+-- be using the libs from the host OS)
+
+devel_mode_tools_ld_so = nil		-- default = not needed
+devel_mode_tools_ld_library_path = nil	-- default = not needed
+-- localization support for tools
+devel_mode_locale_path = nil
+
+if ((tools_root ~= nil) and conf_tools_sb2_installed) then
+	if (conf_tools_ld_so ~= nil) then
+		-- Ok to use dynamic libraries from tools!
+		devel_mode_tools_ld_so = conf_tools_ld_so
+		devel_mode_tools_ld_library_path = conf_tools_ld_so_library_path
+	end
+	if (conf_tools_locale_path ~= nil) then
+		-- use locales from tools
+		devel_mode_locale_path = conf_tools_locale_path
+	end
+end
+
+tools_script_interp_rules = {
+	rules = {
+		{dir = "/scratchbox/tools/bin",
+		 replace_by = tools .. "/usr/bin", log_level = "warning"},
+
+		{prefix = "/", map_to = tools}
+	}
+}
+
+exec_policy_tools = {
+	name = "Tools",
+	native_app_ld_so = devel_mode_tools_ld_so,
+	native_app_ld_so_supports_argv0 = conf_tools_ld_so_supports_argv0,
+	native_app_ld_library_path = devel_mode_tools_ld_library_path,
+	native_app_locale_path = devel_mode_locale_path,
+
+	script_log_level = "debug",
+	script_log_message = "SCRIPT from tools",
+	script_interpreter_rules = tools_script_interp_rules,
+	script_set_argv0_to_mapped_interpreter = true,
+}
+
+exec_policy_tools_perl = {
+	name = "Tools-perl",
+	native_app_ld_so = devel_mode_tools_ld_so,
+	native_app_ld_so_supports_argv0 = conf_tools_ld_so_supports_argv0,
+	native_app_ld_library_path = devel_mode_tools_ld_library_path,
+	native_app_locale_path = devel_mode_locale_path,
+
+	script_log_level = "debug",
+	script_log_message = "SCRIPT from tools (t.p)",
+	script_interpreter_rules = tools_script_interp_rules,
+	script_set_argv0_to_mapped_interpreter = true,
+}
+
+exec_policy_tools_python = {
+	name = "Tools-python",
+	native_app_ld_so = devel_mode_tools_ld_so,
+	native_app_ld_so_supports_argv0 = conf_tools_ld_so_supports_argv0,
+	native_app_ld_library_path = devel_mode_tools_ld_library_path,
+	native_app_locale_path = devel_mode_locale_path,
+
+	script_log_level = "debug",
+	script_log_message = "SCRIPT from tools (t.p)",
+	script_interpreter_rules = tools_script_interp_rules,
+	script_set_argv0_to_mapped_interpreter = true,
+}
+
+-- For target binaries:
+-- First, note that "foreign" binaries are easy to handle, no problem there.
+-- But if CPU transparency method has not been set, then host CPU == target CPU:
+-- we have "target's native" and "host's native" binaries, that would look 
+-- identical (and valid!) to the kernel. But they need to use different 
+-- loaders and dynamic libraries! The solution is that we use the location
+-- (as determined by the mapping engine) to decide the execution policy.
+
+devel_mode_target_ld_so = nil		-- default = not needed
+devel_mode_target_ld_library_path = nil	-- default = not needed
+
+if (conf_target_sb2_installed) then
+	if (conf_target_ld_so ~= nil) then
+		-- use dynamic libraries from target, 
+		-- when executing native binaries!
+		devel_mode_target_ld_so = conf_target_ld_so
+		devel_mode_target_ld_library_path = conf_target_ld_so_library_path
+
+		-- FIXME: This exec policy should process (map components of)
+		-- the current value of LD_LIBRARY_PATH, and add the results
+		-- to devel_mode_target_ld_library_path just before exec.
+		-- This has not been done yet.
+	end
+end
+
+exec_policy_target = {
+	name = "Rootstrap",
+	native_app_ld_so = devel_mode_target_ld_so,
+	native_app_ld_so_supports_argv0 = conf_target_ld_so_supports_argv0,
+	native_app_ld_library_path = devel_mode_target_ld_library_path,
+	native_app_locale_path = conf_target_locale_path,
+}
+
+--
+-- For real host binaries:
+
+exec_policy_host_os = {
+	name = "Host",
+	log_level = "debug",
+	log_message = "executing in host OS mode",
+
+	script_interpreter_rules = {
+		rules = {
+			{prefix = "/", use_orig_path = true}
+		}
+	},
+}
+
+-- =========== Actions for conditional rules ===========
+
+test_first_target_then_tools_default_is_target = {
+	{ if_exists_then_map_to = target_root, readonly = true },
+	{ if_exists_then_map_to = tools, readonly = true },
+	{ map_to = target_root, readonly = true }
+}
+
+test_first_tools_default_is_target = {
+	{ if_exists_then_map_to = tools, readonly = true },
+	{ map_to = target_root, readonly = true }
+}
+
+perl_lib_test = {
+	{ if_active_exec_policy_is = "Tools-perl",
+	  map_to = tools, readonly = true },
+	{ if_active_exec_policy_is = "Rootstrap",
+	  map_to = target_root, readonly = true },
+	{ if_active_exec_policy_is = "Host",
+	  use_orig_path = true, readonly = true },
+	{ map_to = target_root, readonly = true }
+}
+
+perl_bin_test = {
+	{ if_redirect_ignore_is_active = "/usr/bin/perl",
+	  map_to = target_root, readonly = true },
+	{ if_redirect_force_is_active = "/usr/bin/perl",
+	  map_to = tools, readonly = true,
+	  exec_policy = exec_policy_tools_perl },
+	{ if_active_exec_policy_is = "Rootstrap",
+	  map_to = target_root, readonly = true },
+	{ if_active_exec_policy_is = "Tools-perl",
+	  map_to = tools, readonly = true },
+	{ map_to = target_root, readonly = true }
+}
+
+python_bin_test = {
+	{ if_redirect_ignore_is_active = "/usr/bin/python",
+	  map_to = target_root, readonly = true },
+	{ if_redirect_force_is_active = "/usr/bin/python",
+	  map_to = tools, readonly = true,
+	  exec_policy = exec_policy_tools_python },
+	{ if_active_exec_policy_is = "Rootstrap",
+	  map_to = target_root, readonly = true },
+	{ if_active_exec_policy_is = "Tools-python",
+	  map_to = tools, readonly = true },
+	{ map_to = target_root, readonly = true }
+}
+
+python_lib_test = {
+	{ if_active_exec_policy_is = "Tools-python",
+	  map_to = tools, readonly = true },
+	{ if_active_exec_policy_is = "Rootstrap",
+	  map_to = target_root, readonly = true },
+	{ if_active_exec_policy_is = "Host",
+	  use_orig_path = true, readonly = true },
+	{ map_to = target_root, readonly = true }
+}
+
+terminfo_test = {
+	{ if_active_exec_policy_is = "Tools",
+	  map_to = tools, readonly = true },
+	{ if_active_exec_policy_is = "Rootstrap",
+	  map_to = target_root, readonly = true },
+	{ if_active_exec_policy_is = "Host",
+	  use_orig_path = true, readonly = true },
+	{ map_to = target_root, readonly = true }
+}
+
+--
+-- Message catalogs (LC_MESSAGES) are taken based on
+-- active exec policy.
+--
+message_catalog_test = {
+	{ if_active_exec_policy_is = "Tools",
+	  map_to = tools, readonly = true },
+	{ if_active_exec_policy_is = "Rootstrap",
+	  map_to = target_root, readonly = true },
+	{ if_active_exec_policy_is = "Host",
+	  use_orig_path = true, readonly = true },
+	{ map_to = target_root, readonly = true }
+}
+
+-- =========== Mapping rule chains ===========
+
+-- Used when dir = "/usr/share":
+devel_mode_rules_usr_share = {
+	rules = {
+		-- -----------------------------------------------
+		-- 1. General SB2 environment:
+
+		{prefix = sbox_dir .. "/share/scratchbox2/host_usr",
+		 replace_by = "/usr", readonly = true},
+		{prefix = sbox_dir .. "/share/scratchbox2",
+		 use_orig_path = true, readonly = true},
+
+		-- -----------------------------------------------
+		-- Perl:
+		{prefix = "/usr/share/perl", actions = perl_lib_test},
+
+		-- Python:
+		{prefix = "/usr/share/python", actions = python_lib_test},
+		{prefix = "/usr/share/pygobject", actions = python_lib_test},
+
+		-- -----------------------------------------------
+
+		{dir = "/usr/share/aclocal", map_to = target_root,
+		 readonly = true},
+
+		-- 100. DEFAULT RULES:
+		{prefix = "/usr/share",
+		 actions = test_first_target_then_tools_default_is_target},
+	}
+}
+
+-- Used when dir = "/usr/bin":
+devel_mode_rules_usr_bin = {
+	rules = {
+		-- -----------------------------------------------
+		-- 1. General SB2 environment:
+
+		{prefix = "/usr/bin/sb2-",
+		 use_orig_path = true, readonly = true},
+
+		-- -----------------------------------------------
+		-- 20. /usr/bin/*:
+		-- tools that need special processing:
+
+		{prefix = "/usr/bin/host-",
+		 use_orig_path = true, readonly = true},
+
+		-- "localedef" *must* be used from the target, the version
+		-- which exists in tools_root appers to work but doesn't..
+		{path = "/usr/bin/localedef", map_to = target_root,
+		 readonly = true},
+
+		-- "chrpath" comes from target, too, but we haven't 
+		-- verified what happens if it was used from tools.
+		{path = "/usr/bin/chrpath", map_to = target_root,
+		 readonly = true},
+
+		-- 19. perl & python:
+		-- 	processing depends on SBOX_REDIRECT_IGNORE,
+		--	SBOX_REDIRECT_FORCE and 
+		--	name of the current mapping mode. 
+		--	(these are real prefixes, version number may
+		--	be included in the name (/usr/bin/python2.5 etc))
+		{prefix = "/usr/bin/perl", actions = perl_bin_test},
+		{prefix = "/usr/bin/python", actions = python_bin_test},
+
+		-- next, automatically generated rules for /usr/bin:
+		{dir = "/usr/bin", chain = argvmods_rules_for_usr_bin,
+		 virtual_path = true}, -- don't reverse these.
+
+		-- and finally, the default:
+		{dir = "/usr/bin",
+		 actions = test_first_tools_default_is_target},
+	}
+}
+
+
+-- Used when dir = "/usr":
+devel_mode_rules_usr = {
+	rules = {
+		{dir = "/usr/share", chain = devel_mode_rules_usr_share},
+
+		{dir = "/usr/bin", chain = devel_mode_rules_usr_bin},
+
+		-- -----------------------------------------------
+		-- 40. /usr/lib/*
+		-- Most of /usr/lib should come from target_root, but
+		-- there are exceptions: Some tools have private subdirectories
+		-- there.
+
+		{prefix = "/usr/lib/gcc", map_to = tools, readonly = true},
+
+		{prefix = "/usr/lib/perl", actions = perl_lib_test},
+
+		{prefix = "/usr/lib/python", actions = python_lib_test},
+
+		{prefix = "/usr/lib/dpkg", map_to = tools, readonly = true},
+		{prefix = "/usr/lib/apt", map_to = tools, readonly = true},
+
+		{prefix = "/usr/lib/libfakeroot", map_to = tools, readonly = true},
+
+		{prefix = "/usr/lib",
+		 actions = test_first_target_then_tools_default_is_target},
+
+		-- -----------------------------------------------
+		-- 50. /usr/src/*
+		{path = "/usr/src", map_to = target_root, readonly = true},
+		{prefix = "/usr/src/", map_to = target_root, readonly = true},
+
+		-- -----------------------------------------------
+		-- 55. X11 (/usr/X11R6/*)
+
+		{prefix = "/usr/X11R6/lib", map_to = target_root,
+		 readonly = true},
+		{prefix = "/usr/X11R6/include", map_to = target_root,
+		 readonly = true},
+
+		-- -----------------------------------------------
+		-- 60. /usr/include/*
+
+		{prefix = "/usr/include", map_to = target_root,
+		 readonly = true},
+
+		-- -----------------------------------------------
+		{dir = "/usr/sbin",
+		 actions = test_first_tools_default_is_target},
+
+		-- -----------------------------------------------
+		-- 100. DEFAULT RULES:
+		-- the root directory must not be mapped:
+
+		-- "standard" directories are mapped to tools_root,
+		-- but everything else defaults to the host system
+		-- (so that things like /mnt, /media and /opt are
+		-- used from the host)
+		{prefix = "/usr", map_to = tools, readonly = true},
+	}
+}
+
+devel_mode_rules_etc = {
+	rules = {
+		-- -----------------------------------------------
+		-- 70. /etc/*
+		--
+		{prefix = "/etc/gconf/2", map_to = target_root,
+		 readonly = true},
+		{prefix = "/etc/dbus-1", map_to = target_root,
+		 readonly = true},
+		{prefix = "/etc/osso-af-init", map_to = target_root,
+		 readonly = true},
+		{prefix = "/etc/gtk-2.0", map_to = target_root,
+		 readonly = true},
+
+		{prefix = "/etc/apt", map_to = target_root, readonly = true},
+		{prefix = "/etc/terminfo", actions = terminfo_test},
+
+		-- Perl & Python:
+		{prefix = "/etc/perl", actions = perl_lib_test},
+		{prefix = "/etc/python", actions = python_lib_test},
+
+		-- Files that must not be mapped:
+		{prefix = "/etc/resolvconf", use_orig_path = true,
+		 readonly = true},
+		{prefix = "/etc/resolv.conf",
+		 use_orig_path = true, readonly = true},
+		{path = "/etc/passwd",
+		 use_orig_path = true, readonly = true},
+		{path = "/etc/shadow",
+		 use_orig_path = true, readonly = true},
+
+		-- default rules:
+		{dir = "/etc",
+		 actions = test_first_target_then_tools_default_is_target},
+	}
+}
+
+devel_mode_rules_var = {
+	rules = {
+		-- -----------------------------------------------
+		-- 80. /var/*
+
+		{prefix = "/var/run/resolvconf", use_orig_path = true,
+		 readonly = true},
+
+		{prefix = "/var/run", map_to = session_dir},
+
+		-- files from package "xkbutils":
+		{prefix = "/var/lib/xkb", map_to = target_root,
+		 readonly = true},
+
+		-- apt & dpkg:
+		{prefix = "/var/lib/apt", map_to = target_root,
+		 readonly = true},
+		{prefix = "/var/cache/apt", map_to = target_root,
+		 readonly = true},
+		{prefix = "/var/lib/dpkg", map_to = target_root,
+		 readonly = true},
+		{prefix = "/var/cache/dpkg", map_to = target_root,
+		 readonly = true},
+		{prefix = "/var/cache/debconf", map_to = target_root,
+		 readonly = true},
+
+		{prefix = "/var/lib/dbus", map_to = target_root,
+		 readonly = true},
+
+		{prefix = "/var/log", map_to = target_root,
+		 readonly = true},
+
+		-- default rules:
+		{dir = "/var",
+		 actions = test_first_target_then_tools_default_is_target},
+	}
+}
+
+devel_mode_rules_scratchbox1 = {
+	rules = {
+		-- -----------------------------------------------
+		-- 98. Scratchbox 1 emulation rules
+		-- (some packages have hard-coded paths to the SB1 enviroment;
+		-- replace those by the correct locations in our environment)
+		-- (these are marked "virtual"; these won't be reversed)
+		-- "libtool" for arm
+		{prefix = "/scratchbox/compilers/cs2005q3.2-glibc2.5-arm/arch_tools/share/libtool",
+		 replace_by = sb2_share_dir .. "/libtool",
+		 log_level = "warning",
+		 readonly = true, virtual_path = true},
+
+		-- "libtool" for i386
+		{prefix = "/scratchbox/compilers/cs2005q3.2-glibc-i386/arch_tools/share",
+		 replace_by = tools .. "/usr/share",
+		 log_level = "warning",
+		 readonly = true, virtual_path = true},
+
+		-- compiler tools:
+		{prefix = "/scratchbox/compilers/bin",
+		 replace_by = "/usr/bin",
+		 log_level = "warning",
+		 readonly = true, virtual_path = true},
+
+		-- Scratchbox 1 tools/bin
+		--
+		-- set exec_policy for perl & python:
+		{prefix = "/scratchbox/tools/bin/perl",
+		 replace_by = tools .. "/usr/bin/perl",
+	  	 exec_policy = exec_policy_tools_perl,
+		 log_level = "warning",
+		 readonly = true, virtual_path = true},
+		{prefix = "/scratchbox/tools/bin/python",
+		 replace_by = tools .. "/usr/bin/python",
+	  	 exec_policy = exec_policy_tools_python,
+		 log_level = "warning",
+		 readonly = true, virtual_path = true},
+		--
+		-- Other tools:
+		{prefix = "/scratchbox/tools/bin",
+		 replace_by = tools .. "/usr/bin",
+		 log_level = "warning",
+		 readonly = true, virtual_path = true},
+
+		-- "policy-rc.d" checks if scratchbox-version exists, 
+		-- to detect if it is running inside scratchbox..
+		{prefix = "/scratchbox/etc/scratchbox-version",
+		 replace_by = "/usr/share/scratchbox2/version",
+		 log_level = "warning",
+		 readonly = true, virtual_path = true},
+
+		{prefix = "/scratchbox/tools/autotools/automake-1.7/share/automake-1.7",
+		 replace_by = tools .. "/usr/share/automake-1.7",
+		 log_level = "warning",
+		 readonly = true, virtual_path = true},
+
+		-- otherwise, don't map /scratchbox, some people still
+		-- keep their projects there.
+		{prefix = "/scratchbox", use_orig_path = true},
+	}
+}
+
+simple_chain = {
+	next_chain = nil,
+	binary = nil,
+	rules = {
+		-- -----------------------------------------------
+		-- 1. The session directory
+		{dir = session_dir, use_orig_path = true},
+
+		-- -----------------------------------------------
+		-- 2. Development environment special destinations:
+
+		{prefix = "/sb2/wrappers",
+		 replace_by = session_dir .. "/wrappers." .. active_mapmode,
+		 readonly = true},
+
+		{prefix = "/sb2/scripts",
+		 replace_by = sbox_dir.."/share/scratchbox2/scripts",
+		 readonly = true},
+
+		-- tools_root should not be mapped twice.
+		{prefix = tools, use_orig_path = true, readonly = true},
+
+		-- -----------------------------------------------
+		-- 5. Maemo SDK+
+
+		{prefix = "/opt/maemo",
+		 use_orig_path = true, readonly = true},
+
+		-- -----------------------------------------------
+		-- 10. Home directories
+
+		{prefix = sbox_user_home_dir, use_orig_path = true},
+
+		-- "user" is a special username at least on the Maemo platform:
+		-- (but note that if the real user name is "user",
+		-- our previous rule handled that and this rule won't be used)
+		{prefix = "/home/user", map_to = target_root},
+
+		-- Home directories = not mapped, R/W access
+		{prefix = "/home", use_orig_path = true},
+
+		-- -----------------------------------------------
+		-- 20. /bin/*:
+		-- tools that need special processing:
+
+		{path = "/bin/sh",
+		 replace_by = tools .. "/bin/bash", readonly = true},
+
+		-- -----------------------------------------------
+		-- 30. /lib/*
+
+		-- 
+		-- terminfo search path is by default:
+		-- /etc/terminfo, /lib/terminfo and /usr/share/terminfo
+		-- we map these depending on active exec policy.
+		--
+		-- Other rules are in /etc and /usr/share rules above.
+		--
+		{prefix = "/lib/terminfo", actions = terminfo_test},
+		{prefix = "/lib", map_to = target_root, readonly = true},
+
+		-- -----------------------------------------------
+		-- 40. /usr
+		{dir = "/usr", chain = devel_mode_rules_usr},
+
+		-- -----------------------------------------------
+		-- 70. /etc/*
+		--
+		{dir = "/etc", chain = devel_mode_rules_etc},
+
+		-- -----------------------------------------------
+		-- 80. /var/*
+		{dir = "/var", chain = devel_mode_rules_var},
+
+		-- -----------------------------------------------
+		-- 85. /tmp
+		{prefix = "/tmp", map_to = session_dir},
+
+		-- -----------------------------------------------
+		-- 90. Top-level directories that must not be mapped:
+		{prefix = "/dev", use_orig_path = true},
+		{dir = "/proc", custom_map_funct = sb2_procfs_mapper,
+		 virtual_path = true},
+		{prefix = "/sys",
+		 use_orig_path = true, readonly = true},
+
+		-- -----------------------------------------------
+		-- 95. Some virtual paths:
+		{prefix = "/host_usr", map_to = target_root, readonly = true},
+
+		-- unmodified view of the rootstrap, can be used as destination
+		-- directory when installing stuff to the rootstrap
+		-- This provides is R/W access to the target_root!
+		{prefix = "/target_root", replace_by = target_root},
+
+		-- -----------------------------------------------
+		-- 98. Scratchbox 1 emulation rules
+		-- (some packages have hard-coded paths to the SB1 enviroment;
+		-- replace those by the correct locations in our environment)
+		-- (these are marked "virtual"; these won't be reversed)
+		{dir = "/scratchbox", chain = devel_mode_rules_scratchbox1},
+
+		-- -----------------------------------------------
+		-- 100. DEFAULT RULES:
+		-- the root directory must not be mapped:
+		{path = "/", use_orig_path = true},
+
+		-- "standard" directories default to tools_root
+		-- (except that bin and sbin also test for target-
+		-- specific programs from target_root),
+		-- but everything else defaults to the host system
+		-- (so that things like /mnt, /media and /opt are
+		-- used from the host)
+		{dir = "/bin",
+		 actions = test_first_tools_default_is_target},
+		{dir = "/sbin",
+		 actions = test_first_tools_default_is_target},
+
+		-- Default = Host, R/W access
+		{prefix = "/", use_orig_path = true}
+	}
+}
+
+-- Path mapping rules.
+export_chains = {
+	simple_chain
+}
+
+-- Exec policy rules.
+-- These are used only if the mapping rule did not provide an exec policy.
+--
+-- Note that the real path (mapped path) is used
+--  when looking up rules from here!
+devel_exec_policies = {
+	next_chain = nil,
+	binary = nil,
+	rules = {
+
+		-- Tools:
+		-- (tools must be listed first, the tools directory
+		-- might be under user's home directory)
+		{prefix = tools .. "/usr/bin/perl",
+		 exec_policy = exec_policy_tools_perl},
+		{prefix = tools .. "/usr/bin/python",
+		 exec_policy = exec_policy_tools_python},
+		{prefix = tools, exec_policy = exec_policy_tools},
+
+		-- ~/bin probably contains programs for the host OS:
+                {prefix = sbox_user_home_dir.."/bin",
+		 exec_policy = exec_policy_host_os},
+
+                -- Other places under the home directory are expected
+                -- to contain target binaries:
+                {prefix = sbox_user_home_dir, exec_policy = exec_policy_target},
+
+		-- Target binaries:
+		{prefix = target_root, exec_policy = exec_policy_target},
+
+		-- -----------------------------------------------
+		-- DEFAULT RULE (must exist):
+		{prefix = "/", exec_policy = exec_policy_host_os}
+	}
+}
+
+exec_policy_chains = {
+	devel_exec_policies
+}
+
+-- This table lists all exec policies - this is used when the current
+-- process wants to locate the currently active policy
+all_exec_policies = {
+	exec_policy_host_os,
+	exec_policy_target,
+	exec_policy_tools,
+	exec_policy_tools_perl,
+	exec_policy_tools_python,
+}
+
--- scratchbox2-2.0.orig/lua_scripts/pathmaps/devel/00_default.lua
+++ scratchbox2-2.0/lua_scripts/pathmaps/devel/00_default.lua
@@ -368,6 +368,10 @@ devel_mode_rules_usr_share = {
 		{path = "/usr/share/pkgconfig/shared-mime-info.pc",
 		 map_to = target_root, readonly = true},
 
+		-- for "icu":
+		{dir = "/usr/share/icu", map_to = target_root,
+		 readonly = true},
+
 		-- debhelper scripts, now from rootstrap (maping changed due to
 		-- upstart-dev's requirements)
 		{dir = "/usr/share/debhelper/autoscripts",
@@ -590,6 +594,12 @@ devel_mode_rules_scratchbox1 = {
 		 log_level = "warning",
 		 readonly = true, virtual_path = true},
 
+		-- compiler tools:
+		{prefix = "/scratchbox/compilers/bin",
+		 replace_by = "/usr/bin",
+		 log_level = "warning",
+		 readonly = true, virtual_path = true},
+
 		-- Scratchbox 1 tools/bin
 		--
 		-- set exec_policy for perl & python:
--- scratchbox2-2.0.orig/lua_scripts/pathmaps/simple/00_default.lua
+++ scratchbox2-2.0/lua_scripts/pathmaps/simple/00_default.lua
@@ -46,6 +46,7 @@ simple_chain = {
 		-- 99. Other rules.
 		{prefix = "/lib", map_to = target_root},
 		{prefix = "/usr/lib/perl", map_to = tools},
+		{prefix = "/usr/lib/gcc", map_to = tools},
 		{prefix = "/usr/lib", map_to = target_root},
 		{prefix = "/usr/include", map_to = target_root},
 		{prefix = "/home/user", map_to = target_root},
--- scratchbox2-2.0.orig/include/config.h.in
+++ scratchbox2-2.0/include/config.h.in
@@ -42,6 +42,9 @@
 /* Define to 1 if you have the `creat64' function. */
 #undef HAVE_CREAT64
 
+/* Define to 1 if you have the <crt_externs.h> header file. */
+#undef HAVE_CRT_EXTERNS_H
+
 /* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
    */
 #undef HAVE_DIRENT_H
@@ -207,6 +210,9 @@
 /* Define to 1 if you have the <memory.h> header file. */
 #undef HAVE_MEMORY_H
 
+/* Define to 1 if you have the `mempcpy' function. */
+#undef HAVE_MEMPCPY
+
 /* Define to 1 if you have the `mkdir' function. */
 #undef HAVE_MKDIR
 
@@ -396,6 +402,9 @@
 /* Define to 1 if `utime(file, NULL)' sets file's timestamp to the present. */
 #undef HAVE_UTIME_NULL
 
+/* Define to 1 if you have the `_NSGetEnviron' function. */
+#undef HAVE__NSGETENVIRON
+
 /* Define to 1 if you have the `_xftw' function. */
 #undef HAVE__XFTW
 
@@ -450,7 +459,7 @@
 
 /* If using the C implementation of alloca, define if you know the
    direction of stack growth for your system; otherwise it will be
-   automatically deduced at run-time.
+   automatically deduced at runtime.
 	STACK_DIRECTION > 0 => grows toward higher addresses
 	STACK_DIRECTION < 0 => grows toward lower addresses
 	STACK_DIRECTION = 0 => direction of growth unknown */
@@ -481,10 +490,10 @@
 /* Define to `int' if <sys/types.h> does not define. */
 #undef mode_t
 
-/* Define to `long' if <sys/types.h> does not define. */
+/* Define to `long int' if <sys/types.h> does not define. */
 #undef off_t
 
-/* Define to `unsigned' if <sys/types.h> does not define. */
+/* Define to `unsigned int' if <sys/types.h> does not define. */
 #undef size_t
 
 /* Define to `int' if <sys/types.h> doesn't define. */
--- scratchbox2-2.0.orig/utils/sb2-mkinitramfs
+++ scratchbox2-2.0/utils/sb2-mkinitramfs
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 if [ "x$1" = x -o  "x$2" = x ]; then
 	echo usage fakeroot $0 initramfsdir initramfsfile
--- scratchbox2-2.0.orig/utils/sb2-config-gcc-toolchain
+++ scratchbox2-2.0/utils/sb2-config-gcc-toolchain
@@ -94,6 +94,7 @@ gcc_config$gcc_version_id = {
 
 	cross_gcc_prefix_list="$SBOX_CROSS_GCC_PREFIX_LIST",
 	cross_gcc_dir="$SBOX_CROSS_GCC_DIR",
+	cross_gcc_progs_path="$SBOX_CROSS_GCC_PROGS_PATH",
 	cross_gcc_version="$SBOX_CROSS_GCC_VERSION",
 	cross_gcc_shortversion="$SBOX_CROSS_GCC_SHORTVERSION",
 
@@ -234,6 +235,9 @@ else
 	fi
 fi
 
+# Path where gcc searches for sub-tools (ld, as, cc1,..)
+SBOX_CROSS_GCC_PROGS_PATH=$($GCC -print-search-dirs|grep ^programs:|sed 's/programs: =//')
+
 # default for the cross-gcc prefix list:
 # these may be changed by sb2rc.$MAPPING_MODE
 
--- scratchbox2-2.0.orig/utils/sb2-build-qemuserver
+++ scratchbox2-2.0/utils/sb2-build-qemuserver
@@ -1,4 +1,4 @@
-#!/bin/sh -e
+#!/bin/bash -e
 
 function error_not_inside_sb2()
 {
--- scratchbox2-2.0.orig/preload/libsb2.c
+++ scratchbox2-2.0/preload/libsb2.c
@@ -583,7 +583,45 @@ char *realpath_gate(
 			}
 		} /* else not reversed, just return rp */
 	}
-SB_LOG(SB_LOGLEVEL_DEBUG, "REALPATH: returns '%s'", rp);
+	SB_LOG(SB_LOGLEVEL_NOISE, "REALPATH: returns '%s'", rp);
+	return(rp);
+}
+
+/* gate for 
+ *     char *__realpath_chk (__const char *__restrict __name,
+ *		char *__restrict __resolved, size_t __resolvedlen)
+ * (__realpath_chk is yet another ugly trick from the creators of glibc)
+*/
+char *__realpath_chk_gate(
+	char *(*real__realpath_chk_ptr)(__const char *__restrict __name,
+		char *__restrict __resolved, size_t __resolvedlen),
+        const char *realfnname,
+	__const char *__restrict name,	/* name, already mapped */
+	char *__restrict __resolved,
+	size_t __resolvedlen)
+{
+	char *sbox_path = NULL;
+	char *rp;
+	
+	if ((rp = (*real__realpath_chk_ptr)(name,__resolved,__resolvedlen)) == NULL) {
+		return NULL;
+	}
+	if (*rp != '\0') {
+		sbox_path = scratchbox_reverse_path(realfnname, rp);
+		if (sbox_path) {
+			if (__resolved) {
+				strncpy(__resolved, sbox_path, __resolvedlen);
+				rp = __resolved;
+				free(sbox_path);
+			} else {
+				/* resolved was null - assume that glibc 
+				 * allocated memory */
+				free(rp);
+				rp = sbox_path;
+			}
+		} /* else not reversed, just return rp */
+	}
+	SB_LOG(SB_LOGLEVEL_NOISE, "REALPATH: returns '%s'", rp);
 	return(rp);
 }
 
--- scratchbox2-2.0.orig/preload/interface.master
+++ scratchbox2-2.0/preload/interface.master
@@ -65,6 +65,10 @@ GATE: char * getwd (char *buf) : returns
 GATE: char *realpath(const char *name, char *resolved) : \
 	map(name) returns_string
 
+GATE: char *__realpath_chk(__const char *__restrict __name, \
+	char *__restrict __resolved, size_t __resolvedlen) : \
+	map(__name) returns_string
+
 GATE: int uname(struct utsname *buf)
 
 #ifdef HAVE_FTS_H
