Blame view

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