SConscript 3.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. #-*- encoding: utf-8 -*-
  2. #---------------------------------------------------------------------------------
  3. # @File: Sconscript for Package
  4. # @Author: Copyright (c) 2018-2019, liu2guang 1004383796@qq.com
  5. #---------------------------------------------------------------------------------
  6. import os
  7. from building import *
  8. Import('RTT_ROOT')
  9. Import('rtconfig')
  10. #---------------------------------------------------------------------------------
  11. # Package configuration
  12. #---------------------------------------------------------------------------------
  13. PKGNAME = "curl"
  14. DEPENDS = ["PKG_USING_LIBCURL2RTT"]
  15. #---------------------------------------------------------------------------------
  16. # Compile the configuration
  17. #---------------------------------------------------------------------------------
  18. SOURCES = Glob("curl*/lib/*.c") + \
  19. Glob("curl*/lib/vauth/*.c") + \
  20. Glob("curl*/lib/vquic/*.c") + \
  21. Glob("curl*/lib/vssh/*.c") + \
  22. Glob("curl*/lib/vtls/*.c") + \
  23. Glob("curl*/src/*.c")
  24. LOCAL_CPPPATH = []
  25. LOCAL_CCFLAGS = ""
  26. LOCAL_ASFLAGS = ""
  27. CPPPATH = [os.path.join(GetCurrentDir(), '.'),
  28. os.path.join(GetCurrentDir(), 'curl_v7.67.0/lib'),
  29. os.path.join(GetCurrentDir(), 'curl_v7.67.0/include')]
  30. CCFLAGS = ""
  31. ASFLAGS = ""
  32. CPPDEFINES = ["HAVE_CONFIG_H", "BUILDING_LIBCURL"]
  33. LOCAL_CPPDEFINES = []
  34. LIBS = []
  35. LIBPATH = [GetCurrentDir()]
  36. LINKFLAGS = ""
  37. #---------------------------------------------------------------------------------
  38. # Feature clip configuration, optional
  39. #---------------------------------------------------------------------------------
  40. #---------------------------------------------------------------------------------
  41. # Compiler platform configuration, optional
  42. #---------------------------------------------------------------------------------
  43. if rtconfig.CROSS_TOOL == "gcc":
  44. LOCAL_CCFLAGS += ' -std=gnu99 -Ofast -w'
  45. if rtconfig.CROSS_TOOL == "iar":
  46. print("Warning: No iar platform was tested!!!")
  47. if rtconfig.CROSS_TOOL == "keil":
  48. LOCAL_CCFLAGS += ' --gnu -W --diag_suppress=870'
  49. #---------------------------------------------------------------------------------
  50. # System variables
  51. #---------------------------------------------------------------------------------
  52. objs = []
  53. root = GetCurrentDir()
  54. #---------------------------------------------------------------------------------
  55. # Sub target
  56. #---------------------------------------------------------------------------------
  57. list = os.listdir(root)
  58. if GetDepend(DEPENDS):
  59. for d in list:
  60. path = os.path.join(root, d)
  61. if os.path.isfile(os.path.join(path, 'SConscript')):
  62. objs = objs + SConscript(os.path.join(d, 'SConscript'))
  63. #---------------------------------------------------------------------------------
  64. # Main target
  65. #---------------------------------------------------------------------------------
  66. objs += DefineGroup(name = PKGNAME, src = SOURCES, depend = DEPENDS,
  67. CPPPATH = CPPPATH,
  68. CCFLAGS = CCFLAGS,
  69. ASFLAGS = ASFLAGS,
  70. LOCAL_CPPPATH = LOCAL_CPPPATH,
  71. LOCAL_CCFLAGS = LOCAL_CCFLAGS,
  72. LOCAL_ASFLAGS = LOCAL_ASFLAGS,
  73. CPPDEFINES = CPPDEFINES,
  74. LOCAL_CPPDEFINES = LOCAL_CPPDEFINES,
  75. LIBS = LIBS,
  76. LIBPATH = LIBPATH,
  77. LINKFLAGS = LINKFLAGS)
  78. Return("objs")
  79. #---------------------------------------------------------------------------------
  80. # End
  81. #---------------------------------------------------------------------------------