ippcp.parts 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. ############################################################################
  2. # Copyright 2016 Intel Corporation
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. ############################################################################
  16. Import('*')
  17. import os
  18. env.PartVersion("9.0.1")
  19. env.PartName("ippcp")
  20. env.DependsOn([Component('ippcommon')])
  21. ipp_libname = '${PART_SHORT_NAME}'
  22. ipp_src_install_loc = 'epid/src/primitives/${IPP_DIR}/'
  23. env.ExportCPPPATH([AbsDir('sources/ippcp/src/')]) #ippcpepid needs this
  24. #includes to install
  25. install_headers = Pattern(src_dir='include/',
  26. includes=[
  27. 'ippcp.h',
  28. 'ippcpdefs.h',
  29. ],
  30. excludes=[],
  31. recursive=True)
  32. # common headers, for SdkInclude
  33. common_headers = Pattern(src_dir='include/',
  34. includes=['ippdefs.h',
  35. 'ippversion.h',
  36. 'ippcore.h',
  37. 'ippbase.h',
  38. 'ipptypes.h'],
  39. excludes=[],
  40. recursive=True)
  41. #files
  42. ippcp_files = Pattern(src_dir='sources/ippcp/src/',
  43. includes=[
  44. 'pcp*.c',
  45. ],
  46. excludes=[],
  47. recursive=True)
  48. ippdir = ''
  49. #internal ipp includes src/primitives/ipp/
  50. env.Append(CPPPATH=[AbsDir('include/')])
  51. env.Append(CPPPATH=[AbsDir('sources/ippcp/src/')])
  52. #ipp defines
  53. env.Append(CPPDEFINES='_IPP_v50_') #required for all ippcp
  54. env.Append(CPPDEFINES='_IPP_DEBUG') #enable function sanity checking
  55. if 'install_package' in env['MODE']:
  56. # All files at /ext/ipp/source/include
  57. env.InstallTopLevel(install_headers, sub_dir='ext/ipp/include')
  58. src_files = Pattern(src_dir='sources/ippcp/src/',
  59. includes=['*'],
  60. excludes=[''],
  61. recursive=True)
  62. env.InstallTopLevel(src_files, sub_dir='ext/ipp/sources/ippcp/src')
  63. this_file = Pattern(src_dir='.',
  64. includes=['ippcp.parts'],
  65. excludes=[],
  66. recursive=True)
  67. env.InstallTopLevel(this_file, sub_dir='ext/ipp/')
  68. makefile = Pattern(src_dir='./sources/ippcp',
  69. includes=['Makefile'],
  70. excludes=[],
  71. recursive=True)
  72. env.InstallTopLevel(makefile, sub_dir='ext/ipp/sources/ippcp')
  73. else:
  74. all_c_files = ippcp_files.files()
  75. outputs = env.Library(ipp_libname, all_c_files)
  76. env.SdkInclude(install_headers)
  77. env.SdkInclude(common_headers)
  78. if 'use_commercial_ipp' in env['MODE']:
  79. try:
  80. IPPROOT = os.environ['IPPROOT']
  81. except KeyError, e:
  82. env.PrintError("Necessary environment variable not set: ",
  83. e, show_stack=False)
  84. if env['TARGET_PLATFORM']['OS'] == 'win32':
  85. libpre = ''
  86. libpost = '.lib'
  87. IPP_TH_SYMBOL = 'mt'
  88. else:
  89. libpre = 'lib'
  90. libpost = '.a'
  91. IPP_TH_SYMBOL = ''
  92. if env['TARGET_PLATFORM']['ARCH'] == 'x86':
  93. archdir = 'ia32/'
  94. else:
  95. archdir = 'intel64/'
  96. ippcp_libname = libpre + 'ippcp' + IPP_TH_SYMBOL + libpost
  97. ippcore_libname = libpre + 'ippcore' + IPP_TH_SYMBOL + libpost
  98. ipp_dir = IPPROOT + '/lib/' + archdir
  99. env.SdkLib(ipp_dir + ippcp_libname)
  100. env.SdkLib(ipp_dir + ippcore_libname)
  101. else:
  102. env.SdkLib(outputs)
  103. if 'install_lib' in env['MODE']:
  104. env.InstallLib(outputs)