setools.mk 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. ################################################################################
  2. #
  3. # setools
  4. #
  5. ################################################################################
  6. SETOOLS_VERSION = 3.3.8
  7. SETOOLS_SOURCE = setools-$(SETOOLS_VERSION).tar.bz2
  8. SETOOLS_SITE = https://raw.githubusercontent.com/wiki/TresysTechnology/setools3/files/dists/setools-$(SETOOLS_VERSION)/
  9. SETOOLS_DEPENDENCIES = libselinux libsepol sqlite libxml2 bzip2 host-bison
  10. SETOOLS_INSTALL_STAGING = YES
  11. SETOOLS_LICENSE = GPLv2+ LGPLv2.1+
  12. SETOOLS_LICENSE_FILES = COPYING COPYING.GPL COPYING.LGPL
  13. # configure.ac is patched by the cross compile patch,
  14. # so autoreconf is necessary
  15. SETOOLS_AUTORECONF = YES
  16. # Notes: Need "disable-selinux-check" so the configure does not check to see
  17. # if host has selinux enabled.
  18. # No python support as only the libraries and commandline tools are
  19. # installed on target
  20. SETOOLS_CONF_OPTS = \
  21. --disable-debug \
  22. --disable-gui \
  23. --disable-bwidget-check \
  24. --disable-selinux-check \
  25. --disable-swig-java \
  26. --disable-swig-python \
  27. --disable-swig-tcl \
  28. --with-sepol-devel="$(STAGING_DIR)/usr" \
  29. --with-selinux-devel="$(STAGING_DIR)/usr"
  30. HOST_SETOOLS_DEPENDENCIES = host-libselinux host-libsepol host-sqlite \
  31. host-libxml2 host-bzip2 host-bison
  32. ifeq ($(BR2_PACKAGE_PYTHON3),y)
  33. HOST_SETOOLS_PYTHON_VERSION=$(PYTHON3_VERSION_MAJOR)
  34. HOST_SETOOLS_DEPENDENCIES += host-python3
  35. HOST_SETOOLS_CONF_ENV += am_cv_python_version=$(PYTHON3_VERSION)
  36. else
  37. HOST_SETOOLS_PYTHON_VERSION=$(PYTHON_VERSION_MAJOR)
  38. HOST_SETOOLS_DEPENDENCIES += host-python
  39. HOST_SETOOLS_CONF_ENV += am_cv_python_version=$(PYTHON_VERSION)
  40. endif
  41. HOST_SETOOLS_PYTHON_SITE_PACKAGES = $(HOST_DIR)/usr/lib/python$(HOST_SETOOLS_PYTHON_VERSION)/site-packages
  42. HOST_SETOOLS_PYTHON_INCLUDES = $(HOST_DIR)/usr/include/python$(HOST_SETOOLS_PYTHON_VERSION)
  43. HOST_SETOOLS_PYTHON_LIB = -lpython$(HOST_SETOOLS_PYTHON_VERSION)
  44. # Notes: Need "disable-selinux-check" so the configure does not check to see
  45. # if host has selinux enabled.
  46. # Host builds with python support to enable tools for offline target
  47. # policy analysis
  48. HOST_SETOOLS_CONF_OPTS = \
  49. --disable-debug \
  50. --disable-gui \
  51. --disable-bwidget-check \
  52. --disable-selinux-check \
  53. --disable-swig-java \
  54. --disable-swig-python \
  55. --disable-swig-tcl \
  56. --with-sepol-devel="$(HOST_DIR)/usr" \
  57. --with-selinux-devel="$(HOST_DIR)/usr" \
  58. PYTHON_LDFLAGS="-L$(HOST_DIR)/usr/lib/" \
  59. PYTHON_CPPFLAGS="-I$(HOST_SETOOLS_PYTHON_INCLUDES)" \
  60. PYTHON_SITE_PKG="$(HOST_SETOOLS_PYTHON_SITE_PACKAGES)" \
  61. PYTHON_EXTRA_LIBS="-lpthread -ldl -lutil $(HOST_SETOOLS_PYTHON_LIB)"
  62. HOST_SETOOLS_CONF_ENV += \
  63. am_cv_pathless_PYTHON=python \
  64. ac_cv_path_PYTHON=$(HOST_DIR)/usr/bin/python \
  65. am_cv_python_platform=linux2 \
  66. am_cv_python_version=$(HOST_SETOOLS_PYTHON_VERSION) \
  67. am_cv_python_pythondir=$(HOST_SETOOLS_PYTHON_SITE_PACKAGES) \
  68. am_cv_python_pyexecdir=$(HOST_SETOOLS_PYTHON_SITE_PACKAGES) \
  69. am_cv_python_includes=-I$(HOST_SETOOLS_PYTHON_INCLUDES)
  70. $(eval $(autotools-package))
  71. $(eval $(host-autotools-package))