summaryrefslogtreecommitdiffstats
path: root/patches/udev-158/udev-150-split-extras.diff
blob: 28350f5f7eb222e9a179eaff08d2492ee5aae96d (plain)
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
From: Michael Olbrich <m.olbrich@pengutronix.de>
Subject: split enabling extras with dependencies

This patch patch makes it possible to enable all extras with external
dependencies individually. It replaces:
	--disable-extras
with
	--disable-gudev
	--disable-bluetooth
	--disable-keymap
	--disable-acl
	--disable-usbdb
	--disable-pcidb
	--disable-modem-modeswitch
as configure options

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>

---
 Makefile.am  |   25 +++++++++++++++++++++----
 configure.ac |   59 ++++++++++++++++++++++++++++++++++++++++++++++++++---------
 2 files changed, 71 insertions(+), 13 deletions(-)

Index: b/Makefile.am
===================================================================
--- a/Makefile.am
+++ b/Makefile.am
@@ -284,7 +284,8 @@ extras_v4l_id_v4l_id_LDADD = libudev/lib
 libexec_PROGRAMS += extras/v4l_id/v4l_id
 dist_udevrules_DATA += extras/v4l_id/60-persistent-v4l.rules
 
-if ENABLE_EXTRAS
+if ENABLE_USBDB
+if ENABLE_PCIDB
 # ------------------------------------------------------------------------------
 # conditional extras (need glib, libusb, libacl, ...)
 # ------------------------------------------------------------------------------
@@ -292,7 +293,12 @@ dist_udevrules_DATA += \
 	rules/rules.d/75-net-description.rules \
 	rules/rules.d/75-tty-description.rules \
 	rules/rules.d/78-sound-card.rules
+endif # ENABLE_PCIDB
+endif # ENABLE_USBDB
 
+BUILT_SOURCES =
+
+if ENABLE_GUDEV
 # ------------------------------------------------------------------------------
 # GUdev - libudev gobject interface
 # ------------------------------------------------------------------------------
@@ -330,7 +336,7 @@ dist_extras_gudev_libgudev_1_0_la_SOURCE
 	extras/gudev/gudevmarshal.c \
 	extras/gudev/gudevenumtypes.h \
 	extras/gudev/gudevenumtypes.c
-BUILT_SOURCES = $(dist_extras_gudev_libgudev_1_0_la_SOURCES)
+BUILT_SOURCES += $(dist_extras_gudev_libgudev_1_0_la_SOURCES)
 
 extras_gudev_libgudev_1_0_la_CPPFLAGS = \
 	$(AM_CPPFLAGS) \
@@ -407,7 +413,9 @@ typelibs_DATA = extras/gudev/GUdev-1.0.t
 
 CLEANFILES += $(gir_DATA) $(typelibs_DATA)
 endif # ENABLE_INTROSPECTION
+endif # ENABLE_GUDEV
 
+if ENABLE_BLUETOOTH
 # ------------------------------------------------------------------------------
 # Bluetooth HID devices with special magic to switch the device
 # ------------------------------------------------------------------------------
@@ -416,7 +424,9 @@ extras_hid2hci_hid2hci_CPPFLAGS = $(AM_C
 extras_hid2hci_hid2hci_LDADD = libudev/libudev-private.la $(LIBUSB_LIBS)
 dist_udevrules_DATA += extras/hid2hci/70-hid2hci.rules
 libexec_PROGRAMS += extras/hid2hci/hid2hci
+endif # ENABLE_BLUETOOTH
 
+if ENABLE_ACL
 # ------------------------------------------------------------------------------
 # udev_acl - apply ACLs for users with local forground sessions
 # ------------------------------------------------------------------------------
@@ -431,7 +441,9 @@ udevacl-install-hook:
 	ln -sf $(libexecdir)/udev-acl $(DESTDIR)$(prefix)/lib/ConsoleKit/run-seat.d/udev-acl.ck
 
 INSTALL_EXEC_HOOKS += udevacl-install-hook
+endif # ENABLE_ACL
 
+if ENABLE_USBDB
 # ------------------------------------------------------------------------------
 # usb-db - read USB vendor/device string database
 # ------------------------------------------------------------------------------
@@ -439,7 +451,9 @@ extras_usb_db_usb_db_SOURCES = extras/us
 extras_usb_db_usb_db_CPPFLAGS = $(AM_CPPFLAGS) -DUSB_DATABASE=\"$(USB_DATABASE)\" -DBUILD_FOR_USB
 extras_usb_db_usb_db_LDADD = libudev/libudev-private.la
 libexec_PROGRAMS += extras/usb-db/usb-db
+endif # ENABLE_USBDB
 
+if ENABLE_PCIDB
 # ------------------------------------------------------------------------------
 # pci-db - read PCI vendor/device string database
 # ------------------------------------------------------------------------------
@@ -447,7 +461,9 @@ extras_usb_db_pci_db_SOURCES = extras/us
 extras_usb_db_pci_db_CPPFLAGS = $(AM_CPPFLAGS) -DPCI_DATABASE=\"$(PCI_DATABASE)\" -DBUILD_FOR_PCI
 extras_usb_db_pci_db_LDADD = libudev/libudev-private.la
 libexec_PROGRAMS += extras/usb-db/pci-db
+endif # ENABLE_PCIDB
 
+if ENABLE_MOBILE_ACTION_MODESWITCH
 # ------------------------------------------------------------------------------
 # mobile-action-modeswitch - switch Mobile Action cables into serial mode
 # ------------------------------------------------------------------------------
@@ -464,7 +480,9 @@ dist_udevrules_DATA += \
 	extras/mobile-action-modeswitch/61-mobile-action.rules
 
 libexec_PROGRAMS += extras/mobile-action-modeswitch/mobile-action-modeswitch
+endif # ENABLE_MOBILE_ACTION_MODESWITCH
 
+if ENABLE_KEYMAP
 # ------------------------------------------------------------------------------
 # mtd_probe - autoloads FTL module for mtd devices
 # ------------------------------------------------------------------------------
@@ -574,8 +592,7 @@ extras/keymap/keys-to-name.h: extras/key
 keymaps-distcheck-hook: extras/keymap/keys.txt
 	$(top_srcdir)/extras/keymap/check-keymaps.sh $(top_srcdir) $^
 DISTCHECK_HOOKS = keymaps-distcheck-hook
-
-endif # ENABLE_EXTRAS
+endif # ENABLE_KEYMAP
 
 # ------------------------------------------------------------------------------
 # install, uninstall, clean hooks
Index: b/configure.ac
===================================================================
--- a/configure.ac
+++ b/configure.ac
@@ -64,29 +64,68 @@ done
 IFS=$OLD_IFS
 AC_SUBST([FIRMWARE_PATH], [$FIRMWARE_PATH])
 
-AC_ARG_ENABLE([extras],
-	AS_HELP_STRING([--disable-extras], [disable extras with external dependencies]),
-	[], [enable_extras=yes])
-if test "x$enable_extras" = xyes; then
+AC_ARG_ENABLE([gudev],
+	AS_HELP_STRING([--disable-gudev], [disable libgudev - libudev gobject interface]),
+	[], [enable_gudev=yes])
+AM_CONDITIONAL([ENABLE_GUDEV], [test "x$enable_gudev" = xyes])
+AC_ARG_ENABLE([bluetooth],
+	AS_HELP_STRING([--disable-bluetooth], [disable Bluetooth HID devices with special magic to switch the device]),
+	[], [enable_bluetooth=yes])
+AM_CONDITIONAL([ENABLE_BLUETOOTH], [test "x$enable_bluetooth" = xyes])
+AC_ARG_ENABLE([keymap],
+	AS_HELP_STRING([--disable-keymap], [disable keymap - map custom hardware's multimedia keys]),
+	[], [enable_keymap=yes])
+AM_CONDITIONAL([ENABLE_KEYMAP], [test "x$enable_keymap" = xyes])
+AC_ARG_ENABLE([acl],
+	AS_HELP_STRING([--disable-acl], [disable udev_acl - apply ACLs for users with local forground sessions]),
+	[], [enable_acl=yes])
+AM_CONDITIONAL([ENABLE_ACL], [test "x$enable_acl" = xyes])
+AC_ARG_ENABLE([usbdb],
+	AS_HELP_STRING([--disable-usbdb], [disable usb-db - read USB vendor/device string database]),
+	[], [enable_usbdb=yes])
+AM_CONDITIONAL([ENABLE_USBDB], [test "x$enable_usbdb" = xyes])
+AC_ARG_ENABLE([pcidb],
+	AS_HELP_STRING([--disable-pcidb], [disable pci-db - read PCI vendor/device string database]),
+	[], [enable_pcidb=yes])
+AM_CONDITIONAL([ENABLE_PCIDB], [test "x$enable_pcidb" = xyes])
+AC_ARG_ENABLE([mobile-action-modeswitch],
+	AS_HELP_STRING([--disable-mobile-action-modeswitch], [disable mobile-action-modeswitch - switch Mobile Action cables into serial mode]),
+	[], [enable_mobile_action_modeswitch=yes])
+AM_CONDITIONAL([ENABLE_MOBILE_ACTION_MODESWITCH], [test "x$enable_mobile_action_modeswitch" = xyes])
+
+if test "x$enable_keymap" = xyes; then
 	AC_PATH_PROG([GPERF], [gperf])
 	if test -z "$GPERF"; then
 		AC_MSG_ERROR([gperf is needed])
 	fi
 
+	AC_CHECK_HEADER([linux/input.h], [:], AC_MSG_ERROR([kernel headers not found]))
+	AC_SUBST([INCLUDE_PREFIX], [$(echo '#include <linux/input.h>' | eval $ac_cpp -E - | sed -n '/linux\/input.h/ {s:.*"\(.*\)/linux/input.h".*:\1:; p; q}')])
+fi
+
+if test "x$enable_gudev" = xyes -o "x$enable_acl" = xyes; then
 	PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.7.0 gobject-2.0 >= 2.7.0])
 	AC_SUBST([GLIB_CFLAGS])
 	AC_SUBST([GLIB_LIBS])
+fi
 
+if test "x$enable_acl" = xyes; then
 	AC_CHECK_LIB([acl], [acl_init], [:], AC_MSG_ERROR([libacl not found]))
 	AC_CHECK_HEADER([acl/libacl.h], [:], AC_MSG_ERROR([libacl header not found]))
+fi
 
+if test "x$enable_bluetooth" = xyes -o "x$enable_mobile_action_modeswitch" = xyes; then
 	PKG_CHECK_MODULES(LIBUSB, libusb >= 0.1.12)
 	AC_SUBST(LIBUSB_CFLAGS)
 	AC_SUBST(LIBUSB_LIBS)
+fi
 
+if test "x$enable_usbdb" = xyes; then
 	PKG_CHECK_MODULES(USBUTILS, usbutils >= 0.82)
 	AC_SUBST([USB_DATABASE], [$($PKG_CONFIG --variable=usbids usbutils)])
+fi
 
+if test "x$enable_pcidb" = xyes; then
 	if test "x$cross_compiling" = "xno" ; then
 		AC_CHECK_FILES([/usr/share/pci.ids], [pciids=/usr/share/pci.ids])
 		AC_CHECK_FILES([/usr/share/hwdata/pci.ids], [pciids=/usr/share/hwdata/pci.ids])
@@ -103,11 +142,9 @@ if test "x$enable_extras" = xyes; then
 	AC_MSG_CHECKING([for PCI database location])
 	AC_MSG_RESULT([$PCI_DATABASE])
 	AC_SUBST(PCI_DATABASE)
-
-	AC_CHECK_HEADER([linux/input.h], [:], AC_MSG_ERROR([kernel headers not found]))
-	AC_SUBST([INCLUDE_PREFIX], [$(echo '#include <linux/input.h>' | eval $ac_cpp -E - | sed -n '/linux\/input.h/ {s:.*"\(.*\)/linux/input.h".*:\1:; p; q}')])
+else
+	PCI_DATABASE=no
 fi
-AM_CONDITIONAL([ENABLE_EXTRAS], [test "x$enable_extras" = xyes])
 
 AC_ARG_ENABLE([introspection],
 	AS_HELP_STRING([--disable-introspection], [disable GObject introspection]),
@@ -161,7 +198,11 @@ AC_MSG_RESULT([
 	cflags:			${CFLAGS}
 	ldflags:		${LDFLAGS}
 
-	extras:			${enable_extras}
+	gudev:			${enable_gudev}
+	bluetooth:		${enable_bluetooth}
+	keymap:			${enable_keymap}
+	acl:			${enable_acl}
+	mobile-action-modeswitch:	${enable_mobile_action_modeswitch}
 	gintrospection:		${enable_introspection}
 
 	usb.ids:		${USB_DATABASE}