예제 #1
0
def gcc(exeFile, srcFiles, includes, libs, defs):
  # standard includes
  cmd = "gcc"
  if is64bit():
      cmd += " -m32" # always compile in 32bit mode

  for include in includes:
    cmd += " -I\"" + include + "\""

  # defines (tuples)
  for d in defs:
    cmd += " -D" + d[0] + "=" + d[1]

  cmd += " -DPLAT_BUILD_VERSION=" + '\\"' + env.buildVersion() + '\\"'

  # libs
  for lib in libs:
    cmd += " -L\"" + lib + "\""

  # src
  for src in srcFiles:
    cmd += " " + src

  # remaining options
  cmd += " -O2"
  cmd += " -o " + exeFile

  # compile away
  print cmd
  status = os.system(cmd)
  if status:
    raise env.BuildError("FATAL: compileunix " + exeFile)

  print "  Success [" + exeFile + "]"
예제 #2
0
def gcc(exeFile, srcFiles, includes, libs, defs):
    # standard includes
    cmd = "gcc"
    for include in includes:
        cmd += " -I\"" + include + "\""

    # defines (tuples)
    for d in defs:
        cmd += " -D" + d[0] + "=" + d[1]

    cmd += " -DPLAT_BUILD_VERSION=" + '\\"' + env.buildVersion() + '\\"'

    # libs
    for lib in libs:
        cmd += " -L\"" + lib + "\""

    # src
    for src in srcFiles:
        cmd += " " + src

    # remaining options
    cmd += " -O2"
    cmd += " -o " + exeFile

    # compile away
    print cmd
    status = os.system(cmd)
    if status:
        raise env.BuildError("FATAL: compileunix " + exeFile)

    print "  Success [" + exeFile + "]"
예제 #3
0
def gcc(exeFile, srcFiles, includes, libs, defs):
  # standard includes
  compile_prefix=os.environ.get("SVM_CROSS_COMPILE")
  cmd = "gcc"
  if compile_prefix is not None:
    cmd = compile_prefix + cmd

  if (platform.machine() == 'x86_64') and (compile_prefix is None):
    cmd += " -m32"  # always compile in 32bit mode

  sysroot = os.environ.get("SVM_SYSROOT")
  for include in includes:
    if sysroot is not None and include.startswith("/"):
      include = sysroot + os.sep + include
    cmd += " -I" + include

  # defines (tuples)
  for d in defs:
    if not isinstance(d, tuple):
      d = (d, )
    cmd += " -D" + d[0]
    if len(d)>1 and d[1] is not None:
      cmd += "=" + d[1]

  cmd += " -DPLAT_BUILD_VERSION=" + '\\"' + env.buildVersion() + '\\"'

  # add user CFLAGS
  cflags = os.environ.get("SVM_CFLAGS")
  if cflags is not None:
    cmd += " " + cflags

  # src
  for src in srcFiles:
    cmd += " " + src

  # libs
  for lib in libs:
    cmd += " -l" + lib

  # add user LDFLAGS
  ldflags = os.environ.get("SVM_LDFLAGS")
  if ldflags is not None:
    cmd += " " + ldflags

  # remaining options
  cmd += " -O2"
  cmd += " -o " + exeFile

  # compile away
  print(cmd)
  status = os.system(cmd)
  if status:
    raise env.BuildError("FATAL: compileunix " + exeFile)

  print("  Success [" + exeFile + "]")
예제 #4
0
def initParser():
  global parser
  parser = argparse.ArgumentParser(description='Make Sedona VM for Windows')

  parser.add_argument('-v', '--ver', action='store', default=env.buildVersion(), 
                             help='Set SVM version string to VERSION', 
                             metavar="VERSION")

  ipgroup = parser.add_mutually_exclusive_group()
  ipgroup.add_argument('-4', '--ipv4', action='store_true', default=False,  
                             help='Use IPv4 protocol (default)')
  ipgroup.add_argument('-6', '--ipv6', action='store_true', default=False, 
                             help='Use IPv6 protocol')
예제 #5
0
def gcc(exeFile, srcFiles, includes, libs, defs):
    # standard includes

    # Native compilation
    #  cmd = "gcc"

    # Cross compilation
    cmd = "arm-linux-gnueabihf-gcc"

    for include in includes:
        cmd += " -I\"" + include + "\""

    # defines (tuples)
    for d in defs:
        cmd += " -D" + d[0] + "=" + d[1]


#Need to add pthread library to build
    cmd += " -pthread"
    #Need to add "clock" to resovle the "clock_gettime" API
    cmd += "  -lrt -lm"

    #  cmd += " -DPRINT_ENABLED=1"

    cmd += " -DPLAT_BUILD_VERSION=" + '\\"' + env.buildVersion() + '\\"'

    # libs
    for lib in libs:
        cmd += " -L\"" + lib + "\""

    # src
    for src in srcFiles:
        cmd += " " + src

    # remaining options
    cmd += " -O2"
    cmd += " -o " + exeFile

    # compile away
    print cmd
    status = os.system(cmd)
    if status:
        raise env.BuildError("FATAL: compileunix " + exeFile)

    print "  Success [" + exeFile + "]"
예제 #6
0
def initParser():
  global parser
  parser = argparse.ArgumentParser(description='Build and run Sedona VM')

  parser.add_argument('-v', '--version', action='store', default=env.buildVersion(), 
                             help='Set SVM version string to VER', metavar="VER")
  parser.add_argument('-t', '--test', action='append', 
                             help='Run specified test (default is all)',
                             default=None, choices=['sedonac', 'svm', 'all', 'none'], 
                             metavar="TEST")
  parser.add_argument('-r', '--run', action='store_true', default=False,
                             help='Run an app after building')
  parser.add_argument('-a', '--app', action='store', 
                             help='Specify app SAX to run (default is %s)' % defaultapp,
                             default=os.path.join(env.apps, defaultapp), metavar="SAX")
  parser.add_argument('-s', '--scode', action='store', 
                             help='Specify scode XML to run (default is %s)' % defaultscode,
                             default=os.path.join(env.scode, defaultscode), 
                             metavar="XML")
예제 #7
0
def initParser():
  global parser
  parser = argparse.ArgumentParser(description='Build and run Sedona VM for Windows')

  parser.add_argument('-v', '--version', action='store', default=env.buildVersion(), 
                             help='Set SVM version string to VER', metavar="VER")
  parser.add_argument('-t', '--test', action='append', 
                             help='Run specified test (default is all)',
                             default=None, choices=['sedonac', 'svm', 'all', 'none'], 
                             metavar="TEST")
  parser.add_argument('-r', '--run', action='store_true', default=False,
                             help='Run an app after building')
  parser.add_argument('-a', '--app', action='store', 
                             help='Specify app SAX to run (default is %s)' % defaultapp,
                             default=os.path.join(env.apps, defaultapp), metavar="SAX")
  parser.add_argument('-s', '--scode', action='store', 
                             help='Specify scode XML to run (default is %s)' % defaultscode,
                             default=os.path.join(env.scode, defaultscode), 
                             metavar="XML")
예제 #8
0
def initParser():
    global parser
    parser = argparse.ArgumentParser(description='Make Sedona VM for Windows')

    parser.add_argument('-v',
                        '--ver',
                        action='store',
                        default=env.buildVersion(),
                        help='Set SVM version string to VERSION',
                        metavar="VERSION")

    parser.add_argument('-l',
                        '--list-compilers',
                        action='store_true',
                        help='List the supported compilers')

    parser.add_argument(
        '-p',
        '--platform',
        type=platformType,
        action='store',
        help=
        'The path to the sedonaPlatform XML file. \nEnvironment variable SVM_PLATFORM can be used to set the platform path.',
        metavar="SVM_PLATFORM")
    parser.add_argument('-c',
                        '--compiler',
                        type=compilerType,
                        action='store',
                        help="The compiler to use. Defaults to 'msvc'",
                        metavar="COMPILER")

    ipgroup = parser.add_mutually_exclusive_group()
    ipgroup.add_argument('-4',
                         '--ipv4',
                         action='store_true',
                         default=False,
                         help='Use IPv4 protocol (default)')
    ipgroup.add_argument('-6',
                         '--ipv6',
                         action='store_true',
                         default=False,
                         help='Use IPv6 protocol')
예제 #9
0
파일: makedev.py 프로젝트: bondgse/sedona-1
def initParser():
  global parser
  parser = argparse.ArgumentParser(description='Build and run Sedona VM')

  parser.add_argument('-v', '--version', action='store', default=env.buildVersion(), 
                             help='Set SVM version string to VER', metavar="VER")
  parser.add_argument('-t', '--test', action='append', 
                             help='Run specified test (default is all)',
                             default=None, choices=['sedonac', 'svm', 'all', 'none'], 
                             metavar="TEST")
  parser.add_argument('-k', '--kits', action='store',
                             help='Specify XML to build additional external kits. Default is None',
                             default=None,
                             metavar="KITS")
  parser.add_argument('-r', '--run', action='store_true', default=False,
                             help='Run an app after building')
  parser.add_argument('-a', '--app', action='store', 
                             help='Specify app SAX to run (default is %s)' % defaultapp,
                             default=os.path.join(env.apps, defaultapp), metavar="SAX")
  parser.add_argument('-s', '--scode', action='store', 
                             help='Specify scode XML to run (default is %s)' % defaultscode,
                             default=os.path.join(env.scode, defaultscode), 
                             metavar="XML")

  help_msg = 'The path to the sedonaPlatform XML file. ' + \
             'If this option is omitted, then environment variable $SVM_PLATFORM will be checked. ' + \
             'If that variable is not set, then $sedona_home/platforms/src/generic/unix/generic-unix.xml ' + \
             'will be used.'
  parser.add_argument('-p', '--platform', action='store',
                             help=help_msg,
                             default=None,
                             metavar="PLATFORM")

  parser.add_argument('-c', '--compiler', action='store',
                             help='Compiler to use. Defaults to gcc',
                             default=None,
                             metavar="CC")

  parser.add_argument('--sys', action='store',
                             help='Force to use build scripts for specific platform (posix,nt)',
                             default=os.name)
예제 #10
0
exeFile = os.path.join(env.bin, "svm.exe")

stageDir = os.path.join(env.temp, "win32")

srcFiles = [ os.path.join(stageDir, "*.c")]

includes = [ stageDir ]

libs = [ "ws2_32.lib",  "uuid.lib", "kernel32.lib"]


#
# Dictionary of compiler args - may be modified by cmd line
#
defs = { 'WIN32':None, '_WIN32':None, 'SOCKET_FAMILY_INET':None,
         'PLAT_BUILD_VERSION':'\\"' + env.buildVersion() + '\\"' }


# initParser
def initParser():
  global parser
  parser = argparse.ArgumentParser(description='Make Sedona VM for Windows')

  parser.add_argument('-v', '--ver', action='store', default=env.buildVersion(), 
                             help='Set SVM version string to VERSION', 
                             metavar="VERSION")

  ipgroup = parser.add_mutually_exclusive_group()
  ipgroup.add_argument('-4', '--ipv4', action='store_true', default=False,  
                             help='Use IPv4 protocol (default)')
  ipgroup.add_argument('-6', '--ipv6', action='store_true', default=False, 
예제 #11
0
def writeVerFile(dir):
    f = open(os.path.join(dir, "version.txt"), "w")
    f.write("version=" + env.buildVersion() + "\n")
    f.write("time=" + time.strftime("%Y-%m-%d %H:%M") + "\n")
    f.close()
예제 #12
0
def writeVerFile(dir):  
  f = open(os.path.join(dir, "version.txt"), "w")
  f.write("version=" + env.buildVersion() + "\n")
  f.write("time=" + time.strftime("%Y-%m-%d %H:%M") + "\n")
  f.close()  
예제 #13
0
def zip():
    zipprefix = "sedona_community-" + env.buildVersion()
    zipname = zipprefix + ".zip"
    zippath = os.path.join(env.home, zipname)
    fileutil.zip(zippath, stageDir, zipprefix + '/')
예제 #14
0
def zip():
  zipname = "sedona_community-" + env.buildVersion() + ".zip"
  zippath  = os.path.join(env.home, zipname)
  fileutil.zip(zippath, stageDir)