SConscript 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. # SConscript file for hpatchlite-wrapper package
  2. from building import *
  3. import os
  4. # Get the absolute path of the current SConscript file
  5. cwd = GetCurrentDir()
  6. # --- Source Files ---
  7. # Add all necessary source files for the build.
  8. # We only need the core hpatch_lite implementation and the selected decompressor.
  9. src = []
  10. src += Glob('hpatch_impl.c')
  11. src += Glob('HPatchLite/decompresser/tinyuz/tuz_dec.c')
  12. src += Glob('HPatchLite/HDiffPatch/libHDiffPatch/HPatchLite/hpatch_lite.c')
  13. # --- Include Paths ---
  14. # Add all necessary include paths for the compiler.
  15. # This ensures that #include directives can find the required header files.
  16. inc = []
  17. inc.append(cwd)
  18. # Since HPatchLite is a submodule, all its internal paths are relative to its root.
  19. hpatchlite_root = os.path.join(cwd, 'HPatchLite')
  20. inc.append(hpatchlite_root)
  21. inc.append(os.path.join(hpatchlite_root, 'HDiffPatch/libHDiffPatch/HPatchLite'))
  22. inc.append(os.path.join(hpatchlite_root, 'HDiffPatch/libHDiffPatch/HPatch'))
  23. # Add decompressor source files only if they are enabled in the configuration.
  24. if GetDepend(['PKG_HPATCHLITE_DECOMPRESSER_TUZ']):
  25. src += Glob('HPatchLite/tinyuz/decompress/tuz_dec.c')
  26. inc.append(os.path.join(hpatchlite_root, 'tinyuz/decompress'))
  27. # --- Define the Component Group ---
  28. # Define a group named 'hpatchlite' that will be added to the build system.
  29. # This group will only be compiled if the Kconfig option 'PKG_USING_HPATCHLITE' is enabled.
  30. group = DefineGroup('hpatchlite-wrapper', src, depend=['PKG_USING_HPATCHLITE'], CPPPATH=inc)
  31. # Return the defined group to the build system
  32. Return('group')