project_version = '1.3.0'
-# Map of host os and allowed target os (host: allowed target os)
+# Map of build host to possible target os
host_target_map = {
'linux': ['linux', 'android', 'arduino', 'yocto', 'tizen'],
'windows': ['windows', 'android', 'arduino'],
'msys_nt': ['msys_nt'],
}
-# Map of os and allowed archs (os: allowed archs)
+# Map of target os to possible target architecture
os_arch_map = {
'linux': [
'x86', 'x86_64', 'arm', 'arm-v7a', 'armeabi-v7a', 'arm64', 'mips',
],
}
+# Fetch host from Python platform information and smash case
host = platform.system().lower()
-# the host string contains internal version of Windows: 6.3, 6.4, 10.0
-# which are externally known as 8.0, 8.1, and 10 respectively.
-# Canonicalize the msys_nt-XX.X system name by stripping version off.
+# In case of msys_nt, the host string contains an internal Windows version
+# which is not interesting for lookups in the maps.
+# Canonicalize the msys_nt-XX.X system name to msys-nt
if 'msys_nt' in host:
host = 'msys_nt'
if host not in host_target_map:
- print "\nError: building on '%s' is not currently supported.\n" % host
- Exit(1)
+ msg = "\nError: building on host os '%s' is not currently supported.\n" % host
+ Exit(msg)
######################################################################
-# Get build options (the optins from command line)
+# Get build options from command line
######################################################################
-target_os = ARGUMENTS.get('TARGET_OS', host).lower() # target os
+target_os = ARGUMENTS.get('TARGET_OS', host).lower()
if target_os not in host_target_map[host]:
- print "\nError: Unsupported target os: %s (available: %s)\n" % (target_os, host_target_map[host])
- Exit(1)
+ msg = "\nError: host '%s' cannot currently build target '%s'" % (host, target_os)
+ msg += "\n\tchoices: %s\n" % host_target_map[host]
+ Exit(msg)
if target_os == 'android':
default_arch = 'x86'
'y', 'yes', 'true', 't', '1', 'on', 'all', True
]:
release_mode = True
- logging_default = (release_mode == False)
+ logging_default = (release_mode is False)
# targets that do not support the DTLS build (SECURED=1 build option)
targets_without_dtls_support = ['arduino']
if ARGUMENTS.get('SECURED') == '1' and target_os in targets_without_dtls_support:
- print "\nError: DTLS not supported on target %s, MUST build with SECURED=0\n" % (target_os)
- Exit(1)
+ msg = "\nError: DTLS not supported on target '%s', MUST build with SECURED=0\n" % (target_os)
+ Exit(msg)
-######################################################################
-# Common build options (release, target os, target arch)
-######################################################################
+# targets that do not support multiple values for TARGET_TRANSPORT
targets_disallow_multitransport = ['arduino']
-help_vars = Variables()
+# generate a list of unique targets: convert to set() for uniqueness,
+# then convert back to a list
+targetlist = list(set(x for l in host_target_map.values() for x in l))
-help_vars.Add('PROJECT_VERSION',
- 'The version of IoTivity',
- project_version)
+######################################################################
+# Common build options
+######################################################################
-help_vars.Add(
+help_vars = Variables()
+help_vars.AddVariables(
+ ('PROJECT_VERSION',
+ 'The version of IoTivity',
+ project_version),
BoolVariable('VERBOSE',
'Show compilation',
- False))
-help_vars.Add(
+ default=False),
BoolVariable('RELEASE',
'Build for release?',
- True)) # set to 'no', 'false' or 0 for debug
-help_vars.Add(
+ default=True),
EnumVariable('TARGET_OS',
'Target platform',
- host,
- allowed_values=host_target_map[host]))
-
-help_vars.Add(
+ default=host,
+ allowed_values=targetlist),
BoolVariable('WITH_RA',
'Build with Remote Access module',
- False))
-help_vars.Add(
+ default=False),
BoolVariable('WITH_TCP',
'Build with TCP adapter',
- False))
-help_vars.Add(
+ default=False),
BoolVariable('WITH_PROXY',
'Build with CoAP-HTTP Proxy',
- True))
-help_vars.Add(
+ default=True),
ListVariable('WITH_MQ',
'Build with MQ publisher/broker',
- 'OFF',
- ['OFF', 'SUB', 'PUB', 'BROKER']))
-help_vars.Add(
+ default='OFF',
+ names=('OFF', 'SUB', 'PUB', 'BROKER')),
BoolVariable('WITH_CLOUD',
'Build including AccountManager class and Cloud Client sample',
- False))
-help_vars.Add(
+ default=False),
ListVariable('RD_MODE',
'Resource Directory build mode',
- 'CLIENT',
- ['CLIENT', 'SERVER']))
-help_vars.Add(
+ default='CLIENT',
+ names=('CLIENT', 'SERVER')),
BoolVariable('SIMULATOR',
'Build with simulator module',
- False))
-help_vars.Add(
+ default=False),
BoolVariable('WITH_RA_IBB',
'Build with Remote Access module(workssys)',
- False))
-
-if target_os in targets_disallow_multitransport:
- help_vars.Add(
- ListVariable('TARGET_TRANSPORT',
- 'Target transport',
- 'IP',
- ['BT', 'BLE', 'IP', 'NFC']))
-else:
- help_vars.Add(
- ListVariable('TARGET_TRANSPORT',
- 'Target transport',
- 'ALL',
- ['ALL', 'BT', 'BLE', 'IP', 'NFC']))
-
-help_vars.Add(
+ default=False),
EnumVariable('TARGET_ARCH',
'Target architecture',
- default_arch,
- allowed_values=os_arch_map[target_os]))
-
-if target_os in targets_without_dtls_support:
- help_vars.Add(
- EnumVariable('SECURED',
- 'Build with DTLS',
- '0',
- allowed_values=('0', '1')))
-else:
-
- help_vars.Add(
- EnumVariable('SECURED',
- 'Build with DTLS',
- '1',
- allowed_values=('0', '1')))
-help_vars.Add(
+ default=default_arch,
+ allowed_values=os_arch_map[target_os]),
EnumVariable('MULTIPLE_OWNER',
'Enable multiple owner',
- '1',
- allowed_values=('0', '1')))
-help_vars.Add(
+ default='1',
+ allowed_values=('0', '1')),
EnumVariable('EXC_PROV_SUPPORT',
'Except OCPMAPI library(libocpmapi.so)',
- '0',
- allowed_values=('0', '1')))
-help_vars.Add(
+ default='0',
+ allowed_values=('0', '1')),
EnumVariable('TEST',
'Run unit tests',
- '0',
- allowed_values=('0', '1')))
-help_vars.Add(
+ default='0',
+ allowed_values=('0', '1')),
BoolVariable('LOGGING',
'Enable stack logging',
- logging_default))
-help_vars.Add(
+ default=logging_default),
EnumVariable('LOG_LEVEL',
'Enable stack logging level',
- 'DEBUG',
- allowed_values=('DEBUG', 'INFO', 'ERROR', 'WARNING', 'FATAL')))
-help_vars.Add(
+ default='DEBUG',
+ allowed_values=('DEBUG', 'INFO', 'ERROR', 'WARNING', 'FATAL')),
BoolVariable('UPLOAD',
- 'Upload binary ? (For Arduino)',
- require_upload))
-help_vars.Add(
+ 'Upload binary? (For Arduino)',
+ default=require_upload),
EnumVariable('ROUTING',
'Enable routing',
- 'EP',
- allowed_values=('GW', 'EP')))
-help_vars.Add(
+ default='EP',
+ allowed_values=('GW', 'EP')),
EnumVariable('BUILD_SAMPLE',
'Build with sample',
- 'ON',
- allowed_values=('ON', 'OFF')))
-help_vars.AddVariables(('DEVICE_NAME',
- 'Network display name for device (For Arduino)',
- device_name,
- None,
- None), )
-help_vars.Add(
+ default='ON',
+ allowed_values=('ON', 'OFF')),
+ ('DEVICE_NAME',
+ 'Network display name for device (For Arduino)',
+ device_name),
PathVariable('ANDROID_NDK',
'Android NDK path',
- None,
- PathVariable.PathAccept))
-help_vars.Add(
+ default=None,
+ validator=PathVariable.PathAccept),
PathVariable('ANDROID_HOME',
'Android SDK path',
- None,
- PathVariable.PathAccept))
-help_vars.Add(
+ default=None,
+ validator=PathVariable.PathAccept),
PathVariable('ANDROID_GRADLE',
- 'Gradle binary file',
- None,
- PathVariable.PathIsFile))
-help_vars.Add(
+ 'Gradle executable location',
+ default=None,
+ validator=PathVariable.PathIsFile),
EnumVariable('WITH_UPSTREAM_LIBCOAP',
'Use latest stable version of LibCoAP downloaded from github',
- default_with_upstream_libcoap,
- allowed_values=('0', '1')))
-help_vars.Add(
+ default=default_with_upstream_libcoap,
+ allowed_values=('0', '1')),
BoolVariable('WITH_ENV',
'Use compiler options from environment',
- False))
-help_vars.Add(
+ default=False),
BoolVariable('AUTOMATIC_UPDATE',
'Makes libcoap update automatically to the required versions if needed.',
- False))
+ default=False),
+ BoolVariable('BUILD_JAVA',
+ 'Build Java bindings',
+ default=False),
+ PathVariable('JAVA_HOME',
+ 'JDK directory',
+ default=os.environ.get('JAVA_HOME'),
+ validator=PathVariable.PathAccept),
+ EnumVariable('OIC_SUPPORT_TIZEN_TRACE',
+ 'Tizen Trace(T-trace) api availability',
+ default='False',
+ allowed_values=('True', 'False')),
+)
+
+######################################################################
+# Platform (build target) specific options
+######################################################################
+if target_os in targets_disallow_multitransport:
+ help_vars.Add(
+ EnumVariable('TARGET_TRANSPORT',
+ 'Target transport',
+ default='IP',
+ allowed_values=('BT', 'BLE', 'IP', 'NFC')))
+else:
+ help_vars.Add(
+ ListVariable('TARGET_TRANSPORT',
+ 'Target transport',
+ default='ALL',
+ names=('ALL', 'BT', 'BLE', 'IP', 'NFC')))
+
+if target_os in targets_without_dtls_support:
+ help_vars.Add(
+ EnumVariable('SECURED',
+ 'Build with DTLS',
+ default='0',
+ allowed_values=('0',)))
+else:
+ help_vars.Add(
+ EnumVariable('SECURED',
+ 'Build with DTLS',
+ default='1',
+ allowed_values=('0', '1')))
if target_os == 'windows':
- # For VS2013, MSVC_VERSION is '12.0'. For VS2015, MSVC_VERSION is '14.0'.
- # Default value is None, meaning that SCons has to choose automatically a VS version.
+ # Builds differ based on Visual Studio version
+ # For VS2013, MSVC_VERSION is '12.0'.
+ # For VS2015, MSVC_VERSION is '14.0'.
+ # For VS2017, MSVC_VERSION is '15.0'.
+ # Default value is None, which means SCons will pick
help_vars.Add(
EnumVariable('MSVC_VERSION',
'MSVC compiler version - Windows',
- None,
+ default=None,
allowed_values=('12.0', '14.0')))
- help_vars.Add(EnumVariable(
- 'UWP_APP',
- 'Build for a Universal Windows Platform (UWP) Application',
- '0',
+ #TODO allowed_values=('12.0', '14.0', '15.0')))
+ help_vars.Add(
+ EnumVariable('UWP_APP',
+ 'Build a Universal Windows Platform (UWP) Application',
+ default='0',
allowed_values=('0', '1')))
-help_vars.Add(
- BoolVariable('BUILD_JAVA',
- 'Build Java bindings',
- False))
-help_vars.Add(
- PathVariable('JAVA_HOME',
- 'JDK directory',
- os.environ.get('JAVA_HOME'),
- PathVariable.PathAccept))
-help_vars.Add(
- EnumVariable('OIC_SUPPORT_TIZEN_TRACE',
- 'Tizen Trace(T-trace) api availability',
- 'False',
- allowed_values=('True', 'False')))
-
AddOption(
'--prefix',
dest='prefix',
help='installation prefix')
######################################################################
-# Platform(build target) specific options: SDK/NDK & toolchain
+# Platform (build target) specific options: SDK/NDK & toolchain
######################################################################
targets_support_cc = ['linux', 'arduino', 'tizen']
if target_os in targets_support_cc:
# Set cross compile toolchain
help_vars.Add('TC_PREFIX',
- "Toolchain prefix (Generally only be required for cross-compiling)",
- os.environ.get('TC_PREFIX'))
+ "Toolchain prefix (Generally only required for cross-compiling)",
+ default=None)
help_vars.Add(
PathVariable('TC_PATH',
- 'Toolchain path (Generally only be required for cross-compiling)',
- os.environ.get('TC_PATH')))
+ 'Toolchain path (Generally only required for cross-compiling)',
+ default=None,
+ validator=PathVariable.PathAccept))
+######################################################################
# this is where the setup of the construction envionment begins
+######################################################################
if target_os in ['android', 'arduino']:
# Android/Arduino always uses GNU compiler regardless of the host
env = Environment(
print "using LDFLAGS/LINKFLAGS from environment: %s" % env['LINKFLAGS']
# set quieter build messages unless verbose mode was requested
-if env.get('VERBOSE') == False:
+if not env.get('VERBOSE'):
env['CCCOMSTR'] = "Compiling $TARGET"
env['SHCCCOMSTR'] = "Compiling $TARGET"
env['CXXCOMSTR'] = "Compiling $TARGET"
else:
env['CONFIG_ENVIRONMENT_IMPORT'] = False
-if env['CONFIG_ENVIRONMENT_IMPORT'] == True:
+if env['CONFIG_ENVIRONMENT_IMPORT']:
print "warning: importing some environment variables for OS: %s" % target_os
for ev in [
'PATH',
'PKG_CONFIG_PATH',
'PKG_CONFIG_SYSROOT_DIR'
]:
- if os.environ.get(ev) != None:
+ if os.environ.get(ev) is not None:
env['ENV'][ev] = os.environ.get(ev)
if os.environ['LDFLAGS'] != None:
env.AppendUnique(LINKFLAGS=Split(os.environ['LDFLAGS']))
# env.get('BUILD_DIR')
#
if not os.path.exists(dir + '/SConstruct'):
- print '''
+ msg = '''
*************************************** Error *********************************
* The directory (%s) seems not to be a buildable directory,
* no SConstruct file found.
*******************************************************************************
''' % dir
- Exit(1)
+ Exit(msg)
build_dir = dir + '/out/' + target_os + '/'
env.SetDir(env.GetLaunchDir())
env['ROOT_DIR'] = env.GetLaunchDir() + '/..'
+# make 'env' available to all other build scripts to Import()
Export('env')
####################################################################i#
else:
if ('BT' in target_transport):
if (target_os == 'linux'):
- print "CA Transport BT is not supported "
- Exit(1)
+ msg = "CA Transport BT is not supported "
+ Exit(msg)
else:
env.AppendUnique(CPPDEFINES=['EDR_ADAPTER'])
else:
]):
env.AppendUnique(CPPDEFINES=['TCP_ADAPTER', 'WITH_TCP'])
else:
- print "CA Transport TCP is not supported "
- Exit(1)
+ msg = "CA Transport TCP is not supported "
+ Exit(msg)
else:
env.AppendUnique(CPPDEFINES=['NO_TCP_ADAPTER'])
if (target_os == 'android'):
env.AppendUnique(CPPDEFINES=['NFC_ADAPTER'])
else:
- print "CA Transport NFC is not supported "
- Exit(1)
+ msg = "CA Transport NFC is not supported "
+ Exit(msg)
else:
env.AppendUnique(CPPDEFINES=['NO_NFC_ADAPTER'])
if ('BROKER' in with_mq):
env.AppendUnique(CPPDEFINES=['MQ_BROKER', 'WITH_MQ'])
-env.AppendUnique(CPPDEFINES = {'OC_LOG_LEVEL' : env.get('LOG_LEVEL')})
+env.AppendUnique(CPPDEFINES={'OC_LOG_LEVEL': env.get('LOG_LEVEL')})
if env.get('LOGGING'):
env.AppendUnique(CPPDEFINES=['TB_LOG'])
######################################################################
if target_os == "yocto":
'''
- This code injects Yocto cross-compilation tools+flags into scons'
- build environment in order to invoke the relevant tools while
+ This code injects Yocto cross-compilation tools+flags into the scons
+ construction environment in order to invoke the relevant tools while
performing a build.
'''
import os.path
try:
CC = os.environ['CC']
target_prefix = CC.split()[0]
- target_prefix = target_prefix[:len(target_prefix) - 3]
+ target_prefix = target_prefix[:-3]
tools = {
"CC": target_prefix + "gcc",
"CXX": target_prefix + "g++",
if os.path.isfile(os.path.join(path, tools[tool])):
env[tool] = os.path.join(path, os.environ[tool])
break
- env['CROSS_COMPILE'] = target_prefix[:len(target_prefix) - 1]
+ env['CROSS_COMPILE'] = target_prefix[:-1]
except:
- print "ERROR in Yocto cross-toolchain environment"
- Exit(1)
+ msg = "ERROR in Yocto cross-toolchain environment"
+ Exit(msg)
'''
Now reset TARGET_OS to linux so that all linux specific build configurations
hereupon apply for the entirety of the build process.
# Add external Pseudo-Builders
#
# Some methods are added to manage external packages:
-# 'PrepareLib': Checks the existence of an external library, if it
-# doesn't exist, calls the script user provided to download(if required)
-# and build the source code of the external library or notify user to
-# install the library.
+# 'PrepareLib': Make a library ready to use.
# 'Download': Download package from specify URL
# 'UnpackAll': Unpack the package
-# 'Configure': Execute specify script(configure, bootstrap etc)
+# 'Configure': Execute specify script (configure, bootstrap etc)
# 'InstallHeadFile': Install head files
-# 'InstallLib': Install library binaries(.so, .a etc)
+# 'InstallLib': Install library binaries (.so, .a etc)
#
# for more on Pseudo-Builders see scons offical documentation
# 'Pseudo-Builders: the AddMethod function'
##
-import os, subprocess
-import urllib2, urlparse
+import os
+import subprocess
+import urllib2
import SCons.Errors
Import('env')
+src_dir = env.get('SRC_DIR')
-
-# Check whether a library exists, if not, notify user to install it or try to
-# download the source code and build it
+# Prepare a library for use.
+# Check whether it exists
+# if not try to download the source code and build it
+# if not possible, give the user a hint about downloading
# @param libname - the name of the library try to prepare
-# @param lib - the lib(.so, .a etc) to check (a library may include more then
-# one lib, e.g. boost, includes boost_thread, boost_system ...
-# @param path - the directory of the library building script, if it's not set,
-# by default, it's <src_dir>/extlibs/<libname>/
-# @param script - the building script, by default, it's 'SConscript'
+# @param lib - the lib (.so, .a etc) to check (a library may include more then
+# one lib, e.g. boost includes boost_thread, boost_system ...)
+# @param path - path to build script for library. Default is <src_dir>/extlibs/<libname>/
+# @param script - build script for this library. Default is SConscript
#
def __prepare_lib(ienv, libname, lib=None, path=None, script=None):
p_env = ienv.Clone(LIBS=[])
if path:
dir = path
else:
- dir = os.path.join(env.get('SRC_DIR'), 'extlibs', libname)
+ dir = os.path.join(src_dir, 'extlibs', libname)
- # Execute the script to download(if required) and build source code
+ # Execute the script to download (if required) and build source code
if script:
st = os.path.join(dir, script)
else:
SConscript(st)
else:
if target_os in ['linux', 'darwin', 'tizen']:
- print 'Don\'t find library(%s), please intall it, exit ...' % libname
+ msg = 'Library (%s) not found, please intall it, exit ...' % libname
else:
- print 'Library (%s) not found and cannot find the scons script (%s), exit ...' % (
+ msg = 'Library (%s) not found and cannot find the scons script (%s), exit ...' % (
libname, st)
- Exit(1)
+ Exit(msg)
conf.Finish()
-# Run configure command (usually it's done before build a library)
+# Run configure command (usually done before building a library)
def __configure(env, cwd, cmd):
print "Configuring using [%s/%s] ..." % (cwd, cmd)
# build it now (we need the shell, because some programs need it)
def __install_head_file(ienv, file):
return ienv.Install(
os.path.join(
- env.get('SRC_DIR'), 'dep', target_os, target_arch, 'usr',
- 'include'), file)
+ src_dir, 'dep', target_os, target_arch, 'usr', 'include'), file)
# Install library binaries to <src_dir>/deps/<target_os>/lib/<arch>
def __install_lib(ienv, lib):
return ienv.Install(
os.path.join(
- env.get('SRC_DIR'), 'dep', target_os, target_arch, 'usr', 'lib'),
+ src_dir, 'dep', target_os, target_arch, 'usr', 'lib'),
lib)
import winreg
import platform
+src_dir = env.get('SRC_DIR')
+build_dir = env.get('BUILD_DIR')
+
def OpenRegKey(env, key, sub_key, reg_view_64bit=False):
# Default access
reg_access_mask = winreg.KEY_READ
if env.get('BUILD_JAVA') == True:
if not env.get('ANDROID_GRADLE'):
SConscript('../../extlibs/android/gradle/SConscript')
- help_vars.Add(PathVariable('ANDROID_GRADLE', 'Android Gradle directory', os.path.join(env.get('SRC_DIR'), 'extlibs', 'android', 'gradle', 'gradle-2.2.1/bin/gradle')))
+ help_vars.Add(
+ PathVariable('ANDROID_GRADLE',
+ 'Android Gradle directory',
+ default=os.path.join(
+ src_dir, 'extlibs', 'android',
+ 'gradle', 'gradle-2.2.1/bin/gradle')))
if env.get('ANDROID_GRADLE'):
android_gradle = env.get('ANDROID_GRADLE')
print(
'''
*************************************** Info **********************************
-* Android Gradle path isn't set, the default will be used. You can set *
-* environment variable ANDROID_GRADLE or add it in command line as: *
-* # scons ANDROID_GRADLE=<path to android GRADLE> ... *
+* Android Gradle path is not set, the default will be used. You can set
+* environment variable ANDROID_GRADLE or add it on the command line as:
+* # scons ANDROID_GRADLE=<path to android GRADLE> ...
*******************************************************************************
''')
- android_gradle = os.path.join(env.get('SRC_DIR'), 'extlibs', 'android', 'gradle', 'gradle-2.2.1', 'bin', 'gradle')
+ android_gradle = os.path.join(
+ src_dir, 'extlibs', 'android', 'gradle', 'gradle-2.2.1', 'bin', 'gradle')
help_vars.Update(env)
Help(help_vars.GenerateHelpText(env))
if env['CC'] == 'cl':
if env.get('UWP_APP') == '1':
# Currently only supports VS2015 (14.0)
+ # TODO add VS2017 (15.0)
supported_uwp_msvc_versions = ['14.0']
# If MSVC_VERSION is not supported for UWP, exit on error
if env.get('MSVC_VERSION') not in supported_uwp_msvc_versions:
- print '\nError: Trying to Build UWP binaries with unsupported Visual Studio version\n'
- Exit(1)
+ msg = '\nError: Trying to Build UWP binaries with unsupported Visual Studio version\n'
+ Exit(msg)
# - warning C4133: incompatible type conversion
env.AppendUnique(CCFLAGS=['/we4133'])
# InstallTarget() for this static LIB, but didn't finish yet. That behavior results
# in linker errors. Work around this issue by linking with the source of InstallTarget(),
# rather than the target.
- env.PrependUnique(LIBPATH=[os.path.join(env.get('BUILD_DIR'), 'resource', 'src')])
- env.PrependUnique(LIBPATH=[os.path.join(env.get('BUILD_DIR'), 'resource', 'c_common', 'windows')])
- env.PrependUnique(LIBPATH=[os.path.join(env.get('BUILD_DIR'), 'resource', 'oc_logger')])
- env.PrependUnique(LIBPATH=[os.path.join(env.get('BUILD_DIR'), 'resource', 'csdk', 'resource-directory')])
- env.PrependUnique(LIBPATH=['#extlibs/mbedtls'])
+ env.PrependUnique(LIBPATH=[
+ os.path.join(build_dir, 'resource', 'src'),
+ os.path.join(build_dir, 'resource', 'c_common', 'windows'),
+ os.path.join(build_dir, 'resource', 'oc_logger'),
+ os.path.join(build_dir, 'resource', 'csdk', 'resource-directory'),
+ '#extlibs/mbedtls',
+ ])
env['PDB'] = '${TARGET.base}.pdb'
env.Append(LINKFLAGS=['/PDB:${TARGET.base}.pdb'])
env.AppendUnique(LIBS=['WindowsApp', 'bcrypt', 'ws2_32', 'iphlpapi', 'crypt32'])
elif env['CC'] == 'gcc':
- print "\nError: gcc not supported on Windows. Use Visual Studio!\n"
- Exit(1)
+ msg = "\nError: gcc not supported on Windows. Use Visual Studio!\n"
+ Exit(msg)