nut.mk 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. ################################################################################
  2. #
  3. # nut
  4. #
  5. ################################################################################
  6. NUT_VERSION_MAJOR = 2.7
  7. NUT_VERSION = $(NUT_VERSION_MAJOR).4
  8. NUT_SITE = http://www.networkupstools.org/source/$(NUT_VERSION_MAJOR)
  9. NUT_LICENSE = GPL-2.0+, GPL-3.0+ (python scripts), GPL/Artistic (perl client)
  10. NUT_LICENSE_FILES = COPYING LICENSE-GPL2 LICENSE-GPL3
  11. NUT_INSTALL_STAGING = YES
  12. NUT_DEPENDENCIES = host-pkgconf
  13. # Our patch changes m4 macros, so we need to autoreconf
  14. NUT_AUTORECONF = YES
  15. # Race condition in tools generation
  16. NUT_MAKE = $(MAKE1)
  17. # Put the PID files in a read-write place (/var/run is a tmpfs)
  18. # since the default location (/var/state/ups) maybe readonly.
  19. NUT_CONF_OPTS = \
  20. --with-altpidpath=/var/run/upsd \
  21. --with-dev \
  22. --without-hal
  23. # For uClibc-based toolchains, nut forgets to link with -lm
  24. ifeq ($(BR2_TOOLCHAIN_USES_UCLIBC),y)
  25. NUT_CONF_ENV += LDFLAGS="$(TARGET_LDFLAGS) -lm"
  26. endif
  27. ifeq ($(call qstrip,$(BR2_PACKAGE_NUT_DRIVERS)),)
  28. NUT_CONF_OPTS += --with-drivers=all
  29. else
  30. NUT_CONF_OPTS += --with-drivers=$(BR2_PACKAGE_NUT_DRIVERS)
  31. endif
  32. ifeq ($(BR2_PACKAGE_AVAHI)$(BR2_PACKAGE_DBUS),yy)
  33. NUT_DEPENDENCIES += avahi dbus
  34. NUT_CONF_OPTS += --with-avahi
  35. else
  36. NUT_CONF_OPTS += --without-avahi
  37. endif
  38. # gd with support for png is required for the CGI
  39. ifeq ($(BR2_PACKAGE_GD)$(BR2_PACKAGE_LIBPNG),yy)
  40. NUT_DEPENDENCIES += gd libpng
  41. NUT_CONF_OPTS += --with-cgi
  42. else
  43. NUT_CONF_OPTS += --without-cgi
  44. endif
  45. # nut-scanner needs libltdl, which is a wrapper arounf dlopen/dlsym,
  46. # so is not available for static-only builds.
  47. # There is no flag to directly enable/disable nut-scanner, it's done
  48. # via the --enable/disable-libltdl flag.
  49. ifeq ($(BR2_STATIC_LIBS):$(BR2_PACKAGE_LIBTOOL),:y)
  50. NUT_DEPENDENCIES += libtool
  51. NUT_CONF_OPTS += --with-libltdl
  52. else
  53. NUT_CONF_OPTS += --without-libltdl
  54. endif
  55. ifeq ($(BR2_PACKAGE_LIBUSB_COMPAT),y)
  56. NUT_DEPENDENCIES += libusb-compat
  57. NUT_CONF_OPTS += --with-usb
  58. else
  59. NUT_CONF_OPTS += --without-usb
  60. endif
  61. ifeq ($(BR2_PACKAGE_NEON_EXPAT)$(BR2_PACKAGE_NEON_LIBXML2),y)
  62. NUT_DEPENDENCIES += neon
  63. NUT_CONF_OPTS += --with-neon
  64. else
  65. NUT_CONF_OPTS += --without-neon
  66. endif
  67. ifeq ($(BR2_PACKAGE_NETSNMP),y)
  68. NUT_DEPENDENCIES += netsnmp
  69. NUT_CONF_OPTS += \
  70. --with-snmp \
  71. --with-net-snmp-config=$(STAGING_DIR)/usr/bin/net-snmp-config
  72. else
  73. NUT_CONF_OPTS += --without-snmp
  74. endif
  75. ifeq ($(BR2_PACKAGE_OPENSSL),y)
  76. NUT_DEPENDENCIES += openssl
  77. NUT_CONF_OPTS += --with-ssl
  78. else
  79. NUT_CONF_OPTS += --without-ssl
  80. endif
  81. $(eval $(autotools-package))