SConscript.svn-base
上传用户:market2
上传日期:2018-11-18
资源大小:18786k
文件大小:4k
源码类别:

外挂编程

开发平台:

Windows_Unix

  1. # -*-python-*-
  2. Import('*')
  3. import os.path
  4. import copy
  5. ############### OpenKore Standard Library ###############
  6. #osl_objects = env.StaticObject(Split('''
  7. #OSL/Object.cpp
  8. #OSL/Exception.cpp
  9. #OSL/Pointer.cpp
  10. #OSL/Net/Socket.cpp
  11. #OSL/Net/ServerSocket.cpp
  12. #OSL/Threading/Runnable.cpp
  13. #OSL/Threading/MutexLocker.cpp
  14. #OSL/Threading/Atomic.cpp
  15. #OSL/Threading/Mutex.cpp
  16. #OSL/Threading/Thread.cpp
  17. #OSL/IO/OutputStream.cpp
  18. #OSL/IO/InputStream.cpp
  19. #OSL/IO/IOException.cpp
  20. #OSL/IO/BufferedOutputStream.cpp
  21. #'''))
  22. if win32:
  23. osl_libs = ['ws2_32']
  24. else:
  25. osl_libs = ['pthread']
  26. if platform == "sunos":
  27. osl_libs += ['socket', 'nsl']
  28. #env.Program('OSL/test/unit/run-tests', Split('''
  29. #OSL/test/unit/main.cpp
  30. #OSL/test/unit/AtomicTest.cpp
  31. #OSL/test/unit/ObjectTest.cpp
  32. #OSL/test/unit/ExceptionTest.cpp
  33. #OSL/test/unit/PointerTest.cpp
  34. #''') + osl_objects,
  35. #LIBS = osl_libs)
  36. ############### Define sources ###############
  37. # C/C++ source files
  38. sources = []
  39. # XS source files (input : output)
  40. XS_sources = {}
  41. ### Pathfinding
  42. sources += [
  43. 'PathFinding/algorithm.cpp',
  44. 'PathFinding/PathFinding.xs.cpp'
  45. ]
  46. XS_sources['PathFinding/PathFinding.xs'] = 'PathFinding/PathFinding.xs.cpp'
  47. ### Translation
  48. sources += [
  49. 'Translation/filereader.cpp',
  50. 'Translation/translator.cpp',
  51. 'Translation/utils.cpp',
  52. 'Translation/Translation.xs.cpp'
  53. ]
  54. if win32:
  55. sources += ['Translation/winfilereader.cpp']
  56. else:
  57. sources += ['Translation/unixfilereader.cpp']
  58. XS_sources['Translation/Translation.xs'] = 'Translation/Translation.xs.cpp'
  59. ### Unix
  60. if not win32:
  61. sources += [
  62. 'unix/unix.cpp',
  63. 'unix/consoleui.cpp'
  64. ]
  65. XS_sources['unix/unix.xs'] = 'unix/unix.cpp';
  66. perlenv.Depends('unix/unix.cpp', ['unix/consoleui-perl.xs', 'unix/consoleui.h'])
  67. ## Win32
  68. if win32:
  69. sources += [
  70. 'win32/utils.cpp',
  71. 'win32/wrapper.c'
  72. ]
  73. XS_sources['win32/wrapper.xs'] = 'win32/wrapper.c'
  74. ## Utils
  75. sources += [
  76. 'utils/http-reader.cpp',
  77. 'utils/std-http-reader.cpp',
  78. 'utils/mirror-http-reader.cpp',
  79. 'utils/c-bindings/http-reader.cpp',
  80. 'utils/perl/HttpReader.cpp',
  81. 'utils/whirlpool-algorithm.c',
  82. 'utils/perl/Whirlpool.c',
  83. 'utils/rijndael-alg-fst.c',
  84. 'utils/rijndael-api-fst.c',
  85. 'utils/aes-cfb.c',
  86. 'utils/perl/Benchmark.cpp'
  87. ]
  88. XS_sources['utils/perl/Benchmark.xs'] = 'utils/perl/Benchmark.cpp'
  89. XS_sources['utils/perl/HttpReader.xs'] = 'utils/perl/HttpReader.cpp'
  90. XS_sources['utils/perl/Whirlpool.xs'] = 'utils/perl/Whirlpool.c'
  91. if not win32:
  92. perlenv.ParseConfig('curl-config --cflags --libs')
  93. ### Padded packets
  94. sources += [
  95. 'PaddedPackets/Algorithms/cast.c',
  96. 'PaddedPackets/Algorithms/feal8.c',
  97. 'PaddedPackets/Algorithms/mcg_cipher.c',
  98. 'PaddedPackets/Algorithms/misty1.c',
  99. 'PaddedPackets/Algorithms/rmd128.c',
  100. 'PaddedPackets/Algorithms/safer.c',
  101. 'PaddedPackets/Algorithms/seal.c',
  102. 'PaddedPackets/Algorithms/snefru.c',
  103. 'PaddedPackets/Algorithms/tiger.c',
  104. 'PaddedPackets/Algorithms/turtle.c',
  105. 'PaddedPackets/Algorithms/algorithms.cpp',
  106. 'PaddedPackets/block.cpp',
  107. 'PaddedPackets/engine.cpp',
  108. 'PaddedPackets/PaddedPackets.xs.cpp',
  109. ]
  110. XS_sources['PaddedPackets/PaddedPackets.xs'] = 'PaddedPackets/PaddedPackets.xs.cpp'
  111. ### Misc
  112. sources += [
  113. 'misc/misc.c',
  114. 'misc/fastutils.cpp'
  115. ]
  116. XS_sources['misc/misc.xs'] = 'misc/misc.c'
  117. XS_sources['misc/fastutils.xs'] = 'misc/fastutils.cpp'
  118. ###################################################
  119. for input, output in XS_sources.iteritems():
  120. perlenv.XS(output, input)
  121. ############### XSTools ###############
  122. # External library dependencies
  123. deps = copy.copy(osl_libs)
  124. deps_path = []
  125. if not win32:
  126. deps += [READLINE_LIB]
  127. if have_ncurses:
  128. deps += ['ncurses']
  129. else:
  130. deps += ['termcap']
  131. deps_path += ['/usr/lib/termcap']
  132. else:
  133. deps += ['winmm', 'wininet']
  134. perlenv['LIBS'] += deps
  135. perlenv['LIBPATH'] += deps_path
  136. # We're linking C++ objects so force usage of g++
  137. XSTools = perlenv.NativeDLL('XSTools', sources, CC = 'g++')
  138. if not win32 and not darwin:
  139. # Perl expects XSTools.so, not libXSTools.so, so create symlink.
  140. perlenv.Command('XSTools.so', XSTools,
  141. [['ln', '-sf', 'libXSTools.so', 'XSTools.so']],
  142. chdir=1)
  143. ############### NetRedirect.dll ###############
  144. if win32:
  145. sources = [
  146. 'win32/netredirect.cpp',
  147. 'win32/utils-netredirect.cpp'
  148. ]
  149. libenv.NativeDLL('NetRedirect', sources,
  150. CC = 'g++',
  151. LIBS = ['ws2_32'])