chiark / gitweb /
libudev: enumerate - allow to filter-out not-already-initialized devices
[elogind.git] / Makefile.am
index 728076a452baabb6ea532721b56752ceb46efab9..2e0edd0b14409d286fad0050a2c787826a70abb9 100644 (file)
@@ -21,16 +21,22 @@ AM_LDFLAGS = \
        -Wl,--as-needed
 
 DISTCHECK_CONFIGURE_FLAGS = \
-       --enable-gtk-doc
+       --enable-gtk-doc \
+       --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir)
 
 CLEANFILES =
 
+INSTALL_EXEC_HOOKS =
+INSTALL_DATA_HOOKS =
+UNINSTALL_EXEC_HOOKS =
+DISTCHECK_HOOKS =
+
 # ------------------------------------------------------------------------------
 # libudev
 # ------------------------------------------------------------------------------
-LIBUDEV_CURRENT=6
-LIBUDEV_REVISION=1
-LIBUDEV_AGE=6
+LIBUDEV_CURRENT=10
+LIBUDEV_REVISION=0
+LIBUDEV_AGE=10
 
 SUBDIRS += libudev/docs
 
@@ -69,7 +75,7 @@ endif
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = libudev/libudev.pc
 
-EXTRA_DIST += libudev/exported_symbols
+EXTRA_DIST += libudev/exported_symbols libudev/COPYING
 # move lib from $(libdir) to $(rootlib_execdir) and update devel link, if needed
 libudev-install-move-hook:
        if test "$(libdir)" != "$(rootlib_execdir)"; then \
@@ -83,20 +89,21 @@ libudev-install-move-hook:
 libudev-uninstall-move-hook:
        rm -f $(DESTDIR)$(rootlib_execdir)/libudev.so*
 
-INSTALL_EXEC_HOOKS = libudev-install-move-hook
-UNINSTALL_EXEC_HOOKS = libudev-uninstall-move-hook
+INSTALL_EXEC_HOOKS += libudev-install-move-hook
+UNINSTALL_EXEC_HOOKS += libudev-uninstall-move-hook
 
 # ------------------------------------------------------------------------------
 # main udev
 # ------------------------------------------------------------------------------
-install-data-local:
+udev-confdirs:
        -mkdir -p $(DESTDIR)$(sysconfdir)/udev/rules.d
+       -mkdir -p $(DESTDIR)$(libexecdir)/devices
+
+INSTALL_DATA_HOOKS += udev-confdirs
 
 EXTRA_DIST += \
-       rules/packages \
-       rules/redhat \
-       rules/suse \
-       rules/gentoo
+       rules/arch \
+       rules/misc
 
 udevrulesdir = $(libexecdir)/rules.d
 dist_udevrules_DATA = \
@@ -115,6 +122,21 @@ dist_udevconf_DATA = udev.conf
 sharepkgconfigdir = $(datadir)/pkgconfig
 sharepkgconfig_DATA = udev/udev.pc
 
+if WITH_SYSTEMD
+systemdsystemunit_DATA = \
+       init/udev.service \
+       init/udev-settle.service \
+       init/udev-retry.service
+
+systemd-install-hook:
+       mkdir -p $(DESTDIR)$(systemdsystemunitdir)/basic.target.wants
+       ln -sf ../udev.service $(DESTDIR)$(systemdsystemunitdir)/basic.target.wants/udev.service
+       ln -sf ../udev-settle.service $(DESTDIR)$(systemdsystemunitdir)/basic.target.wants/udev-settle.service
+       ln -sf ../udev-retry.service $(DESTDIR)$(systemdsystemunitdir)/basic.target.wants/udev-retry.service
+
+INSTALL_DATA_HOOKS += systemd-install-hook
+endif
+
 sbin_PROGRAMS = \
        udev/udevd \
        udev/udevadm
@@ -128,7 +150,9 @@ udev_common_sources =\
 
 udev_udevd_SOURCES = \
        $(udev_common_sources) \
-       udev/udevd.c
+       udev/udevd.c \
+       udev/sd-daemon.h \
+       udev/sd-daemon.c
 udev_udevd_LDADD = libudev/libudev-private.la
 
 udev_udevadm_SOURCES = \
@@ -156,12 +180,12 @@ EXTRA_DIST += \
        udev/udevd.xml
 
 %.7 %.8 : %.xml
-       $(XSLTPROC) -o $@ -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
+       $(AM_V_GEN)$(XSLTPROC) -o $@ -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
 
 # ------------------------------------------------------------------------------
 # udev tests
 # ------------------------------------------------------------------------------
-TESTS = test/udev-test.pl
+TESTS = test/udev-test.pl test/rules-test.sh
 
 check_PROGRAMS = \
        libudev/test-libudev \
@@ -194,6 +218,7 @@ dist_udevrules_DATA += \
 # ------------------------------------------------------------------------------
 extras_firmware_firmware_SOURCES = extras/firmware/firmware.c
 extras_firmware_firmware_LDADD = libudev/libudev-private.la
+extras_firmware_firmware_CPPFLAGS = $(AM_CPPFLAGS) -DFIRMWARE_PATH="$(FIRMWARE_PATH)"
 dist_udevrules_DATA += extras/firmware/50-firmware.rules
 libexec_PROGRAMS = extras/firmware/firmware
 
@@ -239,7 +264,7 @@ dist_udevrules_DATA += extras/floppy/60-floppy.rules
 # input_id - import input device class
 # ------------------------------------------------------------------------------
 extras_input_id_input_id_SOURCES = extras/input_id/input_id.c
-extras_input_id_input_id_LDADD = libudev/libudev.la
+extras_input_id_input_id_LDADD = libudev/libudev-private.la
 libexec_PROGRAMS += extras/input_id/input_id
 
 # ------------------------------------------------------------------------------
@@ -350,6 +375,7 @@ extras_gudev_libgudev_1_0_la_LDFLAGS = \
        -export-symbols-regex '^g_udev_.*'
 
 EXTRA_DIST += \
+       extras/gudev/COPYING \
        extras/gudev/gudevmarshal.list \
        extras/gudev/gudevenumtypes.h.template \
        extras/gudev/gudevenumtypes.c.template
@@ -372,7 +398,7 @@ extras/gudev/gudevenumtypes.c: extras/gudev/gudevenumtypes.c.template extras/gud
 if ENABLE_INTROSPECTION
 extras/gudev/GUdev-1.0.gir: extras/gudev/libgudev-1.0.la $(G_IR_SCANNER) Makefile.am
        $(AM_V_GEN)PKG_CONFIG_PATH=$(top_builddir)/data:$$PKG_CONFIG_PATH \
-       LD_LIBRARY_PATH=$(top_builddir)/extras/gudev \
+       LD_LIBRARY_PATH=$(top_builddir)/extras/gudev:$$LD_LIBRARY_PATH \
        $(G_IR_SCANNER) -v \
                --namespace GUdev \
                --nsversion=1.0 \
@@ -407,6 +433,22 @@ typelibs_DATA = extras/gudev/GUdev-1.0.typelib
 CLEANFILES += $(gir_DATA) $(typelibs_DATA)
 endif # ENABLE_INTROSPECTION
 
+# move lib from $(libdir) to $(rootlib_execdir) and update devel link, if needed
+libgudev-install-move-hook:
+       if test "$(libdir)" != "$(rootlib_execdir)"; then \
+               mkdir -p $(DESTDIR)$(rootlib_execdir) && \
+               so_img_name=$$(readlink $(DESTDIR)$(libdir)/libgudev-1.0.so) && \
+               so_img_rel_target_prefix=$$(echo $(libdir) | sed 's,\(^/\|\)[^/][^/]*,..,g') && \
+               ln -sf $$so_img_rel_target_prefix$(rootlib_execdir)/$$so_img_name $(DESTDIR)$(libdir)/libgudev-1.0.so && \
+               mv $(DESTDIR)$(libdir)/libgudev-1.0.so.* $(DESTDIR)$(rootlib_execdir); \
+       fi
+
+libgudev-uninstall-move-hook:
+       rm -f $(DESTDIR)$(rootlib_execdir)/libgudev-1.0.so*
+
+INSTALL_EXEC_HOOKS += libgudev-install-move-hook
+UNINSTALL_EXEC_HOOKS += libgudev-uninstall-move-hook
+
 # ------------------------------------------------------------------------------
 # Bluetooth HID devices with special magic to switch the device
 # ------------------------------------------------------------------------------
@@ -448,24 +490,36 @@ extras_usb_db_pci_db_LDADD = libudev/libudev-private.la
 libexec_PROGRAMS += extras/usb-db/pci-db
 
 # ------------------------------------------------------------------------------
-# modem-modeswitch - magic config switch for 3G modems
+# mobile-action-modeswitch - switch Mobile Action cables into serial mode
 # ------------------------------------------------------------------------------
-extras_modem_modeswitch_modem_modeswitch_SOURCES =\
-       extras/modem-modeswitch/modem-modeswitch.c \
-       extras/modem-modeswitch/utils.c \
-       extras/modem-modeswitch/utils.h \
-       extras/modem-modeswitch/ma8280p_us.c \
-       extras/modem-modeswitch/ma8280p_us.h \
-       extras/modem-modeswitch/option.c \
-       extras/modem-modeswitch/option.h
-extras_modem_modeswitch_modem_modeswitch_CPPFLAGS = $(AM_CPPFLAGS) $(LIBUSB_CFLAGS)
-extras_modem_modeswitch_modem_modeswitch_LDADD = libudev/libudev-private.la $(LIBUSB_LIBS)
+extras_mobile_action_modeswitch_mobile_action_modeswitch_SOURCES =\
+       extras/mobile-action-modeswitch/mobile-action-modeswitch.c \
+       extras/mobile-action-modeswitch/utils.c \
+       extras/mobile-action-modeswitch/utils.h \
+       extras/mobile-action-modeswitch/ma8280p_us.c \
+       extras/mobile-action-modeswitch/ma8280p_us.h
+extras_mobile_action_modeswitch_mobile_action_modeswitch_CPPFLAGS = $(AM_CPPFLAGS) $(LIBUSB_CFLAGS)
+extras_mobile_action_modeswitch_mobile_action_modeswitch_LDADD = libudev/libudev-private.la $(LIBUSB_LIBS)
 
 dist_udevrules_DATA += \
-       extras/modem-modeswitch/61-option-modem-modeswitch.rules \
-       extras/modem-modeswitch/61-mobile-action.rules
+       extras/mobile-action-modeswitch/61-mobile-action.rules
+
+libexec_PROGRAMS += extras/mobile-action-modeswitch/mobile-action-modeswitch
+
+# ------------------------------------------------------------------------------
+# mtd_probe - autoloads FTL module for mtd devices
+# ------------------------------------------------------------------------------
+extras_mtd_probe_mtd_probe_SOURCES =  \
+                                                       extras/mtd_probe/mtd_probe.c \
+                                                       extras/mtd_probe/mtd_probe.h \
+                                                       extras/mtd_probe/probe_smartmedia.c
+
+extras_mtd_probe_mtd_probe_CPPFLAGS = $(AM_CPPFLAGS)
 
-libexec_PROGRAMS += extras/modem-modeswitch/modem-modeswitch
+dist_udevrules_DATA += extras/mtd_probe/75-probe_mtd.rules
+
+libexec_PROGRAMS += extras/mtd_probe/mtd_probe
 
 # ------------------------------------------------------------------------------
 # keymap - map custom hardware's multimedia keys
@@ -513,13 +567,17 @@ dist_udevkeymap_DATA = \
        extras/keymap/keymaps/hewlett-packard-presario-2100 \
        extras/keymap/keymaps/hewlett-packard-tablet \
        extras/keymap/keymaps/hewlett-packard-tx2 \
+       extras/keymap/keymaps/ibm-thinkpad-usb-keyboard-trackpoint \
        extras/keymap/keymaps/inventec-symphony_6.0_7.0 \
        extras/keymap/keymaps/lenovo-3000 \
+       extras/keymap/keymaps/lenovo-ideapad \
        extras/keymap/keymaps/lenovo-thinkpad-usb-keyboard-trackpoint \
        extras/keymap/keymaps/lenovo-thinkpad_x6_tablet \
        extras/keymap/keymaps/lenovo-thinkpad_x200_tablet \
+       extras/keymap/keymaps/lg-x110 \
        extras/keymap/keymaps/logitech-wave \
        extras/keymap/keymaps/logitech-wave-cordless \
+       extras/keymap/keymaps/logitech-wave-pro-cordless \
        extras/keymap/keymaps/maxdata-pro_7000 \
        extras/keymap/keymaps/medion-fid2060 \
        extras/keymap/keymaps/medionnb-a555 \
@@ -529,21 +587,27 @@ dist_udevkeymap_DATA = \
        extras/keymap/keymaps/module-lenovo \
        extras/keymap/keymaps/module-sony \
        extras/keymap/keymaps/module-sony-old \
+       extras/keymap/keymaps/module-sony-vgn \
        extras/keymap/keymaps/olpc-xo \
+       extras/keymap/keymaps/onkyo \
        extras/keymap/keymaps/oqo-model2 \
        extras/keymap/keymaps/samsung-other \
        extras/keymap/keymaps/samsung-sq1us \
        extras/keymap/keymaps/samsung-sx20s \
        extras/keymap/keymaps/toshiba-satellite_a100 \
        extras/keymap/keymaps/toshiba-satellite_a110 \
+       extras/keymap/keymaps/toshiba-satellite_m30x \
        extras/keymap/keymaps/zepto-znote
 
 udevkeymapforcereldir = $(libexecdir)/keymaps/force-release
 dist_udevkeymapforcerel_DATA = \
-       extras/keymap/force-release-maps/samsung-other
+       extras/keymap/force-release-maps/dell-touchpad \
+       extras/keymap/force-release-maps/hp-other \
+       extras/keymap/force-release-maps/samsung-other \
+       extras/keymap/force-release-maps/common-volume-keys
 
 extras/keymap/keys.txt: $(INCLUDE_PREFIX)/linux/input.h
-       mkdir -p extras/keymap
+       $(AM_V_at)mkdir -p extras/keymap
        $(AM_V_GEN)$(AWK) '/^#define.*KEY_[^ ]+[ \t]+[0-9]/ { if ($$2 != "KEY_MAX") { print $$2 } }' < $< | sed 's/^KEY_COFFEE$$/KEY_SCREENLOCK/' > $@
 
 extras/keymap/keys-from-name.gperf: extras/keymap/keys.txt
@@ -557,7 +621,7 @@ extras/keymap/keys-to-name.h: extras/keymap/keys.txt Makefile
 
 keymaps-distcheck-hook: extras/keymap/keys.txt
        $(top_srcdir)/extras/keymap/check-keymaps.sh $(top_srcdir) $^
-DISTCHECK_HOOKS = keymaps-distcheck-hook
+DISTCHECK_HOOKS += keymaps-distcheck-hook
 
 endif # ENABLE_EXTRAS
 
@@ -576,9 +640,12 @@ CLEANFILES += \
        $(BUILT_SOURCES)
 
 EXTRA_DIST += $(TESTS)
+EXTRA_DIST += test/rule-syntax-check.py
 
 install-exec-hook: $(INSTALL_EXEC_HOOKS)
 
+install-data-hook: $(INSTALL_DATA_HOOKS)
+
 uninstall-hook: $(UNINSTALL_EXEC_HOOKS)
 
 distcheck-hook: $(DISTCHECK_HOOKS)