board/csky: fixup gdb instructions in readme.txt
[buildroot-gz.git] / package / nut / nut.mk
blob7136e834cca8b9b076613a506e311fbe33939192
1 ################################################################################
3 # nut
5 ################################################################################
7 NUT_VERSION_MAJOR = 2.7
8 NUT_VERSION = $(NUT_VERSION_MAJOR).4
9 NUT_SITE = http://www.networkupstools.org/source/$(NUT_VERSION_MAJOR)
10 NUT_LICENSE = GPLv2+, GPLv3+ (python scripts), GPL/Artistic (perl client)
11 NUT_LICENSE_FILES = COPYING LICENSE-GPL2 LICENSE-GPL3
12 NUT_DEPENDENCIES = host-pkgconf
14 # Our patch changes m4 macros, so we need to autoreconf
15 NUT_AUTORECONF = YES
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 --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
28 ifeq ($(call qstrip,$(BR2_PACKAGE_NUT_DRIVERS)),)
29 NUT_CONF_OPTS += --with-drivers=all
30 else
31 NUT_CONF_OPTS += --with-drivers=$(BR2_PACKAGE_NUT_DRIVERS)
32 endif
34 ifeq ($(BR2_PACKAGE_AVAHI)$(BR2_PACKAGE_DBUS),yy)
35 NUT_DEPENDENCIES += avahi dbus
36 NUT_CONF_OPTS += --with-avahi
37 else
38 NUT_CONF_OPTS += --without-avahi
39 endif
41 # gd with support for png is required for the CGI
42 ifeq ($(BR2_PACKAGE_GD)$(BR2_PACKAGE_LIBPNG),yy)
43 NUT_DEPENDENCIES += gd libpng
44 NUT_CONF_OPTS += \
45 --with-cgi \
46 --with-gdlib-config=$(STAGING_DIR)/usr/bin/gdlib-config
47 else
48 NUT_CONF_OPTS += --without-cgi
49 endif
51 # nut-scanner needs libltdl, which is a wrapper arounf dlopen/dlsym,
52 # so is not available for static-only builds.
53 # There is no flag to directly enable/disable nut-scanner, it's done
54 # via the --enable/disable-libltdl flag.
55 ifeq ($(BR2_STATIC_LIBS):$(BR2_PACKAGE_LIBTOOL),:y)
56 NUT_DEPENDENCIES += libtool
57 NUT_CONF_OPTS += --with-libltdl
58 else
59 NUT_CONF_OPTS += --without-libltdl
60 endif
62 ifeq ($(BR2_PACKAGE_LIBUSB_COMPAT),y)
63 NUT_DEPENDENCIES += libusb-compat
64 NUT_CONF_OPTS += --with-usb
65 else
66 NUT_CONF_OPTS += --without-usb
67 endif
69 ifeq ($(BR2_PACKAGE_NEON_EXPAT)$(BR2_PACKAGE_NEON_LIBXML2),y)
70 NUT_DEPENDENCIES += neon
71 NUT_CONF_OPTS += --with-neon
72 else
73 NUT_CONF_OPTS += --without-neon
74 endif
76 ifeq ($(BR2_PACKAGE_NETSNMP),y)
77 NUT_DEPENDENCIES += netsnmp
78 NUT_CONF_OPTS += \
79 --with-snmp \
80 --with-net-snmp-config=$(STAGING_DIR)/usr/bin/net-snmp-config
81 else
82 NUT_CONF_OPTS += --without-snmp
83 endif
85 ifeq ($(BR2_PACKAGE_OPENSSL),y)
86 NUT_DEPENDENCIES += openssl
87 NUT_CONF_OPTS += --with-ssl
88 else
89 NUT_CONF_OPTS += --without-ssl
90 endif
92 $(eval $(autotools-package))