Skip to contentSkip to conversation

split --disable-extras into multiple options

PATCH In review Michael Olbrich 6 participants 13 messages Feb 11, 2010 – Mar 9, 2010 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 split --disable-extras into multiple options

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]),

Signature · 4 lines
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 |
#1 lore raw

Hello Michael,

Michael Olbrich [2010-02-11 12:12 +0100]:

Quoted 16 lines

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.

Quoted 1 line

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

Signature · 2 lines
Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)
#2 lore raw
In reply to Michael Olbrich
Quoted 19 lines · Martin Pitt

Hello Michael,

Michael Olbrich [2010-02-11 12:12 +0100]:

Quoted 16 lines

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.

Quoted 4 lines
Quoted 1 line

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.

#3 lore raw
In reply to Michael Olbrich

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).

Signature · 2 lines
ciao,
Marco
#4 lore raw
In reply to Michael Olbrich

Hello Michael,

Michael Olbrich [2010-02-11 12:12 +0100]:

Quoted 4 lines

This patch patch makes it possible to enable all extras with external dependencies individually. It replaces:
--disable-extras
with

Quoted 8 lines

--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

Signature · 2 lines
Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)
#5 lore raw
In reply to Michael Olbrich

Hello,

Quoted 14 lines · Martin Pitt

Michael Olbrich [2010-02-11 12:12 +0100]:

Quoted 4 lines

This patch patch makes it possible to enable all extras with external dependencies individually. It replaces:
--disable-extras
with

Quoted 8 lines

--disable-gudev
--disable-bluetooth
--disable-keymap
--disable-acl
--disable-usbdb
--disable-pcidb
--disable-modem-modeswitch
as configure options.

Quoted 2 lines

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.

Quoted 6 lines

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

Signature · 4 lines
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 |

From: Michael Olbrich <[email protected]>
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

---
 Makefile.am  |   25 +++++++++++++++++----
 configure.ac |   69 ++++++++++++++++++++++++++++++++++++++++++++++++-----------
 2 files changed, 78 insertions(+), 16 deletions(-)
Makefile.am +21 -4
Index: 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
configure.ac +57 -12

104 lines not on this page · raw message

#6 lore raw
In reply to Michael Olbrich

Michael Olbrich [2010-03-03 7:15 +0100]:

Quoted 4 lines

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

Signature · 2 lines
Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)
#7 lore raw
In reply to Michael Olbrich
Quoted 65 lines · Michael Olbrich

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

(quoted diff) +0 -0
@@ -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

(quoted diff) +2 -1
-if ENABLE_EXTRAS
+if ENABLE_USBDB
+if ENABLE_PCIDB

 # ------------------------------------------------------------------------------

 # conditional extras (need glib, libusb, libacl, ...)
 # ------------------------------------------------------------------------------
(quoted diff) +0 -0
@@ -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

(quoted diff) +4 -0
+endif # ENABLE_PCIDB
+endif # ENABLE_USBDB
 
+BUILT_SOURCES > +
+if ENABLE_GUDEV

 # ------------------------------------------------------------------------------ # GUdev - libudev gobject interface
 # ------------------------------------------------------------------------------

(quoted diff) +0 -0
@@ -334,7 +340,7 @@ dist_extras_gudev_libgudev_1_0_la_SOURCE
        extras/gudev/gudevmarshal.c \
        extras/gudev/gudevenumtypes.h \

       extras/gudev/gudevenumtypes.c

(quoted diff) +1 -1
-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) \

(quoted diff) +0 -0
@@ -410,7 +416,9 @@ typelibs_DATA = extras/gudev/GUdev-1.0.t
 
  CLEANFILES += $(gir_DATA) $(typelibs_DATA)
Quoted 2 lines

 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

#8 lore raw
In reply to Michael Olbrich
Quoted 7 lines · Dan Nicholson

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

Signature · 4 lines
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 |
#9 lore raw
In reply to Michael Olbrich
Quoted 25 lines · Michael Olbrich
Quoted 7 lines · Dan Nicholson

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
Quoted 6 lines

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

#10 lore raw
In reply to Michael Olbrich
Quoted 2 lines · Martin Pitt

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?

Signature · 5 lines
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
#11 lore raw
In reply to Michael Olbrich

Daniel Mierswa [2010-03-09 13:14 +0100]:

Quoted 4 lines · Martin Pitt
Quoted 2 lines

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

Signature · 2 lines
Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)
#12 lore raw
In reply to Michael Olbrich
Quoted 11 lines · Martin Pitt

Michael Olbrich [2010-03-03 7:15 +0100]:

Quoted 4 lines

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

Signature · 4 lines
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 |