Skip to content

Commit

Permalink
[libUPnP][platinum] update to 1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Rechi committed Jan 2, 2018
1 parent c568a59 commit 4bf0ccf
Show file tree
Hide file tree
Showing 311 changed files with 2,267 additions and 46,118 deletions.
96 changes: 45 additions & 51 deletions lib/libUPnP/Platinum/Build/Boot.scons
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import sys
import os
import platform

EnsureSConsVersion(0,98,1)

Expand All @@ -8,70 +9,63 @@ 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'])
)

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)
31 changes: 21 additions & 10 deletions lib/libUPnP/Platinum/Build/Build.scons
Original file line number Diff line number Diff line change
Expand Up @@ -191,39 +191,50 @@ if os.path.exists(target_config_file):
# module's implementation only.
#######################################################
# Neptune
NPT_SOURCE_ROOT = '../Neptune'

LibraryModule(name = 'Zlib',
source_root = NPT_SOURCE_ROOT,
build_source_dirs = ['ThirdParty/zlib-1.2.3'])

LibraryModule(name = 'axTLS',
source_root = NPT_SOURCE_ROOT,
build_source_dirs = ['ThirdParty/axTLS/crypto', 'ThirdParty/axTLS/ssl', 'ThirdParty/axTLS/config/Generic'])
NPT_SOURCE_ROOT = 'ThirdParty/Neptune'

extra_cpp_flags = []
neptune_extra_linked_modules = []
if not env.has_key('NPT_CONFIG_NO_ZIP'):
extra_cpp_flags = ['NPT_CONFIG_ENABLE_ZIP']
neptune_extra_linked_modules += ['Zlib']

LibraryModule(name = 'Zlib',
source_root = NPT_SOURCE_ROOT,
build_source_dirs = ['ThirdParty/zlib-1.2.3'])

if not env.has_key('NPT_CONFIG_NO_SSL'):
extra_cpp_flags += ['NPT_CONFIG_ENABLE_TLS']
tls_data_dirs = ['Data/TLS']
tls_tests = ['Tls1']
neptune_extra_linked_modules += ['axTLS']

LibraryModule(name = 'axTLS',
source_root = NPT_SOURCE_ROOT,
build_source_dirs = ['ThirdParty/axTLS/crypto', 'ThirdParty/axTLS/ssl', 'ThirdParty/axTLS/config/Generic'])
else:
tls_data_dirs = []
tls_tests = []

if not env.has_key('NPT_CONFIG_NO_CRYPTO'):
extra_cpp_flags += ['NPT_CONFIG_ENABLE_CRYPTO']
neptune_excluded_files = []
else:
neptune_excluded_files = ['NptCrypto.cpp', 'NptDigest.cpp']

LibraryModule(name = 'Neptune',
build_source_dirs = ['Core']+tls_data_dirs,
build_source_files = env['NPT_SYSTEM_SOURCES'],
excluded_files = neptune_excluded_files,
extra_cpp_defines = extra_cpp_flags,
linked_modules = env['NPT_EXTRA_LIBS']+['Zlib']+['axTLS'],
linked_modules = env['NPT_EXTRA_LIBS']+neptune_extra_linked_modules,
source_root = NPT_SOURCE_ROOT + '/Source')

# Platinum
LibraryModule(name = 'Platinum',
build_source_dirs = ['Core', 'Extras'],
build_include_dirs = ['Source/Platinum'],
extra_cpp_defines = extra_cpp_flags,
included_modules = ['Neptune'])

# Platinum MediaServer
Expand Down
22 changes: 11 additions & 11 deletions lib/libUPnP/Platinum/Build/Targets/arm-android-linux/Config.scons
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if not ANDROID_NDK_ROOT:
if env.has_key('android_host_system') and env['android_host_system']:
ANDROID_HOST_SYSTEM = env['android_host_system']
else:
PLATFORM_TO_TARGET_MAP = {
PLATFORM_TO_TARGET_MAP = {
'linux-i386' : 'linux-x86',
'linux2' : 'linux-x86',
'win32' : 'windows',
Expand Down Expand Up @@ -46,7 +46,7 @@ if not os.path.exists(os.path.join(ANDROID_NDK_ROOT, 'toolchains', ANDROID_TOOLC
ANDROID_CROSS_PREFIX = ANDROID_TOOLCHAIN[:suffix_pos]
print "Auto-selecting toolchain:", ANDROID_TOOLCHAIN
break

# override defaults from command line args
if ARGUMENTS.get('android_toolchain'):
ANDROID_TOOLCHAIN=ARGUMENTS.get('android_toolchain')
Expand All @@ -59,7 +59,7 @@ if ARGUMENTS.get('android_platform'):

if ARGUMENTS.get('android_arch'):
ANDROID_ARCH=ARGUMENTS.get('android_arch')

print 'Building for Android: '
print 'ANDROID_HOST_SYSTEM =', ANDROID_HOST_SYSTEM
print 'ANDROID_TOOLCHAIN =', ANDROID_TOOLCHAIN
Expand All @@ -78,7 +78,7 @@ env['NPT_EXTRA_LIBS'] = ['gcc']

### Load the tools
LoadTool('gcc-generic', env, gcc_cross_prefix=ANDROID_CROSS_PREFIX, gcc_strict=False)
env.AppendUnique(CCFLAGS = ['-I'+ANDROID_NDK_ROOT+'/sources/cxx-stl/system/include' ,
env.AppendUnique(CCFLAGS = ['-I'+ANDROID_NDK_ROOT+'/sources/cxx-stl/system/include' ,
'--sysroot', ANDROID_SYSROOT,
'-msoft-float',
'-fpic',
Expand All @@ -90,18 +90,18 @@ env.AppendUnique(CCFLAGS = ['-I'+ANDROID_NDK_ROOT+'/sources/cxx-stl/system/inclu
env.AppendUnique(CXXFLAGS = ['-fno-exceptions', '-fno-rtti'])
env.AppendUnique(CPPDEFINES = ['ANDROID', 'NPT_CONFIG_HAVE_SYSTEM_LOG_CONFIG'])
env.AppendUnique(LINKFLAGS = ['--sysroot', ANDROID_SYSROOT,
'-Wl,--no-undefined',
'-Wl,--no-undefined',
'-Wl,-z,noexecstack',
'-L'+ANDROID_SYSROOT+'/usr/lib',
'-lc',
'-lstdc++',
'-lm',
'-llog',
'-L'+ANDROID_SYSROOT+'/usr/lib',
'-lc',
'-lstdc++',
'-lm',
'-llog',
'-ldl'])

### Specific System choices
env['NPT_SYSTEM_SOURCES']={'System/StdC':'NptStdc[!D]*.cpp',
'System/Bsd':'*.cpp',
'System/Posix':'*.cpp',
'System/Null':'NptNullSerialPort.cpp',
'System/Null':['NptNullSerialPort.cpp', 'NptNullAutoreleasePool.cpp'],
'System/Android':'*.cpp'}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ LoadTool('gcc-generic', env, gcc_cross_prefix='arm-linux')
env['PROGSUFFIX'] = '.gpe'

### Neptune System Files
env['NPT_SYSTEM_SOURCES']={'System/StdC':'*.cpp', 'System/Bsd':'*.cpp', 'System/Posix':'*.cpp'}
env['NPT_SYSTEM_SOURCES']={'System/StdC':'*.cpp', 'System/Bsd':'*.cpp', 'System/Posix':'*.cpp', 'System/Null':'NptNullAutoreleasePool.cpp'}
env['NPT_EXTRA_LIBS']=['pthread']

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
LoadTool('gcc-generic', env, gcc_cross_prefix='arm-linux')

### Neptune System Files
env['NPT_SYSTEM_SOURCES']={'System/StdC':'*.cpp', 'System/Bsd':'*.cpp', 'System/Posix':'*.cpp'}
env['NPT_SYSTEM_SOURCES']={'System/StdC':'*.cpp', 'System/Bsd':'*.cpp', 'System/Posix':'*.cpp', 'System/Null':'NptNullAutoreleasePool.cpp'}
env['NPT_EXTRA_LIBS']=['pthread']

env['STRIP'] = ''

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>com.plutinosoft.$(PRODUCT_NAME:rfc1034identifier)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>
Loading

0 comments on commit 4bf0ccf

Please sign in to comment.