python-treq: bump to version 16.12.0
[buildroot-gz.git] / package / gpsd / gpsd.mk
blob73067d3b1572c54fe188cc413496cccfe10c58e9
1 ################################################################################
3 # gpsd
5 ################################################################################
7 GPSD_VERSION = 3.16
8 GPSD_SITE = http://download-mirror.savannah.gnu.org/releases/gpsd
9 GPSD_LICENSE = BSD-3c
10 GPSD_LICENSE_FILES = COPYING
11 GPSD_INSTALL_STAGING = YES
13 GPSD_DEPENDENCIES = host-scons host-pkgconf
15 GPSD_LDFLAGS = $(TARGET_LDFLAGS)
16 GPSD_CFLAGS = $(TARGET_CFLAGS)
18 GPSD_SCONS_ENV = $(TARGET_CONFIGURE_OPTS)
20 GPSD_SCONS_OPTS = \
21 arch=$(ARCH)\
22 prefix=/usr\
23 sysroot=$(STAGING_DIR)\
24 strip=no\
25 python=no
27 ifeq ($(BR2_PACKAGE_NCURSES),y)
28 GPSD_DEPENDENCIES += ncurses
29 else
30 GPSD_SCONS_OPTS += ncurses=no
31 endif
33 # Build libgpsmm if we've got C++
34 ifeq ($(BR2_INSTALL_LIBSTDCPP),y)
35 GPSD_LDFLAGS += -lstdc++
36 GPSD_CFLAGS += -std=gnu++98
37 GPSD_CXXFLAGS += -std=gnu++98
38 GPSD_SCONS_OPTS += libgpsmm=yes
39 else
40 GPSD_SCONS_OPTS += libgpsmm=no
41 endif
43 # prevents from triggering GCC ICE
44 # A bug was reported to the gcc bug tracker:
45 # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68485
46 ifeq ($(BR2_microblaze),y)
47 GPSD_CFLAGS += -fno-expensive-optimizations -fno-schedule-insns
48 endif
50 # Enable or disable Qt binding
51 ifeq ($(BR2_PACKAGE_QT_NETWORK),y)
52 GPSD_SCONS_ENV += QMAKE="$(QT_QMAKE)"
53 GPSD_DEPENDENCIES += qt
54 else
55 GPSD_SCONS_OPTS += qt=no
56 endif
58 # If libusb is available build it before so the package can use it
59 ifeq ($(BR2_PACKAGE_LIBUSB),y)
60 GPSD_DEPENDENCIES += libusb
61 else
62 GPSD_SCONS_OPTS += usb=no
63 endif
65 # If bluetooth is available build it before so the package can use it
66 ifeq ($(BR2_PACKAGE_BLUEZ_UTILS),y)
67 GPSD_DEPENDENCIES += bluez_utils
68 else
69 GPSD_SCONS_OPTS += bluez=no
70 endif
72 # If pps-tools is available, build it before so the package can use it
73 # (HAVE_SYS_TIMEPPS_H).
74 ifeq ($(BR2_PACKAGE_PPS_TOOLS),y)
75 GPSD_DEPENDENCIES += pps-tools
76 endif
78 ifeq ($(BR2_PACKAGE_DBUS_GLIB),y)
79 GPSD_SCONS_OPTS += dbus_export=yes
80 GPSD_DEPENDENCIES += dbus-glib
81 endif
83 # Protocol support
84 ifneq ($(BR2_PACKAGE_GPSD_ASHTECH),y)
85 GPSD_SCONS_OPTS += ashtech=no
86 endif
87 ifneq ($(BR2_PACKAGE_GPSD_AIVDM),y)
88 GPSD_SCONS_OPTS += aivdm=no
89 endif
90 ifneq ($(BR2_PACKAGE_GPSD_EARTHMATE),y)
91 GPSD_SCONS_OPTS += earthmate=no
92 endif
93 ifneq ($(BR2_PACKAGE_GPSD_EVERMORE),y)
94 GPSD_SCONS_OPTS += evermore=no
95 endif
96 ifneq ($(BR2_PACKAGE_GPSD_FURY),y)
97 GPSD_SCONS_OPTS += fury=no
98 endif
99 ifneq ($(BR2_PACKAGE_GPSD_FV18),y)
100 GPSD_SCONS_OPTS += fv18=no
101 endif
102 ifneq ($(BR2_PACKAGE_GPSD_GARMIN),y)
103 GPSD_SCONS_OPTS += garmin=no
104 endif
105 ifneq ($(BR2_PACKAGE_GPSD_GARMIN_SIMPLE_TXT),y)
106 GPSD_SCONS_OPTS += garmintxt=no
107 endif
108 ifneq ($(BR2_PACKAGE_GPSD_GEOSTAR),y)
109 GPSD_SCONS_OPTS += geostar=no
110 endif
111 ifneq ($(BR2_PACKAGE_GPSD_GPSCLOCK),y)
112 GPSD_SCONS_OPTS += gpsclock=no
113 endif
114 ifneq ($(BR2_PACKAGE_GPSD_ITRAX),y)
115 GPSD_SCONS_OPTS += itrax=no
116 endif
117 ifneq ($(BR2_PACKAGE_GPSD_MTK3301),y)
118 GPSD_SCONS_OPTS += mtk3301=no
119 endif
120 ifneq ($(BR2_PACKAGE_GPSD_NMEA),y)
121 GPSD_SCONS_OPTS += nmea0183=no
122 endif
123 ifneq ($(BR2_PACKAGE_GPSD_NTRIP),y)
124 GPSD_SCONS_OPTS += ntrip=no
125 endif
126 ifneq ($(BR2_PACKAGE_GPSD_NAVCOM),y)
127 GPSD_SCONS_OPTS += navcom=no
128 endif
129 ifneq ($(BR2_PACKAGE_GPSD_NMEA2000),y)
130 GPSD_SCONS_OPTS += nmea2000=no
131 endif
132 ifneq ($(BR2_PACKAGE_GPSD_OCEANSERVER),y)
133 GPSD_SCONS_OPTS += oceanserver=no
134 endif
135 ifneq ($(BR2_PACKAGE_GPSD_ONCORE),y)
136 GPSD_SCONS_OPTS += oncore=no
137 endif
138 ifneq ($(BR2_PACKAGE_GPSD_RTCM104V2),y)
139 GPSD_SCONS_OPTS += rtcm104v2=no
140 endif
141 ifneq ($(BR2_PACKAGE_GPSD_RTCM104V3),y)
142 GPSD_SCONS_OPTS += rtcm104v3=no
143 endif
144 ifneq ($(BR2_PACKAGE_GPSD_SIRF),y)
145 GPSD_SCONS_OPTS += sirf=no
146 endif
147 ifneq ($(BR2_PACKAGE_GPSD_SUPERSTAR2),y)
148 GPSD_SCONS_OPTS += superstar2=no
149 endif
150 ifneq ($(BR2_PACKAGE_GPSD_TRIMBLE_TSIP),y)
151 GPSD_SCONS_OPTS += tsip=no
152 endif
153 ifneq ($(BR2_PACKAGE_GPSD_TRIPMATE),y)
154 GPSD_SCONS_OPTS += tripmate=no
155 endif
156 ifneq ($(BR2_PACKAGE_GPSD_TRUE_NORTH),y)
157 GPSD_SCONS_OPTS += tnt=no
158 endif
159 ifneq ($(BR2_PACKAGE_GPSD_UBX),y)
160 GPSD_SCONS_OPTS += ublox=no
161 endif
163 # Features
164 ifneq ($(BR2_PACKAGE_GPSD_NTP_SHM),y)
165 GPSD_SCONS_OPTS += ntpshm=no
166 endif
167 ifneq ($(BR2_PACKAGE_GPSD_PPS),y)
168 GPSD_SCONS_OPTS += pps=no
169 endif
170 ifeq ($(BR2_PACKAGE_GPSD_SQUELCH),y)
171 GPSD_SCONS_OPTS += squelch=yes
172 endif
173 ifneq ($(BR2_PACKAGE_GPSD_RECONFIGURE),y)
174 GPSD_SCONS_OPTS += reconfigure=no
175 endif
176 ifneq ($(BR2_PACKAGE_GPSD_CONTROLSEND),y)
177 GPSD_SCONS_OPTS += controlsend=no
178 endif
179 ifneq ($(BR2_PACKAGE_GPSD_OLDSTYLE),y)
180 GPSD_SCONS_OPTS += oldstyle=no
181 endif
182 ifeq ($(BR2_PACKAGE_GPSD_PROFILING),y)
183 GPSD_SCONS_OPTS += profiling=yes
184 endif
185 ifneq ($(BR2_PACKAGE_GPSD_CLIENT_DEBUG),y)
186 GPSD_SCONS_OPTS += clientdebug=no
187 endif
188 ifeq ($(BR2_PACKAGE_GPSD_USER),y)
189 GPSD_SCONS_OPTS += gpsd_user=$(BR2_PACKAGE_GPSD_USER_VALUE)
190 endif
191 ifeq ($(BR2_PACKAGE_GPSD_GROUP),y)
192 GPSD_SCONS_OPTS += gpsd_group=$(BR2_PACKAGE_GPSD_GROUP_VALUE)
193 endif
194 ifeq ($(BR2_PACKAGE_GPSD_FIXED_PORT_SPEED),y)
195 GPSD_SCONS_OPTS += fixed_port_speed=$(BR2_PACKAGE_GPSD_FIXED_PORT_SPEED_VALUE)
196 endif
197 ifeq ($(BR2_PACKAGE_GPSD_MAX_CLIENT),y)
198 GPSD_SCONS_OPTS += limited_max_clients=$(BR2_PACKAGE_GPSD_MAX_CLIENT_VALUE)
199 endif
200 ifeq ($(BR2_PACKAGE_GPSD_MAX_DEV),y)
201 GPSD_SCONS_OPTS += limited_max_devices=$(BR2_PACKAGE_GPSD_MAX_DEV_VALUE)
202 endif
204 GPSD_SCONS_ENV += LDFLAGS="$(GPSD_LDFLAGS)" CFLAGS="$(GPSD_CFLAGS)"
206 define GPSD_BUILD_CMDS
207 (cd $(@D); \
208 $(GPSD_SCONS_ENV) \
209 $(SCONS) \
210 $(GPSD_SCONS_OPTS))
211 endef
213 define GPSD_INSTALL_TARGET_CMDS
214 (cd $(@D); \
215 $(GPSD_SCONS_ENV) \
216 DESTDIR=$(TARGET_DIR) \
217 $(SCONS) \
218 $(GPSD_SCONS_OPTS) \
219 install)
220 endef
222 define GPSD_INSTALL_INIT_SYSV
223 $(INSTALL) -m 0755 -D package/gpsd/S50gpsd $(TARGET_DIR)/etc/init.d/S50gpsd
224 $(SED) 's,^DEVICES=.*,DEVICES=$(BR2_PACKAGE_GPSD_DEVICES),' $(TARGET_DIR)/etc/init.d/S50gpsd
225 endef
227 define GPSD_INSTALL_STAGING_CMDS
228 (cd $(@D); \
229 $(GPSD_SCONS_ENV) \
230 DESTDIR=$(STAGING_DIR) \
231 $(SCONS) \
232 $(GPSD_SCONS_OPTS) \
233 install)
234 endef
236 # After installing the udev rule, make it writable so that this
237 # package can be re-built/re-installed.
238 ifeq ($(BR2_PACKAGE_HAS_UDEV),y)
239 define GPSD_INSTALL_UDEV_RULES
240 (cd $(@D); \
241 $(GPSD_SCONS_ENV) \
242 DESTDIR=$(TARGET_DIR) \
243 $(SCONS) \
244 $(GPSD_SCONS_OPTS) \
245 udev-install)
246 chmod u+w $(TARGET_DIR)/lib/udev/rules.d/25-gpsd.rules
247 endef
249 GPSD_POST_INSTALL_TARGET_HOOKS += GPSD_INSTALL_UDEV_RULES
250 endif
252 $(eval $(generic-package))