diff --git a/source-builder/sb/build.py b/source-builder/sb/build.py index b3ecebc..283e2c2 100644 --- a/source-builder/sb/build.py +++ b/source-builder/sb/build.py @@ -395,10 +395,7 @@ class build: def files(self, package): if self.create_tar_files: self.script.append('echo "==> %files:"') - prefixbase = self.opts.prefixbase() - if prefixbase is None: - prefixbase = '' - inpath = path.join('%{buildroot}', prefixbase) + inpath = path.abspath(self.config.expand('%{buildroot}')) tardir = path.abspath(self.config.expand('%{_tardir}')) self.script.append(self.config.expand('if test -d %s; then' % (inpath))) self.script.append(self.config.expand(' %%{__mkdir_p} %s' % tardir)) @@ -521,7 +518,7 @@ def run(args): _notice(opts, 'RTEMS Source Builder, Package Builder v%s' % (version)) if not check.host_setup(opts, _defaults): if not opts.force(): - raise error.general('host build environment is not set up' + + raise error.general('host build environment is not set up' + ' correctly (use --force to proceed)') _notice(opts, 'warning: forcing build with known host setup problems') if opts.get_arg('--list-configs'): diff --git a/source-builder/sb/darwin.py b/source-builder/sb/darwin.py index 5f8ac7f..4bfb635 100644 --- a/source-builder/sb/darwin.py +++ b/source-builder/sb/darwin.py @@ -33,10 +33,11 @@ def load(): e = execute.capture_execution() exit_code, proc, output = e.shell(sysctl + 'hw.ncpu') if exit_code == 0: - smp_mflags = '-j' + output.split(' ')[1].strip() + ncpus = output.split(' ')[1].strip() else: - smp_mflags = '' + ncpus = '1' defines = { + '_ncpus': ('none', 'none', ncpus), '_os': ('none', 'none', 'darwin'), '_host': ('triplet', 'required', uname[4] + '-apple-darwin' + uname[2]), '_host_vendor': ('none', 'none', 'apple'), @@ -48,7 +49,6 @@ def load(): '_var': ('dir', 'optional', '/usr/local/var'), '_prefix': ('dir', 'optional', '%{_usr}'), 'optflags': ('none', 'none', '-O2'), - '_smp_mflags': ('none', 'none', smp_mflags), '__ldconfig': ('exe', 'none', ''), '__xz': ('exe', 'required', '%{_usr}/bin/xz'), 'with_zlib': ('none', 'none', '--with-zlib=no') diff --git a/source-builder/sb/defaults.py b/source-builder/sb/defaults.py index 469ed88..4f38e73 100644 --- a/source-builder/sb/defaults.py +++ b/source-builder/sb/defaults.py @@ -251,68 +251,35 @@ FFLAGS="${FFLAGS:-%optflags}" ; export FFLAGS ; class command_line: """Process the command line in a common way for all Tool Builder commands.""" - # - # The define and if it is a path and needs conversion. - # - _long_opts = { '--prefix' : ('_prefix', True), - '--prefixbase' : ('_prefixbase', True), - '--topdir' : ('_topdir', True), - '--configdir' : ('_configdir', True), - '--builddir' : ('_builddir', True), - '--sourcedir' : ('_sourcedir', True), - '--tmppath' : ('_tmppath', True), - '--log' : ('_logfile', False), - '--url' : ('_url_base', False), - '--targetcflags' : ('_targetcflags', False), - '--targetcxxflags' : ('_targetcxxflags', False), - '--libstdcxxflags' : ('_libstdcxxflags', False) } - - _long_true_opts = { '--force' : '_force', - '--trace' : '_trace', - '--dry-run' : '_dry_run', - '--warn-all' : '_warn_all', - '--no-clean' : '_no_clean', - '--no-smp' : '_no_smp', - '--rebuild' : '_rebuild' } - - _target_triplets = { '--host' : '_host', - '--build' : '_build', - '--target' : '_target' } - - def _help(self): - print '%s: [options] [args]' % (self.command_name) - print 'RTEMS Source Builder, an RTEMS Tools Project (c) 2012-2013 Chris Johns' - print 'Options and arguments:' - print '--force : Force the build to proceed' - print '--trace : Trace the execution (not current used)' - print '--dry-run : Do everything but actually run the build' - print '--warn-all : Generate warnings' - print '--no-clean : Do not clean up the build tree' - print '--no-smp : Run with 1 job and not as many as CPUs' - print '--rebuild : Rebuild (not used)' - print '--host : Set the host triplet' - print '--build : Set the build triplet' - print '--target : Set the target triplet' - print '--prefix path : Tools build prefix, ie where they are installed' - print '--prefixbase path : ' - print '--topdir path : Top of the build tree, default is $PWD' - print '--configdir path : Path to the configuration directory, default: ./config' - print '--builddir path : Path to the build directory, default: ./build' - print '--sourcedir path : Path to the source directory, default: ./source' - print '--tmppath path : Path to the temp directory, default: ./tmp' - print '--log file : Log file where all build out is written too' - print '--url url : URL to look for source' - print '--targetcflags flags : List of C flags for the target code' - print '--targetcxxflags flags : List of C++ flags for the target code' - print '--libstdcxxflags flags : List of C++ flags to build the target libstdc++ code' - print '--with-