SConstruct 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. """ SCons build recipe for the GPSD project
  2. Important targets:
  3. build - build the software (default)
  4. dist - make distribution tarballs .gz and .xz, plus .zip
  5. zip - make distribution zip
  6. install - install programs, libraries, and manual pages
  7. uninstall - undo an install
  8. check - run regression and unit tests.
  9. audit - run code-auditing tools
  10. testbuild - test-build the code from a tarball
  11. website - refresh the website
  12. release - ship a release
  13. --clean - clean all normal build targets
  14. -c - clean all normal build targets
  15. Setting the DESTDIR environment variable will prefix the install destinations
  16. without changing the --prefix prefix.
  17. Pretty much all this file does is create buildtmp, and call SConscript.
  18. """
  19. # Unfinished items:
  20. # * Coveraging mode: gcc "-coverage" flag requires a hack
  21. # for building the python bindings
  22. # This file is Copyright 2010 by the GPSD project
  23. # SPDX-License-Identifier: BSD-2-clause
  24. #
  25. # This code runs compatibly under Python 2 and 3.x for x >= 2.
  26. # Preserve this property!
  27. from __future__ import print_function
  28. import atexit # for atexit.register()
  29. import os
  30. # gpsd needs Scons version at least 2.3
  31. EnsureSConsVersion(2, 3, 0)
  32. # gpsd needs Python version at least 2.6
  33. EnsurePythonVersion(2, 6)
  34. # package version
  35. gpsd_version = "3.21.1~dev"
  36. # name 'build' is already taken, put stuff in gpsd-$VERSION
  37. # it makes tar simple
  38. variantdir = 'gpsd-' + gpsd_version
  39. # one touch clean!
  40. if GetOption('clean'):
  41. # FIXME: remove .tar.gz, .tar.xz and .zip
  42. atexit.register(lambda: os.system("rm -rf %s" % variantdir))
  43. # Not everything respects this chdir()
  44. SConscriptChdir(1)
  45. SConscript('SConscript',
  46. duplicate=1,
  47. exports=['gpsd_version', 'variantdir'],
  48. must_exit=True,
  49. variant_dir=variantdir,
  50. )
  51. # VariantDir('buildtmp', '.')
  52. # SConscript('buildtmp/SConscript', must_exit=True, duplicate=1)