All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] split --disable-extras into multiple options
@ 2010-02-11 11:12 Michael Olbrich
  2010-02-13 12:51 ` Martin Pitt
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: Michael Olbrich @ 2010-02-11 11:12 UTC (permalink / raw)
  To: linux-hotplug

Hi,

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.
I need a patch like this for the embedded system I'm working on. I need
gudev for other stuff, but I don't have libacl and some of the other
dependencies.

Any opinions?

Regards,
Michael

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

Index: b/Makefile.am
=================================--- a/Makefile.am
+++ b/Makefile.am
@@ -288,7 +288,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, ...)
 # ------------------------------------------------------------------------------
@@ -296,7 +297,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
 # ------------------------------------------------------------------------------
@@ -334,7 +340,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) \
@@ -410,7 +416,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
 # ------------------------------------------------------------------------------
@@ -419,7 +427,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
 # ------------------------------------------------------------------------------
@@ -434,7 +444,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
 # ------------------------------------------------------------------------------
@@ -442,7 +454,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
 # ------------------------------------------------------------------------------
@@ -450,7 +464,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_MODEM_MODESWITCH
 # ------------------------------------------------------------------------------
 # modem-modeswitch - magic config switch for 3G modems
 # ------------------------------------------------------------------------------
@@ -470,7 +486,9 @@ dist_udevrules_DATA += \
 	extras/modem-modeswitch/61-mobile-action.rules
 
 libexec_PROGRAMS += extras/modem-modeswitch/modem-modeswitch
+endif # ENABLE_MODEM_MODESWITCH
 
+if ENABLE_KEYMAP
 # ------------------------------------------------------------------------------
 # keymap - map custom hardware's multimedia keys
 # ------------------------------------------------------------------------------
@@ -562,8 +580,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
@@ -46,32 +46,70 @@ if test "x$enable_logging" = "xyes"; the
 	AC_DEFINE(ENABLE_LOGGING, [1], [System logging.])
 fi
 
-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([modem-modeswitch],
+	AS_HELP_STRING([--disable-modem-modeswitch], [disable modem-modeswitch - magic config switch for 3G modems]),
+	[], [enable_modem_modeswitch=yes])
+AM_CONDITIONAL([ENABLE_MODEM_MODESWITCH], [test "x$enable_modem_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
+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
 
-	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]))
-
+if test "x$enable_bluetooth" = xyes -o "x$enable_modem_modeswitch" = xyes; then
 	PKG_CHECK_MODULES(LIBUSB, libusb >= 0.1.12)
 	AC_SUBST(LIBUSB_CFLAGS)
 	AC_SUBST(LIBUSB_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_usbdb" = xyes; then
 	PKG_CHECK_MODULES(USBUTILS, usbutils >= 0.82)
 	AC_SUBST([USB_DATABASE], [$($PKG_CONFIG --variable=usbids usbutils)])
+fi
 
-	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])
-	AC_CHECK_FILES([/usr/share/misc/pci.ids], [pciids=/usr/share/misc/pci.ids])
+if test "x$enable_pcidb" = xyes; then
+	if test "x$cross_compiling" != xyes; 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])
+		AC_CHECK_FILES([/usr/share/misc/pci.ids], [pciids=/usr/share/misc/pci.ids])
+	fi
 	AC_ARG_WITH(pci-ids-path,
 		AS_HELP_STRING([--pci-ids-path=DIR], [Path to pci.ids file]),
 		[PCI_DATABASE=${withval}],
@@ -82,7 +120,6 @@ if test "x$enable_extras" = xyes; then
 		fi])
 	AC_SUBST(PCI_DATABASE)
 fi
-AM_CONDITIONAL([ENABLE_EXTRAS], [test "x$enable_extras" = xyes])
 
 AC_ARG_ENABLE([introspection],
 	AS_HELP_STRING([--disable-introspection], [disable GObject introspection]),

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] split --disable-extras into multiple options
  2010-02-11 11:12 [PATCH] split --disable-extras into multiple options Michael Olbrich
@ 2010-02-13 12:51 ` Martin Pitt
  2010-02-13 17:44 ` Bryan Kadzban
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Martin Pitt @ 2010-02-13 12:51 UTC (permalink / raw)
  To: linux-hotplug

Hello Michael,

Michael Olbrich [2010-02-11 12:12 +0100]:
> 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.
> I need a patch like this for the embedded system I'm working on. I need
> gudev for other stuff, but I don't have libacl and some of the other
> dependencies.
> 
> Any opinions?

This looks fine to me, and it doesn't change the default behaviour
either. If Kay agrees, I'll test this a little bit and commit.

Martin
-- 
Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] split --disable-extras into multiple options
  2010-02-11 11:12 [PATCH] split --disable-extras into multiple options Michael Olbrich
  2010-02-13 12:51 ` Martin Pitt
@ 2010-02-13 17:44 ` Bryan Kadzban
  2010-02-13 18:11 ` Marco d'Itri
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Bryan Kadzban @ 2010-02-13 17:44 UTC (permalink / raw)
  To: linux-hotplug

[-- Attachment #1: Type: text/plain, Size: 1266 bytes --]

Martin Pitt wrote:
> Hello Michael,
> 
> Michael Olbrich [2010-02-11 12:12 +0100]:
>> 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.
>> I need a patch like this for the embedded system I'm working on. I need
>> gudev for other stuff, but I don't have libacl and some of the other
>> dependencies.
>>
>> Any opinions?
> 
> This looks fine to me, and it doesn't change the default behaviour
> either. If Kay agrees, I'll test this a little bit and commit.

I like the idea (for whatever that's worth), but would it be possible to
also split out the pcidb and usbdb rules, so that if I use *just*
--disable-usbdb, I still get the PCI rules?  Obviously that would
require splitting the rules files as well as adding this configure
logic...

If it's a huge pain that's fine, but the reason I ask is that my default
 system config (when I build it anyway) has the PCI database but not the
USB database.  But usbutils (and its libusb dependency) isn't that huge.


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 261 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] split --disable-extras into multiple options
  2010-02-11 11:12 [PATCH] split --disable-extras into multiple options Michael Olbrich
  2010-02-13 12:51 ` Martin Pitt
  2010-02-13 17:44 ` Bryan Kadzban
@ 2010-02-13 18:11 ` Marco d'Itri
  2010-03-02 13:21 ` Martin Pitt
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Marco d'Itri @ 2010-02-13 18:11 UTC (permalink / raw)
  To: linux-hotplug

[-- Attachment #1: Type: text/plain, Size: 164 bytes --]

Please also add an option for the floppy devices helper, which is mostly
useless (e.g. I always disabled it in Debian and nobody misses it).

-- 
ciao,
Marco

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] split --disable-extras into multiple options
  2010-02-11 11:12 [PATCH] split --disable-extras into multiple options Michael Olbrich
                   ` (2 preceding siblings ...)
  2010-02-13 18:11 ` Marco d'Itri
@ 2010-03-02 13:21 ` Martin Pitt
  2010-03-03  6:15 ` Michael Olbrich
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Martin Pitt @ 2010-03-02 13:21 UTC (permalink / raw)
  To: linux-hotplug

Hello Michael,

Michael Olbrich [2010-02-11 12:12 +0100]:
> 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.

I tried to build with --disable-acl, and "make install" entirely stops
installing any helper in /lib/udev/. Can you please fix this?

Also, can you please fix the printed out summary in configure? It
still says

  extras:                  ${enable_extras}

and should be replaced with the individual enable_* options.

Thanks!

Martin

-- 
Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] split --disable-extras into multiple options
  2010-02-11 11:12 [PATCH] split --disable-extras into multiple options Michael Olbrich
                   ` (3 preceding siblings ...)
  2010-03-02 13:21 ` Martin Pitt
@ 2010-03-03  6:15 ` Michael Olbrich
  2010-03-03  8:01 ` Martin Pitt
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Michael Olbrich @ 2010-03-03  6:15 UTC (permalink / raw)
  To: linux-hotplug

[-- Attachment #1: Type: text/plain, Size: 1298 bytes --]

Hello,

On Tue, Mar 02, 2010 at 02:21:05PM +0100, Martin Pitt wrote:
> Michael Olbrich [2010-02-11 12:12 +0100]:
> > 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.
> 
> I tried to build with --disable-acl, and "make install" entirely stops
> installing any helper in /lib/udev/. Can you please fix this?

What configure options are you using? I tried
./configure --prefix=/
with and without --disable-acl and the only difference when installing are
the files for acl.

> Also, can you please fix the printed out summary in configure? It
> still says
> 
>   extras:                  ${enable_extras}
> 
> and should be replaced with the individual enable_* options.

Updated patch attached.

Regards,
Michael

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

[-- Attachment #2: udev-150-split-extras.diff --]
[-- Type: text/x-diff, Size: 9614 bytes --]

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 |   69 ++++++++++++++++++++++++++++++++++++++++++++++++-----------
 2 files changed, 78 insertions(+), 16 deletions(-)

Index: b/Makefile.am
===================================================================
--- a/Makefile.am
+++ b/Makefile.am
@@ -289,7 +289,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, ...)
 # ------------------------------------------------------------------------------
@@ -297,7 +298,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
 # ------------------------------------------------------------------------------
@@ -335,7 +341,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) \
@@ -411,7 +417,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
 # ------------------------------------------------------------------------------
@@ -420,7 +428,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
 # ------------------------------------------------------------------------------
@@ -435,7 +445,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
 # ------------------------------------------------------------------------------
@@ -443,7 +455,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
 # ------------------------------------------------------------------------------
@@ -451,7 +465,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_MODEM_MODESWITCH
 # ------------------------------------------------------------------------------
 # modem-modeswitch - magic config switch for 3G modems
 # ------------------------------------------------------------------------------
@@ -471,7 +487,9 @@ dist_udevrules_DATA += \
 	extras/modem-modeswitch/61-mobile-action.rules
 
 libexec_PROGRAMS += extras/modem-modeswitch/modem-modeswitch
+endif # ENABLE_MODEM_MODESWITCH
 
+if ENABLE_KEYMAP
 # ------------------------------------------------------------------------------
 # keymap - map custom hardware's multimedia keys
 # ------------------------------------------------------------------------------
@@ -563,8 +581,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
@@ -46,32 +46,72 @@ if test "x$enable_logging" = "xyes"; the
 	AC_DEFINE(ENABLE_LOGGING, [1], [System logging.])
 fi
 
-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([modem-modeswitch],
+	AS_HELP_STRING([--disable-modem-modeswitch], [disable modem-modeswitch - magic config switch for 3G modems]),
+	[], [enable_modem_modeswitch=yes])
+AM_CONDITIONAL([ENABLE_MODEM_MODESWITCH], [test "x$enable_modem_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
+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
 
-	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]))
-
+if test "x$enable_bluetooth" = xyes -o "x$enable_modem_modeswitch" = xyes; then
 	PKG_CHECK_MODULES(LIBUSB, libusb >= 0.1.12)
 	AC_SUBST(LIBUSB_CFLAGS)
 	AC_SUBST(LIBUSB_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_usbdb" = xyes; then
 	PKG_CHECK_MODULES(USBUTILS, usbutils >= 0.82)
 	AC_SUBST([USB_DATABASE], [$($PKG_CONFIG --variable=usbids usbutils)])
+else
+	USB_DATABASE=no
+fi
 
-	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])
-	AC_CHECK_FILES([/usr/share/misc/pci.ids], [pciids=/usr/share/misc/pci.ids])
+if test "x$enable_pcidb" = xyes; then
+	if test "x$cross_compiling" != xyes; 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])
+		AC_CHECK_FILES([/usr/share/misc/pci.ids], [pciids=/usr/share/misc/pci.ids])
+	fi
 	AC_ARG_WITH(pci-ids-path,
 		AS_HELP_STRING([--pci-ids-path=DIR], [Path to pci.ids file]),
 		[PCI_DATABASE=${withval}],
@@ -81,8 +121,9 @@ if test "x$enable_extras" = xyes; then
 			AC_MSG_ERROR([pci.ids not found, try --with-pci-ids-path=])
 		fi])
 	AC_SUBST(PCI_DATABASE)
+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]),
@@ -134,7 +175,11 @@ AC_MSG_RESULT([
 	cflags:			${CFLAGS}
 	ldflags:		${LDFLAGS}
 
-	extras:			${enable_extras}
+	gudev:			${enable_gudev}
+	bluetooth:		${enable_bluetooth}
+	keymap:			${enable_keymap}
+	acl:			${enable_acl}
+	modem-modeswitch:	${enable_modem_modeswitch}
 	gintrospection:		${enable_introspection}
 
 	usb.ids:		${USB_DATABASE}

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] split --disable-extras into multiple options
  2010-02-11 11:12 [PATCH] split --disable-extras into multiple options Michael Olbrich
                   ` (4 preceding siblings ...)
  2010-03-03  6:15 ` Michael Olbrich
@ 2010-03-03  8:01 ` Martin Pitt
  2010-03-03 14:23 ` Dan Nicholson
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Martin Pitt @ 2010-03-03  8:01 UTC (permalink / raw)
  To: linux-hotplug

Michael Olbrich [2010-03-03  7:15 +0100]:
> What configure options are you using? I tried
> ./configure --prefix=/
> with and without --disable-acl and the only difference when installing are
> the files for acl.

Just "./configure" or "./configure --disable-acl", so that prefix is
/usr/local; but the probers should still go into /lib/udev (as they do
right now if you configure without a prefix). --prefix=/ is unusual,
since that installs all the documentation, manpages, and ConsoleKit
hook into /lib and /share as well.

Martin
-- 
Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] split --disable-extras into multiple options
  2010-02-11 11:12 [PATCH] split --disable-extras into multiple options Michael Olbrich
                   ` (5 preceding siblings ...)
  2010-03-03  8:01 ` Martin Pitt
@ 2010-03-03 14:23 ` Dan Nicholson
  2010-03-03 15:07 ` Michael Olbrich
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Dan Nicholson @ 2010-03-03 14:23 UTC (permalink / raw)
  To: linux-hotplug

On Thu, Feb 11, 2010 at 3:12 AM, Michael Olbrich
<m.olbrich@pengutronix.de> wrote:
> Hi,
>
> 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.
> I need a patch like this for the embedded system I'm working on. I need
> gudev for other stuff, but I don't have libacl and some of the other
> dependencies.
>
> Any opinions?
>
> Regards,
> Michael
>
> ---
>  Makefile.am  |   25 +++++++++++++++++++++----
>  configure.ac |   59 ++++++++++++++++++++++++++++++++++++++++++++++++-----------
>  2 files changed, 69 insertions(+), 15 deletions(-)
>
> Index: b/Makefile.am
> =================================> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -288,7 +288,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, ...)
>  # ------------------------------------------------------------------------------
> @@ -296,7 +297,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
>  # ------------------------------------------------------------------------------
> @@ -334,7 +340,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) \
> @@ -410,7 +416,9 @@ typelibs_DATA = extras/gudev/GUdev-1.0.t
>
>  CLEANFILES += $(gir_DATA) $(typelibs_DATA)
>  endif # ENABLE_INTROSPECTION
> +endif # ENABLE_GUDEV

I'm not that familiar with the udev setup, but I'd like to caution
against surrounding these whole sections in an AM_CONDITIONAL. The
preferred thing to do is surround just the parts that result in
commands being run. For instance, I can see that you've here put
dist_extras_gudev_libgudev_1_0_la_SOURCES under ENABLE_GUDEV. This
will eventually break "make dist" if there person doing the
distributing isn't building GUdev.

Instead, you want to put the conditional around the directives that
generate things. For a simple example:

if SOME_OPTIONAL_DEP
bin_PROGRAMS = prog
noinst_LTLIBRARIES = libfoo.la
endif

prog_SOURCES = ...
prog_LDADD = libfoo.la
libfoo_la_SOURCES = ...

This will mean that the program and library won't actually be built
when the conditional is false, but the definitions of their prereqs
are not commented out. Otherwise, this patch looks very good from an
autotools perspective.

--
Dan

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] split --disable-extras into multiple options
  2010-02-11 11:12 [PATCH] split --disable-extras into multiple options Michael Olbrich
                   ` (6 preceding siblings ...)
  2010-03-03 14:23 ` Dan Nicholson
@ 2010-03-03 15:07 ` Michael Olbrich
  2010-03-03 16:46 ` Dan Nicholson
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Michael Olbrich @ 2010-03-03 15:07 UTC (permalink / raw)
  To: linux-hotplug

On Wed, Mar 03, 2010 at 06:23:53AM -0800, Dan Nicholson wrote:
> I'm not that familiar with the udev setup, but I'd like to caution
> against surrounding these whole sections in an AM_CONDITIONAL. The
> preferred thing to do is surround just the parts that result in
> commands being run. For instance, I can see that you've here put
> dist_extras_gudev_libgudev_1_0_la_SOURCES under ENABLE_GUDEV. This
> will eventually break "make dist" if there person doing the
> distributing isn't building GUdev.

So you are saying, that if the section is disabled, then the files will be
skipped during "make dist", right?

So how would we handle "udevrules"?
"udevrulesdir" is always set but not all files in "dist_udevrules_DATA" are
always installed.
Would something like this work:

# unconditional stuff:
dist_udevrules_DATA += \
	some_file
...
dist_modem_modeswitch_DATA = \
	extras/modem-modeswitch/61-option-modem-modeswitch.rules \
	extras/modem-modeswitch/61-mobile-action.rules

if ENABLE_MODEM_MODESWITCH
udevrules_DATA += dist_modem_modeswitch_DATA

libexec_PROGRAMS += extras/modem-modeswitch/modem-modeswitch
endif # ENABLE_MODEM_MODESWITCH
...

Regards,
Michael

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] split --disable-extras into multiple options
  2010-02-11 11:12 [PATCH] split --disable-extras into multiple options Michael Olbrich
                   ` (7 preceding siblings ...)
  2010-03-03 15:07 ` Michael Olbrich
@ 2010-03-03 16:46 ` Dan Nicholson
  2010-03-09 12:14 ` Daniel Mierswa
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Dan Nicholson @ 2010-03-03 16:46 UTC (permalink / raw)
  To: linux-hotplug

On Wed, Mar 3, 2010 at 7:07 AM, Michael Olbrich
<m.olbrich@pengutronix.de> wrote:
> On Wed, Mar 03, 2010 at 06:23:53AM -0800, Dan Nicholson wrote:
>> I'm not that familiar with the udev setup, but I'd like to caution
>> against surrounding these whole sections in an AM_CONDITIONAL. The
>> preferred thing to do is surround just the parts that result in
>> commands being run. For instance, I can see that you've here put
>> dist_extras_gudev_libgudev_1_0_la_SOURCES under ENABLE_GUDEV. This
>> will eventually break "make dist" if there person doing the
>> distributing isn't building GUdev.
>
> So you are saying, that if the section is disabled, then the files will be
> skipped during "make dist", right?
>
> So how would we handle "udevrules"?
> "udevrulesdir" is always set but not all files in "dist_udevrules_DATA" are
> always installed.
> Would something like this work:
>
> # unconditional stuff:
> dist_udevrules_DATA += \
>        some_file
> ...
> dist_modem_modeswitch_DATA = \
>        extras/modem-modeswitch/61-option-modem-modeswitch.rules \
>        extras/modem-modeswitch/61-mobile-action.rules
>
> if ENABLE_MODEM_MODESWITCH
> udevrules_DATA += dist_modem_modeswitch_DATA
>
> libexec_PROGRAMS += extras/modem-modeswitch/modem-modeswitch
> endif # ENABLE_MODEM_MODESWITCH
> ...

Sorry, it looks like I lied. I actually tested now, and automake will
search within the conditionals when figuring out what to distribute.
We'd had a bug in one of the X packages from this same type of usage,
but I think it was from a different issue.

--
Dan

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] split --disable-extras into multiple options
  2010-02-11 11:12 [PATCH] split --disable-extras into multiple options Michael Olbrich
                   ` (8 preceding siblings ...)
  2010-03-03 16:46 ` Dan Nicholson
@ 2010-03-09 12:14 ` Daniel Mierswa
  2010-03-09 12:45 ` Martin Pitt
  2010-03-09 16:37 ` Michael Olbrich
  11 siblings, 0 replies; 13+ messages in thread
From: Daniel Mierswa @ 2010-03-09 12:14 UTC (permalink / raw)
  To: linux-hotplug

On 13.02.2010 13:51, Martin Pitt wrote:
> This looks fine to me, and it doesn't change the default behaviour
> either. If Kay agrees, I'll test this a little bit and commit.
Any news on this? Does it need more tests or other fixes?

-- 
Mierswa, Daniel

If you still don't like it, that's ok: that's why I'm boss. I simply
know better than you do.
               --- Linus Torvalds, comp.os.linux.advocacy, 1996/07/2

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] split --disable-extras into multiple options
  2010-02-11 11:12 [PATCH] split --disable-extras into multiple options Michael Olbrich
                   ` (9 preceding siblings ...)
  2010-03-09 12:14 ` Daniel Mierswa
@ 2010-03-09 12:45 ` Martin Pitt
  2010-03-09 16:37 ` Michael Olbrich
  11 siblings, 0 replies; 13+ messages in thread
From: Martin Pitt @ 2010-03-09 12:45 UTC (permalink / raw)
  To: linux-hotplug

Daniel Mierswa [2010-03-09 13:14 +0100]:
> On 13.02.2010 13:51, Martin Pitt wrote:
> > This looks fine to me, and it doesn't change the default behaviour
> > either. If Kay agrees, I'll test this a little bit and commit.
> Any news on this? Does it need more tests or other fixes?

See my other followup, it needs to be fixed first.

Martin
-- 
Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] split --disable-extras into multiple options
  2010-02-11 11:12 [PATCH] split --disable-extras into multiple options Michael Olbrich
                   ` (10 preceding siblings ...)
  2010-03-09 12:45 ` Martin Pitt
@ 2010-03-09 16:37 ` Michael Olbrich
  11 siblings, 0 replies; 13+ messages in thread
From: Michael Olbrich @ 2010-03-09 16:37 UTC (permalink / raw)
  To: linux-hotplug

On Wed, Mar 03, 2010 at 09:01:03AM +0100, Martin Pitt wrote:
> Michael Olbrich [2010-03-03  7:15 +0100]:
> > What configure options are you using? I tried
> > ./configure --prefix=/
> > with and without --disable-acl and the only difference when installing are
> > the files for acl.
> 
> Just "./configure" or "./configure --disable-acl", so that prefix is
> /usr/local; but the probers should still go into /lib/udev (as they do
> right now if you configure without a prefix). --prefix=/ is unusual,
> since that installs all the documentation, manpages, and ConsoleKit
> hook into /lib and /share as well.

With udev-150 the default prefix is /usr and everything is in /usr/...
But even with the options used in autogen.sh I still can't reproduce your
problem. What udev version are you testing this with?

Regards,
Michael

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2010-03-09 16:37 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-11 11:12 [PATCH] split --disable-extras into multiple options Michael Olbrich
2010-02-13 12:51 ` Martin Pitt
2010-02-13 17:44 ` Bryan Kadzban
2010-02-13 18:11 ` Marco d'Itri
2010-03-02 13:21 ` Martin Pitt
2010-03-03  6:15 ` Michael Olbrich
2010-03-03  8:01 ` Martin Pitt
2010-03-03 14:23 ` Dan Nicholson
2010-03-03 15:07 ` Michael Olbrich
2010-03-03 16:46 ` Dan Nicholson
2010-03-09 12:14 ` Daniel Mierswa
2010-03-09 12:45 ` Martin Pitt
2010-03-09 16:37 ` Michael Olbrich

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.