aboutsummaryrefslogtreecommitdiff
path: root/lib/libUPnP/Platinum/Build/Boot.scons
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libUPnP/Platinum/Build/Boot.scons')
-rw-r--r--lib/libUPnP/Platinum/Build/Boot.scons96
1 files changed, 45 insertions, 51 deletions
diff --git a/lib/libUPnP/Platinum/Build/Boot.scons b/lib/libUPnP/Platinum/Build/Boot.scons
index 788a1cbc8f..9b15737da7 100644
--- a/lib/libUPnP/Platinum/Build/Boot.scons
+++ b/lib/libUPnP/Platinum/Build/Boot.scons
@@ -1,5 +1,6 @@
import sys
import os
+import platform
EnsureSConsVersion(0,98,1)
@@ -8,29 +9,46 @@ EnsureSConsVersion(0,98,1)
#######################################################
# Platform to Target Map (specifies which default target to build on a platform)
-PLATFORM_TO_TARGET_MAP = {
- 'linux-i386' : 'x86-unknown-linux',
- 'linux2' : 'x86-unknown-linux',
- 'win32' : 'x86-microsoft-win32',
- 'cygwin' : 'x86-unknown-cygwin',
- 'darwin' : 'universal-apple-macosx'
+PLATFORM_TO_TARGET_MAP = {
+ 'linux-i386' : 'x86-unknown-linux',
+ 'linux-x86_64': 'x86_64-unknown-linux',
+ 'linux-arm' : 'arm-unknown-linux',
+ 'linux2' : 'x86-unknown-linux',
+ 'win32' : 'x86-microsoft-win32',
+ 'cygwin' : 'x86-unknown-cygwin',
+ 'darwin' : 'universal-apple-macosx'
}
-
-CROSS_PLATFORMS = ['ppu-sony-ps3', 'arm-unknown-linux', 'arm-gp2x-linux', 'arm-android-linux']
-SPECIAL_PLATFORMS = ['universal-apple-macosx-xcode']
-
+
+# list all target dirs
+scons_root = Environment().GetBuildPath('#')
+targets_dir = scons_root+'/Build/Targets'
+targets_dirs = os.listdir(targets_dir)
+TARGET_PLATFORMS = [x for x in targets_dirs if os.path.exists(targets_dir +'/'+x+'/Config.scons')]
+
def DefaultTarget():
- if PLATFORM_TO_TARGET_MAP.has_key(sys.platform):
- return PLATFORM_TO_TARGET_MAP[sys.platform]
+ platform_id = sys.platform
+ if platform.system() == 'Linux':
+ if (platform.machine() == 'i386' or
+ platform.machine() == 'i486' or
+ platform.machine() == 'i586'or
+ platform.machine() == 'i686'):
+ platform_id = 'linux-i386'
+ if (platform.machine() == 'x86_64'):
+ platform_id = 'linux-x86_64'
+ if (platform.machine().startswith('arm')):
+ platform_id = 'linux-arm'
+
+ if PLATFORM_TO_TARGET_MAP.has_key(platform_id):
+ return PLATFORM_TO_TARGET_MAP[platform_id]
else:
- return None
-
+ return None
+
#######################################################
# Main Build
#######################################################
options = Variables()
options.AddVariables(
- EnumVariable('target', 'build target', DefaultTarget(), allowed_values=PLATFORM_TO_TARGET_MAP.values()+CROSS_PLATFORMS+SPECIAL_PLATFORMS),
+ EnumVariable('target', 'Build Target', DefaultTarget(), allowed_values=TARGET_PLATFORMS),
BoolVariable('stop_on_warning', 'Stop the build on warnings', False),
ListVariable('build_config', 'build configurations', 'Debug', names=['Debug', 'Release'])
)
@@ -38,40 +56,16 @@ options.AddVariables(
env = Environment(variables=options)
Help(options.GenerateHelpText(env))
-if 'CXX' in os.environ:
- env['CXX'] = os.environ['CXX']
-if 'CC' in os.environ:
- env['CC'] = os.environ['CC']
-
-if not hasattr(env, 'Clone'): env.Clone = env.Copy ## old scons compatibility
-base_env = env
-
-### special build for x86-microsoft-win32
-if env['target'] == 'x86-microsoft-win32':
- import subprocess
- for build_config in env['build_config']:
- env = base_env.Clone()
- env['build_config'] = build_config
- print '********** Configuring Build Target =', env['target'], '/', build_config, '********'
- retVal = subprocess.call(["python", "Build.py", "-r", "-s", "Platinum.sln", "-b", build_config], cwd=env.GetBuildPath('#/Build/Targets/x86-microsoft-win32-vs2005/'))
- if (retVal != 0):
- sys.exit(retVal)
+if 'NPT_CONFIG_NO_SSL' in os.environ:
+ env['NPT_CONFIG_NO_SSL'] = os.environ['NPT_CONFIG_NO_SSL']
+if 'NPT_CONFIG_NO_ZIP' in os.environ:
+ env['NPT_CONFIG_NO_ZIP'] = os.environ['NPT_CONFIG_NO_ZIP']
+if 'NPT_CONFIG_NO_CRYPTO' in os.environ:
+ env['NPT_CONFIG_NO_CRYPTO'] = os.environ['NPT_CONFIG_NO_CRYPTO']
-### special build for universal-apple-macosx-xcode
-elif env['target'] == 'universal-apple-macosx-xcode':
- import subprocess
- for build_config in env['build_config']:
- env = base_env.Clone()
- env['build_config'] = build_config
- print '********** Configuring Build Target =', env['target'], '/', build_config, '********'
- retVal = subprocess.call(["python", "../../Tools/Scripts/XCodeMake.py", "-p", "Platinum.xcodeproj", "-t", "All", "-s", "macosx", "-b", build_config], cwd=env.GetBuildPath('#/Build/Targets/universal-apple-macosx/'))
- if (retVal != 0):
- sys.exit(retVal)
-
-else:
-### call the actual build script for each build config
- for build_config in env['build_config']:
- env = base_env.Clone()
- env['build_config'] = build_config
- print '********** Configuring Build Target =', env['target'], '/', build_config, '********'
- SConscript('Build.scons', variant_dir='Targets/'+env['target']+'/'+build_config, exports='env', duplicate=0)
+base_env = env
+for build_config in env['build_config']:
+ env = base_env.Clone()
+ env['build_config'] = build_config
+ print '********** Configuring Build Target =', env['target'], '/', build_config, '********'
+ SConscript('Build.scons', variant_dir='Targets/'+env['target']+'/'+build_config, exports='env', duplicate=0)