Index: rtems/config/rtems-bsp.cfg
===================================================================
--- rtems/config/rtems-bsp.cfg	(revision 1bbb7666a06393af8d074482468044fa8ad78a91)
+++ rtems/config/rtems-bsp.cfg	(revision 38ed59a301c5f3e03ce83133dadddad695e415fb)
@@ -13,5 +13,16 @@
 #
 
-%if %{_target} == %{nil}
+#
+# If a dry-run and with download ignore errors and correct setting for tools
+# and BSPs. Only after the source to download.
+#
+%if %{_dry_run} && %{defined with_download}
+ %log BSP configuration errors ignored
+ %define rtems_bsp_error 0
+%else
+ %define rtems_bsp_error 1
+%endif
+
+%if %{_target} == %{nil} && %{rtems_bsp_error}
  %error No RTEMS target specified: --rtems-bsp=arch/bsp (or --target=target)
 %endif
@@ -22,5 +33,8 @@
 
 %ifn %{defined with_rtems_bsp}
- %error No RTEMS BSP specified: --rtems-bsp=arch/bsp (or --with-rtems-bsp=bsp)
+ %if %{rtems_bsp_error}
+  %error No RTEMS BSP specified: --rtems-bsp=arch/bsp (or --with-rtems-bsp=bsp)
+ %endif
+ %define with_rtems_bsp sparc/erc32
 %endif
 
@@ -57,10 +71,10 @@
 %define rtems_bsp_libs      %{pkgconfig libs    %{_host}-%{rtems_bsp}}
 
-%if %{rtems_bsp_cflags} == %{nil}
+%if %{rtems_bsp_cflags} == %{nil} && %{rtems_bsp_error}
  %error No RTEMS target CFLAGS found; Please check the --rtems-bsp option.
 %endif
 
 %if %{rtems_bsp_ccflags} == %{nil}
-  %define rtems_bsp_ccflags %{rtems_bsp_cflags}
+ %define rtems_bsp_ccflags %{rtems_bsp_cflags}
 %endif
 
Index: source-builder/pkg-config
===================================================================
--- source-builder/pkg-config	(revision 1bbb7666a06393af8d074482468044fa8ad78a91)
+++ source-builder/pkg-config	(revision 38ed59a301c5f3e03ce83133dadddad695e415fb)
@@ -221,5 +221,5 @@
     print("incorrect package config installation", file = sys.stderr)
     sys.exit(1)
-except pkgconfig.error, e:
+except pkgconfig.error as e:
     print('error: %s' % (e), file = sys.stderr)
     sys.exit(1)
Index: source-builder/sb/check.py
===================================================================
--- source-builder/sb/check.py	(revision 1bbb7666a06393af8d074482468044fa8ad78a91)
+++ source-builder/sb/check.py	(revision 38ed59a301c5f3e03ce83133dadddad695e415fb)
@@ -133,4 +133,5 @@
     sane = True
 
+    log.trace('--- check host set up : start"')
     for d in list(opts.defaults.keys()):
         try:
@@ -153,4 +154,5 @@
             if sane and not ok:
                 sane = False
+    log.trace('--- check host set up : end"')
 
     return sane
Index: source-builder/sb/config.py
===================================================================
--- source-builder/sb/config.py	(revision 1bbb7666a06393af8d074482468044fa8ad78a91)
+++ source-builder/sb/config.py	(revision 38ed59a301c5f3e03ce83133dadddad695e415fb)
@@ -575,4 +575,12 @@
                     expanded = True
                     mn = None
+                elif m.startswith('%{!defined'):
+                    n = self._label(m[10:-1].strip())
+                    if n in self.macros:
+                        s = s.replace(m, '0')
+                    else:
+                        s = s.replace(m, '1')
+                    expanded = True
+                    mn = None
                 elif m.startswith('%{path '):
                     pl = m[7:-1].strip().split()
@@ -753,11 +761,43 @@
             return x + ' ' + str(y)
 
-        istrue = False
-        if isvalid:
-            if len(ls) == 2:
-                s = ls[1]
-            else:
-                s = (ls[1] + ' ' + ls[2])
-            ifls = s.split()
+        if len(ls) == 1:
+            self._error('invalid if expression: ' + reduce(add, ls, ''))
+
+        cistrue = True # compound istrue
+        sls = reduce(add, ls[1:], '').split()
+        cls = sls
+
+        while len(cls) > 0 and isvalid:
+
+            join_op = 'none'
+
+            if cls[0] == '||' or cls[0] == '&&':
+                if cls[0] == '||':
+                    join_op = 'or'
+                elif cls[0] == '&&':
+                    join_op = 'and'
+                cls = cls[1:]
+            ori = 0
+            andi = 0
+            i = len(cls)
+            if '||' in cls:
+                ori = cls.index('||')
+            if '&&' in cls:
+                andi = cls.index('&&')
+            if ori > 0 or andi > 0:
+                if ori < andi:
+                    i = ori
+                else:
+                    i = andi
+                if ori == 0:
+                    i = andi
+            ls = cls[:i]
+            if len(ls) == 0:
+                self._error('invalid if expression: ' + reduce(add, sls, ''))
+            cls = cls[i:]
+
+            istrue = False
+
+            ifls = ls
             if len(ifls) == 1:
                 #
@@ -836,8 +876,20 @@
                 else:
                     self._error('invalid %if operator: ' + reduce(add, ls, ''))
-            if invert:
-                istrue = not istrue
-            log.trace('config: %s: _if:  %s %s' % (self.name, ifls, str(istrue)))
-        return self._ifs(config, ls, '%if', istrue, isvalid, dir, info)
+
+            if join_op == 'or':
+                if istrue:
+                    cistrue = True
+            elif join_op == 'and':
+                if not istrue:
+                    cistrue = False
+            else:
+                cistrue = istrue
+
+            log.trace('config: %s: _if:  %s %s %s %s' % (self.name, ifls, str(cistrue),
+                                                         join_op, str(istrue)))
+
+        if invert:
+            cistrue = not cistrue
+        return self._ifs(config, ls, '%if', cistrue, isvalid, dir, info)
 
     def _ifos(self, config, ls, isvalid, dir, info):
@@ -923,4 +975,7 @@
                     if isvalid:
                         return ('data', ['%%error %s' % (self._name_line_msg(l[7:]))])
+                elif ls[0] == '%log':
+                    if isvalid:
+                        return ('data', ['%%log %s' % (self._name_line_msg(l[4:]))])
                 elif ls[0] == '%warning':
                     if isvalid:
@@ -1020,7 +1075,9 @@
                 l = self._expand(l)
                 raise error.general('config error: %s' % (l[7:]))
+            elif l.startswith('%log'):
+                l = self._expand(l)
+                log.output(l[4:])
             elif l.startswith('%warning'):
                 l = self._expand(l)
-                log.stderr('warning: %s' % (l[9:]))
                 log.warning(l[9:])
             if not directive:
Index: source-builder/sb/options.py
===================================================================
--- source-builder/sb/options.py	(revision 1bbb7666a06393af8d074482468044fa8ad78a91)
+++ source-builder/sb/options.py	(revision 38ed59a301c5f3e03ce83133dadddad695e415fb)
@@ -255,4 +255,11 @@
                         value = '='.join(los[1:])
                     long_opt[1](lo, long_opt[0], value)
+                else:
+                    if a.startswith('--with'):
+                        if len(los) != 1:
+                            value = los[1]
+                        else:
+                            value = '1'
+                        self.defaults[los[0][2:].replace('-', '_').lower()] = ('none', 'none', value)
             else:
                 self.opts['params'].append(a)
@@ -549,5 +556,5 @@
             rtems_version = self.parse_args('--rtems-version')
             if rtems_version is None:
-                rtems_version = '%d.%d' % (version.major, version.minor)
+                rtems_version = version.version()
             else:
                 rtems_version = rtems_version[1]
Index: source-builder/sb/pkgconfig.py
===================================================================
--- source-builder/sb/pkgconfig.py	(revision 1bbb7666a06393af8d074482468044fa8ad78a91)
+++ source-builder/sb/pkgconfig.py	(revision 38ed59a301c5f3e03ce83133dadddad695e415fb)
@@ -215,4 +215,5 @@
             self._log('prefix: %s' % (prefix))
             if type(prefix) is str:
+                self.prefix = []
                 for p in prefix.split(os.pathsep):
                     self.prefix += [path.shell(p)]
Index: source-builder/sb/setbuilder.py
===================================================================
--- source-builder/sb/setbuilder.py	(revision 1bbb7666a06393af8d074482468044fa8ad78a91)
+++ source-builder/sb/setbuilder.py	(revision 38ed59a301c5f3e03ce83133dadddad695e415fb)
@@ -61,4 +61,6 @@
         else:
             self.macros = copy.copy(macros)
+        log.trace('_bset: %s: macro defaults' % (bset))
+        log.trace(str(self.macros))
         self.bset = bset
         _target = self.macros.expand('%{_target}')
Index: source-builder/sb/version.py
===================================================================
--- source-builder/sb/version.py	(revision 1bbb7666a06393af8d074482468044fa8ad78a91)
+++ source-builder/sb/version.py	(revision 38ed59a301c5f3e03ce83133dadddad695e415fb)
@@ -112,4 +112,7 @@
                 sources.hash((hs[0], hash[0], hs[1]), macros, hash_error)
 
+def version():
+    return _version
+
 if __name__ == '__main__':
     print('Version: %s' % (str()))
