+Summary of changes from v173 to v174
+============================================
+
+David Zeuthen (1):
+ ata_id: Check for Compact Flash card
+
+Jerone Young (1):
+ Add mic mute keycode support for Lenovo Thinkpad USB keyboard
+
+Kay Sievers (34):
+ gtk-doc: delete empty files
+ libudev: list - use binary search for list lookup
+ rules: move input_id to default rules
+ implement path_id, usb_id, input_id as built-in command
+ do not remove static nodes on module unload
+ rules: remove legacy rules for cdrom and usb printer
+ update TODO
+ preserve 'sticky bit' on 'add/change' events
+ libudev: util_get_sys_(subsystem,driver}() -> util_get_sys_core_link_value()
+ export USEC_INITIALIZED= and take timestamp on message receive time
+ libudev: udev_device_get_sysattr_value() return syspath of custom links
+ libudev: list - properly sort linked list not only the index
+ mknod: do not complain about existing node
+ update README
+ libudev: fix typo in documentation
+ rules: fuse: do not mount fusectl from udev rules
+ keymap: add genius keymap to Makefile
+ update NEWS
+ usb_id: can't use global variables when used as built-in
+ remove 'udevadm trigger --type=failed' and SYSFS, ID, BUS keys
+ libudev: export udev_util_encode_string()
+ update TODO
+ systemd: no not start udev in a container
+ systemd: no not start udev in a container
+ delete left-over files in extras/
+ systemd: update drop-in sd-daemon files
+ udevadm: control - use /run/udev/control socket instead of abstract namespace one
+ udevd: control - no not delete socket file when --daemon is used
+ udev_ctrl_cleanup()- accept NULL as argument
+ update NEWS
+ udevd: install into /lib/udev instead of /sbin
+ udevd: add missing braces
+ systemd: use ConditionCapability=CAP_MKNOD instead of ConditionVirtualization=!container
+ rules: do not load sg module
+
+Kir Kolyshkin (1):
+ keymap: add Genius SlimStar 320
+
+Martin Pitt (1):
+ keymap: Update Acer Aspire 5920g
+
+Matthias Clasen (1):
+ make: allow to pass ${ACLOCAL_FLAGS}
+
+Paul Fox (1):
+ keymap: update the OLPC keymap for correct function key behavior
+
+Petr Uzel (1):
+ udevadm: settle - return failure if unknown option is given
+
+Steve Langasek (1):
+ udevd: exit - process events before signals in worker
+
+Thomas Hood (2):
+ keymap: Support keymap overrides in /etc/udev/keymaps
+ keymap: Support for microphone mute button on ThinkPad X220 et al
+
+
+Summary of changes from v172 to v173
+============================================
+
+Allin Cottrell (1):
+ configure: allow to disable mtd_probe
+
+Kay Sievers (15):
+ make: fix 'make tar-sync'
+ udevd: use 'uptime' in debug timestamp
+ udevd: fix (recently) broken static node permission setting
+ rules: mount fuse filesystem only 'add'
+ udevadm: move udevadm command descriptions into their files
+ udev-acl: skip ACLs when systemd is running, disable by default
+ do not delete database when renaming netif, the db name does not change anymore
+ do not allow kernel properties to be set by udev rules
+ configure: reorder options
+ rules: input - do not create (broken) links for bluetooth devices
+ rules: serial - do not export ID_PORT, use ID_USB_INTERFACE_NUM
+ rules: sound - instead of ID_IFACE use standard ID_USB_INTERFACE_NUM
+ keymap: do not run usb_id for bluetooth devices
+ udevadm: trigger --type=failed - log deprecation warning
+ udevd: debug - put timestamp in []
+
+Martin Pitt (4):
+ gudev: Ship JavaScript examples
+ scsi_id: Ship README
+ Remove obsolete extras/scsi_id/scsi_id.config
+ keymap: Only run on key devices
+
+
+Summary of changes from v171 to v172
+============================================
+
+Bastien Nocera (3):
+ accelerometer: add orientation property
+ udev-acl: fix memleak
+ accelerometer: add documentation
+
+Harald Hoyer (2):
+ udevadm-*.c: return != 0, if unknown option given
+ udev/udevadm-monitor.c: fixed misplaced brace
+
+Kay Sievers (33):
+ rules: apply 'audio' group of the static snd/{seq,timer} nodes
+ Makefile: add tar-sync
+ rules: static_node - use 0660 if group is given to get the cigar
+ rule-syntax-check.py: use print()
+ make: use 'git tag'
+ rules: run input_id for main input devices too
+ update TODO
+ configure: add AC_CONFIG_AUX_DIR, AC_CONFIG_SRCDIR
+ cdrom_id: add tray lock and eject handling
+ rules: enable in-kernel media-presence polling
+ update TODO
+ delete mobile-action-modeswitch which has moved to usb_modeswitch
+ libudev: enumerate - scan /sys/module
+ rules: move polling rule above 'block' match
+ libudev: monitor - update doc
+ rules: set polling value only if it is disabled
+ libudev: device - fix udev_device_get_tags_list_entry() to always load database
+ rules: remove redundant MODE="0664" from lp rules
+ rules: fix wrong wildcard match, we always need a ':*' at the end
+ libudev: device - export udev_device_has_tag()
+ path_id: add missing '-' to tape suffix
+ path_id: add ID_PATH_TAG= to be used in udev tags
+ enforce valid TAG+= names
+ update TODO
+ libudev: device - add udev_device_has_tag() to libudev.h and gtk-doc
+ libudev: enumerate - add udev_enumerate_add_match_parent()
+ libudev: enumerate - include parent device itself with match_parent()
+ libudev: enumerate - clarify documentation
+ path_id: recognize ACPI parent devices
+ rules: input - call path_id for ACPI devices
+ udevadm: monitor - use uptime to match the kernel's timestamp
+ libudev: ctrl - move code to udev directory
+ update sd-daemon.[ch]
+
+Keshav P.R (1):
+ rules: support for gpt partition uuid/label
+
+Lee, Chun-Yi (1):
+ Support more MSI notebook by using asterisk on dmi vendor name
+
+Marco d'Itri (1):
+ Add missing commas to 95-keymap.rules
+
+Martin Pitt (3):
+ keymap: Add Microsoft Natural Keyboard
+ keymap: Add force-release quirk for Hannspree SN10.
+ keymap: Add slight name variations of Toshiba Satellites
+
+Peter Jones (1):
+ ata_id: show the error message when HDIO_GET_IDENTITY fails
+
+
+Summary of changes from v170 to v171
+============================================
+
+Kay Sievers (17):
+ libudev: export symbols explicitely and individually from C code not from separate file or prefix match
+ libudev: device - make a bunch of symbols static
+ systemd: Replace Requires= with Wants=, run trigger in parallel
+ systemd: sort trigger after socket
+ systemd: trigger - run after udev.service (for now)
+ systemd: set socket buffer size to 128 MB like udev has
+ update TODO
+ update TODO
+ libudev: monitor - use SOCK_NONBLOCK
+ systemd: split socket file
+ systemd: add missing socket files
+ rules: fix whitespace
+ rules: implement TAGS== match
+ libudev: enumerate - do not ignore other matches when add_match_tag() is used
+ rules: support substitutions in TAG=
+ path_id: allow to be asked about usb_devices not only usb_interfaces
+ systemd: run udev.service and udev-trigger.service in parallel
+
+Scott James Remnant (1):
+ configure: allow usb.ids location to be specified
+
+
+Summary of changes from v169 to v170
+============================================
+
+Kay Sievers (1):
+ libudev: ctrl - properly wait for incoming message after connect
+
+Michal Soltys (1):
+ configure.ac: fixes for rule_generator and modeswitch
+
+
+Summary of changes from v168 to v169
+============================================
+
+Kay Sievers (26):
+ simplify rules file overwrite logic
+ libudev: list - use bit flags for 'sort' and 'unique'
+ libudev: queue - _unref() should return the object
+ remove dead fstab_import files
+ hid2hci: prepare move to bluez package
+ set event timeout to 60 sec and settle timeout to 120
+ udevd: improve error message in case exec() fails
+ configure: allow to enable/disable extras individually
+ delete hid2hci which moved to the bluez tree
+ update TODO/NEWS
+ bump requirement to Linux kernel 2.6.32 and ARM 2.6.36
+ libudev: ctrl - log accept4() errors
+ update NEWS
+ update INSTALL, NEWS, configure comment, queue doc
+ update TODO
+ udevd: create queue file before daemonizing to reliably block 'settle'
+ udevd: remove left-over SIGALRM
+ gudev: silent gtk-doc warnings
+ cdrom_id: remove unused --export switch to silent gcc
+ libudev: queue - always rebuild queue file when nothing is queued anymore
+ libudev: device - use DEVMODE from kernel as the default mode
+ update TODO
+ Merge branch 'docs/udev.xml' of git://github.com/mfwitten/udev
+ udate TODO, NEWS, INSTALL
+ build: use --gc-sections, -fvisibility=hidden
+ udevadm: settle: wake up more often if --seq-start= or --exit-if-exists= is used
+
+Koen Kooi (1):
+ configure: reintroduce introspection flags to fix crosscompilation
+
+Michael Witten (36):
+ Docs: udev.xml: Offset daemon name with commas
+ Docs: udev.xml: Remove commas (and unnecessary repetition)
+ Docs: udev.xml: `are' -> `is'; the subject is `Access'
+ Docs: udev.xml: Use present tense
+ Docs: udev.xml: Clarification through proper wording
+ Docs: udev.xml: `,' -> `;'
+ Docs: udev.xml: `key value' -> `key-value'
+ Docs: udev.xml: `,' -> `:'
+ Docs: udev.xml: Use `assignment' consistently
+ Docs: udev.xml: `comma-separated' is a better description
+ Docs: udev.xml: Remove unnecessary repitition
+ Docs: udev.xml: Add a few more words for context
+ Docs: udev.xml: Use `unless' for clarity
+ Docs: udev.xml: Clarify PROGRAM key
+ Docs: udev.xml: `a shell style' -> `shell-style'
+ Docs: udev.xml: Clean `*' description
+ Docs: udev.xml: Clean character range description
+ Docs: udev.xml: Clean up description of NAME assignment key
+ Docs: udev.xml: Clean up description of SYMLINK assignment key
+ Docs: udev.xml: Clean up description of ENV assignment key
+ Docs: udev.xml: Clean up description of RUN assignment key
+ Docs: udev.xml: Clean up description of LABEL assignment key
+ Docs: udev.xml: Add missing `.'
+ Docs: udev.xml: `which' -> `content of which'
+ Docs: udev.xml: `commandline' -> `command line'
+ Docs: udev.xml: Clean up WAIT_FOR description
+ Docs: udev.xml: `a' -> `the'
+ Docs: udev.xml: Clean up introduction to substitutions.
+ Docs: udev.xml: Use normal sentence structure
+ Docs: udev.xml: Actually make a separate paragraph
+ Docs: udev.xml: Add comma
+ Docs: udev.xml: `char' -> `character'
+ Docs: udev.xml: `comma-separated' is a better description
+ Docs: udev.xml: Clarify through a change in word ordering
+ Docs: udev.xml: Improved word order
+ Docs: udev.xml: Fix dangling modifier
+
+Nix (1):
+ libudev: queue - accept NULL passed into udev_queue_export_cleanup()
+
+
+Summary of changes from v167 to v168
+============================================
+
+David Zeuthen (1):
+ Run ata_id on non-removable USB devices
+
+Harald Hoyer (1):
+ udevd: clarify worker exit status
+
+Kay Sievers (35):
+ version bump
+ systemd: let settle depend on trigger, do not block basic with trigger
+ selinux: do not label files in runtime dir
+ selinux: firmware - do not label files in runtime dir
+ udevadm: control - add --exit
+ trivial cleanups
+ udevd: log warning if /run is not writable
+ libudev: ctrl - fix refcounting in connection handling
+ udevadm: settle - watch queue file
+ libudev: bump revision
+ udevadm: info --cleanup-db
+ udevd: do not nice processes
+ "db_persist=" -> "db_persist"
+ udevd: move OOM disable into --daemon option
+ systemd: add OOMScoreAdjust=-1000
+ require explicit "db_persist" to exclude device info from --db-cleanup
+ udevd: get netlink socket from systemd
+ fix more warnings
+ libudev: ctrl, monitor - use SOCK_NONBLOCK
+ systemd: socket -> sockets
+ udevadm: monitor - use epoll
+ libudev: test - use epoll
+ udevadm: test - use printf() instead of info() for non-debug output
+ use 'else if' in epoll event array loop
+ libudev: run_program() - select() -> epoll
+ udevd: ppoll() -> epoll + signalfd
+ Merge branch 'docs/README' of git://github.com/mfwitten/udev
+ timeout handling without alarm()
+ udevadm: settle - kill alarm()
+ udevd: netif rename - use ifindex for temporary name
+ udevd: always use udevd[] log prefix
+ udevd: rules files - accept empty or /dev/null links
+ udevd: log signal number when spawned processes fail
+ systemd: Reqires= -> Wants=udev.socket
+ udevd, udev-event: sync waitpid() error handling
+
+Lee, Chun-Yi (1):
+ Add rule for Acer Aspire One ZG8 to use acer-aspire_5720 keymap
+
+Leonid Antonenkov (1):
+ rule-generator: net - ignore Hyper-V virtual interfaces
+
+Martin Pitt (3):
+ Revert "Do not build extras with --disable-extras"
+ Avoid spinning up CD on pressing eject button
+ keymap: Another ID for Logitech Wave keyboard
+
+Michael Reed (1):
+ path_id: rework SAS device handling
+
+Michael Witten (12):
+ Docs: README: `to replace' -> `replacing'
+ Docs: README: `,' -> `;'
+ Docs: README: Clean up a sentence
+ Docs: README: Use present tense
+ Docs: README: Add missing `and'
+ Docs: README: Remove commas and use subjective mood
+ Docs: README: Clean up `udev extras' requirements
+ Docs: README: Clarify configuration of existing devices
+ Docs: README: `does never apply' -> `never applies'
+ Docs: README: Flip sentence structure to improve wording
+ Docs: README: `set up' is the verb; `setup' is a noun
+ Docs: README: Add a comma to offset the modifier
+
+Seth Forshee (1):
+ keymap: Support Dell Latitude XT2 tablet-mode navigation keys
+
+Thomas Egerer (1):
+ udevd: add 'N:' to optstring in getopt_long
+
+
+Summary of changes from v166 to v167
+============================================
+
+Andrey Borzenkov (1):
+ udev-acl: add /dev/sgX nodes for CD-ROM
+
+David Zeuthen (1):
+ cdrom_id: Don't ignore profiles when there is no media available
+
+Harald Hoyer (2):
+ cdrom_id: cd_media_toc() extend toc size to 65536
+ udev-acl/70-acl.rules: tag ID_REMOTE_CONTROL with acl
+
+Kay Sievers (29):
+ version bump
+ Merge branch 'master' of git+ssh://master.kernel.org/pub/scm/linux/hotplug/udev
+ v4l_id: kill the v4l1 ioctl
+ v4l_id: remove left-over variable
+ update some comments
+ test-libudev: add short options
+ libudev: udev_device_get_sysattr_list_entry() update
+ libudev: resolve ifindex in udev_device_new_from_id_filename()
+ libudev: bump minor version
+ udev-acl: move sg rule to optical drive rule
+ move /dev/.udev/ to /dev/.run/udev/ and convert old udev database at udevd startup
+ NEWS: clarify /dev/.run/ requirements
+ input_id: silent gcc warnings
+ fstab_import: disable build
+ systemd: remove deprecated udev-retry.service
+ fstab_import: remove from configure
+ update sd-daemon.[ch]
+ udevd: use facility == LOG_DAEMON when writing to /dev/kmsg
+ udevd: initialize fds, for proper close() on exit
+ use /run/udev/ if possible and fall back to /dev/.udev/
+ rules: run ata_id only on SPC-3 or later optical drives
+ systemd: bind udev control socket in systemd and split udev.service
+ systemd: use sockets.target not socket.target
+ man: remove trigger --type=failed handling
+ libudev: export udev_get_run_path()
+ libudev: docs - add udev_get_run_path()
+ libudev: make valgrind happy
+ systemd: do not enable udev-settle.service by default
+ systemd: udev.socket - disable implicit dependencies
+
+Kei Tokunaga (1):
+ udevadm: enumerate - update prev pointer properly
+
+Lee, Chun-Yi (2):
+ Remap Acer WMI touchpad toggle key to F21 used by X
+ Remap MSI Laptop touchpad on/off key to F22 and F23
+
+Martin Pitt (12):
+ 60-persistent-input.rules: Support multiple interfaces
+ Only build v4l_id if V4L1 header file is available
+ 60-persistent-input.rules: Do not create duplicate links
+ Fix building with --disable-extras
+ Do not build extras with --disable-extras
+ v4l_id: Drop videodev.h check again
+ keymap: Fix Acer Aspire 5920G media key
+ input_id: Consistently use tabs for indentation
+ input_id: Add some debugging output
+ input_id: Avoid memory overflow with too long capability masks
+ input_id: Cover key devices which only have KEY_* > 255
+ input_id: Rewrite debug logging to use standard udev info()
+
+Seth Forshee (1):
+ keymap: continue reading keymap after invalid scancodes
+
+Thomas Egerer (3):
+ libudev: allow to get list of all available sysfs attrs for a device
+ libudev: use sysfs attr ilist interface for attribute walk
+ udevadm: info - make attribute array static and const
+
+
Summary of changes from v165 to v166
============================================
--libexecdir=/lib/udev \
--with-selinux
-All options:
- --prefix=
- Usually /usr, prefix for man pages, include files.
- --sysconfdir=
- Usually /etc.
- --sbindir=
- Usually /sbin, the place for udevd and udevadm.
- --libexecdir=
- Usually /lib/udev, the udev private directory.
- --enable-debug
- Compile-in verbose debug messages. Usually not needed,
- it increases the size of the binaries.
- --disable-logging
- Disable all logging and compile-out all log strings. This
- is not recommended, as it makes it almost impossible to debug
- udev in the running system.
- --with-selinux
- Link against SELinux libraries to set the expected context
- for created files.
- --disable-extras
- Disable the build of all extras which have larger external
- dependencies like glib, libacl, libusb, ...
-
The options used in a RPM spec file usually look like:
%configure \
--prefix=%{_prefix} \
the /lib/udev/ directory, to install their rule helper and udev
rule files.
-It is recommended to use the /lib/udev/devices/ directory to place
+It is possible to use the /lib/udev/devices/ directory to place
device nodes, directories and symlinks, which are copied to /dev/
at every bootup. That way, nodes for devices which can not be
detected automatically, or are activated on-demand by opening the
pre-existing device node, will be available.
-Default udev rules and persistent device naming rules are required
+Default udev rules and persistent device naming rules may be required
by other software that depends on the data udev collects from the
-devices, and should therefore be installed by default with every udev
-installation.
+devices.
EXTRA_DIST = autogen.sh
-ACLOCAL_AMFLAGS = -I m4
+ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
AM_MAKEFLAGS = --no-print-directory
-DSYSCONFDIR=\""$(sysconfdir)"\" \
-DLIBEXECDIR=\""$(libexecdir)"\"
+AM_CFLAGS = \
+ -fvisibility=hidden \
+ -ffunction-sections \
+ -fdata-sections
+
AM_LDFLAGS = \
+ -Wl,--gc-sections \
-Wl,--as-needed
DISTCHECK_CONFIGURE_FLAGS = \
--with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir)
CLEANFILES =
-
+BUILT_SOURCES =
INSTALL_EXEC_HOOKS =
INSTALL_DATA_HOOKS =
UNINSTALL_EXEC_HOOKS =
DISTCHECK_HOOKS =
+dist_libexec_SCRIPTS =
# ------------------------------------------------------------------------------
# libudev
# ------------------------------------------------------------------------------
-LIBUDEV_CURRENT=10
+LIBUDEV_CURRENT=13
LIBUDEV_REVISION=0
-LIBUDEV_AGE=10
+LIBUDEV_AGE=13
SUBDIRS += libudev/docs
libudev/libudev-queue.c
libudev_libudev_la_LDFLAGS = \
- -version-info $(LIBUDEV_CURRENT):$(LIBUDEV_REVISION):$(LIBUDEV_AGE) \
- -export-symbols $(top_srcdir)/libudev/exported_symbols
+ -version-info $(LIBUDEV_CURRENT):$(LIBUDEV_REVISION):$(LIBUDEV_AGE)
noinst_LTLIBRARIES = \
libudev/libudev-private.la
libudev_libudev_private_la_SOURCES =\
$(libudev_libudev_la_SOURCES) \
- libudev/libudev-ctrl.c \
libudev/libudev-util-private.c \
libudev/libudev-device-private.c \
libudev/libudev-queue-private.c
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libudev/libudev.pc
-EXTRA_DIST += libudev/exported_symbols libudev/COPYING
+EXTRA_DIST += 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 \
if WITH_SYSTEMD
systemdsystemunit_DATA = \
+ init/udev-control.socket \
+ init/udev-kernel.socket \
init/udev.service \
- init/udev-settle.service \
- init/udev-retry.service
+ init/udev-trigger.service \
+ init/udev-settle.service
+
+EXTRA_DIST += \
+ init/udev-control.socket \
+ init/udev-kernel.socket
systemd-install-hook:
+ mkdir -p $(DESTDIR)$(systemdsystemunitdir)/sockets.target.wants
+ ln -sf ../udev-control.socket $(DESTDIR)$(systemdsystemunitdir)/sockets.target.wants/udev-control.socket
+ ln -sf ../udev-kernel.socket $(DESTDIR)$(systemdsystemunitdir)/sockets.target.wants/udev-kernel.socket
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
+ ln -sf ../udev-trigger.service $(DESTDIR)$(systemdsystemunitdir)/basic.target.wants/udev-trigger.service
INSTALL_DATA_HOOKS += systemd-install-hook
endif
sbin_PROGRAMS = \
- udev/udevd \
udev/udevadm
+libexec_PROGRAMS = \
+ udev/udevd
+
udev_common_sources =\
udev/udev.h \
udev/udev-event.c \
udev/udev-watch.c \
udev/udev-node.c \
- udev/udev-rules.c
+ udev/udev-rules.c \
+ udev/udev-ctrl.c \
+ udev/udev-builtin.c \
+ udev/udev-builtin-path_id.c \
+ udev/udev-builtin-usb_id.c \
+ udev/udev-builtin-input_id.c
udev_udevd_SOURCES = \
$(udev_common_sources) \
udev/udevadm.c \
udev/udevadm-info.c \
udev/udevadm-control.c \
- udev/udevadm-test.c \
udev/udevadm-monitor.c \
udev/udevadm-settle.c \
- udev/udevadm-trigger.c
+ udev/udevadm-trigger.c \
+ udev/udevadm-test.c \
+ udev/udevadm-test-builtin.c
udev_udevadm_LDADD = libudev/libudev-private.la
# ------------------------------------------------------------------------------
udev_test_udev_LDADD = libudev/libudev-private.la
# ------------------------------------------------------------------------------
-# rule_generator - persistent network and optical device rule generator
-# ------------------------------------------------------------------------------
-dist_libexec_SCRIPTS = \
- extras/rule_generator/write_cd_rules \
- extras/rule_generator/write_net_rules
-
-udevhomedir = $(libexecdir)
-dist_udevhome_DATA = extras/rule_generator/rule_generator.functions
-
-dist_udevrules_DATA += \
- extras/rule_generator/75-cd-aliases-generator.rules \
- extras/rule_generator/75-persistent-net-generator.rules
-
-# ------------------------------------------------------------------------------
# firmware - firmware loading
# ------------------------------------------------------------------------------
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
+libexec_PROGRAMS += extras/firmware/firmware
# ------------------------------------------------------------------------------
# ata_id - ATA identify
libexec_PROGRAMS += extras/collect/collect
# ------------------------------------------------------------------------------
-# edd_id - BIOS EDD block device match
-# ------------------------------------------------------------------------------
-extras_edd_id_edd_id_SOURCES = extras/edd_id/edd_id.c
-extras_edd_id_edd_id_LDADD = libudev/libudev-private.la
-libexec_PROGRAMS += extras/edd_id/edd_id
-dist_udevrules_DATA += extras/edd_id/61-persistent-storage-edd.rules
-
-# ------------------------------------------------------------------------------
-# create_floppy_devices - historical floppy kernel device nodes (/dev/fd0h1440, ...)
-# ------------------------------------------------------------------------------
-extras_floppy_create_floppy_devices_SOURCES = extras/floppy/create_floppy_devices.c
-extras_floppy_create_floppy_devices_LDADD = libudev/libudev-private.la
-libexec_PROGRAMS += extras/floppy/create_floppy_devices
-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-private.la
-libexec_PROGRAMS += extras/input_id/input_id
-
-# ------------------------------------------------------------------------------
-# path_id - compose identifier of persistent elements of the parent buses
-# ------------------------------------------------------------------------------
-extras_path_id_path_id_SOURCES = extras/path_id/path_id.c
-extras_path_id_path_id_LDADD = libudev/libudev-private.la
-libexec_PROGRAMS += extras/path_id/path_id
-
-# ------------------------------------------------------------------------------
-# fstab_import - import /etc/fstab entry for block device
-# ------------------------------------------------------------------------------
-extras_fstab_import_fstab_import_SOURCES = extras/fstab_import/fstab_import.c
-extras_fstab_import_fstab_import_LDADD = libudev/libudev-private.la
-libexec_PROGRAMS += extras/fstab_import/fstab_import
-dist_udevrules_DATA += extras/fstab_import/79-fstab_import.rules
-
-# ------------------------------------------------------------------------------
# scsi_id - SCSI inquiry to get various serial numbers
# ------------------------------------------------------------------------------
extras_scsi_id_scsi_id_SOURCES =\
extras_scsi_id_scsi_id_LDADD = libudev/libudev-private.la
libexec_PROGRAMS += extras/scsi_id/scsi_id
dist_man_MANS += extras/scsi_id/scsi_id.8
-
-# ------------------------------------------------------------------------------
-# usb_id - USB device property import
-# ------------------------------------------------------------------------------
-extras_usb_id_usb_id_SOURCES = extras/usb_id/usb_id.c
-extras_usb_id_usb_id_LDADD = libudev/libudev-private.la
-libexec_PROGRAMS += extras/usb_id/usb_id
+EXTRA_DIST += extras/scsi_id/README
# ------------------------------------------------------------------------------
# v4l_id - video4linux capabilities
dist_udevrules_DATA += extras/v4l_id/60-persistent-v4l.rules
# ------------------------------------------------------------------------------
-# qemu -- qemu/kvm guest tweaks
+# accelerometer - updates device orientation
# ------------------------------------------------------------------------------
-dist_udevrules_DATA += extras/qemu/42-qemu-usb.rules
+extras_accelerometer_accelerometer_SOURCES = extras/accelerometer/accelerometer.c
+extras_accelerometer_accelerometer_LDADD = libudev/libudev-private.la -lm
+libexec_PROGRAMS += extras/accelerometer/accelerometer
+dist_udevrules_DATA += extras/accelerometer/61-accelerometer.rules
-if ENABLE_EXTRAS
# ------------------------------------------------------------------------------
-# conditional extras (need glib, libusb, libacl, ...)
+# qemu -- qemu/kvm guest tweaks
# ------------------------------------------------------------------------------
-dist_udevrules_DATA += \
- rules/rules.d/75-net-description.rules \
- rules/rules.d/75-tty-description.rules \
- rules/rules.d/78-sound-card.rules
+dist_udevrules_DATA += extras/qemu/42-qemu-usb.rules
+if ENABLE_GUDEV
# ------------------------------------------------------------------------------
# GUdev - libudev gobject interface
# ------------------------------------------------------------------------------
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) \
-D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT \
-D_GUDEV_COMPILATION \
-DG_LOG_DOMAIN=\"GUdev\"
-extras_gudev_libgudev_1_0_la_CFLAGS = $(GLIB_CFLAGS)
+
+extras_gudev_libgudev_1_0_la_CFLAGS = \
+ -fvisibility=default \
+ $(GLIB_CFLAGS)
+
extras_gudev_libgudev_1_0_la_LIBADD = libudev/libudev.la $(GLIB_LIBS)
extras_gudev_libgudev_1_0_la_LDFLAGS = \
extras/gudev/COPYING \
extras/gudev/gudevmarshal.list \
extras/gudev/gudevenumtypes.h.template \
- extras/gudev/gudevenumtypes.c.template
+ extras/gudev/gudevenumtypes.c.template \
+ extras/gudev/gjs-example.js \
+ extras/gudev/seed-example-enum.js \
+ extras/gudev/seed-example.js
extras/gudev/gudevmarshal.h: extras/gudev/gudevmarshal.list
$(AM_V_GEN)glib-genmarshal $< --prefix=g_udev_marshal --header > $@
$@.tmp && mv $@.tmp $@
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 \
- $(G_IR_SCANNER) -v \
+extras/gudev/GUdev-1.0.gir: extras/gudev/libgudev-1.0.la $(G_IR_SCANNER)
+ $(AM_V_GEN)$(G_IR_SCANNER) -v \
+ --warn-all \
--namespace GUdev \
--nsversion=1.0 \
--include=GObject-2.0 \
--library=gudev-1.0 \
- --library-path=extras/gudev \
+ --library-path=$(top_builddir)/libudev \
+ --library-path=$(top_builddir)/extras/gudev \
--output $@ \
--pkg=glib-2.0 \
--pkg=gobject-2.0 \
- -I$(top_builddir)/extras \
-I$(top_srcdir)/extras \
+ -I$(top_builddir)/extras \
-D_GUDEV_COMPILATION \
-D_GUDEV_WORK_AROUND_DEV_T_BUG \
$(top_srcdir)/extras/gudev/gudev.h \
INSTALL_EXEC_HOOKS += libgudev-install-move-hook
UNINSTALL_EXEC_HOOKS += libgudev-uninstall-move-hook
+endif
+if ENABLE_HWDB
# ------------------------------------------------------------------------------
-# Bluetooth HID devices with special magic to switch the device
-# ------------------------------------------------------------------------------
-extras_hid2hci_hid2hci_SOURCES = extras/hid2hci/hid2hci.c
-extras_hid2hci_hid2hci_CPPFLAGS = $(AM_CPPFLAGS) $(LIBUSB_CFLAGS)
-extras_hid2hci_hid2hci_LDADD = libudev/libudev-private.la $(LIBUSB_LIBS)
-dist_udevrules_DATA += extras/hid2hci/70-hid2hci.rules
-libexec_PROGRAMS += extras/hid2hci/hid2hci
-
-# ------------------------------------------------------------------------------
-# udev_acl - apply ACLs for users with local forground sessions
-# ------------------------------------------------------------------------------
-extras_udev_acl_udev_acl_SOURCES = extras/udev-acl/udev-acl.c
-extras_udev_acl_udev_acl_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS)
-extras_udev_acl_udev_acl_LDADD = libudev/libudev-private.la -lacl $(GLIB_LIBS)
-dist_udevrules_DATA += extras/udev-acl/70-acl.rules
-libexec_PROGRAMS += extras/udev-acl/udev-acl
-
-udevacl-install-hook:
- mkdir -p $(DESTDIR)$(prefix)/lib/ConsoleKit/run-seat.d
- ln -sf $(libexecdir)/udev-acl $(DESTDIR)$(prefix)/lib/ConsoleKit/run-seat.d/udev-acl.ck
-
-INSTALL_EXEC_HOOKS += udevacl-install-hook
-
-# ------------------------------------------------------------------------------
-# usb-db - read USB vendor/device string database
+# usb/pci-db - read vendor/device string database
# ------------------------------------------------------------------------------
extras_usb_db_usb_db_SOURCES = extras/usb-db/usb-db.c
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
+dist_udevrules_DATA += \
+ rules/rules.d/75-net-description.rules \
+ rules/rules.d/75-tty-description.rules \
+ rules/rules.d/78-sound-card.rules
-# ------------------------------------------------------------------------------
-# pci-db - read PCI vendor/device string database
-# ------------------------------------------------------------------------------
extras_usb_db_pci_db_SOURCES = extras/usb-db/usb-db.c
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
-# ------------------------------------------------------------------------------
-# mobile-action-modeswitch - switch Mobile Action cables into serial mode
-# ------------------------------------------------------------------------------
-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/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)
-
-dist_udevrules_DATA += extras/mtd_probe/75-probe_mtd.rules
-
-libexec_PROGRAMS += extras/mtd_probe/mtd_probe
-
-
+if ENABLE_KEYMAP
# ------------------------------------------------------------------------------
# keymap - map custom hardware's multimedia keys
# ------------------------------------------------------------------------------
dist_libexec_SCRIPTS += extras/keymap/findkeyboards
dist_libexec_SCRIPTS += extras/keymap/keyboard-force-release.sh
dist_doc_DATA = extras/keymap/README.keymap.txt
-
CLEANFILES += \
extras/keymap/keys.txt \
extras/keymap/keys-from-name.gperf
extras/keymap/keymaps/asus \
extras/keymap/keymaps/compaq-e_evo \
extras/keymap/keymaps/dell \
+ extras/keymap/keymaps/dell-latitude-xt2 \
extras/keymap/keymaps/everex-xt5000 \
extras/keymap/keymaps/fujitsu-amilo_pa_2548 \
extras/keymap/keymaps/fujitsu-amilo_pro_edition_v3505 \
extras/keymap/keymaps/fujitsu-amilo_si_1520 \
extras/keymap/keymaps/fujitsu-esprimo_mobile_v5 \
extras/keymap/keymaps/fujitsu-esprimo_mobile_v6 \
+ extras/keymap/keymaps/genius-slimstar-320 \
extras/keymap/keymaps/hewlett-packard \
extras/keymap/keymaps/hewlett-packard-2510p_2530p \
extras/keymap/keymaps/hewlett-packard-compaq_elitebook \
keymaps-distcheck-hook: extras/keymap/keys.txt
$(top_srcdir)/extras/keymap/check-keymaps.sh $(top_srcdir) $^
DISTCHECK_HOOKS += keymaps-distcheck-hook
+endif
+
+if ENABLE_MTD_PROBE
+# ------------------------------------------------------------------------------
+# 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)
+dist_udevrules_DATA += extras/mtd_probe/75-probe_mtd.rules
+libexec_PROGRAMS += extras/mtd_probe/mtd_probe
+endif
+
+if ENABLE_RULE_GENERATOR
+# ------------------------------------------------------------------------------
+# rule_generator - persistent network and optical device rule generator
+# ------------------------------------------------------------------------------
+dist_libexec_SCRIPTS += \
+ extras/rule_generator/write_cd_rules \
+ extras/rule_generator/write_net_rules
+
+udevhomedir = $(libexecdir)
+dist_udevhome_DATA = extras/rule_generator/rule_generator.functions
+
+dist_udevrules_DATA += \
+ extras/rule_generator/75-cd-aliases-generator.rules \
+ extras/rule_generator/75-persistent-net-generator.rules
+endif
+
+if ENABLE_UDEV_ACL
+# ------------------------------------------------------------------------------
+# udev_acl - apply ACLs for users with local forground sessions
+# ------------------------------------------------------------------------------
+extras_udev_acl_udev_acl_SOURCES = extras/udev-acl/udev-acl.c
+extras_udev_acl_udev_acl_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS)
+extras_udev_acl_udev_acl_LDADD = libudev/libudev-private.la -lacl $(GLIB_LIBS)
+dist_udevrules_DATA += extras/udev-acl/70-udev-acl.rules
+libexec_PROGRAMS += extras/udev-acl/udev-acl
+
+udevacl-install-hook:
+ mkdir -p $(DESTDIR)$(prefix)/lib/ConsoleKit/run-seat.d
+ ln -sf $(libexecdir)/udev-acl $(DESTDIR)$(prefix)/lib/ConsoleKit/run-seat.d/udev-acl.ck
+
+INSTALL_EXEC_HOOKS += udevacl-install-hook
+endif
+
+if ENABLE_FLOPPY
+# ------------------------------------------------------------------------------
+# create_floppy_devices - historical floppy kernel device nodes (/dev/fd0h1440, ...)
+# ------------------------------------------------------------------------------
+extras_floppy_create_floppy_devices_SOURCES = extras/floppy/create_floppy_devices.c
+extras_floppy_create_floppy_devices_LDADD = libudev/libudev-private.la
+libexec_PROGRAMS += extras/floppy/create_floppy_devices
+dist_udevrules_DATA += extras/floppy/60-floppy.rules
+endif
-endif # ENABLE_EXTRAS
+if ENABLE_EDD
+# ------------------------------------------------------------------------------
+# edd_id - create /dev/disk/by-id/edd-* links for BIOS EDD data
+# ------------------------------------------------------------------------------
+extras_edd_id_edd_id_SOURCES = extras/edd_id/edd_id.c
+extras_edd_id_edd_id_LDADD = libudev/libudev-private.la
+libexec_PROGRAMS += extras/edd_id/edd_id
+dist_udevrules_DATA += extras/edd_id/61-persistent-storage-edd.rules
+endif
# ------------------------------------------------------------------------------
# install, uninstall, clean hooks
head -1 ChangeLog | grep -q "to v$(VERSION)"
head -1 NEWS | grep -q "udev $(VERSION)"
git commit -a -m "release $(VERSION)"
- cat .git/refs/heads/master > .git/refs/tags/$(VERSION)
- git gc
- git prune
+ git tag -m $(VERSION) -s $(VERSION)
+ git gc --prune=0
+
+tar:
+ make distcheck
+ gpg --armor --detach-sign udev-$(VERSION).tar.gz
+ gpg --armor --detach-sign udev-$(VERSION).tar.bz2
+
+git-sync:
+ git push
+ git push --tags $(VERSION)
+
+tar-sync:
+ scp udev-$(VERSION).tar.gz master.kernel.org:/pub/linux/utils/kernel/hotplug/
doc-sync:
rsync -av udev/*.html master.kernel.org:/pub/linux/utils/kernel/hotplug/udev/
build_triplet = @build@
host_triplet = @host@
@WITH_SELINUX_TRUE@am__append_1 = libudev/libudev-selinux-private.c
-@WITH_SYSTEMD_TRUE@am__append_2 = systemd-install-hook
-sbin_PROGRAMS = udev/udevd$(EXEEXT) udev/udevadm$(EXEEXT)
-check_PROGRAMS = libudev/test-libudev$(EXEEXT) udev/test-udev$(EXEEXT)
-libexec_PROGRAMS = extras/firmware/firmware$(EXEEXT) \
+@WITH_SYSTEMD_TRUE@am__append_2 = \
+@WITH_SYSTEMD_TRUE@ init/udev-control.socket \
+@WITH_SYSTEMD_TRUE@ init/udev-kernel.socket
+
+@WITH_SYSTEMD_TRUE@am__append_3 = systemd-install-hook
+sbin_PROGRAMS = udev/udevadm$(EXEEXT)
+libexec_PROGRAMS = udev/udevd$(EXEEXT) \
+ extras/firmware/firmware$(EXEEXT) \
extras/ata_id/ata_id$(EXEEXT) \
extras/cdrom_id/cdrom_id$(EXEEXT) \
- extras/collect/collect$(EXEEXT) extras/edd_id/edd_id$(EXEEXT) \
- extras/floppy/create_floppy_devices$(EXEEXT) \
- extras/input_id/input_id$(EXEEXT) \
- extras/path_id/path_id$(EXEEXT) \
- extras/fstab_import/fstab_import$(EXEEXT) \
- extras/scsi_id/scsi_id$(EXEEXT) extras/usb_id/usb_id$(EXEEXT) \
- extras/v4l_id/v4l_id$(EXEEXT) $(am__EXEEXT_1)
+ extras/collect/collect$(EXEEXT) \
+ extras/scsi_id/scsi_id$(EXEEXT) extras/v4l_id/v4l_id$(EXEEXT) \
+ extras/accelerometer/accelerometer$(EXEEXT) $(am__EXEEXT_1) \
+ $(am__EXEEXT_2) $(am__EXEEXT_3) $(am__EXEEXT_4) \
+ $(am__EXEEXT_5) $(am__EXEEXT_6)
+check_PROGRAMS = libudev/test-libudev$(EXEEXT) udev/test-udev$(EXEEXT)
+@ENABLE_GUDEV_TRUE@am__append_4 = extras/gudev/docs
+@ENABLE_GUDEV_TRUE@am__append_5 = extras/gudev/libgudev-1.0.la
+@ENABLE_GUDEV_TRUE@am__append_6 = extras/gudev/gudev-1.0.pc
+@ENABLE_GUDEV_TRUE@am__append_7 = $(dist_extras_gudev_libgudev_1_0_la_SOURCES)
+@ENABLE_GUDEV_TRUE@am__append_8 = \
+@ENABLE_GUDEV_TRUE@ extras/gudev/COPYING \
+@ENABLE_GUDEV_TRUE@ extras/gudev/gudevmarshal.list \
+@ENABLE_GUDEV_TRUE@ extras/gudev/gudevenumtypes.h.template \
+@ENABLE_GUDEV_TRUE@ extras/gudev/gudevenumtypes.c.template \
+@ENABLE_GUDEV_TRUE@ extras/gudev/gjs-example.js \
+@ENABLE_GUDEV_TRUE@ extras/gudev/seed-example-enum.js \
+@ENABLE_GUDEV_TRUE@ extras/gudev/seed-example.js
+
+@ENABLE_GUDEV_TRUE@@ENABLE_INTROSPECTION_TRUE@am__append_9 = $(gir_DATA) $(typelibs_DATA)
+@ENABLE_GUDEV_TRUE@am__append_10 = libgudev-install-move-hook
+@ENABLE_GUDEV_TRUE@am__append_11 = libgudev-uninstall-move-hook
+@ENABLE_HWDB_TRUE@am__append_12 = extras/usb-db/usb-db \
+@ENABLE_HWDB_TRUE@ extras/usb-db/pci-db
+@ENABLE_HWDB_TRUE@am__append_13 = \
+@ENABLE_HWDB_TRUE@ rules/rules.d/75-net-description.rules \
+@ENABLE_HWDB_TRUE@ rules/rules.d/75-tty-description.rules \
+@ENABLE_HWDB_TRUE@ rules/rules.d/78-sound-card.rules
+
+@ENABLE_KEYMAP_TRUE@am__append_14 = $(nodist_extras_keymap_keymap_SOURCES)
+@ENABLE_KEYMAP_TRUE@am__append_15 = extras/keymap/check-keymaps.sh
+@ENABLE_KEYMAP_TRUE@am__append_16 = extras/keymap/95-keymap.rules \
+@ENABLE_KEYMAP_TRUE@ extras/keymap/95-keyboard-force-release.rules
+@ENABLE_KEYMAP_TRUE@am__append_17 = extras/keymap/keymap
+@ENABLE_KEYMAP_TRUE@am__append_18 = extras/keymap/findkeyboards \
+@ENABLE_KEYMAP_TRUE@ extras/keymap/keyboard-force-release.sh
+@ENABLE_KEYMAP_TRUE@am__append_19 = \
+@ENABLE_KEYMAP_TRUE@ extras/keymap/keys.txt \
+@ENABLE_KEYMAP_TRUE@ extras/keymap/keys-from-name.gperf
+
+@ENABLE_KEYMAP_TRUE@am__append_20 = keymaps-distcheck-hook
+@ENABLE_MTD_PROBE_TRUE@am__append_21 = extras/mtd_probe/75-probe_mtd.rules
+@ENABLE_MTD_PROBE_TRUE@am__append_22 = extras/mtd_probe/mtd_probe
# ------------------------------------------------------------------------------
-# conditional extras (need glib, libusb, libacl, ...)
+# rule_generator - persistent network and optical device rule generator
# ------------------------------------------------------------------------------
-@ENABLE_EXTRAS_TRUE@am__append_3 = \
-@ENABLE_EXTRAS_TRUE@ rules/rules.d/75-net-description.rules \
-@ENABLE_EXTRAS_TRUE@ rules/rules.d/75-tty-description.rules \
-@ENABLE_EXTRAS_TRUE@ rules/rules.d/78-sound-card.rules \
-@ENABLE_EXTRAS_TRUE@ extras/hid2hci/70-hid2hci.rules \
-@ENABLE_EXTRAS_TRUE@ extras/udev-acl/70-acl.rules \
-@ENABLE_EXTRAS_TRUE@ extras/mobile-action-modeswitch/61-mobile-action.rules \
-@ENABLE_EXTRAS_TRUE@ extras/mtd_probe/75-probe_mtd.rules \
-@ENABLE_EXTRAS_TRUE@ extras/keymap/95-keymap.rules \
-@ENABLE_EXTRAS_TRUE@ extras/keymap/95-keyboard-force-release.rules
-@ENABLE_EXTRAS_TRUE@am__append_4 = extras/gudev/docs
-@ENABLE_EXTRAS_TRUE@am__append_5 = extras/gudev/libgudev-1.0.la
-@ENABLE_EXTRAS_TRUE@am__append_6 = extras/gudev/gudev-1.0.pc
-@ENABLE_EXTRAS_TRUE@am__append_7 = extras/gudev/COPYING \
-@ENABLE_EXTRAS_TRUE@ extras/gudev/gudevmarshal.list \
-@ENABLE_EXTRAS_TRUE@ extras/gudev/gudevenumtypes.h.template \
-@ENABLE_EXTRAS_TRUE@ extras/gudev/gudevenumtypes.c.template \
-@ENABLE_EXTRAS_TRUE@ extras/keymap/check-keymaps.sh
-@ENABLE_EXTRAS_TRUE@@ENABLE_INTROSPECTION_TRUE@am__append_8 = $(gir_DATA) $(typelibs_DATA)
-@ENABLE_EXTRAS_TRUE@am__append_9 = libgudev-install-move-hook \
-@ENABLE_EXTRAS_TRUE@ udevacl-install-hook
-@ENABLE_EXTRAS_TRUE@am__append_10 = libgudev-uninstall-move-hook
-@ENABLE_EXTRAS_TRUE@am__append_11 = extras/hid2hci/hid2hci \
-@ENABLE_EXTRAS_TRUE@ extras/udev-acl/udev-acl \
-@ENABLE_EXTRAS_TRUE@ extras/usb-db/usb-db extras/usb-db/pci-db \
-@ENABLE_EXTRAS_TRUE@ extras/mobile-action-modeswitch/mobile-action-modeswitch \
-@ENABLE_EXTRAS_TRUE@ extras/mtd_probe/mtd_probe \
-@ENABLE_EXTRAS_TRUE@ extras/keymap/keymap
-@ENABLE_EXTRAS_TRUE@am__append_12 = extras/keymap/findkeyboards \
-@ENABLE_EXTRAS_TRUE@ extras/keymap/keyboard-force-release.sh
-@ENABLE_EXTRAS_TRUE@am__append_13 = \
-@ENABLE_EXTRAS_TRUE@ extras/keymap/keys.txt \
-@ENABLE_EXTRAS_TRUE@ extras/keymap/keys-from-name.gperf
-
-@ENABLE_EXTRAS_TRUE@am__append_14 = keymaps-distcheck-hook
+@ENABLE_RULE_GENERATOR_TRUE@am__append_23 = \
+@ENABLE_RULE_GENERATOR_TRUE@ extras/rule_generator/write_cd_rules \
+@ENABLE_RULE_GENERATOR_TRUE@ extras/rule_generator/write_net_rules
+
+@ENABLE_RULE_GENERATOR_TRUE@am__append_24 = \
+@ENABLE_RULE_GENERATOR_TRUE@ extras/rule_generator/75-cd-aliases-generator.rules \
+@ENABLE_RULE_GENERATOR_TRUE@ extras/rule_generator/75-persistent-net-generator.rules
+
+@ENABLE_UDEV_ACL_TRUE@am__append_25 = extras/udev-acl/70-udev-acl.rules
+@ENABLE_UDEV_ACL_TRUE@am__append_26 = extras/udev-acl/udev-acl
+@ENABLE_UDEV_ACL_TRUE@am__append_27 = udevacl-install-hook
+@ENABLE_FLOPPY_TRUE@am__append_28 = extras/floppy/create_floppy_devices
+@ENABLE_FLOPPY_TRUE@am__append_29 = extras/floppy/60-floppy.rules
+@ENABLE_EDD_TRUE@am__append_30 = extras/edd_id/edd_id
+@ENABLE_EDD_TRUE@am__append_31 = extras/edd_id/61-persistent-storage-edd.rules
subdir = .
DIST_COMMON = README $(am__configure_deps) $(am__dist_doc_DATA_DIST) \
$(am__dist_libexec_SCRIPTS_DIST) \
+ $(am__dist_udevhome_DATA_DIST) \
$(am__dist_udevkeymap_DATA_DIST) \
$(am__dist_udevkeymapforcerel_DATA_DIST) \
$(am__dist_udevrules_DATA_DIST) \
$(am__libgudev_include_HEADERS_DIST) $(dist_man_MANS) \
- $(dist_noinst_DATA) $(dist_udevconf_DATA) \
- $(dist_udevhome_DATA) $(include_HEADERS) $(srcdir)/Makefile.am \
- $(srcdir)/Makefile.in $(srcdir)/config.h.in \
- $(top_srcdir)/configure \
+ $(dist_noinst_DATA) $(dist_udevconf_DATA) $(include_HEADERS) \
+ $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+ $(srcdir)/config.h.in $(top_srcdir)/configure \
$(top_srcdir)/extras/gudev/gudev-1.0.pc.in \
- $(top_srcdir)/init/udev-retry.service.in \
$(top_srcdir)/init/udev-settle.service.in \
+ $(top_srcdir)/init/udev-trigger.service.in \
$(top_srcdir)/init/udev.service.in \
$(top_srcdir)/libudev/libudev.pc.in \
$(top_srcdir)/udev/udev.pc.in COPYING ChangeLog INSTALL NEWS \
- TODO config.guess config.sub depcomp install-sh ltmain.sh \
- missing
+ TODO build-aux/config.guess build-aux/config.sub \
+ build-aux/depcomp build-aux/install-sh build-aux/ltmain.sh \
+ build-aux/missing
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \
$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = config.h
CONFIG_CLEAN_FILES = udev/udev.pc init/udev.service \
- init/udev-settle.service init/udev-retry.service \
+ init/udev-trigger.service init/udev-settle.service \
libudev/libudev.pc extras/gudev/gudev-1.0.pc
CONFIG_CLEAN_VPATH_FILES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
"$(DESTDIR)$(includedir)" "$(DESTDIR)$(libgudev_includedir)"
LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES)
am__DEPENDENCIES_1 =
-@ENABLE_EXTRAS_TRUE@extras_gudev_libgudev_1_0_la_DEPENDENCIES = \
-@ENABLE_EXTRAS_TRUE@ libudev/libudev.la $(am__DEPENDENCIES_1)
+@ENABLE_GUDEV_TRUE@extras_gudev_libgudev_1_0_la_DEPENDENCIES = \
+@ENABLE_GUDEV_TRUE@ libudev/libudev.la $(am__DEPENDENCIES_1)
am__extras_gudev_libgudev_1_0_la_SOURCES_DIST = \
extras/gudev/gudevenums.h extras/gudev/gudevenumtypes.h \
extras/gudev/gudevtypes.h extras/gudev/gudevclient.h \
extras/gudev/gudevdevice.c extras/gudev/gudevenumerator.h \
extras/gudev/gudevenumerator.c extras/gudev/gudevprivate.h
am__dirstamp = $(am__leading_dot)dirstamp
-@ENABLE_EXTRAS_TRUE@am_extras_gudev_libgudev_1_0_la_OBJECTS = extras/gudev/extras_gudev_libgudev_1_0_la-gudevclient.lo \
-@ENABLE_EXTRAS_TRUE@ extras/gudev/extras_gudev_libgudev_1_0_la-gudevdevice.lo \
-@ENABLE_EXTRAS_TRUE@ extras/gudev/extras_gudev_libgudev_1_0_la-gudevenumerator.lo
+@ENABLE_GUDEV_TRUE@am_extras_gudev_libgudev_1_0_la_OBJECTS = extras/gudev/extras_gudev_libgudev_1_0_la-gudevclient.lo \
+@ENABLE_GUDEV_TRUE@ extras/gudev/extras_gudev_libgudev_1_0_la-gudevdevice.lo \
+@ENABLE_GUDEV_TRUE@ extras/gudev/extras_gudev_libgudev_1_0_la-gudevenumerator.lo
am__dist_extras_gudev_libgudev_1_0_la_SOURCES_DIST = \
extras/gudev/gudevmarshal.h extras/gudev/gudevmarshal.c \
extras/gudev/gudevenumtypes.h extras/gudev/gudevenumtypes.c
-@ENABLE_EXTRAS_TRUE@dist_extras_gudev_libgudev_1_0_la_OBJECTS = extras/gudev/extras_gudev_libgudev_1_0_la-gudevmarshal.lo \
-@ENABLE_EXTRAS_TRUE@ extras/gudev/extras_gudev_libgudev_1_0_la-gudevenumtypes.lo
+@ENABLE_GUDEV_TRUE@dist_extras_gudev_libgudev_1_0_la_OBJECTS = extras/gudev/extras_gudev_libgudev_1_0_la-gudevmarshal.lo \
+@ENABLE_GUDEV_TRUE@ extras/gudev/extras_gudev_libgudev_1_0_la-gudevenumtypes.lo
extras_gudev_libgudev_1_0_la_OBJECTS = \
$(am_extras_gudev_libgudev_1_0_la_OBJECTS) \
$(dist_extras_gudev_libgudev_1_0_la_OBJECTS)
$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
$(extras_gudev_libgudev_1_0_la_CFLAGS) $(CFLAGS) \
$(extras_gudev_libgudev_1_0_la_LDFLAGS) $(LDFLAGS) -o $@
-@ENABLE_EXTRAS_TRUE@am_extras_gudev_libgudev_1_0_la_rpath = -rpath \
-@ENABLE_EXTRAS_TRUE@ $(libdir)
+@ENABLE_GUDEV_TRUE@am_extras_gudev_libgudev_1_0_la_rpath = -rpath \
+@ENABLE_GUDEV_TRUE@ $(libdir)
@WITH_SELINUX_TRUE@libudev_libudev_private_la_DEPENDENCIES = \
@WITH_SELINUX_TRUE@ $(am__DEPENDENCIES_1)
am__libudev_libudev_private_la_SOURCES_DIST = \
libudev/libudev-list.c libudev/libudev-util.c \
libudev/libudev-device.c libudev/libudev-enumerate.c \
libudev/libudev-monitor.c libudev/libudev-queue.c \
- libudev/libudev-ctrl.c libudev/libudev-util-private.c \
+ libudev/libudev-util-private.c \
libudev/libudev-device-private.c \
libudev/libudev-queue-private.c \
libudev/libudev-selinux-private.c
libudev/libudev-queue.lo
@WITH_SELINUX_TRUE@am__objects_2 = libudev/libudev-selinux-private.lo
am_libudev_libudev_private_la_OBJECTS = $(am__objects_1) \
- libudev/libudev-ctrl.lo libudev/libudev-util-private.lo \
+ libudev/libudev-util-private.lo \
libudev/libudev-device-private.lo \
libudev/libudev-queue-private.lo $(am__objects_2)
libudev_libudev_private_la_OBJECTS = \
$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
$(AM_CFLAGS) $(CFLAGS) $(libudev_libudev_la_LDFLAGS) \
$(LDFLAGS) -o $@
-@ENABLE_EXTRAS_TRUE@am__EXEEXT_1 = extras/hid2hci/hid2hci$(EXEEXT) \
-@ENABLE_EXTRAS_TRUE@ extras/udev-acl/udev-acl$(EXEEXT) \
-@ENABLE_EXTRAS_TRUE@ extras/usb-db/usb-db$(EXEEXT) \
-@ENABLE_EXTRAS_TRUE@ extras/usb-db/pci-db$(EXEEXT) \
-@ENABLE_EXTRAS_TRUE@ extras/mobile-action-modeswitch/mobile-action-modeswitch$(EXEEXT) \
-@ENABLE_EXTRAS_TRUE@ extras/mtd_probe/mtd_probe$(EXEEXT) \
-@ENABLE_EXTRAS_TRUE@ extras/keymap/keymap$(EXEEXT)
+@ENABLE_HWDB_TRUE@am__EXEEXT_1 = extras/usb-db/usb-db$(EXEEXT) \
+@ENABLE_HWDB_TRUE@ extras/usb-db/pci-db$(EXEEXT)
+@ENABLE_KEYMAP_TRUE@am__EXEEXT_2 = extras/keymap/keymap$(EXEEXT)
+@ENABLE_MTD_PROBE_TRUE@am__EXEEXT_3 = \
+@ENABLE_MTD_PROBE_TRUE@ extras/mtd_probe/mtd_probe$(EXEEXT)
+@ENABLE_UDEV_ACL_TRUE@am__EXEEXT_4 = \
+@ENABLE_UDEV_ACL_TRUE@ extras/udev-acl/udev-acl$(EXEEXT)
+@ENABLE_FLOPPY_TRUE@am__EXEEXT_5 = extras/floppy/create_floppy_devices$(EXEEXT)
+@ENABLE_EDD_TRUE@am__EXEEXT_6 = extras/edd_id/edd_id$(EXEEXT)
PROGRAMS = $(libexec_PROGRAMS) $(sbin_PROGRAMS)
+am_extras_accelerometer_accelerometer_OBJECTS = \
+ extras/accelerometer/accelerometer.$(OBJEXT)
+extras_accelerometer_accelerometer_OBJECTS = \
+ $(am_extras_accelerometer_accelerometer_OBJECTS)
+extras_accelerometer_accelerometer_DEPENDENCIES = \
+ libudev/libudev-private.la
am_extras_ata_id_ata_id_OBJECTS = extras/ata_id/ata_id.$(OBJEXT)
extras_ata_id_ata_id_OBJECTS = $(am_extras_ata_id_ata_id_OBJECTS)
extras_ata_id_ata_id_DEPENDENCIES = libudev/libudev-private.la
am_extras_collect_collect_OBJECTS = extras/collect/collect.$(OBJEXT)
extras_collect_collect_OBJECTS = $(am_extras_collect_collect_OBJECTS)
extras_collect_collect_DEPENDENCIES = libudev/libudev-private.la
-am_extras_edd_id_edd_id_OBJECTS = extras/edd_id/edd_id.$(OBJEXT)
+am__extras_edd_id_edd_id_SOURCES_DIST = extras/edd_id/edd_id.c
+@ENABLE_EDD_TRUE@am_extras_edd_id_edd_id_OBJECTS = \
+@ENABLE_EDD_TRUE@ extras/edd_id/edd_id.$(OBJEXT)
extras_edd_id_edd_id_OBJECTS = $(am_extras_edd_id_edd_id_OBJECTS)
-extras_edd_id_edd_id_DEPENDENCIES = libudev/libudev-private.la
+@ENABLE_EDD_TRUE@extras_edd_id_edd_id_DEPENDENCIES = \
+@ENABLE_EDD_TRUE@ libudev/libudev-private.la
am_extras_firmware_firmware_OBJECTS = \
extras/firmware/extras_firmware_firmware-firmware.$(OBJEXT)
extras_firmware_firmware_OBJECTS = \
$(am_extras_firmware_firmware_OBJECTS)
extras_firmware_firmware_DEPENDENCIES = libudev/libudev-private.la
-am_extras_floppy_create_floppy_devices_OBJECTS = \
- extras/floppy/create_floppy_devices.$(OBJEXT)
+am__extras_floppy_create_floppy_devices_SOURCES_DIST = \
+ extras/floppy/create_floppy_devices.c
+@ENABLE_FLOPPY_TRUE@am_extras_floppy_create_floppy_devices_OBJECTS = extras/floppy/create_floppy_devices.$(OBJEXT)
extras_floppy_create_floppy_devices_OBJECTS = \
$(am_extras_floppy_create_floppy_devices_OBJECTS)
-extras_floppy_create_floppy_devices_DEPENDENCIES = \
- libudev/libudev-private.la
-am_extras_fstab_import_fstab_import_OBJECTS = \
- extras/fstab_import/fstab_import.$(OBJEXT)
-extras_fstab_import_fstab_import_OBJECTS = \
- $(am_extras_fstab_import_fstab_import_OBJECTS)
-extras_fstab_import_fstab_import_DEPENDENCIES = \
- libudev/libudev-private.la
-am__extras_hid2hci_hid2hci_SOURCES_DIST = extras/hid2hci/hid2hci.c
-@ENABLE_EXTRAS_TRUE@am_extras_hid2hci_hid2hci_OBJECTS = extras/hid2hci/extras_hid2hci_hid2hci-hid2hci.$(OBJEXT)
-extras_hid2hci_hid2hci_OBJECTS = $(am_extras_hid2hci_hid2hci_OBJECTS)
-@ENABLE_EXTRAS_TRUE@extras_hid2hci_hid2hci_DEPENDENCIES = \
-@ENABLE_EXTRAS_TRUE@ libudev/libudev-private.la \
-@ENABLE_EXTRAS_TRUE@ $(am__DEPENDENCIES_1)
-am_extras_input_id_input_id_OBJECTS = \
- extras/input_id/input_id.$(OBJEXT)
-extras_input_id_input_id_OBJECTS = \
- $(am_extras_input_id_input_id_OBJECTS)
-extras_input_id_input_id_DEPENDENCIES = libudev/libudev-private.la
+@ENABLE_FLOPPY_TRUE@extras_floppy_create_floppy_devices_DEPENDENCIES = \
+@ENABLE_FLOPPY_TRUE@ libudev/libudev-private.la
am__extras_keymap_keymap_SOURCES_DIST = extras/keymap/keymap.c
-@ENABLE_EXTRAS_TRUE@am_extras_keymap_keymap_OBJECTS = extras/keymap/extras_keymap_keymap-keymap.$(OBJEXT)
+@ENABLE_KEYMAP_TRUE@am_extras_keymap_keymap_OBJECTS = extras/keymap/extras_keymap_keymap-keymap.$(OBJEXT)
nodist_extras_keymap_keymap_OBJECTS =
extras_keymap_keymap_OBJECTS = $(am_extras_keymap_keymap_OBJECTS) \
$(nodist_extras_keymap_keymap_OBJECTS)
extras_keymap_keymap_LDADD = $(LDADD)
-am__extras_mobile_action_modeswitch_mobile_action_modeswitch_SOURCES_DIST = \
- 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
-@ENABLE_EXTRAS_TRUE@am_extras_mobile_action_modeswitch_mobile_action_modeswitch_OBJECTS = extras/mobile-action-modeswitch/extras_mobile_action_modeswitch_mobile_action_modeswitch-mobile-action-modeswitch.$(OBJEXT) \
-@ENABLE_EXTRAS_TRUE@ extras/mobile-action-modeswitch/extras_mobile_action_modeswitch_mobile_action_modeswitch-utils.$(OBJEXT) \
-@ENABLE_EXTRAS_TRUE@ extras/mobile-action-modeswitch/extras_mobile_action_modeswitch_mobile_action_modeswitch-ma8280p_us.$(OBJEXT)
-extras_mobile_action_modeswitch_mobile_action_modeswitch_OBJECTS = $(am_extras_mobile_action_modeswitch_mobile_action_modeswitch_OBJECTS)
-@ENABLE_EXTRAS_TRUE@extras_mobile_action_modeswitch_mobile_action_modeswitch_DEPENDENCIES = \
-@ENABLE_EXTRAS_TRUE@ libudev/libudev-private.la \
-@ENABLE_EXTRAS_TRUE@ $(am__DEPENDENCIES_1)
am__extras_mtd_probe_mtd_probe_SOURCES_DIST = \
extras/mtd_probe/mtd_probe.c extras/mtd_probe/mtd_probe.h \
extras/mtd_probe/probe_smartmedia.c
-@ENABLE_EXTRAS_TRUE@am_extras_mtd_probe_mtd_probe_OBJECTS = extras/mtd_probe/extras_mtd_probe_mtd_probe-mtd_probe.$(OBJEXT) \
-@ENABLE_EXTRAS_TRUE@ extras/mtd_probe/extras_mtd_probe_mtd_probe-probe_smartmedia.$(OBJEXT)
+@ENABLE_MTD_PROBE_TRUE@am_extras_mtd_probe_mtd_probe_OBJECTS = extras/mtd_probe/extras_mtd_probe_mtd_probe-mtd_probe.$(OBJEXT) \
+@ENABLE_MTD_PROBE_TRUE@ extras/mtd_probe/extras_mtd_probe_mtd_probe-probe_smartmedia.$(OBJEXT)
extras_mtd_probe_mtd_probe_OBJECTS = \
$(am_extras_mtd_probe_mtd_probe_OBJECTS)
extras_mtd_probe_mtd_probe_LDADD = $(LDADD)
-am_extras_path_id_path_id_OBJECTS = extras/path_id/path_id.$(OBJEXT)
-extras_path_id_path_id_OBJECTS = $(am_extras_path_id_path_id_OBJECTS)
-extras_path_id_path_id_DEPENDENCIES = libudev/libudev-private.la
am_extras_scsi_id_scsi_id_OBJECTS = extras/scsi_id/scsi_id.$(OBJEXT) \
extras/scsi_id/scsi_serial.$(OBJEXT)
extras_scsi_id_scsi_id_OBJECTS = $(am_extras_scsi_id_scsi_id_OBJECTS)
extras_scsi_id_scsi_id_DEPENDENCIES = libudev/libudev-private.la
am__extras_udev_acl_udev_acl_SOURCES_DIST = \
extras/udev-acl/udev-acl.c
-@ENABLE_EXTRAS_TRUE@am_extras_udev_acl_udev_acl_OBJECTS = extras/udev-acl/extras_udev_acl_udev_acl-udev-acl.$(OBJEXT)
+@ENABLE_UDEV_ACL_TRUE@am_extras_udev_acl_udev_acl_OBJECTS = extras/udev-acl/extras_udev_acl_udev_acl-udev-acl.$(OBJEXT)
extras_udev_acl_udev_acl_OBJECTS = \
$(am_extras_udev_acl_udev_acl_OBJECTS)
-@ENABLE_EXTRAS_TRUE@extras_udev_acl_udev_acl_DEPENDENCIES = \
-@ENABLE_EXTRAS_TRUE@ libudev/libudev-private.la \
-@ENABLE_EXTRAS_TRUE@ $(am__DEPENDENCIES_1)
+@ENABLE_UDEV_ACL_TRUE@extras_udev_acl_udev_acl_DEPENDENCIES = \
+@ENABLE_UDEV_ACL_TRUE@ libudev/libudev-private.la \
+@ENABLE_UDEV_ACL_TRUE@ $(am__DEPENDENCIES_1)
am__extras_usb_db_pci_db_SOURCES_DIST = extras/usb-db/usb-db.c
-@ENABLE_EXTRAS_TRUE@am_extras_usb_db_pci_db_OBJECTS = extras/usb-db/extras_usb_db_pci_db-usb-db.$(OBJEXT)
+@ENABLE_HWDB_TRUE@am_extras_usb_db_pci_db_OBJECTS = extras/usb-db/extras_usb_db_pci_db-usb-db.$(OBJEXT)
extras_usb_db_pci_db_OBJECTS = $(am_extras_usb_db_pci_db_OBJECTS)
-@ENABLE_EXTRAS_TRUE@extras_usb_db_pci_db_DEPENDENCIES = \
-@ENABLE_EXTRAS_TRUE@ libudev/libudev-private.la
+@ENABLE_HWDB_TRUE@extras_usb_db_pci_db_DEPENDENCIES = \
+@ENABLE_HWDB_TRUE@ libudev/libudev-private.la
am__extras_usb_db_usb_db_SOURCES_DIST = extras/usb-db/usb-db.c
-@ENABLE_EXTRAS_TRUE@am_extras_usb_db_usb_db_OBJECTS = extras/usb-db/extras_usb_db_usb_db-usb-db.$(OBJEXT)
+@ENABLE_HWDB_TRUE@am_extras_usb_db_usb_db_OBJECTS = extras/usb-db/extras_usb_db_usb_db-usb-db.$(OBJEXT)
extras_usb_db_usb_db_OBJECTS = $(am_extras_usb_db_usb_db_OBJECTS)
-@ENABLE_EXTRAS_TRUE@extras_usb_db_usb_db_DEPENDENCIES = \
-@ENABLE_EXTRAS_TRUE@ libudev/libudev-private.la
-am_extras_usb_id_usb_id_OBJECTS = extras/usb_id/usb_id.$(OBJEXT)
-extras_usb_id_usb_id_OBJECTS = $(am_extras_usb_id_usb_id_OBJECTS)
-extras_usb_id_usb_id_DEPENDENCIES = libudev/libudev-private.la
+@ENABLE_HWDB_TRUE@extras_usb_db_usb_db_DEPENDENCIES = \
+@ENABLE_HWDB_TRUE@ libudev/libudev-private.la
am_extras_v4l_id_v4l_id_OBJECTS = extras/v4l_id/v4l_id.$(OBJEXT)
extras_v4l_id_v4l_id_OBJECTS = $(am_extras_v4l_id_v4l_id_OBJECTS)
extras_v4l_id_v4l_id_DEPENDENCIES = libudev/libudev-private.la
libudev_test_libudev_OBJECTS = $(am_libudev_test_libudev_OBJECTS)
libudev_test_libudev_DEPENDENCIES = libudev/libudev.la
am__objects_3 = udev/udev-event.$(OBJEXT) udev/udev-watch.$(OBJEXT) \
- udev/udev-node.$(OBJEXT) udev/udev-rules.$(OBJEXT)
+ udev/udev-node.$(OBJEXT) udev/udev-rules.$(OBJEXT) \
+ udev/udev-ctrl.$(OBJEXT) udev/udev-builtin.$(OBJEXT) \
+ udev/udev-builtin-path_id.$(OBJEXT) \
+ udev/udev-builtin-usb_id.$(OBJEXT) \
+ udev/udev-builtin-input_id.$(OBJEXT)
am_udev_test_udev_OBJECTS = $(am__objects_3) udev/test-udev.$(OBJEXT)
udev_test_udev_OBJECTS = $(am_udev_test_udev_OBJECTS)
udev_test_udev_DEPENDENCIES = libudev/libudev-private.la
am_udev_udevadm_OBJECTS = $(am__objects_3) udev/udevadm.$(OBJEXT) \
udev/udevadm-info.$(OBJEXT) udev/udevadm-control.$(OBJEXT) \
- udev/udevadm-test.$(OBJEXT) udev/udevadm-monitor.$(OBJEXT) \
- udev/udevadm-settle.$(OBJEXT) udev/udevadm-trigger.$(OBJEXT)
+ udev/udevadm-monitor.$(OBJEXT) udev/udevadm-settle.$(OBJEXT) \
+ udev/udevadm-trigger.$(OBJEXT) udev/udevadm-test.$(OBJEXT) \
+ udev/udevadm-test-builtin.$(OBJEXT)
udev_udevadm_OBJECTS = $(am_udev_udevadm_OBJECTS)
udev_udevadm_DEPENDENCIES = libudev/libudev-private.la
am_udev_udevd_OBJECTS = $(am__objects_3) udev/udevd.$(OBJEXT) \
udev/sd-daemon.$(OBJEXT)
udev_udevd_OBJECTS = $(am_udev_udevd_OBJECTS)
udev_udevd_DEPENDENCIES = libudev/libudev-private.la
-am__dist_libexec_SCRIPTS_DIST = extras/rule_generator/write_cd_rules \
- extras/rule_generator/write_net_rules \
- extras/keymap/findkeyboards \
- extras/keymap/keyboard-force-release.sh
+am__dist_libexec_SCRIPTS_DIST = extras/keymap/findkeyboards \
+ extras/keymap/keyboard-force-release.sh \
+ extras/rule_generator/write_cd_rules \
+ extras/rule_generator/write_net_rules
SCRIPTS = $(dist_libexec_SCRIPTS)
DEFAULT_INCLUDES = -I.@am__isrc@
-depcomp = $(SHELL) $(top_srcdir)/depcomp
+depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
am__depfiles_maybe = depfiles
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
SOURCES = $(extras_gudev_libgudev_1_0_la_SOURCES) \
$(dist_extras_gudev_libgudev_1_0_la_SOURCES) \
$(libudev_libudev_private_la_SOURCES) \
- $(libudev_libudev_la_SOURCES) $(extras_ata_id_ata_id_SOURCES) \
+ $(libudev_libudev_la_SOURCES) \
+ $(extras_accelerometer_accelerometer_SOURCES) \
+ $(extras_ata_id_ata_id_SOURCES) \
$(extras_cdrom_id_cdrom_id_SOURCES) \
$(extras_collect_collect_SOURCES) \
$(extras_edd_id_edd_id_SOURCES) \
$(extras_firmware_firmware_SOURCES) \
$(extras_floppy_create_floppy_devices_SOURCES) \
- $(extras_fstab_import_fstab_import_SOURCES) \
- $(extras_hid2hci_hid2hci_SOURCES) \
- $(extras_input_id_input_id_SOURCES) \
$(extras_keymap_keymap_SOURCES) \
$(nodist_extras_keymap_keymap_SOURCES) \
- $(extras_mobile_action_modeswitch_mobile_action_modeswitch_SOURCES) \
$(extras_mtd_probe_mtd_probe_SOURCES) \
- $(extras_path_id_path_id_SOURCES) \
$(extras_scsi_id_scsi_id_SOURCES) \
$(extras_udev_acl_udev_acl_SOURCES) \
$(extras_usb_db_pci_db_SOURCES) \
$(extras_usb_db_usb_db_SOURCES) \
- $(extras_usb_id_usb_id_SOURCES) \
$(extras_v4l_id_v4l_id_SOURCES) \
$(libudev_test_libudev_SOURCES) $(udev_test_udev_SOURCES) \
$(udev_udevadm_SOURCES) $(udev_udevd_SOURCES)
DIST_SOURCES = $(am__extras_gudev_libgudev_1_0_la_SOURCES_DIST) \
$(am__dist_extras_gudev_libgudev_1_0_la_SOURCES_DIST) \
$(am__libudev_libudev_private_la_SOURCES_DIST) \
- $(libudev_libudev_la_SOURCES) $(extras_ata_id_ata_id_SOURCES) \
+ $(libudev_libudev_la_SOURCES) \
+ $(extras_accelerometer_accelerometer_SOURCES) \
+ $(extras_ata_id_ata_id_SOURCES) \
$(extras_cdrom_id_cdrom_id_SOURCES) \
$(extras_collect_collect_SOURCES) \
- $(extras_edd_id_edd_id_SOURCES) \
+ $(am__extras_edd_id_edd_id_SOURCES_DIST) \
$(extras_firmware_firmware_SOURCES) \
- $(extras_floppy_create_floppy_devices_SOURCES) \
- $(extras_fstab_import_fstab_import_SOURCES) \
- $(am__extras_hid2hci_hid2hci_SOURCES_DIST) \
- $(extras_input_id_input_id_SOURCES) \
+ $(am__extras_floppy_create_floppy_devices_SOURCES_DIST) \
$(am__extras_keymap_keymap_SOURCES_DIST) \
- $(am__extras_mobile_action_modeswitch_mobile_action_modeswitch_SOURCES_DIST) \
$(am__extras_mtd_probe_mtd_probe_SOURCES_DIST) \
- $(extras_path_id_path_id_SOURCES) \
$(extras_scsi_id_scsi_id_SOURCES) \
$(am__extras_udev_acl_udev_acl_SOURCES_DIST) \
$(am__extras_usb_db_pci_db_SOURCES_DIST) \
$(am__extras_usb_db_usb_db_SOURCES_DIST) \
- $(extras_usb_id_usb_id_SOURCES) \
$(extras_v4l_id_v4l_id_SOURCES) \
$(libudev_test_libudev_SOURCES) $(udev_test_udev_SOURCES) \
$(udev_udevadm_SOURCES) $(udev_udevd_SOURCES)
NROFF = nroff
MANS = $(dist_man_MANS)
am__dist_doc_DATA_DIST = extras/keymap/README.keymap.txt
+am__dist_udevhome_DATA_DIST = \
+ extras/rule_generator/rule_generator.functions
am__dist_udevkeymap_DATA_DIST = extras/keymap/keymaps/acer \
extras/keymap/keymaps/acer-aspire_5720 \
extras/keymap/keymaps/acer-aspire_8930 \
extras/keymap/keymaps/acer-aspire_6920 \
extras/keymap/keymaps/acer-travelmate_c300 \
extras/keymap/keymaps/asus extras/keymap/keymaps/compaq-e_evo \
- extras/keymap/keymaps/dell extras/keymap/keymaps/everex-xt5000 \
+ extras/keymap/keymaps/dell \
+ extras/keymap/keymaps/dell-latitude-xt2 \
+ extras/keymap/keymaps/everex-xt5000 \
extras/keymap/keymaps/fujitsu-amilo_pa_2548 \
extras/keymap/keymaps/fujitsu-amilo_pro_edition_v3505 \
extras/keymap/keymaps/fujitsu-amilo_pro_v3205 \
extras/keymap/keymaps/fujitsu-amilo_si_1520 \
extras/keymap/keymaps/fujitsu-esprimo_mobile_v5 \
extras/keymap/keymaps/fujitsu-esprimo_mobile_v6 \
+ extras/keymap/keymaps/genius-slimstar-320 \
extras/keymap/keymaps/hewlett-packard \
extras/keymap/keymaps/hewlett-packard-2510p_2530p \
extras/keymap/keymaps/hewlett-packard-compaq_elitebook \
rules/rules.d/60-persistent-alsa.rules \
rules/rules.d/80-drivers.rules \
rules/rules.d/95-udev-late.rules \
- extras/rule_generator/75-cd-aliases-generator.rules \
- extras/rule_generator/75-persistent-net-generator.rules \
extras/firmware/50-firmware.rules \
extras/cdrom_id/60-cdrom_id.rules \
- extras/edd_id/61-persistent-storage-edd.rules \
- extras/floppy/60-floppy.rules \
- extras/fstab_import/79-fstab_import.rules \
extras/v4l_id/60-persistent-v4l.rules \
+ extras/accelerometer/61-accelerometer.rules \
extras/qemu/42-qemu-usb.rules \
rules/rules.d/75-net-description.rules \
rules/rules.d/75-tty-description.rules \
rules/rules.d/78-sound-card.rules \
- extras/hid2hci/70-hid2hci.rules extras/udev-acl/70-acl.rules \
- extras/mobile-action-modeswitch/61-mobile-action.rules \
- extras/mtd_probe/75-probe_mtd.rules \
extras/keymap/95-keymap.rules \
- extras/keymap/95-keyboard-force-release.rules
+ extras/keymap/95-keyboard-force-release.rules \
+ extras/mtd_probe/75-probe_mtd.rules \
+ extras/rule_generator/75-cd-aliases-generator.rules \
+ extras/rule_generator/75-persistent-net-generator.rules \
+ extras/udev-acl/70-udev-acl.rules \
+ extras/floppy/60-floppy.rules \
+ extras/edd_id/61-persistent-storage-edd.rules
DATA = $(dist_doc_DATA) $(dist_noinst_DATA) $(dist_udevconf_DATA) \
$(dist_udevhome_DATA) $(dist_udevkeymap_DATA) \
$(dist_udevkeymapforcerel_DATA) $(dist_udevrules_DATA) \
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
GPERF = @GPERF@
GREP = @GREP@
GTKDOC_CHECK = @GTKDOC_CHECK@
+GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@
+GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@
GTKDOC_MKPDF = @GTKDOC_MKPDF@
GTKDOC_REBASE = @GTKDOC_REBASE@
G_IR_COMPILER = @G_IR_COMPILER@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
-LIBUSB_CFLAGS = @LIBUSB_CFLAGS@
-LIBUSB_LIBS = @LIBUSB_LIBS@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
SUBDIRS = . libudev/docs $(am__append_4)
-EXTRA_DIST = autogen.sh libudev/exported_symbols libudev/COPYING \
- rules/arch rules/misc udev/udev.xml udev/udevadm.xml \
- udev/udevd.xml $(am__append_7) $(TESTS) \
- test/rule-syntax-check.py
-ACLOCAL_AMFLAGS = -I m4
+EXTRA_DIST = autogen.sh libudev/COPYING rules/arch rules/misc \
+ $(am__append_2) udev/udev.xml udev/udevadm.xml udev/udevd.xml \
+ extras/scsi_id/README $(am__append_8) $(am__append_15) \
+ $(TESTS) test/rule-syntax-check.py
+ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
AM_MAKEFLAGS = --no-print-directory
AM_CPPFLAGS = \
-include $(top_builddir)/config.h \
-DSYSCONFDIR=\""$(sysconfdir)"\" \
-DLIBEXECDIR=\""$(libexecdir)"\"
+AM_CFLAGS = \
+ -fvisibility=hidden \
+ -ffunction-sections \
+ -fdata-sections
+
AM_LDFLAGS = \
+ -Wl,--gc-sections \
-Wl,--as-needed
DISTCHECK_CONFIGURE_FLAGS = \
--enable-gtk-doc \
--with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir)
-CLEANFILES = $(am__append_8) $(am__append_13) udev-$(VERSION).tar.gz \
+CLEANFILES = $(am__append_9) $(am__append_19) udev-$(VERSION).tar.gz \
udev-$(VERSION).tar.bz2 $(BUILT_SOURCES)
-INSTALL_EXEC_HOOKS = libudev-install-move-hook $(am__append_9)
-INSTALL_DATA_HOOKS = udev-confdirs $(am__append_2)
-UNINSTALL_EXEC_HOOKS = libudev-uninstall-move-hook $(am__append_10)
-DISTCHECK_HOOKS = $(am__append_14)
+BUILT_SOURCES = $(am__append_7) $(am__append_14)
+INSTALL_EXEC_HOOKS = libudev-install-move-hook $(am__append_10) \
+ $(am__append_27)
+INSTALL_DATA_HOOKS = udev-confdirs $(am__append_3)
+UNINSTALL_EXEC_HOOKS = libudev-uninstall-move-hook $(am__append_11)
+DISTCHECK_HOOKS = $(am__append_20)
+dist_libexec_SCRIPTS = $(am__append_18) $(am__append_23)
# ------------------------------------------------------------------------------
# libudev
# ------------------------------------------------------------------------------
-LIBUDEV_CURRENT = 10
+LIBUDEV_CURRENT = 13
LIBUDEV_REVISION = 0
-LIBUDEV_AGE = 10
+LIBUDEV_AGE = 13
include_HEADERS = libudev/libudev.h
lib_LTLIBRARIES = libudev/libudev.la $(am__append_5)
libudev_libudev_la_SOURCES = \
libudev/libudev-queue.c
libudev_libudev_la_LDFLAGS = \
- -version-info $(LIBUDEV_CURRENT):$(LIBUDEV_REVISION):$(LIBUDEV_AGE) \
- -export-symbols $(top_srcdir)/libudev/exported_symbols
+ -version-info $(LIBUDEV_CURRENT):$(LIBUDEV_REVISION):$(LIBUDEV_AGE)
noinst_LTLIBRARIES = \
libudev/libudev-private.la
libudev_libudev_private_la_SOURCES = $(libudev_libudev_la_SOURCES) \
- libudev/libudev-ctrl.c libudev/libudev-util-private.c \
+ libudev/libudev-util-private.c \
libudev/libudev-device-private.c \
libudev/libudev-queue-private.c $(am__append_1)
@WITH_SELINUX_TRUE@libudev_libudev_private_la_LIBADD = $(SELINUX_LIBS)
rules/rules.d/60-persistent-alsa.rules \
rules/rules.d/80-drivers.rules \
rules/rules.d/95-udev-late.rules \
- extras/rule_generator/75-cd-aliases-generator.rules \
- extras/rule_generator/75-persistent-net-generator.rules \
extras/firmware/50-firmware.rules \
extras/cdrom_id/60-cdrom_id.rules \
- extras/edd_id/61-persistent-storage-edd.rules \
- extras/floppy/60-floppy.rules \
- extras/fstab_import/79-fstab_import.rules \
extras/v4l_id/60-persistent-v4l.rules \
- extras/qemu/42-qemu-usb.rules $(am__append_3)
+ extras/accelerometer/61-accelerometer.rules \
+ extras/qemu/42-qemu-usb.rules $(am__append_13) \
+ $(am__append_16) $(am__append_21) $(am__append_24) \
+ $(am__append_25) $(am__append_29) $(am__append_31)
udevconfdir = $(sysconfdir)/udev
dist_udevconf_DATA = udev.conf
sharepkgconfigdir = $(datadir)/pkgconfig
sharepkgconfig_DATA = udev/udev.pc
@WITH_SYSTEMD_TRUE@systemdsystemunit_DATA = \
+@WITH_SYSTEMD_TRUE@ init/udev-control.socket \
+@WITH_SYSTEMD_TRUE@ init/udev-kernel.socket \
@WITH_SYSTEMD_TRUE@ init/udev.service \
-@WITH_SYSTEMD_TRUE@ init/udev-settle.service \
-@WITH_SYSTEMD_TRUE@ init/udev-retry.service
+@WITH_SYSTEMD_TRUE@ init/udev-trigger.service \
+@WITH_SYSTEMD_TRUE@ init/udev-settle.service
udev_common_sources = \
udev/udev.h \
udev/udev-event.c \
udev/udev-watch.c \
udev/udev-node.c \
- udev/udev-rules.c
+ udev/udev-rules.c \
+ udev/udev-ctrl.c \
+ udev/udev-builtin.c \
+ udev/udev-builtin-path_id.c \
+ udev/udev-builtin-usb_id.c \
+ udev/udev-builtin-input_id.c
udev_udevd_SOURCES = \
$(udev_common_sources) \
udev/udevadm.c \
udev/udevadm-info.c \
udev/udevadm-control.c \
- udev/udevadm-test.c \
udev/udevadm-monitor.c \
udev/udevadm-settle.c \
- udev/udevadm-trigger.c
+ udev/udevadm-trigger.c \
+ udev/udevadm-test.c \
+ udev/udevadm-test-builtin.c
udev_udevadm_LDADD = libudev/libudev-private.la
udev_test_udev_LDADD = libudev/libudev-private.la
# ------------------------------------------------------------------------------
-# rule_generator - persistent network and optical device rule generator
-# ------------------------------------------------------------------------------
-dist_libexec_SCRIPTS = extras/rule_generator/write_cd_rules \
- extras/rule_generator/write_net_rules $(am__append_12)
-udevhomedir = $(libexecdir)
-dist_udevhome_DATA = extras/rule_generator/rule_generator.functions
-
-# ------------------------------------------------------------------------------
# firmware - firmware loading
# ------------------------------------------------------------------------------
extras_firmware_firmware_SOURCES = extras/firmware/firmware.c
extras_collect_collect_LDADD = libudev/libudev-private.la
# ------------------------------------------------------------------------------
-# edd_id - BIOS EDD block device match
-# ------------------------------------------------------------------------------
-extras_edd_id_edd_id_SOURCES = extras/edd_id/edd_id.c
-extras_edd_id_edd_id_LDADD = libudev/libudev-private.la
-
-# ------------------------------------------------------------------------------
-# create_floppy_devices - historical floppy kernel device nodes (/dev/fd0h1440, ...)
-# ------------------------------------------------------------------------------
-extras_floppy_create_floppy_devices_SOURCES = extras/floppy/create_floppy_devices.c
-extras_floppy_create_floppy_devices_LDADD = libudev/libudev-private.la
-
-# ------------------------------------------------------------------------------
-# 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-private.la
-
-# ------------------------------------------------------------------------------
-# path_id - compose identifier of persistent elements of the parent buses
-# ------------------------------------------------------------------------------
-extras_path_id_path_id_SOURCES = extras/path_id/path_id.c
-extras_path_id_path_id_LDADD = libudev/libudev-private.la
-
-# ------------------------------------------------------------------------------
-# fstab_import - import /etc/fstab entry for block device
-# ------------------------------------------------------------------------------
-extras_fstab_import_fstab_import_SOURCES = extras/fstab_import/fstab_import.c
-extras_fstab_import_fstab_import_LDADD = libudev/libudev-private.la
-
-# ------------------------------------------------------------------------------
# scsi_id - SCSI inquiry to get various serial numbers
# ------------------------------------------------------------------------------
extras_scsi_id_scsi_id_SOURCES = \
extras_scsi_id_scsi_id_LDADD = libudev/libudev-private.la
# ------------------------------------------------------------------------------
-# usb_id - USB device property import
-# ------------------------------------------------------------------------------
-extras_usb_id_usb_id_SOURCES = extras/usb_id/usb_id.c
-extras_usb_id_usb_id_LDADD = libudev/libudev-private.la
-
-# ------------------------------------------------------------------------------
# v4l_id - video4linux capabilities
# ------------------------------------------------------------------------------
extras_v4l_id_v4l_id_SOURCES = extras/v4l_id/v4l_id.c
extras_v4l_id_v4l_id_LDADD = libudev/libudev-private.la
# ------------------------------------------------------------------------------
-# GUdev - libudev gobject interface
+# accelerometer - updates device orientation
# ------------------------------------------------------------------------------
-@ENABLE_EXTRAS_TRUE@LIBGUDEV_CURRENT = 1
-@ENABLE_EXTRAS_TRUE@LIBGUDEV_REVISION = 0
-@ENABLE_EXTRAS_TRUE@LIBGUDEV_AGE = 1
-@ENABLE_EXTRAS_TRUE@libgudev_includedir = $(includedir)/gudev-1.0/gudev
-@ENABLE_EXTRAS_TRUE@libgudev_include_HEADERS = \
-@ENABLE_EXTRAS_TRUE@ extras/gudev/gudev.h \
-@ENABLE_EXTRAS_TRUE@ extras/gudev/gudevenums.h \
-@ENABLE_EXTRAS_TRUE@ extras/gudev/gudevenumtypes.h \
-@ENABLE_EXTRAS_TRUE@ extras/gudev/gudevtypes.h \
-@ENABLE_EXTRAS_TRUE@ extras/gudev/gudevclient.h \
-@ENABLE_EXTRAS_TRUE@ extras/gudev/gudevdevice.h \
-@ENABLE_EXTRAS_TRUE@ extras/gudev/gudevenumerator.h
-
-@ENABLE_EXTRAS_TRUE@extras_gudev_libgudev_1_0_la_SOURCES = \
-@ENABLE_EXTRAS_TRUE@ extras/gudev/gudevenums.h \
-@ENABLE_EXTRAS_TRUE@ extras/gudev/gudevenumtypes.h \
-@ENABLE_EXTRAS_TRUE@ extras/gudev/gudevenumtypes.h\
-@ENABLE_EXTRAS_TRUE@ extras/gudev/gudevtypes.h \
-@ENABLE_EXTRAS_TRUE@ extras/gudev/gudevclient.h \
-@ENABLE_EXTRAS_TRUE@ extras/gudev/gudevclient.c \
-@ENABLE_EXTRAS_TRUE@ extras/gudev/gudevdevice.h \
-@ENABLE_EXTRAS_TRUE@ extras/gudev/gudevdevice.c \
-@ENABLE_EXTRAS_TRUE@ extras/gudev/gudevenumerator.h \
-@ENABLE_EXTRAS_TRUE@ extras/gudev/gudevenumerator.c \
-@ENABLE_EXTRAS_TRUE@ extras/gudev/gudevprivate.h
-
-@ENABLE_EXTRAS_TRUE@dist_extras_gudev_libgudev_1_0_la_SOURCES = \
-@ENABLE_EXTRAS_TRUE@ extras/gudev/gudevmarshal.h \
-@ENABLE_EXTRAS_TRUE@ extras/gudev/gudevmarshal.c \
-@ENABLE_EXTRAS_TRUE@ extras/gudev/gudevenumtypes.h \
-@ENABLE_EXTRAS_TRUE@ extras/gudev/gudevenumtypes.c
-
-@ENABLE_EXTRAS_TRUE@BUILT_SOURCES = $(dist_extras_gudev_libgudev_1_0_la_SOURCES) \
-@ENABLE_EXTRAS_TRUE@ $(nodist_extras_keymap_keymap_SOURCES)
-@ENABLE_EXTRAS_TRUE@extras_gudev_libgudev_1_0_la_CPPFLAGS = \
-@ENABLE_EXTRAS_TRUE@ $(AM_CPPFLAGS) \
-@ENABLE_EXTRAS_TRUE@ -I$(top_builddir)/extras \
-@ENABLE_EXTRAS_TRUE@ -I$(top_srcdir)/extras \
-@ENABLE_EXTRAS_TRUE@ -I$(top_builddir)/extras/gudev \
-@ENABLE_EXTRAS_TRUE@ -I$(top_srcdir)/extras/gudev \
-@ENABLE_EXTRAS_TRUE@ -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT \
-@ENABLE_EXTRAS_TRUE@ -D_GUDEV_COMPILATION \
-@ENABLE_EXTRAS_TRUE@ -DG_LOG_DOMAIN=\"GUdev\"
-
-@ENABLE_EXTRAS_TRUE@extras_gudev_libgudev_1_0_la_CFLAGS = $(GLIB_CFLAGS)
-@ENABLE_EXTRAS_TRUE@extras_gudev_libgudev_1_0_la_LIBADD = libudev/libudev.la $(GLIB_LIBS)
-@ENABLE_EXTRAS_TRUE@extras_gudev_libgudev_1_0_la_LDFLAGS = \
-@ENABLE_EXTRAS_TRUE@ -version-info $(LIBGUDEV_CURRENT):$(LIBGUDEV_REVISION):$(LIBGUDEV_AGE) \
-@ENABLE_EXTRAS_TRUE@ -export-dynamic -no-undefined \
-@ENABLE_EXTRAS_TRUE@ -export-symbols-regex '^g_udev_.*'
-
-@ENABLE_EXTRAS_TRUE@@ENABLE_INTROSPECTION_TRUE@girdir = $(GIRDIR)
-@ENABLE_EXTRAS_TRUE@@ENABLE_INTROSPECTION_TRUE@gir_DATA = extras/gudev/GUdev-1.0.gir
-@ENABLE_EXTRAS_TRUE@@ENABLE_INTROSPECTION_TRUE@typelibsdir = $(GIRTYPELIBDIR)
-@ENABLE_EXTRAS_TRUE@@ENABLE_INTROSPECTION_TRUE@typelibs_DATA = extras/gudev/GUdev-1.0.typelib
+extras_accelerometer_accelerometer_SOURCES = extras/accelerometer/accelerometer.c
+extras_accelerometer_accelerometer_LDADD = libudev/libudev-private.la -lm
# ------------------------------------------------------------------------------
-# Bluetooth HID devices with special magic to switch the device
+# GUdev - libudev gobject interface
# ------------------------------------------------------------------------------
-@ENABLE_EXTRAS_TRUE@extras_hid2hci_hid2hci_SOURCES = extras/hid2hci/hid2hci.c
-@ENABLE_EXTRAS_TRUE@extras_hid2hci_hid2hci_CPPFLAGS = $(AM_CPPFLAGS) $(LIBUSB_CFLAGS)
-@ENABLE_EXTRAS_TRUE@extras_hid2hci_hid2hci_LDADD = libudev/libudev-private.la $(LIBUSB_LIBS)
+@ENABLE_GUDEV_TRUE@LIBGUDEV_CURRENT = 1
+@ENABLE_GUDEV_TRUE@LIBGUDEV_REVISION = 0
+@ENABLE_GUDEV_TRUE@LIBGUDEV_AGE = 1
+@ENABLE_GUDEV_TRUE@libgudev_includedir = $(includedir)/gudev-1.0/gudev
+@ENABLE_GUDEV_TRUE@libgudev_include_HEADERS = \
+@ENABLE_GUDEV_TRUE@ extras/gudev/gudev.h \
+@ENABLE_GUDEV_TRUE@ extras/gudev/gudevenums.h \
+@ENABLE_GUDEV_TRUE@ extras/gudev/gudevenumtypes.h \
+@ENABLE_GUDEV_TRUE@ extras/gudev/gudevtypes.h \
+@ENABLE_GUDEV_TRUE@ extras/gudev/gudevclient.h \
+@ENABLE_GUDEV_TRUE@ extras/gudev/gudevdevice.h \
+@ENABLE_GUDEV_TRUE@ extras/gudev/gudevenumerator.h
+
+@ENABLE_GUDEV_TRUE@extras_gudev_libgudev_1_0_la_SOURCES = \
+@ENABLE_GUDEV_TRUE@ extras/gudev/gudevenums.h \
+@ENABLE_GUDEV_TRUE@ extras/gudev/gudevenumtypes.h \
+@ENABLE_GUDEV_TRUE@ extras/gudev/gudevenumtypes.h\
+@ENABLE_GUDEV_TRUE@ extras/gudev/gudevtypes.h \
+@ENABLE_GUDEV_TRUE@ extras/gudev/gudevclient.h \
+@ENABLE_GUDEV_TRUE@ extras/gudev/gudevclient.c \
+@ENABLE_GUDEV_TRUE@ extras/gudev/gudevdevice.h \
+@ENABLE_GUDEV_TRUE@ extras/gudev/gudevdevice.c \
+@ENABLE_GUDEV_TRUE@ extras/gudev/gudevenumerator.h \
+@ENABLE_GUDEV_TRUE@ extras/gudev/gudevenumerator.c \
+@ENABLE_GUDEV_TRUE@ extras/gudev/gudevprivate.h
+
+@ENABLE_GUDEV_TRUE@dist_extras_gudev_libgudev_1_0_la_SOURCES = \
+@ENABLE_GUDEV_TRUE@ extras/gudev/gudevmarshal.h \
+@ENABLE_GUDEV_TRUE@ extras/gudev/gudevmarshal.c \
+@ENABLE_GUDEV_TRUE@ extras/gudev/gudevenumtypes.h \
+@ENABLE_GUDEV_TRUE@ extras/gudev/gudevenumtypes.c
+
+@ENABLE_GUDEV_TRUE@extras_gudev_libgudev_1_0_la_CPPFLAGS = \
+@ENABLE_GUDEV_TRUE@ $(AM_CPPFLAGS) \
+@ENABLE_GUDEV_TRUE@ -I$(top_builddir)/extras \
+@ENABLE_GUDEV_TRUE@ -I$(top_srcdir)/extras \
+@ENABLE_GUDEV_TRUE@ -I$(top_builddir)/extras/gudev \
+@ENABLE_GUDEV_TRUE@ -I$(top_srcdir)/extras/gudev \
+@ENABLE_GUDEV_TRUE@ -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT \
+@ENABLE_GUDEV_TRUE@ -D_GUDEV_COMPILATION \
+@ENABLE_GUDEV_TRUE@ -DG_LOG_DOMAIN=\"GUdev\"
+
+@ENABLE_GUDEV_TRUE@extras_gudev_libgudev_1_0_la_CFLAGS = \
+@ENABLE_GUDEV_TRUE@ -fvisibility=default \
+@ENABLE_GUDEV_TRUE@ $(GLIB_CFLAGS)
+
+@ENABLE_GUDEV_TRUE@extras_gudev_libgudev_1_0_la_LIBADD = libudev/libudev.la $(GLIB_LIBS)
+@ENABLE_GUDEV_TRUE@extras_gudev_libgudev_1_0_la_LDFLAGS = \
+@ENABLE_GUDEV_TRUE@ -version-info $(LIBGUDEV_CURRENT):$(LIBGUDEV_REVISION):$(LIBGUDEV_AGE) \
+@ENABLE_GUDEV_TRUE@ -export-dynamic -no-undefined \
+@ENABLE_GUDEV_TRUE@ -export-symbols-regex '^g_udev_.*'
+
+@ENABLE_GUDEV_TRUE@@ENABLE_INTROSPECTION_TRUE@girdir = $(GIRDIR)
+@ENABLE_GUDEV_TRUE@@ENABLE_INTROSPECTION_TRUE@gir_DATA = extras/gudev/GUdev-1.0.gir
+@ENABLE_GUDEV_TRUE@@ENABLE_INTROSPECTION_TRUE@typelibsdir = $(GIRTYPELIBDIR)
+@ENABLE_GUDEV_TRUE@@ENABLE_INTROSPECTION_TRUE@typelibs_DATA = extras/gudev/GUdev-1.0.typelib
# ------------------------------------------------------------------------------
-# udev_acl - apply ACLs for users with local forground sessions
+# usb/pci-db - read vendor/device string database
# ------------------------------------------------------------------------------
-@ENABLE_EXTRAS_TRUE@extras_udev_acl_udev_acl_SOURCES = extras/udev-acl/udev-acl.c
-@ENABLE_EXTRAS_TRUE@extras_udev_acl_udev_acl_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS)
-@ENABLE_EXTRAS_TRUE@extras_udev_acl_udev_acl_LDADD = libudev/libudev-private.la -lacl $(GLIB_LIBS)
+@ENABLE_HWDB_TRUE@extras_usb_db_usb_db_SOURCES = extras/usb-db/usb-db.c
+@ENABLE_HWDB_TRUE@extras_usb_db_usb_db_CPPFLAGS = $(AM_CPPFLAGS) -DUSB_DATABASE=\"$(USB_DATABASE)\" -DBUILD_FOR_USB
+@ENABLE_HWDB_TRUE@extras_usb_db_usb_db_LDADD = libudev/libudev-private.la
+@ENABLE_HWDB_TRUE@extras_usb_db_pci_db_SOURCES = extras/usb-db/usb-db.c
+@ENABLE_HWDB_TRUE@extras_usb_db_pci_db_CPPFLAGS = $(AM_CPPFLAGS) -DPCI_DATABASE=\"$(PCI_DATABASE)\" -DBUILD_FOR_PCI
+@ENABLE_HWDB_TRUE@extras_usb_db_pci_db_LDADD = libudev/libudev-private.la
# ------------------------------------------------------------------------------
-# usb-db - read USB vendor/device string database
+# keymap - map custom hardware's multimedia keys
# ------------------------------------------------------------------------------
-@ENABLE_EXTRAS_TRUE@extras_usb_db_usb_db_SOURCES = extras/usb-db/usb-db.c
-@ENABLE_EXTRAS_TRUE@extras_usb_db_usb_db_CPPFLAGS = $(AM_CPPFLAGS) -DUSB_DATABASE=\"$(USB_DATABASE)\" -DBUILD_FOR_USB
-@ENABLE_EXTRAS_TRUE@extras_usb_db_usb_db_LDADD = libudev/libudev-private.la
+@ENABLE_KEYMAP_TRUE@extras_keymap_keymap_SOURCES = extras/keymap/keymap.c
+@ENABLE_KEYMAP_TRUE@extras_keymap_keymap_CPPFLAGS = $(AM_CPPFLAGS) -I extras/keymap
+@ENABLE_KEYMAP_TRUE@nodist_extras_keymap_keymap_SOURCES = \
+@ENABLE_KEYMAP_TRUE@ extras/keymap/keys-from-name.h \
+@ENABLE_KEYMAP_TRUE@ extras/keymap/keys-to-name.h
+
+@ENABLE_KEYMAP_TRUE@dist_doc_DATA = extras/keymap/README.keymap.txt
+@ENABLE_KEYMAP_TRUE@udevkeymapdir = $(libexecdir)/keymaps
+@ENABLE_KEYMAP_TRUE@dist_udevkeymap_DATA = \
+@ENABLE_KEYMAP_TRUE@ extras/keymap/keymaps/acer \
+@ENABLE_KEYMAP_TRUE@ extras/keymap/keymaps/acer-aspire_5720 \
+@ENABLE_KEYMAP_TRUE@ extras/keymap/keymaps/acer-aspire_8930 \
+@ENABLE_KEYMAP_TRUE@ extras/keymap/keymaps/acer-aspire_5920g \
+@ENABLE_KEYMAP_TRUE@ extras/keymap/keymaps/acer-aspire_6920 \
+@ENABLE_KEYMAP_TRUE@ extras/keymap/keymaps/acer-travelmate_c300 \
+@ENABLE_KEYMAP_TRUE@ extras/keymap/keymaps/asus \
+@ENABLE_KEYMAP_TRUE@ extras/keymap/keymaps/compaq-e_evo \
+@ENABLE_KEYMAP_TRUE@ extras/keymap/keymaps/dell \
+@ENABLE_KEYMAP_TRUE@ extras/keymap/keymaps/dell-latitude-xt2 \
+@ENABLE_KEYMAP_TRUE@ extras/keymap/keymaps/everex-xt5000 \
+@ENABLE_KEYMAP_TRUE@ extras/keymap/keymaps/fujitsu-amilo_pa_2548 \
+@ENABLE_KEYMAP_TRUE@ extras/keymap/keymaps/fujitsu-amilo_pro_edition_v3505 \
+@ENABLE_KEYMAP_TRUE@ extras/keymap/keymaps/fujitsu-amilo_pro_v3205 \
+@ENABLE_KEYMAP_TRUE@ extras/keymap/keymaps/fujitsu-amilo_si_1520 \
+@ENABLE_KEYMAP_TRUE@ extras/keymap/keymaps/fujitsu-esprimo_mobile_v5 \
+@ENABLE_KEYMAP_TRUE@ extras/keymap/keymaps/fujitsu-esprimo_mobile_v6 \
+@ENABLE_KEYMAP_TRUE@ extras/keymap/keymaps/genius-slimstar-320 \
+@ENABLE_KEYMAP_TRUE@ extras/keymap/keymaps/hewlett-packard \
+@ENABLE_KEYMAP_TRUE@ extras/keymap/keymaps/hewlett-packard-2510p_2530p \
+@ENABLE_KEYMAP_TRUE@ extras/keymap/keymaps/hewlett-packard-compaq_elitebook \
+@ENABLE_KEYMAP_TRUE@ extras/keymap/keymaps/hewlett-packard-pavilion \
+@ENABLE_KEYMAP_TRUE@ extras/keymap/keymaps/hewlett-packard-presario-2100 \
+@ENABLE_KEYMAP_TRUE@ extras/keymap/keymaps/hewlett-packard-tablet \
+@ENABLE_KEYMAP_TRUE@ extras/keymap/keymaps/hewlett-packard-tx2 \
+@ENABLE_KEYMAP_TRUE@ extras/keymap/keymaps/ibm-thinkpad-usb-keyboard-trackpoint \
+@ENABLE_KEYMAP_TRUE@ extras/keymap/keymaps/inventec-symphony_6.0_7.0 \
+@ENABLE_KEYMAP_TRUE@ extras/keymap/keymaps/lenovo-3000 \
+@ENABLE_KEYMAP_TRUE@ extras/keymap/keymaps/lenovo-ideapad \
+@ENABLE_KEYMAP_TRUE@ extras/keymap/keymaps/lenovo-thinkpad-usb-keyboard-trackpoint \
+@ENABLE_KEYMAP_TRUE@ extras/keymap/keymaps/lenovo-thinkpad_x6_tablet \
+@ENABLE_KEYMAP_TRUE@ extras/keymap/keymaps/lenovo-thinkpad_x200_tablet \
+@ENABLE_KEYMAP_TRUE@ extras/keymap/keymaps/lg-x110 \
+@ENABLE_KEYMAP_TRUE@ extras/keymap/keymaps/logitech-wave \
+@ENABLE_KEYMAP_TRUE@ extras/keymap/keymaps/logitech-wave-cordless \
+@ENABLE_KEYMAP_TRUE@ extras/keymap/keymaps/logitech-wave-pro-cordless \
+@ENABLE_KEYMAP_TRUE@ extras/keymap/keymaps/maxdata-pro_7000 \
+@ENABLE_KEYMAP_TRUE@ extras/keymap/keymaps/medion-fid2060 \
+@ENABLE_KEYMAP_TRUE@ extras/keymap/keymaps/medionnb-a555 \
+@ENABLE_KEYMAP_TRUE@ extras/keymap/keymaps/micro-star \
+@ENABLE_KEYMAP_TRUE@ extras/keymap/keymaps/module-asus-w3j \
+@ENABLE_KEYMAP_TRUE@ extras/keymap/keymaps/module-ibm \
+@ENABLE_KEYMAP_TRUE@ extras/keymap/keymaps/module-lenovo \
+@ENABLE_KEYMAP_TRUE@ extras/keymap/keymaps/module-sony \
+@ENABLE_KEYMAP_TRUE@ extras/keymap/keymaps/module-sony-old \
+@ENABLE_KEYMAP_TRUE@ extras/keymap/keymaps/module-sony-vgn \
+@ENABLE_KEYMAP_TRUE@ extras/keymap/keymaps/olpc-xo \
+@ENABLE_KEYMAP_TRUE@ extras/keymap/keymaps/onkyo \
+@ENABLE_KEYMAP_TRUE@ extras/keymap/keymaps/oqo-model2 \
+@ENABLE_KEYMAP_TRUE@ extras/keymap/keymaps/samsung-other \
+@ENABLE_KEYMAP_TRUE@ extras/keymap/keymaps/samsung-sq1us \
+@ENABLE_KEYMAP_TRUE@ extras/keymap/keymaps/samsung-sx20s \
+@ENABLE_KEYMAP_TRUE@ extras/keymap/keymaps/toshiba-satellite_a100 \
+@ENABLE_KEYMAP_TRUE@ extras/keymap/keymaps/toshiba-satellite_a110 \
+@ENABLE_KEYMAP_TRUE@ extras/keymap/keymaps/toshiba-satellite_m30x \
+@ENABLE_KEYMAP_TRUE@ extras/keymap/keymaps/zepto-znote
+
+@ENABLE_KEYMAP_TRUE@udevkeymapforcereldir = $(libexecdir)/keymaps/force-release
+@ENABLE_KEYMAP_TRUE@dist_udevkeymapforcerel_DATA = \
+@ENABLE_KEYMAP_TRUE@ extras/keymap/force-release-maps/dell-touchpad \
+@ENABLE_KEYMAP_TRUE@ extras/keymap/force-release-maps/hp-other \
+@ENABLE_KEYMAP_TRUE@ extras/keymap/force-release-maps/samsung-other \
+@ENABLE_KEYMAP_TRUE@ extras/keymap/force-release-maps/common-volume-keys
-# ------------------------------------------------------------------------------
-# pci-db - read PCI vendor/device string database
-# ------------------------------------------------------------------------------
-@ENABLE_EXTRAS_TRUE@extras_usb_db_pci_db_SOURCES = extras/usb-db/usb-db.c
-@ENABLE_EXTRAS_TRUE@extras_usb_db_pci_db_CPPFLAGS = $(AM_CPPFLAGS) -DPCI_DATABASE=\"$(PCI_DATABASE)\" -DBUILD_FOR_PCI
-@ENABLE_EXTRAS_TRUE@extras_usb_db_pci_db_LDADD = libudev/libudev-private.la
# ------------------------------------------------------------------------------
-# mobile-action-modeswitch - switch Mobile Action cables into serial mode
+# mtd_probe - autoloads FTL module for mtd devices
# ------------------------------------------------------------------------------
-@ENABLE_EXTRAS_TRUE@extras_mobile_action_modeswitch_mobile_action_modeswitch_SOURCES = \
-@ENABLE_EXTRAS_TRUE@ extras/mobile-action-modeswitch/mobile-action-modeswitch.c \
-@ENABLE_EXTRAS_TRUE@ extras/mobile-action-modeswitch/utils.c \
-@ENABLE_EXTRAS_TRUE@ extras/mobile-action-modeswitch/utils.h \
-@ENABLE_EXTRAS_TRUE@ extras/mobile-action-modeswitch/ma8280p_us.c \
-@ENABLE_EXTRAS_TRUE@ extras/mobile-action-modeswitch/ma8280p_us.h
+@ENABLE_MTD_PROBE_TRUE@extras_mtd_probe_mtd_probe_SOURCES = \
+@ENABLE_MTD_PROBE_TRUE@ extras/mtd_probe/mtd_probe.c \
+@ENABLE_MTD_PROBE_TRUE@ extras/mtd_probe/mtd_probe.h \
+@ENABLE_MTD_PROBE_TRUE@ extras/mtd_probe/probe_smartmedia.c
-@ENABLE_EXTRAS_TRUE@extras_mobile_action_modeswitch_mobile_action_modeswitch_CPPFLAGS = $(AM_CPPFLAGS) $(LIBUSB_CFLAGS)
-@ENABLE_EXTRAS_TRUE@extras_mobile_action_modeswitch_mobile_action_modeswitch_LDADD = libudev/libudev-private.la $(LIBUSB_LIBS)
+@ENABLE_MTD_PROBE_TRUE@extras_mtd_probe_mtd_probe_CPPFLAGS = $(AM_CPPFLAGS)
+@ENABLE_RULE_GENERATOR_TRUE@udevhomedir = $(libexecdir)
+@ENABLE_RULE_GENERATOR_TRUE@dist_udevhome_DATA = extras/rule_generator/rule_generator.functions
# ------------------------------------------------------------------------------
-# mtd_probe - autoloads FTL module for mtd devices
+# udev_acl - apply ACLs for users with local forground sessions
# ------------------------------------------------------------------------------
-@ENABLE_EXTRAS_TRUE@extras_mtd_probe_mtd_probe_SOURCES = \
-@ENABLE_EXTRAS_TRUE@ extras/mtd_probe/mtd_probe.c \
-@ENABLE_EXTRAS_TRUE@ extras/mtd_probe/mtd_probe.h \
-@ENABLE_EXTRAS_TRUE@ extras/mtd_probe/probe_smartmedia.c
-
-@ENABLE_EXTRAS_TRUE@extras_mtd_probe_mtd_probe_CPPFLAGS = $(AM_CPPFLAGS)
+@ENABLE_UDEV_ACL_TRUE@extras_udev_acl_udev_acl_SOURCES = extras/udev-acl/udev-acl.c
+@ENABLE_UDEV_ACL_TRUE@extras_udev_acl_udev_acl_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS)
+@ENABLE_UDEV_ACL_TRUE@extras_udev_acl_udev_acl_LDADD = libudev/libudev-private.la -lacl $(GLIB_LIBS)
# ------------------------------------------------------------------------------
-# keymap - map custom hardware's multimedia keys
+# create_floppy_devices - historical floppy kernel device nodes (/dev/fd0h1440, ...)
# ------------------------------------------------------------------------------
-@ENABLE_EXTRAS_TRUE@extras_keymap_keymap_SOURCES = extras/keymap/keymap.c
-@ENABLE_EXTRAS_TRUE@extras_keymap_keymap_CPPFLAGS = $(AM_CPPFLAGS) -I extras/keymap
-@ENABLE_EXTRAS_TRUE@nodist_extras_keymap_keymap_SOURCES = \
-@ENABLE_EXTRAS_TRUE@ extras/keymap/keys-from-name.h \
-@ENABLE_EXTRAS_TRUE@ extras/keymap/keys-to-name.h
-
-@ENABLE_EXTRAS_TRUE@dist_doc_DATA = extras/keymap/README.keymap.txt
-@ENABLE_EXTRAS_TRUE@udevkeymapdir = $(libexecdir)/keymaps
-@ENABLE_EXTRAS_TRUE@dist_udevkeymap_DATA = \
-@ENABLE_EXTRAS_TRUE@ extras/keymap/keymaps/acer \
-@ENABLE_EXTRAS_TRUE@ extras/keymap/keymaps/acer-aspire_5720 \
-@ENABLE_EXTRAS_TRUE@ extras/keymap/keymaps/acer-aspire_8930 \
-@ENABLE_EXTRAS_TRUE@ extras/keymap/keymaps/acer-aspire_5920g \
-@ENABLE_EXTRAS_TRUE@ extras/keymap/keymaps/acer-aspire_6920 \
-@ENABLE_EXTRAS_TRUE@ extras/keymap/keymaps/acer-travelmate_c300 \
-@ENABLE_EXTRAS_TRUE@ extras/keymap/keymaps/asus \
-@ENABLE_EXTRAS_TRUE@ extras/keymap/keymaps/compaq-e_evo \
-@ENABLE_EXTRAS_TRUE@ extras/keymap/keymaps/dell \
-@ENABLE_EXTRAS_TRUE@ extras/keymap/keymaps/everex-xt5000 \
-@ENABLE_EXTRAS_TRUE@ extras/keymap/keymaps/fujitsu-amilo_pa_2548 \
-@ENABLE_EXTRAS_TRUE@ extras/keymap/keymaps/fujitsu-amilo_pro_edition_v3505 \
-@ENABLE_EXTRAS_TRUE@ extras/keymap/keymaps/fujitsu-amilo_pro_v3205 \
-@ENABLE_EXTRAS_TRUE@ extras/keymap/keymaps/fujitsu-amilo_si_1520 \
-@ENABLE_EXTRAS_TRUE@ extras/keymap/keymaps/fujitsu-esprimo_mobile_v5 \
-@ENABLE_EXTRAS_TRUE@ extras/keymap/keymaps/fujitsu-esprimo_mobile_v6 \
-@ENABLE_EXTRAS_TRUE@ extras/keymap/keymaps/hewlett-packard \
-@ENABLE_EXTRAS_TRUE@ extras/keymap/keymaps/hewlett-packard-2510p_2530p \
-@ENABLE_EXTRAS_TRUE@ extras/keymap/keymaps/hewlett-packard-compaq_elitebook \
-@ENABLE_EXTRAS_TRUE@ extras/keymap/keymaps/hewlett-packard-pavilion \
-@ENABLE_EXTRAS_TRUE@ extras/keymap/keymaps/hewlett-packard-presario-2100 \
-@ENABLE_EXTRAS_TRUE@ extras/keymap/keymaps/hewlett-packard-tablet \
-@ENABLE_EXTRAS_TRUE@ extras/keymap/keymaps/hewlett-packard-tx2 \
-@ENABLE_EXTRAS_TRUE@ extras/keymap/keymaps/ibm-thinkpad-usb-keyboard-trackpoint \
-@ENABLE_EXTRAS_TRUE@ extras/keymap/keymaps/inventec-symphony_6.0_7.0 \
-@ENABLE_EXTRAS_TRUE@ extras/keymap/keymaps/lenovo-3000 \
-@ENABLE_EXTRAS_TRUE@ extras/keymap/keymaps/lenovo-ideapad \
-@ENABLE_EXTRAS_TRUE@ extras/keymap/keymaps/lenovo-thinkpad-usb-keyboard-trackpoint \
-@ENABLE_EXTRAS_TRUE@ extras/keymap/keymaps/lenovo-thinkpad_x6_tablet \
-@ENABLE_EXTRAS_TRUE@ extras/keymap/keymaps/lenovo-thinkpad_x200_tablet \
-@ENABLE_EXTRAS_TRUE@ extras/keymap/keymaps/lg-x110 \
-@ENABLE_EXTRAS_TRUE@ extras/keymap/keymaps/logitech-wave \
-@ENABLE_EXTRAS_TRUE@ extras/keymap/keymaps/logitech-wave-cordless \
-@ENABLE_EXTRAS_TRUE@ extras/keymap/keymaps/logitech-wave-pro-cordless \
-@ENABLE_EXTRAS_TRUE@ extras/keymap/keymaps/maxdata-pro_7000 \
-@ENABLE_EXTRAS_TRUE@ extras/keymap/keymaps/medion-fid2060 \
-@ENABLE_EXTRAS_TRUE@ extras/keymap/keymaps/medionnb-a555 \
-@ENABLE_EXTRAS_TRUE@ extras/keymap/keymaps/micro-star \
-@ENABLE_EXTRAS_TRUE@ extras/keymap/keymaps/module-asus-w3j \
-@ENABLE_EXTRAS_TRUE@ extras/keymap/keymaps/module-ibm \
-@ENABLE_EXTRAS_TRUE@ extras/keymap/keymaps/module-lenovo \
-@ENABLE_EXTRAS_TRUE@ extras/keymap/keymaps/module-sony \
-@ENABLE_EXTRAS_TRUE@ extras/keymap/keymaps/module-sony-old \
-@ENABLE_EXTRAS_TRUE@ extras/keymap/keymaps/module-sony-vgn \
-@ENABLE_EXTRAS_TRUE@ extras/keymap/keymaps/olpc-xo \
-@ENABLE_EXTRAS_TRUE@ extras/keymap/keymaps/onkyo \
-@ENABLE_EXTRAS_TRUE@ extras/keymap/keymaps/oqo-model2 \
-@ENABLE_EXTRAS_TRUE@ extras/keymap/keymaps/samsung-other \
-@ENABLE_EXTRAS_TRUE@ extras/keymap/keymaps/samsung-sq1us \
-@ENABLE_EXTRAS_TRUE@ extras/keymap/keymaps/samsung-sx20s \
-@ENABLE_EXTRAS_TRUE@ extras/keymap/keymaps/toshiba-satellite_a100 \
-@ENABLE_EXTRAS_TRUE@ extras/keymap/keymaps/toshiba-satellite_a110 \
-@ENABLE_EXTRAS_TRUE@ extras/keymap/keymaps/toshiba-satellite_m30x \
-@ENABLE_EXTRAS_TRUE@ extras/keymap/keymaps/zepto-znote
-
-@ENABLE_EXTRAS_TRUE@udevkeymapforcereldir = $(libexecdir)/keymaps/force-release
-@ENABLE_EXTRAS_TRUE@dist_udevkeymapforcerel_DATA = \
-@ENABLE_EXTRAS_TRUE@ extras/keymap/force-release-maps/dell-touchpad \
-@ENABLE_EXTRAS_TRUE@ extras/keymap/force-release-maps/hp-other \
-@ENABLE_EXTRAS_TRUE@ extras/keymap/force-release-maps/samsung-other \
-@ENABLE_EXTRAS_TRUE@ extras/keymap/force-release-maps/common-volume-keys
+@ENABLE_FLOPPY_TRUE@extras_floppy_create_floppy_devices_SOURCES = extras/floppy/create_floppy_devices.c
+@ENABLE_FLOPPY_TRUE@extras_floppy_create_floppy_devices_LDADD = libudev/libudev-private.la
+# ------------------------------------------------------------------------------
+# edd_id - create /dev/disk/by-id/edd-* links for BIOS EDD data
+# ------------------------------------------------------------------------------
+@ENABLE_EDD_TRUE@extras_edd_id_edd_id_SOURCES = extras/edd_id/edd_id.c
+@ENABLE_EDD_TRUE@extras_edd_id_edd_id_LDADD = libudev/libudev-private.la
# ------------------------------------------------------------------------------
# custom release helpers
cd $(top_builddir) && $(SHELL) ./config.status $@
init/udev.service: $(top_builddir)/config.status $(top_srcdir)/init/udev.service.in
cd $(top_builddir) && $(SHELL) ./config.status $@
-init/udev-settle.service: $(top_builddir)/config.status $(top_srcdir)/init/udev-settle.service.in
+init/udev-trigger.service: $(top_builddir)/config.status $(top_srcdir)/init/udev-trigger.service.in
cd $(top_builddir) && $(SHELL) ./config.status $@
-init/udev-retry.service: $(top_builddir)/config.status $(top_srcdir)/init/udev-retry.service.in
+init/udev-settle.service: $(top_builddir)/config.status $(top_srcdir)/init/udev-settle.service.in
cd $(top_builddir) && $(SHELL) ./config.status $@
libudev/libudev.pc: $(top_builddir)/config.status $(top_srcdir)/libudev/libudev.pc.in
cd $(top_builddir) && $(SHELL) ./config.status $@
libudev/$(DEPDIR)/$(am__dirstamp)
libudev/libudev-queue.lo: libudev/$(am__dirstamp) \
libudev/$(DEPDIR)/$(am__dirstamp)
-libudev/libudev-ctrl.lo: libudev/$(am__dirstamp) \
- libudev/$(DEPDIR)/$(am__dirstamp)
libudev/libudev-util-private.lo: libudev/$(am__dirstamp) \
libudev/$(DEPDIR)/$(am__dirstamp)
libudev/libudev-device-private.lo: libudev/$(am__dirstamp) \
list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
echo " rm -f" $$list; \
rm -f $$list
+extras/accelerometer/$(am__dirstamp):
+ @$(MKDIR_P) extras/accelerometer
+ @: > extras/accelerometer/$(am__dirstamp)
+extras/accelerometer/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) extras/accelerometer/$(DEPDIR)
+ @: > extras/accelerometer/$(DEPDIR)/$(am__dirstamp)
+extras/accelerometer/accelerometer.$(OBJEXT): \
+ extras/accelerometer/$(am__dirstamp) \
+ extras/accelerometer/$(DEPDIR)/$(am__dirstamp)
+extras/accelerometer/accelerometer$(EXEEXT): $(extras_accelerometer_accelerometer_OBJECTS) $(extras_accelerometer_accelerometer_DEPENDENCIES) extras/accelerometer/$(am__dirstamp)
+ @rm -f extras/accelerometer/accelerometer$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(extras_accelerometer_accelerometer_OBJECTS) $(extras_accelerometer_accelerometer_LDADD) $(LIBS)
extras/ata_id/$(am__dirstamp):
@$(MKDIR_P) extras/ata_id
@: > extras/ata_id/$(am__dirstamp)
extras/floppy/create_floppy_devices$(EXEEXT): $(extras_floppy_create_floppy_devices_OBJECTS) $(extras_floppy_create_floppy_devices_DEPENDENCIES) extras/floppy/$(am__dirstamp)
@rm -f extras/floppy/create_floppy_devices$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(extras_floppy_create_floppy_devices_OBJECTS) $(extras_floppy_create_floppy_devices_LDADD) $(LIBS)
-extras/fstab_import/$(am__dirstamp):
- @$(MKDIR_P) extras/fstab_import
- @: > extras/fstab_import/$(am__dirstamp)
-extras/fstab_import/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) extras/fstab_import/$(DEPDIR)
- @: > extras/fstab_import/$(DEPDIR)/$(am__dirstamp)
-extras/fstab_import/fstab_import.$(OBJEXT): \
- extras/fstab_import/$(am__dirstamp) \
- extras/fstab_import/$(DEPDIR)/$(am__dirstamp)
-extras/fstab_import/fstab_import$(EXEEXT): $(extras_fstab_import_fstab_import_OBJECTS) $(extras_fstab_import_fstab_import_DEPENDENCIES) extras/fstab_import/$(am__dirstamp)
- @rm -f extras/fstab_import/fstab_import$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(extras_fstab_import_fstab_import_OBJECTS) $(extras_fstab_import_fstab_import_LDADD) $(LIBS)
-extras/hid2hci/$(am__dirstamp):
- @$(MKDIR_P) extras/hid2hci
- @: > extras/hid2hci/$(am__dirstamp)
-extras/hid2hci/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) extras/hid2hci/$(DEPDIR)
- @: > extras/hid2hci/$(DEPDIR)/$(am__dirstamp)
-extras/hid2hci/extras_hid2hci_hid2hci-hid2hci.$(OBJEXT): \
- extras/hid2hci/$(am__dirstamp) \
- extras/hid2hci/$(DEPDIR)/$(am__dirstamp)
-extras/hid2hci/hid2hci$(EXEEXT): $(extras_hid2hci_hid2hci_OBJECTS) $(extras_hid2hci_hid2hci_DEPENDENCIES) extras/hid2hci/$(am__dirstamp)
- @rm -f extras/hid2hci/hid2hci$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(extras_hid2hci_hid2hci_OBJECTS) $(extras_hid2hci_hid2hci_LDADD) $(LIBS)
-extras/input_id/$(am__dirstamp):
- @$(MKDIR_P) extras/input_id
- @: > extras/input_id/$(am__dirstamp)
-extras/input_id/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) extras/input_id/$(DEPDIR)
- @: > extras/input_id/$(DEPDIR)/$(am__dirstamp)
-extras/input_id/input_id.$(OBJEXT): extras/input_id/$(am__dirstamp) \
- extras/input_id/$(DEPDIR)/$(am__dirstamp)
-extras/input_id/input_id$(EXEEXT): $(extras_input_id_input_id_OBJECTS) $(extras_input_id_input_id_DEPENDENCIES) extras/input_id/$(am__dirstamp)
- @rm -f extras/input_id/input_id$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(extras_input_id_input_id_OBJECTS) $(extras_input_id_input_id_LDADD) $(LIBS)
extras/keymap/$(am__dirstamp):
@$(MKDIR_P) extras/keymap
@: > extras/keymap/$(am__dirstamp)
extras/keymap/keymap$(EXEEXT): $(extras_keymap_keymap_OBJECTS) $(extras_keymap_keymap_DEPENDENCIES) extras/keymap/$(am__dirstamp)
@rm -f extras/keymap/keymap$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(extras_keymap_keymap_OBJECTS) $(extras_keymap_keymap_LDADD) $(LIBS)
-extras/mobile-action-modeswitch/$(am__dirstamp):
- @$(MKDIR_P) extras/mobile-action-modeswitch
- @: > extras/mobile-action-modeswitch/$(am__dirstamp)
-extras/mobile-action-modeswitch/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) extras/mobile-action-modeswitch/$(DEPDIR)
- @: > extras/mobile-action-modeswitch/$(DEPDIR)/$(am__dirstamp)
-extras/mobile-action-modeswitch/extras_mobile_action_modeswitch_mobile_action_modeswitch-mobile-action-modeswitch.$(OBJEXT): \
- extras/mobile-action-modeswitch/$(am__dirstamp) \
- extras/mobile-action-modeswitch/$(DEPDIR)/$(am__dirstamp)
-extras/mobile-action-modeswitch/extras_mobile_action_modeswitch_mobile_action_modeswitch-utils.$(OBJEXT): \
- extras/mobile-action-modeswitch/$(am__dirstamp) \
- extras/mobile-action-modeswitch/$(DEPDIR)/$(am__dirstamp)
-extras/mobile-action-modeswitch/extras_mobile_action_modeswitch_mobile_action_modeswitch-ma8280p_us.$(OBJEXT): \
- extras/mobile-action-modeswitch/$(am__dirstamp) \
- extras/mobile-action-modeswitch/$(DEPDIR)/$(am__dirstamp)
-extras/mobile-action-modeswitch/mobile-action-modeswitch$(EXEEXT): $(extras_mobile_action_modeswitch_mobile_action_modeswitch_OBJECTS) $(extras_mobile_action_modeswitch_mobile_action_modeswitch_DEPENDENCIES) extras/mobile-action-modeswitch/$(am__dirstamp)
- @rm -f extras/mobile-action-modeswitch/mobile-action-modeswitch$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(extras_mobile_action_modeswitch_mobile_action_modeswitch_OBJECTS) $(extras_mobile_action_modeswitch_mobile_action_modeswitch_LDADD) $(LIBS)
extras/mtd_probe/$(am__dirstamp):
@$(MKDIR_P) extras/mtd_probe
@: > extras/mtd_probe/$(am__dirstamp)
extras/mtd_probe/mtd_probe$(EXEEXT): $(extras_mtd_probe_mtd_probe_OBJECTS) $(extras_mtd_probe_mtd_probe_DEPENDENCIES) extras/mtd_probe/$(am__dirstamp)
@rm -f extras/mtd_probe/mtd_probe$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(extras_mtd_probe_mtd_probe_OBJECTS) $(extras_mtd_probe_mtd_probe_LDADD) $(LIBS)
-extras/path_id/$(am__dirstamp):
- @$(MKDIR_P) extras/path_id
- @: > extras/path_id/$(am__dirstamp)
-extras/path_id/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) extras/path_id/$(DEPDIR)
- @: > extras/path_id/$(DEPDIR)/$(am__dirstamp)
-extras/path_id/path_id.$(OBJEXT): extras/path_id/$(am__dirstamp) \
- extras/path_id/$(DEPDIR)/$(am__dirstamp)
-extras/path_id/path_id$(EXEEXT): $(extras_path_id_path_id_OBJECTS) $(extras_path_id_path_id_DEPENDENCIES) extras/path_id/$(am__dirstamp)
- @rm -f extras/path_id/path_id$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(extras_path_id_path_id_OBJECTS) $(extras_path_id_path_id_LDADD) $(LIBS)
extras/scsi_id/$(am__dirstamp):
@$(MKDIR_P) extras/scsi_id
@: > extras/scsi_id/$(am__dirstamp)
extras/usb-db/usb-db$(EXEEXT): $(extras_usb_db_usb_db_OBJECTS) $(extras_usb_db_usb_db_DEPENDENCIES) extras/usb-db/$(am__dirstamp)
@rm -f extras/usb-db/usb-db$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(extras_usb_db_usb_db_OBJECTS) $(extras_usb_db_usb_db_LDADD) $(LIBS)
-extras/usb_id/$(am__dirstamp):
- @$(MKDIR_P) extras/usb_id
- @: > extras/usb_id/$(am__dirstamp)
-extras/usb_id/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) extras/usb_id/$(DEPDIR)
- @: > extras/usb_id/$(DEPDIR)/$(am__dirstamp)
-extras/usb_id/usb_id.$(OBJEXT): extras/usb_id/$(am__dirstamp) \
- extras/usb_id/$(DEPDIR)/$(am__dirstamp)
-extras/usb_id/usb_id$(EXEEXT): $(extras_usb_id_usb_id_OBJECTS) $(extras_usb_id_usb_id_DEPENDENCIES) extras/usb_id/$(am__dirstamp)
- @rm -f extras/usb_id/usb_id$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(extras_usb_id_usb_id_OBJECTS) $(extras_usb_id_usb_id_LDADD) $(LIBS)
extras/v4l_id/$(am__dirstamp):
@$(MKDIR_P) extras/v4l_id
@: > extras/v4l_id/$(am__dirstamp)
udev/$(DEPDIR)/$(am__dirstamp)
udev/udev-rules.$(OBJEXT): udev/$(am__dirstamp) \
udev/$(DEPDIR)/$(am__dirstamp)
+udev/udev-ctrl.$(OBJEXT): udev/$(am__dirstamp) \
+ udev/$(DEPDIR)/$(am__dirstamp)
+udev/udev-builtin.$(OBJEXT): udev/$(am__dirstamp) \
+ udev/$(DEPDIR)/$(am__dirstamp)
+udev/udev-builtin-path_id.$(OBJEXT): udev/$(am__dirstamp) \
+ udev/$(DEPDIR)/$(am__dirstamp)
+udev/udev-builtin-usb_id.$(OBJEXT): udev/$(am__dirstamp) \
+ udev/$(DEPDIR)/$(am__dirstamp)
+udev/udev-builtin-input_id.$(OBJEXT): udev/$(am__dirstamp) \
+ udev/$(DEPDIR)/$(am__dirstamp)
udev/test-udev.$(OBJEXT): udev/$(am__dirstamp) \
udev/$(DEPDIR)/$(am__dirstamp)
udev/test-udev$(EXEEXT): $(udev_test_udev_OBJECTS) $(udev_test_udev_DEPENDENCIES) udev/$(am__dirstamp)
udev/$(DEPDIR)/$(am__dirstamp)
udev/udevadm-control.$(OBJEXT): udev/$(am__dirstamp) \
udev/$(DEPDIR)/$(am__dirstamp)
-udev/udevadm-test.$(OBJEXT): udev/$(am__dirstamp) \
- udev/$(DEPDIR)/$(am__dirstamp)
udev/udevadm-monitor.$(OBJEXT): udev/$(am__dirstamp) \
udev/$(DEPDIR)/$(am__dirstamp)
udev/udevadm-settle.$(OBJEXT): udev/$(am__dirstamp) \
udev/$(DEPDIR)/$(am__dirstamp)
udev/udevadm-trigger.$(OBJEXT): udev/$(am__dirstamp) \
udev/$(DEPDIR)/$(am__dirstamp)
+udev/udevadm-test.$(OBJEXT): udev/$(am__dirstamp) \
+ udev/$(DEPDIR)/$(am__dirstamp)
+udev/udevadm-test-builtin.$(OBJEXT): udev/$(am__dirstamp) \
+ udev/$(DEPDIR)/$(am__dirstamp)
udev/udevadm$(EXEEXT): $(udev_udevadm_OBJECTS) $(udev_udevadm_DEPENDENCIES) udev/$(am__dirstamp)
@rm -f udev/udevadm$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(udev_udevadm_OBJECTS) $(udev_udevadm_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
+ -rm -f extras/accelerometer/accelerometer.$(OBJEXT)
-rm -f extras/ata_id/ata_id.$(OBJEXT)
-rm -f extras/cdrom_id/cdrom_id.$(OBJEXT)
-rm -f extras/collect/collect.$(OBJEXT)
-rm -f extras/edd_id/edd_id.$(OBJEXT)
-rm -f extras/firmware/extras_firmware_firmware-firmware.$(OBJEXT)
-rm -f extras/floppy/create_floppy_devices.$(OBJEXT)
- -rm -f extras/fstab_import/fstab_import.$(OBJEXT)
-rm -f extras/gudev/extras_gudev_libgudev_1_0_la-gudevclient.$(OBJEXT)
-rm -f extras/gudev/extras_gudev_libgudev_1_0_la-gudevclient.lo
-rm -f extras/gudev/extras_gudev_libgudev_1_0_la-gudevdevice.$(OBJEXT)
-rm -f extras/gudev/extras_gudev_libgudev_1_0_la-gudevenumtypes.lo
-rm -f extras/gudev/extras_gudev_libgudev_1_0_la-gudevmarshal.$(OBJEXT)
-rm -f extras/gudev/extras_gudev_libgudev_1_0_la-gudevmarshal.lo
- -rm -f extras/hid2hci/extras_hid2hci_hid2hci-hid2hci.$(OBJEXT)
- -rm -f extras/input_id/input_id.$(OBJEXT)
-rm -f extras/keymap/extras_keymap_keymap-keymap.$(OBJEXT)
- -rm -f extras/mobile-action-modeswitch/extras_mobile_action_modeswitch_mobile_action_modeswitch-ma8280p_us.$(OBJEXT)
- -rm -f extras/mobile-action-modeswitch/extras_mobile_action_modeswitch_mobile_action_modeswitch-mobile-action-modeswitch.$(OBJEXT)
- -rm -f extras/mobile-action-modeswitch/extras_mobile_action_modeswitch_mobile_action_modeswitch-utils.$(OBJEXT)
-rm -f extras/mtd_probe/extras_mtd_probe_mtd_probe-mtd_probe.$(OBJEXT)
-rm -f extras/mtd_probe/extras_mtd_probe_mtd_probe-probe_smartmedia.$(OBJEXT)
- -rm -f extras/path_id/path_id.$(OBJEXT)
-rm -f extras/scsi_id/scsi_id.$(OBJEXT)
-rm -f extras/scsi_id/scsi_serial.$(OBJEXT)
-rm -f extras/udev-acl/extras_udev_acl_udev_acl-udev-acl.$(OBJEXT)
-rm -f extras/usb-db/extras_usb_db_pci_db-usb-db.$(OBJEXT)
-rm -f extras/usb-db/extras_usb_db_usb_db-usb-db.$(OBJEXT)
- -rm -f extras/usb_id/usb_id.$(OBJEXT)
-rm -f extras/v4l_id/v4l_id.$(OBJEXT)
- -rm -f libudev/libudev-ctrl.$(OBJEXT)
- -rm -f libudev/libudev-ctrl.lo
-rm -f libudev/libudev-device-private.$(OBJEXT)
-rm -f libudev/libudev-device-private.lo
-rm -f libudev/libudev-device.$(OBJEXT)
-rm -f libudev/test-libudev.$(OBJEXT)
-rm -f udev/sd-daemon.$(OBJEXT)
-rm -f udev/test-udev.$(OBJEXT)
+ -rm -f udev/udev-builtin-input_id.$(OBJEXT)
+ -rm -f udev/udev-builtin-path_id.$(OBJEXT)
+ -rm -f udev/udev-builtin-usb_id.$(OBJEXT)
+ -rm -f udev/udev-builtin.$(OBJEXT)
+ -rm -f udev/udev-ctrl.$(OBJEXT)
-rm -f udev/udev-event.$(OBJEXT)
-rm -f udev/udev-node.$(OBJEXT)
-rm -f udev/udev-rules.$(OBJEXT)
-rm -f udev/udevadm-info.$(OBJEXT)
-rm -f udev/udevadm-monitor.$(OBJEXT)
-rm -f udev/udevadm-settle.$(OBJEXT)
+ -rm -f udev/udevadm-test-builtin.$(OBJEXT)
-rm -f udev/udevadm-test.$(OBJEXT)
-rm -f udev/udevadm-trigger.$(OBJEXT)
-rm -f udev/udevadm.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
+@AMDEP_TRUE@@am__include@ @am__quote@extras/accelerometer/$(DEPDIR)/accelerometer.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@extras/ata_id/$(DEPDIR)/ata_id.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@extras/cdrom_id/$(DEPDIR)/cdrom_id.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@extras/collect/$(DEPDIR)/collect.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@extras/edd_id/$(DEPDIR)/edd_id.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@extras/firmware/$(DEPDIR)/extras_firmware_firmware-firmware.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@extras/floppy/$(DEPDIR)/create_floppy_devices.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@extras/fstab_import/$(DEPDIR)/fstab_import.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@extras/gudev/$(DEPDIR)/extras_gudev_libgudev_1_0_la-gudevclient.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@extras/gudev/$(DEPDIR)/extras_gudev_libgudev_1_0_la-gudevdevice.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@extras/gudev/$(DEPDIR)/extras_gudev_libgudev_1_0_la-gudevenumerator.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@extras/gudev/$(DEPDIR)/extras_gudev_libgudev_1_0_la-gudevenumtypes.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@extras/gudev/$(DEPDIR)/extras_gudev_libgudev_1_0_la-gudevmarshal.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@extras/hid2hci/$(DEPDIR)/extras_hid2hci_hid2hci-hid2hci.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@extras/input_id/$(DEPDIR)/input_id.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@extras/keymap/$(DEPDIR)/extras_keymap_keymap-keymap.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@extras/mobile-action-modeswitch/$(DEPDIR)/extras_mobile_action_modeswitch_mobile_action_modeswitch-ma8280p_us.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@extras/mobile-action-modeswitch/$(DEPDIR)/extras_mobile_action_modeswitch_mobile_action_modeswitch-mobile-action-modeswitch.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@extras/mobile-action-modeswitch/$(DEPDIR)/extras_mobile_action_modeswitch_mobile_action_modeswitch-utils.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@extras/mtd_probe/$(DEPDIR)/extras_mtd_probe_mtd_probe-mtd_probe.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@extras/mtd_probe/$(DEPDIR)/extras_mtd_probe_mtd_probe-probe_smartmedia.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@extras/path_id/$(DEPDIR)/path_id.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@extras/scsi_id/$(DEPDIR)/scsi_id.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@extras/scsi_id/$(DEPDIR)/scsi_serial.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@extras/udev-acl/$(DEPDIR)/extras_udev_acl_udev_acl-udev-acl.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@extras/usb-db/$(DEPDIR)/extras_usb_db_pci_db-usb-db.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@extras/usb-db/$(DEPDIR)/extras_usb_db_usb_db-usb-db.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@extras/usb_id/$(DEPDIR)/usb_id.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@extras/v4l_id/$(DEPDIR)/v4l_id.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@libudev/$(DEPDIR)/libudev-ctrl.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libudev/$(DEPDIR)/libudev-device-private.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libudev/$(DEPDIR)/libudev-device.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libudev/$(DEPDIR)/libudev-enumerate.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libudev/$(DEPDIR)/test-libudev.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@udev/$(DEPDIR)/sd-daemon.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@udev/$(DEPDIR)/test-udev.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@udev/$(DEPDIR)/udev-builtin-input_id.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@udev/$(DEPDIR)/udev-builtin-path_id.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@udev/$(DEPDIR)/udev-builtin-usb_id.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@udev/$(DEPDIR)/udev-builtin.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@udev/$(DEPDIR)/udev-ctrl.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@udev/$(DEPDIR)/udev-event.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@udev/$(DEPDIR)/udev-node.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@udev/$(DEPDIR)/udev-rules.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@udev/$(DEPDIR)/udevadm-info.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@udev/$(DEPDIR)/udevadm-monitor.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@udev/$(DEPDIR)/udevadm-settle.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@udev/$(DEPDIR)/udevadm-test-builtin.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@udev/$(DEPDIR)/udevadm-test.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@udev/$(DEPDIR)/udevadm-trigger.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@udev/$(DEPDIR)/udevadm.Po@am__quote@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(extras_firmware_firmware_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o extras/firmware/extras_firmware_firmware-firmware.obj `if test -f 'extras/firmware/firmware.c'; then $(CYGPATH_W) 'extras/firmware/firmware.c'; else $(CYGPATH_W) '$(srcdir)/extras/firmware/firmware.c'; fi`
-extras/hid2hci/extras_hid2hci_hid2hci-hid2hci.o: extras/hid2hci/hid2hci.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(extras_hid2hci_hid2hci_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT extras/hid2hci/extras_hid2hci_hid2hci-hid2hci.o -MD -MP -MF extras/hid2hci/$(DEPDIR)/extras_hid2hci_hid2hci-hid2hci.Tpo -c -o extras/hid2hci/extras_hid2hci_hid2hci-hid2hci.o `test -f 'extras/hid2hci/hid2hci.c' || echo '$(srcdir)/'`extras/hid2hci/hid2hci.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) extras/hid2hci/$(DEPDIR)/extras_hid2hci_hid2hci-hid2hci.Tpo extras/hid2hci/$(DEPDIR)/extras_hid2hci_hid2hci-hid2hci.Po
-@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='extras/hid2hci/hid2hci.c' object='extras/hid2hci/extras_hid2hci_hid2hci-hid2hci.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(extras_hid2hci_hid2hci_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o extras/hid2hci/extras_hid2hci_hid2hci-hid2hci.o `test -f 'extras/hid2hci/hid2hci.c' || echo '$(srcdir)/'`extras/hid2hci/hid2hci.c
-
-extras/hid2hci/extras_hid2hci_hid2hci-hid2hci.obj: extras/hid2hci/hid2hci.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(extras_hid2hci_hid2hci_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT extras/hid2hci/extras_hid2hci_hid2hci-hid2hci.obj -MD -MP -MF extras/hid2hci/$(DEPDIR)/extras_hid2hci_hid2hci-hid2hci.Tpo -c -o extras/hid2hci/extras_hid2hci_hid2hci-hid2hci.obj `if test -f 'extras/hid2hci/hid2hci.c'; then $(CYGPATH_W) 'extras/hid2hci/hid2hci.c'; else $(CYGPATH_W) '$(srcdir)/extras/hid2hci/hid2hci.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) extras/hid2hci/$(DEPDIR)/extras_hid2hci_hid2hci-hid2hci.Tpo extras/hid2hci/$(DEPDIR)/extras_hid2hci_hid2hci-hid2hci.Po
-@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='extras/hid2hci/hid2hci.c' object='extras/hid2hci/extras_hid2hci_hid2hci-hid2hci.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(extras_hid2hci_hid2hci_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o extras/hid2hci/extras_hid2hci_hid2hci-hid2hci.obj `if test -f 'extras/hid2hci/hid2hci.c'; then $(CYGPATH_W) 'extras/hid2hci/hid2hci.c'; else $(CYGPATH_W) '$(srcdir)/extras/hid2hci/hid2hci.c'; fi`
-
extras/keymap/extras_keymap_keymap-keymap.o: extras/keymap/keymap.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(extras_keymap_keymap_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT extras/keymap/extras_keymap_keymap-keymap.o -MD -MP -MF extras/keymap/$(DEPDIR)/extras_keymap_keymap-keymap.Tpo -c -o extras/keymap/extras_keymap_keymap-keymap.o `test -f 'extras/keymap/keymap.c' || echo '$(srcdir)/'`extras/keymap/keymap.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) extras/keymap/$(DEPDIR)/extras_keymap_keymap-keymap.Tpo extras/keymap/$(DEPDIR)/extras_keymap_keymap-keymap.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(extras_keymap_keymap_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o extras/keymap/extras_keymap_keymap-keymap.obj `if test -f 'extras/keymap/keymap.c'; then $(CYGPATH_W) 'extras/keymap/keymap.c'; else $(CYGPATH_W) '$(srcdir)/extras/keymap/keymap.c'; fi`
-extras/mobile-action-modeswitch/extras_mobile_action_modeswitch_mobile_action_modeswitch-mobile-action-modeswitch.o: extras/mobile-action-modeswitch/mobile-action-modeswitch.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(extras_mobile_action_modeswitch_mobile_action_modeswitch_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT extras/mobile-action-modeswitch/extras_mobile_action_modeswitch_mobile_action_modeswitch-mobile-action-modeswitch.o -MD -MP -MF extras/mobile-action-modeswitch/$(DEPDIR)/extras_mobile_action_modeswitch_mobile_action_modeswitch-mobile-action-modeswitch.Tpo -c -o extras/mobile-action-modeswitch/extras_mobile_action_modeswitch_mobile_action_modeswitch-mobile-action-modeswitch.o `test -f 'extras/mobile-action-modeswitch/mobile-action-modeswitch.c' || echo '$(srcdir)/'`extras/mobile-action-modeswitch/mobile-action-modeswitch.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) extras/mobile-action-modeswitch/$(DEPDIR)/extras_mobile_action_modeswitch_mobile_action_modeswitch-mobile-action-modeswitch.Tpo extras/mobile-action-modeswitch/$(DEPDIR)/extras_mobile_action_modeswitch_mobile_action_modeswitch-mobile-action-modeswitch.Po
-@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='extras/mobile-action-modeswitch/mobile-action-modeswitch.c' object='extras/mobile-action-modeswitch/extras_mobile_action_modeswitch_mobile_action_modeswitch-mobile-action-modeswitch.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(extras_mobile_action_modeswitch_mobile_action_modeswitch_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o extras/mobile-action-modeswitch/extras_mobile_action_modeswitch_mobile_action_modeswitch-mobile-action-modeswitch.o `test -f 'extras/mobile-action-modeswitch/mobile-action-modeswitch.c' || echo '$(srcdir)/'`extras/mobile-action-modeswitch/mobile-action-modeswitch.c
-
-extras/mobile-action-modeswitch/extras_mobile_action_modeswitch_mobile_action_modeswitch-mobile-action-modeswitch.obj: extras/mobile-action-modeswitch/mobile-action-modeswitch.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(extras_mobile_action_modeswitch_mobile_action_modeswitch_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT extras/mobile-action-modeswitch/extras_mobile_action_modeswitch_mobile_action_modeswitch-mobile-action-modeswitch.obj -MD -MP -MF extras/mobile-action-modeswitch/$(DEPDIR)/extras_mobile_action_modeswitch_mobile_action_modeswitch-mobile-action-modeswitch.Tpo -c -o extras/mobile-action-modeswitch/extras_mobile_action_modeswitch_mobile_action_modeswitch-mobile-action-modeswitch.obj `if test -f 'extras/mobile-action-modeswitch/mobile-action-modeswitch.c'; then $(CYGPATH_W) 'extras/mobile-action-modeswitch/mobile-action-modeswitch.c'; else $(CYGPATH_W) '$(srcdir)/extras/mobile-action-modeswitch/mobile-action-modeswitch.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) extras/mobile-action-modeswitch/$(DEPDIR)/extras_mobile_action_modeswitch_mobile_action_modeswitch-mobile-action-modeswitch.Tpo extras/mobile-action-modeswitch/$(DEPDIR)/extras_mobile_action_modeswitch_mobile_action_modeswitch-mobile-action-modeswitch.Po
-@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='extras/mobile-action-modeswitch/mobile-action-modeswitch.c' object='extras/mobile-action-modeswitch/extras_mobile_action_modeswitch_mobile_action_modeswitch-mobile-action-modeswitch.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(extras_mobile_action_modeswitch_mobile_action_modeswitch_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o extras/mobile-action-modeswitch/extras_mobile_action_modeswitch_mobile_action_modeswitch-mobile-action-modeswitch.obj `if test -f 'extras/mobile-action-modeswitch/mobile-action-modeswitch.c'; then $(CYGPATH_W) 'extras/mobile-action-modeswitch/mobile-action-modeswitch.c'; else $(CYGPATH_W) '$(srcdir)/extras/mobile-action-modeswitch/mobile-action-modeswitch.c'; fi`
-
-extras/mobile-action-modeswitch/extras_mobile_action_modeswitch_mobile_action_modeswitch-utils.o: extras/mobile-action-modeswitch/utils.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(extras_mobile_action_modeswitch_mobile_action_modeswitch_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT extras/mobile-action-modeswitch/extras_mobile_action_modeswitch_mobile_action_modeswitch-utils.o -MD -MP -MF extras/mobile-action-modeswitch/$(DEPDIR)/extras_mobile_action_modeswitch_mobile_action_modeswitch-utils.Tpo -c -o extras/mobile-action-modeswitch/extras_mobile_action_modeswitch_mobile_action_modeswitch-utils.o `test -f 'extras/mobile-action-modeswitch/utils.c' || echo '$(srcdir)/'`extras/mobile-action-modeswitch/utils.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) extras/mobile-action-modeswitch/$(DEPDIR)/extras_mobile_action_modeswitch_mobile_action_modeswitch-utils.Tpo extras/mobile-action-modeswitch/$(DEPDIR)/extras_mobile_action_modeswitch_mobile_action_modeswitch-utils.Po
-@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='extras/mobile-action-modeswitch/utils.c' object='extras/mobile-action-modeswitch/extras_mobile_action_modeswitch_mobile_action_modeswitch-utils.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(extras_mobile_action_modeswitch_mobile_action_modeswitch_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o extras/mobile-action-modeswitch/extras_mobile_action_modeswitch_mobile_action_modeswitch-utils.o `test -f 'extras/mobile-action-modeswitch/utils.c' || echo '$(srcdir)/'`extras/mobile-action-modeswitch/utils.c
-
-extras/mobile-action-modeswitch/extras_mobile_action_modeswitch_mobile_action_modeswitch-utils.obj: extras/mobile-action-modeswitch/utils.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(extras_mobile_action_modeswitch_mobile_action_modeswitch_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT extras/mobile-action-modeswitch/extras_mobile_action_modeswitch_mobile_action_modeswitch-utils.obj -MD -MP -MF extras/mobile-action-modeswitch/$(DEPDIR)/extras_mobile_action_modeswitch_mobile_action_modeswitch-utils.Tpo -c -o extras/mobile-action-modeswitch/extras_mobile_action_modeswitch_mobile_action_modeswitch-utils.obj `if test -f 'extras/mobile-action-modeswitch/utils.c'; then $(CYGPATH_W) 'extras/mobile-action-modeswitch/utils.c'; else $(CYGPATH_W) '$(srcdir)/extras/mobile-action-modeswitch/utils.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) extras/mobile-action-modeswitch/$(DEPDIR)/extras_mobile_action_modeswitch_mobile_action_modeswitch-utils.Tpo extras/mobile-action-modeswitch/$(DEPDIR)/extras_mobile_action_modeswitch_mobile_action_modeswitch-utils.Po
-@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='extras/mobile-action-modeswitch/utils.c' object='extras/mobile-action-modeswitch/extras_mobile_action_modeswitch_mobile_action_modeswitch-utils.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(extras_mobile_action_modeswitch_mobile_action_modeswitch_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o extras/mobile-action-modeswitch/extras_mobile_action_modeswitch_mobile_action_modeswitch-utils.obj `if test -f 'extras/mobile-action-modeswitch/utils.c'; then $(CYGPATH_W) 'extras/mobile-action-modeswitch/utils.c'; else $(CYGPATH_W) '$(srcdir)/extras/mobile-action-modeswitch/utils.c'; fi`
-
-extras/mobile-action-modeswitch/extras_mobile_action_modeswitch_mobile_action_modeswitch-ma8280p_us.o: extras/mobile-action-modeswitch/ma8280p_us.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(extras_mobile_action_modeswitch_mobile_action_modeswitch_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT extras/mobile-action-modeswitch/extras_mobile_action_modeswitch_mobile_action_modeswitch-ma8280p_us.o -MD -MP -MF extras/mobile-action-modeswitch/$(DEPDIR)/extras_mobile_action_modeswitch_mobile_action_modeswitch-ma8280p_us.Tpo -c -o extras/mobile-action-modeswitch/extras_mobile_action_modeswitch_mobile_action_modeswitch-ma8280p_us.o `test -f 'extras/mobile-action-modeswitch/ma8280p_us.c' || echo '$(srcdir)/'`extras/mobile-action-modeswitch/ma8280p_us.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) extras/mobile-action-modeswitch/$(DEPDIR)/extras_mobile_action_modeswitch_mobile_action_modeswitch-ma8280p_us.Tpo extras/mobile-action-modeswitch/$(DEPDIR)/extras_mobile_action_modeswitch_mobile_action_modeswitch-ma8280p_us.Po
-@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='extras/mobile-action-modeswitch/ma8280p_us.c' object='extras/mobile-action-modeswitch/extras_mobile_action_modeswitch_mobile_action_modeswitch-ma8280p_us.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(extras_mobile_action_modeswitch_mobile_action_modeswitch_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o extras/mobile-action-modeswitch/extras_mobile_action_modeswitch_mobile_action_modeswitch-ma8280p_us.o `test -f 'extras/mobile-action-modeswitch/ma8280p_us.c' || echo '$(srcdir)/'`extras/mobile-action-modeswitch/ma8280p_us.c
-
-extras/mobile-action-modeswitch/extras_mobile_action_modeswitch_mobile_action_modeswitch-ma8280p_us.obj: extras/mobile-action-modeswitch/ma8280p_us.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(extras_mobile_action_modeswitch_mobile_action_modeswitch_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT extras/mobile-action-modeswitch/extras_mobile_action_modeswitch_mobile_action_modeswitch-ma8280p_us.obj -MD -MP -MF extras/mobile-action-modeswitch/$(DEPDIR)/extras_mobile_action_modeswitch_mobile_action_modeswitch-ma8280p_us.Tpo -c -o extras/mobile-action-modeswitch/extras_mobile_action_modeswitch_mobile_action_modeswitch-ma8280p_us.obj `if test -f 'extras/mobile-action-modeswitch/ma8280p_us.c'; then $(CYGPATH_W) 'extras/mobile-action-modeswitch/ma8280p_us.c'; else $(CYGPATH_W) '$(srcdir)/extras/mobile-action-modeswitch/ma8280p_us.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) extras/mobile-action-modeswitch/$(DEPDIR)/extras_mobile_action_modeswitch_mobile_action_modeswitch-ma8280p_us.Tpo extras/mobile-action-modeswitch/$(DEPDIR)/extras_mobile_action_modeswitch_mobile_action_modeswitch-ma8280p_us.Po
-@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='extras/mobile-action-modeswitch/ma8280p_us.c' object='extras/mobile-action-modeswitch/extras_mobile_action_modeswitch_mobile_action_modeswitch-ma8280p_us.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(extras_mobile_action_modeswitch_mobile_action_modeswitch_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o extras/mobile-action-modeswitch/extras_mobile_action_modeswitch_mobile_action_modeswitch-ma8280p_us.obj `if test -f 'extras/mobile-action-modeswitch/ma8280p_us.c'; then $(CYGPATH_W) 'extras/mobile-action-modeswitch/ma8280p_us.c'; else $(CYGPATH_W) '$(srcdir)/extras/mobile-action-modeswitch/ma8280p_us.c'; fi`
-
extras/mtd_probe/extras_mtd_probe_mtd_probe-mtd_probe.o: extras/mtd_probe/mtd_probe.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(extras_mtd_probe_mtd_probe_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT extras/mtd_probe/extras_mtd_probe_mtd_probe-mtd_probe.o -MD -MP -MF extras/mtd_probe/$(DEPDIR)/extras_mtd_probe_mtd_probe-mtd_probe.Tpo -c -o extras/mtd_probe/extras_mtd_probe_mtd_probe-mtd_probe.o `test -f 'extras/mtd_probe/mtd_probe.c' || echo '$(srcdir)/'`extras/mtd_probe/mtd_probe.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) extras/mtd_probe/$(DEPDIR)/extras_mtd_probe_mtd_probe-mtd_probe.Tpo extras/mtd_probe/$(DEPDIR)/extras_mtd_probe_mtd_probe-mtd_probe.Po
clean-libtool:
-rm -rf .libs _libs
+ -rm -rf extras/accelerometer/.libs extras/accelerometer/_libs
-rm -rf extras/ata_id/.libs extras/ata_id/_libs
-rm -rf extras/cdrom_id/.libs extras/cdrom_id/_libs
-rm -rf extras/collect/.libs extras/collect/_libs
-rm -rf extras/edd_id/.libs extras/edd_id/_libs
-rm -rf extras/firmware/.libs extras/firmware/_libs
-rm -rf extras/floppy/.libs extras/floppy/_libs
- -rm -rf extras/fstab_import/.libs extras/fstab_import/_libs
-rm -rf extras/gudev/.libs extras/gudev/_libs
- -rm -rf extras/hid2hci/.libs extras/hid2hci/_libs
- -rm -rf extras/input_id/.libs extras/input_id/_libs
-rm -rf extras/keymap/.libs extras/keymap/_libs
- -rm -rf extras/mobile-action-modeswitch/.libs extras/mobile-action-modeswitch/_libs
-rm -rf extras/mtd_probe/.libs extras/mtd_probe/_libs
- -rm -rf extras/path_id/.libs extras/path_id/_libs
-rm -rf extras/scsi_id/.libs extras/scsi_id/_libs
-rm -rf extras/udev-acl/.libs extras/udev-acl/_libs
-rm -rf extras/usb-db/.libs extras/usb-db/_libs
- -rm -rf extras/usb_id/.libs extras/usb_id/_libs
-rm -rf extras/v4l_id/.libs extras/v4l_id/_libs
-rm -rf libudev/.libs libudev/_libs
-rm -rf udev/.libs udev/_libs
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+ -rm -f extras/accelerometer/$(DEPDIR)/$(am__dirstamp)
+ -rm -f extras/accelerometer/$(am__dirstamp)
-rm -f extras/ata_id/$(DEPDIR)/$(am__dirstamp)
-rm -f extras/ata_id/$(am__dirstamp)
-rm -f extras/cdrom_id/$(DEPDIR)/$(am__dirstamp)
-rm -f extras/firmware/$(am__dirstamp)
-rm -f extras/floppy/$(DEPDIR)/$(am__dirstamp)
-rm -f extras/floppy/$(am__dirstamp)
- -rm -f extras/fstab_import/$(DEPDIR)/$(am__dirstamp)
- -rm -f extras/fstab_import/$(am__dirstamp)
-rm -f extras/gudev/$(DEPDIR)/$(am__dirstamp)
-rm -f extras/gudev/$(am__dirstamp)
- -rm -f extras/hid2hci/$(DEPDIR)/$(am__dirstamp)
- -rm -f extras/hid2hci/$(am__dirstamp)
- -rm -f extras/input_id/$(DEPDIR)/$(am__dirstamp)
- -rm -f extras/input_id/$(am__dirstamp)
-rm -f extras/keymap/$(DEPDIR)/$(am__dirstamp)
-rm -f extras/keymap/$(am__dirstamp)
- -rm -f extras/mobile-action-modeswitch/$(DEPDIR)/$(am__dirstamp)
- -rm -f extras/mobile-action-modeswitch/$(am__dirstamp)
-rm -f extras/mtd_probe/$(DEPDIR)/$(am__dirstamp)
-rm -f extras/mtd_probe/$(am__dirstamp)
- -rm -f extras/path_id/$(DEPDIR)/$(am__dirstamp)
- -rm -f extras/path_id/$(am__dirstamp)
-rm -f extras/scsi_id/$(DEPDIR)/$(am__dirstamp)
-rm -f extras/scsi_id/$(am__dirstamp)
-rm -f extras/udev-acl/$(DEPDIR)/$(am__dirstamp)
-rm -f extras/udev-acl/$(am__dirstamp)
-rm -f extras/usb-db/$(DEPDIR)/$(am__dirstamp)
-rm -f extras/usb-db/$(am__dirstamp)
- -rm -f extras/usb_id/$(DEPDIR)/$(am__dirstamp)
- -rm -f extras/usb_id/$(am__dirstamp)
-rm -f extras/v4l_id/$(DEPDIR)/$(am__dirstamp)
-rm -f extras/v4l_id/$(am__dirstamp)
-rm -f libudev/$(DEPDIR)/$(am__dirstamp)
distclean: distclean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
- -rm -rf extras/ata_id/$(DEPDIR) extras/cdrom_id/$(DEPDIR) extras/collect/$(DEPDIR) extras/edd_id/$(DEPDIR) extras/firmware/$(DEPDIR) extras/floppy/$(DEPDIR) extras/fstab_import/$(DEPDIR) extras/gudev/$(DEPDIR) extras/hid2hci/$(DEPDIR) extras/input_id/$(DEPDIR) extras/keymap/$(DEPDIR) extras/mobile-action-modeswitch/$(DEPDIR) extras/mtd_probe/$(DEPDIR) extras/path_id/$(DEPDIR) extras/scsi_id/$(DEPDIR) extras/udev-acl/$(DEPDIR) extras/usb-db/$(DEPDIR) extras/usb_id/$(DEPDIR) extras/v4l_id/$(DEPDIR) libudev/$(DEPDIR) udev/$(DEPDIR)
+ -rm -rf extras/accelerometer/$(DEPDIR) extras/ata_id/$(DEPDIR) extras/cdrom_id/$(DEPDIR) extras/collect/$(DEPDIR) extras/edd_id/$(DEPDIR) extras/firmware/$(DEPDIR) extras/floppy/$(DEPDIR) extras/gudev/$(DEPDIR) extras/keymap/$(DEPDIR) extras/mtd_probe/$(DEPDIR) extras/scsi_id/$(DEPDIR) extras/udev-acl/$(DEPDIR) extras/usb-db/$(DEPDIR) extras/v4l_id/$(DEPDIR) libudev/$(DEPDIR) udev/$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-hdr distclean-libtool distclean-local distclean-tags
maintainer-clean: maintainer-clean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf $(top_srcdir)/autom4te.cache
- -rm -rf extras/ata_id/$(DEPDIR) extras/cdrom_id/$(DEPDIR) extras/collect/$(DEPDIR) extras/edd_id/$(DEPDIR) extras/firmware/$(DEPDIR) extras/floppy/$(DEPDIR) extras/fstab_import/$(DEPDIR) extras/gudev/$(DEPDIR) extras/hid2hci/$(DEPDIR) extras/input_id/$(DEPDIR) extras/keymap/$(DEPDIR) extras/mobile-action-modeswitch/$(DEPDIR) extras/mtd_probe/$(DEPDIR) extras/path_id/$(DEPDIR) extras/scsi_id/$(DEPDIR) extras/udev-acl/$(DEPDIR) extras/usb-db/$(DEPDIR) extras/usb_id/$(DEPDIR) extras/v4l_id/$(DEPDIR) libudev/$(DEPDIR) udev/$(DEPDIR)
+ -rm -rf extras/accelerometer/$(DEPDIR) extras/ata_id/$(DEPDIR) extras/cdrom_id/$(DEPDIR) extras/collect/$(DEPDIR) extras/edd_id/$(DEPDIR) extras/firmware/$(DEPDIR) extras/floppy/$(DEPDIR) extras/gudev/$(DEPDIR) extras/keymap/$(DEPDIR) extras/mtd_probe/$(DEPDIR) extras/scsi_id/$(DEPDIR) extras/udev-acl/$(DEPDIR) extras/usb-db/$(DEPDIR) extras/v4l_id/$(DEPDIR) libudev/$(DEPDIR) udev/$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
-mkdir -p $(DESTDIR)$(libexecdir)/devices
@WITH_SYSTEMD_TRUE@systemd-install-hook:
+@WITH_SYSTEMD_TRUE@ mkdir -p $(DESTDIR)$(systemdsystemunitdir)/sockets.target.wants
+@WITH_SYSTEMD_TRUE@ ln -sf ../udev-control.socket $(DESTDIR)$(systemdsystemunitdir)/sockets.target.wants/udev-control.socket
+@WITH_SYSTEMD_TRUE@ ln -sf ../udev-kernel.socket $(DESTDIR)$(systemdsystemunitdir)/sockets.target.wants/udev-kernel.socket
@WITH_SYSTEMD_TRUE@ mkdir -p $(DESTDIR)$(systemdsystemunitdir)/basic.target.wants
@WITH_SYSTEMD_TRUE@ ln -sf ../udev.service $(DESTDIR)$(systemdsystemunitdir)/basic.target.wants/udev.service
-@WITH_SYSTEMD_TRUE@ ln -sf ../udev-settle.service $(DESTDIR)$(systemdsystemunitdir)/basic.target.wants/udev-settle.service
-@WITH_SYSTEMD_TRUE@ ln -sf ../udev-retry.service $(DESTDIR)$(systemdsystemunitdir)/basic.target.wants/udev-retry.service
+@WITH_SYSTEMD_TRUE@ ln -sf ../udev-trigger.service $(DESTDIR)$(systemdsystemunitdir)/basic.target.wants/udev-trigger.service
udev/%.7 udev/%.8 : udev/%.xml
$(AM_V_GEN)$(XSLTPROC) -o $@ -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
udev/%.html : udev/%.xml
$(AM_V_GEN)$(XSLTPROC) -o $@ -nonet http://docbook.sourceforge.net/release/xsl/current/xhtml-1_1/docbook.xsl $<
-@ENABLE_EXTRAS_TRUE@extras/gudev/gudevmarshal.h: extras/gudev/gudevmarshal.list
-@ENABLE_EXTRAS_TRUE@ $(AM_V_GEN)glib-genmarshal $< --prefix=g_udev_marshal --header > $@
-
-@ENABLE_EXTRAS_TRUE@extras/gudev/gudevmarshal.c: extras/gudev/gudevmarshal.list
-@ENABLE_EXTRAS_TRUE@ $(AM_V_GEN)echo "#include \"gudevmarshal.h\"" > $@ && \
-@ENABLE_EXTRAS_TRUE@ glib-genmarshal $< --prefix=g_udev_marshal --body >> $@
-
-@ENABLE_EXTRAS_TRUE@extras/gudev/gudevenumtypes.h: extras/gudev/gudevenumtypes.h.template extras/gudev/gudevenums.h
-@ENABLE_EXTRAS_TRUE@ $(AM_V_GEN)glib-mkenums --template $^ > \
-@ENABLE_EXTRAS_TRUE@ $@.tmp && mv $@.tmp $@
-
-@ENABLE_EXTRAS_TRUE@extras/gudev/gudevenumtypes.c: extras/gudev/gudevenumtypes.c.template extras/gudev/gudevenums.h
-@ENABLE_EXTRAS_TRUE@ $(AM_V_GEN)glib-mkenums --template $^ > \
-@ENABLE_EXTRAS_TRUE@ $@.tmp && mv $@.tmp $@
-
-@ENABLE_EXTRAS_TRUE@@ENABLE_INTROSPECTION_TRUE@extras/gudev/GUdev-1.0.gir: extras/gudev/libgudev-1.0.la $(G_IR_SCANNER) Makefile.am
-@ENABLE_EXTRAS_TRUE@@ENABLE_INTROSPECTION_TRUE@ $(AM_V_GEN)PKG_CONFIG_PATH=$(top_builddir)/data:$$PKG_CONFIG_PATH \
-@ENABLE_EXTRAS_TRUE@@ENABLE_INTROSPECTION_TRUE@ LD_LIBRARY_PATH=$(top_builddir)/extras/gudev:$$LD_LIBRARY_PATH \
-@ENABLE_EXTRAS_TRUE@@ENABLE_INTROSPECTION_TRUE@ $(G_IR_SCANNER) -v \
-@ENABLE_EXTRAS_TRUE@@ENABLE_INTROSPECTION_TRUE@ --namespace GUdev \
-@ENABLE_EXTRAS_TRUE@@ENABLE_INTROSPECTION_TRUE@ --nsversion=1.0 \
-@ENABLE_EXTRAS_TRUE@@ENABLE_INTROSPECTION_TRUE@ --include=GObject-2.0 \
-@ENABLE_EXTRAS_TRUE@@ENABLE_INTROSPECTION_TRUE@ --library=gudev-1.0 \
-@ENABLE_EXTRAS_TRUE@@ENABLE_INTROSPECTION_TRUE@ --library-path=extras/gudev \
-@ENABLE_EXTRAS_TRUE@@ENABLE_INTROSPECTION_TRUE@ --output $@ \
-@ENABLE_EXTRAS_TRUE@@ENABLE_INTROSPECTION_TRUE@ --pkg=glib-2.0 \
-@ENABLE_EXTRAS_TRUE@@ENABLE_INTROSPECTION_TRUE@ --pkg=gobject-2.0 \
-@ENABLE_EXTRAS_TRUE@@ENABLE_INTROSPECTION_TRUE@ -I$(top_builddir)/extras \
-@ENABLE_EXTRAS_TRUE@@ENABLE_INTROSPECTION_TRUE@ -I$(top_srcdir)/extras \
-@ENABLE_EXTRAS_TRUE@@ENABLE_INTROSPECTION_TRUE@ -D_GUDEV_COMPILATION \
-@ENABLE_EXTRAS_TRUE@@ENABLE_INTROSPECTION_TRUE@ -D_GUDEV_WORK_AROUND_DEV_T_BUG \
-@ENABLE_EXTRAS_TRUE@@ENABLE_INTROSPECTION_TRUE@ $(top_srcdir)/extras/gudev/gudev.h \
-@ENABLE_EXTRAS_TRUE@@ENABLE_INTROSPECTION_TRUE@ $(top_srcdir)/extras/gudev/gudevtypes.h \
-@ENABLE_EXTRAS_TRUE@@ENABLE_INTROSPECTION_TRUE@ $(top_srcdir)/extras/gudev/gudevenums.h \
-@ENABLE_EXTRAS_TRUE@@ENABLE_INTROSPECTION_TRUE@ $(or $(wildcard $(top_builddir)/extras/gudev/gudevenumtypes.h),$(top_srcdir)/extras/gudev/gudevenumtypes.h) \
-@ENABLE_EXTRAS_TRUE@@ENABLE_INTROSPECTION_TRUE@ $(top_srcdir)/extras/gudev/gudevclient.h \
-@ENABLE_EXTRAS_TRUE@@ENABLE_INTROSPECTION_TRUE@ $(top_srcdir)/extras/gudev/gudevdevice.h \
-@ENABLE_EXTRAS_TRUE@@ENABLE_INTROSPECTION_TRUE@ $(top_srcdir)/extras/gudev/gudevenumerator.h \
-@ENABLE_EXTRAS_TRUE@@ENABLE_INTROSPECTION_TRUE@ $(top_srcdir)/extras/gudev/gudevclient.c \
-@ENABLE_EXTRAS_TRUE@@ENABLE_INTROSPECTION_TRUE@ $(top_srcdir)/extras/gudev/gudevdevice.c \
-@ENABLE_EXTRAS_TRUE@@ENABLE_INTROSPECTION_TRUE@ $(top_srcdir)/extras/gudev/gudevenumerator.c
-
-@ENABLE_EXTRAS_TRUE@@ENABLE_INTROSPECTION_TRUE@extras/gudev/GUdev-1.0.typelib: extras/gudev/GUdev-1.0.gir $(G_IR_COMPILER)
-@ENABLE_EXTRAS_TRUE@@ENABLE_INTROSPECTION_TRUE@ $(AM_V_GEN)g-ir-compiler $< -o $@
+@ENABLE_GUDEV_TRUE@extras/gudev/gudevmarshal.h: extras/gudev/gudevmarshal.list
+@ENABLE_GUDEV_TRUE@ $(AM_V_GEN)glib-genmarshal $< --prefix=g_udev_marshal --header > $@
+
+@ENABLE_GUDEV_TRUE@extras/gudev/gudevmarshal.c: extras/gudev/gudevmarshal.list
+@ENABLE_GUDEV_TRUE@ $(AM_V_GEN)echo "#include \"gudevmarshal.h\"" > $@ && \
+@ENABLE_GUDEV_TRUE@ glib-genmarshal $< --prefix=g_udev_marshal --body >> $@
+
+@ENABLE_GUDEV_TRUE@extras/gudev/gudevenumtypes.h: extras/gudev/gudevenumtypes.h.template extras/gudev/gudevenums.h
+@ENABLE_GUDEV_TRUE@ $(AM_V_GEN)glib-mkenums --template $^ > \
+@ENABLE_GUDEV_TRUE@ $@.tmp && mv $@.tmp $@
+
+@ENABLE_GUDEV_TRUE@extras/gudev/gudevenumtypes.c: extras/gudev/gudevenumtypes.c.template extras/gudev/gudevenums.h
+@ENABLE_GUDEV_TRUE@ $(AM_V_GEN)glib-mkenums --template $^ > \
+@ENABLE_GUDEV_TRUE@ $@.tmp && mv $@.tmp $@
+
+@ENABLE_GUDEV_TRUE@@ENABLE_INTROSPECTION_TRUE@extras/gudev/GUdev-1.0.gir: extras/gudev/libgudev-1.0.la $(G_IR_SCANNER)
+@ENABLE_GUDEV_TRUE@@ENABLE_INTROSPECTION_TRUE@ $(AM_V_GEN)$(G_IR_SCANNER) -v \
+@ENABLE_GUDEV_TRUE@@ENABLE_INTROSPECTION_TRUE@ --warn-all \
+@ENABLE_GUDEV_TRUE@@ENABLE_INTROSPECTION_TRUE@ --namespace GUdev \
+@ENABLE_GUDEV_TRUE@@ENABLE_INTROSPECTION_TRUE@ --nsversion=1.0 \
+@ENABLE_GUDEV_TRUE@@ENABLE_INTROSPECTION_TRUE@ --include=GObject-2.0 \
+@ENABLE_GUDEV_TRUE@@ENABLE_INTROSPECTION_TRUE@ --library=gudev-1.0 \
+@ENABLE_GUDEV_TRUE@@ENABLE_INTROSPECTION_TRUE@ --library-path=$(top_builddir)/libudev \
+@ENABLE_GUDEV_TRUE@@ENABLE_INTROSPECTION_TRUE@ --library-path=$(top_builddir)/extras/gudev \
+@ENABLE_GUDEV_TRUE@@ENABLE_INTROSPECTION_TRUE@ --output $@ \
+@ENABLE_GUDEV_TRUE@@ENABLE_INTROSPECTION_TRUE@ --pkg=glib-2.0 \
+@ENABLE_GUDEV_TRUE@@ENABLE_INTROSPECTION_TRUE@ --pkg=gobject-2.0 \
+@ENABLE_GUDEV_TRUE@@ENABLE_INTROSPECTION_TRUE@ -I$(top_srcdir)/extras \
+@ENABLE_GUDEV_TRUE@@ENABLE_INTROSPECTION_TRUE@ -I$(top_builddir)/extras \
+@ENABLE_GUDEV_TRUE@@ENABLE_INTROSPECTION_TRUE@ -D_GUDEV_COMPILATION \
+@ENABLE_GUDEV_TRUE@@ENABLE_INTROSPECTION_TRUE@ -D_GUDEV_WORK_AROUND_DEV_T_BUG \
+@ENABLE_GUDEV_TRUE@@ENABLE_INTROSPECTION_TRUE@ $(top_srcdir)/extras/gudev/gudev.h \
+@ENABLE_GUDEV_TRUE@@ENABLE_INTROSPECTION_TRUE@ $(top_srcdir)/extras/gudev/gudevtypes.h \
+@ENABLE_GUDEV_TRUE@@ENABLE_INTROSPECTION_TRUE@ $(top_srcdir)/extras/gudev/gudevenums.h \
+@ENABLE_GUDEV_TRUE@@ENABLE_INTROSPECTION_TRUE@ $(or $(wildcard $(top_builddir)/extras/gudev/gudevenumtypes.h),$(top_srcdir)/extras/gudev/gudevenumtypes.h) \
+@ENABLE_GUDEV_TRUE@@ENABLE_INTROSPECTION_TRUE@ $(top_srcdir)/extras/gudev/gudevclient.h \
+@ENABLE_GUDEV_TRUE@@ENABLE_INTROSPECTION_TRUE@ $(top_srcdir)/extras/gudev/gudevdevice.h \
+@ENABLE_GUDEV_TRUE@@ENABLE_INTROSPECTION_TRUE@ $(top_srcdir)/extras/gudev/gudevenumerator.h \
+@ENABLE_GUDEV_TRUE@@ENABLE_INTROSPECTION_TRUE@ $(top_srcdir)/extras/gudev/gudevclient.c \
+@ENABLE_GUDEV_TRUE@@ENABLE_INTROSPECTION_TRUE@ $(top_srcdir)/extras/gudev/gudevdevice.c \
+@ENABLE_GUDEV_TRUE@@ENABLE_INTROSPECTION_TRUE@ $(top_srcdir)/extras/gudev/gudevenumerator.c
+
+@ENABLE_GUDEV_TRUE@@ENABLE_INTROSPECTION_TRUE@extras/gudev/GUdev-1.0.typelib: extras/gudev/GUdev-1.0.gir $(G_IR_COMPILER)
+@ENABLE_GUDEV_TRUE@@ENABLE_INTROSPECTION_TRUE@ $(AM_V_GEN)g-ir-compiler $< -o $@
# move lib from $(libdir) to $(rootlib_execdir) and update devel link, if needed
-@ENABLE_EXTRAS_TRUE@libgudev-install-move-hook:
-@ENABLE_EXTRAS_TRUE@ if test "$(libdir)" != "$(rootlib_execdir)"; then \
-@ENABLE_EXTRAS_TRUE@ mkdir -p $(DESTDIR)$(rootlib_execdir) && \
-@ENABLE_EXTRAS_TRUE@ so_img_name=$$(readlink $(DESTDIR)$(libdir)/libgudev-1.0.so) && \
-@ENABLE_EXTRAS_TRUE@ so_img_rel_target_prefix=$$(echo $(libdir) | sed 's,\(^/\|\)[^/][^/]*,..,g') && \
-@ENABLE_EXTRAS_TRUE@ ln -sf $$so_img_rel_target_prefix$(rootlib_execdir)/$$so_img_name $(DESTDIR)$(libdir)/libgudev-1.0.so && \
-@ENABLE_EXTRAS_TRUE@ mv $(DESTDIR)$(libdir)/libgudev-1.0.so.* $(DESTDIR)$(rootlib_execdir); \
-@ENABLE_EXTRAS_TRUE@ fi
+@ENABLE_GUDEV_TRUE@libgudev-install-move-hook:
+@ENABLE_GUDEV_TRUE@ if test "$(libdir)" != "$(rootlib_execdir)"; then \
+@ENABLE_GUDEV_TRUE@ mkdir -p $(DESTDIR)$(rootlib_execdir) && \
+@ENABLE_GUDEV_TRUE@ so_img_name=$$(readlink $(DESTDIR)$(libdir)/libgudev-1.0.so) && \
+@ENABLE_GUDEV_TRUE@ so_img_rel_target_prefix=$$(echo $(libdir) | sed 's,\(^/\|\)[^/][^/]*,..,g') && \
+@ENABLE_GUDEV_TRUE@ ln -sf $$so_img_rel_target_prefix$(rootlib_execdir)/$$so_img_name $(DESTDIR)$(libdir)/libgudev-1.0.so && \
+@ENABLE_GUDEV_TRUE@ mv $(DESTDIR)$(libdir)/libgudev-1.0.so.* $(DESTDIR)$(rootlib_execdir); \
+@ENABLE_GUDEV_TRUE@ fi
-@ENABLE_EXTRAS_TRUE@libgudev-uninstall-move-hook:
-@ENABLE_EXTRAS_TRUE@ rm -f $(DESTDIR)$(rootlib_execdir)/libgudev-1.0.so*
+@ENABLE_GUDEV_TRUE@libgudev-uninstall-move-hook:
+@ENABLE_GUDEV_TRUE@ rm -f $(DESTDIR)$(rootlib_execdir)/libgudev-1.0.so*
-@ENABLE_EXTRAS_TRUE@udevacl-install-hook:
-@ENABLE_EXTRAS_TRUE@ mkdir -p $(DESTDIR)$(prefix)/lib/ConsoleKit/run-seat.d
-@ENABLE_EXTRAS_TRUE@ ln -sf $(libexecdir)/udev-acl $(DESTDIR)$(prefix)/lib/ConsoleKit/run-seat.d/udev-acl.ck
+@ENABLE_KEYMAP_TRUE@extras/keymap/keys.txt: $(INCLUDE_PREFIX)/linux/input.h
+@ENABLE_KEYMAP_TRUE@ $(AM_V_at)mkdir -p extras/keymap
+@ENABLE_KEYMAP_TRUE@ $(AM_V_GEN)$(AWK) '/^#define.*KEY_[^ ]+[ \t]+[0-9]/ { if ($$2 != "KEY_MAX") { print $$2 } }' < $< | sed 's/^KEY_COFFEE$$/KEY_SCREENLOCK/' > $@
-@ENABLE_EXTRAS_TRUE@extras/keymap/keys.txt: $(INCLUDE_PREFIX)/linux/input.h
-@ENABLE_EXTRAS_TRUE@ $(AM_V_at)mkdir -p extras/keymap
-@ENABLE_EXTRAS_TRUE@ $(AM_V_GEN)$(AWK) '/^#define.*KEY_[^ ]+[ \t]+[0-9]/ { if ($$2 != "KEY_MAX") { print $$2 } }' < $< | sed 's/^KEY_COFFEE$$/KEY_SCREENLOCK/' > $@
+@ENABLE_KEYMAP_TRUE@extras/keymap/keys-from-name.gperf: extras/keymap/keys.txt
+@ENABLE_KEYMAP_TRUE@ $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct key { const char* name; unsigned short id; };"; print "%null-strings"; print "%%";} { print $$1 ", " $$1 }' < $< > $@
-@ENABLE_EXTRAS_TRUE@extras/keymap/keys-from-name.gperf: extras/keymap/keys.txt
-@ENABLE_EXTRAS_TRUE@ $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct key { const char* name; unsigned short id; };"; print "%null-strings"; print "%%";} { print $$1 ", " $$1 }' < $< > $@
+@ENABLE_KEYMAP_TRUE@extras/keymap/keys-from-name.h: extras/keymap/keys-from-name.gperf Makefile
+@ENABLE_KEYMAP_TRUE@ $(AM_V_GEN)$(GPERF) -L ANSI-C -t --ignore-case -N lookup_key -H hash_key_name -p -C < $< > $@
-@ENABLE_EXTRAS_TRUE@extras/keymap/keys-from-name.h: extras/keymap/keys-from-name.gperf Makefile
-@ENABLE_EXTRAS_TRUE@ $(AM_V_GEN)$(GPERF) -L ANSI-C -t --ignore-case -N lookup_key -H hash_key_name -p -C < $< > $@
+@ENABLE_KEYMAP_TRUE@extras/keymap/keys-to-name.h: extras/keymap/keys.txt Makefile
+@ENABLE_KEYMAP_TRUE@ $(AM_V_GEN)$(AWK) 'BEGIN{ print "const char* const key_names[KEY_CNT] = { "} { print "[" $$1 "] = \"" $$1 "\"," } END{print "};"}' < $< > $@
-@ENABLE_EXTRAS_TRUE@extras/keymap/keys-to-name.h: extras/keymap/keys.txt Makefile
-@ENABLE_EXTRAS_TRUE@ $(AM_V_GEN)$(AWK) 'BEGIN{ print "const char* const key_names[KEY_CNT] = { "} { print "[" $$1 "] = \"" $$1 "\"," } END{print "};"}' < $< > $@
+@ENABLE_KEYMAP_TRUE@keymaps-distcheck-hook: extras/keymap/keys.txt
+@ENABLE_KEYMAP_TRUE@ $(top_srcdir)/extras/keymap/check-keymaps.sh $(top_srcdir) $^
-@ENABLE_EXTRAS_TRUE@keymaps-distcheck-hook: extras/keymap/keys.txt
-@ENABLE_EXTRAS_TRUE@ $(top_srcdir)/extras/keymap/check-keymaps.sh $(top_srcdir) $^
+@ENABLE_UDEV_ACL_TRUE@udevacl-install-hook:
+@ENABLE_UDEV_ACL_TRUE@ mkdir -p $(DESTDIR)$(prefix)/lib/ConsoleKit/run-seat.d
+@ENABLE_UDEV_ACL_TRUE@ ln -sf $(libexecdir)/udev-acl $(DESTDIR)$(prefix)/lib/ConsoleKit/run-seat.d/udev-acl.ck
# ------------------------------------------------------------------------------
# install, uninstall, clean hooks
head -1 ChangeLog | grep -q "to v$(VERSION)"
head -1 NEWS | grep -q "udev $(VERSION)"
git commit -a -m "release $(VERSION)"
- cat .git/refs/heads/master > .git/refs/tags/$(VERSION)
- git gc
- git prune
+ git tag -m $(VERSION) -s $(VERSION)
+ git gc --prune=0
+
+tar:
+ make distcheck
+ gpg --armor --detach-sign udev-$(VERSION).tar.gz
+ gpg --armor --detach-sign udev-$(VERSION).tar.bz2
+
+git-sync:
+ git push
+ git push --tags $(VERSION)
+
+tar-sync:
+ scp udev-$(VERSION).tar.gz master.kernel.org:/pub/linux/utils/kernel/hotplug/
doc-sync:
rsync -av udev/*.html master.kernel.org:/pub/linux/utils/kernel/hotplug/udev/
+udev 174
+========
+Bugfixes.
+
+The udev daemon moved to /lib/udev/udevd. Non-systemd init systems
+and non-dracut initramfs image generators need to change the init
+scripts. Alternatively the udev build needs to move udevd back to
+/sbin or create a symlink in /sbin, which is not done by default.
+
+The path_id, usb_id, input_id tools are built-in commands now and
+the stand-alone tools do not exist anymore. Static lists of file in
+initramfs generators need to be updated. For testing, the commands
+can still be executed standalone with 'udevadm test-builtin <cmd>'.
+
+The fusectl filesystem is no longer mounted directly from udev.
+Systemd systems will take care of mounting fusectl and configfs
+now. Non-systemd systems need to ship their own rule if they
+need these filesystems auto-mounted.
+
+The long deprecated keys: SYSFS=, ID=, BUS= have been removed.
+
+The support for 'udevadm trigger --type=failed, and the
+RUN{fail_event_on_error} attribute was removed.
+
+The udev control socket is now created in /run/udev/control
+and no longer as an abstract namespace one.
+
+The rules to create persistent network interface and cdrom link
+rules automatically in /etc/udev/rules.d/ have been disabled by
+default. Explicit configuration will be required for these use
+cases, udev will no longer try to write any persistent system
+configuration from a device hotplug path.
+
+udev 173
+========
+Bugfixes.
+
+The udev-acl extra is no longer enabled by default now. To enable it,
+--enable-udev_acl needs to be given at ./configure time. On systemd
+systems, the udev-acl rules prevent it from running as the functionality
+has moved to systemd.
+
+udev 172
+========
+Bugfixes.
+
+Udev now enables kernel media-presence polling if available. Part
+of udisks optical drive tray-handling moved to cdrom_id: The tray
+is locked as soon as a media is detected to enable the receiving
+of media-eject-request events. Media-eject-request events will
+eject the media.
+
+Libudev enumerate is now able to enumerate a subtree of a given
+device.
+
+The mobile-action-modeswitch modeswitch tool was deleted. The
+functionality is provided by usb_modeswitch now.
+
+udev 171
+========
+Bugfixes.
+
+The systemd service files require systemd version 28. The systemd
+socket activation make it possible now to start 'udevd' and 'udevadm
+trigger' in parallel.
+
+udev 170
+========
+Fix bug in control message handling, which can lead to a failing
+udevadm control --exit. Thanks to Jürg Billeter for help tracking
+it down.
+
+udev 169
+========
+Bugfixes.
+
+We require at least Linux kernel 2.6.32 now. Some platforms might
+require a later kernel that supports accept4() and similar, or
+need to backport the trivial syscall wiring to the older kernels.
+
+The hid2hci tool moved to the bluez package and was removed.
+
+Many of the extras can be --enable/--disabled at ./configure
+time. The --disable-extras option was removed. Some extras have
+been disabled by default. The current options and their defaults
+can be checked with './configure --help'.
+
+udev 168
+========
+Bugfixes.
+
+Udev logs a warning now if /run is not writable at udevd
+startup. It will still fall back to /dev/.udev, but this is
+now considered a bug.
+
+The running udev daemon can now cleanly shut down with:
+ udevadm control --exit
+
+Udev in initramfs should clean the state of the udev database
+with: udevadm info --cleanup-db which will remove all state left
+behind from events/rules in initramfs. If initramfs uses
+--cleanup-db and device-mapper/LVM, the rules in initramfs need
+to add OPTIONS+="db_persist" for all dm devices. This will
+prevent removal of the udev database for these devices.
+
+Spawned programs by PROGRAM/IMPORT/RUN now have a hard timeout of
+120 seconds per process. If that timeout is reached the spawned
+process will be killed. The event timeout can be overwritten with
+udev rules.
+
+If systemd is used, udev gets now activated by netlink data.
+Systemd will bind the netlink socket which will buffer all data.
+If needed, such setup allows a seemless update of the udev daemon,
+where no event can be lost during a udevd update/restart.
+Packages need to make sure to: systemctl stop udev.socket udev.service
+or 'mask' udev.service during the upgrade to prevent any unwanted
+auto-spawning of udevd.
+This version of udev conflicts with systemd version below 25. The
+unchanged service files will not wirk correctly.
+
+udev 167
+========
+Bugfixes.
+
+The udev runtime data moved from /dev/.udev/ to /run/udev/. The
+/run mountpoint is supposed to be a tmpfs mounted during early boot,
+available and writable to for all tools at any time during bootup,
+it replaces /var/run/, which should become a symlink some day.
+
+If /run does not exist, or is not writable, udev will fall back using
+/dev/.udev/.
+
+On systemd systems with initramfs and LVM used, packagers must
+make sure, that the systemd and initramfs versions match. The initramfs
+needs to create the /run mountpoint for udev to store the data, and
+mount this tmpfs to /run in the rootfs, so the that the udev database
+is preserved for the udev version started in the rootfs.
+
+The command 'udevadm info --convert-db' is gone. The udev daemon
+itself, at startup, converts any old database version if necessary.
+
+The systemd services files have been reorganized. The udev control
+socket is bound by systemd and passed to the started udev daemon.
+The udev-settle.service is no longer active by default. Services which
+can not handle hotplug setups properly need to actively pull it in, to
+act like a barrier. Alternatively the settle service can be unconditionally
+'systemctl'enabled, and act like a barrier for basic.target.
+
+The fstab_import callout is no longer built or installed. Udev
+should not be used to mount, does not watch changes to fstab, and
+should not mirror fstab values in the udev database.
+
udev 166
========
Bugfixes.
Integrating udev in the system has complex dependencies and may differ from
distribution to distribution. A system may not be able to boot up or work
reliably without a properly installed udev version. The upstream udev project
-does not recommend to replace a distro's udev installation with the upstream
+does not recommend replacing a distro's udev installation with the upstream
version.
The upstream udev project's set of default rules may require a most recent
-kernel release to work properly. This is currently version 2.6.31.
+kernel release to work properly. This is currently version 2.6.32.
Tools and rules shipped by udev are not public API and may change at any time.
-Never call any private tool in /lib/udev from any external application, it might
+Never call any private tool in /lib/udev from any external application; it might
just go away in the next release. Access to udev information is only offered
-by udevadm and libudev. Tools and rules in /lib/udev, and the entire content of
-the /dev/.udev directory is private to udev and does change whenever needed.
+by udevadm and libudev. Tools and rules in /lib/udev and the entire contents of
+the /run/udev directory are private to udev and do change whenever needed.
Requirements:
- - Version 2.6.27 of the Linux kernel with sysfs, procfs, signalfd, inotify,
- unix domain sockets, networking and hotplug enabled:
+ - Version 2.6.34 of the Linux kernel with sysfs, procfs, signalfd, inotify,
+ unix domain sockets, networking and hotplug enabled
+
+ - Some architectures might need a later kernel, that supports accept4(),
+ or need to backport the accept4() syscall wiring in the kernel.
+
+ - These options are needed:
CONFIG_HOTPLUG=y
CONFIG_UEVENT_HELPER_PATH=""
CONFIG_NET=y
CONFIG_SYSFS=y
CONFIG_SYSFS_DEPRECATED*=n
CONFIG_PROC_FS=y
- CONFIG_TMPFS=y
CONFIG_INOTIFY_USER=y
CONFIG_SIGNALFD=y
+
+ - These options might be needed:
+ CONFIG_TMPFS=y
CONFIG_TMPFS_POSIX_ACL=y (user ACLs for device nodes)
CONFIG_BLK_DEV_BSG=y (SCSI devices)
- - Udev will not work with the CONFIG_SYSFS_DEPRECATED* option.
+ - Udev does not work with the CONFIG_SYSFS_DEPRECATED* option.
- Unix domain sockets (CONFIG_UNIX) as a loadable kernel module may work,
but it is not supported.
unusable because the kernel may create too many processes in parallel
so that the system runs out-of-memory.
- - The proc filesystem must be mounted on /proc, the sysfs filesystem must
+ - The proc filesystem must be mounted on /proc, and the sysfs filesystem must
be mounted at /sys. No other locations are supported by a standard
udev installation.
- - The system must have the following group names resolvable at udev startup:
- disk, cdrom, floppy, tape, audio, video, lp, tty, dialout, kmem.
- Especially in LDAP setups, it is required, that getgrnam() is able to resolve
- these group names with only the rootfs mounted, and while no network is
+ - The default rule sset requires the following group names resolvable at udev startup:
+ disk, cdrom, floppy, tape, audio, video, lp, tty, dialout, and kmem.
+ Especially in LDAP setups, it is required that getgrnam() be able to resolve
+ these group names with only the rootfs mounted and while no network is
available.
- - To build all 'udev extras', libacl, libglib2, libusb, usbutils, pciutils,
- gperf are needed. These dependencies can be disabled with the
- --disable-extras configure option.
+ - Some udev extras have external dependencies like:
+ libacl, libglib2, usbutils, pciutils, and gperf.
+ All these extras can be disabled with configure options.
Setup:
- At bootup, the /dev directory should get the 'devtmpfs' filesystem
- mounted. Udev will manage permissions and ownership of the kernel-created
- device nodes, and possibly create additional symlinks. If needed, udev also
- works on an empty 'tmpfs' filesystem, but some static device nodes like
- /dev/null, /dev/console, /dev/kmsg are needed to be able to start udev itself.
+ mounted. Udev manages the permissions and ownership of the kernel-created
+ device nodes, and udev possibly creates additional symlinks. If needed, udev also
+ works on an empty 'tmpfs' filesystem, but some device nodes like
+ /dev/null, /dev/console, /dev/kmsg should be created before udevd is started.
- The udev daemon should be started to handle device events sent by the kernel.
- During bootup, the kernel can be asked to send events for all already existing
- devices, to apply the configuration to these devices. This is usually done by:
- /sbin/udevadm trigger --type=subsystems
- /sbin/udevadm trigger --type=devices
+ During bootup, the events for already existing devices can be replayed, so
+ that they are configured by udev. This is usually done by:
+ /sbin/udevadm trigger --action=add --type=subsystems
+ /sbin/udevadm trigger --action=add --type=devices
- - Restarting the daemon does never apply any rules to existing devices.
+ - Restarting the daemon never applies any rules to existing devices.
- - New/changed rule files are picked up automatically, there is no daemon
+ - New/changed rule files are picked up automatically; there is no daemon
restart or signal needed.
Operation:
- - Udev creates/removes device nodes in /dev, based on events the kernel
- sends out on device creation/removal.
+ - Based on events the kernel sends out on device creation/removal, udev
+ creates/removes device nodes and symlinks in the /dev directory.
- All kernel events are matched against a set of specified rules, which
possibly hook into the event processing and load required kernel
- modules to setup devices. For all devices the kernel exports a major/minor
- number, if needed, udev will create a device node with the default kernel
- name. If specified, udev applies permissions/ownership to the device
+ modules to set up devices. For all devices, the kernel exports a major/minor
+ number; if needed, udev creates a device node with the default kernel
+ device name. If specified, udev applies permissions/ownership to the device
node, creates additional symlinks pointing to the node, and executes
programs to handle the device.
http://www.kernel.org/pub/linux/utils/kernel/hotplug/libudev/
http://www.kernel.org/pub/linux/utils/kernel/hotplug/gudev/
-For more details about udev and udev rules see the udev(7) man page.
+For more details about udev and udev rules, see the udev man pages:
+ http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev/
Please direct any comment/question to the linux-hotplug mailing list at:
linux-hotplug@vger.kernel.org
+ - test (now fixed) /dev/tape/ links
+
+ - move udevadm -> --bindir
+
+ - have a $attrs{} ?
+
+ - kill rules_generator
+
+ - kill tabs?
+
+ - deprecate and warn about RUN+="socket:"
+
+ - libudev.so.1
+ - symbol versioning
+ - return object with *_unref()
+ - udev_monitor_from_socket()
+ - udev_queue_get_failed_list_entry()
- o get rid of "scan all devices to find myself" libusb interface
- if it can not be fixed, drop libusb entirely and add a simple
- wrapper around the Linux usb ioctls we need
- o remove deprecated BUS=, SYSFS{}=, ID= keys
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
-_PKG_TEXT])[]dnl
+_PKG_TEXT])
])
elif test $pkg_failed = untried; then
AC_MSG_RESULT([no])
_PKG_TEXT
-To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.])
])
else
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
AC_DEFUN([_AM_IF_OPTION],
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_RUN_LOG(COMMAND)
+# -------------------
+# Run COMMAND, save the exit status in ac_status, and log it.
+# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
+AC_DEFUN([AM_RUN_LOG],
+[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
+ ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+ (exit $ac_status); }])
+
# Check to make sure that the build environment is sane. -*- Autoconf -*-
# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
-Wnested-externs -Wpointer-arith \
-Wpointer-arith -Wsign-compare -Wchar-subscripts \
-Wstrict-prototypes -Wshadow \
--Wformat=2 -Wtype-limits"
+-Wformat-security -Wtype-limits"
case "$CFLAGS" in
*-O[0-9]*)
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
-case "${UNAME_MACHINE}" in
- i?86)
- test -z "$VENDOR" && VENDOR=pc
- ;;
- *)
- test -z "$VENDOR" && VENDOR=unknown
- ;;
-esac
-test -f /etc/SuSE-release -o -f /.buildenv && VENDOR=suse
-
# Note: order is significant - the case branches are not exclusive.
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
exit ;;
*:OpenBSD:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
- echo ${UNAME_MACHINE_ARCH}-${VENDOR}-openbsd${UNAME_RELEASE}
+ echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
exit ;;
*:ekkoBSD:*:*)
- echo ${UNAME_MACHINE}-${VENDOR}-ekkobsd${UNAME_RELEASE}
+ echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
exit ;;
*:SolidBSD:*:*)
- echo ${UNAME_MACHINE}-${VENDOR}-solidbsd${UNAME_RELEASE}
+ echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
exit ;;
macppc:MirBSD:*:*)
- echo powerpc-${VENDOR}-mirbsd${UNAME_RELEASE}
+ echo powerpc-unknown-mirbsd${UNAME_RELEASE}
exit ;;
*:MirBSD:*:*)
- echo ${UNAME_MACHINE}-${VENDOR}-mirbsd${UNAME_RELEASE}
+ echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
exit ;;
alpha:OSF1:*:*)
case $UNAME_RELEASE in
echo alpha-dec-winnt3.5
exit ;;
Amiga*:UNIX_System_V:4.0:*)
- echo m68k-${VENDOR}-sysv4
+ echo m68k-unknown-sysv4
exit ;;
*:[Aa]miga[Oo][Ss]:*:*)
- echo ${UNAME_MACHINE}-${VENDOR}-amigaos
+ echo ${UNAME_MACHINE}-unknown-amigaos
exit ;;
*:[Mm]orph[Oo][Ss]:*:*)
- echo ${UNAME_MACHINE}-${VENDOR}-morphos
+ echo ${UNAME_MACHINE}-unknown-morphos
exit ;;
*:OS/390:*:*)
echo i370-ibm-openedition
echo arm-acorn-riscix${UNAME_RELEASE}
exit ;;
arm:riscos:*:*|arm:RISCOS:*:*)
- echo arm-${VENDOR}-riscos
+ echo arm-unknown-riscos
exit ;;
SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
echo hppa1.1-hitachi-hiuxmpp
echo m68k-hades-mint${UNAME_RELEASE}
exit ;;
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
- echo m68k-${VENDOR}-mint${UNAME_RELEASE}
+ echo m68k-unknown-mint${UNAME_RELEASE}
exit ;;
m68k:machten:*:*)
echo m68k-apple-machten${UNAME_RELEASE}
exit ;;
i*86:OSF1:*:*)
if [ -x /usr/sbin/sysversion ] ; then
- echo ${UNAME_MACHINE}-${VENDOR}-osf1mk
+ echo ${UNAME_MACHINE}-unknown-osf1mk
else
- echo ${UNAME_MACHINE}-${VENDOR}-osf1
+ echo ${UNAME_MACHINE}-unknown-osf1
fi
exit ;;
parisc*:Lites*:*:*)
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
exit ;;
sparc*:BSD/OS:*:*)
- echo sparc-${VENDOR}-bsdi${UNAME_RELEASE}
+ echo sparc-unknown-bsdi${UNAME_RELEASE}
exit ;;
*:BSD/OS:*:*)
- echo ${UNAME_MACHINE}-${VENDOR}-bsdi${UNAME_RELEASE}
+ echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
exit ;;
*:FreeBSD:*:*)
case ${UNAME_MACHINE} in
pc98)
- echo i386-${VENDOR}-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
amd64)
- echo x86_64-${VENDOR}-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
*)
- echo ${UNAME_MACHINE}-${VENDOR}-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
esac
exit ;;
i*:CYGWIN*:*)
echo i586-pc-interix${UNAME_RELEASE}
exit ;;
authenticamd | genuineintel | EM64T)
- echo x86_64-${VENDOR}-interix${UNAME_RELEASE}
+ echo x86_64-unknown-interix${UNAME_RELEASE}
exit ;;
IA64)
- echo ia64-${VENDOR}-interix${UNAME_RELEASE}
+ echo ia64-unknown-interix${UNAME_RELEASE}
exit ;;
esac ;;
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
echo ${UNAME_MACHINE}-pc-uwin
exit ;;
amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
- echo x86_64-${VENDOR}-cygwin
+ echo x86_64-unknown-cygwin
exit ;;
p*:CYGWIN*:*)
- echo powerpcle-${VENDOR}-cygwin
+ echo powerpcle-unknown-cygwin
exit ;;
prep*:SunOS:5.*:*)
- echo powerpcle-${VENDOR}-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
*:GNU:*:*)
# the GNU system
- echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-${VENDOR}-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+ echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
exit ;;
*:GNU/*:*:*)
# other systems with GNU libc and userland
- echo ${UNAME_MACHINE}-${VENDOR}-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
+ echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
exit ;;
i*86:Minix:*:*)
echo ${UNAME_MACHINE}-pc-minix
esac
objdump --private-headers /bin/sh | grep -q ld.so.1
if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
- echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu${LIBC}
+ echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
exit ;;
arm*:Linux:*:*)
eval $set_cc_for_build
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_EABI__
then
- echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
else
- echo ${UNAME_MACHINE}-${VENDOR}-linux-gnueabi
+ echo ${UNAME_MACHINE}-unknown-linux-gnueabi
fi
exit ;;
avr32*:Linux:*:*)
- echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
cris:Linux:*:*)
echo cris-axis-linux-gnu
echo crisv32-axis-linux-gnu
exit ;;
frv:Linux:*:*)
- echo frv-${VENDOR}-linux-gnu
+ echo frv-unknown-linux-gnu
exit ;;
i*86:Linux:*:*)
LIBC=gnu
#endif
EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
- echo "${UNAME_MACHINE}-${VENDOR}-linux-${LIBC}"
+ echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
exit ;;
ia64:Linux:*:*)
- echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
m32r*:Linux:*:*)
- echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
m68*:Linux:*:*)
- echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
mips:Linux:*:* | mips64:Linux:*:*)
eval $set_cc_for_build
#endif
EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
- test x"${CPU}" != x && { echo "${CPU}-${VENDOR}-linux-gnu"; exit; }
+ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
;;
or32:Linux:*:*)
- echo or32-${VENDOR}-linux-gnu
+ echo or32-unknown-linux-gnu
exit ;;
padre:Linux:*:*)
- echo sparc-${VENDOR}-linux-gnu
+ echo sparc-unknown-linux-gnu
exit ;;
parisc64:Linux:*:* | hppa64:Linux:*:*)
- echo hppa64-${VENDOR}-linux-gnu
+ echo hppa64-unknown-linux-gnu
exit ;;
parisc:Linux:*:* | hppa:Linux:*:*)
# Look for CPU level
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
- PA7*) echo hppa1.1-${VENDOR}-linux-gnu ;;
- PA8*) echo hppa2.0-${VENDOR}-linux-gnu ;;
- *) echo hppa-${VENDOR}-linux-gnu ;;
+ PA7*) echo hppa1.1-unknown-linux-gnu ;;
+ PA8*) echo hppa2.0-unknown-linux-gnu ;;
+ *) echo hppa-unknown-linux-gnu ;;
esac
exit ;;
ppc64:Linux:*:*)
- echo powerpc64-${VENDOR}-linux-gnu
+ echo powerpc64-unknown-linux-gnu
exit ;;
ppc:Linux:*:*)
- echo powerpc-${VENDOR}-linux-gnu
+ echo powerpc-unknown-linux-gnu
exit ;;
s390:Linux:*:* | s390x:Linux:*:*)
echo ${UNAME_MACHINE}-ibm-linux
exit ;;
sh64*:Linux:*:*)
- echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
sh*:Linux:*:*)
- echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
sparc:Linux:*:* | sparc64:Linux:*:*)
- echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
vax:Linux:*:*)
echo ${UNAME_MACHINE}-dec-linux-gnu
exit ;;
x86_64:Linux:*:*)
- echo x86_64-${VENDOR}-linux-gnu
+ echo x86_64-unknown-linux-gnu
exit ;;
xtensa*:Linux:*:*)
- echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
i*86:DYNIX/ptx:4*:*)
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
echo ${UNAME_MACHINE}-pc-os2-emx
exit ;;
i*86:XTS-300:*:STOP)
- echo ${UNAME_MACHINE}-${VENDOR}-stop
+ echo ${UNAME_MACHINE}-unknown-stop
exit ;;
i*86:atheos:*:*)
- echo ${UNAME_MACHINE}-${VENDOR}-atheos
+ echo ${UNAME_MACHINE}-unknown-atheos
exit ;;
i*86:syllable:*:*)
echo ${UNAME_MACHINE}-pc-syllable
exit ;;
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
- echo i386-${VENDOR}-lynxos${UNAME_RELEASE}
+ echo i386-unknown-lynxos${UNAME_RELEASE}
exit ;;
i*86:*DOS:*:*)
echo ${UNAME_MACHINE}-pc-msdosdjgpp
*Pentium) UNAME_MACHINE=i586 ;;
*Pent*|*Celeron) UNAME_MACHINE=i686 ;;
esac
- echo ${UNAME_MACHINE}-${VENDOR}-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+ echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
exit ;;
i*86:*:3.2:*)
if test -f /usr/options/cb.name; then
if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
else # Add other i860-SVR4 vendors below as they are discovered.
- echo i860-${VENDOR}-sysv${UNAME_RELEASE} # Unknown i860-SVR4
+ echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
fi
exit ;;
mini*:CTIX:SYS*5:*)
/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
&& { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
- echo m68k-${VENDOR}-lynxos${UNAME_RELEASE}
+ echo m68k-unknown-lynxos${UNAME_RELEASE}
exit ;;
mc68030:UNIX_System_V:4.*:*)
echo m68k-atari-sysv4
exit ;;
TSUNAMI:LynxOS:2.*:*)
- echo sparc-${VENDOR}-lynxos${UNAME_RELEASE}
+ echo sparc-unknown-lynxos${UNAME_RELEASE}
exit ;;
rs6000:LynxOS:2.*:*)
- echo rs6000-${VENDOR}-lynxos${UNAME_RELEASE}
+ echo rs6000-unknown-lynxos${UNAME_RELEASE}
exit ;;
PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
- echo powerpc-${VENDOR}-lynxos${UNAME_RELEASE}
+ echo powerpc-unknown-lynxos${UNAME_RELEASE}
exit ;;
SM[BE]S:UNIX_SV:*:*)
echo mips-dde-sysv${UNAME_RELEASE}
if [ -d /usr/nec ]; then
echo mips-nec-sysv${UNAME_RELEASE}
else
- echo mips-${VENDOR}-sysv${UNAME_RELEASE}
+ echo mips-unknown-sysv${UNAME_RELEASE}
fi
exit ;;
BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
else
UNAME_MACHINE="$cputype"
fi
- echo ${UNAME_MACHINE}-${VENDOR}-plan9
+ echo ${UNAME_MACHINE}-unknown-plan9
exit ;;
*:TOPS-10:*:*)
- echo pdp10-${VENDOR}-tops10
+ echo pdp10-unknown-tops10
exit ;;
*:TENEX:*:*)
- echo pdp10-${VENDOR}-tenex
+ echo pdp10-unknown-tenex
exit ;;
KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
echo pdp10-dec-tops20
echo pdp10-xkl-tops20
exit ;;
*:TOPS-20:*:*)
- echo pdp10-${VENDOR}-tops20
+ echo pdp10-unknown-tops20
exit ;;
*:ITS:*:*)
- echo pdp10-${VENDOR}-its
+ echo pdp10-unknown-its
exit ;;
SEI:*:*:SEIUX)
echo mips-sei-seiux${UNAME_RELEASE}
exit ;;
*:DragonFly:*:*)
- echo ${UNAME_MACHINE}-${VENDOR}-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+ echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
exit ;;
*:*VMS:*:*)
UNAME_MACHINE=`(uname -p) 2>/dev/null`
-# Generated from ltmain.m4sh.
-# ltmain.sh (GNU libtool) 2.2.6b
+# libtool (GNU libtool) 2.4
# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
+# 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions. There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
# Provide generalized library-building support services.
#
-# --config show all configuration variables
-# --debug enable verbose shell tracing
-# -n, --dry-run display commands without modifying any files
-# --features display basic configuration information and exit
-# --mode=MODE use operation mode MODE
-# --preserve-dup-deps don't remove duplicate dependency libraries
-# --quiet, --silent don't print informational messages
-# --tag=TAG use configuration variables from tag TAG
-# -v, --verbose print informational messages (default)
-# --version print version information
-# -h, --help print short or long help message
+# --config show all configuration variables
+# --debug enable verbose shell tracing
+# -n, --dry-run display commands without modifying any files
+# --features display basic configuration information and exit
+# --mode=MODE use operation mode MODE
+# --preserve-dup-deps don't remove duplicate dependency libraries
+# --quiet, --silent don't print informational messages
+# --no-quiet, --no-silent
+# print informational messages (default)
+# --tag=TAG use configuration variables from tag TAG
+# -v, --verbose print more informational messages than default
+# --no-verbose don't print the extra informational messages
+# --version print version information
+# -h, --help, --help-all print short, long, or detailed help message
#
# MODE must be one of the following:
#
-# clean remove files from the build directory
-# compile compile a source file into a libtool object
-# execute automatically set library path, then run a program
-# finish complete the installation of libtool libraries
-# install install libraries or executables
-# link create a library or an executable
-# uninstall remove libraries from an installed directory
+# clean remove files from the build directory
+# compile compile a source file into a libtool object
+# execute automatically set library path, then run a program
+# finish complete the installation of libtool libraries
+# install install libraries or executables
+# link create a library or an executable
+# uninstall remove libraries from an installed directory
#
-# MODE-ARGS vary depending on the MODE.
+# MODE-ARGS vary depending on the MODE. When passed as first option,
+# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that.
# Try `$progname --help --mode=MODE' for a more detailed description of MODE.
#
# When reporting a bug, please describe a test case to reproduce it and
# include the following information:
#
-# host-triplet: $host
-# shell: $SHELL
-# compiler: $LTCC
-# compiler flags: $LTCFLAGS
-# linker: $LD (gnu? $with_gnu_ld)
-# $progname: (GNU libtool) 2.2.6b
-# automake: $automake_version
-# autoconf: $autoconf_version
+# host-triplet: $host
+# shell: $SHELL
+# compiler: $LTCC
+# compiler flags: $LTCFLAGS
+# linker: $LD (gnu? $with_gnu_ld)
+# $progname: (GNU libtool) 2.4
+# automake: $automake_version
+# autoconf: $autoconf_version
#
# Report bugs to <bug-libtool@gnu.org>.
+# GNU libtool home page: <http://www.gnu.org/software/libtool/>.
+# General help using GNU software: <http://www.gnu.org/gethelp/>.
-PROGRAM=ltmain.sh
+PROGRAM=libtool
PACKAGE=libtool
-VERSION=2.2.6b
+VERSION=2.4
TIMESTAMP=""
-package_revision=1.3017
+package_revision=1.3293
# Be Bourne compatible
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
BIN_SH=xpg4; export BIN_SH # for Tru64
DUALCASE=1; export DUALCASE # for MKS sh
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+ eval 'cat <<_LTECHO_EOF
+$1
+_LTECHO_EOF'
+}
+
# NLS nuisances: We save the old values to restore during execute mode.
-# Only set LANG and LC_ALL to C if already set.
-# These must not be set unconditionally because not all systems understand
-# e.g. LANG=C (notably SCO).
lt_user_locale=
lt_safe_locale=
for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
fi"
done
+LC_ALL=C
+LANGUAGE=C
+export LANGUAGE LC_ALL
$lt_unset CDPATH
+# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
+# is ksh but when the shell is invoked as "sh" and the current value of
+# the _XPG environment variable is not equal to 1 (one), the special
+# positional parameter $0, within a function call, is the name of the
+# function.
+progpath="$0"
: ${CP="cp -f"}
-: ${ECHO="echo"}
+test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
: ${EGREP="/bin/grep -E"}
: ${FGREP="/bin/grep -F"}
: ${GREP="/bin/grep"}
dirname="s,/[^/]*$,,"
basename="s,^.*/,,"
+# func_dirname file append nondir_replacement
+# Compute the dirname of FILE. If nonempty, add APPEND to the result,
+# otherwise set result to NONDIR_REPLACEMENT.
+func_dirname ()
+{
+ func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
+ if test "X$func_dirname_result" = "X${1}"; then
+ func_dirname_result="${3}"
+ else
+ func_dirname_result="$func_dirname_result${2}"
+ fi
+} # func_dirname may be replaced by extended shell implementation
+
+
+# func_basename file
+func_basename ()
+{
+ func_basename_result=`$ECHO "${1}" | $SED "$basename"`
+} # func_basename may be replaced by extended shell implementation
+
+
# func_dirname_and_basename file append nondir_replacement
# perform func_basename and func_dirname in a single function
# call:
# those functions but instead duplicate the functionality here.
func_dirname_and_basename ()
{
- # Extract subdirectory from the argument.
- func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
- if test "X$func_dirname_result" = "X${1}"; then
- func_dirname_result="${3}"
- else
- func_dirname_result="$func_dirname_result${2}"
- fi
- func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
+ # Extract subdirectory from the argument.
+ func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"`
+ if test "X$func_dirname_result" = "X${1}"; then
+ func_dirname_result="${3}"
+ else
+ func_dirname_result="$func_dirname_result${2}"
+ fi
+ func_basename_result=`$ECHO "${1}" | $SED -e "$basename"`
+} # func_dirname_and_basename may be replaced by extended shell implementation
+
+
+# func_stripname prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+# func_strip_suffix prefix name
+func_stripname ()
+{
+ case ${2} in
+ .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+ *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+ esac
+} # func_stripname may be replaced by extended shell implementation
+
+
+# These SED scripts presuppose an absolute path with a trailing slash.
+pathcar='s,^/\([^/]*\).*$,\1,'
+pathcdr='s,^/[^/]*,,'
+removedotparts=':dotsl
+ s@/\./@/@g
+ t dotsl
+ s,/\.$,/,'
+collapseslashes='s@/\{1,\}@/@g'
+finalslash='s,/*$,/,'
+
+# func_normal_abspath PATH
+# Remove doubled-up and trailing slashes, "." path components,
+# and cancel out any ".." path components in PATH after making
+# it an absolute path.
+# value returned in "$func_normal_abspath_result"
+func_normal_abspath ()
+{
+ # Start from root dir and reassemble the path.
+ func_normal_abspath_result=
+ func_normal_abspath_tpath=$1
+ func_normal_abspath_altnamespace=
+ case $func_normal_abspath_tpath in
+ "")
+ # Empty path, that just means $cwd.
+ func_stripname '' '/' "`pwd`"
+ func_normal_abspath_result=$func_stripname_result
+ return
+ ;;
+ # The next three entries are used to spot a run of precisely
+ # two leading slashes without using negated character classes;
+ # we take advantage of case's first-match behaviour.
+ ///*)
+ # Unusual form of absolute path, do nothing.
+ ;;
+ //*)
+ # Not necessarily an ordinary path; POSIX reserves leading '//'
+ # and for example Cygwin uses it to access remote file shares
+ # over CIFS/SMB, so we conserve a leading double slash if found.
+ func_normal_abspath_altnamespace=/
+ ;;
+ /*)
+ # Absolute path, do nothing.
+ ;;
+ *)
+ # Relative path, prepend $cwd.
+ func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
+ ;;
+ esac
+ # Cancel out all the simple stuff to save iterations. We also want
+ # the path to end with a slash for ease of parsing, so make sure
+ # there is one (and only one) here.
+ func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
+ -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"`
+ while :; do
+ # Processed it all yet?
+ if test "$func_normal_abspath_tpath" = / ; then
+ # If we ascended to the root using ".." the result may be empty now.
+ if test -z "$func_normal_abspath_result" ; then
+ func_normal_abspath_result=/
+ fi
+ break
+ fi
+ func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
+ -e "$pathcar"`
+ func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
+ -e "$pathcdr"`
+ # Figure out what to do with it
+ case $func_normal_abspath_tcomponent in
+ "")
+ # Trailing empty path component, ignore it.
+ ;;
+ ..)
+ # Parent dir; strip last assembled component from result.
+ func_dirname "$func_normal_abspath_result"
+ func_normal_abspath_result=$func_dirname_result
+ ;;
+ *)
+ # Actual path component, append it.
+ func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent
+ ;;
+ esac
+ done
+ # Restore leading double-slash if one was found on entry.
+ func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
}
-# Generated shell functions inserted here.
+# func_relative_path SRCDIR DSTDIR
+# generates a relative path from SRCDIR to DSTDIR, with a trailing
+# slash if non-empty, suitable for immediately appending a filename
+# without needing to append a separator.
+# value returned in "$func_relative_path_result"
+func_relative_path ()
+{
+ func_relative_path_result=
+ func_normal_abspath "$1"
+ func_relative_path_tlibdir=$func_normal_abspath_result
+ func_normal_abspath "$2"
+ func_relative_path_tbindir=$func_normal_abspath_result
+
+ # Ascend the tree starting from libdir
+ while :; do
+ # check if we have found a prefix of bindir
+ case $func_relative_path_tbindir in
+ $func_relative_path_tlibdir)
+ # found an exact match
+ func_relative_path_tcancelled=
+ break
+ ;;
+ $func_relative_path_tlibdir*)
+ # found a matching prefix
+ func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
+ func_relative_path_tcancelled=$func_stripname_result
+ if test -z "$func_relative_path_result"; then
+ func_relative_path_result=.
+ fi
+ break
+ ;;
+ *)
+ func_dirname $func_relative_path_tlibdir
+ func_relative_path_tlibdir=${func_dirname_result}
+ if test "x$func_relative_path_tlibdir" = x ; then
+ # Have to descend all the way to the root!
+ func_relative_path_result=../$func_relative_path_result
+ func_relative_path_tcancelled=$func_relative_path_tbindir
+ break
+ fi
+ func_relative_path_result=../$func_relative_path_result
+ ;;
+ esac
+ done
-# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
-# is ksh but when the shell is invoked as "sh" and the current value of
-# the _XPG environment variable is not equal to 1 (one), the special
-# positional parameter $0, within a function call, is the name of the
-# function.
-progpath="$0"
+ # Now calculate path; take care to avoid doubling-up slashes.
+ func_stripname '' '/' "$func_relative_path_result"
+ func_relative_path_result=$func_stripname_result
+ func_stripname '/' '/' "$func_relative_path_tcancelled"
+ if test "x$func_stripname_result" != x ; then
+ func_relative_path_result=${func_relative_path_result}/${func_stripname_result}
+ fi
+
+ # Normalisation. If bindir is libdir, return empty string,
+ # else relative path ending with a slash; either way, target
+ # file name can be directly appended.
+ if test ! -z "$func_relative_path_result"; then
+ func_stripname './' '' "$func_relative_path_result/"
+ func_relative_path_result=$func_stripname_result
+ fi
+}
# The name of this program:
-# In the unlikely event $progname began with a '-', it would play havoc with
-# func_echo (imagine progname=-n), so we prepend ./ in that case:
func_dirname_and_basename "$progpath"
progname=$func_basename_result
-case $progname in
- -*) progname=./$progname ;;
-esac
# Make sure we have an absolute path for reexecution:
case $progpath in
# Same as above, but do not quote variable references.
double_quote_subst='s/\(["`\\]\)/\\\1/g'
+# Sed substitution that turns a string into a regex matching for the
+# string literally.
+sed_make_literal_regex='s,[].[^$\\*\/],\\&,g'
+
+# Sed substitution that converts a w32 file name or path
+# which contains forward slashes, into one that contains
+# (escaped) backslashes. A very naive implementation.
+lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
+
# Re-`\' parameter expansions in output of double_quote_subst that were
# `\'-ed in input to the same. If an odd number of `\' preceded a '$'
# in input to double_quote_subst, that '$' was protected from expansion.
# name if it has been set yet.
func_echo ()
{
- $ECHO "$progname${mode+: }$mode: $*"
+ $ECHO "$progname: ${opt_mode+$opt_mode: }$*"
}
# func_verbose arg...
:
}
+# func_echo_all arg...
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+ $ECHO "$*"
+}
+
# func_error arg...
# Echo program name prefixed message to standard error.
func_error ()
{
- $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2
+ $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2
}
# func_warning arg...
# Echo program name prefixed warning message to standard error.
func_warning ()
{
- $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2
+ $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2
# bash bug again:
:
case $my_directory_path in */*) ;; *) break ;; esac
# ...otherwise throw away the child directory and loop
- my_directory_path=`$ECHO "X$my_directory_path" | $Xsed -e "$dirname"`
+ my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"`
done
- my_dir_list=`$ECHO "X$my_dir_list" | $Xsed -e 's,:*$,,'`
+ my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'`
save_mkdir_p_IFS="$IFS"; IFS=':'
for my_dir in $my_dir_list; do
func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
fi
- $ECHO "X$my_tmpdir" | $Xsed
+ $ECHO "$my_tmpdir"
}
{
case $1 in
*[\\\`\"\$]*)
- func_quote_for_eval_unquoted_result=`$ECHO "X$1" | $Xsed -e "$sed_quote_subst"` ;;
+ func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;;
*)
func_quote_for_eval_unquoted_result="$1" ;;
esac
{
case $1 in
*[\\\`\"]*)
- my_arg=`$ECHO "X$1" | $Xsed \
+ my_arg=`$ECHO "$1" | $SED \
-e "$double_quote_subst" -e "$sed_double_backslash"` ;;
*)
my_arg="$1" ;;
fi
}
-
-
+# func_tr_sh
+# Turn $1 into a string suitable for a shell variable name.
+# Result is stored in $func_tr_sh_result. All characters
+# not in the set a-zA-Z0-9_ are replaced with '_'. Further,
+# if $1 begins with a digit, a '_' is prepended as well.
+func_tr_sh ()
+{
+ case $1 in
+ [0-9]* | *[!a-zA-Z0-9_]*)
+ func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'`
+ ;;
+ * )
+ func_tr_sh_result=$1
+ ;;
+ esac
+}
# func_version
# Echo version message to standard output and exit.
func_version ()
{
- $SED -n '/^# '$PROGRAM' (GNU /,/# warranty; / {
+ $opt_debug
+
+ $SED -n '/(C)/!b go
+ :more
+ /\./!{
+ N
+ s/\n# / /
+ b more
+ }
+ :go
+ /^# '$PROGRAM' (GNU /,/# warranty; / {
s/^# //
s/^# *$//
s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
# Echo short help message to standard output and exit.
func_usage ()
{
- $SED -n '/^# Usage:/,/# -h/ {
+ $opt_debug
+
+ $SED -n '/^# Usage:/,/^# *.*--help/ {
s/^# //
s/^# *$//
s/\$progname/'$progname'/
p
}' < "$progpath"
- $ECHO
+ echo
$ECHO "run \`$progname --help | more' for full usage"
exit $?
}
-# func_help
-# Echo long help message to standard output and exit.
+# func_help [NOEXIT]
+# Echo long help message to standard output and exit,
+# unless 'noexit' is passed as argument.
func_help ()
{
+ $opt_debug
+
$SED -n '/^# Usage:/,/# Report bugs to/ {
+ :print
s/^# //
s/^# *$//
s*\$progname*'$progname'*
s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/
s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
p
- }' < "$progpath"
- exit $?
+ d
+ }
+ /^# .* home page:/b print
+ /^# General help using/b print
+ ' < "$progpath"
+ ret=$?
+ if test -z "$1"; then
+ exit $ret
+ fi
}
# func_missing_arg argname
# exit_cmd.
func_missing_arg ()
{
- func_error "missing argument for $1"
+ $opt_debug
+
+ func_error "missing argument for $1."
exit_cmd=exit
}
-exit_cmd=:
+# func_split_short_opt shortopt
+# Set func_split_short_opt_name and func_split_short_opt_arg shell
+# variables after splitting SHORTOPT after the 2nd character.
+func_split_short_opt ()
+{
+ my_sed_short_opt='1s/^\(..\).*$/\1/;q'
+ my_sed_short_rest='1s/^..\(.*\)$/\1/;q'
+ func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"`
+ func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"`
+} # func_split_short_opt may be replaced by extended shell implementation
+
+
+# func_split_long_opt longopt
+# Set func_split_long_opt_name and func_split_long_opt_arg shell
+# variables after splitting LONGOPT at the `=' sign.
+func_split_long_opt ()
+{
+ my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q'
+ my_sed_long_arg='1s/^--[^=]*=//'
+
+ func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"`
+ func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"`
+} # func_split_long_opt may be replaced by extended shell implementation
+
+exit_cmd=:
-# Check that we have a working $ECHO.
-if test "X$1" = X--no-reexec; then
- # Discard the --no-reexec flag, and continue.
- shift
-elif test "X$1" = X--fallback-echo; then
- # Avoid inline document here, it may be left over
- :
-elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then
- # Yippee, $ECHO works!
- :
-else
- # Restart under the correct shell, and then maybe $ECHO will work.
- exec $SHELL "$progpath" --no-reexec ${1+"$@"}
-fi
-if test "X$1" = X--fallback-echo; then
- # used as fallback echo
- shift
- cat <<EOF
-$*
-EOF
- exit $EXIT_SUCCESS
-fi
magic="%%%MAGIC variable%%%"
magic_exe="%%%MAGIC EXE variable%%%"
# Global variables.
-# $mode is unset
nonopt=
-execute_dlfiles=
preserve_args=
lo2o="s/\\.lo\$/.${objext}/"
o2lo="s/\\.${objext}\$/.lo/"
extracted_archives=
extracted_serial=0
-opt_dry_run=false
-opt_duplicate_deps=false
-opt_silent=false
-opt_debug=:
-
# If this variable is set in any of the actions, the command in it
# will be execed at the end. This prevents here-documents from being
# left over by shells.
exec_cmd=
+# func_append var value
+# Append VALUE to the end of shell variable VAR.
+func_append ()
+{
+ eval "${1}=\$${1}\${2}"
+} # func_append may be replaced by extended shell implementation
+
+# func_append_quoted var value
+# Quote VALUE and append to the end of shell variable VAR, separated
+# by a space.
+func_append_quoted ()
+{
+ func_quote_for_eval "${2}"
+ eval "${1}=\$${1}\\ \$func_quote_for_eval_result"
+} # func_append_quoted may be replaced by extended shell implementation
+
+
+# func_arith arithmetic-term...
+func_arith ()
+{
+ func_arith_result=`expr "${@}"`
+} # func_arith may be replaced by extended shell implementation
+
+
+# func_len string
+# STRING may not start with a hyphen.
+func_len ()
+{
+ func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len`
+} # func_len may be replaced by extended shell implementation
+
+
+# func_lo2o object
+func_lo2o ()
+{
+ func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
+} # func_lo2o may be replaced by extended shell implementation
+
+
+# func_xform libobj-or-source
+func_xform ()
+{
+ func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
+} # func_xform may be replaced by extended shell implementation
+
+
# func_fatal_configuration arg...
# Echo program name prefixed message to standard error, followed by
# a configuration failure hint, and exit.
# Display the features supported by this script.
func_features ()
{
- $ECHO "host: $host"
+ echo "host: $host"
if test "$build_libtool_libs" = yes; then
- $ECHO "enable shared libraries"
+ echo "enable shared libraries"
else
- $ECHO "disable shared libraries"
+ echo "disable shared libraries"
fi
if test "$build_old_libs" = yes; then
- $ECHO "enable static libraries"
+ echo "enable static libraries"
else
- $ECHO "disable static libraries"
+ echo "disable static libraries"
fi
exit $?
esac
}
-# Parse options once, thoroughly. This comes as soon as possible in
-# the script to make things like `libtool --version' happen quickly.
+# func_check_version_match
+# Ensure that we are using m4 macros, and libtool script from the same
+# release of libtool.
+func_check_version_match ()
{
+ if test "$package_revision" != "$macro_revision"; then
+ if test "$VERSION" != "$macro_version"; then
+ if test -z "$macro_version"; then
+ cat >&2 <<_LT_EOF
+$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
+$progname: definition of this LT_INIT comes from an older release.
+$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
+$progname: and run autoconf again.
+_LT_EOF
+ else
+ cat >&2 <<_LT_EOF
+$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
+$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
+$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
+$progname: and run autoconf again.
+_LT_EOF
+ fi
+ else
+ cat >&2 <<_LT_EOF
+$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision,
+$progname: but the definition of this LT_INIT comes from revision $macro_revision.
+$progname: You should recreate aclocal.m4 with macros from revision $package_revision
+$progname: of $PACKAGE $VERSION and run autoconf again.
+_LT_EOF
+ fi
- # Shorthand for --mode=foo, only valid as the first argument
- case $1 in
- clean|clea|cle|cl)
- shift; set dummy --mode clean ${1+"$@"}; shift
- ;;
- compile|compil|compi|comp|com|co|c)
- shift; set dummy --mode compile ${1+"$@"}; shift
- ;;
- execute|execut|execu|exec|exe|ex|e)
- shift; set dummy --mode execute ${1+"$@"}; shift
- ;;
- finish|finis|fini|fin|fi|f)
- shift; set dummy --mode finish ${1+"$@"}; shift
- ;;
- install|instal|insta|inst|ins|in|i)
- shift; set dummy --mode install ${1+"$@"}; shift
- ;;
- link|lin|li|l)
- shift; set dummy --mode link ${1+"$@"}; shift
- ;;
- uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
- shift; set dummy --mode uninstall ${1+"$@"}; shift
- ;;
- esac
+ exit $EXIT_MISMATCH
+ fi
+}
+
+
+# Shorthand for --mode=foo, only valid as the first argument
+case $1 in
+clean|clea|cle|cl)
+ shift; set dummy --mode clean ${1+"$@"}; shift
+ ;;
+compile|compil|compi|comp|com|co|c)
+ shift; set dummy --mode compile ${1+"$@"}; shift
+ ;;
+execute|execut|execu|exec|exe|ex|e)
+ shift; set dummy --mode execute ${1+"$@"}; shift
+ ;;
+finish|finis|fini|fin|fi|f)
+ shift; set dummy --mode finish ${1+"$@"}; shift
+ ;;
+install|instal|insta|inst|ins|in|i)
+ shift; set dummy --mode install ${1+"$@"}; shift
+ ;;
+link|lin|li|l)
+ shift; set dummy --mode link ${1+"$@"}; shift
+ ;;
+uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
+ shift; set dummy --mode uninstall ${1+"$@"}; shift
+ ;;
+esac
+
+
+
+# Option defaults:
+opt_debug=:
+opt_dry_run=false
+opt_config=false
+opt_preserve_dup_deps=false
+opt_features=false
+opt_finish=false
+opt_help=false
+opt_help_all=false
+opt_silent=:
+opt_verbose=:
+opt_silent=false
+opt_verbose=false
- # Parse non-mode specific arguments:
- while test "$#" -gt 0; do
+
+# Parse options once, thoroughly. This comes as soon as possible in the
+# script to make things like `--version' happen as quickly as we can.
+{
+ # this just eases exit handling
+ while test $# -gt 0; do
opt="$1"
shift
-
case $opt in
- --config) func_config ;;
-
- --debug) preserve_args="$preserve_args $opt"
+ --debug|-x) opt_debug='set -x'
func_echo "enabling shell trace mode"
- opt_debug='set -x'
$opt_debug
;;
-
- -dlopen) test "$#" -eq 0 && func_missing_arg "$opt" && break
- execute_dlfiles="$execute_dlfiles $1"
- shift
+ --dry-run|--dryrun|-n)
+ opt_dry_run=:
;;
-
- --dry-run | -n) opt_dry_run=: ;;
- --features) func_features ;;
- --finish) mode="finish" ;;
-
- --mode) test "$#" -eq 0 && func_missing_arg "$opt" && break
- case $1 in
- # Valid mode arguments:
- clean) ;;
- compile) ;;
- execute) ;;
- finish) ;;
- install) ;;
- link) ;;
- relink) ;;
- uninstall) ;;
-
- # Catch anything else as an error
- *) func_error "invalid argument for $opt"
- exit_cmd=exit
- break
- ;;
- esac
-
- mode="$1"
+ --config)
+ opt_config=:
+func_config
+ ;;
+ --dlopen|-dlopen)
+ optarg="$1"
+ opt_dlopen="${opt_dlopen+$opt_dlopen
+}$optarg"
shift
;;
-
--preserve-dup-deps)
- opt_duplicate_deps=: ;;
-
- --quiet|--silent) preserve_args="$preserve_args $opt"
- opt_silent=:
+ opt_preserve_dup_deps=:
;;
-
- --verbose| -v) preserve_args="$preserve_args $opt"
+ --features)
+ opt_features=:
+func_features
+ ;;
+ --finish)
+ opt_finish=:
+set dummy --mode finish ${1+"$@"}; shift
+ ;;
+ --help)
+ opt_help=:
+ ;;
+ --help-all)
+ opt_help_all=:
+opt_help=': help-all'
+ ;;
+ --mode)
+ test $# = 0 && func_missing_arg $opt && break
+ optarg="$1"
+ opt_mode="$optarg"
+case $optarg in
+ # Valid mode arguments:
+ clean|compile|execute|finish|install|link|relink|uninstall) ;;
+
+ # Catch anything else as an error
+ *) func_error "invalid argument for $opt"
+ exit_cmd=exit
+ break
+ ;;
+esac
+ shift
+ ;;
+ --no-silent|--no-quiet)
opt_silent=false
+func_append preserve_args " $opt"
;;
-
- --tag) test "$#" -eq 0 && func_missing_arg "$opt" && break
- preserve_args="$preserve_args $opt $1"
- func_enable_tag "$1" # tagname is set here
+ --no-verbose)
+ opt_verbose=false
+func_append preserve_args " $opt"
+ ;;
+ --silent|--quiet)
+ opt_silent=:
+func_append preserve_args " $opt"
+ opt_verbose=false
+ ;;
+ --verbose|-v)
+ opt_verbose=:
+func_append preserve_args " $opt"
+opt_silent=false
+ ;;
+ --tag)
+ test $# = 0 && func_missing_arg $opt && break
+ optarg="$1"
+ opt_tag="$optarg"
+func_append preserve_args " $opt $optarg"
+func_enable_tag "$optarg"
shift
;;
+ -\?|-h) func_usage ;;
+ --help) func_help ;;
+ --version) func_version ;;
+
# Separate optargs to long options:
- -dlopen=*|--mode=*|--tag=*)
- func_opt_split "$opt"
- set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"}
+ --*=*)
+ func_split_long_opt "$opt"
+ set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"}
shift
;;
- -\?|-h) func_usage ;;
- --help) opt_help=: ;;
- --version) func_version ;;
-
- -*) func_fatal_help "unrecognized option \`$opt'" ;;
-
- *) nonopt="$opt"
- break
+ # Separate non-argument short options:
+ -\?*|-h*|-n*|-v*)
+ func_split_short_opt "$opt"
+ set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"}
+ shift
;;
+
+ --) break ;;
+ -*) func_fatal_help "unrecognized option \`$opt'" ;;
+ *) set dummy "$opt" ${1+"$@"}; shift; break ;;
esac
done
+ # Validate options:
+
+ # save first non-option argument
+ if test "$#" -gt 0; then
+ nonopt="$opt"
+ shift
+ fi
+
+ # preserve --debug
+ test "$opt_debug" = : || func_append preserve_args " --debug"
case $host in
*cygwin* | *mingw* | *pw32* | *cegcc*)
opt_duplicate_compiler_generated_deps=:
;;
*)
- opt_duplicate_compiler_generated_deps=$opt_duplicate_deps
+ opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
;;
esac
- # Having warned about all mis-specified options, bail out if
- # anything was wrong.
- $exit_cmd $EXIT_FAILURE
-}
+ $opt_help || {
+ # Sanity checks first:
+ func_check_version_match
-# func_check_version_match
-# Ensure that we are using m4 macros, and libtool script from the same
-# release of libtool.
-func_check_version_match ()
-{
- if test "$package_revision" != "$macro_revision"; then
- if test "$VERSION" != "$macro_version"; then
- if test -z "$macro_version"; then
- cat >&2 <<_LT_EOF
-$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
-$progname: definition of this LT_INIT comes from an older release.
-$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
-$progname: and run autoconf again.
-_LT_EOF
- else
- cat >&2 <<_LT_EOF
-$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
-$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
-$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
-$progname: and run autoconf again.
-_LT_EOF
- fi
- else
- cat >&2 <<_LT_EOF
-$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision,
-$progname: but the definition of this LT_INIT comes from revision $macro_revision.
-$progname: You should recreate aclocal.m4 with macros from revision $package_revision
-$progname: of $PACKAGE $VERSION and run autoconf again.
-_LT_EOF
+ if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
+ func_fatal_configuration "not configured to build any kind of library"
fi
- exit $EXIT_MISMATCH
- fi
-}
-
-
-## ----------- ##
-## Main. ##
-## ----------- ##
-
-$opt_help || {
- # Sanity checks first:
- func_check_version_match
+ # Darwin sucks
+ eval std_shrext=\"$shrext_cmds\"
- if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
- func_fatal_configuration "not configured to build any kind of library"
- fi
+ # Only execute mode is allowed to have -dlopen flags.
+ if test -n "$opt_dlopen" && test "$opt_mode" != execute; then
+ func_error "unrecognized option \`-dlopen'"
+ $ECHO "$help" 1>&2
+ exit $EXIT_FAILURE
+ fi
- test -z "$mode" && func_fatal_error "error: you must specify a MODE."
+ # Change the help message to a mode-specific one.
+ generic_help="$help"
+ help="Try \`$progname --help --mode=$opt_mode' for more information."
+ }
- # Darwin sucks
- eval std_shrext=\"$shrext_cmds\"
+ # Bail if the options were screwed
+ $exit_cmd $EXIT_FAILURE
+}
- # Only execute mode is allowed to have -dlopen flags.
- if test -n "$execute_dlfiles" && test "$mode" != execute; then
- func_error "unrecognized option \`-dlopen'"
- $ECHO "$help" 1>&2
- exit $EXIT_FAILURE
- fi
- # Change the help message to a mode-specific one.
- generic_help="$help"
- help="Try \`$progname --help --mode=$mode' for more information."
-}
+## ----------- ##
+## Main. ##
+## ----------- ##
# func_lalib_p file
# True iff FILE is a libtool `.la' library or `.lo' object file.
# temporary ltwrapper_script.
func_ltwrapper_scriptname ()
{
- func_ltwrapper_scriptname_result=""
- if func_ltwrapper_executable_p "$1"; then
- func_dirname_and_basename "$1" "" "."
- func_stripname '' '.exe' "$func_basename_result"
- func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
- fi
+ func_dirname_and_basename "$1" "" "."
+ func_stripname '' '.exe' "$func_basename_result"
+ func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
}
# func_ltwrapper_p file
}
+# func_resolve_sysroot PATH
+# Replace a leading = in PATH with a sysroot. Store the result into
+# func_resolve_sysroot_result
+func_resolve_sysroot ()
+{
+ func_resolve_sysroot_result=$1
+ case $func_resolve_sysroot_result in
+ =*)
+ func_stripname '=' '' "$func_resolve_sysroot_result"
+ func_resolve_sysroot_result=$lt_sysroot$func_stripname_result
+ ;;
+ esac
+}
+
+# func_replace_sysroot PATH
+# If PATH begins with the sysroot, replace it with = and
+# store the result into func_replace_sysroot_result.
+func_replace_sysroot ()
+{
+ case "$lt_sysroot:$1" in
+ ?*:"$lt_sysroot"*)
+ func_stripname "$lt_sysroot" '' "$1"
+ func_replace_sysroot_result="=$func_stripname_result"
+ ;;
+ *)
+ # Including no sysroot.
+ func_replace_sysroot_result=$1
+ ;;
+ esac
+}
+
# func_infer_tag arg
# Infer tagged configuration to use if any are available and
# if one wasn't chosen via the "--tag" command line option.
if test -n "$available_tags" && test -z "$tagname"; then
CC_quoted=
for arg in $CC; do
- func_quote_for_eval "$arg"
- CC_quoted="$CC_quoted $func_quote_for_eval_result"
+ func_append_quoted CC_quoted "$arg"
done
+ CC_expanded=`func_echo_all $CC`
+ CC_quoted_expanded=`func_echo_all $CC_quoted`
case $@ in
# Blanks in the command may have been stripped by the calling shell,
# but not from the CC environment variable when configure was run.
- " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) ;;
+ " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
+ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;;
# Blanks at the start of $base_compile will cause this to fail
# if we don't check for them as well.
*)
CC_quoted=
for arg in $CC; do
# Double-quote args containing other shell metacharacters.
- func_quote_for_eval "$arg"
- CC_quoted="$CC_quoted $func_quote_for_eval_result"
+ func_append_quoted CC_quoted "$arg"
done
+ CC_expanded=`func_echo_all $CC`
+ CC_quoted_expanded=`func_echo_all $CC_quoted`
case "$@ " in
- " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*)
+ " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
+ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*)
# The compiler in the base compile command matches
# the one in the tagged configuration.
# Assume this is the tagged configuration we want.
}
}
+
+##################################################
+# FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #
+##################################################
+
+# func_convert_core_file_wine_to_w32 ARG
+# Helper function used by file name conversion functions when $build is *nix,
+# and $host is mingw, cygwin, or some other w32 environment. Relies on a
+# correctly configured wine environment available, with the winepath program
+# in $build's $PATH.
+#
+# ARG is the $build file name to be converted to w32 format.
+# Result is available in $func_convert_core_file_wine_to_w32_result, and will
+# be empty on error (or when ARG is empty)
+func_convert_core_file_wine_to_w32 ()
+{
+ $opt_debug
+ func_convert_core_file_wine_to_w32_result="$1"
+ if test -n "$1"; then
+ # Unfortunately, winepath does not exit with a non-zero error code, so we
+ # are forced to check the contents of stdout. On the other hand, if the
+ # command is not found, the shell will set an exit code of 127 and print
+ # *an error message* to stdout. So we must check for both error code of
+ # zero AND non-empty stdout, which explains the odd construction:
+ func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
+ if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then
+ func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
+ $SED -e "$lt_sed_naive_backslashify"`
+ else
+ func_convert_core_file_wine_to_w32_result=
+ fi
+ fi
+}
+# end: func_convert_core_file_wine_to_w32
+
+
+# func_convert_core_path_wine_to_w32 ARG
+# Helper function used by path conversion functions when $build is *nix, and
+# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
+# configured wine environment available, with the winepath program in $build's
+# $PATH. Assumes ARG has no leading or trailing path separator characters.
+#
+# ARG is path to be converted from $build format to win32.
+# Result is available in $func_convert_core_path_wine_to_w32_result.
+# Unconvertible file (directory) names in ARG are skipped; if no directory names
+# are convertible, then the result may be empty.
+func_convert_core_path_wine_to_w32 ()
+{
+ $opt_debug
+ # unfortunately, winepath doesn't convert paths, only file names
+ func_convert_core_path_wine_to_w32_result=""
+ if test -n "$1"; then
+ oldIFS=$IFS
+ IFS=:
+ for func_convert_core_path_wine_to_w32_f in $1; do
+ IFS=$oldIFS
+ func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
+ if test -n "$func_convert_core_file_wine_to_w32_result" ; then
+ if test -z "$func_convert_core_path_wine_to_w32_result"; then
+ func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result"
+ else
+ func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
+ fi
+ fi
+ done
+ IFS=$oldIFS
+ fi
+}
+# end: func_convert_core_path_wine_to_w32
+
+
+# func_cygpath ARGS...
+# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when
+# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)
+# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or
+# (2), returns the Cygwin file name or path in func_cygpath_result (input
+# file name or path is assumed to be in w32 format, as previously converted
+# from $build's *nix or MSYS format). In case (3), returns the w32 file name
+# or path in func_cygpath_result (input file name or path is assumed to be in
+# Cygwin format). Returns an empty string on error.
+#
+# ARGS are passed to cygpath, with the last one being the file name or path to
+# be converted.
+#
+# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH
+# environment variable; do not put it in $PATH.
+func_cygpath ()
+{
+ $opt_debug
+ if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
+ func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
+ if test "$?" -ne 0; then
+ # on failure, ensure result is empty
+ func_cygpath_result=
+ fi
+ else
+ func_cygpath_result=
+ func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'"
+ fi
+}
+#end: func_cygpath
+
+
+# func_convert_core_msys_to_w32 ARG
+# Convert file name or path ARG from MSYS format to w32 format. Return
+# result in func_convert_core_msys_to_w32_result.
+func_convert_core_msys_to_w32 ()
+{
+ $opt_debug
+ # awkward: cmd appends spaces to result
+ func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
+ $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
+}
+#end: func_convert_core_msys_to_w32
+
+
+# func_convert_file_check ARG1 ARG2
+# Verify that ARG1 (a file name in $build format) was converted to $host
+# format in ARG2. Otherwise, emit an error message, but continue (resetting
+# func_to_host_file_result to ARG1).
+func_convert_file_check ()
+{
+ $opt_debug
+ if test -z "$2" && test -n "$1" ; then
+ func_error "Could not determine host file name corresponding to"
+ func_error " \`$1'"
+ func_error "Continuing, but uninstalled executables may not work."
+ # Fallback:
+ func_to_host_file_result="$1"
+ fi
+}
+# end func_convert_file_check
+
+
+# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH
+# Verify that FROM_PATH (a path in $build format) was converted to $host
+# format in TO_PATH. Otherwise, emit an error message, but continue, resetting
+# func_to_host_file_result to a simplistic fallback value (see below).
+func_convert_path_check ()
+{
+ $opt_debug
+ if test -z "$4" && test -n "$3"; then
+ func_error "Could not determine the host path corresponding to"
+ func_error " \`$3'"
+ func_error "Continuing, but uninstalled executables may not work."
+ # Fallback. This is a deliberately simplistic "conversion" and
+ # should not be "improved". See libtool.info.
+ if test "x$1" != "x$2"; then
+ lt_replace_pathsep_chars="s|$1|$2|g"
+ func_to_host_path_result=`echo "$3" |
+ $SED -e "$lt_replace_pathsep_chars"`
+ else
+ func_to_host_path_result="$3"
+ fi
+ fi
+}
+# end func_convert_path_check
+
+
+# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG
+# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT
+# and appending REPL if ORIG matches BACKPAT.
+func_convert_path_front_back_pathsep ()
+{
+ $opt_debug
+ case $4 in
+ $1 ) func_to_host_path_result="$3$func_to_host_path_result"
+ ;;
+ esac
+ case $4 in
+ $2 ) func_append func_to_host_path_result "$3"
+ ;;
+ esac
+}
+# end func_convert_path_front_back_pathsep
+
+
+##################################################
+# $build to $host FILE NAME CONVERSION FUNCTIONS #
+##################################################
+# invoked via `$to_host_file_cmd ARG'
+#
+# In each case, ARG is the path to be converted from $build to $host format.
+# Result will be available in $func_to_host_file_result.
+
+
+# func_to_host_file ARG
+# Converts the file name ARG from $build format to $host format. Return result
+# in func_to_host_file_result.
+func_to_host_file ()
+{
+ $opt_debug
+ $to_host_file_cmd "$1"
+}
+# end func_to_host_file
+
+
+# func_to_tool_file ARG LAZY
+# converts the file name ARG from $build format to toolchain format. Return
+# result in func_to_tool_file_result. If the conversion in use is listed
+# in (the comma separated) LAZY, no conversion takes place.
+func_to_tool_file ()
+{
+ $opt_debug
+ case ,$2, in
+ *,"$to_tool_file_cmd",*)
+ func_to_tool_file_result=$1
+ ;;
+ *)
+ $to_tool_file_cmd "$1"
+ func_to_tool_file_result=$func_to_host_file_result
+ ;;
+ esac
+}
+# end func_to_tool_file
+
+
+# func_convert_file_noop ARG
+# Copy ARG to func_to_host_file_result.
+func_convert_file_noop ()
+{
+ func_to_host_file_result="$1"
+}
+# end func_convert_file_noop
+
+
+# func_convert_file_msys_to_w32 ARG
+# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic
+# conversion to w32 is not available inside the cwrapper. Returns result in
+# func_to_host_file_result.
+func_convert_file_msys_to_w32 ()
+{
+ $opt_debug
+ func_to_host_file_result="$1"
+ if test -n "$1"; then
+ func_convert_core_msys_to_w32 "$1"
+ func_to_host_file_result="$func_convert_core_msys_to_w32_result"
+ fi
+ func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_msys_to_w32
+
+
+# func_convert_file_cygwin_to_w32 ARG
+# Convert file name ARG from Cygwin to w32 format. Returns result in
+# func_to_host_file_result.
+func_convert_file_cygwin_to_w32 ()
+{
+ $opt_debug
+ func_to_host_file_result="$1"
+ if test -n "$1"; then
+ # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
+ # LT_CYGPATH in this case.
+ func_to_host_file_result=`cygpath -m "$1"`
+ fi
+ func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_cygwin_to_w32
+
+
+# func_convert_file_nix_to_w32 ARG
+# Convert file name ARG from *nix to w32 format. Requires a wine environment
+# and a working winepath. Returns result in func_to_host_file_result.
+func_convert_file_nix_to_w32 ()
+{
+ $opt_debug
+ func_to_host_file_result="$1"
+ if test -n "$1"; then
+ func_convert_core_file_wine_to_w32 "$1"
+ func_to_host_file_result="$func_convert_core_file_wine_to_w32_result"
+ fi
+ func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_nix_to_w32
+
+
+# func_convert_file_msys_to_cygwin ARG
+# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
+# Returns result in func_to_host_file_result.
+func_convert_file_msys_to_cygwin ()
+{
+ $opt_debug
+ func_to_host_file_result="$1"
+ if test -n "$1"; then
+ func_convert_core_msys_to_w32 "$1"
+ func_cygpath -u "$func_convert_core_msys_to_w32_result"
+ func_to_host_file_result="$func_cygpath_result"
+ fi
+ func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_msys_to_cygwin
+
+
+# func_convert_file_nix_to_cygwin ARG
+# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed
+# in a wine environment, working winepath, and LT_CYGPATH set. Returns result
+# in func_to_host_file_result.
+func_convert_file_nix_to_cygwin ()
+{
+ $opt_debug
+ func_to_host_file_result="$1"
+ if test -n "$1"; then
+ # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
+ func_convert_core_file_wine_to_w32 "$1"
+ func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
+ func_to_host_file_result="$func_cygpath_result"
+ fi
+ func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_nix_to_cygwin
+
+
+#############################################
+# $build to $host PATH CONVERSION FUNCTIONS #
+#############################################
+# invoked via `$to_host_path_cmd ARG'
+#
+# In each case, ARG is the path to be converted from $build to $host format.
+# The result will be available in $func_to_host_path_result.
+#
+# Path separators are also converted from $build format to $host format. If
+# ARG begins or ends with a path separator character, it is preserved (but
+# converted to $host format) on output.
+#
+# All path conversion functions are named using the following convention:
+# file name conversion function : func_convert_file_X_to_Y ()
+# path conversion function : func_convert_path_X_to_Y ()
+# where, for any given $build/$host combination the 'X_to_Y' value is the
+# same. If conversion functions are added for new $build/$host combinations,
+# the two new functions must follow this pattern, or func_init_to_host_path_cmd
+# will break.
+
+
+# func_init_to_host_path_cmd
+# Ensures that function "pointer" variable $to_host_path_cmd is set to the
+# appropriate value, based on the value of $to_host_file_cmd.
+to_host_path_cmd=
+func_init_to_host_path_cmd ()
+{
+ $opt_debug
+ if test -z "$to_host_path_cmd"; then
+ func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
+ to_host_path_cmd="func_convert_path_${func_stripname_result}"
+ fi
+}
+
+
+# func_to_host_path ARG
+# Converts the path ARG from $build format to $host format. Return result
+# in func_to_host_path_result.
+func_to_host_path ()
+{
+ $opt_debug
+ func_init_to_host_path_cmd
+ $to_host_path_cmd "$1"
+}
+# end func_to_host_path
+
+
+# func_convert_path_noop ARG
+# Copy ARG to func_to_host_path_result.
+func_convert_path_noop ()
+{
+ func_to_host_path_result="$1"
+}
+# end func_convert_path_noop
+
+
+# func_convert_path_msys_to_w32 ARG
+# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic
+# conversion to w32 is not available inside the cwrapper. Returns result in
+# func_to_host_path_result.
+func_convert_path_msys_to_w32 ()
+{
+ $opt_debug
+ func_to_host_path_result="$1"
+ if test -n "$1"; then
+ # Remove leading and trailing path separator characters from ARG. MSYS
+ # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
+ # and winepath ignores them completely.
+ func_stripname : : "$1"
+ func_to_host_path_tmp1=$func_stripname_result
+ func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
+ func_to_host_path_result="$func_convert_core_msys_to_w32_result"
+ func_convert_path_check : ";" \
+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
+ func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
+ fi
+}
+# end func_convert_path_msys_to_w32
+
+
+# func_convert_path_cygwin_to_w32 ARG
+# Convert path ARG from Cygwin to w32 format. Returns result in
+# func_to_host_file_result.
+func_convert_path_cygwin_to_w32 ()
+{
+ $opt_debug
+ func_to_host_path_result="$1"
+ if test -n "$1"; then
+ # See func_convert_path_msys_to_w32:
+ func_stripname : : "$1"
+ func_to_host_path_tmp1=$func_stripname_result
+ func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`
+ func_convert_path_check : ";" \
+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
+ func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
+ fi
+}
+# end func_convert_path_cygwin_to_w32
+
+
+# func_convert_path_nix_to_w32 ARG
+# Convert path ARG from *nix to w32 format. Requires a wine environment and
+# a working winepath. Returns result in func_to_host_file_result.
+func_convert_path_nix_to_w32 ()
+{
+ $opt_debug
+ func_to_host_path_result="$1"
+ if test -n "$1"; then
+ # See func_convert_path_msys_to_w32:
+ func_stripname : : "$1"
+ func_to_host_path_tmp1=$func_stripname_result
+ func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
+ func_to_host_path_result="$func_convert_core_path_wine_to_w32_result"
+ func_convert_path_check : ";" \
+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
+ func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
+ fi
+}
+# end func_convert_path_nix_to_w32
+
+
+# func_convert_path_msys_to_cygwin ARG
+# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
+# Returns result in func_to_host_file_result.
+func_convert_path_msys_to_cygwin ()
+{
+ $opt_debug
+ func_to_host_path_result="$1"
+ if test -n "$1"; then
+ # See func_convert_path_msys_to_w32:
+ func_stripname : : "$1"
+ func_to_host_path_tmp1=$func_stripname_result
+ func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
+ func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
+ func_to_host_path_result="$func_cygpath_result"
+ func_convert_path_check : : \
+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
+ func_convert_path_front_back_pathsep ":*" "*:" : "$1"
+ fi
+}
+# end func_convert_path_msys_to_cygwin
+
+
+# func_convert_path_nix_to_cygwin ARG
+# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a
+# a wine environment, working winepath, and LT_CYGPATH set. Returns result in
+# func_to_host_file_result.
+func_convert_path_nix_to_cygwin ()
+{
+ $opt_debug
+ func_to_host_path_result="$1"
+ if test -n "$1"; then
+ # Remove leading and trailing path separator characters from
+ # ARG. msys behavior is inconsistent here, cygpath turns them
+ # into '.;' and ';.', and winepath ignores them completely.
+ func_stripname : : "$1"
+ func_to_host_path_tmp1=$func_stripname_result
+ func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
+ func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
+ func_to_host_path_result="$func_cygpath_result"
+ func_convert_path_check : : \
+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
+ func_convert_path_front_back_pathsep ":*" "*:" : "$1"
+ fi
+}
+# end func_convert_path_nix_to_cygwin
+
+
# func_mode_compile arg...
func_mode_compile ()
{
;;
-pie | -fpie | -fPIE)
- pie_flag="$pie_flag $arg"
+ func_append pie_flag " $arg"
continue
;;
-shared | -static | -prefer-pic | -prefer-non-pic)
- later="$later $arg"
+ func_append later " $arg"
continue
;;
save_ifs="$IFS"; IFS=','
for arg in $args; do
IFS="$save_ifs"
- func_quote_for_eval "$arg"
- lastarg="$lastarg $func_quote_for_eval_result"
+ func_append_quoted lastarg "$arg"
done
IFS="$save_ifs"
func_stripname ' ' '' "$lastarg"
lastarg=$func_stripname_result
# Add the arguments to base_compile.
- base_compile="$base_compile $lastarg"
+ func_append base_compile " $lastarg"
continue
;;
esac # case $arg_mode
# Aesthetically quote the previous argument.
- func_quote_for_eval "$lastarg"
- base_compile="$base_compile $func_quote_for_eval_result"
+ func_append_quoted base_compile "$lastarg"
done # for arg
case $arg_mode in
*.[cCFSifmso] | \
*.ada | *.adb | *.ads | *.asm | \
*.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
- *.[fF][09]? | *.for | *.java | *.obj | *.sx)
+ *.[fF][09]? | *.for | *.java | *.obj | *.sx | *.cu | *.cup)
func_xform "$libobj"
libobj=$func_xform_result
;;
# Calculate the filename of the output object if compiler does
# not support -o with -c
if test "$compiler_c_o" = no; then
- output_obj=`$ECHO "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
+ output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext}
lockfile="$output_obj.lock"
else
output_obj=
$opt_dry_run || $RM $removelist
exit $EXIT_FAILURE
fi
- removelist="$removelist $output_obj"
+ func_append removelist " $output_obj"
$ECHO "$srcfile" > "$lockfile"
fi
$opt_dry_run || $RM $removelist
- removelist="$removelist $lockfile"
+ func_append removelist " $lockfile"
trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
- if test -n "$fix_srcfile_path"; then
- eval srcfile=\"$fix_srcfile_path\"
- fi
+ func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
+ srcfile=$func_to_tool_file_result
func_quote_for_eval "$srcfile"
qsrcfile=$func_quote_for_eval_result
if test -z "$output_obj"; then
# Place PIC objects in $objdir
- command="$command -o $lobj"
+ func_append command " -o $lobj"
fi
func_show_eval_locale "$command" \
command="$base_compile $qsrcfile $pic_flag"
fi
if test "$compiler_c_o" = yes; then
- command="$command -o $obj"
+ func_append command " -o $obj"
fi
# Suppress compiler output if we already did a PIC compilation.
- command="$command$suppress_output"
+ func_append command "$suppress_output"
func_show_eval_locale "$command" \
'$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
}
$opt_help || {
-test "$mode" = compile && func_mode_compile ${1+"$@"}
+ test "$opt_mode" = compile && func_mode_compile ${1+"$@"}
}
func_mode_help ()
{
# We need to display help for each of the modes.
- case $mode in
+ case $opt_mode in
"")
# Generic help is extracted from the usage comments
# at the start of this file.
-o OUTPUT-FILE set the output file name to OUTPUT-FILE
-no-suppress do not suppress compiler output for multiple passes
- -prefer-pic try to building PIC objects only
- -prefer-non-pic try to building non-PIC objects only
+ -prefer-pic try to build PIC objects only
+ -prefer-non-pic try to build non-PIC objects only
-shared do not build a \`.o' file suitable for static linking
-static only build a \`.o' file suitable for static linking
+ -Wc,FLAG pass FLAG directly to the compiler
COMPILE-COMMAND is a command to be used in creating a \`standard' object file
from the given SOURCEFILE.
The following components of INSTALL-COMMAND are treated specially:
- -inst-prefix PREFIX-DIR Use PREFIX-DIR as a staging area for installation
+ -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation
The rest of the components are interpreted as arguments to that command (only
BSD-compatible install options are recognized)."
-all-static do not do any dynamic linking at all
-avoid-version do not add a version suffix if possible
+ -bindir BINDIR specify path to binaries directory (for systems where
+ libraries must be found in the PATH setting at runtime)
-dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
-dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
-export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
-version-info CURRENT[:REVISION[:AGE]]
specify library version info [each variable defaults to 0]
-weak LIBNAME declare that the target provides the LIBNAME interface
+ -Wc,FLAG
+ -Xcompiler FLAG pass linker-specific FLAG directly to the compiler
+ -Wl,FLAG
+ -Xlinker FLAG pass linker-specific FLAG directly to the linker
+ -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC)
All other options (arguments beginning with \`-') are ignored.
;;
*)
- func_fatal_help "invalid operation mode \`$mode'"
+ func_fatal_help "invalid operation mode \`$opt_mode'"
;;
esac
- $ECHO
+ echo
$ECHO "Try \`$progname --help' for more information about other modes."
-
- exit $?
}
- # Now that we've collected a possible --mode arg, show help if necessary
- $opt_help && func_mode_help
+# Now that we've collected a possible --mode arg, show help if necessary
+if $opt_help; then
+ if test "$opt_help" = :; then
+ func_mode_help
+ else
+ {
+ func_help noexit
+ for opt_mode in compile link execute install finish uninstall clean; do
+ func_mode_help
+ done
+ } | sed -n '1p; 2,$s/^Usage:/ or: /p'
+ {
+ func_help noexit
+ for opt_mode in compile link execute install finish uninstall clean; do
+ echo
+ func_mode_help
+ done
+ } |
+ sed '1d
+ /^When reporting/,/^Report/{
+ H
+ d
+ }
+ $x
+ /information about other modes/d
+ /more detailed .*MODE/d
+ s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/'
+ fi
+ exit $?
+fi
# func_mode_execute arg...
func_fatal_help "you must specify a COMMAND"
# Handle -dlopen flags immediately.
- for file in $execute_dlfiles; do
+ for file in $opt_dlopen; do
test -f "$file" \
|| func_fatal_help "\`$file' is not a file"
dir=
case $file in
*.la)
+ func_resolve_sysroot "$file"
+ file=$func_resolve_sysroot_result
+
# Check to see that this really is a libtool archive.
func_lalib_unsafe_p "$file" \
|| func_fatal_help "\`$lib' is not a valid libtool archive"
dir="$func_dirname_result"
if test -f "$dir/$objdir/$dlname"; then
- dir="$dir/$objdir"
+ func_append dir "/$objdir"
else
if test ! -f "$dir/$dlname"; then
func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
for file
do
case $file in
- -*) ;;
+ -* | *.la | *.lo ) ;;
*)
# Do a test to see if this is really a libtool program.
if func_ltwrapper_script_p "$file"; then
;;
esac
# Quote arguments (to preserve shell metacharacters).
- func_quote_for_eval "$file"
- args="$args $func_quote_for_eval_result"
+ func_append_quoted args "$file"
done
if test "X$opt_dry_run" = Xfalse; then
# Display what would be done.
if test -n "$shlibpath_var"; then
eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
- $ECHO "export $shlibpath_var"
+ echo "export $shlibpath_var"
fi
$ECHO "$cmd$args"
exit $EXIT_SUCCESS
fi
}
-test "$mode" = execute && func_mode_execute ${1+"$@"}
+test "$opt_mode" = execute && func_mode_execute ${1+"$@"}
+
+
+# func_mode_finish arg...
+func_mode_finish ()
+{
+ $opt_debug
+ libs=
+ libdirs=
+ admincmds=
+
+ for opt in "$nonopt" ${1+"$@"}
+ do
+ if test -d "$opt"; then
+ func_append libdirs " $opt"
+
+ elif test -f "$opt"; then
+ if func_lalib_unsafe_p "$opt"; then
+ func_append libs " $opt"
+ else
+ func_warning "\`$opt' is not a valid libtool archive"
+ fi
+
+ else
+ func_fatal_error "invalid argument \`$opt'"
+ fi
+ done
+ if test -n "$libs"; then
+ if test -n "$lt_sysroot"; then
+ sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"`
+ sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;"
+ else
+ sysroot_cmd=
+ fi
-# func_mode_finish arg...
-func_mode_finish ()
-{
- $opt_debug
- libdirs="$nonopt"
- admincmds=
+ # Remove sysroot references
+ if $opt_dry_run; then
+ for lib in $libs; do
+ echo "removing references to $lt_sysroot and \`=' prefixes from $lib"
+ done
+ else
+ tmpdir=`func_mktempdir`
+ for lib in $libs; do
+ sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
+ > $tmpdir/tmp-la
+ mv -f $tmpdir/tmp-la $lib
+ done
+ ${RM}r "$tmpdir"
+ fi
+ fi
if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
- for dir
- do
- libdirs="$libdirs $dir"
- done
-
for libdir in $libdirs; do
if test -n "$finish_cmds"; then
# Do each command in the finish commands.
if test -n "$finish_eval"; then
# Do the single finish_eval.
eval cmds=\"$finish_eval\"
- $opt_dry_run || eval "$cmds" || admincmds="$admincmds
+ $opt_dry_run || eval "$cmds" || func_append admincmds "
$cmds"
fi
done
# Exit here if they wanted silent mode.
$opt_silent && exit $EXIT_SUCCESS
- $ECHO "X----------------------------------------------------------------------" | $Xsed
- $ECHO "Libraries have been installed in:"
- for libdir in $libdirs; do
- $ECHO " $libdir"
- done
- $ECHO
- $ECHO "If you ever happen to want to link against installed libraries"
- $ECHO "in a given directory, LIBDIR, you must either use libtool, and"
- $ECHO "specify the full pathname of the library, or use the \`-LLIBDIR'"
- $ECHO "flag during linking and do at least one of the following:"
- if test -n "$shlibpath_var"; then
- $ECHO " - add LIBDIR to the \`$shlibpath_var' environment variable"
- $ECHO " during execution"
- fi
- if test -n "$runpath_var"; then
- $ECHO " - add LIBDIR to the \`$runpath_var' environment variable"
- $ECHO " during linking"
- fi
- if test -n "$hardcode_libdir_flag_spec"; then
- libdir=LIBDIR
- eval flag=\"$hardcode_libdir_flag_spec\"
+ if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+ echo "----------------------------------------------------------------------"
+ echo "Libraries have been installed in:"
+ for libdir in $libdirs; do
+ $ECHO " $libdir"
+ done
+ echo
+ echo "If you ever happen to want to link against installed libraries"
+ echo "in a given directory, LIBDIR, you must either use libtool, and"
+ echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
+ echo "flag during linking and do at least one of the following:"
+ if test -n "$shlibpath_var"; then
+ echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
+ echo " during execution"
+ fi
+ if test -n "$runpath_var"; then
+ echo " - add LIBDIR to the \`$runpath_var' environment variable"
+ echo " during linking"
+ fi
+ if test -n "$hardcode_libdir_flag_spec"; then
+ libdir=LIBDIR
+ eval flag=\"$hardcode_libdir_flag_spec\"
- $ECHO " - use the \`$flag' linker flag"
- fi
- if test -n "$admincmds"; then
- $ECHO " - have your system administrator run these commands:$admincmds"
- fi
- if test -f /etc/ld.so.conf; then
- $ECHO " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
- fi
- $ECHO
+ $ECHO " - use the \`$flag' linker flag"
+ fi
+ if test -n "$admincmds"; then
+ $ECHO " - have your system administrator run these commands:$admincmds"
+ fi
+ if test -f /etc/ld.so.conf; then
+ echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
+ fi
+ echo
- $ECHO "See any operating system documentation about shared libraries for"
- case $host in
- solaris2.[6789]|solaris2.1[0-9])
- $ECHO "more information, such as the ld(1), crle(1) and ld.so(8) manual"
- $ECHO "pages."
- ;;
- *)
- $ECHO "more information, such as the ld(1) and ld.so(8) manual pages."
- ;;
- esac
- $ECHO "X----------------------------------------------------------------------" | $Xsed
+ echo "See any operating system documentation about shared libraries for"
+ case $host in
+ solaris2.[6789]|solaris2.1[0-9])
+ echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
+ echo "pages."
+ ;;
+ *)
+ echo "more information, such as the ld(1) and ld.so(8) manual pages."
+ ;;
+ esac
+ echo "----------------------------------------------------------------------"
+ fi
exit $EXIT_SUCCESS
}
-test "$mode" = finish && func_mode_finish ${1+"$@"}
+test "$opt_mode" = finish && func_mode_finish ${1+"$@"}
# func_mode_install arg...
# install_prog (especially on Windows NT).
if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
# Allow the use of GNU shtool's install command.
- $ECHO "X$nonopt" | $GREP shtool >/dev/null; then
+ case $nonopt in *shtool*) :;; *) false;; esac; then
# Aesthetically quote it.
func_quote_for_eval "$nonopt"
install_prog="$func_quote_for_eval_result "
# The real first argument should be the name of the installation program.
# Aesthetically quote it.
func_quote_for_eval "$arg"
- install_prog="$install_prog$func_quote_for_eval_result"
+ func_append install_prog "$func_quote_for_eval_result"
+ install_shared_prog=$install_prog
+ case " $install_prog " in
+ *[\\\ /]cp\ *) install_cp=: ;;
+ *) install_cp=false ;;
+ esac
# We need to accept at least all the BSD install flags.
dest=
install_type=
isdir=no
stripme=
+ no_mode=:
for arg
do
+ arg2=
if test -n "$dest"; then
- files="$files $dest"
+ func_append files " $dest"
dest=$arg
continue
fi
case $arg in
-d) isdir=yes ;;
-f)
- case " $install_prog " in
- *[\\\ /]cp\ *) ;;
- *) prev=$arg ;;
- esac
+ if $install_cp; then :; else
+ prev=$arg
+ fi
;;
-g | -m | -o)
prev=$arg
*)
# If the previous option needed an argument, then skip it.
if test -n "$prev"; then
+ if test "x$prev" = x-m && test -n "$install_override_mode"; then
+ arg2=$install_override_mode
+ no_mode=false
+ fi
prev=
else
dest=$arg
# Aesthetically quote the argument.
func_quote_for_eval "$arg"
- install_prog="$install_prog $func_quote_for_eval_result"
+ func_append install_prog " $func_quote_for_eval_result"
+ if test -n "$arg2"; then
+ func_quote_for_eval "$arg2"
+ fi
+ func_append install_shared_prog " $func_quote_for_eval_result"
done
test -z "$install_prog" && \
test -n "$prev" && \
func_fatal_help "the \`$prev' option requires an argument"
+ if test -n "$install_override_mode" && $no_mode; then
+ if $install_cp; then :; else
+ func_quote_for_eval "$install_override_mode"
+ func_append install_shared_prog " -m $func_quote_for_eval_result"
+ fi
+ fi
+
if test -z "$files"; then
if test -z "$dest"; then
func_fatal_help "no file or destination specified"
case $file in
*.$libext)
# Do the static libraries later.
- staticlibs="$staticlibs $file"
+ func_append staticlibs " $file"
;;
*.la)
+ func_resolve_sysroot "$file"
+ file=$func_resolve_sysroot_result
+
# Check to see that this really is a libtool archive.
func_lalib_unsafe_p "$file" \
|| func_fatal_help "\`$file' is not a valid libtool archive"
if test "X$destdir" = "X$libdir"; then
case "$current_libdirs " in
*" $libdir "*) ;;
- *) current_libdirs="$current_libdirs $libdir" ;;
+ *) func_append current_libdirs " $libdir" ;;
esac
else
# Note the libdir as a future libdir.
case "$future_libdirs " in
*" $libdir "*) ;;
- *) future_libdirs="$future_libdirs $libdir" ;;
+ *) func_append future_libdirs " $libdir" ;;
esac
fi
func_dirname "$file" "/" ""
dir="$func_dirname_result"
- dir="$dir$objdir"
+ func_append dir "$objdir"
if test -n "$relink_command"; then
# Determine the prefix the user has applied to our future dir.
- inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -e "s%$libdir\$%%"`
+ inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
# Don't allow the user to place us outside of our expected
# location b/c this prevents finding dependent libraries that
if test -n "$inst_prefix_dir"; then
# Stick the inst_prefix_dir data into the link command.
- relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
+ relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
else
- relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%%"`
+ relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
fi
func_warning "relinking \`$file'"
test -n "$relink_command" && srcname="$realname"T
# Install the shared library and build the symlinks.
- func_show_eval "$install_prog $dir/$srcname $destdir/$realname" \
+ func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
'exit $?'
tstripme="$stripme"
case $host_os in
func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
# Maybe install the static library, too.
- test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
+ test -n "$old_library" && func_append staticlibs " $dir/$old_library"
;;
*.lo)
if test -f "$lib"; then
func_source "$lib"
fi
- libfile="$libdir/"`$ECHO "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
+ libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test
if test -n "$libdir" && test ! -f "$libfile"; then
func_warning "\`$lib' has not been installed in \`$libdir'"
finalize=no
file="$func_basename_result"
outputname="$tmpdir/$file"
# Replace the output file specification.
- relink_command=`$ECHO "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
+ relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
$opt_silent || {
func_quote_for_expand "$relink_command"
}
else
# Install the binary that we compiled earlier.
- file=`$ECHO "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
+ file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"`
fi
fi
fi
}
-test "$mode" = install && func_mode_install ${1+"$@"}
+test "$opt_mode" = install && func_mode_install ${1+"$@"}
# func_generate_dlsyms outputname originator pic_p
extern \"C\" {
#endif
+#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
+#pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
+#endif
+
+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
+/* DATA imports from DLLs on WIN32 con't be const, because runtime
+ relocations are performed -- see ld's documentation on pseudo-relocs. */
+# define LT_DLSYM_CONST
+#elif defined(__osf__)
+/* This system does not cope well with relocations in const data. */
+# define LT_DLSYM_CONST
+#else
+# define LT_DLSYM_CONST const
+#endif
+
/* External symbol declarations for the compiler. */\
"
$opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
# Add our own program objects to the symbol list.
- progfiles=`$ECHO "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+ progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
for progfile in $progfiles; do
- func_verbose "extracting global C symbols from \`$progfile'"
- $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'"
+ func_to_tool_file "$progfile" func_convert_file_msys_to_w32
+ func_verbose "extracting global C symbols from \`$func_to_tool_file_result'"
+ $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
done
if test -n "$exclude_expsyms"; then
eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
eval '$MV "$nlist"T "$nlist"'
case $host in
- *cygwin | *mingw* | *cegcc* )
+ *cygwin* | *mingw* | *cegcc* )
eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
;;
func_verbose "extracting global C symbols from \`$dlprefile'"
func_basename "$dlprefile"
name="$func_basename_result"
- $opt_dry_run || {
- eval '$ECHO ": $name " >> "$nlist"'
- eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'"
- }
+ case $host in
+ *cygwin* | *mingw* | *cegcc* )
+ # if an import library, we need to obtain dlname
+ if func_win32_import_lib_p "$dlprefile"; then
+ func_tr_sh "$dlprefile"
+ eval "curr_lafile=\$libfile_$func_tr_sh_result"
+ dlprefile_dlbasename=""
+ if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
+ # Use subshell, to avoid clobbering current variable values
+ dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
+ if test -n "$dlprefile_dlname" ; then
+ func_basename "$dlprefile_dlname"
+ dlprefile_dlbasename="$func_basename_result"
+ else
+ # no lafile. user explicitly requested -dlpreopen <import library>.
+ $sharedlib_from_linklib_cmd "$dlprefile"
+ dlprefile_dlbasename=$sharedlib_from_linklib_result
+ fi
+ fi
+ $opt_dry_run || {
+ if test -n "$dlprefile_dlbasename" ; then
+ eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
+ else
+ func_warning "Could not compute DLL name from $name"
+ eval '$ECHO ": $name " >> "$nlist"'
+ fi
+ func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
+ eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
+ $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'"
+ }
+ else # not an import lib
+ $opt_dry_run || {
+ eval '$ECHO ": $name " >> "$nlist"'
+ func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
+ eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
+ }
+ fi
+ ;;
+ *)
+ $opt_dry_run || {
+ eval '$ECHO ": $name " >> "$nlist"'
+ func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
+ eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
+ }
+ ;;
+ esac
done
$opt_dry_run || {
if test -f "$nlist"S; then
eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
else
- $ECHO '/* NONE */' >> "$output_objdir/$my_dlsyms"
+ echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
fi
- $ECHO >> "$output_objdir/$my_dlsyms" "\
+ echo >> "$output_objdir/$my_dlsyms" "\
/* The mapping between symbol names and symbols. */
typedef struct {
const char *name;
void *address;
} lt_dlsymlist;
-"
- case $host in
- *cygwin* | *mingw* | *cegcc* )
- $ECHO >> "$output_objdir/$my_dlsyms" "\
-/* DATA imports from DLLs on WIN32 con't be const, because
- runtime relocations are performed -- see ld's documentation
- on pseudo-relocs. */"
- lt_dlsym_const= ;;
- *osf5*)
- echo >> "$output_objdir/$my_dlsyms" "\
-/* This system does not cope well with relocations in const data */"
- lt_dlsym_const= ;;
- *)
- lt_dlsym_const=const ;;
- esac
-
- $ECHO >> "$output_objdir/$my_dlsyms" "\
-extern $lt_dlsym_const lt_dlsymlist
+extern LT_DLSYM_CONST lt_dlsymlist
lt_${my_prefix}_LTX_preloaded_symbols[];
-$lt_dlsym_const lt_dlsymlist
+LT_DLSYM_CONST lt_dlsymlist
lt_${my_prefix}_LTX_preloaded_symbols[] =
{\
{ \"$my_originator\", (void *) 0 },"
eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
;;
esac
- $ECHO >> "$output_objdir/$my_dlsyms" "\
+ echo >> "$output_objdir/$my_dlsyms" "\
{0, (void *) 0}
};
for arg in $LTCFLAGS; do
case $arg in
-pie | -fpie | -fPIE) ;;
- *) symtab_cflags="$symtab_cflags $arg" ;;
+ *) func_append symtab_cflags " $arg" ;;
esac
done
case $host in
*cygwin* | *mingw* | *cegcc* )
if test -f "$output_objdir/$my_outputname.def"; then
- compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
- finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
+ compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
+ finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
else
- compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
- finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
+ compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+ finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
fi
;;
*)
- compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
- finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
+ compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+ finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
;;
esac
;;
# really was required.
# Nullify the symbol file.
- compile_command=`$ECHO "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
- finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
+ compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"`
+ finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"`
fi
}
# Need a lot of goo to handle *both* DLLs and import libs
# Has to be a shell function in order to 'eat' the argument
# that is supplied when $file_magic_command is called.
+# Despite the name, also deal with 64 bit binaries.
func_win32_libid ()
{
$opt_debug
win32_libid_type="x86 archive import"
;;
*ar\ archive*) # could be an import, or static
+ # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
- $EGREP 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
- win32_nmres=`eval $NM -f posix -A $1 |
+ $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
+ func_to_tool_file "$1" func_convert_file_msys_to_w32
+ win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
$SED -n -e '
1,100{
/ I /{
$ECHO "$win32_libid_type"
}
+# func_cygming_dll_for_implib ARG
+#
+# Platform-specific function to extract the
+# name of the DLL associated with the specified
+# import library ARG.
+# Invoked by eval'ing the libtool variable
+# $sharedlib_from_linklib_cmd
+# Result is available in the variable
+# $sharedlib_from_linklib_result
+func_cygming_dll_for_implib ()
+{
+ $opt_debug
+ sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
+}
+
+# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs
+#
+# The is the core of a fallback implementation of a
+# platform-specific function to extract the name of the
+# DLL associated with the specified import library LIBNAME.
+#
+# SECTION_NAME is either .idata$6 or .idata$7, depending
+# on the platform and compiler that created the implib.
+#
+# Echos the name of the DLL associated with the
+# specified import library.
+func_cygming_dll_for_implib_fallback_core ()
+{
+ $opt_debug
+ match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
+ $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
+ $SED '/^Contents of section '"$match_literal"':/{
+ # Place marker at beginning of archive member dllname section
+ s/.*/====MARK====/
+ p
+ d
+ }
+ # These lines can sometimes be longer than 43 characters, but
+ # are always uninteresting
+ /:[ ]*file format pe[i]\{,1\}-/d
+ /^In archive [^:]*:/d
+ # Ensure marker is printed
+ /^====MARK====/p
+ # Remove all lines with less than 43 characters
+ /^.\{43\}/!d
+ # From remaining lines, remove first 43 characters
+ s/^.\{43\}//' |
+ $SED -n '
+ # Join marker and all lines until next marker into a single line
+ /^====MARK====/ b para
+ H
+ $ b para
+ b
+ :para
+ x
+ s/\n//g
+ # Remove the marker
+ s/^====MARK====//
+ # Remove trailing dots and whitespace
+ s/[\. \t]*$//
+ # Print
+ /./p' |
+ # we now have a list, one entry per line, of the stringified
+ # contents of the appropriate section of all members of the
+ # archive which possess that section. Heuristic: eliminate
+ # all those which have a first or second character that is
+ # a '.' (that is, objdump's representation of an unprintable
+ # character.) This should work for all archives with less than
+ # 0x302f exports -- but will fail for DLLs whose name actually
+ # begins with a literal '.' or a single character followed by
+ # a '.'.
+ #
+ # Of those that remain, print the first one.
+ $SED -e '/^\./d;/^.\./d;q'
+}
+
+# func_cygming_gnu_implib_p ARG
+# This predicate returns with zero status (TRUE) if
+# ARG is a GNU/binutils-style import library. Returns
+# with nonzero status (FALSE) otherwise.
+func_cygming_gnu_implib_p ()
+{
+ $opt_debug
+ func_to_tool_file "$1" func_convert_file_msys_to_w32
+ func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
+ test -n "$func_cygming_gnu_implib_tmp"
+}
+
+# func_cygming_ms_implib_p ARG
+# This predicate returns with zero status (TRUE) if
+# ARG is an MS-style import library. Returns
+# with nonzero status (FALSE) otherwise.
+func_cygming_ms_implib_p ()
+{
+ $opt_debug
+ func_to_tool_file "$1" func_convert_file_msys_to_w32
+ func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
+ test -n "$func_cygming_ms_implib_tmp"
+}
+
+# func_cygming_dll_for_implib_fallback ARG
+# Platform-specific function to extract the
+# name of the DLL associated with the specified
+# import library ARG.
+#
+# This fallback implementation is for use when $DLLTOOL
+# does not support the --identify-strict option.
+# Invoked by eval'ing the libtool variable
+# $sharedlib_from_linklib_cmd
+# Result is available in the variable
+# $sharedlib_from_linklib_result
+func_cygming_dll_for_implib_fallback ()
+{
+ $opt_debug
+ if func_cygming_gnu_implib_p "$1" ; then
+ # binutils import library
+ sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
+ elif func_cygming_ms_implib_p "$1" ; then
+ # ms-generated import library
+ sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
+ else
+ # unknown
+ sharedlib_from_linklib_result=""
+ fi
+}
# func_extract_an_archive dir oldlib
$opt_debug
f_ex_an_ar_dir="$1"; shift
f_ex_an_ar_oldlib="$1"
- func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" 'exit $?'
+ if test "$lock_old_archive_extraction" = yes; then
+ lockfile=$f_ex_an_ar_oldlib.lock
+ until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
+ func_echo "Waiting for $lockfile to be removed"
+ sleep 2
+ done
+ fi
+ func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
+ 'stat=$?; rm -f "$lockfile"; exit $stat'
+ if test "$lock_old_archive_extraction" = yes; then
+ $opt_dry_run || rm -f "$lockfile"
+ fi
if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
:
else
darwin_file=
darwin_files=
for darwin_file in $darwin_filelist; do
- darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
+ darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP`
$LIPO -create -output "$darwin_file" $darwin_files
done # $darwin_filelist
$RM -rf unfat-$$
func_extract_an_archive "$my_xdir" "$my_xabs"
;;
esac
- my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
+ my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
done
func_extract_archives_result="$my_oldobjs"
}
-
-# func_emit_wrapper_part1 [arg=no]
+# func_emit_wrapper [arg=no]
+#
+# Emit a libtool wrapper script on stdout.
+# Don't directly open a file because we may want to
+# incorporate the script contents within a cygwin/mingw
+# wrapper executable. Must ONLY be called from within
+# func_mode_link because it depends on a number of variables
+# set therein.
#
-# Emit the first part of a libtool wrapper script on stdout.
-# For more information, see the description associated with
-# func_emit_wrapper(), below.
-func_emit_wrapper_part1 ()
+# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
+# variable will take. If 'yes', then the emitted script
+# will assume that the directory in which it is stored is
+# the $objdir directory. This is a cygwin/mingw-specific
+# behavior.
+func_emit_wrapper ()
{
- func_emit_wrapper_part1_arg1=no
- if test -n "$1" ; then
- func_emit_wrapper_part1_arg1=$1
- fi
+ func_emit_wrapper_arg1=${1-no}
$ECHO "\
#! $SHELL
# Sed substitution that helps us do robust quoting. It backslashifies
# metacharacters that are still active within double-quoted strings.
-Xsed='${SED} -e 1s/^X//'
sed_quote_subst='$sed_quote_subst'
# Be Bourne compatible
else
# When we are sourced in execute mode, \$file and \$ECHO are already set.
if test \"\$libtool_execute_magic\" != \"$magic\"; then
- ECHO=\"$qecho\"
- file=\"\$0\"
- # Make sure echo works.
- if test \"X\$1\" = X--no-reexec; then
- # Discard the --no-reexec flag, and continue.
- shift
- elif test \"X\`{ \$ECHO '\t'; } 2>/dev/null\`\" = 'X\t'; then
- # Yippee, \$ECHO works!
- :
- else
- # Restart under the correct shell, and then maybe \$ECHO will work.
- exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
- fi
- fi\
+ file=\"\$0\""
+
+ qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
+ $ECHO "\
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+ eval 'cat <<_LTECHO_EOF
+\$1
+_LTECHO_EOF'
+}
+ ECHO=\"$qECHO\"
+ fi
+
+# Very basic option parsing. These options are (a) specific to
+# the libtool wrapper, (b) are identical between the wrapper
+# /script/ and the wrapper /executable/ which is used only on
+# windows platforms, and (c) all begin with the string "--lt-"
+# (application programs are unlikely to have options which match
+# this pattern).
+#
+# There are only two supported options: --lt-debug and
+# --lt-dump-script. There is, deliberately, no --lt-help.
+#
+# The first argument to this parsing function should be the
+# script's $0 value, followed by "$@".
+lt_option_debug=
+func_parse_lt_options ()
+{
+ lt_script_arg0=\$0
+ shift
+ for lt_opt
+ do
+ case \"\$lt_opt\" in
+ --lt-debug) lt_option_debug=1 ;;
+ --lt-dump-script)
+ lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\`
+ test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=.
+ lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\`
+ cat \"\$lt_dump_D/\$lt_dump_F\"
+ exit 0
+ ;;
+ --lt-*)
+ \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2
+ exit 1
+ ;;
+ esac
+ done
+
+ # Print the debug banner immediately:
+ if test -n \"\$lt_option_debug\"; then
+ echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2
+ fi
+}
+
+# Used when --lt-debug. Prints its arguments to stdout
+# (redirection is the responsibility of the caller)
+func_lt_dump_args ()
+{
+ lt_dump_args_N=1;
+ for lt_arg
+ do
+ \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\"
+ lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
+ done
+}
+
+# Core function for launching the target application
+func_exec_program_core ()
+{
"
- $ECHO "\
+ case $host in
+ # Backslashes separate directories on plain windows
+ *-*-mingw | *-*-os2* | *-cegcc*)
+ $ECHO "\
+ if test -n \"\$lt_option_debug\"; then
+ \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2
+ func_lt_dump_args \${1+\"\$@\"} 1>&2
+ fi
+ exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
+"
+ ;;
+
+ *)
+ $ECHO "\
+ if test -n \"\$lt_option_debug\"; then
+ \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2
+ func_lt_dump_args \${1+\"\$@\"} 1>&2
+ fi
+ exec \"\$progdir/\$program\" \${1+\"\$@\"}
+"
+ ;;
+ esac
+ $ECHO "\
+ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
+ exit 1
+}
+
+# A function to encapsulate launching the target application
+# Strips options in the --lt-* namespace from \$@ and
+# launches target application with the remaining arguments.
+func_exec_program ()
+{
+ for lt_wr_arg
+ do
+ case \$lt_wr_arg in
+ --lt-*) ;;
+ *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
+ esac
+ shift
+ done
+ func_exec_program_core \${1+\"\$@\"}
+}
+
+ # Parse options
+ func_parse_lt_options \"\$0\" \${1+\"\$@\"}
# Find the directory that this script lives in.
- thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
+ thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\`
test \"x\$thisdir\" = \"x\$file\" && thisdir=.
# Follow symbolic links until we get to the real thisdir.
- file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
+ file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\`
while test -n \"\$file\"; do
- destdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
+ destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\`
# If there was a directory component, then change thisdir.
if test \"x\$destdir\" != \"x\$file\"; then
esac
fi
- file=\`\$ECHO \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
- file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
+ file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\`
+ file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\`
done
-"
-}
-# end: func_emit_wrapper_part1
-
-# func_emit_wrapper_part2 [arg=no]
-#
-# Emit the second part of a libtool wrapper script on stdout.
-# For more information, see the description associated with
-# func_emit_wrapper(), below.
-func_emit_wrapper_part2 ()
-{
- func_emit_wrapper_part2_arg1=no
- if test -n "$1" ; then
- func_emit_wrapper_part2_arg1=$1
- fi
-
- $ECHO "\
# Usually 'no', except on cygwin/mingw when embedded into
# the cwrapper.
- WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_part2_arg1
+ WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
# special case for '.'
if test \"\$thisdir\" = \".\"; then
fi
# remove .libs from thisdir
case \"\$thisdir\" in
- *[\\\\/]$objdir ) thisdir=\`\$ECHO \"X\$thisdir\" | \$Xsed -e 's%[\\\\/][^\\\\/]*$%%'\` ;;
+ *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;;
$objdir ) thisdir=. ;;
esac
fi
if test -f \"\$progdir/\$program\"; then"
+ # fixup the dll searchpath if we need to.
+ #
+ # Fix the DLL searchpath if we need to. Do this before prepending
+ # to shlibpath, because on Windows, both are PATH and uninstalled
+ # libraries must come first.
+ if test -n "$dllsearchpath"; then
+ $ECHO "\
+ # Add the dll search path components to the executable PATH
+ PATH=$dllsearchpath:\$PATH
+"
+ fi
+
# Export our shlibpath_var if we have one.
if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
$ECHO "\
# Some systems cannot cope with colon-terminated $shlibpath_var
# The second colon is a workaround for a bug in BeOS R4 sed
- $shlibpath_var=\`\$ECHO \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
+ $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\`
export $shlibpath_var
"
fi
- # fixup the dll searchpath if we need to.
- if test -n "$dllsearchpath"; then
- $ECHO "\
- # Add the dll search path components to the executable PATH
- PATH=$dllsearchpath:\$PATH
-"
- fi
-
$ECHO "\
if test \"\$libtool_execute_magic\" != \"$magic\"; then
# Run the actual program with our arguments.
-"
- case $host in
- # Backslashes separate directories on plain windows
- *-*-mingw | *-*-os2* | *-cegcc*)
- $ECHO "\
- exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
-"
- ;;
-
- *)
- $ECHO "\
- exec \"\$progdir/\$program\" \${1+\"\$@\"}
-"
- ;;
- esac
- $ECHO "\
- \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
- exit 1
+ func_exec_program \${1+\"\$@\"}
fi
else
# The program doesn't exist.
\$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
\$ECHO \"This script is just a wrapper for \$program.\" 1>&2
- $ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
+ \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
exit 1
fi
fi\
"
}
-# end: func_emit_wrapper_part2
-
-
-# func_emit_wrapper [arg=no]
-#
-# Emit a libtool wrapper script on stdout.
-# Don't directly open a file because we may want to
-# incorporate the script contents within a cygwin/mingw
-# wrapper executable. Must ONLY be called from within
-# func_mode_link because it depends on a number of variables
-# set therein.
-#
-# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
-# variable will take. If 'yes', then the emitted script
-# will assume that the directory in which it is stored is
-# the $objdir directory. This is a cygwin/mingw-specific
-# behavior.
-func_emit_wrapper ()
-{
- func_emit_wrapper_arg1=no
- if test -n "$1" ; then
- func_emit_wrapper_arg1=$1
- fi
-
- # split this up so that func_emit_cwrapperexe_src
- # can call each part independently.
- func_emit_wrapper_part1 "${func_emit_wrapper_arg1}"
- func_emit_wrapper_part2 "${func_emit_wrapper_arg1}"
-}
-
-
-# func_to_host_path arg
-#
-# Convert paths to host format when used with build tools.
-# Intended for use with "native" mingw (where libtool itself
-# is running under the msys shell), or in the following cross-
-# build environments:
-# $build $host
-# mingw (msys) mingw [e.g. native]
-# cygwin mingw
-# *nix + wine mingw
-# where wine is equipped with the `winepath' executable.
-# In the native mingw case, the (msys) shell automatically
-# converts paths for any non-msys applications it launches,
-# but that facility isn't available from inside the cwrapper.
-# Similar accommodations are necessary for $host mingw and
-# $build cygwin. Calling this function does no harm for other
-# $host/$build combinations not listed above.
-#
-# ARG is the path (on $build) that should be converted to
-# the proper representation for $host. The result is stored
-# in $func_to_host_path_result.
-func_to_host_path ()
-{
- func_to_host_path_result="$1"
- if test -n "$1" ; then
- case $host in
- *mingw* )
- lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
- case $build in
- *mingw* ) # actually, msys
- # awkward: cmd appends spaces to result
- lt_sed_strip_trailing_spaces="s/[ ]*\$//"
- func_to_host_path_tmp1=`( cmd //c echo "$1" |\
- $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""`
- func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
- $SED -e "$lt_sed_naive_backslashify"`
- ;;
- *cygwin* )
- func_to_host_path_tmp1=`cygpath -w "$1"`
- func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
- $SED -e "$lt_sed_naive_backslashify"`
- ;;
- * )
- # Unfortunately, winepath does not exit with a non-zero
- # error code, so we are forced to check the contents of
- # stdout. On the other hand, if the command is not
- # found, the shell will set an exit code of 127 and print
- # *an error message* to stdout. So we must check for both
- # error code of zero AND non-empty stdout, which explains
- # the odd construction:
- func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null`
- if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then
- func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
- $SED -e "$lt_sed_naive_backslashify"`
- else
- # Allow warning below.
- func_to_host_path_result=""
- fi
- ;;
- esac
- if test -z "$func_to_host_path_result" ; then
- func_error "Could not determine host path corresponding to"
- func_error " '$1'"
- func_error "Continuing, but uninstalled executables may not work."
- # Fallback:
- func_to_host_path_result="$1"
- fi
- ;;
- esac
- fi
-}
-# end: func_to_host_path
-# func_to_host_pathlist arg
-#
-# Convert pathlists to host format when used with build tools.
-# See func_to_host_path(), above. This function supports the
-# following $build/$host combinations (but does no harm for
-# combinations not listed here):
-# $build $host
-# mingw (msys) mingw [e.g. native]
-# cygwin mingw
-# *nix + wine mingw
-#
-# Path separators are also converted from $build format to
-# $host format. If ARG begins or ends with a path separator
-# character, it is preserved (but converted to $host format)
-# on output.
-#
-# ARG is a pathlist (on $build) that should be converted to
-# the proper representation on $host. The result is stored
-# in $func_to_host_pathlist_result.
-func_to_host_pathlist ()
-{
- func_to_host_pathlist_result="$1"
- if test -n "$1" ; then
- case $host in
- *mingw* )
- lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
- # Remove leading and trailing path separator characters from
- # ARG. msys behavior is inconsistent here, cygpath turns them
- # into '.;' and ';.', and winepath ignores them completely.
- func_to_host_pathlist_tmp2="$1"
- # Once set for this call, this variable should not be
- # reassigned. It is used in tha fallback case.
- func_to_host_pathlist_tmp1=`echo "$func_to_host_pathlist_tmp2" |\
- $SED -e 's|^:*||' -e 's|:*$||'`
- case $build in
- *mingw* ) # Actually, msys.
- # Awkward: cmd appends spaces to result.
- lt_sed_strip_trailing_spaces="s/[ ]*\$//"
- func_to_host_pathlist_tmp2=`( cmd //c echo "$func_to_host_pathlist_tmp1" |\
- $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""`
- func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\
- $SED -e "$lt_sed_naive_backslashify"`
- ;;
- *cygwin* )
- func_to_host_pathlist_tmp2=`cygpath -w -p "$func_to_host_pathlist_tmp1"`
- func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\
- $SED -e "$lt_sed_naive_backslashify"`
- ;;
- * )
- # unfortunately, winepath doesn't convert pathlists
- func_to_host_pathlist_result=""
- func_to_host_pathlist_oldIFS=$IFS
- IFS=:
- for func_to_host_pathlist_f in $func_to_host_pathlist_tmp1 ; do
- IFS=$func_to_host_pathlist_oldIFS
- if test -n "$func_to_host_pathlist_f" ; then
- func_to_host_path "$func_to_host_pathlist_f"
- if test -n "$func_to_host_path_result" ; then
- if test -z "$func_to_host_pathlist_result" ; then
- func_to_host_pathlist_result="$func_to_host_path_result"
- else
- func_to_host_pathlist_result="$func_to_host_pathlist_result;$func_to_host_path_result"
- fi
- fi
- fi
- IFS=:
- done
- IFS=$func_to_host_pathlist_oldIFS
- ;;
- esac
- if test -z "$func_to_host_pathlist_result" ; then
- func_error "Could not determine the host path(s) corresponding to"
- func_error " '$1'"
- func_error "Continuing, but uninstalled executables may not work."
- # Fallback. This may break if $1 contains DOS-style drive
- # specifications. The fix is not to complicate the expression
- # below, but for the user to provide a working wine installation
- # with winepath so that path translation in the cross-to-mingw
- # case works properly.
- lt_replace_pathsep_nix_to_dos="s|:|;|g"
- func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\
- $SED -e "$lt_replace_pathsep_nix_to_dos"`
- fi
- # Now, add the leading and trailing path separators back
- case "$1" in
- :* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result"
- ;;
- esac
- case "$1" in
- *: ) func_to_host_pathlist_result="$func_to_host_pathlist_result;"
- ;;
- esac
- ;;
- esac
- fi
-}
-# end: func_to_host_pathlist
# func_emit_cwrapperexe_src
# emit the source code for a wrapper executable on stdout
This wrapper executable should never be moved out of the build directory.
If it is, it will not operate correctly.
-
- Currently, it simply execs the wrapper *script* "$SHELL $output",
- but could eventually absorb all of the scripts functionality and
- exec $objdir/$outputname directly.
*/
EOF
cat <<"EOF"
+#ifdef _MSC_VER
+# define _CRT_SECURE_NO_DEPRECATE 1
+#endif
#include <stdio.h>
#include <stdlib.h>
#ifdef _MSC_VER
# include <direct.h>
# include <process.h>
# include <io.h>
-# define setmode _setmode
#else
# include <unistd.h>
# include <stdint.h>
# ifdef __CYGWIN__
# include <io.h>
-# define HAVE_SETENV
-# ifdef __STRICT_ANSI__
-char *realpath (const char *, char *);
-int putenv (char *);
-int setenv (const char *, const char *, int);
-# endif
# endif
#endif
#include <malloc.h>
#include <fcntl.h>
#include <sys/stat.h>
+/* declarations of non-ANSI functions */
+#if defined(__MINGW32__)
+# ifdef __STRICT_ANSI__
+int _putenv (const char *);
+# endif
+#elif defined(__CYGWIN__)
+# ifdef __STRICT_ANSI__
+char *realpath (const char *, char *);
+int putenv (char *);
+int setenv (const char *, const char *, int);
+# endif
+/* #elif defined (other platforms) ... */
+#endif
+
+/* portability defines, excluding path handling macros */
+#if defined(_MSC_VER)
+# define setmode _setmode
+# define stat _stat
+# define chmod _chmod
+# define getcwd _getcwd
+# define putenv _putenv
+# define S_IXUSR _S_IEXEC
+# ifndef _INTPTR_T_DEFINED
+# define _INTPTR_T_DEFINED
+# define intptr_t int
+# endif
+#elif defined(__MINGW32__)
+# define setmode _setmode
+# define stat _stat
+# define chmod _chmod
+# define getcwd _getcwd
+# define putenv _putenv
+#elif defined(__CYGWIN__)
+# define HAVE_SETENV
+# define FOPEN_WB "wb"
+/* #elif defined (other platforms) ... */
+#endif
+
#if defined(PATH_MAX)
# define LT_PATHMAX PATH_MAX
#elif defined(MAXPATHLEN)
# define S_IXGRP 0
#endif
-#ifdef _MSC_VER
-# define S_IXUSR _S_IEXEC
-# define stat _stat
-# ifndef _INTPTR_T_DEFINED
-# define intptr_t int
-# endif
-#endif
-
+/* path handling portability macros */
#ifndef DIR_SEPARATOR
# define DIR_SEPARATOR '/'
# define PATH_SEPARATOR ':'
# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
#endif /* PATH_SEPARATOR_2 */
-#ifdef __CYGWIN__
-# define FOPEN_WB "wb"
-#endif
-
#ifndef FOPEN_WB
# define FOPEN_WB "w"
#endif
if (stale) { free ((void *) stale); stale = 0; } \
} while (0)
-#undef LTWRAPPER_DEBUGPRINTF
-#if defined DEBUGWRAPPER
-# define LTWRAPPER_DEBUGPRINTF(args) ltwrapper_debugprintf args
-static void
-ltwrapper_debugprintf (const char *fmt, ...)
-{
- va_list args;
- va_start (args, fmt);
- (void) vfprintf (stderr, fmt, args);
- va_end (args);
-}
+#if defined(LT_DEBUGWRAPPER)
+static int lt_debug = 1;
#else
-# define LTWRAPPER_DEBUGPRINTF(args)
+static int lt_debug = 0;
#endif
-const char *program_name = NULL;
+const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */
void *xmalloc (size_t num);
char *xstrdup (const char *string);
int make_executable (const char *path);
int check_executable (const char *path);
char *strendzap (char *str, const char *pat);
-void lt_fatal (const char *message, ...);
+void lt_debugprintf (const char *file, int line, const char *fmt, ...);
+void lt_fatal (const char *file, int line, const char *message, ...);
+static const char *nonnull (const char *s);
+static const char *nonempty (const char *s);
void lt_setenv (const char *name, const char *value);
char *lt_extend_str (const char *orig_value, const char *add, int to_end);
-void lt_opt_process_env_set (const char *arg);
-void lt_opt_process_env_prepend (const char *arg);
-void lt_opt_process_env_append (const char *arg);
-int lt_split_name_value (const char *arg, char** name, char** value);
void lt_update_exe_path (const char *name, const char *value);
void lt_update_lib_path (const char *name, const char *value);
-
-static const char *script_text_part1 =
-EOF
-
- func_emit_wrapper_part1 yes |
- $SED -e 's/\([\\"]\)/\\\1/g' \
- -e 's/^/ "/' -e 's/$/\\n"/'
- echo ";"
- cat <<EOF
-
-static const char *script_text_part2 =
+char **prepare_spawn (char **argv);
+void lt_dump_script (FILE *f);
EOF
- func_emit_wrapper_part2 yes |
- $SED -e 's/\([\\"]\)/\\\1/g' \
- -e 's/^/ "/' -e 's/$/\\n"/'
- echo ";"
cat <<EOF
-const char * MAGIC_EXE = "$magic_exe";
+volatile const char * MAGIC_EXE = "$magic_exe";
const char * LIB_PATH_VARNAME = "$shlibpath_var";
EOF
if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
- func_to_host_pathlist "$temp_rpath"
+ func_to_host_path "$temp_rpath"
cat <<EOF
-const char * LIB_PATH_VALUE = "$func_to_host_pathlist_result";
+const char * LIB_PATH_VALUE = "$func_to_host_path_result";
EOF
else
cat <<"EOF"
fi
if test -n "$dllsearchpath"; then
- func_to_host_pathlist "$dllsearchpath:"
+ func_to_host_path "$dllsearchpath:"
cat <<EOF
const char * EXE_PATH_VARNAME = "PATH";
-const char * EXE_PATH_VALUE = "$func_to_host_pathlist_result";
+const char * EXE_PATH_VALUE = "$func_to_host_path_result";
EOF
else
cat <<"EOF"
cat <<"EOF"
#define LTWRAPPER_OPTION_PREFIX "--lt-"
-#define LTWRAPPER_OPTION_PREFIX_LENGTH 5
-static const size_t opt_prefix_len = LTWRAPPER_OPTION_PREFIX_LENGTH;
static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
-
static const char *dumpscript_opt = LTWRAPPER_OPTION_PREFIX "dump-script";
-
-static const size_t env_set_opt_len = LTWRAPPER_OPTION_PREFIX_LENGTH + 7;
-static const char *env_set_opt = LTWRAPPER_OPTION_PREFIX "env-set";
- /* argument is putenv-style "foo=bar", value of foo is set to bar */
-
-static const size_t env_prepend_opt_len = LTWRAPPER_OPTION_PREFIX_LENGTH + 11;
-static const char *env_prepend_opt = LTWRAPPER_OPTION_PREFIX "env-prepend";
- /* argument is putenv-style "foo=bar", new value of foo is bar${foo} */
-
-static const size_t env_append_opt_len = LTWRAPPER_OPTION_PREFIX_LENGTH + 10;
-static const char *env_append_opt = LTWRAPPER_OPTION_PREFIX "env-append";
- /* argument is putenv-style "foo=bar", new value of foo is ${foo}bar */
+static const char *debug_opt = LTWRAPPER_OPTION_PREFIX "debug";
int
main (int argc, char *argv[])
int i;
program_name = (char *) xstrdup (base_name (argv[0]));
- LTWRAPPER_DEBUGPRINTF (("(main) argv[0] : %s\n", argv[0]));
- LTWRAPPER_DEBUGPRINTF (("(main) program_name : %s\n", program_name));
+ newargz = XMALLOC (char *, argc + 1);
- /* very simple arg parsing; don't want to rely on getopt */
+ /* very simple arg parsing; don't want to rely on getopt
+ * also, copy all non cwrapper options to newargz, except
+ * argz[0], which is handled differently
+ */
+ newargc=0;
for (i = 1; i < argc; i++)
{
if (strcmp (argv[i], dumpscript_opt) == 0)
esac
cat <<"EOF"
- printf ("%s", script_text_part1);
- printf ("%s", script_text_part2);
+ lt_dump_script (stdout);
return 0;
}
+ if (strcmp (argv[i], debug_opt) == 0)
+ {
+ lt_debug = 1;
+ continue;
+ }
+ if (strcmp (argv[i], ltwrapper_option_prefix) == 0)
+ {
+ /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
+ namespace, but it is not one of the ones we know about and
+ have already dealt with, above (inluding dump-script), then
+ report an error. Otherwise, targets might begin to believe
+ they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
+ namespace. The first time any user complains about this, we'll
+ need to make LTWRAPPER_OPTION_PREFIX a configure-time option
+ or a configure.ac-settable value.
+ */
+ lt_fatal (__FILE__, __LINE__,
+ "unrecognized %s option: '%s'",
+ ltwrapper_option_prefix, argv[i]);
+ }
+ /* otherwise ... */
+ newargz[++newargc] = xstrdup (argv[i]);
}
+ newargz[++newargc] = NULL;
+
+EOF
+ cat <<EOF
+ /* The GNU banner must be the first non-error debug message */
+ lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\n");
+EOF
+ cat <<"EOF"
+ lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
+ lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name);
- newargz = XMALLOC (char *, argc + 1);
tmp_pathspec = find_executable (argv[0]);
if (tmp_pathspec == NULL)
- lt_fatal ("Couldn't find %s", argv[0]);
- LTWRAPPER_DEBUGPRINTF (("(main) found exe (before symlink chase) at : %s\n",
- tmp_pathspec));
+ lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]);
+ lt_debugprintf (__FILE__, __LINE__,
+ "(main) found exe (before symlink chase) at: %s\n",
+ tmp_pathspec);
actual_cwrapper_path = chase_symlinks (tmp_pathspec);
- LTWRAPPER_DEBUGPRINTF (("(main) found exe (after symlink chase) at : %s\n",
- actual_cwrapper_path));
+ lt_debugprintf (__FILE__, __LINE__,
+ "(main) found exe (after symlink chase) at: %s\n",
+ actual_cwrapper_path);
XFREE (tmp_pathspec);
- actual_cwrapper_name = xstrdup( base_name (actual_cwrapper_path));
+ actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path));
strendzap (actual_cwrapper_path, actual_cwrapper_name);
/* wrapper name transforms */
target_name = tmp_pathspec;
tmp_pathspec = 0;
- LTWRAPPER_DEBUGPRINTF (("(main) libtool target name: %s\n",
- target_name));
+ lt_debugprintf (__FILE__, __LINE__,
+ "(main) libtool target name: %s\n",
+ target_name);
EOF
cat <<EOF
lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
lt_setenv ("DUALCASE", "1"); /* for MSK sh */
- lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
+ /* Update the DLL searchpath. EXE_PATH_VALUE ($dllsearchpath) must
+ be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath)
+ because on Windows, both *_VARNAMEs are PATH but uninstalled
+ libraries must come first. */
lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
+ lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
- newargc=0;
- for (i = 1; i < argc; i++)
- {
- if (strncmp (argv[i], env_set_opt, env_set_opt_len) == 0)
- {
- if (argv[i][env_set_opt_len] == '=')
- {
- const char *p = argv[i] + env_set_opt_len + 1;
- lt_opt_process_env_set (p);
- }
- else if (argv[i][env_set_opt_len] == '\0' && i + 1 < argc)
- {
- lt_opt_process_env_set (argv[++i]); /* don't copy */
- }
- else
- lt_fatal ("%s missing required argument", env_set_opt);
- continue;
- }
- if (strncmp (argv[i], env_prepend_opt, env_prepend_opt_len) == 0)
- {
- if (argv[i][env_prepend_opt_len] == '=')
- {
- const char *p = argv[i] + env_prepend_opt_len + 1;
- lt_opt_process_env_prepend (p);
- }
- else if (argv[i][env_prepend_opt_len] == '\0' && i + 1 < argc)
- {
- lt_opt_process_env_prepend (argv[++i]); /* don't copy */
- }
- else
- lt_fatal ("%s missing required argument", env_prepend_opt);
- continue;
- }
- if (strncmp (argv[i], env_append_opt, env_append_opt_len) == 0)
- {
- if (argv[i][env_append_opt_len] == '=')
- {
- const char *p = argv[i] + env_append_opt_len + 1;
- lt_opt_process_env_append (p);
- }
- else if (argv[i][env_append_opt_len] == '\0' && i + 1 < argc)
- {
- lt_opt_process_env_append (argv[++i]); /* don't copy */
- }
- else
- lt_fatal ("%s missing required argument", env_append_opt);
- continue;
- }
- if (strncmp (argv[i], ltwrapper_option_prefix, opt_prefix_len) == 0)
- {
- /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
- namespace, but it is not one of the ones we know about and
- have already dealt with, above (inluding dump-script), then
- report an error. Otherwise, targets might begin to believe
- they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
- namespace. The first time any user complains about this, we'll
- need to make LTWRAPPER_OPTION_PREFIX a configure-time option
- or a configure.ac-settable value.
- */
- lt_fatal ("Unrecognized option in %s namespace: '%s'",
- ltwrapper_option_prefix, argv[i]);
- }
- /* otherwise ... */
- newargz[++newargc] = xstrdup (argv[i]);
- }
- newargz[++newargc] = NULL;
-
- LTWRAPPER_DEBUGPRINTF (("(main) lt_argv_zero : %s\n", (lt_argv_zero ? lt_argv_zero : "<NULL>")));
+ lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
+ nonnull (lt_argv_zero));
for (i = 0; i < newargc; i++)
{
- LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d] : %s\n", i, (newargz[i] ? newargz[i] : "<NULL>")));
+ lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n",
+ i, nonnull (newargz[i]));
}
EOF
mingw*)
cat <<"EOF"
/* execv doesn't actually work on mingw as expected on unix */
+ newargz = prepare_spawn (newargz);
rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
if (rval == -1)
{
/* failed to start process */
- LTWRAPPER_DEBUGPRINTF (("(main) failed to launch target \"%s\": errno = %d\n", lt_argv_zero, errno));
+ lt_debugprintf (__FILE__, __LINE__,
+ "(main) failed to launch target \"%s\": %s\n",
+ lt_argv_zero, nonnull (strerror (errno)));
return 127;
}
return rval;
{
void *p = (void *) malloc (num);
if (!p)
- lt_fatal ("Memory exhausted");
+ lt_fatal (__FILE__, __LINE__, "memory exhausted");
return p;
}
{
struct stat st;
- LTWRAPPER_DEBUGPRINTF (("(check_executable) : %s\n",
- path ? (*path ? path : "EMPTY!") : "NULL!"));
+ lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n",
+ nonempty (path));
if ((!path) || (!*path))
return 0;
int rval = 0;
struct stat st;
- LTWRAPPER_DEBUGPRINTF (("(make_executable) : %s\n",
- path ? (*path ? path : "EMPTY!") : "NULL!"));
+ lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n",
+ nonempty (path));
if ((!path) || (!*path))
return 0;
int tmp_len;
char *concat_name;
- LTWRAPPER_DEBUGPRINTF (("(find_executable) : %s\n",
- wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"));
+ lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
+ nonempty (wrapper));
if ((wrapper == NULL) || (*wrapper == '\0'))
return NULL;
{
/* empty path: current directory */
if (getcwd (tmp, LT_PATHMAX) == NULL)
- lt_fatal ("getcwd failed");
+ lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
+ nonnull (strerror (errno)));
tmp_len = strlen (tmp);
concat_name =
XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
}
/* Relative path | not found in path: prepend cwd */
if (getcwd (tmp, LT_PATHMAX) == NULL)
- lt_fatal ("getcwd failed");
+ lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
+ nonnull (strerror (errno)));
tmp_len = strlen (tmp);
concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
memcpy (concat_name, tmp, tmp_len);
int has_symlinks = 0;
while (strlen (tmp_pathspec) && !has_symlinks)
{
- LTWRAPPER_DEBUGPRINTF (("checking path component for symlinks: %s\n",
- tmp_pathspec));
+ lt_debugprintf (__FILE__, __LINE__,
+ "checking path component for symlinks: %s\n",
+ tmp_pathspec);
if (lstat (tmp_pathspec, &s) == 0)
{
if (S_ISLNK (s.st_mode) != 0)
}
else
{
- char *errstr = strerror (errno);
- lt_fatal ("Error accessing file %s (%s)", tmp_pathspec, errstr);
+ lt_fatal (__FILE__, __LINE__,
+ "error accessing file \"%s\": %s",
+ tmp_pathspec, nonnull (strerror (errno)));
}
}
XFREE (tmp_pathspec);
tmp_pathspec = realpath (pathspec, buf);
if (tmp_pathspec == 0)
{
- lt_fatal ("Could not follow symlinks for %s", pathspec);
+ lt_fatal (__FILE__, __LINE__,
+ "could not follow symlinks for %s", pathspec);
}
return xstrdup (tmp_pathspec);
#endif
return str;
}
+void
+lt_debugprintf (const char *file, int line, const char *fmt, ...)
+{
+ va_list args;
+ if (lt_debug)
+ {
+ (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line);
+ va_start (args, fmt);
+ (void) vfprintf (stderr, fmt, args);
+ va_end (args);
+ }
+}
+
static void
-lt_error_core (int exit_status, const char *mode,
+lt_error_core (int exit_status, const char *file,
+ int line, const char *mode,
const char *message, va_list ap)
{
- fprintf (stderr, "%s: %s: ", program_name, mode);
+ fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode);
vfprintf (stderr, message, ap);
fprintf (stderr, ".\n");
}
void
-lt_fatal (const char *message, ...)
+lt_fatal (const char *file, int line, const char *message, ...)
{
va_list ap;
va_start (ap, message);
- lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
+ lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap);
va_end (ap);
}
+static const char *
+nonnull (const char *s)
+{
+ return s ? s : "(null)";
+}
+
+static const char *
+nonempty (const char *s)
+{
+ return (s && !*s) ? "(empty)" : nonnull (s);
+}
+
void
lt_setenv (const char *name, const char *value)
{
- LTWRAPPER_DEBUGPRINTF (("(lt_setenv) setting '%s' to '%s'\n",
- (name ? name : "<NULL>"),
- (value ? value : "<NULL>")));
+ lt_debugprintf (__FILE__, __LINE__,
+ "(lt_setenv) setting '%s' to '%s'\n",
+ nonnull (name), nonnull (value));
{
#ifdef HAVE_SETENV
/* always make a copy, for consistency with !HAVE_SETENV */
return new_value;
}
-int
-lt_split_name_value (const char *arg, char** name, char** value)
-{
- const char *p;
- int len;
- if (!arg || !*arg)
- return 1;
-
- p = strchr (arg, (int)'=');
-
- if (!p)
- return 1;
-
- *value = xstrdup (++p);
-
- len = strlen (arg) - strlen (*value);
- *name = XMALLOC (char, len);
- strncpy (*name, arg, len-1);
- (*name)[len - 1] = '\0';
-
- return 0;
-}
-
-void
-lt_opt_process_env_set (const char *arg)
-{
- char *name = NULL;
- char *value = NULL;
-
- if (lt_split_name_value (arg, &name, &value) != 0)
- {
- XFREE (name);
- XFREE (value);
- lt_fatal ("bad argument for %s: '%s'", env_set_opt, arg);
- }
-
- lt_setenv (name, value);
- XFREE (name);
- XFREE (value);
-}
-
-void
-lt_opt_process_env_prepend (const char *arg)
-{
- char *name = NULL;
- char *value = NULL;
- char *new_value = NULL;
-
- if (lt_split_name_value (arg, &name, &value) != 0)
- {
- XFREE (name);
- XFREE (value);
- lt_fatal ("bad argument for %s: '%s'", env_prepend_opt, arg);
- }
-
- new_value = lt_extend_str (getenv (name), value, 0);
- lt_setenv (name, new_value);
- XFREE (new_value);
- XFREE (name);
- XFREE (value);
-}
-
-void
-lt_opt_process_env_append (const char *arg)
-{
- char *name = NULL;
- char *value = NULL;
- char *new_value = NULL;
-
- if (lt_split_name_value (arg, &name, &value) != 0)
- {
- XFREE (name);
- XFREE (value);
- lt_fatal ("bad argument for %s: '%s'", env_append_opt, arg);
- }
-
- new_value = lt_extend_str (getenv (name), value, 1);
- lt_setenv (name, new_value);
- XFREE (new_value);
- XFREE (name);
- XFREE (value);
-}
-
void
lt_update_exe_path (const char *name, const char *value)
{
- LTWRAPPER_DEBUGPRINTF (("(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
- (name ? name : "<NULL>"),
- (value ? value : "<NULL>")));
+ lt_debugprintf (__FILE__, __LINE__,
+ "(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
+ nonnull (name), nonnull (value));
if (name && *name && value && *value)
{
void
lt_update_lib_path (const char *name, const char *value)
{
- LTWRAPPER_DEBUGPRINTF (("(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
- (name ? name : "<NULL>"),
- (value ? value : "<NULL>")));
+ lt_debugprintf (__FILE__, __LINE__,
+ "(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
+ nonnull (name), nonnull (value));
if (name && *name && value && *value)
{
}
}
+EOF
+ case $host_os in
+ mingw*)
+ cat <<"EOF"
+
+/* Prepares an argument vector before calling spawn().
+ Note that spawn() does not by itself call the command interpreter
+ (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") :
+ ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+ GetVersionEx(&v);
+ v.dwPlatformId == VER_PLATFORM_WIN32_NT;
+ }) ? "cmd.exe" : "command.com").
+ Instead it simply concatenates the arguments, separated by ' ', and calls
+ CreateProcess(). We must quote the arguments since Win32 CreateProcess()
+ interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a
+ special way:
+ - Space and tab are interpreted as delimiters. They are not treated as
+ delimiters if they are surrounded by double quotes: "...".
+ - Unescaped double quotes are removed from the input. Their only effect is
+ that within double quotes, space and tab are treated like normal
+ characters.
+ - Backslashes not followed by double quotes are not special.
+ - But 2*n+1 backslashes followed by a double quote become
+ n backslashes followed by a double quote (n >= 0):
+ \" -> "
+ \\\" -> \"
+ \\\\\" -> \\"
+ */
+#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
+#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
+char **
+prepare_spawn (char **argv)
+{
+ size_t argc;
+ char **new_argv;
+ size_t i;
+
+ /* Count number of arguments. */
+ for (argc = 0; argv[argc] != NULL; argc++)
+ ;
+
+ /* Allocate new argument vector. */
+ new_argv = XMALLOC (char *, argc + 1);
+
+ /* Put quoted arguments into the new argument vector. */
+ for (i = 0; i < argc; i++)
+ {
+ const char *string = argv[i];
+
+ if (string[0] == '\0')
+ new_argv[i] = xstrdup ("\"\"");
+ else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL)
+ {
+ int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL);
+ size_t length;
+ unsigned int backslashes;
+ const char *s;
+ char *quoted_string;
+ char *p;
+
+ length = 0;
+ backslashes = 0;
+ if (quote_around)
+ length++;
+ for (s = string; *s != '\0'; s++)
+ {
+ char c = *s;
+ if (c == '"')
+ length += backslashes + 1;
+ length++;
+ if (c == '\\')
+ backslashes++;
+ else
+ backslashes = 0;
+ }
+ if (quote_around)
+ length += backslashes + 1;
+
+ quoted_string = XMALLOC (char, length + 1);
+
+ p = quoted_string;
+ backslashes = 0;
+ if (quote_around)
+ *p++ = '"';
+ for (s = string; *s != '\0'; s++)
+ {
+ char c = *s;
+ if (c == '"')
+ {
+ unsigned int j;
+ for (j = backslashes + 1; j > 0; j--)
+ *p++ = '\\';
+ }
+ *p++ = c;
+ if (c == '\\')
+ backslashes++;
+ else
+ backslashes = 0;
+ }
+ if (quote_around)
+ {
+ unsigned int j;
+ for (j = backslashes; j > 0; j--)
+ *p++ = '\\';
+ *p++ = '"';
+ }
+ *p = '\0';
+
+ new_argv[i] = quoted_string;
+ }
+ else
+ new_argv[i] = (char *) string;
+ }
+ new_argv[argc] = NULL;
+
+ return new_argv;
+}
+EOF
+ ;;
+ esac
+
+ cat <<"EOF"
+void lt_dump_script (FILE* f)
+{
+EOF
+ func_emit_wrapper yes |
+ $SED -e 's/\([\\"]\)/\\\1/g' \
+ -e 's/^/ fputs ("/' -e 's/$/\\n", f);/'
+ cat <<"EOF"
+}
EOF
}
# end: func_emit_cwrapperexe_src
+# func_win32_import_lib_p ARG
+# True if ARG is an import lib, as indicated by $file_magic_cmd
+func_win32_import_lib_p ()
+{
+ $opt_debug
+ case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
+ *import*) : ;;
+ *) false ;;
+ esac
+}
+
# func_mode_link arg...
func_mode_link ()
{
new_inherited_linker_flags=
avoid_version=no
+ bindir=
dlfiles=
dlprefiles=
dlself=no
esac
case $prev in
+ bindir)
+ bindir="$arg"
+ prev=
+ continue
+ ;;
dlfiles|dlprefiles)
if test "$preload" = no; then
# Add the symbol object into the linking commands.
;;
*)
if test "$prev" = dlfiles; then
- dlfiles="$dlfiles $arg"
+ func_append dlfiles " $arg"
else
- dlprefiles="$dlprefiles $arg"
+ func_append dlprefiles " $arg"
fi
prev=
continue
*-*-darwin*)
case "$deplibs " in
*" $qarg.ltframework "*) ;;
- *) deplibs="$deplibs $qarg.ltframework" # this is fixed later
+ *) func_append deplibs " $qarg.ltframework" # this is fixed later
;;
esac
;;
moreargs=
for fil in `cat "$save_arg"`
do
-# moreargs="$moreargs $fil"
+# func_append moreargs " $fil"
arg=$fil
# A libtool-controlled object.
if test "$prev" = dlfiles; then
if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
- dlfiles="$dlfiles $pic_object"
+ func_append dlfiles " $pic_object"
prev=
continue
else
# CHECK ME: I think I busted this. -Ossama
if test "$prev" = dlprefiles; then
# Preload the old-style object.
- dlprefiles="$dlprefiles $pic_object"
+ func_append dlprefiles " $pic_object"
prev=
fi
if test "$prev" = rpath; then
case "$rpath " in
*" $arg "*) ;;
- *) rpath="$rpath $arg" ;;
+ *) func_append rpath " $arg" ;;
esac
else
case "$xrpath " in
*" $arg "*) ;;
- *) xrpath="$xrpath $arg" ;;
+ *) func_append xrpath " $arg" ;;
esac
fi
prev=
continue
;;
weak)
- weak_libs="$weak_libs $arg"
+ func_append weak_libs " $arg"
prev=
continue
;;
xcclinker)
- linker_flags="$linker_flags $qarg"
- compiler_flags="$compiler_flags $qarg"
+ func_append linker_flags " $qarg"
+ func_append compiler_flags " $qarg"
prev=
func_append compile_command " $qarg"
func_append finalize_command " $qarg"
continue
;;
xcompiler)
- compiler_flags="$compiler_flags $qarg"
+ func_append compiler_flags " $qarg"
prev=
func_append compile_command " $qarg"
func_append finalize_command " $qarg"
continue
;;
xlinker)
- linker_flags="$linker_flags $qarg"
- compiler_flags="$compiler_flags $wl$qarg"
+ func_append linker_flags " $qarg"
+ func_append compiler_flags " $wl$qarg"
prev=
func_append compile_command " $wl$qarg"
func_append finalize_command " $wl$qarg"
continue
;;
+ -bindir)
+ prev=bindir
+ continue
+ ;;
+
-dlopen)
prev=dlfiles
continue
;;
-L*)
- func_stripname '-L' '' "$arg"
- dir=$func_stripname_result
- if test -z "$dir"; then
+ func_stripname "-L" '' "$arg"
+ if test -z "$func_stripname_result"; then
if test "$#" -gt 0; then
func_fatal_error "require no space between \`-L' and \`$1'"
else
func_fatal_error "need path for \`-L' option"
fi
fi
+ func_resolve_sysroot "$func_stripname_result"
+ dir=$func_resolve_sysroot_result
# We need an absolute path.
case $dir in
[\\/]* | [A-Za-z]:[\\/]*) ;;
;;
esac
case "$deplibs " in
- *" -L$dir "*) ;;
+ *" -L$dir "* | *" $arg "*)
+ # Will only happen for absolute or sysroot arguments
+ ;;
*)
- deplibs="$deplibs -L$dir"
- lib_search_path="$lib_search_path $dir"
+ # Preserve sysroot, but never include relative directories
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;;
+ *) func_append deplibs " -L$dir" ;;
+ esac
+ func_append lib_search_path " $dir"
;;
esac
case $host in
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
- testbindir=`$ECHO "X$dir" | $Xsed -e 's*/lib$*/bin*'`
+ testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'`
case :$dllsearchpath: in
*":$dir:"*) ;;
::) dllsearchpath=$dir;;
- *) dllsearchpath="$dllsearchpath:$dir";;
+ *) func_append dllsearchpath ":$dir";;
esac
case :$dllsearchpath: in
*":$testbindir:"*) ;;
::) dllsearchpath=$testbindir;;
- *) dllsearchpath="$dllsearchpath:$testbindir";;
+ *) func_append dllsearchpath ":$testbindir";;
esac
;;
esac
-l*)
if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc*)
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
# These systems don't actually have a C or math library (as such)
continue
;;
;;
*-*-rhapsody* | *-*-darwin1.[012])
# Rhapsody C and math libraries are in the System framework
- deplibs="$deplibs System.ltframework"
+ func_append deplibs " System.ltframework"
continue
;;
*-*-sco3.2v5* | *-*-sco5v6*)
;;
esac
fi
- deplibs="$deplibs $arg"
+ func_append deplibs " $arg"
continue
;;
# Tru64 UNIX uses -model [arg] to determine the layout of C++
# classes, name mangling, and exception handling.
# Darwin uses the -arch flag to determine output architecture.
- -model|-arch|-isysroot)
- compiler_flags="$compiler_flags $arg"
+ -model|-arch|-isysroot|--sysroot)
+ func_append compiler_flags " $arg"
func_append compile_command " $arg"
func_append finalize_command " $arg"
prev=xcompiler
;;
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
- compiler_flags="$compiler_flags $arg"
+ func_append compiler_flags " $arg"
func_append compile_command " $arg"
func_append finalize_command " $arg"
case "$new_inherited_linker_flags " in
*" $arg "*) ;;
- * ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;;
+ * ) func_append new_inherited_linker_flags " $arg" ;;
esac
continue
;;
# We need an absolute path.
case $dir in
[\\/]* | [A-Za-z]:[\\/]*) ;;
+ =*)
+ func_stripname '=' '' "$dir"
+ dir=$lt_sysroot$func_stripname_result
+ ;;
*)
func_fatal_error "only absolute run-paths are allowed"
;;
esac
case "$xrpath " in
*" $dir "*) ;;
- *) xrpath="$xrpath $dir" ;;
+ *) func_append xrpath " $dir" ;;
esac
continue
;;
for flag in $args; do
IFS="$save_ifs"
func_quote_for_eval "$flag"
- arg="$arg $wl$func_quote_for_eval_result"
- compiler_flags="$compiler_flags $func_quote_for_eval_result"
+ func_append arg " $func_quote_for_eval_result"
+ func_append compiler_flags " $func_quote_for_eval_result"
done
IFS="$save_ifs"
func_stripname ' ' '' "$arg"
for flag in $args; do
IFS="$save_ifs"
func_quote_for_eval "$flag"
- arg="$arg $wl$func_quote_for_eval_result"
- compiler_flags="$compiler_flags $wl$func_quote_for_eval_result"
- linker_flags="$linker_flags $func_quote_for_eval_result"
+ func_append arg " $wl$func_quote_for_eval_result"
+ func_append compiler_flags " $wl$func_quote_for_eval_result"
+ func_append linker_flags " $func_quote_for_eval_result"
done
IFS="$save_ifs"
func_stripname ' ' '' "$arg"
arg="$func_quote_for_eval_result"
;;
- # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
- # -r[0-9][0-9]* specifies the processor on the SGI compiler
- # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
- # +DA*, +DD* enable 64-bit mode on the HP compiler
- # -q* pass through compiler args for the IBM compiler
- # -m*, -t[45]*, -txscale* pass through architecture-specific
- # compiler args for GCC
- # -F/path gives path to uninstalled frameworks, gcc on darwin
- # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC
- # @file GCC response files
+ # Flags to be passed through unchanged, with rationale:
+ # -64, -mips[0-9] enable 64-bit mode for the SGI compiler
+ # -r[0-9][0-9]* specify processor for the SGI compiler
+ # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler
+ # +DA*, +DD* enable 64-bit mode for the HP compiler
+ # -q* compiler args for the IBM compiler
+ # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
+ # -F/path path to uninstalled frameworks, gcc on darwin
+ # -p, -pg, --coverage, -fprofile-* profiling flags for GCC
+ # @file GCC response files
+ # -tp=* Portland pgcc target processor selection
+ # --sysroot=* for sysroot support
+ # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
-64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
- -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*)
+ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
+ -O*|-flto*|-fwhopr*|-fuse-linker-plugin)
func_quote_for_eval "$arg"
arg="$func_quote_for_eval_result"
func_append compile_command " $arg"
func_append finalize_command " $arg"
- compiler_flags="$compiler_flags $arg"
+ func_append compiler_flags " $arg"
continue
;;
*.$objext)
# A standard object.
- objs="$objs $arg"
+ func_append objs " $arg"
;;
*.lo)
if test "$prev" = dlfiles; then
if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
- dlfiles="$dlfiles $pic_object"
+ func_append dlfiles " $pic_object"
prev=
continue
else
# CHECK ME: I think I busted this. -Ossama
if test "$prev" = dlprefiles; then
# Preload the old-style object.
- dlprefiles="$dlprefiles $pic_object"
+ func_append dlprefiles " $pic_object"
prev=
fi
*.$libext)
# An archive.
- deplibs="$deplibs $arg"
- old_deplibs="$old_deplibs $arg"
+ func_append deplibs " $arg"
+ func_append old_deplibs " $arg"
continue
;;
*.la)
# A libtool-controlled library.
+ func_resolve_sysroot "$arg"
if test "$prev" = dlfiles; then
# This library was specified with -dlopen.
- dlfiles="$dlfiles $arg"
+ func_append dlfiles " $func_resolve_sysroot_result"
prev=
elif test "$prev" = dlprefiles; then
# The library was specified with -dlpreopen.
- dlprefiles="$dlprefiles $arg"
+ func_append dlprefiles " $func_resolve_sysroot_result"
prev=
else
- deplibs="$deplibs $arg"
+ func_append deplibs " $func_resolve_sysroot_result"
fi
continue
;;
if test -n "$shlibpath_var"; then
# get the directories listed in $shlibpath_var
- eval shlib_search_path=\`\$ECHO \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
+ eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\`
else
shlib_search_path=
fi
func_dirname "$output" "/" ""
output_objdir="$func_dirname_result$objdir"
+ func_to_tool_file "$output_objdir/"
+ tool_output_objdir=$func_to_tool_file_result
# Create the object directory.
func_mkdir_p "$output_objdir"
# Find all interdependent deplibs by searching for libraries
# that are linked more than once (e.g. -la -lb -la)
for deplib in $deplibs; do
- if $opt_duplicate_deps ; then
+ if $opt_preserve_dup_deps ; then
case "$libs " in
- *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+ *" $deplib "*) func_append specialdeplibs " $deplib" ;;
esac
fi
- libs="$libs $deplib"
+ func_append libs " $deplib"
done
if test "$linkmode" = lib; then
if $opt_duplicate_compiler_generated_deps; then
for pre_post_dep in $predeps $postdeps; do
case "$pre_post_deps " in
- *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
+ *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;;
esac
- pre_post_deps="$pre_post_deps $pre_post_dep"
+ func_append pre_post_deps " $pre_post_dep"
done
fi
pre_post_deps=
for lib in $dlprefiles; do
# Ignore non-libtool-libs
dependency_libs=
+ func_resolve_sysroot "$lib"
case $lib in
- *.la) func_source "$lib" ;;
+ *.la) func_source "$func_resolve_sysroot_result" ;;
esac
# Collect preopened libtool deplibs, except any this library
# has declared as weak libs
for deplib in $dependency_libs; do
- deplib_base=`$ECHO "X$deplib" | $Xsed -e "$basename"`
+ func_basename "$deplib"
+ deplib_base=$func_basename_result
case " $weak_libs " in
*" $deplib_base "*) ;;
- *) deplibs="$deplibs $deplib" ;;
+ *) func_append deplibs " $deplib" ;;
esac
done
done
compile_deplibs="$deplib $compile_deplibs"
finalize_deplibs="$deplib $finalize_deplibs"
else
- compiler_flags="$compiler_flags $deplib"
+ func_append compiler_flags " $deplib"
if test "$linkmode" = lib ; then
case "$new_inherited_linker_flags " in
*" $deplib "*) ;;
- * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
+ * ) func_append new_inherited_linker_flags " $deplib" ;;
esac
fi
fi
if test "$linkmode" = lib ; then
case "$new_inherited_linker_flags " in
*" $deplib "*) ;;
- * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
+ * ) func_append new_inherited_linker_flags " $deplib" ;;
esac
fi
fi
test "$pass" = conv && continue
newdependency_libs="$deplib $newdependency_libs"
func_stripname '-L' '' "$deplib"
- newlib_search_path="$newlib_search_path $func_stripname_result"
+ func_resolve_sysroot "$func_stripname_result"
+ func_append newlib_search_path " $func_resolve_sysroot_result"
;;
prog)
if test "$pass" = conv; then
finalize_deplibs="$deplib $finalize_deplibs"
fi
func_stripname '-L' '' "$deplib"
- newlib_search_path="$newlib_search_path $func_stripname_result"
+ func_resolve_sysroot "$func_stripname_result"
+ func_append newlib_search_path " $func_resolve_sysroot_result"
;;
*)
func_warning "\`-L' is ignored for archives/objects"
-R*)
if test "$pass" = link; then
func_stripname '-R' '' "$deplib"
- dir=$func_stripname_result
+ func_resolve_sysroot "$func_stripname_result"
+ dir=$func_resolve_sysroot_result
# Make sure the xrpath contains only unique directories.
case "$xrpath " in
*" $dir "*) ;;
- *) xrpath="$xrpath $dir" ;;
+ *) func_append xrpath " $dir" ;;
esac
fi
deplibs="$deplib $deplibs"
continue
;;
- *.la) lib="$deplib" ;;
+ *.la)
+ func_resolve_sysroot "$deplib"
+ lib=$func_resolve_sysroot_result
+ ;;
*.$libext)
if test "$pass" = conv; then
deplibs="$deplib $deplibs"
match_pattern*)
set dummy $deplibs_check_method; shift
match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
- if eval "\$ECHO \"X$deplib\"" 2>/dev/null | $Xsed -e 10q \
+ if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
| $EGREP "$match_pattern_regex" > /dev/null; then
valid_a_lib=yes
fi
;;
esac
if test "$valid_a_lib" != yes; then
- $ECHO
+ echo
$ECHO "*** Warning: Trying to link with static lib archive $deplib."
- $ECHO "*** I have the capability to make that library automatically link in when"
- $ECHO "*** you link to this library. But I can only do this if you have a"
- $ECHO "*** shared version of the library, which you do not appear to have"
- $ECHO "*** because the file extensions .$libext of this argument makes me believe"
- $ECHO "*** that it is just a static archive that I should not use here."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+ echo "*** shared version of the library, which you do not appear to have"
+ echo "*** because the file extensions .$libext of this argument makes me believe"
+ echo "*** that it is just a static archive that I should not use here."
else
- $ECHO
+ echo
$ECHO "*** Warning: Linking the shared library $output against the"
$ECHO "*** static library $deplib is not portable!"
deplibs="$deplib $deplibs"
if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
# If there is no dlopen support or we're linking statically,
# we need to preload.
- newdlprefiles="$newdlprefiles $deplib"
+ func_append newdlprefiles " $deplib"
compile_deplibs="$deplib $compile_deplibs"
finalize_deplibs="$deplib $finalize_deplibs"
else
- newdlfiles="$newdlfiles $deplib"
+ func_append newdlfiles " $deplib"
fi
fi
continue
# Convert "-framework foo" to "foo.ltframework"
if test -n "$inherited_linker_flags"; then
- tmp_inherited_linker_flags=`$ECHO "X$inherited_linker_flags" | $Xsed -e 's/-framework \([^ $]*\)/\1.ltframework/g'`
+ tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`
for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
case " $new_inherited_linker_flags " in
*" $tmp_inherited_linker_flag "*) ;;
- *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";;
+ *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";;
esac
done
fi
- dependency_libs=`$ECHO "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+ dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
if test "$linkmode,$pass" = "lib,link" ||
test "$linkmode,$pass" = "prog,scan" ||
{ test "$linkmode" != prog && test "$linkmode" != lib; }; then
- test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
- test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
+ test -n "$dlopen" && func_append dlfiles " $dlopen"
+ test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"
fi
if test "$pass" = conv; then
func_fatal_error "cannot find name of link library for \`$lib'"
fi
# It is a libtool convenience library, so add in its objects.
- convenience="$convenience $ladir/$objdir/$old_library"
- old_convenience="$old_convenience $ladir/$objdir/$old_library"
+ func_append convenience " $ladir/$objdir/$old_library"
+ func_append old_convenience " $ladir/$objdir/$old_library"
elif test "$linkmode" != prog && test "$linkmode" != lib; then
func_fatal_error "\`$lib' is not a convenience library"
fi
tmp_libs=
for deplib in $dependency_libs; do
deplibs="$deplib $deplibs"
- if $opt_duplicate_deps ; then
+ if $opt_preserve_dup_deps ; then
case "$tmp_libs " in
- *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+ *" $deplib "*) func_append specialdeplibs " $deplib" ;;
esac
fi
- tmp_libs="$tmp_libs $deplib"
+ func_append tmp_libs " $deplib"
done
continue
fi # $pass = conv
# Get the name of the library we link against.
linklib=
- for l in $old_library $library_names; do
- linklib="$l"
- done
+ if test -n "$old_library" &&
+ { test "$prefer_static_libs" = yes ||
+ test "$prefer_static_libs,$installed" = "built,no"; }; then
+ linklib=$old_library
+ else
+ for l in $old_library $library_names; do
+ linklib="$l"
+ done
+ fi
if test -z "$linklib"; then
func_fatal_error "cannot find name of link library for \`$lib'"
fi
# statically, we need to preload. We also need to preload any
# dependent libraries so libltdl's deplib preloader doesn't
# bomb out in the load deplibs phase.
- dlprefiles="$dlprefiles $lib $dependency_libs"
+ func_append dlprefiles " $lib $dependency_libs"
else
- newdlfiles="$newdlfiles $lib"
+ func_append newdlfiles " $lib"
fi
continue
fi # $pass = dlopen
# Find the relevant object directory and library name.
if test "X$installed" = Xyes; then
- if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+ if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
func_warning "library \`$lib' was moved."
dir="$ladir"
absdir="$abs_ladir"
libdir="$abs_ladir"
else
- dir="$libdir"
- absdir="$libdir"
+ dir="$lt_sysroot$libdir"
+ absdir="$lt_sysroot$libdir"
fi
test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
else
dir="$ladir"
absdir="$abs_ladir"
# Remove this search path later
- notinst_path="$notinst_path $abs_ladir"
+ func_append notinst_path " $abs_ladir"
else
dir="$ladir/$objdir"
absdir="$abs_ladir/$objdir"
# Remove this search path later
- notinst_path="$notinst_path $abs_ladir"
+ func_append notinst_path " $abs_ladir"
fi
fi # $installed = yes
func_stripname 'lib' '.la' "$laname"
if test -z "$libdir" && test "$linkmode" = prog; then
func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
fi
- # Prefer using a static library (so that no silly _DYNAMIC symbols
- # are required to link).
- if test -n "$old_library"; then
- newdlprefiles="$newdlprefiles $dir/$old_library"
- # Keep a list of preopened convenience libraries to check
- # that they are being used correctly in the link pass.
- test -z "$libdir" && \
- dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library"
- # Otherwise, use the dlname, so that lt_dlopen finds it.
- elif test -n "$dlname"; then
- newdlprefiles="$newdlprefiles $dir/$dlname"
- else
- newdlprefiles="$newdlprefiles $dir/$linklib"
- fi
+ case "$host" in
+ # special handling for platforms with PE-DLLs.
+ *cygwin* | *mingw* | *cegcc* )
+ # Linker will automatically link against shared library if both
+ # static and shared are present. Therefore, ensure we extract
+ # symbols from the import library if a shared library is present
+ # (otherwise, the dlopen module name will be incorrect). We do
+ # this by putting the import library name into $newdlprefiles.
+ # We recover the dlopen module name by 'saving' the la file
+ # name in a special purpose variable, and (later) extracting the
+ # dlname from the la file.
+ if test -n "$dlname"; then
+ func_tr_sh "$dir/$linklib"
+ eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname"
+ func_append newdlprefiles " $dir/$linklib"
+ else
+ func_append newdlprefiles " $dir/$old_library"
+ # Keep a list of preopened convenience libraries to check
+ # that they are being used correctly in the link pass.
+ test -z "$libdir" && \
+ func_append dlpreconveniencelibs " $dir/$old_library"
+ fi
+ ;;
+ * )
+ # Prefer using a static library (so that no silly _DYNAMIC symbols
+ # are required to link).
+ if test -n "$old_library"; then
+ func_append newdlprefiles " $dir/$old_library"
+ # Keep a list of preopened convenience libraries to check
+ # that they are being used correctly in the link pass.
+ test -z "$libdir" && \
+ func_append dlpreconveniencelibs " $dir/$old_library"
+ # Otherwise, use the dlname, so that lt_dlopen finds it.
+ elif test -n "$dlname"; then
+ func_append newdlprefiles " $dir/$dlname"
+ else
+ func_append newdlprefiles " $dir/$linklib"
+ fi
+ ;;
+ esac
fi # $pass = dlpreopen
if test -z "$libdir"; then
if test "$linkmode" = prog && test "$pass" != link; then
- newlib_search_path="$newlib_search_path $ladir"
+ func_append newlib_search_path " $ladir"
deplibs="$lib $deplibs"
linkalldeplibs=no
for deplib in $dependency_libs; do
case $deplib in
-L*) func_stripname '-L' '' "$deplib"
- newlib_search_path="$newlib_search_path $func_stripname_result"
+ func_resolve_sysroot "$func_stripname_result"
+ func_append newlib_search_path " $func_resolve_sysroot_result"
;;
esac
# Need to link against all dependency_libs?
# or/and link against static libraries
newdependency_libs="$deplib $newdependency_libs"
fi
- if $opt_duplicate_deps ; then
+ if $opt_preserve_dup_deps ; then
case "$tmp_libs " in
- *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+ *" $deplib "*) func_append specialdeplibs " $deplib" ;;
esac
fi
- tmp_libs="$tmp_libs $deplib"
+ func_append tmp_libs " $deplib"
done # for deplib
continue
fi # $linkmode = prog...
# Make sure the rpath contains only unique directories.
case "$temp_rpath:" in
*"$absdir:"*) ;;
- *) temp_rpath="$temp_rpath$absdir:" ;;
+ *) func_append temp_rpath "$absdir:" ;;
esac
fi
*)
case "$compile_rpath " in
*" $absdir "*) ;;
- *) compile_rpath="$compile_rpath $absdir"
+ *) func_append compile_rpath " $absdir" ;;
esac
;;
esac
*)
case "$finalize_rpath " in
*" $libdir "*) ;;
- *) finalize_rpath="$finalize_rpath $libdir"
+ *) func_append finalize_rpath " $libdir" ;;
esac
;;
esac
case $host in
*cygwin* | *mingw* | *cegcc*)
# No point in relinking DLLs because paths are not encoded
- notinst_deplibs="$notinst_deplibs $lib"
+ func_append notinst_deplibs " $lib"
need_relink=no
;;
*)
if test "$installed" = no; then
- notinst_deplibs="$notinst_deplibs $lib"
+ func_append notinst_deplibs " $lib"
need_relink=yes
fi
;;
fi
done
if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
- $ECHO
+ echo
if test "$linkmode" = prog; then
$ECHO "*** Warning: Linking the executable $output against the loadable module"
else
*)
case "$compile_rpath " in
*" $absdir "*) ;;
- *) compile_rpath="$compile_rpath $absdir"
+ *) func_append compile_rpath " $absdir" ;;
esac
;;
esac
*)
case "$finalize_rpath " in
*" $libdir "*) ;;
- *) finalize_rpath="$finalize_rpath $libdir"
+ *) func_append finalize_rpath " $libdir" ;;
esac
;;
esac
linklib=$newlib
fi # test -n "$old_archive_from_expsyms_cmds"
- if test "$linkmode" = prog || test "$mode" != relink; then
+ if test "$linkmode" = prog || test "$opt_mode" != relink; then
add_shlibpath=
add_dir=
add=
if test "X$dlopenmodule" != "X$lib"; then
$ECHO "*** Warning: lib $linklib is a module, not a shared library"
if test -z "$old_library" ; then
- $ECHO
- $ECHO "*** And there doesn't seem to be a static archive available"
- $ECHO "*** The link will probably fail, sorry"
+ echo
+ echo "*** And there doesn't seem to be a static archive available"
+ echo "*** The link will probably fail, sorry"
else
add="$dir/$old_library"
fi
if test -n "$inst_prefix_dir"; then
case $libdir in
[\\/]*)
- add_dir="$add_dir -L$inst_prefix_dir$libdir"
+ func_append add_dir " -L$inst_prefix_dir$libdir"
;;
esac
fi
if test -n "$add_shlibpath"; then
case :$compile_shlibpath: in
*":$add_shlibpath:"*) ;;
- *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
+ *) func_append compile_shlibpath "$add_shlibpath:" ;;
esac
fi
if test "$linkmode" = prog; then
test "$hardcode_shlibpath_var" = yes; then
case :$finalize_shlibpath: in
*":$libdir:"*) ;;
- *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
+ *) func_append finalize_shlibpath "$libdir:" ;;
esac
fi
fi
fi
- if test "$linkmode" = prog || test "$mode" = relink; then
+ if test "$linkmode" = prog || test "$opt_mode" = relink; then
add_shlibpath=
add_dir=
add=
elif test "$hardcode_shlibpath_var" = yes; then
case :$finalize_shlibpath: in
*":$libdir:"*) ;;
- *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
+ *) func_append finalize_shlibpath "$libdir:" ;;
esac
add="-l$name"
elif test "$hardcode_automatic" = yes; then
if test -n "$inst_prefix_dir"; then
case $libdir in
[\\/]*)
- add_dir="$add_dir -L$inst_prefix_dir$libdir"
+ func_append add_dir " -L$inst_prefix_dir$libdir"
;;
esac
fi
# Just print a warning and add the library to dependency_libs so
# that the program can be linked against the static library.
- $ECHO
+ echo
$ECHO "*** Warning: This system can not link to static lib archive $lib."
- $ECHO "*** I have the capability to make that library automatically link in when"
- $ECHO "*** you link to this library. But I can only do this if you have a"
- $ECHO "*** shared version of the library, which you do not appear to have."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+ echo "*** shared version of the library, which you do not appear to have."
if test "$module" = yes; then
- $ECHO "*** But as you try to build a module library, libtool will still create "
- $ECHO "*** a static module, that should work as long as the dlopening application"
- $ECHO "*** is linked with the -dlopen flag to resolve symbols at runtime."
+ echo "*** But as you try to build a module library, libtool will still create "
+ echo "*** a static module, that should work as long as the dlopening application"
+ echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
if test -z "$global_symbol_pipe"; then
- $ECHO
- $ECHO "*** However, this would only work if libtool was able to extract symbol"
- $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"
- $ECHO "*** not find such a program. So, this module is probably useless."
- $ECHO "*** \`nm' from GNU binutils and a full rebuild may help."
+ echo
+ echo "*** However, this would only work if libtool was able to extract symbol"
+ echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+ echo "*** not find such a program. So, this module is probably useless."
+ echo "*** \`nm' from GNU binutils and a full rebuild may help."
fi
if test "$build_old_libs" = no; then
build_libtool_libs=module
temp_xrpath=$func_stripname_result
case " $xrpath " in
*" $temp_xrpath "*) ;;
- *) xrpath="$xrpath $temp_xrpath";;
+ *) func_append xrpath " $temp_xrpath";;
esac;;
- *) temp_deplibs="$temp_deplibs $libdir";;
+ *) func_append temp_deplibs " $libdir";;
esac
done
dependency_libs="$temp_deplibs"
fi
- newlib_search_path="$newlib_search_path $absdir"
+ func_append newlib_search_path " $absdir"
# Link against this library
test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
# ... and its dependency_libs
tmp_libs=
for deplib in $dependency_libs; do
newdependency_libs="$deplib $newdependency_libs"
- if $opt_duplicate_deps ; then
+ case $deplib in
+ -L*) func_stripname '-L' '' "$deplib"
+ func_resolve_sysroot "$func_stripname_result";;
+ *) func_resolve_sysroot "$deplib" ;;
+ esac
+ if $opt_preserve_dup_deps ; then
case "$tmp_libs " in
- *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+ *" $func_resolve_sysroot_result "*)
+ func_append specialdeplibs " $func_resolve_sysroot_result" ;;
esac
fi
- tmp_libs="$tmp_libs $deplib"
+ func_append tmp_libs " $func_resolve_sysroot_result"
done
if test "$link_all_deplibs" != no; then
# Add the search paths of all dependency libraries
for deplib in $dependency_libs; do
+ path=
case $deplib in
-L*) path="$deplib" ;;
*.la)
+ func_resolve_sysroot "$deplib"
+ deplib=$func_resolve_sysroot_result
func_dirname "$deplib" "" "."
- dir="$func_dirname_result"
+ dir=$func_dirname_result
# We need an absolute path.
case $dir in
[\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
if test -z "$darwin_install_name"; then
darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
fi
- compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
- linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}"
+ func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
+ func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}"
path=
fi
fi
compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
else
- compiler_flags="$compiler_flags "`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+ compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
fi
fi
dependency_libs="$newdependency_libs"
for dir in $newlib_search_path; do
case "$lib_search_path " in
*" $dir "*) ;;
- *) lib_search_path="$lib_search_path $dir" ;;
+ *) func_append lib_search_path " $dir" ;;
esac
done
newlib_search_path=
-L*)
case " $tmp_libs " in
*" $deplib "*) ;;
- *) tmp_libs="$tmp_libs $deplib" ;;
+ *) func_append tmp_libs " $deplib" ;;
esac
;;
- *) tmp_libs="$tmp_libs $deplib" ;;
+ *) func_append tmp_libs " $deplib" ;;
esac
done
eval $var=\"$tmp_libs\"
;;
esac
if test -n "$i" ; then
- tmp_libs="$tmp_libs $i"
+ func_append tmp_libs " $i"
fi
done
dependency_libs=$tmp_libs
# Now set the variables for building old libraries.
build_libtool_libs=no
oldlibs="$output"
- objs="$objs$old_deplibs"
+ func_append objs "$old_deplibs"
;;
lib)
if test "$deplibs_check_method" != pass_all; then
func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
else
- $ECHO
+ echo
$ECHO "*** Warning: Linking the shared library $output against the non-libtool"
$ECHO "*** objects $objs is not portable!"
- libobjs="$libobjs $objs"
+ func_append libobjs " $objs"
fi
fi
age="$number_minor"
revision="$number_revision"
;;
- freebsd-aout|freebsd-elf|sunos)
+ freebsd-aout|freebsd-elf|qnx|sunos)
current="$number_major"
revision="$number_minor"
age="0"
done
# Make executables depend on our current version.
- verstring="$verstring:${current}.0"
+ func_append verstring ":${current}.0"
;;
qnx)
fi
func_generate_dlsyms "$libname" "$libname" "yes"
- libobjs="$libobjs $symfileobj"
+ func_append libobjs " $symfileobj"
test "X$libobjs" = "X " && libobjs=
- if test "$mode" != relink; then
+ if test "$opt_mode" != relink; then
# Remove our outputs, but don't remove object files since they
# may have been created when compiling PIC objects.
removelist=
continue
fi
fi
- removelist="$removelist $p"
+ func_append removelist " $p"
;;
*) ;;
esac
# Now set the variables for building old libraries.
if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
- oldlibs="$oldlibs $output_objdir/$libname.$libext"
+ func_append oldlibs " $output_objdir/$libname.$libext"
# Transform .lo files to .o files.
- oldobjs="$objs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
+ oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP`
fi
# Eliminate all temporary directories.
#for path in $notinst_path; do
- # lib_search_path=`$ECHO "X$lib_search_path " | $Xsed -e "s% $path % %g"`
- # deplibs=`$ECHO "X$deplibs " | $Xsed -e "s% -L$path % %g"`
- # dependency_libs=`$ECHO "X$dependency_libs " | $Xsed -e "s% -L$path % %g"`
+ # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"`
+ # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"`
+ # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"`
#done
if test -n "$xrpath"; then
# If the user specified any rpath flags, then add them.
temp_xrpath=
for libdir in $xrpath; do
- temp_xrpath="$temp_xrpath -R$libdir"
+ func_replace_sysroot "$libdir"
+ func_append temp_xrpath " -R$func_replace_sysroot_result"
case "$finalize_rpath " in
*" $libdir "*) ;;
- *) finalize_rpath="$finalize_rpath $libdir" ;;
+ *) func_append finalize_rpath " $libdir" ;;
esac
done
if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
for lib in $old_dlfiles; do
case " $dlprefiles $dlfiles " in
*" $lib "*) ;;
- *) dlfiles="$dlfiles $lib" ;;
+ *) func_append dlfiles " $lib" ;;
esac
done
for lib in $old_dlprefiles; do
case "$dlprefiles " in
*" $lib "*) ;;
- *) dlprefiles="$dlprefiles $lib" ;;
+ *) func_append dlprefiles " $lib" ;;
esac
done
if test "$build_libtool_libs" = yes; then
if test -n "$rpath"; then
case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc*)
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
# these systems don't actually have a c library (as such)!
;;
*-*-rhapsody* | *-*-darwin1.[012])
# Rhapsody C library is in the System framework
- deplibs="$deplibs System.ltframework"
+ func_append deplibs " System.ltframework"
;;
*-*-netbsd*)
# Don't link with libc until the a.out ld.so is fixed.
*)
# Add libc to deplibs on all other systems if necessary.
if test "$build_libtool_need_lc" = "yes"; then
- deplibs="$deplibs -lc"
+ func_append deplibs " -lc"
fi
;;
esac
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
case " $predeps $postdeps " in
*" $i "*)
- newdeplibs="$newdeplibs $i"
+ func_append newdeplibs " $i"
i=""
;;
esac
set dummy $deplib_matches; shift
deplib_match=$1
if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
- newdeplibs="$newdeplibs $i"
+ func_append newdeplibs " $i"
else
droppeddeps=yes
- $ECHO
+ echo
$ECHO "*** Warning: dynamic linker does not accept needed library $i."
- $ECHO "*** I have the capability to make that library automatically link in when"
- $ECHO "*** you link to this library. But I can only do this if you have a"
- $ECHO "*** shared version of the library, which I believe you do not have"
- $ECHO "*** because a test_compile did reveal that the linker did not use it for"
- $ECHO "*** its dynamic dependency list that programs get resolved with at runtime."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+ echo "*** shared version of the library, which I believe you do not have"
+ echo "*** because a test_compile did reveal that the linker did not use it for"
+ echo "*** its dynamic dependency list that programs get resolved with at runtime."
fi
fi
;;
*)
- newdeplibs="$newdeplibs $i"
+ func_append newdeplibs " $i"
;;
esac
done
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
case " $predeps $postdeps " in
*" $i "*)
- newdeplibs="$newdeplibs $i"
+ func_append newdeplibs " $i"
i=""
;;
esac
set dummy $deplib_matches; shift
deplib_match=$1
if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
- newdeplibs="$newdeplibs $i"
+ func_append newdeplibs " $i"
else
droppeddeps=yes
- $ECHO
+ echo
$ECHO "*** Warning: dynamic linker does not accept needed library $i."
- $ECHO "*** I have the capability to make that library automatically link in when"
- $ECHO "*** you link to this library. But I can only do this if you have a"
- $ECHO "*** shared version of the library, which you do not appear to have"
- $ECHO "*** because a test_compile did reveal that the linker did not use this one"
- $ECHO "*** as a dynamic dependency that programs can get resolved with at runtime."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+ echo "*** shared version of the library, which you do not appear to have"
+ echo "*** because a test_compile did reveal that the linker did not use this one"
+ echo "*** as a dynamic dependency that programs can get resolved with at runtime."
fi
fi
else
droppeddeps=yes
- $ECHO
+ echo
$ECHO "*** Warning! Library $i is needed by this library but I was not able to"
- $ECHO "*** make it link in! You will probably need to install it or some"
- $ECHO "*** library that it depends on before this library will be fully"
- $ECHO "*** functional. Installing it before continuing would be even better."
+ echo "*** make it link in! You will probably need to install it or some"
+ echo "*** library that it depends on before this library will be fully"
+ echo "*** functional. Installing it before continuing would be even better."
fi
;;
*)
- newdeplibs="$newdeplibs $i"
+ func_append newdeplibs " $i"
;;
esac
done
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
case " $predeps $postdeps " in
*" $a_deplib "*)
- newdeplibs="$newdeplibs $a_deplib"
+ func_append newdeplibs " $a_deplib"
a_deplib=""
;;
esac
fi
if test -n "$a_deplib" ; then
libname=`eval "\\$ECHO \"$libname_spec\""`
+ if test -n "$file_magic_glob"; then
+ libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
+ else
+ libnameglob=$libname
+ fi
+ test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob`
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
- potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+ if test "$want_nocaseglob" = yes; then
+ shopt -s nocaseglob
+ potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
+ $nocaseglob
+ else
+ potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
+ fi
for potent_lib in $potential_libs; do
# Follow soft links.
if ls -lLd "$potent_lib" 2>/dev/null |
potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
case $potliblink in
[\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
- *) potlib=`$ECHO "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
+ *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";;
esac
done
if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
$SED -e 10q |
$EGREP "$file_magic_regex" > /dev/null; then
- newdeplibs="$newdeplibs $a_deplib"
+ func_append newdeplibs " $a_deplib"
a_deplib=""
break 2
fi
fi
if test -n "$a_deplib" ; then
droppeddeps=yes
- $ECHO
+ echo
$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
- $ECHO "*** I have the capability to make that library automatically link in when"
- $ECHO "*** you link to this library. But I can only do this if you have a"
- $ECHO "*** shared version of the library, which you do not appear to have"
- $ECHO "*** because I did check the linker path looking for a file starting"
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+ echo "*** shared version of the library, which you do not appear to have"
+ echo "*** because I did check the linker path looking for a file starting"
if test -z "$potlib" ; then
$ECHO "*** with $libname but no candidates were found. (...for file magic test)"
else
;;
*)
# Add a -L argument.
- newdeplibs="$newdeplibs $a_deplib"
+ func_append newdeplibs " $a_deplib"
;;
esac
done # Gone through all deplibs.
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
case " $predeps $postdeps " in
*" $a_deplib "*)
- newdeplibs="$newdeplibs $a_deplib"
+ func_append newdeplibs " $a_deplib"
a_deplib=""
;;
esac
potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
for potent_lib in $potential_libs; do
potlib="$potent_lib" # see symlink-check above in file_magic test
- if eval "\$ECHO \"X$potent_lib\"" 2>/dev/null | $Xsed -e 10q | \
+ if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
$EGREP "$match_pattern_regex" > /dev/null; then
- newdeplibs="$newdeplibs $a_deplib"
+ func_append newdeplibs " $a_deplib"
a_deplib=""
break 2
fi
fi
if test -n "$a_deplib" ; then
droppeddeps=yes
- $ECHO
+ echo
$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
- $ECHO "*** I have the capability to make that library automatically link in when"
- $ECHO "*** you link to this library. But I can only do this if you have a"
- $ECHO "*** shared version of the library, which you do not appear to have"
- $ECHO "*** because I did check the linker path looking for a file starting"
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+ echo "*** shared version of the library, which you do not appear to have"
+ echo "*** because I did check the linker path looking for a file starting"
if test -z "$potlib" ; then
$ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
else
;;
*)
# Add a -L argument.
- newdeplibs="$newdeplibs $a_deplib"
+ func_append newdeplibs " $a_deplib"
;;
esac
done # Gone through all deplibs.
;;
none | unknown | *)
newdeplibs=""
- tmp_deplibs=`$ECHO "X $deplibs" | $Xsed \
- -e 's/ -lc$//' -e 's/ -[LR][^ ]*//g'`
+ tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
for i in $predeps $postdeps ; do
# can't use Xsed below, because $i might contain '/'
- tmp_deplibs=`$ECHO "X $tmp_deplibs" | $Xsed -e "s,$i,,"`
+ tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"`
done
fi
- if $ECHO "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' |
- $GREP . >/dev/null; then
- $ECHO
+ case $tmp_deplibs in
+ *[!\ \ ]*)
+ echo
if test "X$deplibs_check_method" = "Xnone"; then
- $ECHO "*** Warning: inter-library dependencies are not supported in this platform."
+ echo "*** Warning: inter-library dependencies are not supported in this platform."
else
- $ECHO "*** Warning: inter-library dependencies are not known to be supported."
+ echo "*** Warning: inter-library dependencies are not known to be supported."
fi
- $ECHO "*** All declared inter-library dependencies are being dropped."
+ echo "*** All declared inter-library dependencies are being dropped."
droppeddeps=yes
- fi
+ ;;
+ esac
;;
esac
versuffix=$versuffix_save
case $host in
*-*-rhapsody* | *-*-darwin1.[012])
# On Rhapsody replace the C library with the System framework
- newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
+ newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'`
;;
esac
if test "$droppeddeps" = yes; then
if test "$module" = yes; then
- $ECHO
- $ECHO "*** Warning: libtool could not satisfy all declared inter-library"
+ echo
+ echo "*** Warning: libtool could not satisfy all declared inter-library"
$ECHO "*** dependencies of module $libname. Therefore, libtool will create"
- $ECHO "*** a static module, that should work as long as the dlopening"
- $ECHO "*** application is linked with the -dlopen flag."
+ echo "*** a static module, that should work as long as the dlopening"
+ echo "*** application is linked with the -dlopen flag."
if test -z "$global_symbol_pipe"; then
- $ECHO
- $ECHO "*** However, this would only work if libtool was able to extract symbol"
- $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"
- $ECHO "*** not find such a program. So, this module is probably useless."
- $ECHO "*** \`nm' from GNU binutils and a full rebuild may help."
+ echo
+ echo "*** However, this would only work if libtool was able to extract symbol"
+ echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+ echo "*** not find such a program. So, this module is probably useless."
+ echo "*** \`nm' from GNU binutils and a full rebuild may help."
fi
if test "$build_old_libs" = no; then
oldlibs="$output_objdir/$libname.$libext"
build_libtool_libs=no
fi
else
- $ECHO "*** The inter-library dependencies that have been dropped here will be"
- $ECHO "*** automatically added whenever a program is linked with this library"
- $ECHO "*** or is declared to -dlopen it."
+ echo "*** The inter-library dependencies that have been dropped here will be"
+ echo "*** automatically added whenever a program is linked with this library"
+ echo "*** or is declared to -dlopen it."
if test "$allow_undefined" = no; then
- $ECHO
- $ECHO "*** Since this library must not contain undefined symbols,"
- $ECHO "*** because either the platform does not support them or"
- $ECHO "*** it was explicitly requested with -no-undefined,"
- $ECHO "*** libtool will only create a static version of it."
+ echo
+ echo "*** Since this library must not contain undefined symbols,"
+ echo "*** because either the platform does not support them or"
+ echo "*** it was explicitly requested with -no-undefined,"
+ echo "*** libtool will only create a static version of it."
if test "$build_old_libs" = no; then
oldlibs="$output_objdir/$libname.$libext"
build_libtool_libs=module
# Time to change all our "foo.ltframework" stuff back to "-framework foo"
case $host in
*-*-darwin*)
- newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
- new_inherited_linker_flags=`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
- deplibs=`$ECHO "X $deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+ newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
;;
esac
*)
case " $deplibs " in
*" -L$path/$objdir "*)
- new_libs="$new_libs -L$path/$objdir" ;;
+ func_append new_libs " -L$path/$objdir" ;;
esac
;;
esac
-L*)
case " $new_libs " in
*" $deplib "*) ;;
- *) new_libs="$new_libs $deplib" ;;
+ *) func_append new_libs " $deplib" ;;
esac
;;
- *) new_libs="$new_libs $deplib" ;;
+ *) func_append new_libs " $deplib" ;;
esac
done
deplibs="$new_libs"
hardcode_libdirs=
dep_rpath=
rpath="$finalize_rpath"
- test "$mode" != relink && rpath="$compile_rpath$rpath"
+ test "$opt_mode" != relink && rpath="$compile_rpath$rpath"
for libdir in $rpath; do
if test -n "$hardcode_libdir_flag_spec"; then
if test -n "$hardcode_libdir_separator"; then
+ func_replace_sysroot "$libdir"
+ libdir=$func_replace_sysroot_result
if test -z "$hardcode_libdirs"; then
hardcode_libdirs="$libdir"
else
*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
;;
*)
- hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+ func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
;;
esac
fi
else
eval flag=\"$hardcode_libdir_flag_spec\"
- dep_rpath="$dep_rpath $flag"
+ func_append dep_rpath " $flag"
fi
elif test -n "$runpath_var"; then
case "$perm_rpath " in
*" $libdir "*) ;;
- *) perm_rpath="$perm_rpath $libdir" ;;
+ *) func_apped perm_rpath " $libdir" ;;
esac
fi
done
# We should set the runpath_var.
rpath=
for dir in $perm_rpath; do
- rpath="$rpath$dir:"
+ func_append rpath "$dir:"
done
eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
fi
fi
shlibpath="$finalize_shlibpath"
- test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
+ test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
if test -n "$shlibpath"; then
eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
fi
linknames=
for link
do
- linknames="$linknames $link"
+ func_append linknames " $link"
done
# Use standard objects if they are pic
- test -z "$pic_flag" && libobjs=`$ECHO "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+ test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP`
test "X$libobjs" = "X " && libobjs=
delfiles=
if test -n "$export_symbols" && test -n "$include_expsyms"; then
$opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
export_symbols="$output_objdir/$libname.uexp"
- delfiles="$delfiles $export_symbols"
+ func_append delfiles " $export_symbols"
fi
orig_export_symbols=
$opt_dry_run || $RM $export_symbols
cmds=$export_symbols_cmds
save_ifs="$IFS"; IFS='~'
- for cmd in $cmds; do
+ for cmd1 in $cmds; do
IFS="$save_ifs"
- eval cmd=\"$cmd\"
- func_len " $cmd"
- len=$func_len_result
- if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+ # Take the normal branch if the nm_file_list_spec branch
+ # doesn't work or if tool conversion is not needed.
+ case $nm_file_list_spec~$to_tool_file_cmd in
+ *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*)
+ try_normal_branch=yes
+ eval cmd=\"$cmd1\"
+ func_len " $cmd"
+ len=$func_len_result
+ ;;
+ *)
+ try_normal_branch=no
+ ;;
+ esac
+ if test "$try_normal_branch" = yes \
+ && { test "$len" -lt "$max_cmd_len" \
+ || test "$max_cmd_len" -le -1; }
+ then
+ func_show_eval "$cmd" 'exit $?'
+ skipped_export=false
+ elif test -n "$nm_file_list_spec"; then
+ func_basename "$output"
+ output_la=$func_basename_result
+ save_libobjs=$libobjs
+ save_output=$output
+ output=${output_objdir}/${output_la}.nm
+ func_to_tool_file "$output"
+ libobjs=$nm_file_list_spec$func_to_tool_file_result
+ func_append delfiles " $output"
+ func_verbose "creating $NM input file list: $output"
+ for obj in $save_libobjs; do
+ func_to_tool_file "$obj"
+ $ECHO "$func_to_tool_file_result"
+ done > "$output"
+ eval cmd=\"$cmd1\"
func_show_eval "$cmd" 'exit $?'
+ output=$save_output
+ libobjs=$save_libobjs
skipped_export=false
else
# The command line is too long to execute in one step.
if test -n "$export_symbols" && test -n "$include_expsyms"; then
tmp_export_symbols="$export_symbols"
test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
- $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"'
+ $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
fi
if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
# global variables. join(1) would be nice here, but unfortunately
# isn't a blessed tool.
$opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
- delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
+ func_append delfiles " $export_symbols $output_objdir/$libname.filter"
export_symbols=$output_objdir/$libname.def
$opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
fi
case " $convenience " in
*" $test_deplib "*) ;;
*)
- tmp_deplibs="$tmp_deplibs $test_deplib"
+ func_append tmp_deplibs " $test_deplib"
;;
esac
done
test "X$libobjs" = "X " && libobjs=
else
gentop="$output_objdir/${outputname}x"
- generated="$generated $gentop"
+ func_append generated " $gentop"
func_extract_archives $gentop $convenience
- libobjs="$libobjs $func_extract_archives_result"
+ func_append libobjs " $func_extract_archives_result"
test "X$libobjs" = "X " && libobjs=
fi
fi
if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
eval flag=\"$thread_safe_flag_spec\"
- linker_flags="$linker_flags $flag"
+ func_append linker_flags " $flag"
fi
# Make a backup of the uninstalled library when relinking
- if test "$mode" = relink; then
+ if test "$opt_mode" = relink; then
$opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
fi
save_libobjs=$libobjs
fi
save_output=$output
- output_la=`$ECHO "X$output" | $Xsed -e "$basename"`
+ func_basename "$output"
+ output_la=$func_basename_result
# Clear the reloadable object creation command queue and
# initialize k to one.
if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
output=${output_objdir}/${output_la}.lnkscript
func_verbose "creating GNU ld script: $output"
- $ECHO 'INPUT (' > $output
+ echo 'INPUT (' > $output
for obj in $save_libobjs
do
- $ECHO "$obj" >> $output
+ func_to_tool_file "$obj"
+ $ECHO "$func_to_tool_file_result" >> $output
done
- $ECHO ')' >> $output
- delfiles="$delfiles $output"
+ echo ')' >> $output
+ func_append delfiles " $output"
+ func_to_tool_file "$output"
+ output=$func_to_tool_file_result
elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
output=${output_objdir}/${output_la}.lnk
func_verbose "creating linker input file list: $output"
fi
for obj
do
- $ECHO "$obj" >> $output
+ func_to_tool_file "$obj"
+ $ECHO "$func_to_tool_file_result" >> $output
done
- delfiles="$delfiles $output"
- output=$firstobj\"$file_list_spec$output\"
+ func_append delfiles " $output"
+ func_to_tool_file "$output"
+ output=$firstobj\"$file_list_spec$func_to_tool_file_result\"
else
if test -n "$save_libobjs"; then
func_verbose "creating reloadable object files..."
# command to the queue.
if test "$k" -eq 1 ; then
# The first file doesn't have a previous command to add.
- eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
+ reload_objs=$objlist
+ eval concat_cmds=\"$reload_cmds\"
else
# All subsequent reloadable object files will link in
# the last one created.
- eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj~\$RM $last_robj\"
+ reload_objs="$objlist $last_robj"
+ eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
fi
last_robj=$output_objdir/$output_la-${k}.$objext
func_arith $k + 1
k=$func_arith_result
output=$output_objdir/$output_la-${k}.$objext
- objlist=$obj
+ objlist=" $obj"
func_len " $last_robj"
func_arith $len0 + $func_len_result
len=$func_arith_result
# reloadable object file. All subsequent reloadable object
# files will link in the last one created.
test -z "$concat_cmds" || concat_cmds=$concat_cmds~
- eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
+ reload_objs="$objlist $last_robj"
+ eval concat_cmds=\"\${concat_cmds}$reload_cmds\"
if test -n "$last_robj"; then
eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
fi
- delfiles="$delfiles $output"
+ func_append delfiles " $output"
else
output=
lt_exit=$?
# Restore the uninstalled library and exit
- if test "$mode" = relink; then
+ if test "$opt_mode" = relink; then
( cd "$output_objdir" && \
$RM "${realname}T" && \
$MV "${realname}U" "$realname" )
if test -n "$export_symbols" && test -n "$include_expsyms"; then
tmp_export_symbols="$export_symbols"
test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
- $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"'
+ $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
fi
if test -n "$orig_export_symbols"; then
# global variables. join(1) would be nice here, but unfortunately
# isn't a blessed tool.
$opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
- delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
+ func_append delfiles " $export_symbols $output_objdir/$libname.filter"
export_symbols=$output_objdir/$libname.def
$opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
fi
# Add any objects from preloaded convenience libraries
if test -n "$dlprefiles"; then
gentop="$output_objdir/${outputname}x"
- generated="$generated $gentop"
+ func_append generated " $gentop"
func_extract_archives $gentop $dlprefiles
- libobjs="$libobjs $func_extract_archives_result"
+ func_append libobjs " $func_extract_archives_result"
test "X$libobjs" = "X " && libobjs=
fi
lt_exit=$?
# Restore the uninstalled library and exit
- if test "$mode" = relink; then
+ if test "$opt_mode" = relink; then
( cd "$output_objdir" && \
$RM "${realname}T" && \
$MV "${realname}U" "$realname" )
IFS="$save_ifs"
# Restore the uninstalled library and exit
- if test "$mode" = relink; then
+ if test "$opt_mode" = relink; then
$opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
if test -n "$convenience"; then
if test -n "$convenience"; then
if test -n "$whole_archive_flag_spec"; then
eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
- reload_conv_objs=$reload_objs\ `$ECHO "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'`
+ reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
else
gentop="$output_objdir/${obj}x"
- generated="$generated $gentop"
+ func_append generated " $gentop"
func_extract_archives $gentop $convenience
reload_conv_objs="$reload_objs $func_extract_archives_result"
fi
fi
+ # If we're not building shared, we need to use non_pic_objs
+ test "$build_libtool_libs" != yes && libobjs="$non_pic_objects"
+
# Create the old-style object.
- reload_objs="$objs$old_deplibs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
+ reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
output="$obj"
func_execute_cmds "$reload_cmds" 'exit $?'
case $host in
*-*-rhapsody* | *-*-darwin1.[012])
# On Rhapsody replace the C library is the System framework
- compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
- finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
+ compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'`
+ finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'`
;;
esac
if test "$tagname" = CXX ; then
case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
10.[0123])
- compile_command="$compile_command ${wl}-bind_at_load"
- finalize_command="$finalize_command ${wl}-bind_at_load"
+ func_append compile_command " ${wl}-bind_at_load"
+ func_append finalize_command " ${wl}-bind_at_load"
;;
esac
fi
# Time to change all our "foo.ltframework" stuff back to "-framework foo"
- compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
- finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+ compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
;;
esac
*)
case " $compile_deplibs " in
*" -L$path/$objdir "*)
- new_libs="$new_libs -L$path/$objdir" ;;
+ func_append new_libs " -L$path/$objdir" ;;
esac
;;
esac
-L*)
case " $new_libs " in
*" $deplib "*) ;;
- *) new_libs="$new_libs $deplib" ;;
+ *) func_append new_libs " $deplib" ;;
esac
;;
- *) new_libs="$new_libs $deplib" ;;
+ *) func_append new_libs " $deplib" ;;
esac
done
compile_deplibs="$new_libs"
- compile_command="$compile_command $compile_deplibs"
- finalize_command="$finalize_command $finalize_deplibs"
+ func_append compile_command " $compile_deplibs"
+ func_append finalize_command " $finalize_deplibs"
if test -n "$rpath$xrpath"; then
# If the user specified any rpath flags, then add them.
# This is the magic to use -rpath.
case "$finalize_rpath " in
*" $libdir "*) ;;
- *) finalize_rpath="$finalize_rpath $libdir" ;;
+ *) func_append finalize_rpath " $libdir" ;;
esac
done
fi
*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
;;
*)
- hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+ func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
;;
esac
fi
else
eval flag=\"$hardcode_libdir_flag_spec\"
- rpath="$rpath $flag"
+ func_append rpath " $flag"
fi
elif test -n "$runpath_var"; then
case "$perm_rpath " in
*" $libdir "*) ;;
- *) perm_rpath="$perm_rpath $libdir" ;;
+ *) func_append perm_rpath " $libdir" ;;
esac
fi
case $host in
case :$dllsearchpath: in
*":$libdir:"*) ;;
::) dllsearchpath=$libdir;;
- *) dllsearchpath="$dllsearchpath:$libdir";;
+ *) func_append dllsearchpath ":$libdir";;
esac
case :$dllsearchpath: in
*":$testbindir:"*) ;;
::) dllsearchpath=$testbindir;;
- *) dllsearchpath="$dllsearchpath:$testbindir";;
+ *) func_append dllsearchpath ":$testbindir";;
esac
;;
esac
*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
;;
*)
- hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+ func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
;;
esac
fi
else
eval flag=\"$hardcode_libdir_flag_spec\"
- rpath="$rpath $flag"
+ func_append rpath " $flag"
fi
elif test -n "$runpath_var"; then
case "$finalize_perm_rpath " in
*" $libdir "*) ;;
- *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
+ *) func_append finalize_perm_rpath " $libdir" ;;
esac
fi
done
if test -n "$libobjs" && test "$build_old_libs" = yes; then
# Transform all the library objects into standard objects.
- compile_command=`$ECHO "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
- finalize_command=`$ECHO "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+ compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
+ finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
fi
func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
wrappers_required=yes
case $host in
+ *cegcc* | *mingw32ce*)
+ # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
+ wrappers_required=no
+ ;;
*cygwin* | *mingw* )
if test "$build_libtool_libs" != yes; then
wrappers_required=no
fi
;;
- *cegcc)
- # Disable wrappers for cegcc, we are cross compiling anyway.
- wrappers_required=no
- ;;
*)
if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
wrappers_required=no
esac
if test "$wrappers_required" = no; then
# Replace the output file specification.
- compile_command=`$ECHO "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
+ compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
link_command="$compile_command$compile_rpath"
# We have no uninstalled library dependencies, so finalize right now.
exit_status=0
func_show_eval "$link_command" 'exit_status=$?'
+ if test -n "$postlink_cmds"; then
+ func_to_tool_file "$output"
+ postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
+ func_execute_cmds "$postlink_cmds" 'exit $?'
+ fi
+
# Delete the generated files.
if test -f "$output_objdir/${outputname}S.${objext}"; then
func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
# We should set the runpath_var.
rpath=
for dir in $perm_rpath; do
- rpath="$rpath$dir:"
+ func_append rpath "$dir:"
done
compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
fi
# We should set the runpath_var.
rpath=
for dir in $finalize_perm_rpath; do
- rpath="$rpath$dir:"
+ func_append rpath "$dir:"
done
finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
fi
# We don't need to create a wrapper script.
link_command="$compile_var$compile_command$compile_rpath"
# Replace the output file specification.
- link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
+ link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
# Delete the old output file.
$opt_dry_run || $RM $output
# Link the executable and exit
func_show_eval "$link_command" 'exit $?'
+
+ if test -n "$postlink_cmds"; then
+ func_to_tool_file "$output"
+ postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
+ func_execute_cmds "$postlink_cmds" 'exit $?'
+ fi
+
exit $EXIT_SUCCESS
fi
if test "$fast_install" != no; then
link_command="$finalize_var$compile_command$finalize_rpath"
if test "$fast_install" = yes; then
- relink_command=`$ECHO "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
+ relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
else
# fast_install is set to needless
relink_command=
fi
# Replace the output file specification.
- link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
+ link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
# Delete the old output files.
$opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
func_show_eval "$link_command" 'exit $?'
+ if test -n "$postlink_cmds"; then
+ func_to_tool_file "$output_objdir/$outputname"
+ postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
+ func_execute_cmds "$postlink_cmds" 'exit $?'
+ fi
+
# Now create the wrapper script.
func_verbose "creating $output"
fi
done
relink_command="(cd `pwd`; $relink_command)"
- relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"`
- fi
-
- # Quote $ECHO for shipping.
- if test "X$ECHO" = "X$SHELL $progpath --fallback-echo"; then
- case $progpath in
- [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
- *) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
- esac
- qecho=`$ECHO "X$qecho" | $Xsed -e "$sed_quote_subst"`
- else
- qecho=`$ECHO "X$ECHO" | $Xsed -e "$sed_quote_subst"`
+ relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
fi
# Only actually do things if not in dry run mode.
else
oldobjs="$old_deplibs $non_pic_objects"
if test "$preload" = yes && test -f "$symfileobj"; then
- oldobjs="$oldobjs $symfileobj"
+ func_append oldobjs " $symfileobj"
fi
fi
addlibs="$old_convenience"
if test -n "$addlibs"; then
gentop="$output_objdir/${outputname}x"
- generated="$generated $gentop"
+ func_append generated " $gentop"
func_extract_archives $gentop $addlibs
- oldobjs="$oldobjs $func_extract_archives_result"
+ func_append oldobjs " $func_extract_archives_result"
fi
# Do each command in the archive commands.
# Add any objects from preloaded convenience libraries
if test -n "$dlprefiles"; then
gentop="$output_objdir/${outputname}x"
- generated="$generated $gentop"
+ func_append generated " $gentop"
func_extract_archives $gentop $dlprefiles
- oldobjs="$oldobjs $func_extract_archives_result"
+ func_append oldobjs " $func_extract_archives_result"
fi
# POSIX demands no paths to be encoded in archives. We have
done | sort | sort -uc >/dev/null 2>&1); then
:
else
- $ECHO "copying selected object files to avoid basename conflicts..."
+ echo "copying selected object files to avoid basename conflicts..."
gentop="$output_objdir/${outputname}x"
- generated="$generated $gentop"
+ func_append generated " $gentop"
func_mkdir_p "$gentop"
save_oldobjs=$oldobjs
oldobjs=
esac
done
func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
- oldobjs="$oldobjs $gentop/$newobj"
+ func_append oldobjs " $gentop/$newobj"
;;
- *) oldobjs="$oldobjs $obj" ;;
+ *) func_append oldobjs " $obj" ;;
esac
done
fi
len=$func_len_result
if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
cmds=$old_archive_cmds
+ elif test -n "$archiver_list_spec"; then
+ func_verbose "using command file archive linking..."
+ for obj in $oldobjs
+ do
+ func_to_tool_file "$obj"
+ $ECHO "$func_to_tool_file_result"
+ done > $output_objdir/$libname.libcmd
+ func_to_tool_file "$output_objdir/$libname.libcmd"
+ oldobjs=" $archiver_list_spec$func_to_tool_file_result"
+ cmds=$old_archive_cmds
else
# the command line is too long to link in one step, link in parts
func_verbose "using piecewise archive linking..."
done
# Quote the link command for shipping.
relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
- relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"`
+ relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
if test "$hardcode_automatic" = yes ; then
relink_command=
fi
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
test -z "$libdir" && \
func_fatal_error "\`$deplib' is not a valid libtool archive"
- newdependency_libs="$newdependency_libs $libdir/$name"
+ func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
+ ;;
+ -L*)
+ func_stripname -L '' "$deplib"
+ func_replace_sysroot "$func_stripname_result"
+ func_append newdependency_libs " -L$func_replace_sysroot_result"
;;
- *) newdependency_libs="$newdependency_libs $deplib" ;;
+ -R*)
+ func_stripname -R '' "$deplib"
+ func_replace_sysroot "$func_stripname_result"
+ func_append newdependency_libs " -R$func_replace_sysroot_result"
+ ;;
+ *) func_append newdependency_libs " $deplib" ;;
esac
done
dependency_libs="$newdependency_libs"
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
test -z "$libdir" && \
func_fatal_error "\`$lib' is not a valid libtool archive"
- newdlfiles="$newdlfiles $libdir/$name"
+ func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"
;;
- *) newdlfiles="$newdlfiles $lib" ;;
+ *) func_append newdlfiles " $lib" ;;
esac
done
dlfiles="$newdlfiles"
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
test -z "$libdir" && \
func_fatal_error "\`$lib' is not a valid libtool archive"
- newdlprefiles="$newdlprefiles $libdir/$name"
+ func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"
;;
esac
done
[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
*) abs=`pwd`"/$lib" ;;
esac
- newdlfiles="$newdlfiles $abs"
+ func_append newdlfiles " $abs"
done
dlfiles="$newdlfiles"
newdlprefiles=
[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
*) abs=`pwd`"/$lib" ;;
esac
- newdlprefiles="$newdlprefiles $abs"
+ func_append newdlprefiles " $abs"
done
dlprefiles="$newdlprefiles"
fi
$RM $output
# place dlname in correct position for cygwin
+ # In fact, it would be nice if we could use this code for all target
+ # systems that can't hard-code library paths into their executables
+ # and that have no shared library path variable independent of PATH,
+ # but it turns out we can't easily determine that from inspecting
+ # libtool variables, so we have to hard-code the OSs to which it
+ # applies here; at the moment, that means platforms that use the PE
+ # object format with DLL files. See the long comment at the top of
+ # tests/bindir.at for full details.
tdlname=$dlname
case $host,$output,$installed,$module,$dlname in
- *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
+ *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
+ # If a -bindir argument was supplied, place the dll there.
+ if test "x$bindir" != x ;
+ then
+ func_relative_path "$install_libdir" "$bindir"
+ tdlname=$func_relative_path_result$dlname
+ else
+ # Otherwise fall back on heuristic.
+ tdlname=../bin/$dlname
+ fi
+ ;;
esac
$ECHO > $output "\
# $outputname - a libtool library file
exit $EXIT_SUCCESS
}
-{ test "$mode" = link || test "$mode" = relink; } &&
+{ test "$opt_mode" = link || test "$opt_mode" = relink; } &&
func_mode_link ${1+"$@"}
for arg
do
case $arg in
- -f) RM="$RM $arg"; rmforce=yes ;;
- -*) RM="$RM $arg" ;;
- *) files="$files $arg" ;;
+ -f) func_append RM " $arg"; rmforce=yes ;;
+ -*) func_append RM " $arg" ;;
+ *) func_append files " $arg" ;;
esac
done
rmdirs=
- origobjdir="$objdir"
for file in $files; do
func_dirname "$file" "" "."
dir="$func_dirname_result"
if test "X$dir" = X.; then
- objdir="$origobjdir"
+ odir="$objdir"
else
- objdir="$dir/$origobjdir"
+ odir="$dir/$objdir"
fi
func_basename "$file"
name="$func_basename_result"
- test "$mode" = uninstall && objdir="$dir"
+ test "$opt_mode" = uninstall && odir="$dir"
- # Remember objdir for removal later, being careful to avoid duplicates
- if test "$mode" = clean; then
+ # Remember odir for removal later, being careful to avoid duplicates
+ if test "$opt_mode" = clean; then
case " $rmdirs " in
- *" $objdir "*) ;;
- *) rmdirs="$rmdirs $objdir" ;;
+ *" $odir "*) ;;
+ *) func_append rmdirs " $odir" ;;
esac
fi
# Delete the libtool libraries and symlinks.
for n in $library_names; do
- rmfiles="$rmfiles $objdir/$n"
+ func_append rmfiles " $odir/$n"
done
- test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
+ test -n "$old_library" && func_append rmfiles " $odir/$old_library"
- case "$mode" in
+ case "$opt_mode" in
clean)
- case " $library_names " in
- # " " in the beginning catches empty $dlname
+ case " $library_names " in
*" $dlname "*) ;;
- *) rmfiles="$rmfiles $objdir/$dlname" ;;
+ *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;;
esac
- test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
+ test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i"
;;
uninstall)
if test -n "$library_names"; then
# Add PIC object to the list of files to remove.
if test -n "$pic_object" &&
test "$pic_object" != none; then
- rmfiles="$rmfiles $dir/$pic_object"
+ func_append rmfiles " $dir/$pic_object"
fi
# Add non-PIC object to the list of files to remove.
if test -n "$non_pic_object" &&
test "$non_pic_object" != none; then
- rmfiles="$rmfiles $dir/$non_pic_object"
+ func_append rmfiles " $dir/$non_pic_object"
fi
fi
;;
*)
- if test "$mode" = clean ; then
+ if test "$opt_mode" = clean ; then
noexename=$name
case $file in
*.exe)
noexename=$func_stripname_result
# $file with .exe has already been added to rmfiles,
# add $file without .exe
- rmfiles="$rmfiles $file"
+ func_append rmfiles " $file"
;;
esac
# Do a test to see if this is a libtool program.
func_ltwrapper_scriptname "$file"
relink_command=
func_source $func_ltwrapper_scriptname_result
- rmfiles="$rmfiles $func_ltwrapper_scriptname_result"
+ func_append rmfiles " $func_ltwrapper_scriptname_result"
else
relink_command=
func_source $dir/$noexename
# note $name still contains .exe if it was in $file originally
# as does the version of $file that was added into $rmfiles
- rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
+ func_append rmfiles " $odir/$name $odir/${name}S.${objext}"
if test "$fast_install" = yes && test -n "$relink_command"; then
- rmfiles="$rmfiles $objdir/lt-$name"
+ func_append rmfiles " $odir/lt-$name"
fi
if test "X$noexename" != "X$name" ; then
- rmfiles="$rmfiles $objdir/lt-${noexename}.c"
+ func_append rmfiles " $odir/lt-${noexename}.c"
fi
fi
fi
esac
func_show_eval "$RM $rmfiles" 'exit_status=1'
done
- objdir="$origobjdir"
# Try to remove the ${objdir}s in the directories where we deleted files
for dir in $rmdirs; do
exit $exit_status
}
-{ test "$mode" = uninstall || test "$mode" = clean; } &&
+{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } &&
func_mode_uninstall ${1+"$@"}
-test -z "$mode" && {
+test -z "$opt_mode" && {
help="$generic_help"
func_fatal_help "you must specify a MODE"
}
test -z "$exec_cmd" && \
- func_fatal_help "invalid operation mode \`$mode'"
+ func_fatal_help "invalid operation mode \`$opt_mode'"
if test -n "$exec_cmd"; then
eval exec "$exec_cmd"
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.68 for udev 166.
+# Generated by GNU Autoconf 2.68 for udev 174.
#
# Report bugs to <linux-hotplug@vger.kernel.org>.
#
as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
-test \$(( 1 + 1 )) = 2 || exit 1"
+test \$(( 1 + 1 )) = 2 || exit 1
+
+ test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || (
+ ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
+ ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
+ PATH=/empty FPATH=/empty; export PATH FPATH
+ test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\
+ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1"
if (eval "$as_required") 2>/dev/null; then :
as_have_required=yes
else
# Sed expression to map a string onto a valid variable name.
as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-
-
-# Check that we are running under the correct shell.
SHELL=${CONFIG_SHELL-/bin/sh}
-case X$lt_ECHO in
-X*--fallback-echo)
- # Remove one level of quotation (which was required for Make).
- ECHO=`echo "$lt_ECHO" | sed 's,\\\\\$\\$0,'$0','`
- ;;
-esac
-
-ECHO=${lt_ECHO-echo}
-if test "X$1" = X--no-reexec; then
- # Discard the --no-reexec flag, and continue.
- shift
-elif test "X$1" = X--fallback-echo; then
- # Avoid inline document here, it may be left over
- :
-elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then
- # Yippee, $ECHO works!
- :
-else
- # Restart under the correct shell.
- exec $SHELL "$0" --no-reexec ${1+"$@"}
-fi
-
-if test "X$1" = X--fallback-echo; then
- # used as fallback echo
- shift
- cat <<_LT_EOF
-$*
-_LT_EOF
- exit 0
-fi
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-if test -z "$lt_ECHO"; then
- if test "X${echo_test_string+set}" != Xset; then
- # find a string as large as possible, as long as the shell can cope with it
- for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
- # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
- if { echo_test_string=`eval $cmd`; } 2>/dev/null &&
- { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null
- then
- break
- fi
- done
- fi
-
- if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
- echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- :
- else
- # The Solaris, AIX, and Digital Unix default echo programs unquote
- # backslashes. This makes it impossible to quote backslashes using
- # echo "$something" | sed 's/\\/\\\\/g'
- #
- # So, first we look for a working echo in the user's PATH.
-
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
- for dir in $PATH /usr/ucb; do
- IFS="$lt_save_ifs"
- if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
- test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
- echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- ECHO="$dir/echo"
- break
- fi
- done
- IFS="$lt_save_ifs"
-
- if test "X$ECHO" = Xecho; then
- # We didn't find a better echo, so look for alternatives.
- if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' &&
- echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- # This shell has a builtin print -r that does the trick.
- ECHO='print -r'
- elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } &&
- test "X$CONFIG_SHELL" != X/bin/ksh; then
- # If we have ksh, try running configure again with it.
- ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
- export ORIGINAL_CONFIG_SHELL
- CONFIG_SHELL=/bin/ksh
- export CONFIG_SHELL
- exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"}
- else
- # Try using printf.
- ECHO='printf %s\n'
- if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
- echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- # Cool, printf works
- :
- elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
- test "X$echo_testing_string" = 'X\t' &&
- echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
- export CONFIG_SHELL
- SHELL="$CONFIG_SHELL"
- export SHELL
- ECHO="$CONFIG_SHELL $0 --fallback-echo"
- elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
- test "X$echo_testing_string" = 'X\t' &&
- echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- ECHO="$CONFIG_SHELL $0 --fallback-echo"
- else
- # maybe with a smaller string...
- prev=:
-
- for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do
- if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null
- then
- break
- fi
- prev="$cmd"
- done
-
- if test "$prev" != 'sed 50q "$0"'; then
- echo_test_string=`eval $prev`
- export echo_test_string
- exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"}
- else
- # Oops. We lost completely, so just stick with echo.
- ECHO=echo
- fi
- fi
- fi
- fi
- fi
-fi
-
-# Copy echo and quote the copy suitably for passing to libtool from
-# the Makefile, instead of quoting the original, which is used later.
-lt_ECHO=$ECHO
-if test "X$lt_ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then
- lt_ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo"
-fi
-
-
-
test -n "$DJDIR" || exec 7<&0 </dev/null
exec 6>&1
# Identity of this package.
PACKAGE_NAME='udev'
PACKAGE_TARNAME='udev'
-PACKAGE_VERSION='166'
-PACKAGE_STRING='udev 166'
+PACKAGE_VERSION='174'
+PACKAGE_STRING='udev 174'
PACKAGE_BUGREPORT='linux-hotplug@vger.kernel.org'
-PACKAGE_URL=''
+PACKAGE_URL='http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html'
+ac_unique_file="udev/udevd.c"
# Factoring default headers for most tests.
ac_includes_default="\
#include <stdio.h>
am__EXEEXT_TRUE
LTLIBOBJS
LIBOBJS
+ENABLE_EDD_FALSE
+ENABLE_EDD_TRUE
+ENABLE_FLOPPY_FALSE
+ENABLE_FLOPPY_TRUE
+ENABLE_UDEV_ACL_FALSE
+ENABLE_UDEV_ACL_TRUE
+ENABLE_RULE_GENERATOR_FALSE
+ENABLE_RULE_GENERATOR_TRUE
+ENABLE_MTD_PROBE_FALSE
+ENABLE_MTD_PROBE_TRUE
+ENABLE_KEYMAP_FALSE
+ENABLE_KEYMAP_TRUE
+INCLUDE_PREFIX
+GPERF
+ENABLE_HWDB_FALSE
+ENABLE_HWDB_TRUE
+PCI_DATABASE
+USB_DATABASE
+USBUTILS_LIBS
+USBUTILS_CFLAGS
+ENABLE_GUDEV_FALSE
+ENABLE_GUDEV_TRUE
ENABLE_INTROSPECTION_FALSE
ENABLE_INTROSPECTION_TRUE
GIRTYPELIBDIR
G_IR_SCANNER
INTROSPECTION_LIBS
INTROSPECTION_CFLAGS
-ENABLE_EXTRAS_FALSE
-ENABLE_EXTRAS_TRUE
-INCLUDE_PREFIX
-PCI_DATABASE
-USB_DATABASE
-USBUTILS_LIBS
-USBUTILS_CFLAGS
-LIBUSB_LIBS
-LIBUSB_CFLAGS
GLIB_LIBS
GLIB_CFLAGS
-GPERF
WITH_SYSTEMD_FALSE
WITH_SYSTEMD_TRUE
systemdsystemunitdir
GTK_DOC_BUILD_HTML_TRUE
ENABLE_GTK_DOC_FALSE
ENABLE_GTK_DOC_TRUE
-PKG_CONFIG_LIBDIR
-PKG_CONFIG_PATH
-PKG_CONFIG
+GTKDOC_DEPS_LIBS
+GTKDOC_DEPS_CFLAGS
HTML_DIR
GTKDOC_MKPDF
GTKDOC_REBASE
GTKDOC_CHECK
+PKG_CONFIG_LIBDIR
+PKG_CONFIG_PATH
+PKG_CONFIG
OTOOL64
OTOOL
LIPO
NMEDIT
DSYMUTIL
-lt_ECHO
+MANIFEST_TOOL
RANLIB
+ac_ct_AR
AR
+DLLTOOL
OBJDUMP
LN_S
NM
with_pic
enable_fast_install
with_gnu_ld
+with_sysroot
enable_libtool_lock
with_html_dir
enable_gtk_doc
enable_logging
with_firmware_path
with_systemdsystemunitdir
-enable_extras
-with_pci_ids_path
+enable_gudev
enable_introspection
+enable_hwdb
+with_usb_ids_path
+with_pci_ids_path
+enable_keymap
+enable_mtd_probe
+enable_rule_generator
+enable_udev_acl
+enable_floppy
+enable_edd
'
ac_precious_vars='build_alias
host_alias
PKG_CONFIG
PKG_CONFIG_PATH
PKG_CONFIG_LIBDIR
+GTKDOC_DEPS_CFLAGS
+GTKDOC_DEPS_LIBS
GLIB_CFLAGS
GLIB_LIBS
-LIBUSB_CFLAGS
-LIBUSB_LIBS
-USBUTILS_CFLAGS
-USBUTILS_LIBS
INTROSPECTION_CFLAGS
-INTROSPECTION_LIBS'
+INTROSPECTION_LIBS
+USBUTILS_CFLAGS
+USBUTILS_LIBS'
# Initialize some variables set by options.
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures udev 166 to adapt to many kinds of systems.
+\`configure' configures udev 174 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of udev 166:";;
+ short | recursive ) echo "Configuration of udev 174:";;
esac
cat <<\_ACEOF
--enable-gtk-doc-pdf build documentation in pdf format [[default=no]]
--enable-debug enable debug messages
--disable-logging disable system logging
- --disable-extras disable extras with external dependencies
+ --disable-gudev disable Gobject libudev support
--disable-introspection disable GObject introspection
+ --disable-hwdb disable hardware database support
+ --disable-keymap disable keymap fixup support
+ --disable-mtd_probe disable MTD support
+ --enable-rule_generator enable persistent network + cdrom links support
+ --enable-udev_acl enable local user acl permissions support
+ --enable-floppy enable legacy floppy support
+ --enable-edd enable disk edd support
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--with-pic try to use only PIC/non-PIC objects [default=use
both]
--with-gnu-ld assume the C compiler uses GNU ld [default=no]
+ --with-sysroot=DIR Search for dependent libraries within DIR
+ (or the compiler's sysroot if not specified).
--with-html-dir=PATH path to installed docs
--with-rootlibdir=DIR rootfs directory to install shared libraries
--with-selinux enable SELinux support
(default=/lib/firmware/updates:/lib/firmware)
--with-systemdsystemunitdir=DIR
Directory for systemd service files
+ --with-usb-ids-path=DIR Path to usb.ids file
--with-pci-ids-path=DIR Path to pci.ids file
Some influential environment variables:
directories to add to pkg-config's search path
PKG_CONFIG_LIBDIR
path overriding pkg-config's built-in search path
+ GTKDOC_DEPS_CFLAGS
+ C compiler flags for GTKDOC_DEPS, overriding pkg-config
+ GTKDOC_DEPS_LIBS
+ linker flags for GTKDOC_DEPS, overriding pkg-config
GLIB_CFLAGS C compiler flags for GLIB, overriding pkg-config
GLIB_LIBS linker flags for GLIB, overriding pkg-config
- LIBUSB_CFLAGS
- C compiler flags for LIBUSB, overriding pkg-config
- LIBUSB_LIBS linker flags for LIBUSB, overriding pkg-config
- USBUTILS_CFLAGS
- C compiler flags for USBUTILS, overriding pkg-config
- USBUTILS_LIBS
- linker flags for USBUTILS, overriding pkg-config
INTROSPECTION_CFLAGS
C compiler flags for INTROSPECTION, overriding pkg-config
INTROSPECTION_LIBS
linker flags for INTROSPECTION, overriding pkg-config
+ USBUTILS_CFLAGS
+ C compiler flags for USBUTILS, overriding pkg-config
+ USBUTILS_LIBS
+ linker flags for USBUTILS, overriding pkg-config
Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.
Report bugs to <linux-hotplug@vger.kernel.org>.
+udev home page: <http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html>.
_ACEOF
ac_status=$?
fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-udev configure 166
+udev configure 174
generated by GNU Autoconf 2.68
Copyright (C) 2010 Free Software Foundation, Inc.
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by udev $as_me 166, which was
+It was created by udev $as_me 174, which was
generated by GNU Autoconf 2.68. Invocation command line was
$ $0 $@
-am__api_version='1.11'
-
ac_aux_dir=
-for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
+for ac_dir in build-aux "$srcdir"/build-aux; do
if test -f "$ac_dir/install-sh"; then
ac_aux_dir=$ac_dir
ac_install_sh="$ac_aux_dir/install-sh -c"
fi
done
if test -z "$ac_aux_dir"; then
- as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
+ as_fn_error $? "cannot find install-sh, install.sh, or shtool in build-aux \"$srcdir\"/build-aux" "$LINENO" 5
fi
# These three variables are undocumented and unsupported,
ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
+am__api_version='1.11'
+
# Find a good install program. We prefer a C program (faster),
# so one script is as good as another. But avoid the broken or
# incompatible versions:
fi
rmdir .tst 2>/dev/null
+# Check whether --enable-silent-rules was given.
+if test "${enable_silent_rules+set}" = set; then :
+ enableval=$enable_silent_rules;
+fi
+
+case $enable_silent_rules in
+yes) AM_DEFAULT_VERBOSITY=0;;
+no) AM_DEFAULT_VERBOSITY=1;;
+*) AM_DEFAULT_VERBOSITY=1;;
+esac
+AM_BACKSLASH='\'
+
if test "`cd $srcdir && pwd`" != "`pwd`"; then
# Use -I$(srcdir) only when $(srcdir) != ., so that make's output
# is not polluted with repeated "-I."
# Define the identity of the package.
PACKAGE='udev'
- VERSION='166'
+ VERSION='174'
cat >>confdefs.h <<_ACEOF
AMTAR=${AMTAR-"${am_missing_run}tar"}
-am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to create a pax tar archive" >&5
+$as_echo_n "checking how to create a pax tar archive... " >&6; }
+# Loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar pax cpio none'
+_am_tools=${am_cv_prog_tar_pax-$_am_tools}
+# Do not fold the above two line into one, because Tru64 sh and
+# Solaris sh will not grok spaces in the rhs of `-'.
+for _am_tool in $_am_tools
+do
+ case $_am_tool in
+ gnutar)
+ for _am_tar in tar gnutar gtar;
+ do
+ { echo "$as_me:$LINENO: $_am_tar --version" >&5
+ ($_am_tar --version) >&5 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && break
+ done
+ am__tar="$_am_tar --format=posix -chf - "'"$$tardir"'
+ am__tar_="$_am_tar --format=posix -chf - "'"$tardir"'
+ am__untar="$_am_tar -xf -"
+ ;;
+ plaintar)
+ # Must skip GNU tar: if it does not support --format= it doesn't create
+ # ustar tarball either.
+ (tar --version) >/dev/null 2>&1 && continue
+ am__tar='tar chf - "$$tardir"'
+ am__tar_='tar chf - "$tardir"'
+ am__untar='tar xf -'
+ ;;
+ pax)
+ am__tar='pax -L -x pax -w "$$tardir"'
+ am__tar_='pax -L -x pax -w "$tardir"'
+ am__untar='pax -r'
+ ;;
+ cpio)
+ am__tar='find "$$tardir" -print | cpio -o -H pax -L'
+ am__tar_='find "$tardir" -print | cpio -o -H pax -L'
+ am__untar='cpio -i -H pax -d'
+ ;;
+ none)
+ am__tar=false
+ am__tar_=false
+ am__untar=false
+ ;;
+ esac
+ # If the value was cached, stop now. We just wanted to have am__tar
+ # and am__untar set.
+ test -n "${am_cv_prog_tar_pax}" && break
+ # tar/untar a dummy directory, and stop if the command works
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ echo GrepMe > conftest.dir/file
+ { echo "$as_me:$LINENO: tardir=conftest.dir && eval $am__tar_ >conftest.tar" >&5
+ (tardir=conftest.dir && eval $am__tar_ >conftest.tar) >&5 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+ rm -rf conftest.dir
+ if test -s conftest.tar; then
+ { echo "$as_me:$LINENO: $am__untar <conftest.tar" >&5
+ ($am__untar <conftest.tar) >&5 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+ grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+ fi
+done
+rm -rf conftest.dir
-# Check whether --enable-silent-rules was given.
-if test "${enable_silent_rules+set}" = set; then :
- enableval=$enable_silent_rules;
+if ${am_cv_prog_tar_pax+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ am_cv_prog_tar_pax=$_am_tool
fi
-case $enable_silent_rules in
-yes) AM_DEFAULT_VERBOSITY=0;;
-no) AM_DEFAULT_VERBOSITY=1;;
-*) AM_DEFAULT_VERBOSITY=0;;
-esac
-AM_BACKSLASH='\'
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_tar_pax" >&5
+$as_echo "$am_cv_prog_tar_pax" >&6; }
+
+
+
+
# Check whether --enable-static was given.
if test "${enable_static+set}" = set; then :
fi
+# Check whether --enable-silent-rules was given.
+if test "${enable_silent_rules+set}" = set; then :
+ enableval=$enable_silent_rules;
+fi
+
+case $enable_silent_rules in
+yes) AM_DEFAULT_VERBOSITY=0;;
+no) AM_DEFAULT_VERBOSITY=1;;
+*) AM_DEFAULT_VERBOSITY=0;;
+esac
+AM_BACKSLASH='\'
+
case `pwd` in
*\ * | *\ *)
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
-macro_version='2.2.6b'
-macro_revision='1.3017'
+macro_version='2.4'
+macro_revision='1.3293'
case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+# Backslashify metacharacters that are still active within
+# double-quoted strings.
+sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\(["`\\]\)/\\\1/g'
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to delay expansion of an escaped single quote.
+delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+
+ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5
+$as_echo_n "checking how to print strings... " >&6; }
+# Test print first, because it will be a builtin if present.
+if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
+ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+ ECHO='print -r --'
+elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+ ECHO='printf %s\n'
+else
+ # Use this function as a fallback that always works.
+ func_fallback_echo ()
+ {
+ eval 'cat <<_LTECHO_EOF
+$1
+_LTECHO_EOF'
+ }
+ ECHO='func_fallback_echo'
+fi
+
+# func_echo_all arg...
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+ $ECHO ""
+}
+
+case "$ECHO" in
+ printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5
+$as_echo "printf" >&6; } ;;
+ print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5
+$as_echo "print -r" >&6; } ;;
+ *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5
+$as_echo "cat" >&6; } ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
$as_echo_n "checking for a sed that does not truncate output... " >&6; }
if ${ac_cv_path_SED+:} false; then :
NM="$lt_cv_path_NM"
else
# Didn't find any BSD compatible name lister, look for dumpbin.
- if test -n "$ac_tool_prefix"; then
- for ac_prog in "dumpbin -symbols" "link -dump -symbols"
+ if test -n "$DUMPBIN"; then :
+ # Let the user override the test.
+ else
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in dumpbin "link -dump"
do
# Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
set dummy $ac_tool_prefix$ac_prog; ac_word=$2
fi
if test -z "$DUMPBIN"; then
ac_ct_DUMPBIN=$DUMPBIN
- for ac_prog in "dumpbin -symbols" "link -dump -symbols"
+ for ac_prog in dumpbin "link -dump"
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
fi
fi
+ case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
+ *COFF*)
+ DUMPBIN="$DUMPBIN -symbols"
+ ;;
+ *)
+ DUMPBIN=:
+ ;;
+ esac
+ fi
if test "$DUMPBIN" != ":"; then
NM="$DUMPBIN"
else
lt_cv_nm_interface="BSD nm"
echo "int some_variable = 0;" > conftest.$ac_ext
- (eval echo "\"\$as_me:5161: $ac_compile\"" >&5)
+ (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5)
(eval "$ac_compile" 2>conftest.err)
cat conftest.err >&5
- (eval echo "\"\$as_me:5164: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
+ (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
(eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
cat conftest.err >&5
- (eval echo "\"\$as_me:5167: output\"" >&5)
+ (eval echo "\"\$as_me:$LINENO: output\"" >&5)
cat conftest.out >&5
if $GREP 'External.*some_variable' conftest.out > /dev/null; then
lt_cv_nm_interface="MS dumpbin"
lt_cv_sys_max_cmd_len=8192;
;;
+ mint*)
+ # On MiNT this can take a long time and run out of memory.
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
amigaos*)
# On AmigaOS with pdksh, this test takes hours, literally.
# So we just punt and use a minimum line length of 8192.
# If test is not a shell built-in, we'll probably end up computing a
# maximum length that is only half of the actual maximum length, but
# we can't tell.
- while { test "X"`$SHELL $0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \
- = "XX$teststring$teststring"; } >/dev/null 2>&1 &&
+ while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \
+ = "X$teststring$teststring"; } >/dev/null 2>&1 &&
test $i != 17 # 1/2 MB should be enough
do
i=`expr $i + 1`
# Try some XSI features
xsi_shell=no
( _lt_dummy="a/b/c"
- test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
- = c,a/b,, \
+ test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
+ = c,a/b,b/c, \
&& eval 'test $(( 1 + 1 )) -eq 2 \
&& test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
&& xsi_shell=yes
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5
+$as_echo_n "checking how to convert $build file names to $host format... " >&6; }
+if ${lt_cv_to_host_file_cmd+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $host in
+ *-*-mingw* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
+ ;;
+ *-*-cygwin* )
+ lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
+ ;;
+ * ) # otherwise, assume *nix
+ lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
+ ;;
+ esac
+ ;;
+ *-*-cygwin* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
+ ;;
+ *-*-cygwin* )
+ lt_cv_to_host_file_cmd=func_convert_file_noop
+ ;;
+ * ) # otherwise, assume *nix
+ lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
+ ;;
+ esac
+ ;;
+ * ) # unhandled hosts (and "normal" native builds)
+ lt_cv_to_host_file_cmd=func_convert_file_noop
+ ;;
+esac
+
+fi
+
+to_host_file_cmd=$lt_cv_to_host_file_cmd
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5
+$as_echo "$lt_cv_to_host_file_cmd" >&6; }
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5
+$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; }
+if ${lt_cv_to_tool_file_cmd+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ #assume ordinary cross tools, or native build.
+lt_cv_to_tool_file_cmd=func_convert_file_noop
+case $host in
+ *-*-mingw* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
+ ;;
+ esac
+ ;;
+esac
+
+fi
+
+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5
+$as_echo "$lt_cv_to_tool_file_cmd" >&6; }
+
+
+
+
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
$as_echo_n "checking for $LD option to reload object files... " >&6; }
if ${lt_cv_ld_reload_flag+:} false; then :
esac
reload_cmds='$LD$reload_flag -o $output$reload_objs'
case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ if test "$GCC" != yes; then
+ reload_cmds=false
+ fi
+ ;;
darwin*)
if test "$GCC" = yes; then
reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
# Base MSYS/MinGW do not provide the 'file' command needed by
# func_win32_libid shell function, so use a weaker test based on 'objdump',
# unless we find 'file', for example because we are cross-compiling.
- if ( file / ) >/dev/null 2>&1; then
+ # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
+ if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
lt_cv_file_magic_cmd='func_win32_libid'
else
- lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+ # Keep this pattern in sync with the one in func_win32_libid.
+ lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
lt_cv_file_magic_cmd='$OBJDUMP -f'
fi
;;
-cegcc)
+cegcc*)
# use the weaker test based on 'objdump'. See mingw*.
lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
lt_cv_file_magic_cmd='$OBJDUMP -f'
lt_cv_deplibs_check_method=pass_all
;;
+haiku*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
hpux10.20* | hpux11*)
lt_cv_file_magic_cmd=/usr/bin/file
case $host_cpu in
lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
;;
hppa*64*)
- lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'
lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
;;
*)
- lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library'
lt_cv_file_magic_test_file=/usr/lib/libc.sl
;;
esac
;;
# This must be Linux ELF.
-linux* | k*bsd*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
lt_cv_deplibs_check_method=pass_all
;;
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
$as_echo "$lt_cv_deplibs_check_method" >&6; }
+
+file_magic_glob=
+want_nocaseglob=no
+if test "$build" = "$host"; then
+ case $host_os in
+ mingw* | pw32*)
+ if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
+ want_nocaseglob=yes
+ else
+ file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"`
+ fi
+ ;;
+ esac
+fi
+
file_magic_cmd=$lt_cv_file_magic_cmd
deplibs_check_method=$lt_cv_deplibs_check_method
test -z "$deplibs_check_method" && deplibs_check_method=unknown
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ar; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_AR+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$AR"; then
+
+
+
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
+set dummy ${ac_tool_prefix}dlltool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_DLLTOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$DLLTOOL"; then
+ ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+DLLTOOL=$ac_cv_prog_DLLTOOL
+if test -n "$DLLTOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
+$as_echo "$DLLTOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_DLLTOOL"; then
+ ac_ct_DLLTOOL=$DLLTOOL
+ # Extract the first word of "dlltool", so it can be a program name with args.
+set dummy dlltool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_DLLTOOL"; then
+ ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_DLLTOOL="dlltool"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
+if test -n "$ac_ct_DLLTOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
+$as_echo "$ac_ct_DLLTOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_DLLTOOL" = x; then
+ DLLTOOL="false"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ DLLTOOL=$ac_ct_DLLTOOL
+ fi
+else
+ DLLTOOL="$ac_cv_prog_DLLTOOL"
+fi
+
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5
+$as_echo_n "checking how to associate runtime and link libraries... " >&6; }
+if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_sharedlib_from_linklib_cmd='unknown'
+
+case $host_os in
+cygwin* | mingw* | pw32* | cegcc*)
+ # two different shell functions defined in ltmain.sh
+ # decide which to use based on capabilities of $DLLTOOL
+ case `$DLLTOOL --help 2>&1` in
+ *--identify-strict*)
+ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
+ ;;
+ *)
+ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
+ ;;
+ esac
+ ;;
+*)
+ # fallback: assume linklib IS sharedlib
+ lt_cv_sharedlib_from_linklib_cmd="$ECHO"
+ ;;
+esac
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5
+$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; }
+sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
+test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ for ac_prog in ar
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AR+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$AR"; then
ac_cv_prog_AR="$AR" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_AR="${ac_tool_prefix}ar"
+ ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
fi
+ test -n "$AR" && break
+ done
fi
-if test -z "$ac_cv_prog_AR"; then
+if test -z "$AR"; then
ac_ct_AR=$AR
- # Extract the first word of "ar", so it can be a program name with args.
-set dummy ar; ac_word=$2
+ for ac_prog in ar
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_ac_ct_AR+:} false; then :
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_AR="ar"
+ ac_cv_prog_ac_ct_AR="$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
$as_echo "no" >&6; }
fi
+
+ test -n "$ac_ct_AR" && break
+done
+
if test "x$ac_ct_AR" = x; then
AR="false"
else
esac
AR=$ac_ct_AR
fi
-else
- AR="$ac_cv_prog_AR"
fi
-test -z "$AR" && AR=ar
-test -z "$AR_FLAGS" && AR_FLAGS=cru
+: ${AR=ar}
+: ${AR_FLAGS=cru}
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5
+$as_echo_n "checking for archiver @FILE support... " >&6; }
+if ${lt_cv_ar_at_file+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_ar_at_file=no
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ echo conftest.$ac_objext > conftest.lst
+ lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
+ (eval $lt_ar_try) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ if test "$ac_status" -eq 0; then
+ # Ensure the archiver fails upon bogus file names.
+ rm -f conftest.$ac_objext libconftest.a
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
+ (eval $lt_ar_try) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ if test "$ac_status" -ne 0; then
+ lt_cv_ar_at_file=@
+ fi
+ fi
+ rm -f conftest.* libconftest.a
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
+$as_echo "$lt_cv_ar_at_file" >&6; }
+
+if test "x$lt_cv_ar_at_file" = xno; then
+ archiver_list_spec=
+else
+ archiver_list_spec=$lt_cv_ar_at_file
+fi
+
+
+
+
+
if test -n "$ac_tool_prefix"; then
old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
fi
+case $host_os in
+ darwin*)
+ lock_old_archive_extraction=yes ;;
+ *)
+ lock_old_archive_extraction=no ;;
+esac
+
+
+
+
+
+
lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
# Transform an extracted symbol line into symbol name and symbol address
-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'"
-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
# Handle CRLF in mingw tool chain
opt_cr=
else
lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
fi
+ lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
# Check to see that the pipe works correctly.
pipe_works=no
test $ac_status = 0; }; then
# Now try to grab the symbols.
nlist=conftest.nm
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\""; } >&5
- (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5
+ (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } && test -s "$nlist"; then
if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
cat <<_LT_EOF > conftest.$ac_ext
+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
+/* DATA imports from DLLs on WIN32 con't be const, because runtime
+ relocations are performed -- see ld's documentation on pseudo-relocs. */
+# define LT_DLSYM_CONST
+#elif defined(__osf__)
+/* This system does not cope well with relocations in const data. */
+# define LT_DLSYM_CONST
+#else
+# define LT_DLSYM_CONST const
+#endif
+
#ifdef __cplusplus
extern "C" {
#endif
cat <<_LT_EOF >> conftest.$ac_ext
/* The mapping between symbol names and symbols. */
-const struct {
+LT_DLSYM_CONST struct {
const char *name;
void *address;
}
_LT_EOF
# Now try linking the two files.
mv conftest.$ac_objext conftstm.$ac_objext
- lt_save_LIBS="$LIBS"
- lt_save_CFLAGS="$CFLAGS"
+ lt_globsym_save_LIBS=$LIBS
+ lt_globsym_save_CFLAGS=$CFLAGS
LIBS="conftstm.$ac_objext"
CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
test $ac_status = 0; } && test -s conftest${ac_exeext}; then
pipe_works=yes
fi
- LIBS="$lt_save_LIBS"
- CFLAGS="$lt_save_CFLAGS"
+ LIBS=$lt_globsym_save_LIBS
+ CFLAGS=$lt_globsym_save_CFLAGS
else
echo "cannot find nm_test_func in $nlist" >&5
fi
$as_echo "ok" >&6; }
fi
+# Response file support.
+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+ nm_file_list_spec='@'
+elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then
+ nm_file_list_spec='@'
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
+$as_echo_n "checking for sysroot... " >&6; }
+# Check whether --with-sysroot was given.
+if test "${with_sysroot+set}" = set; then :
+ withval=$with_sysroot;
+else
+ with_sysroot=no
+fi
+lt_sysroot=
+case ${with_sysroot} in #(
+ yes)
+ if test "$GCC" = yes; then
+ lt_sysroot=`$CC --print-sysroot 2>/dev/null`
+ fi
+ ;; #(
+ /*)
+ lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
+ ;; #(
+ no|'')
+ ;; #(
+ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5
+$as_echo "${with_sysroot}" >&6; }
+ as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5
+ ;;
+esac
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5
+$as_echo "${lt_sysroot:-no}" >&6; }
;;
*-*-irix6*)
# Find out which ABI we are using.
- echo '#line 6372 "configure"' > conftest.$ac_ext
+ echo '#line '$LINENO' "configure"' > conftest.$ac_ext
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
(eval $ac_compile) 2>&5
ac_status=$?
need_locks="$enable_libtool_lock"
-
- case $host_os in
- rhapsody* | darwin*)
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args.
-set dummy ${ac_tool_prefix}dsymutil; ac_word=$2
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
+set dummy ${ac_tool_prefix}mt; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_DSYMUTIL+:} false; then :
+if ${ac_cv_prog_MANIFEST_TOOL+:} false; then :
$as_echo_n "(cached) " >&6
else
- if test -n "$DSYMUTIL"; then
- ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test.
+ if test -n "$MANIFEST_TOOL"; then
+ ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"
+ ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
fi
fi
-DSYMUTIL=$ac_cv_prog_DSYMUTIL
-if test -n "$DSYMUTIL"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5
-$as_echo "$DSYMUTIL" >&6; }
+MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL
+if test -n "$MANIFEST_TOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5
+$as_echo "$MANIFEST_TOOL" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
-if test -z "$ac_cv_prog_DSYMUTIL"; then
- ac_ct_DSYMUTIL=$DSYMUTIL
- # Extract the first word of "dsymutil", so it can be a program name with args.
-set dummy dsymutil; ac_word=$2
+if test -z "$ac_cv_prog_MANIFEST_TOOL"; then
+ ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL
+ # Extract the first word of "mt", so it can be a program name with args.
+set dummy mt; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then :
+if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then :
$as_echo_n "(cached) " >&6
else
- if test -n "$ac_ct_DSYMUTIL"; then
- ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test.
+ if test -n "$ac_ct_MANIFEST_TOOL"; then
+ ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_DSYMUTIL="dsymutil"
+ ac_cv_prog_ac_ct_MANIFEST_TOOL="mt"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
fi
fi
-ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL
-if test -n "$ac_ct_DSYMUTIL"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5
-$as_echo "$ac_ct_DSYMUTIL" >&6; }
+ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL
+if test -n "$ac_ct_MANIFEST_TOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5
+$as_echo "$ac_ct_MANIFEST_TOOL" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
- if test "x$ac_ct_DSYMUTIL" = x; then
- DSYMUTIL=":"
+ if test "x$ac_ct_MANIFEST_TOOL" = x; then
+ MANIFEST_TOOL=":"
else
case $cross_compiling:$ac_tool_warned in
yes:)
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
- DSYMUTIL=$ac_ct_DSYMUTIL
+ MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL
fi
else
- DSYMUTIL="$ac_cv_prog_DSYMUTIL"
+ MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL"
+fi
+
+test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5
+$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; }
+if ${lt_cv_path_mainfest_tool+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_path_mainfest_tool=no
+ echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5
+ $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
+ cat conftest.err >&5
+ if $GREP 'Manifest Tool' conftest.out > /dev/null; then
+ lt_cv_path_mainfest_tool=yes
+ fi
+ rm -f conftest*
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
+$as_echo "$lt_cv_path_mainfest_tool" >&6; }
+if test "x$lt_cv_path_mainfest_tool" != xyes; then
+ MANIFEST_TOOL=:
+fi
+
+
+
+
+
+ case $host_os in
+ rhapsody* | darwin*)
if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args.
-set dummy ${ac_tool_prefix}nmedit; ac_word=$2
+ # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args.
+set dummy ${ac_tool_prefix}dsymutil; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_NMEDIT+:} false; then :
+if ${ac_cv_prog_DSYMUTIL+:} false; then :
$as_echo_n "(cached) " >&6
else
- if test -n "$NMEDIT"; then
- ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test.
+ if test -n "$DSYMUTIL"; then
+ ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit"
+ ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
fi
fi
-NMEDIT=$ac_cv_prog_NMEDIT
-if test -n "$NMEDIT"; then
+DSYMUTIL=$ac_cv_prog_DSYMUTIL
+if test -n "$DSYMUTIL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5
+$as_echo "$DSYMUTIL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_DSYMUTIL"; then
+ ac_ct_DSYMUTIL=$DSYMUTIL
+ # Extract the first word of "dsymutil", so it can be a program name with args.
+set dummy dsymutil; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_DSYMUTIL"; then
+ ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_DSYMUTIL="dsymutil"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL
+if test -n "$ac_ct_DSYMUTIL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5
+$as_echo "$ac_ct_DSYMUTIL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_DSYMUTIL" = x; then
+ DSYMUTIL=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ DSYMUTIL=$ac_ct_DSYMUTIL
+ fi
+else
+ DSYMUTIL="$ac_cv_prog_DSYMUTIL"
+fi
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args.
+set dummy ${ac_tool_prefix}nmedit; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_NMEDIT+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$NMEDIT"; then
+ ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+NMEDIT=$ac_cv_prog_NMEDIT
+if test -n "$NMEDIT"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5
$as_echo "$NMEDIT" >&6; }
else
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5
$as_echo "$lt_cv_ld_exported_symbols_list" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5
+$as_echo_n "checking for -force_load linker flag... " >&6; }
+if ${lt_cv_ld_force_load+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_ld_force_load=no
+ cat > conftest.c << _LT_EOF
+int forced_loaded() { return 2;}
+_LT_EOF
+ echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5
+ $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
+ echo "$AR cru libconftest.a conftest.o" >&5
+ $AR cru libconftest.a conftest.o 2>&5
+ echo "$RANLIB libconftest.a" >&5
+ $RANLIB libconftest.a 2>&5
+ cat > conftest.c << _LT_EOF
+int main() { return 0;}
+_LT_EOF
+ echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5
+ $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
+ _lt_result=$?
+ if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then
+ lt_cv_ld_force_load=yes
+ else
+ cat conftest.err >&5
+ fi
+ rm -f conftest.err libconftest.a conftest conftest.c
+ rm -rf conftest.dSYM
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5
+$as_echo "$lt_cv_ld_force_load" >&6; }
case $host_os in
rhapsody* | darwin1.[012])
_lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
else
_lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
fi
- if test "$DSYMUTIL" != ":"; then
+ if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
_lt_dsymutil='~$DSYMUTIL $lib || :'
else
_lt_dsymutil=
+
+
# Set options
+
test -z "$LN_S" && LN_S="ln -s"
-
-
-
-
-
-
-
-
-
-
-
-
-
case $host_os in
aix3*)
# AIX sometimes has problems with the GCC collect2 program. For some
;;
esac
-# Sed substitution that helps us do robust quoting. It backslashifies
-# metacharacters that are still active within double-quoted strings.
-sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
-
-# Same as above, but do not quote variable references.
-double_quote_subst='s/\(["`\\]\)/\\\1/g'
-
-# Sed substitution to delay expansion of an escaped shell variable in a
-# double_quote_subst'ed string.
-delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
-
-# Sed substitution to delay expansion of an escaped single quote.
-delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
-
-# Sed substitution to avoid accidental globbing in evaled expressions
-no_glob_subst='s/\*/\\\*/g'
-
# Global variables:
ofile=libtool
can_build_shared=yes
*) break;;
esac
done
-cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
# Only perform the check for file, if the check method requires it
lt_prog_compiler_no_builtin_flag=
if test "$GCC" = yes; then
- lt_prog_compiler_no_builtin_flag=' -fno-builtin'
+ case $cc_basename in
+ nvcc*)
+ lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;;
+ *)
+ lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;;
+ esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; }
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:7604: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:7608: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
- $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
$SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
lt_cv_prog_compiler_rtti_exceptions=yes
lt_prog_compiler_pic=
lt_prog_compiler_static=
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
-$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
if test "$GCC" = yes; then
lt_prog_compiler_wl='-Wl,'
lt_prog_compiler_pic='-fno-common'
;;
+ haiku*)
+ # PIC is the default for Haiku.
+ # The "-static" flag exists, but is broken.
+ lt_prog_compiler_static=
+ ;;
+
hpux*)
# PIC is the default for 64-bit PA HP-UX, but not for 32-bit
# PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
lt_prog_compiler_pic='-fPIC'
;;
esac
+
+ case $cc_basename in
+ nvcc*) # Cuda Compiler Driver 2.2
+ lt_prog_compiler_wl='-Xlinker '
+ lt_prog_compiler_pic='-Xcompiler -fPIC'
+ ;;
+ esac
else
# PORTME Check for flag to pass linker flags through the system compiler.
case $host_os in
lt_prog_compiler_static='-non_shared'
;;
- linux* | k*bsd*-gnu)
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
case $cc_basename in
# old Intel for x86_64 which still supported -KPIC.
ecc*)
lt_prog_compiler_pic='--shared'
lt_prog_compiler_static='--static'
;;
- pgcc* | pgf77* | pgf90* | pgf95*)
+ nagfor*)
+ # NAG Fortran compiler
+ lt_prog_compiler_wl='-Wl,-Wl,,'
+ lt_prog_compiler_pic='-PIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+ pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
# Portland Group compilers (*not* the Pentium gcc compiler,
# which looks to be a dead project)
lt_prog_compiler_wl='-Wl,'
# All Alpha code is PIC.
lt_prog_compiler_static='-non_shared'
;;
- xl*)
- # IBM XL C 8.0/Fortran 10.1 on PPC
+ xl* | bgxl* | bgf* | mpixl*)
+ # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
lt_prog_compiler_wl='-Wl,'
lt_prog_compiler_pic='-qpic'
lt_prog_compiler_static='-qstaticlink'
;;
*)
case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*)
- # Sun C 5.9
+ *Sun\ F* | *Sun*Fortran*)
+ # Sun Fortran 8.3 passes all unrecognized flags to the linker
lt_prog_compiler_pic='-KPIC'
lt_prog_compiler_static='-Bstatic'
- lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_wl=''
;;
- *Sun\ F*)
- # Sun Fortran 8.3 passes all unrecognized flags to the linker
+ *Sun\ C*)
+ # Sun C 5.9
lt_prog_compiler_pic='-KPIC'
lt_prog_compiler_static='-Bstatic'
- lt_prog_compiler_wl=''
+ lt_prog_compiler_wl='-Wl,'
;;
esac
;;
lt_prog_compiler_pic='-KPIC'
lt_prog_compiler_static='-Bstatic'
case $cc_basename in
- f77* | f90* | f95*)
+ f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
lt_prog_compiler_wl='-Qoption ld ';;
*)
lt_prog_compiler_wl='-Wl,';;
lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
;;
esac
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5
-$as_echo "$lt_prog_compiler_pic" >&6; }
-
-
-
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+if ${lt_cv_prog_compiler_pic+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_pic=$lt_prog_compiler_pic
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
+$as_echo "$lt_cv_prog_compiler_pic" >&6; }
+lt_prog_compiler_pic=$lt_cv_prog_compiler_pic
#
# Check to make sure the PIC flag actually works.
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:7943: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:7947: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
- $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
$SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
lt_cv_prog_compiler_pic_works=yes
+
+
+
+
+
#
# Check to make sure the static flag actually works.
#
if test -s conftest.err; then
# Append any errors to the config.log.
cat conftest.err 1>&5
- $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
+ $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
$SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
if diff conftest.exp conftest.er2 >/dev/null; then
lt_cv_prog_compiler_static_works=yes
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:8048: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:8052: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
- $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
$SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
lt_cv_prog_compiler_c_o=yes
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:8103: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:8107: \$? = $ac_status" >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
- $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
$SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
lt_cv_prog_compiler_c_o=yes
esac
ld_shlibs=yes
+
+ # On some targets, GNU ld is compatible enough with the native linker
+ # that we're better off using the native interface for both.
+ lt_use_gnu_ld_interface=no
if test "$with_gnu_ld" = yes; then
+ case $host_os in
+ aix*)
+ # The AIX port of GNU ld has always aspired to compatibility
+ # with the native linker. However, as the warning in the GNU ld
+ # block says, versions before 2.19.5* couldn't really create working
+ # shared libraries, regardless of the interface used.
+ case `$LD -v 2>&1` in
+ *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
+ *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;;
+ *\ \(GNU\ Binutils\)\ [3-9]*) ;;
+ *)
+ lt_use_gnu_ld_interface=yes
+ ;;
+ esac
+ ;;
+ *)
+ lt_use_gnu_ld_interface=yes
+ ;;
+ esac
+ fi
+
+ if test "$lt_use_gnu_ld_interface" = yes; then
# If archive_cmds runs LD, not CC, wlarc should be empty
wlarc='${wl}'
fi
supports_anon_versioning=no
case `$LD -v 2>&1` in
+ *GNU\ gold*) supports_anon_versioning=yes ;;
*\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
*\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
*\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
ld_shlibs=no
cat <<_LT_EOF 1>&2
-*** Warning: the GNU linker, at least up to release 2.9.1, is reported
+*** Warning: the GNU linker, at least up to release 2.19, is reported
*** to be unable to reliably create shared libraries on AIX.
*** Therefore, libtool is disabling shared libraries support. If you
-*** really care for shared libraries, you may want to modify your PATH
-*** so that a non-GNU linker is found, and then restart.
+*** really care for shared libraries, you may want to install binutils
+*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
+*** You will then need to restart the configuration process.
_LT_EOF
fi
# _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
# as there is no search path for DLLs.
hardcode_libdir_flag_spec='-L$libdir'
+ export_dynamic_flag_spec='${wl}--export-all-symbols'
allow_undefined_flag=unsupported
always_export_symbols=no
enable_shared_with_static_runtimes=yes
- export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
+ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
+ exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
fi
;;
+ haiku*)
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ link_all_deplibs=yes
+ ;;
+
interix[3-9]*)
hardcode_direct=no
hardcode_shlibpath_var=no
archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
;;
- gnu* | linux* | tpf* | k*bsd*-gnu)
+ gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
tmp_diet=no
if test "$host_os" = linux-dietlibc; then
case $cc_basename in
if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
&& test "$tmp_diet" = no
then
- tmp_addflag=
+ tmp_addflag=' $pic_flag'
tmp_sharedflag='-shared'
case $cc_basename,$host_cpu in
pgcc*) # Portland Group C compiler
- whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+ whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
tmp_addflag=' $pic_flag'
;;
- pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers
- whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+ pgf77* | pgf90* | pgf95* | pgfortran*)
+ # Portland Group f77 and f90 compilers
+ whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
tmp_addflag=' $pic_flag -Mnomain' ;;
ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
tmp_addflag=' -i_dynamic' ;;
lf95*) # Lahey Fortran 8.1
whole_archive_flag_spec=
tmp_sharedflag='--shared' ;;
- xl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
+ xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
tmp_sharedflag='-qmkshrobj'
tmp_addflag= ;;
+ nvcc*) # Cuda Compiler Driver 2.2
+ whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ compiler_needs_object=yes
+ ;;
esac
case `$CC -V 2>&1 | sed 5q` in
*Sun\ C*) # Sun C 5.9
- whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+ whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
compiler_needs_object=yes
tmp_sharedflag='-G' ;;
*Sun\ F*) # Sun Fortran 8.3
fi
case $cc_basename in
- xlf*)
+ xlf* | bgf* | bgxlf* | mpixlf*)
# IBM XL Fortran 10.1 on PPC cannot create shared libs itself
whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
hardcode_libdir_flag_spec=
hardcode_libdir_flag_spec_ld='-rpath $libdir'
- archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
+ archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
if test "x$supports_anon_versioning" = xyes; then
archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
echo "local: *; };" >> $output_objdir/$libname.ver~
- $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
fi
;;
esac
archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
wlarc=
else
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
fi
;;
_LT_EOF
elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
else
ld_shlibs=no
fi
*)
if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
else
ld_shlibs=no
fi
else
# If we're using GNU nm, then we don't want the "-C" option.
# -C means demangle to AIX nm, but means don't demangle with GNU nm
+ # Also, AIX nm treats weak defined symbols like other global
+ # defined symbols, whereas GNU nm marks them as "W".
if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
- export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
else
export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
fi
allow_undefined_flag='-berok'
# Determine the default libpath from the value encoded in an
# empty executable.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ if test "${lt_cv_aix_libpath+set}" = set; then
+ aix_libpath=$lt_cv_aix_libpath
+else
+ if ${lt_cv_aix_libpath_+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
-lt_aix_libpath_sed='
- /Import File Strings/,/^$/ {
- /^0/ {
- s/^0 *\(.*\)$/\1/
- p
- }
- }'
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then
- aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-fi
+ lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\([^ ]*\) *$/\1/
+ p
+ }
+ }'
+ lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ # Check for a 64-bit object if we didn't find anything.
+ if test -z "$lt_cv_aix_libpath_"; then
+ lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ fi
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ if test -z "$lt_cv_aix_libpath_"; then
+ lt_cv_aix_libpath_="/usr/lib:/lib"
+ fi
+
+fi
+
+ aix_libpath=$lt_cv_aix_libpath_
+fi
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
- archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
else
if test "$host_cpu" = ia64; then
hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
else
# Determine the default libpath from the value encoded in an
# empty executable.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ if test "${lt_cv_aix_libpath+set}" = set; then
+ aix_libpath=$lt_cv_aix_libpath
+else
+ if ${lt_cv_aix_libpath_+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
-lt_aix_libpath_sed='
- /Import File Strings/,/^$/ {
- /^0/ {
- s/^0 *\(.*\)$/\1/
- p
- }
- }'
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then
- aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-fi
+ lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\([^ ]*\) *$/\1/
+ p
+ }
+ }'
+ lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ # Check for a 64-bit object if we didn't find anything.
+ if test -z "$lt_cv_aix_libpath_"; then
+ lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ fi
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ if test -z "$lt_cv_aix_libpath_"; then
+ lt_cv_aix_libpath_="/usr/lib:/lib"
+ fi
+
+fi
+
+ aix_libpath=$lt_cv_aix_libpath_
+fi
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
# Warning - without using the other run time loading flags,
# -berok will link without error, but may produce a broken library.
no_undefined_flag=' ${wl}-bernotok'
allow_undefined_flag=' ${wl}-berok'
- # Exported symbols can be pulled into shared objects from archives
- whole_archive_flag_spec='$convenience'
+ if test "$with_gnu_ld" = yes; then
+ # We only use this code for GNU lds that support --whole-archive.
+ whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ else
+ # Exported symbols can be pulled into shared objects from archives
+ whole_archive_flag_spec='$convenience'
+ fi
archive_cmds_need_lc=yes
# This is similar to how AIX traditionally builds its shared libraries.
archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
# Microsoft Visual C++.
# hardcode_libdir_flag_spec is actually meaningless, as there is
# no search path for DLLs.
- hardcode_libdir_flag_spec=' '
- allow_undefined_flag=unsupported
- # Tell ltmain to make .lib files, not .a files.
- libext=lib
- # Tell ltmain to make .dll files, not .so files.
- shrext_cmds=".dll"
- # FIXME: Setting linknames here is a bad hack.
- archive_cmds='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames='
- # The linker will automatically build a .lib file if we build a DLL.
- old_archive_from_new_cmds='true'
- # FIXME: Should let the user specify the lib program.
- old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
- fix_srcfile_path='`cygpath -w "$srcfile"`'
- enable_shared_with_static_runtimes=yes
+ case $cc_basename in
+ cl*)
+ # Native MSVC
+ hardcode_libdir_flag_spec=' '
+ allow_undefined_flag=unsupported
+ always_export_symbols=yes
+ file_list_spec='@'
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
+ archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+ else
+ sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+ fi~
+ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+ linknames='
+ # The linker will not automatically build a static lib if we build a DLL.
+ # _LT_TAGVAR(old_archive_from_new_cmds, )='true'
+ enable_shared_with_static_runtimes=yes
+ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
+ # Don't use ranlib
+ old_postinstall_cmds='chmod 644 $oldlib'
+ postlink_cmds='lt_outputfile="@OUTPUT@"~
+ lt_tool_outputfile="@TOOL_OUTPUT@"~
+ case $lt_outputfile in
+ *.exe|*.EXE) ;;
+ *)
+ lt_outputfile="$lt_outputfile.exe"
+ lt_tool_outputfile="$lt_tool_outputfile.exe"
+ ;;
+ esac~
+ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
+ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+ $RM "$lt_outputfile.manifest";
+ fi'
+ ;;
+ *)
+ # Assume MSVC wrapper
+ hardcode_libdir_flag_spec=' '
+ allow_undefined_flag=unsupported
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+ # The linker will automatically build a .lib file if we build a DLL.
+ old_archive_from_new_cmds='true'
+ # FIXME: Should let the user specify the lib program.
+ old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
+ enable_shared_with_static_runtimes=yes
+ ;;
+ esac
;;
darwin* | rhapsody*)
hardcode_direct=no
hardcode_automatic=yes
hardcode_shlibpath_var=unsupported
- whole_archive_flag_spec=''
+ if test "$lt_cv_ld_force_load" = "yes"; then
+ whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+ else
+ whole_archive_flag_spec=''
+ fi
link_all_deplibs=yes
allow_undefined_flag="$_lt_dar_allow_undefined"
case $cc_basename in
*) _lt_dar_can_shared=$GCC ;;
esac
if test "$_lt_dar_can_shared" = "yes"; then
- output_verbose_link_cmd=echo
+ output_verbose_link_cmd=func_echo_all
archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
# FreeBSD 3 and greater uses gcc -shared to do shared libraries.
freebsd* | dragonfly*)
- archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
hardcode_libdir_flag_spec='-R$libdir'
hardcode_direct=yes
hardcode_shlibpath_var=no
hpux9*)
if test "$GCC" = yes; then
- archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
else
archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
fi
;;
hpux10*)
- if test "$GCC" = yes -a "$with_gnu_ld" = no; then
- archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+ archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
else
archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
fi
;;
hpux11*)
- if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+ if test "$GCC" = yes && test "$with_gnu_ld" = no; then
case $host_cpu in
hppa*64*)
archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
;;
ia64*)
- archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
;;
*)
- archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
;;
esac
else
archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
;;
*)
- archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+
+ # Older versions of the 11.00 compiler do not understand -b yet
+ # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5
+$as_echo_n "checking if $CC understands -b... " >&6; }
+if ${lt_cv_prog_compiler__b+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler__b=no
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -b"
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The linker can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&5
+ $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler__b=yes
+ fi
+ else
+ lt_cv_prog_compiler__b=yes
+ fi
+ fi
+ $RM -r conftest*
+ LDFLAGS="$save_LDFLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5
+$as_echo "$lt_cv_prog_compiler__b" >&6; }
+
+if test x"$lt_cv_prog_compiler__b" = xyes; then
+ archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+else
+ archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+fi
+
;;
esac
fi
irix5* | irix6* | nonstopux*)
if test "$GCC" = yes; then
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
# Try to use the -exported_symbol ld option, if it does not
# work, assume that -exports_file does not work either and
# implicitly export all symbols.
- save_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ # This should be the same for all languages, so no per-tag cache variable.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
+$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
+if ${lt_cv_irix_exported_symbol+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-int foo(void) {}
+int foo (void) { return 0; }
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
-
+ lt_cv_irix_exported_symbol=yes
+else
+ lt_cv_irix_exported_symbol=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
- LDFLAGS="$save_LDFLAGS"
+ LDFLAGS="$save_LDFLAGS"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
+$as_echo "$lt_cv_irix_exported_symbol" >&6; }
+ if test "$lt_cv_irix_exported_symbol" = yes; then
+ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+ fi
else
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
fi
archive_cmds_need_lc='no'
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
hardcode_libdir_flag_spec='-L$libdir'
hardcode_minus_L=yes
allow_undefined_flag=unsupported
- archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+ archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
;;
osf3*)
if test "$GCC" = yes; then
allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
else
allow_undefined_flag=' -expect_unresolved \*'
- archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+ archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
fi
archive_cmds_need_lc='no'
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
osf4* | osf5*) # as osf3* with the addition of -msym flag
if test "$GCC" = yes; then
allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
else
allow_undefined_flag=' -expect_unresolved \*'
- archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+ archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
- $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
+ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
# Both c and cxx compiler support -rpath directly
hardcode_libdir_flag_spec='-rpath $libdir'
no_undefined_flag=' -z defs'
if test "$GCC" = yes; then
wlarc='${wl}'
- archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
- $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
else
case `$CC -V 2>&1` in
*"Compilers 5.0"*)
# to ld, don't add -lc before -lgcc.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
- $RM conftest*
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+if ${lt_cv_archive_cmds_need_lc+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ $RM conftest*
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
(eval $ac_compile) 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } 2>conftest.err; then
- soname=conftest
- lib=conftest
- libobjs=conftest.$ac_objext
- deplibs=
- wl=$lt_prog_compiler_wl
- pic_flag=$lt_prog_compiler_pic
- compiler_flags=-v
- linker_flags=-v
- verstring=
- output_objdir=.
- libname=conftest
- lt_save_allow_undefined_flag=$allow_undefined_flag
- allow_undefined_flag=
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
+ soname=conftest
+ lib=conftest
+ libobjs=conftest.$ac_objext
+ deplibs=
+ wl=$lt_prog_compiler_wl
+ pic_flag=$lt_prog_compiler_pic
+ compiler_flags=-v
+ linker_flags=-v
+ verstring=
+ output_objdir=.
+ libname=conftest
+ lt_save_allow_undefined_flag=$allow_undefined_flag
+ allow_undefined_flag=
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
(eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
- then
- archive_cmds_need_lc=no
- else
- archive_cmds_need_lc=yes
- fi
- allow_undefined_flag=$lt_save_allow_undefined_flag
- else
- cat conftest.err 1>&5
- fi
- $RM conftest*
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $archive_cmds_need_lc" >&5
-$as_echo "$archive_cmds_need_lc" >&6; }
+ then
+ lt_cv_archive_cmds_need_lc=no
+ else
+ lt_cv_archive_cmds_need_lc=yes
+ fi
+ allow_undefined_flag=$lt_save_allow_undefined_flag
+ else
+ cat conftest.err 1>&5
+ fi
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5
+$as_echo "$lt_cv_archive_cmds_need_lc" >&6; }
+ archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc
;;
esac
fi
darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
*) lt_awk_arg="/^libraries:/" ;;
esac
- lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
- if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then
+ case $host_os in
+ mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;;
+ *) lt_sed_strip_eq="s,=/,/,g" ;;
+ esac
+ lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
+ case $lt_search_path_spec in
+ *\;*)
# if the path contains ";" then we assume it to be the separator
# otherwise default to the standard path separator (i.e. ":") - it is
# assumed that no part of a normal pathname contains ";" but that should
# okay in the real world where ";" in dirpaths is itself problematic.
- lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'`
- else
- lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- fi
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
+ ;;
+ *)
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
+ ;;
+ esac
# Ok, now we have the path, separated by spaces, we can step through it
# and add multilib dir if necessary.
lt_tmp_lt_search_path_spec=
lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
fi
done
- lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk '
+ lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
BEGIN {RS=" "; FS="/|\n";} {
lt_foo="";
lt_count=0;
if (lt_foo != "") { lt_freq[lt_foo]++; }
if (lt_freq[lt_foo] == 1) { print lt_foo; }
}'`
- sys_lib_search_path_spec=`$ECHO $lt_search_path_spec`
+ # AWK program above erroneously prepends '/' to C:/dos/paths
+ # for these hosts.
+ case $host_os in
+ mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
+ $SED 's,/\([A-Za-z]:\),\1,g'` ;;
+ esac
+ sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
else
sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
fi
m68k)
library_names_spec='$libname.ixlibrary $libname.a'
# Create ${libname}_ixlibrary.a entries in /sys/libs.
- finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
;;
esac
;;
need_version=no
need_lib_prefix=no
- case $GCC,$host_os in
- yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
+ case $GCC,$cc_basename in
+ yes,*)
+ # gcc
library_names_spec='$libname.dll.a'
# DLL is installed to $(libdir)/../bin by postinstall_cmds
postinstall_cmds='base_file=`basename \${file}`~
cygwin*)
# Cygwin DLLs use 'cyg' prefix rather than 'lib'
soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"
;;
mingw* | cegcc*)
# MinGW DLLs use traditional 'lib' prefix
soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
- if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
- # It is most probably a Windows format PATH printed by
- # mingw gcc, but we are running on Cygwin. Gcc prints its search
- # path with ; separators, and with drive letters. We can handle the
- # drive letters (cygwin fileutils understands them), so leave them,
- # especially as we might pass files found there to a mingw objdump,
- # which wouldn't understand a cygwinified path. Ahh.
- sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
- else
- sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- fi
;;
pw32*)
# pw32 DLLs use 'pw' prefix rather than 'lib'
library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
;;
esac
+ dynamic_linker='Win32 ld.exe'
+ ;;
+
+ *,cl*)
+ # Native MSVC
+ libname_spec='$name'
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ library_names_spec='${libname}.dll.lib'
+
+ case $build_os in
+ mingw*)
+ sys_lib_search_path_spec=
+ lt_save_ifs=$IFS
+ IFS=';'
+ for lt_path in $LIB
+ do
+ IFS=$lt_save_ifs
+ # Let DOS variable expansion print the short 8.3 style file name.
+ lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
+ sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
+ done
+ IFS=$lt_save_ifs
+ # Convert to MSYS style.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
+ ;;
+ cygwin*)
+ # Convert to unix form, then to dos form, then back to unix form
+ # but this time dos style (no spaces!) so that the unix form looks
+ # like /cygdrive/c/PROGRA~1:/cygdr...
+ sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
+ sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
+ sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ ;;
+ *)
+ sys_lib_search_path_spec="$LIB"
+ if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
+ # It is most probably a Windows format PATH.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ # FIXME: find the short name or the path components, as spaces are
+ # common. (e.g. "Program Files" -> "PROGRA~1")
+ ;;
+ esac
+
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ shlibpath_overrides_runpath=yes
+ dynamic_linker='Win32 link.exe'
;;
*)
+ # Assume MSVC wrapper
library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+ dynamic_linker='Win32 ld.exe'
;;
esac
- dynamic_linker='Win32 ld.exe'
# FIXME: first we should search . and the directory the executable is in
shlibpath_var=PATH
;;
hardcode_into_libs=yes
;;
+haiku*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ dynamic_linker="$host_os runtime_loader"
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+ hardcode_into_libs=yes
+ ;;
+
hpux9* | hpux10* | hpux11*)
# Give a soname corresponding to the major version so that dld.sl refuses to
# link against other versions.
soname_spec='${libname}${release}${shared_ext}$major'
;;
esac
- # HP-UX runs *really* slowly unless shared libraries are mode 555.
+ # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
postinstall_cmds='chmod 555 $lib'
+ # or fails outright, so override atomically:
+ install_override_mode=555
;;
interix[3-9]*)
;;
# This must be Linux ELF.
-linux* | k*bsd*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
version_type=linux
need_lib_prefix=no
need_version=no
finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=no
+
# Some binutils ld are patched to set DT_RUNPATH
- save_LDFLAGS=$LDFLAGS
- save_libdir=$libdir
- eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \
- LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\""
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ if ${lt_cv_shlibpath_overrides_runpath+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_shlibpath_overrides_runpath=no
+ save_LDFLAGS=$LDFLAGS
+ save_libdir=$libdir
+ eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \
+ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\""
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
- shlibpath_overrides_runpath=yes
+ lt_cv_shlibpath_overrides_runpath=yes
fi
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
- LDFLAGS=$save_LDFLAGS
- libdir=$save_libdir
+ LDFLAGS=$save_LDFLAGS
+ libdir=$save_libdir
+
+fi
+
+ shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
# This implies no fast_install, which is unacceptable.
# Some rework will be needed to allow for fast_install
# before this can be enabled.
hardcode_into_libs=yes
+ # Add ABI-specific directories to the system library path.
+ sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib"
+
# Append ld.so.conf contents to the search path
if test -f /etc/ld.so.conf; then
- lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
- sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+ sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
+
fi
# We used to test for /lib/ld.so.1 and disable shared libraries on
+
+
+
+
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
hardcode_action=
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 10470 "configure"
+#line $LINENO "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
# endif
#endif
-void fnord() { int i=42;}
+/* When -fvisbility=hidden is used, assume the code has been annotated
+ correspondingly for the symbols needed. */
+#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+int fnord () __attribute__((visibility("default")));
+#endif
+
+int fnord () { return 42; }
int main ()
{
void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
if (self)
{
if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
- else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ else
+ {
+ if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ else puts (dlerror ());
+ }
/* dlclose (self); */
}
else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 10566 "configure"
+#line $LINENO "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
# endif
#endif
-void fnord() { int i=42;}
+/* When -fvisbility=hidden is used, assume the code has been annotated
+ correspondingly for the symbols needed. */
+#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+int fnord () __attribute__((visibility("default")));
+#endif
+
+int fnord () { return 42; }
int main ()
{
void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
if (self)
{
if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
- else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ else
+ {
+ if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ else puts (dlerror ());
+ }
/* dlclose (self); */
}
else
fi
+
# Extract the first word of "gtkdoc-check", so it can be a program name with args.
set dummy gtkdoc-check; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
else
as_fn_error $? "You need to have gtk-doc >= 1.10 installed to build $PACKAGE_NAME" "$LINENO" 5
fi
+ if test "x$PACKAGE_NAME" != "xglib"; then
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GTKDOC_DEPS" >&5
+$as_echo_n "checking for GTKDOC_DEPS... " >&6; }
+
+if test -n "$GTKDOC_DEPS_CFLAGS"; then
+ pkg_cv_GTKDOC_DEPS_CFLAGS="$GTKDOC_DEPS_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_GTKDOC_DEPS_CFLAGS=`$PKG_CONFIG --cflags "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0" 2>/dev/null`
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+if test -n "$GTKDOC_DEPS_LIBS"; then
+ pkg_cv_GTKDOC_DEPS_LIBS="$GTKDOC_DEPS_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_GTKDOC_DEPS_LIBS=`$PKG_CONFIG --libs "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0" 2>/dev/null`
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi
+ if test $_pkg_short_errors_supported = yes; then
+ GTKDOC_DEPS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0" 2>&1`
+ else
+ GTKDOC_DEPS_PKG_ERRORS=`$PKG_CONFIG --print-errors "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$GTKDOC_DEPS_PKG_ERRORS" >&5
+
+ as_fn_error $? "Package requirements (glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0) were not met:
+
+$GTKDOC_DEPS_PKG_ERRORS
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+Alternatively, you may set the environment variables GTKDOC_DEPS_CFLAGS
+and GTKDOC_DEPS_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details." "$LINENO" 5
+
+elif test $pkg_failed = untried; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+Alternatively, you may set the environment variables GTKDOC_DEPS_CFLAGS
+and GTKDOC_DEPS_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details" "$LINENO" 5; }
+
+else
+ GTKDOC_DEPS_CFLAGS=$pkg_cv_GTKDOC_DEPS_CFLAGS
+ GTKDOC_DEPS_LIBS=$pkg_cv_GTKDOC_DEPS_LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+fi
+ fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build gtk-doc documentation" >&5
OLD_IFS=$IFS
IFS=:
-for i in $with_firmware_path
-do
+for i in $with_firmware_path; do
if test "x${FIRMWARE_PATH}" = "x"; then
FIRMWARE_PATH="\\\"${i}/\\\""
else
fi
if test "x$with_systemdsystemunitdir" != xno; then
- systemdsystemunitdir=$with_systemdsystemunitdir
+ systemdsystemunitdir=$with_systemdsystemunitdir
fi
if test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ; then
fi
-# Check whether --enable-extras was given.
-if test "${enable_extras+set}" = set; then :
- enableval=$enable_extras;
-else
- enable_extras=yes
-fi
-
-if test "x$enable_extras" = xyes; then
- # Extract the first word of "gperf", so it can be a program name with args.
-set dummy gperf; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_GPERF+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $GPERF in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_GPERF="$GPERF" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_path_GPERF="$as_dir/$ac_word$ac_exec_ext"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
- ;;
-esac
-fi
-GPERF=$ac_cv_path_GPERF
-if test -n "$GPERF"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GPERF" >&5
-$as_echo "$GPERF" >&6; }
+# ------------------------------------------------------------------------------
+# GUdev - libudev gobject interface
+# ------------------------------------------------------------------------------
+# Check whether --enable-gudev was given.
+if test "${enable_gudev+set}" = set; then :
+ enableval=$enable_gudev;
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ enable_gudev=yes
fi
-
- if test -z "$GPERF"; then
- as_fn_error $? "gperf is needed" "$LINENO" 5
- fi
-
+if test "x$enable_gudev" = xyes; then
pkg_failed=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLIB" >&5
Alternatively, you may set the environment variables GLIB_CFLAGS
and GLIB_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details." "$LINENO" 5
+
elif test $pkg_failed = untried; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
To get pkg-config, see <http://pkg-config.freedesktop.org/>.
See \`config.log' for more details" "$LINENO" 5; }
+
else
GLIB_CFLAGS=$pkg_cv_GLIB_CFLAGS
GLIB_LIBS=$pkg_cv_GLIB_LIBS
$as_echo "yes" >&6; }
fi
+fi
+# Check whether --enable-introspection was given.
+if test "${enable_introspection+set}" = set; then :
+ enableval=$enable_introspection;
+else
+ enable_introspection=yes
+fi
+if test "x$enable_introspection" = xyes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for acl_init in -lacl" >&5
-$as_echo_n "checking for acl_init in -lacl... " >&6; }
-if ${ac_cv_lib_acl_acl_init+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lacl $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for INTROSPECTION" >&5
+$as_echo_n "checking for INTROSPECTION... " >&6; }
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char acl_init ();
-int
-main ()
-{
-return acl_init ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_acl_acl_init=yes
+if test -n "$INTROSPECTION_CFLAGS"; then
+ pkg_cv_INTROSPECTION_CFLAGS="$INTROSPECTION_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gobject-introspection-1.0 >= 0.6.2\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "gobject-introspection-1.0 >= 0.6.2") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_INTROSPECTION_CFLAGS=`$PKG_CONFIG --cflags "gobject-introspection-1.0 >= 0.6.2" 2>/dev/null`
else
- ac_cv_lib_acl_acl_init=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_acl_acl_init" >&5
-$as_echo "$ac_cv_lib_acl_acl_init" >&6; }
-if test "x$ac_cv_lib_acl_acl_init" = xyes; then :
- :
-else
- as_fn_error $? "libacl not found" "$LINENO" 5
-fi
-
- ac_fn_c_check_header_mongrel "$LINENO" "acl/libacl.h" "ac_cv_header_acl_libacl_h" "$ac_includes_default"
-if test "x$ac_cv_header_acl_libacl_h" = xyes; then :
- :
-else
- as_fn_error $? "libacl header not found" "$LINENO" 5
-fi
-
-
-
-
-pkg_failed=no
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBUSB" >&5
-$as_echo_n "checking for LIBUSB... " >&6; }
-
-if test -n "$LIBUSB_CFLAGS"; then
- pkg_cv_LIBUSB_CFLAGS="$LIBUSB_CFLAGS"
- elif test -n "$PKG_CONFIG"; then
- if test -n "$PKG_CONFIG" && \
- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libusb >= 0.1.12\""; } >&5
- ($PKG_CONFIG --exists --print-errors "libusb >= 0.1.12") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- pkg_cv_LIBUSB_CFLAGS=`$PKG_CONFIG --cflags "libusb >= 0.1.12" 2>/dev/null`
-else
- pkg_failed=yes
+ pkg_failed=yes
fi
else
pkg_failed=untried
fi
-if test -n "$LIBUSB_LIBS"; then
- pkg_cv_LIBUSB_LIBS="$LIBUSB_LIBS"
+if test -n "$INTROSPECTION_LIBS"; then
+ pkg_cv_INTROSPECTION_LIBS="$INTROSPECTION_LIBS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libusb >= 0.1.12\""; } >&5
- ($PKG_CONFIG --exists --print-errors "libusb >= 0.1.12") 2>&5
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gobject-introspection-1.0 >= 0.6.2\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "gobject-introspection-1.0 >= 0.6.2") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
- pkg_cv_LIBUSB_LIBS=`$PKG_CONFIG --libs "libusb >= 0.1.12" 2>/dev/null`
+ pkg_cv_INTROSPECTION_LIBS=`$PKG_CONFIG --libs "gobject-introspection-1.0 >= 0.6.2" 2>/dev/null`
else
pkg_failed=yes
fi
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
- LIBUSB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "libusb >= 0.1.12" 2>&1`
+ INTROSPECTION_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "gobject-introspection-1.0 >= 0.6.2" 2>&1`
else
- LIBUSB_PKG_ERRORS=`$PKG_CONFIG --print-errors "libusb >= 0.1.12" 2>&1`
+ INTROSPECTION_PKG_ERRORS=`$PKG_CONFIG --print-errors "gobject-introspection-1.0 >= 0.6.2" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
- echo "$LIBUSB_PKG_ERRORS" >&5
+ echo "$INTROSPECTION_PKG_ERRORS" >&5
- as_fn_error $? "Package requirements (libusb >= 0.1.12) were not met:
+ as_fn_error $? "Package requirements (gobject-introspection-1.0 >= 0.6.2) were not met:
-$LIBUSB_PKG_ERRORS
+$INTROSPECTION_PKG_ERRORS
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
-Alternatively, you may set the environment variables LIBUSB_CFLAGS
-and LIBUSB_LIBS to avoid the need to call pkg-config.
+Alternatively, you may set the environment variables INTROSPECTION_CFLAGS
+and INTROSPECTION_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details." "$LINENO" 5
+
elif test $pkg_failed = untried; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
is in your PATH or set the PKG_CONFIG environment variable to the full
path to pkg-config.
-Alternatively, you may set the environment variables LIBUSB_CFLAGS
-and LIBUSB_LIBS to avoid the need to call pkg-config.
+Alternatively, you may set the environment variables INTROSPECTION_CFLAGS
+and INTROSPECTION_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
To get pkg-config, see <http://pkg-config.freedesktop.org/>.
See \`config.log' for more details" "$LINENO" 5; }
+
else
- LIBUSB_CFLAGS=$pkg_cv_LIBUSB_CFLAGS
- LIBUSB_LIBS=$pkg_cv_LIBUSB_LIBS
+ INTROSPECTION_CFLAGS=$pkg_cv_INTROSPECTION_CFLAGS
+ INTROSPECTION_LIBS=$pkg_cv_INTROSPECTION_LIBS
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
fi
+$as_echo "#define ENABLE_INTROSPECTION 1" >>confdefs.h
+
+ G_IR_SCANNER=$($PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0)
+
+ G_IR_COMPILER=$($PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0)
+
+ G_IR_GENERATE=$($PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0)
+
+ GIRDIR=$($PKG_CONFIG --define-variable=datadir=${datadir} --variable=girdir gobject-introspection-1.0)
+
+ GIRTYPELIBDIR=$($PKG_CONFIG --define-variable=libdir=${libdir} --variable=typelibdir gobject-introspection-1.0)
+
+fi
+ if test "x$enable_introspection" = xyes; then
+ ENABLE_INTROSPECTION_TRUE=
+ ENABLE_INTROSPECTION_FALSE='#'
+else
+ ENABLE_INTROSPECTION_TRUE='#'
+ ENABLE_INTROSPECTION_FALSE=
+fi
+
+
+ if test "x$enable_gudev" = xyes; then
+ ENABLE_GUDEV_TRUE=
+ ENABLE_GUDEV_FALSE='#'
+else
+ ENABLE_GUDEV_TRUE='#'
+ ENABLE_GUDEV_FALSE=
+fi
+
+
+# ------------------------------------------------------------------------------
+# usb/pci-db - read vendor/device string database
+# ------------------------------------------------------------------------------
+# Check whether --enable-hwdb was given.
+if test "${enable_hwdb+set}" = set; then :
+ enableval=$enable_hwdb;
+else
+ enable_hwdb=yes
+fi
+
+if test "x$enable_hwdb" = xyes; then
+ if test "x$cross_compiling" = "xno" ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/share/pci.ids" >&5
+$as_echo_n "checking for /usr/share/pci.ids... " >&6; }
+if ${ac_cv_file__usr_share_pci_ids+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ test "$cross_compiling" = yes &&
+ as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5
+if test -r "/usr/share/pci.ids"; then
+ ac_cv_file__usr_share_pci_ids=yes
+else
+ ac_cv_file__usr_share_pci_ids=no
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_share_pci_ids" >&5
+$as_echo "$ac_cv_file__usr_share_pci_ids" >&6; }
+if test "x$ac_cv_file__usr_share_pci_ids" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE__USR_SHARE_PCI_IDS 1
+_ACEOF
+pciids=/usr/share/pci.ids
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/share/hwdata/pci.ids" >&5
+$as_echo_n "checking for /usr/share/hwdata/pci.ids... " >&6; }
+if ${ac_cv_file__usr_share_hwdata_pci_ids+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ test "$cross_compiling" = yes &&
+ as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5
+if test -r "/usr/share/hwdata/pci.ids"; then
+ ac_cv_file__usr_share_hwdata_pci_ids=yes
+else
+ ac_cv_file__usr_share_hwdata_pci_ids=no
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_share_hwdata_pci_ids" >&5
+$as_echo "$ac_cv_file__usr_share_hwdata_pci_ids" >&6; }
+if test "x$ac_cv_file__usr_share_hwdata_pci_ids" = xyes; then :
+cat >>confdefs.h <<_ACEOF
+#define HAVE__USR_SHARE_HWDATA_PCI_IDS 1
+_ACEOF
+pciids=/usr/share/hwdata/pci.ids
+fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/share/misc/pci.ids" >&5
+$as_echo_n "checking for /usr/share/misc/pci.ids... " >&6; }
+if ${ac_cv_file__usr_share_misc_pci_ids+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ test "$cross_compiling" = yes &&
+ as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5
+if test -r "/usr/share/misc/pci.ids"; then
+ ac_cv_file__usr_share_misc_pci_ids=yes
+else
+ ac_cv_file__usr_share_misc_pci_ids=no
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_share_misc_pci_ids" >&5
+$as_echo "$ac_cv_file__usr_share_misc_pci_ids" >&6; }
+if test "x$ac_cv_file__usr_share_misc_pci_ids" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE__USR_SHARE_MISC_PCI_IDS 1
+_ACEOF
+pciids=/usr/share/misc/pci.ids
+fi
+
+ fi
+
+
+# Check whether --with-usb-ids-path was given.
+if test "${with_usb_ids_path+set}" = set; then :
+ withval=$with_usb_ids_path; USB_DATABASE=${withval}
+else
+ if test -n "$usbids" ; then
+ USB_DATABASE="$usbids"
+ else
pkg_failed=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for USBUTILS" >&5
Alternatively, you may set the environment variables USBUTILS_CFLAGS
and USBUTILS_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details." "$LINENO" 5
+
elif test $pkg_failed = untried; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
To get pkg-config, see <http://pkg-config.freedesktop.org/>.
See \`config.log' for more details" "$LINENO" 5; }
+
else
USBUTILS_CFLAGS=$pkg_cv_USBUTILS_CFLAGS
USBUTILS_LIBS=$pkg_cv_USBUTILS_LIBS
$as_echo "yes" >&6; }
fi
- USB_DATABASE=$($PKG_CONFIG --variable=usbids usbutils)
-
+ USB_DATABASE=$($PKG_CONFIG --variable=usbids usbutils)
- if test "x$cross_compiling" = "xno" ; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/share/pci.ids" >&5
-$as_echo_n "checking for /usr/share/pci.ids... " >&6; }
-if ${ac_cv_file__usr_share_pci_ids+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- test "$cross_compiling" = yes &&
- as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5
-if test -r "/usr/share/pci.ids"; then
- ac_cv_file__usr_share_pci_ids=yes
-else
- ac_cv_file__usr_share_pci_ids=no
-fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_share_pci_ids" >&5
-$as_echo "$ac_cv_file__usr_share_pci_ids" >&6; }
-if test "x$ac_cv_file__usr_share_pci_ids" = xyes; then :
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE__USR_SHARE_PCI_IDS 1
-_ACEOF
-pciids=/usr/share/pci.ids
+ fi
fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/share/hwdata/pci.ids" >&5
-$as_echo_n "checking for /usr/share/hwdata/pci.ids... " >&6; }
-if ${ac_cv_file__usr_share_hwdata_pci_ids+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- test "$cross_compiling" = yes &&
- as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5
-if test -r "/usr/share/hwdata/pci.ids"; then
- ac_cv_file__usr_share_hwdata_pci_ids=yes
-else
- ac_cv_file__usr_share_hwdata_pci_ids=no
-fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_share_hwdata_pci_ids" >&5
-$as_echo "$ac_cv_file__usr_share_hwdata_pci_ids" >&6; }
-if test "x$ac_cv_file__usr_share_hwdata_pci_ids" = xyes; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for USB database location" >&5
+$as_echo_n "checking for USB database location... " >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USB_DATABASE" >&5
+$as_echo "$USB_DATABASE" >&6; }
-cat >>confdefs.h <<_ACEOF
-#define HAVE__USR_SHARE_HWDATA_PCI_IDS 1
-_ACEOF
-pciids=/usr/share/hwdata/pci.ids
-fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/share/misc/pci.ids" >&5
-$as_echo_n "checking for /usr/share/misc/pci.ids... " >&6; }
-if ${ac_cv_file__usr_share_misc_pci_ids+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- test "$cross_compiling" = yes &&
- as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5
-if test -r "/usr/share/misc/pci.ids"; then
- ac_cv_file__usr_share_misc_pci_ids=yes
-else
- ac_cv_file__usr_share_misc_pci_ids=no
-fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_share_misc_pci_ids" >&5
-$as_echo "$ac_cv_file__usr_share_misc_pci_ids" >&6; }
-if test "x$ac_cv_file__usr_share_misc_pci_ids" = xyes; then :
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE__USR_SHARE_MISC_PCI_IDS 1
-_ACEOF
-pciids=/usr/share/misc/pci.ids
-fi
-
- fi
# Check whether --with-pci-ids-path was given.
if test "${with_pci_ids_path+set}" = set; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PCI_DATABASE" >&5
$as_echo "$PCI_DATABASE" >&6; }
+fi
+ if test "x$enable_hwdb" = xyes; then
+ ENABLE_HWDB_TRUE=
+ ENABLE_HWDB_FALSE='#'
+else
+ ENABLE_HWDB_TRUE='#'
+ ENABLE_HWDB_FALSE=
+fi
+
+
+# ------------------------------------------------------------------------------
+# keymap - map custom hardware's multimedia keys
+# ------------------------------------------------------------------------------
+# Check whether --enable-keymap was given.
+if test "${enable_keymap+set}" = set; then :
+ enableval=$enable_keymap;
+else
+ enable_keymap=yes
+fi
+
+if test "x$enable_keymap" = xyes; then
+ # Extract the first word of "gperf", so it can be a program name with args.
+set dummy gperf; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_GPERF+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $GPERF in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_GPERF="$GPERF" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_GPERF="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+GPERF=$ac_cv_path_GPERF
+if test -n "$GPERF"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GPERF" >&5
+$as_echo "$GPERF" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ if test -z "$GPERF"; then
+ as_fn_error $? "gperf is needed" "$LINENO" 5
+ fi
ac_fn_c_check_header_mongrel "$LINENO" "linux/input.h" "ac_cv_header_linux_input_h" "$ac_includes_default"
if test "x$ac_cv_header_linux_input_h" = xyes; then :
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_extras" = xyes; then
- ENABLE_EXTRAS_TRUE=
- ENABLE_EXTRAS_FALSE='#'
+ if test "x$enable_keymap" = xyes; then
+ ENABLE_KEYMAP_TRUE=
+ ENABLE_KEYMAP_FALSE='#'
else
- ENABLE_EXTRAS_TRUE='#'
- ENABLE_EXTRAS_FALSE=
+ ENABLE_KEYMAP_TRUE='#'
+ ENABLE_KEYMAP_FALSE=
fi
-# Check whether --enable-introspection was given.
-if test "${enable_introspection+set}" = set; then :
- enableval=$enable_introspection;
+# ------------------------------------------------------------------------------
+# mtd_probe - autoloads FTL module for mtd devices
+# ------------------------------------------------------------------------------
+# Check whether --enable-mtd_probe was given.
+if test "${enable_mtd_probe+set}" = set; then :
+ enableval=$enable_mtd_probe;
else
- enable_introspection=yes
+ enable_mtd_probe=yes
fi
-if test "x$enable_introspection" = xyes; then
+ if test "x$enable_mtd_probe" = xyes; then
+ ENABLE_MTD_PROBE_TRUE=
+ ENABLE_MTD_PROBE_FALSE='#'
+else
+ ENABLE_MTD_PROBE_TRUE='#'
+ ENABLE_MTD_PROBE_FALSE=
+fi
-pkg_failed=no
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for INTROSPECTION" >&5
-$as_echo_n "checking for INTROSPECTION... " >&6; }
-if test -n "$INTROSPECTION_CFLAGS"; then
- pkg_cv_INTROSPECTION_CFLAGS="$INTROSPECTION_CFLAGS"
+# ------------------------------------------------------------------------------
+# rule_generator - persistent network and optical device rule generator
+# ------------------------------------------------------------------------------
+# Check whether --enable-rule_generator was given.
+if test "${enable_rule_generator+set}" = set; then :
+ enableval=$enable_rule_generator;
+else
+ enable_rule_generator=no
+fi
+
+ if test "x$enable_rule_generator" = xyes; then
+ ENABLE_RULE_GENERATOR_TRUE=
+ ENABLE_RULE_GENERATOR_FALSE='#'
+else
+ ENABLE_RULE_GENERATOR_TRUE='#'
+ ENABLE_RULE_GENERATOR_FALSE=
+fi
+
+
+# ------------------------------------------------------------------------------
+# udev_acl - apply ACLs for users with local forground sessions
+# ------------------------------------------------------------------------------
+# Check whether --enable-udev_acl was given.
+if test "${enable_udev_acl+set}" = set; then :
+ enableval=$enable_udev_acl;
+else
+ enable_udev_acl=no
+fi
+
+if test "x$enable_udev_acl" = xyes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for acl_init in -lacl" >&5
+$as_echo_n "checking for acl_init in -lacl... " >&6; }
+if ${ac_cv_lib_acl_acl_init+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lacl $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char acl_init ();
+int
+main ()
+{
+return acl_init ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_acl_acl_init=yes
+else
+ ac_cv_lib_acl_acl_init=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_acl_acl_init" >&5
+$as_echo "$ac_cv_lib_acl_acl_init" >&6; }
+if test "x$ac_cv_lib_acl_acl_init" = xyes; then :
+ :
+else
+ as_fn_error $? "libacl not found" "$LINENO" 5
+fi
+
+ ac_fn_c_check_header_mongrel "$LINENO" "acl/libacl.h" "ac_cv_header_acl_libacl_h" "$ac_includes_default"
+if test "x$ac_cv_header_acl_libacl_h" = xyes; then :
+ :
+else
+ as_fn_error $? "libacl header not found" "$LINENO" 5
+fi
+
+
+
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLIB" >&5
+$as_echo_n "checking for GLIB... " >&6; }
+
+if test -n "$GLIB_CFLAGS"; then
+ pkg_cv_GLIB_CFLAGS="$GLIB_CFLAGS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gobject-introspection-1.0 >= 0.6.2\""; } >&5
- ($PKG_CONFIG --exists --print-errors "gobject-introspection-1.0 >= 0.6.2") 2>&5
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.22.0 gobject-2.0 >= 2.22.0\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.22.0 gobject-2.0 >= 2.22.0") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
- pkg_cv_INTROSPECTION_CFLAGS=`$PKG_CONFIG --cflags "gobject-introspection-1.0 >= 0.6.2" 2>/dev/null`
+ pkg_cv_GLIB_CFLAGS=`$PKG_CONFIG --cflags "glib-2.0 >= 2.22.0 gobject-2.0 >= 2.22.0" 2>/dev/null`
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
-if test -n "$INTROSPECTION_LIBS"; then
- pkg_cv_INTROSPECTION_LIBS="$INTROSPECTION_LIBS"
+if test -n "$GLIB_LIBS"; then
+ pkg_cv_GLIB_LIBS="$GLIB_LIBS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gobject-introspection-1.0 >= 0.6.2\""; } >&5
- ($PKG_CONFIG --exists --print-errors "gobject-introspection-1.0 >= 0.6.2") 2>&5
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.22.0 gobject-2.0 >= 2.22.0\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.22.0 gobject-2.0 >= 2.22.0") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
- pkg_cv_INTROSPECTION_LIBS=`$PKG_CONFIG --libs "gobject-introspection-1.0 >= 0.6.2" 2>/dev/null`
+ pkg_cv_GLIB_LIBS=`$PKG_CONFIG --libs "glib-2.0 >= 2.22.0 gobject-2.0 >= 2.22.0" 2>/dev/null`
else
pkg_failed=yes
fi
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
- INTROSPECTION_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "gobject-introspection-1.0 >= 0.6.2" 2>&1`
+ GLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "glib-2.0 >= 2.22.0 gobject-2.0 >= 2.22.0" 2>&1`
else
- INTROSPECTION_PKG_ERRORS=`$PKG_CONFIG --print-errors "gobject-introspection-1.0 >= 0.6.2" 2>&1`
+ GLIB_PKG_ERRORS=`$PKG_CONFIG --print-errors "glib-2.0 >= 2.22.0 gobject-2.0 >= 2.22.0" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
- echo "$INTROSPECTION_PKG_ERRORS" >&5
+ echo "$GLIB_PKG_ERRORS" >&5
- as_fn_error $? "Package requirements (gobject-introspection-1.0 >= 0.6.2) were not met:
+ as_fn_error $? "Package requirements (glib-2.0 >= 2.22.0 gobject-2.0 >= 2.22.0) were not met:
-$INTROSPECTION_PKG_ERRORS
+$GLIB_PKG_ERRORS
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
-Alternatively, you may set the environment variables INTROSPECTION_CFLAGS
-and INTROSPECTION_LIBS to avoid the need to call pkg-config.
+Alternatively, you may set the environment variables GLIB_CFLAGS
+and GLIB_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details." "$LINENO" 5
+
elif test $pkg_failed = untried; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
is in your PATH or set the PKG_CONFIG environment variable to the full
path to pkg-config.
-Alternatively, you may set the environment variables INTROSPECTION_CFLAGS
-and INTROSPECTION_LIBS to avoid the need to call pkg-config.
+Alternatively, you may set the environment variables GLIB_CFLAGS
+and GLIB_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
To get pkg-config, see <http://pkg-config.freedesktop.org/>.
See \`config.log' for more details" "$LINENO" 5; }
+
else
- INTROSPECTION_CFLAGS=$pkg_cv_INTROSPECTION_CFLAGS
- INTROSPECTION_LIBS=$pkg_cv_INTROSPECTION_LIBS
+ GLIB_CFLAGS=$pkg_cv_GLIB_CFLAGS
+ GLIB_LIBS=$pkg_cv_GLIB_LIBS
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
fi
+fi
+ if test "x$enable_udev_acl" = xyes; then
+ ENABLE_UDEV_ACL_TRUE=
+ ENABLE_UDEV_ACL_FALSE='#'
+else
+ ENABLE_UDEV_ACL_TRUE='#'
+ ENABLE_UDEV_ACL_FALSE=
+fi
-$as_echo "#define ENABLE_INTROSPECTION 1" >>confdefs.h
-
- G_IR_SCANNER=$($PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0)
-
- G_IR_COMPILER=$($PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0)
- G_IR_GENERATE=$($PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0)
+# ------------------------------------------------------------------------------
+# create_floppy_devices - historical floppy kernel device nodes (/dev/fd0h1440, ...)
+# ------------------------------------------------------------------------------
+# Check whether --enable-floppy was given.
+if test "${enable_floppy+set}" = set; then :
+ enableval=$enable_floppy;
+else
+ enable_floppy=no
+fi
- GIRDIR=$($PKG_CONFIG --define-variable=datadir=${datadir} --variable=girdir gobject-introspection-1.0)
+ if test "x$enable_floppy" = xyes; then
+ ENABLE_FLOPPY_TRUE=
+ ENABLE_FLOPPY_FALSE='#'
+else
+ ENABLE_FLOPPY_TRUE='#'
+ ENABLE_FLOPPY_FALSE=
+fi
- GIRTYPELIBDIR=$($PKG_CONFIG --define-variable=libdir=${libdir} --variable=typelibdir gobject-introspection-1.0)
+# ------------------------------------------------------------------------------
+# edd_id - create /dev/disk/by-id/edd-* links for BIOS EDD data
+# ------------------------------------------------------------------------------
+# Check whether --enable-edd was given.
+if test "${enable_edd+set}" = set; then :
+ enableval=$enable_edd;
+else
+ enable_edd=no
fi
- if test "x$enable_introspection" = xyes; then
- ENABLE_INTROSPECTION_TRUE=
- ENABLE_INTROSPECTION_FALSE='#'
+
+ if test "x$enable_edd" = xyes; then
+ ENABLE_EDD_TRUE=
+ ENABLE_EDD_FALSE='#'
else
- ENABLE_INTROSPECTION_TRUE='#'
- ENABLE_INTROSPECTION_FALSE=
+ ENABLE_EDD_TRUE='#'
+ ENABLE_EDD_FALSE=
fi
ac_config_headers="$ac_config_headers config.h"
-ac_config_files="$ac_config_files Makefile udev/udev.pc init/udev.service init/udev-settle.service init/udev-retry.service libudev/libudev.pc libudev/docs/Makefile libudev/docs/version.xml extras/gudev/gudev-1.0.pc extras/gudev/docs/Makefile extras/gudev/docs/version.xml"
+ac_config_files="$ac_config_files Makefile udev/udev.pc init/udev.service init/udev-trigger.service init/udev-settle.service libudev/libudev.pc libudev/docs/Makefile libudev/docs/version.xml extras/gudev/gudev-1.0.pc extras/gudev/docs/Makefile extras/gudev/docs/version.xml"
cat >confcache <<\_ACEOF
as_fn_error $? "conditional \"WITH_SYSTEMD\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
-if test -z "${ENABLE_EXTRAS_TRUE}" && test -z "${ENABLE_EXTRAS_FALSE}"; then
- as_fn_error $? "conditional \"ENABLE_EXTRAS\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
if test -z "${ENABLE_INTROSPECTION_TRUE}" && test -z "${ENABLE_INTROSPECTION_FALSE}"; then
as_fn_error $? "conditional \"ENABLE_INTROSPECTION\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
+if test -z "${ENABLE_GUDEV_TRUE}" && test -z "${ENABLE_GUDEV_FALSE}"; then
+ as_fn_error $? "conditional \"ENABLE_GUDEV\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${ENABLE_HWDB_TRUE}" && test -z "${ENABLE_HWDB_FALSE}"; then
+ as_fn_error $? "conditional \"ENABLE_HWDB\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${ENABLE_KEYMAP_TRUE}" && test -z "${ENABLE_KEYMAP_FALSE}"; then
+ as_fn_error $? "conditional \"ENABLE_KEYMAP\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${ENABLE_MTD_PROBE_TRUE}" && test -z "${ENABLE_MTD_PROBE_FALSE}"; then
+ as_fn_error $? "conditional \"ENABLE_MTD_PROBE\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${ENABLE_RULE_GENERATOR_TRUE}" && test -z "${ENABLE_RULE_GENERATOR_FALSE}"; then
+ as_fn_error $? "conditional \"ENABLE_RULE_GENERATOR\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${ENABLE_UDEV_ACL_TRUE}" && test -z "${ENABLE_UDEV_ACL_FALSE}"; then
+ as_fn_error $? "conditional \"ENABLE_UDEV_ACL\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${ENABLE_FLOPPY_TRUE}" && test -z "${ENABLE_FLOPPY_FALSE}"; then
+ as_fn_error $? "conditional \"ENABLE_FLOPPY\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${ENABLE_EDD_TRUE}" && test -z "${ENABLE_EDD_FALSE}"; then
+ as_fn_error $? "conditional \"ENABLE_EDD\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
: "${CONFIG_STATUS=./config.status}"
ac_write_fail=0
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by udev $as_me 166, which was
+This file was extended by udev $as_me 174, which was
generated by GNU Autoconf 2.68. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
Configuration commands:
$config_commands
-Report bugs to <linux-hotplug@vger.kernel.org>."
+Report bugs to <linux-hotplug@vger.kernel.org>.
+udev home page: <http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html>."
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-udev config.status 166
+udev config.status 174
configured by $0, generated by GNU Autoconf 2.68,
with options \\"\$ac_cs_config\\"
sed_quote_subst='$sed_quote_subst'
double_quote_subst='$double_quote_subst'
delay_variable_subst='$delay_variable_subst'
-enable_static='`$ECHO "X$enable_static" | $Xsed -e "$delay_single_quote_subst"`'
-macro_version='`$ECHO "X$macro_version" | $Xsed -e "$delay_single_quote_subst"`'
-macro_revision='`$ECHO "X$macro_revision" | $Xsed -e "$delay_single_quote_subst"`'
-enable_shared='`$ECHO "X$enable_shared" | $Xsed -e "$delay_single_quote_subst"`'
-pic_mode='`$ECHO "X$pic_mode" | $Xsed -e "$delay_single_quote_subst"`'
-enable_fast_install='`$ECHO "X$enable_fast_install" | $Xsed -e "$delay_single_quote_subst"`'
-host_alias='`$ECHO "X$host_alias" | $Xsed -e "$delay_single_quote_subst"`'
-host='`$ECHO "X$host" | $Xsed -e "$delay_single_quote_subst"`'
-host_os='`$ECHO "X$host_os" | $Xsed -e "$delay_single_quote_subst"`'
-build_alias='`$ECHO "X$build_alias" | $Xsed -e "$delay_single_quote_subst"`'
-build='`$ECHO "X$build" | $Xsed -e "$delay_single_quote_subst"`'
-build_os='`$ECHO "X$build_os" | $Xsed -e "$delay_single_quote_subst"`'
-SED='`$ECHO "X$SED" | $Xsed -e "$delay_single_quote_subst"`'
-Xsed='`$ECHO "X$Xsed" | $Xsed -e "$delay_single_quote_subst"`'
-GREP='`$ECHO "X$GREP" | $Xsed -e "$delay_single_quote_subst"`'
-EGREP='`$ECHO "X$EGREP" | $Xsed -e "$delay_single_quote_subst"`'
-FGREP='`$ECHO "X$FGREP" | $Xsed -e "$delay_single_quote_subst"`'
-LD='`$ECHO "X$LD" | $Xsed -e "$delay_single_quote_subst"`'
-NM='`$ECHO "X$NM" | $Xsed -e "$delay_single_quote_subst"`'
-LN_S='`$ECHO "X$LN_S" | $Xsed -e "$delay_single_quote_subst"`'
-max_cmd_len='`$ECHO "X$max_cmd_len" | $Xsed -e "$delay_single_quote_subst"`'
-ac_objext='`$ECHO "X$ac_objext" | $Xsed -e "$delay_single_quote_subst"`'
-exeext='`$ECHO "X$exeext" | $Xsed -e "$delay_single_quote_subst"`'
-lt_unset='`$ECHO "X$lt_unset" | $Xsed -e "$delay_single_quote_subst"`'
-lt_SP2NL='`$ECHO "X$lt_SP2NL" | $Xsed -e "$delay_single_quote_subst"`'
-lt_NL2SP='`$ECHO "X$lt_NL2SP" | $Xsed -e "$delay_single_quote_subst"`'
-reload_flag='`$ECHO "X$reload_flag" | $Xsed -e "$delay_single_quote_subst"`'
-reload_cmds='`$ECHO "X$reload_cmds" | $Xsed -e "$delay_single_quote_subst"`'
-OBJDUMP='`$ECHO "X$OBJDUMP" | $Xsed -e "$delay_single_quote_subst"`'
-deplibs_check_method='`$ECHO "X$deplibs_check_method" | $Xsed -e "$delay_single_quote_subst"`'
-file_magic_cmd='`$ECHO "X$file_magic_cmd" | $Xsed -e "$delay_single_quote_subst"`'
-AR='`$ECHO "X$AR" | $Xsed -e "$delay_single_quote_subst"`'
-AR_FLAGS='`$ECHO "X$AR_FLAGS" | $Xsed -e "$delay_single_quote_subst"`'
-STRIP='`$ECHO "X$STRIP" | $Xsed -e "$delay_single_quote_subst"`'
-RANLIB='`$ECHO "X$RANLIB" | $Xsed -e "$delay_single_quote_subst"`'
-old_postinstall_cmds='`$ECHO "X$old_postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`'
-old_postuninstall_cmds='`$ECHO "X$old_postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`'
-old_archive_cmds='`$ECHO "X$old_archive_cmds" | $Xsed -e "$delay_single_quote_subst"`'
-CC='`$ECHO "X$CC" | $Xsed -e "$delay_single_quote_subst"`'
-CFLAGS='`$ECHO "X$CFLAGS" | $Xsed -e "$delay_single_quote_subst"`'
-compiler='`$ECHO "X$compiler" | $Xsed -e "$delay_single_quote_subst"`'
-GCC='`$ECHO "X$GCC" | $Xsed -e "$delay_single_quote_subst"`'
-lt_cv_sys_global_symbol_pipe='`$ECHO "X$lt_cv_sys_global_symbol_pipe" | $Xsed -e "$delay_single_quote_subst"`'
-lt_cv_sys_global_symbol_to_cdecl='`$ECHO "X$lt_cv_sys_global_symbol_to_cdecl" | $Xsed -e "$delay_single_quote_subst"`'
-lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address" | $Xsed -e "$delay_single_quote_subst"`'
-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`'
-objdir='`$ECHO "X$objdir" | $Xsed -e "$delay_single_quote_subst"`'
-SHELL='`$ECHO "X$SHELL" | $Xsed -e "$delay_single_quote_subst"`'
-ECHO='`$ECHO "X$ECHO" | $Xsed -e "$delay_single_quote_subst"`'
-MAGIC_CMD='`$ECHO "X$MAGIC_CMD" | $Xsed -e "$delay_single_quote_subst"`'
-lt_prog_compiler_no_builtin_flag='`$ECHO "X$lt_prog_compiler_no_builtin_flag" | $Xsed -e "$delay_single_quote_subst"`'
-lt_prog_compiler_wl='`$ECHO "X$lt_prog_compiler_wl" | $Xsed -e "$delay_single_quote_subst"`'
-lt_prog_compiler_pic='`$ECHO "X$lt_prog_compiler_pic" | $Xsed -e "$delay_single_quote_subst"`'
-lt_prog_compiler_static='`$ECHO "X$lt_prog_compiler_static" | $Xsed -e "$delay_single_quote_subst"`'
-lt_cv_prog_compiler_c_o='`$ECHO "X$lt_cv_prog_compiler_c_o" | $Xsed -e "$delay_single_quote_subst"`'
-need_locks='`$ECHO "X$need_locks" | $Xsed -e "$delay_single_quote_subst"`'
-DSYMUTIL='`$ECHO "X$DSYMUTIL" | $Xsed -e "$delay_single_quote_subst"`'
-NMEDIT='`$ECHO "X$NMEDIT" | $Xsed -e "$delay_single_quote_subst"`'
-LIPO='`$ECHO "X$LIPO" | $Xsed -e "$delay_single_quote_subst"`'
-OTOOL='`$ECHO "X$OTOOL" | $Xsed -e "$delay_single_quote_subst"`'
-OTOOL64='`$ECHO "X$OTOOL64" | $Xsed -e "$delay_single_quote_subst"`'
-libext='`$ECHO "X$libext" | $Xsed -e "$delay_single_quote_subst"`'
-shrext_cmds='`$ECHO "X$shrext_cmds" | $Xsed -e "$delay_single_quote_subst"`'
-extract_expsyms_cmds='`$ECHO "X$extract_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`'
-archive_cmds_need_lc='`$ECHO "X$archive_cmds_need_lc" | $Xsed -e "$delay_single_quote_subst"`'
-enable_shared_with_static_runtimes='`$ECHO "X$enable_shared_with_static_runtimes" | $Xsed -e "$delay_single_quote_subst"`'
-export_dynamic_flag_spec='`$ECHO "X$export_dynamic_flag_spec" | $Xsed -e "$delay_single_quote_subst"`'
-whole_archive_flag_spec='`$ECHO "X$whole_archive_flag_spec" | $Xsed -e "$delay_single_quote_subst"`'
-compiler_needs_object='`$ECHO "X$compiler_needs_object" | $Xsed -e "$delay_single_quote_subst"`'
-old_archive_from_new_cmds='`$ECHO "X$old_archive_from_new_cmds" | $Xsed -e "$delay_single_quote_subst"`'
-old_archive_from_expsyms_cmds='`$ECHO "X$old_archive_from_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`'
-archive_cmds='`$ECHO "X$archive_cmds" | $Xsed -e "$delay_single_quote_subst"`'
-archive_expsym_cmds='`$ECHO "X$archive_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`'
-module_cmds='`$ECHO "X$module_cmds" | $Xsed -e "$delay_single_quote_subst"`'
-module_expsym_cmds='`$ECHO "X$module_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`'
-with_gnu_ld='`$ECHO "X$with_gnu_ld" | $Xsed -e "$delay_single_quote_subst"`'
-allow_undefined_flag='`$ECHO "X$allow_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`'
-no_undefined_flag='`$ECHO "X$no_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`'
-hardcode_libdir_flag_spec='`$ECHO "X$hardcode_libdir_flag_spec" | $Xsed -e "$delay_single_quote_subst"`'
-hardcode_libdir_flag_spec_ld='`$ECHO "X$hardcode_libdir_flag_spec_ld" | $Xsed -e "$delay_single_quote_subst"`'
-hardcode_libdir_separator='`$ECHO "X$hardcode_libdir_separator" | $Xsed -e "$delay_single_quote_subst"`'
-hardcode_direct='`$ECHO "X$hardcode_direct" | $Xsed -e "$delay_single_quote_subst"`'
-hardcode_direct_absolute='`$ECHO "X$hardcode_direct_absolute" | $Xsed -e "$delay_single_quote_subst"`'
-hardcode_minus_L='`$ECHO "X$hardcode_minus_L" | $Xsed -e "$delay_single_quote_subst"`'
-hardcode_shlibpath_var='`$ECHO "X$hardcode_shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`'
-hardcode_automatic='`$ECHO "X$hardcode_automatic" | $Xsed -e "$delay_single_quote_subst"`'
-inherit_rpath='`$ECHO "X$inherit_rpath" | $Xsed -e "$delay_single_quote_subst"`'
-link_all_deplibs='`$ECHO "X$link_all_deplibs" | $Xsed -e "$delay_single_quote_subst"`'
-fix_srcfile_path='`$ECHO "X$fix_srcfile_path" | $Xsed -e "$delay_single_quote_subst"`'
-always_export_symbols='`$ECHO "X$always_export_symbols" | $Xsed -e "$delay_single_quote_subst"`'
-export_symbols_cmds='`$ECHO "X$export_symbols_cmds" | $Xsed -e "$delay_single_quote_subst"`'
-exclude_expsyms='`$ECHO "X$exclude_expsyms" | $Xsed -e "$delay_single_quote_subst"`'
-include_expsyms='`$ECHO "X$include_expsyms" | $Xsed -e "$delay_single_quote_subst"`'
-prelink_cmds='`$ECHO "X$prelink_cmds" | $Xsed -e "$delay_single_quote_subst"`'
-file_list_spec='`$ECHO "X$file_list_spec" | $Xsed -e "$delay_single_quote_subst"`'
-variables_saved_for_relink='`$ECHO "X$variables_saved_for_relink" | $Xsed -e "$delay_single_quote_subst"`'
-need_lib_prefix='`$ECHO "X$need_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`'
-need_version='`$ECHO "X$need_version" | $Xsed -e "$delay_single_quote_subst"`'
-version_type='`$ECHO "X$version_type" | $Xsed -e "$delay_single_quote_subst"`'
-runpath_var='`$ECHO "X$runpath_var" | $Xsed -e "$delay_single_quote_subst"`'
-shlibpath_var='`$ECHO "X$shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`'
-shlibpath_overrides_runpath='`$ECHO "X$shlibpath_overrides_runpath" | $Xsed -e "$delay_single_quote_subst"`'
-libname_spec='`$ECHO "X$libname_spec" | $Xsed -e "$delay_single_quote_subst"`'
-library_names_spec='`$ECHO "X$library_names_spec" | $Xsed -e "$delay_single_quote_subst"`'
-soname_spec='`$ECHO "X$soname_spec" | $Xsed -e "$delay_single_quote_subst"`'
-postinstall_cmds='`$ECHO "X$postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`'
-postuninstall_cmds='`$ECHO "X$postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`'
-finish_cmds='`$ECHO "X$finish_cmds" | $Xsed -e "$delay_single_quote_subst"`'
-finish_eval='`$ECHO "X$finish_eval" | $Xsed -e "$delay_single_quote_subst"`'
-hardcode_into_libs='`$ECHO "X$hardcode_into_libs" | $Xsed -e "$delay_single_quote_subst"`'
-sys_lib_search_path_spec='`$ECHO "X$sys_lib_search_path_spec" | $Xsed -e "$delay_single_quote_subst"`'
-sys_lib_dlsearch_path_spec='`$ECHO "X$sys_lib_dlsearch_path_spec" | $Xsed -e "$delay_single_quote_subst"`'
-hardcode_action='`$ECHO "X$hardcode_action" | $Xsed -e "$delay_single_quote_subst"`'
-enable_dlopen='`$ECHO "X$enable_dlopen" | $Xsed -e "$delay_single_quote_subst"`'
-enable_dlopen_self='`$ECHO "X$enable_dlopen_self" | $Xsed -e "$delay_single_quote_subst"`'
-enable_dlopen_self_static='`$ECHO "X$enable_dlopen_self_static" | $Xsed -e "$delay_single_quote_subst"`'
-old_striplib='`$ECHO "X$old_striplib" | $Xsed -e "$delay_single_quote_subst"`'
-striplib='`$ECHO "X$striplib" | $Xsed -e "$delay_single_quote_subst"`'
+enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`'
+macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`'
+macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`'
+enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`'
+pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`'
+enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`'
+SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`'
+ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`'
+host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`'
+host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`'
+host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`'
+build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`'
+build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`'
+build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`'
+SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`'
+Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`'
+GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`'
+EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`'
+FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`'
+LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`'
+NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`'
+LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`'
+max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`'
+ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`'
+exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`'
+lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`'
+lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`'
+lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`'
+lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`'
+lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`'
+reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`'
+reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`'
+OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`'
+deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`'
+file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`'
+file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`'
+want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`'
+DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`'
+sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`'
+AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
+AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
+archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`'
+STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
+RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`'
+old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`'
+old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
+old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`'
+lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`'
+CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`'
+CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`'
+compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`'
+GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
+nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
+lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
+objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
+MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`'
+lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`'
+need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`'
+MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`'
+DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`'
+NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`'
+LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`'
+OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`'
+OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`'
+libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`'
+shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`'
+extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
+archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`'
+enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`'
+export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`'
+whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`'
+compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`'
+old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`'
+old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
+archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`'
+archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`'
+module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`'
+module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`'
+with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`'
+allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`'
+no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec_ld='`$ECHO "$hardcode_libdir_flag_spec_ld" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`'
+hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`'
+hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`'
+hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`'
+hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`'
+hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`'
+inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`'
+link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`'
+always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`'
+export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`'
+exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`'
+include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`'
+prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`'
+postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`'
+file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`'
+variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`'
+need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`'
+need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`'
+version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`'
+runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`'
+shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`'
+shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`'
+libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`'
+library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`'
+soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`'
+install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`'
+postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`'
+postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
+finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`'
+finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`'
+hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`'
+sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`'
+sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`'
+hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`'
+enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`'
+enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`'
+enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`'
+old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`'
+striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`'
LTCC='$LTCC'
LTCFLAGS='$LTCFLAGS'
compiler='$compiler_DEFAULT'
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+ eval 'cat <<_LTECHO_EOF
+\$1
+_LTECHO_EOF'
+}
+
# Quote evaled strings.
-for var in SED \
+for var in SHELL \
+ECHO \
+SED \
GREP \
EGREP \
FGREP \
OBJDUMP \
deplibs_check_method \
file_magic_cmd \
+file_magic_glob \
+want_nocaseglob \
+DLLTOOL \
+sharedlib_from_linklib_cmd \
AR \
AR_FLAGS \
+archiver_list_spec \
STRIP \
RANLIB \
CC \
lt_cv_sys_global_symbol_to_cdecl \
lt_cv_sys_global_symbol_to_c_name_address \
lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
-SHELL \
-ECHO \
+nm_file_list_spec \
lt_prog_compiler_no_builtin_flag \
-lt_prog_compiler_wl \
lt_prog_compiler_pic \
+lt_prog_compiler_wl \
lt_prog_compiler_static \
lt_cv_prog_compiler_c_o \
need_locks \
+MANIFEST_TOOL \
DSYMUTIL \
NMEDIT \
LIPO \
hardcode_libdir_flag_spec \
hardcode_libdir_flag_spec_ld \
hardcode_libdir_separator \
-fix_srcfile_path \
exclude_expsyms \
include_expsyms \
file_list_spec \
libname_spec \
library_names_spec \
soname_spec \
+install_override_mode \
finish_eval \
old_striplib \
striplib; do
- case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
+ case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
*[\\\\\\\`\\"\\\$]*)
- eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
;;
*)
eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
module_expsym_cmds \
export_symbols_cmds \
prelink_cmds \
+postlink_cmds \
postinstall_cmds \
postuninstall_cmds \
finish_cmds \
sys_lib_search_path_spec \
sys_lib_dlsearch_path_spec; do
- case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
+ case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
*[\\\\\\\`\\"\\\$]*)
- eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
;;
*)
eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
esac
done
-# Fix-up fallback echo if it was mangled by the above quoting rules.
-case \$lt_ECHO in
-*'\\\$0 --fallback-echo"') lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\$0 --fallback-echo"\$/\$0 --fallback-echo"/'\`
- ;;
-esac
-
ac_aux_dir='$ac_aux_dir'
xsi_shell='$xsi_shell'
lt_shell_append='$lt_shell_append'
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
"udev/udev.pc") CONFIG_FILES="$CONFIG_FILES udev/udev.pc" ;;
"init/udev.service") CONFIG_FILES="$CONFIG_FILES init/udev.service" ;;
+ "init/udev-trigger.service") CONFIG_FILES="$CONFIG_FILES init/udev-trigger.service" ;;
"init/udev-settle.service") CONFIG_FILES="$CONFIG_FILES init/udev-settle.service" ;;
- "init/udev-retry.service") CONFIG_FILES="$CONFIG_FILES init/udev-retry.service" ;;
"libudev/libudev.pc") CONFIG_FILES="$CONFIG_FILES libudev/libudev.pc" ;;
"libudev/docs/Makefile") CONFIG_FILES="$CONFIG_FILES libudev/docs/Makefile" ;;
"libudev/docs/version.xml") CONFIG_FILES="$CONFIG_FILES libudev/docs/version.xml" ;;
# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
# NOTE: Changes made to this file will be lost: look at ltmain.sh.
#
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-# 2006, 2007, 2008 Free Software Foundation, Inc.
+# 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
+# Inc.
# Written by Gordon Matzigkeit, 1996
#
# This file is part of GNU Libtool.
# Whether or not to optimize for fast installation.
fast_install=$enable_fast_install
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# An echo program that protects backslashes.
+ECHO=$lt_ECHO
+
# The host system.
host_alias=$host_alias
host=$host
# turn newlines into spaces.
NL2SP=$lt_lt_NL2SP
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
+# convert \$build file names to \$host format.
+to_host_file_cmd=$lt_cv_to_host_file_cmd
+
+# convert \$build files to toolchain format.
+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
# An object symbol dumper.
OBJDUMP=$lt_OBJDUMP
# Method to check whether dependent libraries are shared objects.
deplibs_check_method=$lt_deplibs_check_method
-# Command to use when deplibs_check_method == "file_magic".
+# Command to use when deplibs_check_method = "file_magic".
file_magic_cmd=$lt_file_magic_cmd
+# How to find potential files when deplibs_check_method = "file_magic".
+file_magic_glob=$lt_file_magic_glob
+
+# Find potential files using nocaseglob when deplibs_check_method = "file_magic".
+want_nocaseglob=$lt_want_nocaseglob
+
+# DLL creation program.
+DLLTOOL=$lt_DLLTOOL
+
+# Command to associate shared and link libraries.
+sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd
+
# The archiver.
AR=$lt_AR
+
+# Flags to create an archive.
AR_FLAGS=$lt_AR_FLAGS
+# How to feed a file listing to the archiver.
+archiver_list_spec=$lt_archiver_list_spec
+
# A symbol stripping program.
STRIP=$lt_STRIP
old_postinstall_cmds=$lt_old_postinstall_cmds
old_postuninstall_cmds=$lt_old_postuninstall_cmds
+# Whether to use a lock for old archive extraction.
+lock_old_archive_extraction=$lock_old_archive_extraction
+
# A C compiler.
LTCC=$lt_CC
# Transform the output of nm in a C name address pair when lib prefix is needed.
global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
+# Specify filename containing input files for \$NM.
+nm_file_list_spec=$lt_nm_file_list_spec
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
+# The root where to search for dependent libraries,and in which our libraries should be installed.
+lt_sysroot=$lt_sysroot
-# An echo program that does not interpret backslashes.
-ECHO=$lt_ECHO
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
# Used to examine libraries when file_magic_cmd begins with "file".
MAGIC_CMD=$MAGIC_CMD
# Must we lock files when doing compilation?
need_locks=$lt_need_locks
+# Manifest tool.
+MANIFEST_TOOL=$lt_MANIFEST_TOOL
+
# Tool to manipulate archived DWARF debug symbol files on Mac OS X.
DSYMUTIL=$lt_DSYMUTIL
# The coded name of the library, if different from the real name.
soname_spec=$lt_soname_spec
+# Permission mode override for installation of shared libraries.
+install_override_mode=$lt_install_override_mode
+
# Command to use after installation of a shared archive.
postinstall_cmds=$lt_postinstall_cmds
# The linker used to build libraries.
LD=$lt_LD
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
# Commands used to build an old-style archive.
old_archive_cmds=$lt_old_archive_cmds
# Compiler flag to turn off builtin functions.
no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl
-
# Additional compiler flags for building library objects.
pic_flag=$lt_lt_prog_compiler_pic
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl
+
# Compiler flag to prevent dynamic linking.
link_static_flag=$lt_lt_prog_compiler_static
# Whether libtool must link a program against all its dependency libraries.
link_all_deplibs=$link_all_deplibs
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path=$lt_fix_srcfile_path
-
# Set to "yes" if exported symbols are required.
always_export_symbols=$always_export_symbols
# Commands necessary for linking programs (against libraries) with templates.
prelink_cmds=$lt_prelink_cmds
+# Commands necessary for finishing linking programs.
+postlink_cmds=$lt_postlink_cmds
+
# Specify filename containing input files.
file_list_spec=$lt_file_list_spec
# if finds mixed CR/LF and LF-only lines. Since sed operates in
# text mode, it properly converts lines to CR/LF. This bash problem
# is reportedly fixed, but why not run on old versions too?
- sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
- || (rm -f "$cfgfile"; exit 1)
-
- case $xsi_shell in
- yes)
- cat << \_LT_EOF >> "$cfgfile"
-
-# func_dirname file append nondir_replacement
-# Compute the dirname of FILE. If nonempty, add APPEND to the result,
-# otherwise set result to NONDIR_REPLACEMENT.
-func_dirname ()
-{
- case ${1} in
- */*) func_dirname_result="${1%/*}${2}" ;;
- * ) func_dirname_result="${3}" ;;
- esac
-}
-
-# func_basename file
-func_basename ()
-{
- func_basename_result="${1##*/}"
-}
-
-# func_dirname_and_basename file append nondir_replacement
-# perform func_basename and func_dirname in a single function
-# call:
-# dirname: Compute the dirname of FILE. If nonempty,
-# add APPEND to the result, otherwise set result
-# to NONDIR_REPLACEMENT.
-# value returned in "$func_dirname_result"
-# basename: Compute filename of FILE.
-# value retuned in "$func_basename_result"
-# Implementation must be kept synchronized with func_dirname
-# and func_basename. For efficiency, we do not delegate to
-# those functions but instead duplicate the functionality here.
-func_dirname_and_basename ()
-{
- case ${1} in
- */*) func_dirname_result="${1%/*}${2}" ;;
- * ) func_dirname_result="${3}" ;;
- esac
- func_basename_result="${1##*/}"
-}
-
-# func_stripname prefix suffix name
-# strip PREFIX and SUFFIX off of NAME.
-# PREFIX and SUFFIX must not contain globbing or regex special
-# characters, hashes, percent signs, but SUFFIX may contain a leading
-# dot (in which case that matches only a dot).
-func_stripname ()
-{
- # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
- # positional parameters, so assign one to ordinary parameter first.
- func_stripname_result=${3}
- func_stripname_result=${func_stripname_result#"${1}"}
- func_stripname_result=${func_stripname_result%"${2}"}
-}
-
-# func_opt_split
-func_opt_split ()
-{
- func_opt_split_opt=${1%%=*}
- func_opt_split_arg=${1#*=}
-}
-
-# func_lo2o object
-func_lo2o ()
-{
- case ${1} in
- *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
- *) func_lo2o_result=${1} ;;
- esac
-}
-
-# func_xform libobj-or-source
-func_xform ()
-{
- func_xform_result=${1%.*}.lo
-}
-
-# func_arith arithmetic-term...
-func_arith ()
-{
- func_arith_result=$(( $* ))
-}
-
-# func_len string
-# STRING may not start with a hyphen.
-func_len ()
-{
- func_len_result=${#1}
-}
-
-_LT_EOF
- ;;
- *) # Bourne compatible functions.
- cat << \_LT_EOF >> "$cfgfile"
-
-# func_dirname file append nondir_replacement
-# Compute the dirname of FILE. If nonempty, add APPEND to the result,
-# otherwise set result to NONDIR_REPLACEMENT.
-func_dirname ()
-{
- # Extract subdirectory from the argument.
- func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
- if test "X$func_dirname_result" = "X${1}"; then
- func_dirname_result="${3}"
- else
- func_dirname_result="$func_dirname_result${2}"
- fi
-}
-
-# func_basename file
-func_basename ()
-{
- func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
-}
-
-
-# func_stripname prefix suffix name
-# strip PREFIX and SUFFIX off of NAME.
-# PREFIX and SUFFIX must not contain globbing or regex special
-# characters, hashes, percent signs, but SUFFIX may contain a leading
-# dot (in which case that matches only a dot).
-# func_strip_suffix prefix name
-func_stripname ()
-{
- case ${2} in
- .*) func_stripname_result=`$ECHO "X${3}" \
- | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;;
- *) func_stripname_result=`$ECHO "X${3}" \
- | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;;
- esac
-}
-
-# sed scripts:
-my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q'
-my_sed_long_arg='1s/^-[^=]*=//'
-
-# func_opt_split
-func_opt_split ()
-{
- func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"`
- func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"`
-}
-
-# func_lo2o object
-func_lo2o ()
-{
- func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"`
-}
-
-# func_xform libobj-or-source
-func_xform ()
-{
- func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[^.]*$/.lo/'`
-}
-
-# func_arith arithmetic-term...
-func_arith ()
-{
- func_arith_result=`expr "$@"`
-}
-
-# func_len string
-# STRING may not start with a hyphen.
-func_len ()
-{
- func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
-}
-
-_LT_EOF
-esac
-
-case $lt_shell_append in
- yes)
- cat << \_LT_EOF >> "$cfgfile"
-
-# func_append var value
-# Append VALUE to the end of shell variable VAR.
-func_append ()
-{
- eval "$1+=\$2"
-}
-_LT_EOF
- ;;
- *)
- cat << \_LT_EOF >> "$cfgfile"
-
-# func_append var value
-# Append VALUE to the end of shell variable VAR.
-func_append ()
-{
- eval "$1=\$$1\$2"
-}
-
-_LT_EOF
- ;;
- esac
-
-
- sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
- || (rm -f "$cfgfile"; exit 1)
-
- mv -f "$cfgfile" "$ofile" ||
+ sed '$q' "$ltmain" >> "$cfgfile" \
+ || (rm -f "$cfgfile"; exit 1)
+
+ if test x"$xsi_shell" = xyes; then
+ sed -e '/^func_dirname ()$/,/^} # func_dirname /c\
+func_dirname ()\
+{\
+\ case ${1} in\
+\ */*) func_dirname_result="${1%/*}${2}" ;;\
+\ * ) func_dirname_result="${3}" ;;\
+\ esac\
+} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_basename ()$/,/^} # func_basename /c\
+func_basename ()\
+{\
+\ func_basename_result="${1##*/}"\
+} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\
+func_dirname_and_basename ()\
+{\
+\ case ${1} in\
+\ */*) func_dirname_result="${1%/*}${2}" ;;\
+\ * ) func_dirname_result="${3}" ;;\
+\ esac\
+\ func_basename_result="${1##*/}"\
+} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_stripname ()$/,/^} # func_stripname /c\
+func_stripname ()\
+{\
+\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\
+\ # positional parameters, so assign one to ordinary parameter first.\
+\ func_stripname_result=${3}\
+\ func_stripname_result=${func_stripname_result#"${1}"}\
+\ func_stripname_result=${func_stripname_result%"${2}"}\
+} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\
+func_split_long_opt ()\
+{\
+\ func_split_long_opt_name=${1%%=*}\
+\ func_split_long_opt_arg=${1#*=}\
+} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\
+func_split_short_opt ()\
+{\
+\ func_split_short_opt_arg=${1#??}\
+\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\
+} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\
+func_lo2o ()\
+{\
+\ case ${1} in\
+\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\
+\ *) func_lo2o_result=${1} ;;\
+\ esac\
+} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_xform ()$/,/^} # func_xform /c\
+func_xform ()\
+{\
+ func_xform_result=${1%.*}.lo\
+} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_arith ()$/,/^} # func_arith /c\
+func_arith ()\
+{\
+ func_arith_result=$(( $* ))\
+} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_len ()$/,/^} # func_len /c\
+func_len ()\
+{\
+ func_len_result=${#1}\
+} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+fi
+
+if test x"$lt_shell_append" = xyes; then
+ sed -e '/^func_append ()$/,/^} # func_append /c\
+func_append ()\
+{\
+ eval "${1}+=\\${2}"\
+} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\
+func_append_quoted ()\
+{\
+\ func_quote_for_eval "${2}"\
+\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\
+} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ # Save a `func_append' function call where possible by direct use of '+='
+ sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+ test 0 -eq $? || _lt_function_replace_fail=:
+else
+ # Save a `func_append' function call even when '+=' is not available
+ sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+ test 0 -eq $? || _lt_function_replace_fail=:
+fi
+
+if test x"$_lt_function_replace_fail" = x":"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5
+$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;}
+fi
+
+
+ mv -f "$cfgfile" "$ofile" ||
(rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
chmod +x "$ofile"
libdir: ${libdir}
rootlibdir: ${rootlib_execdir}
libexecdir: ${libexecdir}
-
datarootdir: ${datarootdir}
mandir: ${mandir}
includedir: ${includedir}
-
include_prefix: ${INCLUDE_PREFIX}
-
systemdsystemunitdir: ${systemdsystemunitdir}
-
- logging: ${enable_logging}
- debug: ${enable_debug}
- selinux: ${with_selinux}
+ firmware path: ${FIRMWARE_PATH}
compiler: ${CC}
cflags: ${CFLAGS}
ldflags: ${LDFLAGS}
-
- extras: ${enable_extras}
- gintrospection: ${enable_introspection}
-
- usb.ids: ${USB_DATABASE}
- pci.ids: ${PCI_DATABASE}
- firmware path: ${FIRMWARE_PATH}
-
xsltproc: ${XSLTPROC}
gperf: ${GPERF}
+
+ logging: ${enable_logging}
+ debug: ${enable_debug}
+ selinux: ${with_selinux}
+
+ gudev: ${enable_gudev}
+ gintrospection: ${enable_introspection}
+ keymap: ${enable_keymap}
+ hwdb: ${enable_hwdb}
+ usb.ids: ${USB_DATABASE}
+ pci.ids: ${PCI_DATABASE}
+ mtd_probe: ${enable_mtd_probe}
+ rule_generator: ${enable_rule_generator}
+ udev_acl: ${enable_udev_acl}
+ floppy: ${enable_floppy}
+ edd: ${enable_edd}
" >&5
$as_echo "
udev $VERSION
libdir: ${libdir}
rootlibdir: ${rootlib_execdir}
libexecdir: ${libexecdir}
-
datarootdir: ${datarootdir}
mandir: ${mandir}
includedir: ${includedir}
-
include_prefix: ${INCLUDE_PREFIX}
-
systemdsystemunitdir: ${systemdsystemunitdir}
-
- logging: ${enable_logging}
- debug: ${enable_debug}
- selinux: ${with_selinux}
+ firmware path: ${FIRMWARE_PATH}
compiler: ${CC}
cflags: ${CFLAGS}
ldflags: ${LDFLAGS}
-
- extras: ${enable_extras}
- gintrospection: ${enable_introspection}
-
- usb.ids: ${USB_DATABASE}
- pci.ids: ${PCI_DATABASE}
- firmware path: ${FIRMWARE_PATH}
-
xsltproc: ${XSLTPROC}
gperf: ${GPERF}
+
+ logging: ${enable_logging}
+ debug: ${enable_debug}
+ selinux: ${with_selinux}
+
+ gudev: ${enable_gudev}
+ gintrospection: ${enable_introspection}
+ keymap: ${enable_keymap}
+ hwdb: ${enable_hwdb}
+ usb.ids: ${USB_DATABASE}
+ pci.ids: ${PCI_DATABASE}
+ mtd_probe: ${enable_mtd_probe}
+ rule_generator: ${enable_rule_generator}
+ udev_acl: ${enable_udev_acl}
+ floppy: ${enable_floppy}
+ edd: ${enable_edd}
" >&6; }
-AC_INIT([udev], [166], [linux-hotplug@vger.kernel.org])
AC_PREREQ(2.60)
-AM_INIT_AUTOMAKE([check-news foreign 1.10 dist-bzip2 subdir-objects])
-m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
+AC_INIT([udev],
+ [174],
+ [linux-hotplug@vger.kernel.org],
+ [udev],
+ [http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html])
+AC_CONFIG_SRCDIR([udev/udevd.c])
+AC_CONFIG_AUX_DIR([build-aux])
+AM_INIT_AUTOMAKE([check-news foreign 1.11 -Wall -Wno-portability silent-rules tar-pax dist-bzip2 subdir-objects])
AC_DISABLE_STATIC
AC_USE_SYSTEM_EXTENSIONS
AC_SYS_LARGEFILE
AC_CONFIG_MACRO_DIR([m4])
+AM_SILENT_RULES([yes])
LT_INIT
AC_PROG_AWK
GTK_DOC_CHECK(1.10)
[], [with_firmware_path="/lib/firmware/updates:/lib/firmware"])
OLD_IFS=$IFS
IFS=:
-for i in $with_firmware_path
-do
+for i in $with_firmware_path; do
if test "x${FIRMWARE_PATH}" = "x"; then
FIRMWARE_PATH="\\\"${i}/\\\""
else
AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
[], [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)])
if test "x$with_systemdsystemunitdir" != xno; then
- AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
+ AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
fi
AM_CONDITIONAL(WITH_SYSTEMD, [test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ])
-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_PATH_PROG([GPERF], [gperf])
- if test -z "$GPERF"; then
- AC_MSG_ERROR([gperf is needed])
- fi
-
+# ------------------------------------------------------------------------------
+# GUdev - libudev gobject interface
+# ------------------------------------------------------------------------------
+AC_ARG_ENABLE([gudev],
+ AS_HELP_STRING([--disable-gudev], [disable Gobject libudev support]),
+ [], [enable_gudev=yes])
+if test "x$enable_gudev" = xyes; then
PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.22.0 gobject-2.0 >= 2.22.0])
- AC_SUBST([GLIB_CFLAGS])
- AC_SUBST([GLIB_LIBS])
-
- 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
- PKG_CHECK_MODULES(LIBUSB, libusb >= 0.1.12)
- AC_SUBST(LIBUSB_CFLAGS)
- AC_SUBST(LIBUSB_LIBS)
+AC_ARG_ENABLE([introspection],
+ AS_HELP_STRING([--disable-introspection], [disable GObject introspection]),
+ [], [enable_introspection=yes])
+if test "x$enable_introspection" = xyes; then
+ PKG_CHECK_MODULES([INTROSPECTION], [gobject-introspection-1.0 >= 0.6.2])
+ AC_DEFINE([ENABLE_INTROSPECTION], [1], [enable GObject introspection support])
+ AC_SUBST([G_IR_SCANNER], [$($PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0)])
+ AC_SUBST([G_IR_COMPILER], [$($PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0)])
+ AC_SUBST([G_IR_GENERATE], [$($PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0)])
+ AC_SUBST([GIRDIR], [$($PKG_CONFIG --define-variable=datadir=${datadir} --variable=girdir gobject-introspection-1.0)])
+ AC_SUBST([GIRTYPELIBDIR], [$($PKG_CONFIG --define-variable=libdir=${libdir} --variable=typelibdir gobject-introspection-1.0)])
+fi
+AM_CONDITIONAL([ENABLE_INTROSPECTION], [test "x$enable_introspection" = xyes])
- PKG_CHECK_MODULES(USBUTILS, usbutils >= 0.82)
- AC_SUBST([USB_DATABASE], [$($PKG_CONFIG --variable=usbids usbutils)])
+AM_CONDITIONAL([ENABLE_GUDEV], [test "x$enable_gudev" = xyes])
+# ------------------------------------------------------------------------------
+# usb/pci-db - read vendor/device string database
+# ------------------------------------------------------------------------------
+AC_ARG_ENABLE([hwdb],
+ AS_HELP_STRING([--disable-hwdb], [disable hardware database support]),
+ [], [enable_hwdb=yes])
+if test "x$enable_hwdb" = 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])
AC_CHECK_FILES([/usr/share/misc/pci.ids], [pciids=/usr/share/misc/pci.ids])
fi
+
+ AC_ARG_WITH(usb-ids-path,
+ [AS_HELP_STRING([--with-usb-ids-path=DIR], [Path to usb.ids file])],
+ [USB_DATABASE=${withval}],
+ [if test -n "$usbids" ; then
+ USB_DATABASE="$usbids"
+ else
+ PKG_CHECK_MODULES(USBUTILS, usbutils >= 0.82)
+ AC_SUBST([USB_DATABASE], [$($PKG_CONFIG --variable=usbids usbutils)])
+ fi])
+ AC_MSG_CHECKING([for USB database location])
+ AC_MSG_RESULT([$USB_DATABASE])
+ AC_SUBST(USB_DATABASE)
+
AC_ARG_WITH(pci-ids-path,
[AS_HELP_STRING([--with-pci-ids-path=DIR], [Path to pci.ids file])],
[PCI_DATABASE=${withval}],
AC_MSG_CHECKING([for PCI database location])
AC_MSG_RESULT([$PCI_DATABASE])
AC_SUBST(PCI_DATABASE)
+fi
+AM_CONDITIONAL([ENABLE_HWDB], [test "x$enable_hwdb" = xyes])
+
+# ------------------------------------------------------------------------------
+# keymap - map custom hardware's multimedia keys
+# ------------------------------------------------------------------------------
+AC_ARG_ENABLE([keymap],
+ AS_HELP_STRING([--disable-keymap], [disable keymap fixup support]),
+ [], [enable_keymap=yes])
+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
-AM_CONDITIONAL([ENABLE_EXTRAS], [test "x$enable_extras" = xyes])
+AM_CONDITIONAL([ENABLE_KEYMAP], [test "x$enable_keymap" = xyes])
-AC_ARG_ENABLE([introspection],
- AS_HELP_STRING([--disable-introspection], [disable GObject introspection]),
- [], [enable_introspection=yes])
-if test "x$enable_introspection" = xyes; then
- PKG_CHECK_MODULES([INTROSPECTION], [gobject-introspection-1.0 >= 0.6.2])
- AC_DEFINE([ENABLE_INTROSPECTION], [1], [enable GObject introspection support])
- AC_SUBST([G_IR_SCANNER], [$($PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0)])
- AC_SUBST([G_IR_COMPILER], [$($PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0)])
- AC_SUBST([G_IR_GENERATE], [$($PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0)])
- AC_SUBST([GIRDIR], [$($PKG_CONFIG --define-variable=datadir=${datadir} --variable=girdir gobject-introspection-1.0)])
- AC_SUBST([GIRTYPELIBDIR], [$($PKG_CONFIG --define-variable=libdir=${libdir} --variable=typelibdir gobject-introspection-1.0)])
+# ------------------------------------------------------------------------------
+# mtd_probe - autoloads FTL module for mtd devices
+# ------------------------------------------------------------------------------
+AC_ARG_ENABLE([mtd_probe],
+ AS_HELP_STRING([--disable-mtd_probe], [disable MTD support]),
+ [], [enable_mtd_probe=yes])
+AM_CONDITIONAL([ENABLE_MTD_PROBE], [test "x$enable_mtd_probe" = xyes])
+
+# ------------------------------------------------------------------------------
+# rule_generator - persistent network and optical device rule generator
+# ------------------------------------------------------------------------------
+AC_ARG_ENABLE([rule_generator],
+ AS_HELP_STRING([--enable-rule_generator], [enable persistent network + cdrom links support]),
+ [], [enable_rule_generator=no])
+AM_CONDITIONAL([ENABLE_RULE_GENERATOR], [test "x$enable_rule_generator" = xyes])
+
+# ------------------------------------------------------------------------------
+# udev_acl - apply ACLs for users with local forground sessions
+# ------------------------------------------------------------------------------
+AC_ARG_ENABLE([udev_acl],
+ AS_HELP_STRING([--enable-udev_acl], [enable local user acl permissions support]),
+ [], [enable_udev_acl=no])
+if test "x$enable_udev_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]))
+
+ PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.22.0 gobject-2.0 >= 2.22.0])
fi
-AM_CONDITIONAL([ENABLE_INTROSPECTION], [test "x$enable_introspection" = xyes])
+AM_CONDITIONAL([ENABLE_UDEV_ACL], [test "x$enable_udev_acl" = xyes])
+
+# ------------------------------------------------------------------------------
+# create_floppy_devices - historical floppy kernel device nodes (/dev/fd0h1440, ...)
+# ------------------------------------------------------------------------------
+AC_ARG_ENABLE([floppy],
+ AS_HELP_STRING([--enable-floppy], [enable legacy floppy support]),
+ [], [enable_floppy=no])
+AM_CONDITIONAL([ENABLE_FLOPPY], [test "x$enable_floppy" = xyes])
+
+# ------------------------------------------------------------------------------
+# edd_id - create /dev/disk/by-id/edd-* links for BIOS EDD data
+# ------------------------------------------------------------------------------
+AC_ARG_ENABLE([edd],
+ AS_HELP_STRING([--enable-edd], [enable disk edd support]),
+ [], [enable_edd=no])
+AM_CONDITIONAL([ENABLE_EDD], [test "x$enable_edd" = xyes])
AC_CONFIG_HEADERS(config.h)
AC_CONFIG_FILES([
Makefile
udev/udev.pc
init/udev.service
+ init/udev-trigger.service
init/udev-settle.service
- init/udev-retry.service
libudev/libudev.pc
libudev/docs/Makefile
libudev/docs/version.xml
libdir: ${libdir}
rootlibdir: ${rootlib_execdir}
libexecdir: ${libexecdir}
-
datarootdir: ${datarootdir}
mandir: ${mandir}
includedir: ${includedir}
-
include_prefix: ${INCLUDE_PREFIX}
-
systemdsystemunitdir: ${systemdsystemunitdir}
-
- logging: ${enable_logging}
- debug: ${enable_debug}
- selinux: ${with_selinux}
+ firmware path: ${FIRMWARE_PATH}
compiler: ${CC}
cflags: ${CFLAGS}
ldflags: ${LDFLAGS}
-
- extras: ${enable_extras}
- gintrospection: ${enable_introspection}
-
- usb.ids: ${USB_DATABASE}
- pci.ids: ${PCI_DATABASE}
- firmware path: ${FIRMWARE_PATH}
-
xsltproc: ${XSLTPROC}
gperf: ${GPERF}
+
+ logging: ${enable_logging}
+ debug: ${enable_debug}
+ selinux: ${with_selinux}
+
+ gudev: ${enable_gudev}
+ gintrospection: ${enable_introspection}
+ keymap: ${enable_keymap}
+ hwdb: ${enable_hwdb}
+ usb.ids: ${USB_DATABASE}
+ pci.ids: ${PCI_DATABASE}
+ mtd_probe: ${enable_mtd_probe}
+ rule_generator: ${enable_rule_generator}
+ udev_acl: ${enable_udev_acl}
+ floppy: ${enable_floppy}
+ edd: ${enable_edd}
])
+udev (174-1slp2+s1) unstable; urgency=low
+
+ * udev version update(v.166->174)
+ * Git: slp/pkgs/u/udev
+ * Tag: udev_174-1slp2+s1
+
+ -- Jooseok Park <jooseok.park@samsung.com> Wed, 20 Jun 2012 17:29:28 +0900
+
+udev (166-1slp2+s12) unstable; urgency=low
+
+ * Modify Makefile.am to remove 75-persistent-net-generator.rules
+ * Git: slp/pkgs/u/udev
+ * Tag: udev_166-1slp2+s12
+
+ -- Kyuwook Lim <kyuwook.lim@samsung.com> Fri, 13 Apr 2012 19:58:28 +0900
+
+udev (166-1slp2+s11) unstable; urgency=low
+
+ * Delete rules/debian/75-persistent-net-generator.rules for wifi interface issue
+ * Git: slp/pkgs/u/udev
+ * Tag: udev_166-1slp2+s11
+
+ -- Kyuwook Lim <kyuwook.lim@samsung.com> Thu, 12 Apr 2012 14:09:38 +0900
+
udev (166-1slp2+s10) unstable; urgency=low
[ Kim Hyunhee ]
Source: udev
Section: admin
Priority: important
-Maintainer: Hyunhee Kim <hyunhee.kim@samsung.com>
-Uploaders: Hyunhee Kim <hyunhee.kim@samsung.com>, Rafal Krypa <r.krypa@samsung.com>
+Maintainer: WaLyong Cho <walyong.cho@samsung.com>, Jooseok Park <jooseok.park@samsung.com>
+Uploaders: WaLyong Cho <walyong.cho@samsung.com>, Jooseok Park <jooseok.park@samsung.com>, Rafal Krypa <r.krypa@samsung.com>
X-Original-Maintainer: Marco d'Itri <md@linux.it>
Build-Depends: debhelper (>> 7), hardening-includes, quilt (>= 0.40), libglib2.0-dev (>= 2.12.0), libusb-dev (>= 1:0.1.12), libacl1-dev, usbutils (>= 0.86-2), pciutils, libc6-dev (>= 2.9) [!alpha !ia64], libc6.1-dev (>= 2.9) [alpha ia64], linux-libc-dev (>= 2.6.29), autoconf, automake, libtool (>= 2.2.2), gtk-doc-tools, xsltproc, docbook-xsl, gperf
Standards-Version: 3.9.1
+++ /dev/null
-# This file lists modules which will not be loaded as the result of
-# alias expansion, with the purpose of preventing the hotplug subsystem
-# to load them. It does not affect autoloading of modules by the kernel.
-# This file is provided by the udev package.
-
-# evbug is a debug tool and should be loaded explicitly
-blacklist evbug
-
-# these drivers are very simple, the HID drivers are usually preferred
-blacklist usbmouse
-blacklist usbkbd
-
-# replaced by e100
-blacklist eepro100
-
-# replaced by tulip
-blacklist de4x5
-
-# replaced by tmscsim
-blacklist am53c974
-
-# these watchdog drivers break some systems
-blacklist iTCO_wdt
-
+++ /dev/null
-#!/bin/sh -e
-
-make_extra_nodes() {
- [ -e /etc/udev/links.conf ] || return 0
-
- grep '^[^#]' /etc/udev/links.conf | \
- while read type name arg1; do
- [ "$type" -a "$name" -a ! -e "/$1/$name" -a ! -L "/$1/$name" ] || continue
- case "$type" in
- L) ln -s $arg1 /$1/$name ;;
- D) mkdir -p /$1/$name ;;
- M) mknod -m 600 /$1/$name $arg1 ;;
- *) echo "links.conf: unparseable line ($type $name $arg1)" >&2 ;;
- esac
-
- if [ -x /sbin/restorecon ]; then
- /sbin/restorecon /dev/$name
- fi
- done
-}
-
-if [ "$1" ]; then
- devdir="$1"
-else
- devdir='/dev'
-fi
-
-make_extra_nodes $devdir
-
-exit 0
-
+++ /dev/null
-#!/bin/sh -e
-#
-# Copyright 2008 Marco d'Itri <md@Linux.IT>
-#
-# This script automatically starts networking when a DSL modem is connected
-# and its ATM interface is ready.
-#
-#
-# For PPPoE you can set PROTOCOL=2684bridged and then add something like
-# this to /etc/network/interfaces:
-#
-# allow-hotplug nas0
-# iface nas0 inet manual
-# pre-up ip link set up $IFACE
-# up pppd persist call dsl-provider
-#
-#
-# Support for CLIP (Classical IP over ATM, RFC 1577) may be incomplete.
-#
-
-# defaults
-[ "$IP_INTERFACE" ] || IP_INTERFACE='nas0'
-[ "$VP" ] || VP='8'
-[ "$VC" ] || VC='35'
-
-if [ -e /etc/default/dsl-modem.agent ]; then
- . /etc/default/dsl-modem.agent
-fi
-
-# just exit unless a protocol is configured
-[ "$PROTOCOL" ] || exit 0
-
-##############################################################################
-wait_and_run_pppd() {
- # this guarantees that everything pppd needs to work is ready
- wait_for_file /dev/log
-
- exec pppd persist call ${PPP_PEER:-dsl-provider}
-}
-
-wait_and_run_br2684ctl() {
- wait_for_file /dev/log
-
- exec br2684ctl $BR2684_ARGS -b -c ${IP_INTERFACE#nas} \
- -a ${ATM_INTERFACE}.${VP}.${VC}
-}
-
-wait_and_run_atmarp() {
- wait_for_file /var/run/atmarpd.table
-
- # create the IP interface
- atmarp -c ${IP_INTERFACE:-atm0}
- # setup the VC
-# atmarp -s 192.0.2.254 ${ATM_INTERFACE}.${VP}.${VC}
- exec ifup ${IP_INTERFACE:-atm0} # XXX
-}
-
-##############################################################################
-ATM_DRIVER=${NAME%%[0-9]*}
-ATM_INTERFACE=${NAME##$ATM_DRIVER}
-
-# is this a DSL modem?
-case "$ATM_DRIVER" in
-cxacru|speedtch|ueagle-atm|xusbatm|UNICORN) ;;
-*) exit 0 ;;
-esac
-
-cd /lib/udev/
-. ./hotplug.functions
-
-##############################################################################
-case "$ACTION" in
-add)
- case "$PROTOCOL" in
- pppoa) wait_and_run_pppd & ;;
- 2684bridged) wait_and_run_br2684ctl & ;;
- clip) wait_and_run_atmarp & ;;
- esac
- ;;
-
-remove)
- case "$PROTOCOL" in
- pppoa)
- # pppd will terminate automatically
- ;;
- 2684bridged)
- PIDFILE="/var/run/br2684ctl-$IP_INTERFACE.pid"
- if [ -e $PIDFILE ]; then
- kill $(cat $PIDFILE)
- rm -f $PIDFILE
- fi
- ;;
- clip)
- ifdown ${IP_INTERFACE:-atm0} # XXX
-# atmarp -d 192.0.2.254
- ;;
- esac
- ;;
-esac
-
-exit 0
-
+++ /dev/null
-# This file blacklists the framebuffer drivers.
-
-blacklist arkfb
-blacklist aty128fb
-blacklist atyfb
-blacklist radeonfb
-blacklist cirrusfb
-blacklist cyber2000fb
-blacklist gx1fb
-blacklist gxfb
-blacklist lxfb
-blacklist kyrofb
-blacklist matroxfb_base
-blacklist mb862xxfb
-blacklist neofb
-blacklist nvidiafb
-blacklist pm2fb
-blacklist pm3fb
-blacklist s3fb
-blacklist savagefb
-blacklist sisfb
-blacklist tdfxfb
-blacklist tridentfb
-blacklist viafb
-blacklist vt8623fb
+++ /dev/null
-#!/bin/sh -e
-#
-# firmware loader agent
-#
-
-cd /lib/udev/
-. ./hotplug.functions
-
-if [ ! -e /sys/$DEVPATH/loading ]; then
- mesg "/sys/$DEVPATH/ does not exist"
- exit 1
-fi
-
-FIRMWARE_DIRS="/lib/firmware/$(uname -r) /lib/firmware /usr/local/lib/firmware /usr/lib/hotplug/firmware"
-
-for DIR in $FIRMWARE_DIRS; do
- [ -e "$DIR/$FIRMWARE" ] || continue
- echo 1 > /sys/$DEVPATH/loading
- cat "$DIR/$FIRMWARE" > /sys/$DEVPATH/data
- echo 0 > /sys/$DEVPATH/loading
- exit 0
-done
-
-# the firmware was not found
-echo -1 > /sys/$DEVPATH/loading
-
-if [ -d /dev/.udev/ ]; then
- mkdir -p /dev/.udev/firmware-missing/
- file=$(echo "$FIRMWARE" | sed -e 's#/#\\x2f#g')
- ln -s -f "$DEVPATH" /dev/.udev/firmware-missing/$file
-fi
-
-debug_mesg "Cannot find the $FIRMWARE firmware"
-exit 1
-
+++ /dev/null
-# Setup and shell utility functions for use in hotplug agents.
-# vim: syntax=sh
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation version 2 of the License.
-
-if [ "$UDEV_LOG" ] && [ "$UDEV_LOG" -ge 7 ]; then
- DEBUG=yes
-fi
-
-PATH='/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin'
-
-[ -e /etc/default/hotplug ] && . /etc/default/hotplug
-
-
-if [ -x /usr/bin/logger ]; then
- LOGGER=/usr/bin/logger
-elif [ -x /bin/logger ]; then
- LOGGER=/bin/logger
-else
- unset LOGGER
-fi
-
-# for diagnostics
-if [ -t 1 -a -z "$LOGGER" ] || [ ! -e '/dev/log' ]; then
- mesg() {
- echo "$@" >&2
- }
-elif [ -t 1 ]; then
- mesg() {
- echo "$@"
- $LOGGER -t "${0##*/}[$$]" "$@"
- }
-else
- mesg() {
- $LOGGER -t "${0##*/}[$$]" "$@"
- }
-fi
-
-debug_mesg() {
- [ -z "$DEBUG" -o "$DEBUG" = no ] && return 0
- mesg "$@"
-}
-
-wait_for_file() {
- local file=$1
- local timeout=$2
- [ "$timeout" ] || timeout=120
-
- local count=$timeout
- while [ $count != 0 ]; do
- [ -e "$file" ] && return 0
- sleep 1
- count=$(($count - 1))
- done
-
- mesg "$file did not appear before the timeout!"
- exit 1
-}
-
+++ /dev/null
-#!/bin/sh -e
-
-PREREQS=""
-
-prereqs() { echo "$PREREQS"; }
-
-case "$1" in
- prereqs)
- prereqs
- exit 0
- ;;
-esac
-
-# Stop udevd, we'll miss a few events while we run init, but we catch up
-for proc in /proc/[0-9]*; do
- [ -x $proc/exe ] || continue
- if [ "$(readlink $proc/exe)" = /sbin/udevd ]; then
- # errors must be ignored due to a race with udevd child processes
- # naturally terminating
- kill ${proc#/proc/} 2> /dev/null || true
- fi
-done
-
-udev_root="/dev"
-if [ -e /etc/udev/udev.conf ]; then
- . /etc/udev/udev.conf
-fi
-
-# move the /dev tmpfs to the rootfs
-mount -n -o move /dev ${rootmnt}${udev_root}
-
-# create a temporary symlink to the final /dev for other initramfs scripts
-nuke /dev
-ln -s ${rootmnt}${udev_root} /dev
-
+++ /dev/null
-#!/bin/sh -e
-
-PREREQS=""
-
-prereqs() { echo "$PREREQS"; }
-
-case "$1" in
- prereqs)
- prereqs
- exit 0
- ;;
-esac
-
-root_over_the_network() {
- if egrep -q '^/dev/(nbd|nd[a-z]|etherd/e)[^[:space:]]+[[:space:]]+/[[:space:]]' /etc/fstab; then
- return 0
- elif egrep -q '^[^[:space:]#]+[[:space:]]+/[[:space:]]+nfs[234]?[[:space:]]' /etc/fstab; then
- return 0
- fi
- return 1 # false
-}
-
-. /usr/share/initramfs-tools/hook-functions
-
-# udevd uses unix domain sockets for communication
-force_load unix
-
-copy_exec /sbin/udevd /sbin
-copy_exec /sbin/udevadm /sbin
-
-mkdir -p $DESTDIR/etc/udev
-cp -p /etc/udev/udev.conf $DESTDIR/etc/udev/
-
-mkdir -p $DESTDIR/lib/udev/rules.d/
-for rules in 50-udev-default.rules 60-persistent-storage.rules \
- 80-drivers.rules 91-permissions.rules \
- 64-md-raid.rules 60-persistent-storage-lvm.rules \
- 55-dm.rules 60-persistent-storage-dm.rules; do
- if [ -e /etc/udev/rules.d/$rules ]; then
- cp -p /etc/udev/rules.d/$rules $DESTDIR/lib/udev/rules.d/
- elif [ -e /lib/udev/rules.d/$rules ]; then
- cp -p /lib/udev/rules.d/$rules $DESTDIR/lib/udev/rules.d/
- fi
-done
-
-# try to autodetect the value of this configuration option
-if [ -z "$NEED_PERSISTENT_NET" ] && root_over_the_network; then
- NEED_PERSISTENT_NET='yes'
-fi
-
-# Copy the rules for persistent network interface names for the benefit of
-# systems which need to boot over the network. If this is enabled then the
-# initramfs must be rebuilt every time a new network interface is added.
-# See #414287 for details.
-case "$NEED_PERSISTENT_NET" in
-YES|yes|Yes|Y|y)
- if [ -e /etc/udev/rules.d/70-persistent-net.rules ]; then
- cp -p /etc/udev/rules.d/70-persistent-net.rules $DESTDIR/lib/udev/rules.d/
- fi
- ;;
-esac
-
-cp /lib/udev/hotplug.functions $DESTDIR/lib/udev/
-for program in firmware.agent ata_id edd_id path_id scsi_id usb_id; do
- copy_exec /lib/udev/$program /lib/udev
-done
-copy_exec /sbin/blkid /sbin
-
-if [ -x /lib/udev/vio_type ]; then
- copy_exec /lib/udev/vio_type /lib/udev
-fi
-
+++ /dev/null
-#!/bin/sh -e
-
-PREREQS=""
-
-prereqs() { echo "$PREREQS"; }
-
-case "$1" in
- prereqs)
- prereqs
- exit 0
- ;;
-esac
-
-echo > /sys/kernel/uevent_helper
-
-UDEV_ROOT=/dev \
-udevd --daemon --resolve-names=never
-
-udevadm trigger --action=add
-udevadm settle || true
-
-if [ -d /sys/bus/scsi ]; then
- modprobe -q scsi_wait_scan && modprobe -r scsi_wait_scan || true
- udevadm settle || true
-fi
-
-# If the rootdelay parameter has been set, we wait a bit for devices
-# like usb/firewire disks to settle.
-if [ "$ROOTDELAY" ]; then
- sleep $ROOTDELAY
-fi
-
-# Leave udev running to process events that come in out-of-band (like USB
-# connections)
+++ /dev/null
-# This file does not exist. Please do not ask the Debian maintainer about it.
-# If you need manually created devices, create them in /lib/udev/devices/ .
-
-D pts
-D shm
-
-M null c 1 3
-M console c 5 1
-
-# Hic sunt leones.
-M ppp c 108 0
-M loop0 b 7 0
-D net
-M net/tun c 10 200
-
+++ /dev/null
-#!/bin/sh -e
-#
-# log the event to a file
-#
-
-cd /lib/udev/
-. ./hotplug.functions
-
-# provide env-like output when the real thing is not available
-if [ ! -x /usr/bin/env ]; then
- env() {
- # bash prepends "declare -x " at the beginning of each line
- export -p | sed -e 's/^\(declare -x\|export\) //'
- }
-fi
-
-# writes a copy of the current hotplug event to stdout
-log_to_stdout()
-{
- {
- echo "HOTPLUG_TIME='$(date)'"
- env
- echo ''
- } | egrep -v "^'$|^(_|PATH|PWD|PPID|SHLVL|HOME|IFS|OPTIND|PS[1234])="
-}
-
-[ "$EVENTS_LOG" ] || EVENTS_LOG='/dev/hotplug.log'
-
-log_to_stdout >> $EVENTS_LOG
-
-exit 0
-
+++ /dev/null
-#!/bin/sh
-# This script should be run before building the package every time a new
-# kernel is released.
-
-set -e
-
-BL='fbdev-blacklist.conf'
-
-if [ -e extra/$BL ]; then cd extra; fi
-
-{
-printf "# This file blacklists the framebuffer drivers.\n\n"
-
-find /lib/modules/$(uname -r)/kernel/drivers/video -type f | sort | \
-while read file; do
- /sbin/modinfo $file | grep -q '^alias: *pci:' \
- && echo blacklist $(basename $file .ko) || true
-done
-} > $BL.tmp
-
-if diff --unified=0 $BL $BL.tmp; then
- rm $BL.tmp
-else
- printf "\n\n\n$BL.tmp has changes!\n\n\n\n"
-fi
-
+++ /dev/null
-#!/bin/sh -e
-#
-# run /sbin/{ifup,ifdown} with the --allow=hotplug option.
-#
-
-. /lib/udev/hotplug.functions
-
-if [ -z "$INTERFACE" ]; then
- mesg "Bad net.agent invocation: \$INTERFACE is not set"
- exit 1
-fi
-
-check_program() {
- [ -x $1 ] && return 0
-
- mesg "ERROR: $1 not found. You need to install the ifupdown package."
- mesg "net.agent $ACTION event for $INTERFACE not handled."
- exit 1
-}
-
-wait_for_interface() {
- local interface=$1
-
- while :; do
- local state="$(cat /sys/class/net/$interface/operstate 2>/dev/null || true)"
- if [ "$state" != down ]; then
- return 0
- fi
- sleep 1
- done
-}
-
-net_ifup() {
- check_program /sbin/ifup
-
- if grep -q '^auto[[:space:]].*\<'"$INTERFACE"'\>' \
- /etc/network/interfaces; then
- # this $INTERFACE is marked as "auto"
- IFUPARG='\('$INTERFACE'\|-a\|--all\)'
- else
- IFUPARG=$INTERFACE
- fi
-
- if ps -C ifup ho args | grep -q "$IFUPARG"; then
- debug_mesg "Already ifup-ing interface $INTERFACE"
- exit 0
- fi
-
- wait_for_interface lo
- if [ -e /bin/systemctl ]; then
- wait_for_file /dev/log
- fi
-
- exec ifup --allow=hotplug $INTERFACE
-}
-
-net_ifdown() {
- check_program /sbin/ifdown
-
- if ps -C ifdown ho args | grep -q $INTERFACE; then
- debug_mesg "Already ifdown-ing interface $INTERFACE"
- exit 0
- fi
-
- exec ifdown --allow=hotplug $INTERFACE
-}
-
-do_everything() {
-
-case "$ACTION" in
- add)
- # these interfaces generate hotplug events *after* they are brought up
- case $INTERFACE in
- ppp*|ippp*|isdn*|plip*|lo|irda*|ipsec*)
- exit 0 ;;
- esac
-
- net_ifup
- ;;
-
- remove)
- # the pppd persist option may have been used, so it should not be killed
- case $INTERFACE in
- ppp*)
- exit 0 ;;
- esac
-
- net_ifdown
- ;;
-
- *)
- debug_mesg "NET $ACTION event not supported"
- exit 1
- ;;
-esac
-
-}
-
-# When udev_log="debug" stdout and stderr are pipes connected to udevd.
-# They need to be closed or udevd will wait for this process which will
-# deadlock with udevsettle until the timeout.
-do_everything > /dev/null 2> /dev/null &
-
-exit 0
-
+++ /dev/null
-#!/usr/bin/perl
-
-use warnings;
-use strict;
-
-my $base = $ARGV[0] || die;
-
-my $file = "$base/lib/udev/rules.d/70-acl.rules";
-my $program = "$base/lib/udev/udev-acl";
-my $library = 'libglib-2.0.so.0';
-
-##############################################################################
-my $rules = read_file($file);
-
-my $libfile = library_path($program, $library)
- or die "Cannot find the path of $library in $program!";
-
-$rules =~ s#\@GLIB_PATH\@#$libfile#;
-
-print "Updating $file for $libfile.\n";
-write_file($file, $rules);
-
-exit 0;
-
-##############################################################################
-sub library_path {
- my ($file, $library) = @_;
-
- open(LDD, "ldd $file |") or die "open(ldd $file |): $!";
- my $libfile;
- while (<LDD>) {
- next unless m#^\s*(\S+)\s+=>\s+(\S+)\s+#;
- next unless $1 eq $library;
- $libfile = $2;
- }
- close LDD or die "close(ldd $file |): status=$?";
-
- return $libfile;
-}
-
-##############################################################################
-sub read_file {
- my ($file) = @_;
- open(FILE, $file) or die "open($file): $!";
- local $/ = undef;
- my $data = <FILE>;
- close FILE;
- return $data;
-}
-
-sub write_file {
- my ($file, $data) = @_;
- open(FILE, '>', $file) or die "open(> $file): $!";
- print FILE $data;
- close FILE or die "close($file): $!";
-}
-
+++ /dev/null
-#!/bin/sh -e
-
-RULESDIR=etc/udev/rules.d
-
-mkdir -p /target/$RULESDIR
-cp /$RULESDIR/70-persistent-*.rules /target/$RULESDIR 2>/dev/null || true
-
+++ /dev/null
-#!/bin/sh -e
-
-make_extra_nodes() {
- [ -e /etc/udev/links.conf ] || return 0
- grep '^[^#]' /etc/udev/links.conf | \
- while read type name arg1; do
- [ "$type" -a "$name" -a ! -e "/dev/$name" -a ! -L "/dev/$name" ] ||continue
- case "$type" in
- L) ln -s $arg1 /dev/$name ;;
- D) mkdir -p /dev/$name ;;
- M) mknod -m 600 /dev/$name $arg1 ;;
- *) echo "links.conf: unparseable line ($type $name $arg1)" ;;
- esac
- done
-}
-
-echo > /sys/kernel/uevent_helper
-
-if ! grep -E -q "^[^[:space:]]+ /dev (dev)?tmpfs" /proc/mounts; then
- mount -n -o mode=0755 -t tmpfs tmpfs /dev
-fi
-make_extra_nodes
-
-udevd --daemon --resolve-names=never
-
-udevadm trigger --action=add
-
-mount /dev/pts
-
-udevadm settle || true
-
-if [ -d /sys/bus/scsi ]; then
- modprobe -q scsi_wait_scan && modprobe -r scsi_wait_scan || true
- udevadm settle || true
-fi
-
-exit 0
-
+++ /dev/null
-" Vim syntax file
-" Language: udev rules files
-" Maintainer: Marco d'Itri <md@linux.it>
-" Last Change: 2005 August
-"
-" This syntax file is unfinished. If you can, please clean it up and submit
-" it for inclusion in the vim package.
-
-if exists("b:current_syntax")
- finish
-endif
-
-let b:current_syntax = "udev"
-
-syn keyword Ucondition ACTION ENV RESULT KERNEL SUBSYSTEM DRIVER ATTR
-syn keyword Ucondition KERNELS SUBSYSTEMS DRIVERS ATTRS DEVPATH TEST
-syn keyword Ucondition nextgroup=Uparambr,Uoperator
-syn keyword Uaction PROGRAM NAME SYMLINK OWNER GROUP MODE RUN OPTIONS
-syn keyword Uaction IMPORT GOTO LABEL
-syn keyword Uaction nextgroup=Uparambr,Uoperator
-syn region Uparambr start=/{/ end=/}/ contains=Uparam
-syn match Uparam '[A-Za-z0-9_]*' contained
-syn match Ufnmatch "[?*|]" contained
-syn region Ufnmatch start=/\[/ skip=/\\\]/ end=/\]/ contained
-syn match Uprintf '%[beknMmps%]\|%c{[0-9]}' contained
-syn match Ustringvar '\$[a-z]*' nextgroup=Uparambr
-syn match Ustring '"[^"]*"' contains=Uprintf,Ufnmatch,Ustringvar
-syn match Uoperator "==\|!=\|=\|+=\|:=\|,"
-syn match Ueol '\\$'
-syn region Ucomment start=/#/ end=/$/
-syn keyword Utodo contained TODO FIXME XXX
-
-hi def link Ucondition Identifier
-hi def link Uaction Identifier
-hi def link Uparambr Delimiter
-hi def link Uparam PreProc
-hi def link Ufnmatch Special
-hi def link Uprintf Special
-hi def link Ustringvar Function
-hi def link Ustring String
-hi def link Uoperator Operator
-hi def link Ueol Delimiter
-hi def link Ucomment Comment
-hi def link Utodo Todo
-
--- /dev/null
+# do not edit this file, it will be overwritten on update
+
+SUBSYSTEM=="input", ACTION!="remove", ENV{ID_INPUT_ACCELEROMETER}=="1", IMPORT{program}="accelerometer %p"
--- /dev/null
+/*
+ * accelerometer - exports device orientation through property
+ *
+ * When an "change" event is received on an accelerometer,
+ * open its device node, and from the value, as well as the previous
+ * value of the property, calculate the device's new orientation,
+ * and export it as ID_INPUT_ACCELEROMETER_ORIENTATION.
+ *
+ * Possible values are:
+ * undefined
+ * * normal
+ * * bottom-up
+ * * left-up
+ * * right-up
+ *
+ * The property will be persistent across sessions, and the new
+ * orientations can be deducted from the previous one (it allows
+ * for a threshold for switching between opposite ends of the
+ * orientation).
+ *
+ * Copyright (C) 2011 Red Hat, Inc.
+ * Author:
+ * Bastien Nocera <hadess@hadess.net>
+ *
+ * orientation_calc() from the sensorfw package
+ * Copyright (C) 2009-2010 Nokia Corporation
+ * Authors:
+ * Üstün Ergenoglu <ext-ustun.ergenoglu@nokia.com>
+ * Timo Rongas <ext-timo.2.rongas@nokia.com>
+ * Lihan Guo <lihan.guo@digia.com>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with keymap; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <math.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <getopt.h>
+#include <limits.h>
+#include <linux/limits.h>
+#include <linux/input.h>
+
+#include "libudev.h"
+#include "libudev-private.h"
+
+/* we must use this kernel-compatible implementation */
+#define BITS_PER_LONG (sizeof(unsigned long) * 8)
+#define NBITS(x) ((((x)-1)/BITS_PER_LONG)+1)
+#define OFF(x) ((x)%BITS_PER_LONG)
+#define BIT(x) (1UL<<OFF(x))
+#define LONG(x) ((x)/BITS_PER_LONG)
+#define test_bit(bit, array) ((array[LONG(bit)] >> OFF(bit)) & 1)
+
+static int debug = 0;
+
+static void log_fn(struct udev *udev, int priority,
+ const char *file, int line, const char *fn,
+ const char *format, va_list args)
+{
+ if (debug) {
+ fprintf(stderr, "%s: ", fn);
+ vfprintf(stderr, format, args);
+ } else {
+ vsyslog(priority, format, args);
+ }
+}
+
+typedef enum {
+ ORIENTATION_UNDEFINED,
+ ORIENTATION_NORMAL,
+ ORIENTATION_BOTTOM_UP,
+ ORIENTATION_LEFT_UP,
+ ORIENTATION_RIGHT_UP
+} OrientationUp;
+
+static const char *orientations[] = {
+ "undefined",
+ "normal",
+ "bottom-up",
+ "left-up",
+ "right-up",
+ NULL
+};
+
+#define ORIENTATION_UP_UP ORIENTATION_NORMAL
+
+#define DEFAULT_THRESHOLD 250
+#define RADIANS_TO_DEGREES 180.0/M_PI
+#define SAME_AXIS_LIMIT 5
+
+#define THRESHOLD_LANDSCAPE 25
+#define THRESHOLD_PORTRAIT 20
+
+static const char *
+orientation_to_string (OrientationUp o)
+{
+ return orientations[o];
+}
+
+static OrientationUp
+string_to_orientation (const char *orientation)
+{
+ int i;
+
+ if (orientation == NULL)
+ return ORIENTATION_UNDEFINED;
+ for (i = 0; orientations[i] != NULL; i++) {
+ if (strcmp (orientation, orientations[i]) == 0)
+ return i;
+ }
+ return ORIENTATION_UNDEFINED;
+}
+
+static OrientationUp
+orientation_calc (OrientationUp prev,
+ int x, int y, int z)
+{
+ int rotation;
+ OrientationUp ret = prev;
+
+ /* Portrait check */
+ rotation = round(atan((double) x / sqrt(y * y + z * z)) * RADIANS_TO_DEGREES);
+
+ if (abs(rotation) > THRESHOLD_PORTRAIT) {
+ ret = (rotation < 0) ? ORIENTATION_LEFT_UP : ORIENTATION_RIGHT_UP;
+
+ /* Some threshold to switching between portrait modes */
+ if (prev == ORIENTATION_LEFT_UP || prev == ORIENTATION_RIGHT_UP) {
+ if (abs(rotation) < SAME_AXIS_LIMIT) {
+ ret = prev;
+ }
+ }
+
+ } else {
+ /* Landscape check */
+ rotation = round(atan((double) y / sqrt(x * x + z * z)) * RADIANS_TO_DEGREES);
+
+ if (abs(rotation) > THRESHOLD_LANDSCAPE) {
+ ret = (rotation < 0) ? ORIENTATION_BOTTOM_UP : ORIENTATION_NORMAL;
+
+ /* Some threshold to switching between landscape modes */
+ if (prev == ORIENTATION_BOTTOM_UP || prev == ORIENTATION_NORMAL) {
+ if (abs(rotation) < SAME_AXIS_LIMIT) {
+ ret = prev;
+ }
+ }
+ }
+ }
+
+ return ret;
+}
+
+static OrientationUp
+get_prev_orientation(struct udev_device *dev)
+{
+ const char *value;
+
+ value = udev_device_get_property_value(dev, "ID_INPUT_ACCELEROMETER_ORIENTATION");
+ if (value == NULL)
+ return ORIENTATION_UNDEFINED;
+ return string_to_orientation(value);
+}
+
+#define SET_AXIS(axis, code_) if (ev[i].code == code_) { if (got_##axis == 0) { axis = ev[i].value; got_##axis = 1; } }
+
+/* accelerometers */
+static void test_orientation(struct udev *udev,
+ struct udev_device *dev,
+ const char *devpath)
+{
+ OrientationUp old, new;
+ int fd, r;
+ struct input_event ev[64];
+ int got_syn = 0;
+ int got_x, got_y, got_z;
+ int x = 0, y = 0, z = 0;
+ char text[64];
+
+ old = get_prev_orientation(dev);
+
+ if ((fd = open(devpath, O_RDONLY)) < 0)
+ return;
+
+ got_x = got_y = got_z = 0;
+
+ while (1) {
+ int i;
+
+ r = read(fd, ev, sizeof(struct input_event) * 64);
+
+ if (r < (int) sizeof(struct input_event))
+ return;
+
+ for (i = 0; i < r / (int) sizeof(struct input_event); i++) {
+ if (got_syn == 1) {
+ if (ev[i].type == EV_ABS) {
+ SET_AXIS(x, ABS_X);
+ SET_AXIS(y, ABS_Y);
+ SET_AXIS(z, ABS_Z);
+ }
+ }
+ if (ev[i].type == EV_SYN && ev[i].code == SYN_REPORT) {
+ got_syn = 1;
+ }
+ if (got_x && got_y && got_z)
+ goto read_dev;
+ }
+ }
+
+read_dev:
+ close(fd);
+
+ if (!got_x || !got_y || !got_z)
+ return;
+
+ new = orientation_calc(old, x, y, z);
+ snprintf(text, sizeof(text), "ID_INPUT_ACCELEROMETER_ORIENTATION=%s", orientation_to_string(new));
+ puts(text);
+}
+
+static void help(void)
+{
+ printf("Usage: accelerometer [options] <device path>\n"
+ " --debug debug to stderr\n"
+ " --help print this help text\n\n");
+}
+
+int main (int argc, char** argv)
+{
+ struct udev *udev;
+ struct udev_device *dev;
+
+ static const struct option options[] = {
+ { "debug", no_argument, NULL, 'd' },
+ { "help", no_argument, NULL, 'h' },
+ {}
+ };
+
+ char devpath[PATH_MAX];
+ char *devnode;
+ const char *id_path;
+ struct udev_enumerate *enumerate;
+ struct udev_list_entry *list_entry;
+
+ udev = udev_new();
+ if (udev == NULL)
+ return 1;
+
+ udev_log_init("input_id");
+ udev_set_log_fn(udev, log_fn);
+
+ /* CLI argument parsing */
+ while (1) {
+ int option;
+
+ option = getopt_long(argc, argv, "dxh", options, NULL);
+ if (option == -1)
+ break;
+
+ switch (option) {
+ case 'd':
+ debug = 1;
+ if (udev_get_log_priority(udev) < LOG_INFO)
+ udev_set_log_priority(udev, LOG_INFO);
+ break;
+ case 'h':
+ help();
+ exit(0);
+ default:
+ exit(1);
+ }
+ }
+
+ if (argv[optind] == NULL) {
+ help();
+ exit(1);
+ }
+
+ /* get the device */
+ snprintf(devpath, sizeof(devpath), "%s/%s", udev_get_sys_path(udev), argv[optind]);
+ dev = udev_device_new_from_syspath(udev, devpath);
+ if (dev == NULL) {
+ fprintf(stderr, "unable to access '%s'\n", devpath);
+ return 1;
+ }
+
+ id_path = udev_device_get_property_value(dev, "ID_PATH");
+ if (id_path == NULL) {
+ fprintf (stderr, "unable to get property ID_PATH for '%s'", devpath);
+ return 0;
+ }
+
+ /* Get the children devices and find the devnode
+ * FIXME: use udev_enumerate_add_match_children() instead
+ * when it's available */
+ devnode = NULL;
+ enumerate = udev_enumerate_new(udev);
+ udev_enumerate_add_match_property(enumerate, "ID_PATH", id_path);
+ udev_enumerate_add_match_subsystem(enumerate, "input");
+ udev_enumerate_scan_devices(enumerate);
+ udev_list_entry_foreach(list_entry, udev_enumerate_get_list_entry(enumerate)) {
+ struct udev_device *device;
+ const char *node;
+
+ device = udev_device_new_from_syspath(udev_enumerate_get_udev(enumerate),
+ udev_list_entry_get_name(list_entry));
+ if (device == NULL)
+ continue;
+ /* Already found it */
+ if (devnode != NULL) {
+ udev_device_unref(device);
+ continue;
+ }
+
+ node = udev_device_get_devnode(device);
+ if (node == NULL) {
+ udev_device_unref(device);
+ continue;
+ }
+ /* Use the event sub-device */
+ if (strstr(node, "/event") == NULL) {
+ udev_device_unref(device);
+ continue;
+ }
+
+ devnode = strdup(node);
+ udev_device_unref(device);
+ }
+
+ if (devnode == NULL) {
+ fprintf(stderr, "unable to get device node for '%s'\n", devpath);
+ return 0;
+ }
+
+ info(udev, "Opening accelerometer device %s\n", devnode);
+ test_orientation(udev, dev, devnode);
+ free(devnode);
+
+ return 0;
+}
struct udev *udev;
struct hd_driveid id;
uint8_t identify[512];
+ uint16_t *identify_words;
char model[41];
char model_enc[256];
char serial[21];
printf("Usage: ata_id [--export] [--help] <device>\n"
" --export print values as environment keys\n"
" --help print this help text\n\n");
- default:
- rc = 1;
goto exit;
}
}
info(udev, "HDIO_GET_IDENTITY unsupported for '%s'\n", node);
rc = 2;
} else {
- err(udev, "HDIO_GET_IDENTITY failed for '%s'\n", node);
+ err(udev, "HDIO_GET_IDENTITY failed for '%s': %m\n", node);
rc = 3;
}
goto close;
}
}
+ identify_words = (uint16_t *) identify;
memcpy (model, id.model, 40);
model[40] = '\0';
udev_util_encode_string(model, model_enc, sizeof(model_enc));
- udev_util_replace_whitespace((char *) id.model, model, 40);
- udev_util_replace_chars(model, NULL);
- udev_util_replace_whitespace((char *) id.serial_no, serial, 20);
- udev_util_replace_chars(serial, NULL);
- udev_util_replace_whitespace((char *) id.fw_rev, revision, 8);
- udev_util_replace_chars(revision, NULL);
+ util_replace_whitespace((char *) id.model, model, 40);
+ util_replace_chars(model, NULL);
+ util_replace_whitespace((char *) id.serial_no, serial, 20);
+ util_replace_chars(serial, NULL);
+ util_replace_whitespace((char *) id.fw_rev, revision, 8);
+ util_replace_chars(revision, NULL);
if (export) {
/* Set this to convey the disk speaks the ATA protocol */
/* ATA devices have no vendor extension */
printf("ID_WWN_WITH_EXTENSION=0x%llx\n", (unsigned long long int) wwwn);
}
+
+ /* from Linux's include/linux/ata.h */
+ if (identify_words[0] == 0x848a || identify_words[0] == 0x844a) {
+ printf("ID_ATA_CFA=1\n");
+ } else {
+ if ((identify_words[83] & 0xc004) == 0x4004) {
+ printf("ID_ATA_CFA=1\n");
+ }
+ }
} else {
if (serial[0] != '\0')
printf("%s_%s\n", model, serial);
KERNEL!="sr[0-9]*|xvd*", GOTO="cdrom_end"
ENV{DEVTYPE}!="disk", GOTO="cdrom_end"
+# unconditionally tag device as CDROM
KERNEL=="sr[0-9]*", ENV{ID_CDROM}="1"
-IMPORT{program}="cdrom_id --export $tempnode"
+
+# media eject button pressed
+ENV{DISK_EJECT_REQUEST}=="?*", RUN+="cdrom_id --eject-media $tempnode", GOTO="cdrom_end"
+
+# import device and media properties and lock tray to
+# enable the receiving of media eject button events
+IMPORT{program}="cdrom_id --lock-media $tempnode"
LABEL="cdrom_end"
#include "libudev.h"
#include "libudev-private.h"
-static int debug;
+static bool debug;
static void log_fn(struct udev *udev, int priority,
const char *file, int line, const char *fn,
struct sg_io_hdr sg_io;
};
-static void scsi_cmd_init(struct udev *udev, struct scsi_cmd *cmd, unsigned char *buf, size_t bufsize)
+static void scsi_cmd_init(struct udev *udev, struct scsi_cmd *cmd)
{
memset(cmd, 0x00, sizeof(struct scsi_cmd));
- memset(buf, 0x00, bufsize);
cmd->cgc.quiet = 1;
cmd->cgc.sense = &cmd->_sense.s;
- memset(&cmd->sg_io, 0, sizeof(cmd->sg_io));
cmd->sg_io.interface_id = 'S';
cmd->sg_io.mx_sb_len = sizeof(cmd->_sense);
cmd->sg_io.cmdp = cmd->cgc.cmd;
{
int ret = 0;
- cmd->sg_io.dxferp = buf;
- cmd->sg_io.dxfer_len = bufsize;
- cmd->sg_io.dxfer_direction = SG_DXFER_FROM_DEV;
+ if (bufsize > 0) {
+ cmd->sg_io.dxferp = buf;
+ cmd->sg_io.dxfer_len = bufsize;
+ cmd->sg_io.dxfer_direction = SG_DXFER_FROM_DEV;
+ } else {
+ cmd->sg_io.dxfer_direction = SG_DXFER_NONE;
+ }
if (ioctl(fd, SG_IO, &cmd->sg_io))
return -1;
return ret;
}
+static int media_lock(struct udev *udev, int fd, bool lock)
+{
+ int err;
+
+ /* disable the kernel's lock logic */
+ err = ioctl(fd, CDROM_CLEAR_OPTIONS, CDO_LOCK);
+ if (err < 0)
+ info(udev, "CDROM_CLEAR_OPTIONS, CDO_LOCK failed\n");
+
+ err = ioctl(fd, CDROM_LOCKDOOR, lock ? 1 : 0);
+ if (err < 0)
+ info(udev, "CDROM_LOCKDOOR failed\n");
+
+ return err;
+}
+
+static int media_eject(struct udev *udev, int fd)
+{
+ struct scsi_cmd sc;
+ int err;
+
+ scsi_cmd_init(udev, &sc);
+ scsi_cmd_set(udev, &sc, 0, 0x1b);
+ scsi_cmd_set(udev, &sc, 4, 0x02);
+ scsi_cmd_set(udev, &sc, 5, 0);
+ err = scsi_cmd_run(udev, &sc, fd, NULL, 0);
+ if ((err != 0)) {
+ info_scsi_cmd_err(udev, "START_STOP_UNIT", err);
+ return -1;
+ }
+ return 0;
+}
+
static int cd_capability_compat(struct udev *udev, int fd)
{
int capability;
return 0;
}
-static int cd_inquiry(struct udev *udev, int fd) {
+static int cd_inquiry(struct udev *udev, int fd)
+{
struct scsi_cmd sc;
unsigned char inq[128];
int err;
- scsi_cmd_init(udev, &sc, inq, sizeof(inq));
+ scsi_cmd_init(udev, &sc);
scsi_cmd_set(udev, &sc, 0, 0x12);
scsi_cmd_set(udev, &sc, 4, 36);
scsi_cmd_set(udev, &sc, 5, 0);
return 0;
}
+static void feature_profile_media(struct udev *udev, int cur_profile)
+{
+ switch (cur_profile) {
+ case 0x03:
+ case 0x04:
+ case 0x05:
+ info(udev, "profile 0x%02x \n", cur_profile);
+ cd_media = 1;
+ cd_media_mo = 1;
+ break;
+ case 0x08:
+ info(udev, "profile 0x%02x media_cd_rom\n", cur_profile);
+ cd_media = 1;
+ cd_media_cd_rom = 1;
+ break;
+ case 0x09:
+ info(udev, "profile 0x%02x media_cd_r\n", cur_profile);
+ cd_media = 1;
+ cd_media_cd_r = 1;
+ break;
+ case 0x0a:
+ info(udev, "profile 0x%02x media_cd_rw\n", cur_profile);
+ cd_media = 1;
+ cd_media_cd_rw = 1;
+ break;
+ case 0x10:
+ info(udev, "profile 0x%02x media_dvd_ro\n", cur_profile);
+ cd_media = 1;
+ cd_media_dvd_rom = 1;
+ break;
+ case 0x11:
+ info(udev, "profile 0x%02x media_dvd_r\n", cur_profile);
+ cd_media = 1;
+ cd_media_dvd_r = 1;
+ break;
+ case 0x12:
+ info(udev, "profile 0x%02x media_dvd_ram\n", cur_profile);
+ cd_media = 1;
+ cd_media_dvd_ram = 1;
+ break;
+ case 0x13:
+ info(udev, "profile 0x%02x media_dvd_rw_ro\n", cur_profile);
+ cd_media = 1;
+ cd_media_dvd_rw = 1;
+ cd_media_dvd_rw_ro = 1;
+ break;
+ case 0x14:
+ info(udev, "profile 0x%02x media_dvd_rw_seq\n", cur_profile);
+ cd_media = 1;
+ cd_media_dvd_rw = 1;
+ cd_media_dvd_rw_seq = 1;
+ break;
+ case 0x1B:
+ info(udev, "profile 0x%02x media_dvd_plus_r\n", cur_profile);
+ cd_media = 1;
+ cd_media_dvd_plus_r = 1;
+ break;
+ case 0x1A:
+ info(udev, "profile 0x%02x media_dvd_plus_rw\n", cur_profile);
+ cd_media = 1;
+ cd_media_dvd_plus_rw = 1;
+ break;
+ case 0x2A:
+ info(udev, "profile 0x%02x media_dvd_plus_rw_dl\n", cur_profile);
+ cd_media = 1;
+ cd_media_dvd_plus_rw_dl = 1;
+ break;
+ case 0x2B:
+ info(udev, "profile 0x%02x media_dvd_plus_r_dl\n", cur_profile);
+ cd_media = 1;
+ cd_media_dvd_plus_r_dl = 1;
+ break;
+ case 0x40:
+ info(udev, "profile 0x%02x media_bd\n", cur_profile);
+ cd_media = 1;
+ cd_media_bd = 1;
+ break;
+ case 0x41:
+ case 0x42:
+ info(udev, "profile 0x%02x media_bd_r\n", cur_profile);
+ cd_media = 1;
+ cd_media_bd_r = 1;
+ break;
+ case 0x43:
+ info(udev, "profile 0x%02x media_bd_re\n", cur_profile);
+ cd_media = 1;
+ cd_media_bd_re = 1;
+ break;
+ case 0x50:
+ info(udev, "profile 0x%02x media_hddvd\n", cur_profile);
+ cd_media = 1;
+ cd_media_hddvd = 1;
+ break;
+ case 0x51:
+ info(udev, "profile 0x%02x media_hddvd_r\n", cur_profile);
+ cd_media = 1;
+ cd_media_hddvd_r = 1;
+ break;
+ case 0x52:
+ info(udev, "profile 0x%02x media_hddvd_rw\n", cur_profile);
+ cd_media = 1;
+ cd_media_hddvd_rw = 1;
+ break;
+ default:
+ info(udev, "profile 0x%02x <ignored>\n", cur_profile);
+ break;
+ }
+}
+
static int feature_profiles(struct udev *udev, const unsigned char *profiles, size_t size)
{
unsigned int i;
return 0;
}
+/* returns 0 if media was detected */
static int cd_profiles_old_mmc(struct udev *udev, int fd)
{
struct scsi_cmd sc;
unsigned char header[32];
- scsi_cmd_init(udev, &sc, header, sizeof(header));
+ scsi_cmd_init(udev, &sc);
scsi_cmd_set(udev, &sc, 0, 0x51);
scsi_cmd_set(udev, &sc, 8, sizeof(header));
scsi_cmd_set(udev, &sc, 9, 0);
return 0;
}
+/* returns 0 if media was detected */
static int cd_profiles(struct udev *udev, int fd)
{
struct scsi_cmd sc;
unsigned int len;
unsigned int i;
int err;
+ int ret;
+
+ ret = -1;
/* First query the current profile */
- scsi_cmd_init(udev, &sc, features, sizeof(features));
+ scsi_cmd_init(udev, &sc);
scsi_cmd_set(udev, &sc, 0, 0x46);
scsi_cmd_set(udev, &sc, 8, 8);
scsi_cmd_set(udev, &sc, 9, 0);
if (SK(err) == 0x5 && ASC(err) == 0x20) {
info(udev, "drive is pre-MMC2 and does not support 46h get configuration command\n");
info(udev, "trying to work around the problem\n");
- return cd_profiles_old_mmc(udev, fd);
+ ret = cd_profiles_old_mmc(udev, fd);
}
- return -1;
+ goto out;
}
cur_profile = features[6] << 8 | features[7];
if (cur_profile > 0) {
info(udev, "current profile 0x%02x\n", cur_profile);
+ feature_profile_media (udev, cur_profile);
+ ret = 0; /* we have media */
} else {
info(udev, "no current profile, assuming no media\n");
- return -1;
}
- switch (cur_profile) {
- case 0x03:
- case 0x04:
- case 0x05:
- info(udev, "profile 0x%02x \n", cur_profile);
- cd_media = 1;
- cd_media_mo = 1;
- break;
- case 0x08:
- info(udev, "profile 0x%02x media_cd_rom\n", cur_profile);
- cd_media = 1;
- cd_media_cd_rom = 1;
- break;
- case 0x09:
- info(udev, "profile 0x%02x media_cd_r\n", cur_profile);
- cd_media = 1;
- cd_media_cd_r = 1;
- break;
- case 0x0a:
- info(udev, "profile 0x%02x media_cd_rw\n", cur_profile);
- cd_media = 1;
- cd_media_cd_rw = 1;
- break;
- case 0x10:
- info(udev, "profile 0x%02x media_dvd_ro\n", cur_profile);
- cd_media = 1;
- cd_media_dvd_rom = 1;
- break;
- case 0x11:
- info(udev, "profile 0x%02x media_dvd_r\n", cur_profile);
- cd_media = 1;
- cd_media_dvd_r = 1;
- break;
- case 0x12:
- info(udev, "profile 0x%02x media_dvd_ram\n", cur_profile);
- cd_media = 1;
- cd_media_dvd_ram = 1;
- break;
- case 0x13:
- info(udev, "profile 0x%02x media_dvd_rw_ro\n", cur_profile);
- cd_media = 1;
- cd_media_dvd_rw = 1;
- cd_media_dvd_rw_ro = 1;
- break;
- case 0x14:
- info(udev, "profile 0x%02x media_dvd_rw_seq\n", cur_profile);
- cd_media = 1;
- cd_media_dvd_rw = 1;
- cd_media_dvd_rw_seq = 1;
- break;
- case 0x1B:
- info(udev, "profile 0x%02x media_dvd_plus_r\n", cur_profile);
- cd_media = 1;
- cd_media_dvd_plus_r = 1;
- break;
- case 0x1A:
- info(udev, "profile 0x%02x media_dvd_plus_rw\n", cur_profile);
- cd_media = 1;
- cd_media_dvd_plus_rw = 1;
- break;
- case 0x2A:
- info(udev, "profile 0x%02x media_dvd_plus_rw_dl\n", cur_profile);
- cd_media = 1;
- cd_media_dvd_plus_rw_dl = 1;
- break;
- case 0x2B:
- info(udev, "profile 0x%02x media_dvd_plus_r_dl\n", cur_profile);
- cd_media = 1;
- cd_media_dvd_plus_r_dl = 1;
- break;
- case 0x40:
- info(udev, "profile 0x%02x media_bd\n", cur_profile);
- cd_media = 1;
- cd_media_bd = 1;
- break;
- case 0x41:
- case 0x42:
- info(udev, "profile 0x%02x media_bd_r\n", cur_profile);
- cd_media = 1;
- cd_media_bd_r = 1;
- break;
- case 0x43:
- info(udev, "profile 0x%02x media_bd_re\n", cur_profile);
- cd_media = 1;
- cd_media_bd_re = 1;
- break;
- case 0x50:
- info(udev, "profile 0x%02x media_hddvd\n", cur_profile);
- cd_media = 1;
- cd_media_hddvd = 1;
- break;
- case 0x51:
- info(udev, "profile 0x%02x media_hddvd_r\n", cur_profile);
- cd_media = 1;
- cd_media_hddvd_r = 1;
- break;
- case 0x52:
- info(udev, "profile 0x%02x media_hddvd_rw\n", cur_profile);
- cd_media = 1;
- cd_media_hddvd_rw = 1;
- break;
- default:
- info(udev, "profile 0x%02x <ignored>\n", cur_profile);
- break;
- }
-
-
len = features[0] << 24 | features[1] << 16 | features[2] << 8 | features[3];
info(udev, "GET CONFIGURATION: size of features buffer 0x%04x\n", len);
}
/* Now get the full feature buffer */
- scsi_cmd_init(udev, &sc, features, len);
+ scsi_cmd_init(udev, &sc);
scsi_cmd_set(udev, &sc, 0, 0x46);
scsi_cmd_set(udev, &sc, 7, ( len >> 8 ) & 0xff);
scsi_cmd_set(udev, &sc, 8, len & 0xff);
break;
}
}
-
- return 0;
+out:
+ return ret;
}
static int cd_media_info(struct udev *udev, int fd)
};
int err;
- scsi_cmd_init(udev, &sc, header, sizeof(header));
+ scsi_cmd_init(udev, &sc);
scsi_cmd_set(udev, &sc, 0, 0x51);
scsi_cmd_set(udev, &sc, 8, sizeof(header) & 0xff);
scsi_cmd_set(udev, &sc, 9, 0);
unsigned char dvdstruct[8];
unsigned char format[12];
- scsi_cmd_init(udev, &sc, dvdstruct, sizeof(dvdstruct));
+ scsi_cmd_init(udev, &sc);
scsi_cmd_set(udev, &sc, 0, 0xAD);
scsi_cmd_set(udev, &sc, 7, 0xC0);
scsi_cmd_set(udev, &sc, 9, sizeof(dvdstruct));
}
/* let's make sure we don't try to read unformatted media */
- scsi_cmd_init(udev, &sc, format, sizeof(format));
+ scsi_cmd_init(udev, &sc);
scsi_cmd_set(udev, &sc, 0, 0x23);
scsi_cmd_set(udev, &sc, 8, sizeof(format));
scsi_cmd_set(udev, &sc, 9, 0);
* has "blank" status", DVD-RAM was examined earlier) and check
* for ISO and UDF PVDs or a fs superblock presence and do it
* in one ioctl (we need just sectors 0 and 16) */
- scsi_cmd_init(udev, &sc, buffer, sizeof(buffer));
+ scsi_cmd_init(udev, &sc);
scsi_cmd_set(udev, &sc, 0, 0x28);
scsi_cmd_set(udev, &sc, 5, 0);
scsi_cmd_set(udev, &sc, 8, 32);
{
struct scsi_cmd sc;
unsigned char header[12];
- unsigned char toc[2048];
+ unsigned char toc[65536];
unsigned int len, i, num_tracks;
unsigned char *p;
int err;
- scsi_cmd_init(udev, &sc, header, sizeof(header));
+ scsi_cmd_init(udev, &sc);
scsi_cmd_set(udev, &sc, 0, 0x43);
scsi_cmd_set(udev, &sc, 6, 1);
scsi_cmd_set(udev, &sc, 8, sizeof(header) & 0xff);
if (len < 8)
return 0;
- scsi_cmd_init(udev, &sc, toc, sizeof(toc));
+ scsi_cmd_init(udev, &sc);
scsi_cmd_set(udev, &sc, 0, 0x43);
scsi_cmd_set(udev, &sc, 6, header[2]); /* First Track/Session Number */
scsi_cmd_set(udev, &sc, 7, (len >> 8) & 0xff);
cd_media_track_count_audio++;
}
- scsi_cmd_init(udev, &sc, header, sizeof(header));
+ scsi_cmd_init(udev, &sc);
scsi_cmd_set(udev, &sc, 0, 0x43);
scsi_cmd_set(udev, &sc, 2, 1); /* Session Info */
scsi_cmd_set(udev, &sc, 8, sizeof(header));
{
struct udev *udev;
static const struct option options[] = {
- { "export", no_argument, NULL, 'x' },
+ { "lock-media", no_argument, NULL, 'l' },
+ { "unlock-media", no_argument, NULL, 'u' },
+ { "eject-media", no_argument, NULL, 'e' },
{ "debug", no_argument, NULL, 'd' },
{ "help", no_argument, NULL, 'h' },
{}
};
+ bool eject = false;
+ bool lock = false;
+ bool unlock = false;
const char *node = NULL;
- int export = 0;
int fd = -1;
int cnt;
int rc = 0;
while (1) {
int option;
- option = getopt_long(argc, argv, "dxh", options, NULL);
+ option = getopt_long(argc, argv, "deluh", options, NULL);
if (option == -1)
break;
switch (option) {
+ case 'l':
+ lock = true;
+ break;
+ case 'u':
+ unlock = true;
+ break;
+ case 'e':
+ eject = true;
+ break;
case 'd':
- debug = 1;
+ debug = true;
if (udev_get_log_priority(udev) < LOG_INFO)
udev_set_log_priority(udev, LOG_INFO);
break;
- case 'x':
- export = 1;
- break;
case 'h':
printf("Usage: cdrom_id [options] <device>\n"
- " --export export key/value pairs\n"
+ " --lock-media lock the media (to enable eject request events)\n"
+ " --unlock-media unlock the media\n"
+ " --eject-media eject the media\n"
" --debug debug to stderr\n"
" --help print this help text\n\n");
goto exit;
/* check if drive talks MMC */
if (cd_inquiry(udev, fd) < 0)
- goto print;
+ goto work;
/* read drive and possibly current profile */
- if (cd_profiles(udev, fd) < 0)
- goto print;
+ if (cd_profiles(udev, fd) != 0)
+ goto work;
+
+ /* at this point we are guaranteed to have media in the drive - find out more about it */
/* get session/track info */
cd_media_toc(udev, fd);
/* get writable media state */
cd_media_info(udev, fd);
-print:
+work:
+ /* lock the media, so we enable eject button events */
+ if (lock && cd_media) {
+ info(udev, "PREVENT_ALLOW_MEDIUM_REMOVAL (lock)\n");
+ media_lock(udev, fd, true);
+ }
+
+ if (unlock && cd_media) {
+ info(udev, "PREVENT_ALLOW_MEDIUM_REMOVAL (unlock)\n");
+ media_lock(udev, fd, false);
+ }
+
+ if (eject) {
+ info(udev, "PREVENT_ALLOW_MEDIUM_REMOVAL (unlock)\n");
+ media_lock(udev, fd, false);
+ info(udev, "START_STOP_UNIT (eject)\n");
+ media_eject(udev, fd);
+ }
+
printf("ID_CDROM=1\n");
if (cd_cd_rom)
printf("ID_CDROM_CD=1\n");
udev_log_close();
return rc;
}
-
#include "libudev.h"
#include "libudev-private.h"
-#define TMPFILE "/dev/.udev/collect"
#define BUFSIZE 16
#define UDEV_ALARM_TIMEOUT 180
int main(int argc, char **argv)
{
+ struct udev *udev;
static const struct option options[] = {
{ "add", no_argument, NULL, 'a' },
{ "remove", no_argument, NULL, 'r' },
char *checkpoint, *us;
int fd;
int i;
- int ret = 0;
+ int ret = EXIT_SUCCESS;
int prune = 0;
+ char tmpdir[UTIL_PATH_SIZE];
+
+ udev = udev_new();
+ if (udev == NULL) {
+ ret = EXIT_FAILURE;
+ goto exit;
+ }
while (1) {
int option;
goto exit;
}
- udev_list_init(&bunch);
+ udev_list_node_init(&bunch);
if (debug)
fprintf(stderr, "Using checkpoint '%s'\n", checkpoint);
- fd = prepare(TMPFILE, checkpoint);
+ util_strscpyl(tmpdir, sizeof(tmpdir), udev_get_run_path(udev), "/collect", NULL);
+ fd = prepare(tmpdir, checkpoint);
if (fd < 0) {
ret = 3;
goto out;
lockf(fd, F_ULOCK, 0);
close(fd);
- out:
+out:
if (debug)
everybody();
if (ret >= 0)
printf("COLLECT_%s=%d\n", checkpoint, ret);
- exit:
+exit:
+ udev_unref(udev);
return ret;
}
static bool copy_firmware(struct udev *udev, const char *source, const char *target, size_t size)
{
char *buf;
- FILE *fsource, *ftarget;
+ FILE *fsource = NULL, *ftarget = NULL;
bool ret = false;
buf = malloc(size);
break;
case 'h':
printf("Usage: firmware --firmware=<fwfile> --devpath=<path> [--help]\n\n");
- default:
- rc = 1;
goto exit;
}
}
}
util_path_encode(firmware, fwencpath, sizeof(fwencpath));
- util_strscpyl(misspath, sizeof(misspath), udev_get_dev_path(udev), "/.udev/firmware-missing/", fwencpath, NULL);
+ util_strscpyl(misspath, sizeof(misspath), udev_get_run_path(udev), "/firmware-missing/", fwencpath, NULL);
util_strscpyl(loadpath, sizeof(loadpath), udev_get_sys_path(udev), devpath, "/loading", NULL);
if (fwfile == NULL) {
err = util_create_path(udev, misspath);
if (err != 0 && err != -ENOENT)
break;
- udev_selinux_setfscreatecon(udev, misspath, S_IFLNK);
err = symlink(devpath, misspath);
if (err != 0)
err = -errno;
- udev_selinux_resetfscreatecon(udev);
} while (err == -ENOENT);
rc = 2;
set_loading(udev, loadpath, "-1");
+++ /dev/null
-ACTION!="remove", SUBSYSTEM=="block", ENV{ID_FS_USAGE}=="filesystem|other", IMPORT="fstab_import $name $links mapper/$env{DM_NAME}"
-
+++ /dev/null
-/*
- * find matching entry in fstab and export it
- *
- * Copyright (C) 2008 Kay Sievers <kay.sievers@vrfy.org>
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
- */
-
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE 1
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <ctype.h>
-#include <string.h>
-#include <errno.h>
-#include <getopt.h>
-#include <mntent.h>
-#include <sys/stat.h>
-
-#include "libudev.h"
-#include "libudev-private.h"
-
-static int debug;
-
-static void log_fn(struct udev *udev, int priority,
- const char *file, int line, const char *fn,
- const char *format, va_list args)
-{
- if (debug) {
- fprintf(stderr, "%s: ", fn);
- vfprintf(stderr, format, args);
- } else {
- vsyslog(priority, format, args);
- }
-}
-
-static int matches_device_list(struct udev *udev, char **devices, const char *name)
-{
- int i;
-
- for (i = 0; devices[i] != NULL; i++) {
- info(udev, "compare '%s' == '%s'\n", name, devices[i]);
- if (strcmp(devices[i], name) == 0)
- return 1;
- }
- return 0;
-}
-
-static void print_fstab_entry(struct udev *udev, struct mntent *mnt)
-{
- printf("FSTAB_NAME=%s\n", mnt->mnt_fsname);
- printf("FSTAB_DIR=%s\n", mnt->mnt_dir);
- printf("FSTAB_TYPE=%s\n", mnt->mnt_type);
- printf("FSTAB_OPTS=%s\n", mnt->mnt_opts);
- printf("FSTAB_FREQ=%d\n", mnt->mnt_freq);
- printf("FSTAB_PASSNO=%d\n", mnt->mnt_passno);
-}
-
-int main(int argc, char *argv[])
-{
- struct udev *udev;
- static const struct option options[] = {
- { "export", no_argument, NULL, 'x' },
- { "debug", no_argument, NULL, 'd' },
- { "help", no_argument, NULL, 'h' },
- {}
- };
- char **devices;
- FILE *fp;
- struct mntent *mnt;
- int rc = 1;
-
- udev = udev_new();
- if (udev == NULL)
- goto exit;
-
- udev_log_init("fstab_id");
- udev_set_log_fn(udev, log_fn);
-
- while (1) {
- int option;
-
- option = getopt_long(argc, argv, "dxh", options, NULL);
- if (option == -1)
- break;
-
- switch (option) {
- case 'd':
- debug = 1;
- if (udev_get_log_priority(udev) < LOG_INFO)
- udev_set_log_priority(udev, LOG_INFO);
- break;
- case 'h':
- printf("Usage: fstab_id [OPTIONS] name [...]\n"
- " --export print environment keys\n"
- " --debug debug to stderr\n"
- " --help print this help text\n\n");
- goto exit;
- case 'x':
- break;
- default:
- rc = 2;
- goto exit;
- }
- }
-
- devices = &argv[optind];
- if (devices[0] == NULL) {
- fprintf(stderr, "error: missing device(s) to match\n");
- rc = 3;
- goto exit;
- }
-
- fp = setmntent ("/etc/fstab", "r");
- if (fp == NULL) {
- fprintf(stderr, "error: opening fstab: %s\n", strerror(errno));
- rc = 4;
- goto exit;
- }
-
- while (1) {
- mnt = getmntent(fp);
- if (mnt == NULL)
- break;
-
- info(udev, "found '%s'@'%s'\n", mnt->mnt_fsname, mnt->mnt_dir);
-
- /* skip root device */
- if (strcmp(mnt->mnt_dir, "/") == 0)
- continue;
-
- /* match LABEL */
- if (strncmp(mnt->mnt_fsname, "LABEL=", 6) == 0) {
- const char *label;
- char str[256];
-
- label = &mnt->mnt_fsname[6];
- if (label[0] == '"' || label[0] == '\'') {
- char *pos;
-
- util_strscpy(str, sizeof(str), &label[1]);
- pos = strrchr(str, label[0]);
- if (pos == NULL)
- continue;
- pos[0] = '\0';
- label = str;
- }
- if (matches_device_list(udev, devices, label)) {
- print_fstab_entry(udev, mnt);
- rc = 0;
- break;
- }
- continue;
- }
-
- /* match UUID */
- if (strncmp(mnt->mnt_fsname, "UUID=", 5) == 0) {
- const char *uuid;
- char str[256];
-
- uuid = &mnt->mnt_fsname[5];
- if (uuid[0] == '"' || uuid[0] == '\'') {
- char *pos;
-
- util_strscpy(str, sizeof(str), &uuid[1]);
- pos = strrchr(str, uuid[0]);
- if (pos == NULL)
- continue;
- pos[0] = '\0';
- uuid = str;
- }
- if (matches_device_list(udev, devices, uuid)) {
- print_fstab_entry(udev, mnt);
- rc = 0;
- break;
- }
- continue;
- }
-
- /* only devices */
- if (strncmp(mnt->mnt_fsname, udev_get_dev_path(udev), strlen(udev_get_dev_path(udev))) != 0)
- continue;
-
- if (matches_device_list(udev, devices, &mnt->mnt_fsname[strlen(udev_get_dev_path(udev))+1])) {
- print_fstab_entry(udev, mnt);
- rc = 0;
- break;
- }
- }
- endmntent(fp);
-
-exit:
- udev_unref(udev);
- udev_log_close();
- return rc;
-}
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
GPERF = @GPERF@
GREP = @GREP@
GTKDOC_CHECK = @GTKDOC_CHECK@
+GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@
+GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@
GTKDOC_MKPDF = @GTKDOC_MKPDF@
GTKDOC_REBASE = @GTKDOC_REBASE@
G_IR_COMPILER = @G_IR_COMPILER@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
-LIBUSB_CFLAGS = @LIBUSB_CFLAGS@
-LIBUSB_LIBS = @LIBUSB_LIBS@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
$(GLIB_LIBS) \
$(top_builddir)/extras/gudev/libgudev-1.0.la
-@GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_CC = $(CC) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-@GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_CC = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-@GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_LD = $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS)
-@GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_LD = $(LIBTOOL) --tag=CC --mode=link $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS)
+@GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_CC = $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+@GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_CC = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+@GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_LD = $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS)
+@GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_LD = $(LIBTOOL) --tag=CC --mode=link $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS)
@GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_RUN =
@GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_RUN = $(LIBTOOL) --mode=execute
#
GPATH = $(srcdir)
TARGET_DIR = $(HTML_DIR)/$(DOC_MODULE)
+SETUP_FILES = \
+ $(content_files) \
+ $(DOC_MAIN_SGML_FILE) \
+ $(DOC_MODULE)-sections.txt \
+ $(DOC_MODULE)-overrides.txt
+
# This includes the standard gtk-doc make rules, copied by gtkdocize.
# Other files to distribute
# e.g. EXTRA_DIST += version.xml.in
-EXTRA_DIST = $(content_files) $(HTML_IMAGES) $(DOC_MAIN_SGML_FILE) \
- $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt \
- version.xml.in
-DOC_STAMPS = scan-build.stamp tmpl-build.stamp sgml-build.stamp html-build.stamp \
- pdf-build.stamp \
- $(srcdir)/tmpl.stamp $(srcdir)/sgml.stamp $(srcdir)/html.stamp \
- $(srcdir)/pdf.stamp
+EXTRA_DIST = $(HTML_IMAGES) $(SETUP_FILES) version.xml.in
+DOC_STAMPS = setup-build.stamp scan-build.stamp tmpl-build.stamp sgml-build.stamp \
+ html-build.stamp pdf-build.stamp \
+ tmpl.stamp sgml.stamp html.stamp pdf.stamp
SCANOBJ_FILES = \
$(DOC_MODULE).args \
$(REPORT_FILES): sgml-build.stamp
+#### setup ####
+
+setup-build.stamp:
+ -@if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \
+ echo ' DOC Preparing build'; \
+ files=`echo $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types`; \
+ if test "x$$files" != "x" ; then \
+ for file in $$files ; do \
+ test -f $(abs_srcdir)/$$file && \
+ cp -pu $(abs_srcdir)/$$file $(abs_builddir)/ || true; \
+ done; \
+ fi; \
+ test -d $(abs_srcdir)/tmpl && \
+ { cp -rp $(abs_srcdir)/tmpl $(abs_builddir)/; \
+ chmod -R u+w $(abs_builddir)/tmpl; } \
+ fi
+ @touch setup-build.stamp
+
#### scan ####
scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB)
- @echo 'gtk-doc: Scanning header files'
- @-chmod -R u+w $(srcdir)
- @_source_dir='' ; for i in $(DOC_SOURCE_DIR) ; do \
+ @echo ' DOC Scanning header files'
+ @_source_dir='' ; \
+ for i in $(DOC_SOURCE_DIR) ; do \
_source_dir="$${_source_dir} --source-dir=$$i" ; \
- done ; \
- cd $(srcdir) && \
- gtkdoc-scan --module=$(DOC_MODULE) --ignore-headers="$(IGNORE_HFILES)" $${_source_dir} $(SCAN_OPTIONS) $(EXTRA_HFILES)
- @if grep -l '^..*$$' $(srcdir)/$(DOC_MODULE).types > /dev/null 2>&1 ; then \
- CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" gtkdoc-scangobj $(SCANGOBJ_OPTIONS) --module=$(DOC_MODULE) --output-dir=$(srcdir) ; \
+ done ; \
+ gtkdoc-scan --module=$(DOC_MODULE) --ignore-headers="$(IGNORE_HFILES)" $${_source_dir} $(SCAN_OPTIONS) $(EXTRA_HFILES)
+ @if grep -l '^..*$$' $(DOC_MODULE).types > /dev/null 2>&1 ; then \
+ echo " DOC Introspecting gobjects"; \
+ scanobj_options=""; \
+ gtkdoc-scangobj 2>&1 --help | grep >/dev/null "\-\-verbose"; \
+ if test "$(?)" = "0"; then \
+ if test "x$(V)" = "x1"; then \
+ scanobj_options="--verbose"; \
+ fi; \
+ fi; \
+ CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" \
+ gtkdoc-scangobj $(SCANGOBJ_OPTIONS) $$scanobj_options --module=$(DOC_MODULE); \
else \
- cd $(srcdir) ; \
for i in $(SCANOBJ_FILES) ; do \
- test -f $$i || touch $$i ; \
+ test -f $$i || touch $$i ; \
done \
fi
@touch scan-build.stamp
#### templates ####
-tmpl-build.stamp: $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt
- @echo 'gtk-doc: Rebuilding template files'
- @-chmod -R u+w $(srcdir)
- @cd $(srcdir) && gtkdoc-mktmpl --module=$(DOC_MODULE) $(MKTMPL_OPTIONS)
+tmpl-build.stamp: setup-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt
+ @echo ' DOC Rebuilding template files'
+ @gtkdoc-mktmpl --module=$(DOC_MODULE) $(MKTMPL_OPTIONS)
+ @if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \
+ if test -w $(abs_srcdir) ; then \
+ cp -rp $(abs_builddir)/tmpl $(abs_srcdir)/; \
+ fi \
+ fi
@touch tmpl-build.stamp
tmpl.stamp: tmpl-build.stamp
#### xml ####
sgml-build.stamp: tmpl.stamp $(DOC_MODULE)-sections.txt $(srcdir)/tmpl/*.sgml $(expand_content_files)
- @echo 'gtk-doc: Building XML'
+ @echo ' DOC Building XML'
@-chmod -R u+w $(srcdir)
- @_source_dir='' ; for i in $(DOC_SOURCE_DIR) ; do \
+ @_source_dir='' ; \
+ for i in $(DOC_SOURCE_DIR) ; do \
_source_dir="$${_source_dir} --source-dir=$$i" ; \
- done ; \
- cd $(srcdir) && \
- gtkdoc-mkdb --module=$(DOC_MODULE) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $${_source_dir} $(MKDB_OPTIONS)
+ done ; \
+ gtkdoc-mkdb --module=$(DOC_MODULE) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $${_source_dir} $(MKDB_OPTIONS)
@touch sgml-build.stamp
sgml.stamp: sgml-build.stamp
#### html ####
html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files)
- @echo 'gtk-doc: Building HTML'
- @-chmod -R u+w $(srcdir)
- @rm -rf $(srcdir)/html
- @mkdir $(srcdir)/html
+ @echo ' DOC Building HTML'
+ @rm -rf html
+ @mkdir html
@mkhtml_options=""; \
+ gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-verbose"; \
+ if test "$(?)" = "0"; then \
+ if test "x$(V)" = "x1"; then \
+ mkhtml_options="$$mkhtml_options --verbose"; \
+ fi; \
+ fi; \
gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-path"; \
if test "$(?)" = "0"; then \
- mkhtml_options=--path="$(srcdir)"; \
+ mkhtml_options="$$mkhtml_options --path=\"$(abs_srcdir)\""; \
fi; \
- cd $(srcdir)/html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE)
- @test "x$(HTML_IMAGES)" = "x" || ( cd $(srcdir) && cp $(HTML_IMAGES) html )
- @echo 'gtk-doc: Fixing cross-references'
- @cd $(srcdir) && gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS)
+ cd html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE)
+ -@test "x$(HTML_IMAGES)" = "x" || \
+ for file in $(HTML_IMAGES) ; do \
+ if test -f $(abs_srcdir)/$$file ; then \
+ cp $(abs_srcdir)/$$file $(abs_builddir)/html; \
+ fi; \
+ if test -f $(abs_builddir)/$$file ; then \
+ cp $(abs_builddir)/$$file $(abs_builddir)/html; \
+ fi; \
+ done;
+ @echo ' DOC Fixing cross-references'
+ @gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS)
@touch html-build.stamp
#### pdf ####
pdf-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files)
- @echo 'gtk-doc: Building PDF'
- @-chmod -R u+w $(srcdir)
- @rm -rf $(srcdir)/$(DOC_MODULE).pdf
- @mkpdf_imgdirs=""; \
+ @echo ' DOC Building PDF'
+ @rm -f $(DOC_MODULE).pdf
+ @mkpdf_options=""; \
+ gtkdoc-mkpdf 2>&1 --help | grep >/dev/null "\-\-verbose"; \
+ if test "$(?)" = "0"; then \
+ if test "x$(V)" = "x1"; then \
+ mkpdf_options="$$mkpdf_options --verbose"; \
+ fi; \
+ fi; \
if test "x$(HTML_IMAGES)" != "x"; then \
for img in $(HTML_IMAGES); do \
part=`dirname $$img`; \
- echo $$mkpdf_imgdirs | grep >/dev/null "\-\-imgdir=$$part "; \
+ echo $$mkpdf_options | grep >/dev/null "\-\-imgdir=$$part "; \
if test $$? != 0; then \
- mkpdf_imgdirs="$$mkpdf_imgdirs --imgdir=$$part"; \
+ mkpdf_options="$$mkpdf_options --imgdir=$$part"; \
fi; \
done; \
fi; \
- cd $(srcdir) && gtkdoc-mkpdf --path="$(abs_srcdir)" $$mkpdf_imgdirs $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS)
+ gtkdoc-mkpdf --path="$(abs_srcdir)" $$mkpdf_options $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS)
@touch pdf-build.stamp
##############
clean-local:
- rm -f *~ *.bak
- rm -rf .libs
+ @rm -f *~ *.bak
+ @rm -rf .libs
distclean-local:
- cd $(srcdir) && \
- rm -rf xml $(REPORT_FILES) $(DOC_MODULE).pdf \
- $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt
+ @rm -rf xml html $(REPORT_FILES) $(DOC_MODULE).pdf \
+ $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt
+ @if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \
+ rm -f $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types; \
+ rm -rf tmpl; \
+ fi
maintainer-clean-local: clean
- cd $(srcdir) && rm -rf xml html
+ @rm -rf xml html
install-data-local:
- @installfiles=`echo $(srcdir)/html/*`; \
- if test "$$installfiles" = '$(srcdir)/html/*'; \
- then echo '-- Nothing to install' ; \
+ @installfiles=`echo $(builddir)/html/*`; \
+ if test "$$installfiles" = '$(builddir)/html/*'; \
+ then echo 1>&2 'Nothing to install' ; \
else \
if test -n "$(DOC_MODULE_VERSION)"; then \
installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \
fi; \
$(mkinstalldirs) $${installdir} ; \
for i in $$installfiles; do \
- echo '-- Installing '$$i ; \
+ echo ' $(INSTALL_DATA) '$$i ; \
$(INSTALL_DATA) $$i $${installdir}; \
done; \
if test -n "$(DOC_MODULE_VERSION)"; then \
mv -f $${installdir}/$(DOC_MODULE).devhelp2 \
$${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp2; \
- mv -f $${installdir}/$(DOC_MODULE).devhelp \
- $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp; \
fi; \
$(GTKDOC_REBASE) --relative --dest-dir=$(DESTDIR) --html-dir=$${installdir}; \
fi
@ENABLE_GTK_DOC_FALSE@ @false
dist-hook: dist-check-gtkdoc dist-hook-local
- mkdir $(distdir)/tmpl
- mkdir $(distdir)/html
- -cp $(srcdir)/tmpl/*.sgml $(distdir)/tmpl
- cp $(srcdir)/html/* $(distdir)/html
- -cp $(srcdir)/$(DOC_MODULE).pdf $(distdir)/
- -cp $(srcdir)/$(DOC_MODULE).types $(distdir)/
- -cp $(srcdir)/$(DOC_MODULE)-sections.txt $(distdir)/
- cd $(distdir) && rm -f $(DISTCLEANFILES)
- $(GTKDOC_REBASE) --online --relative --html-dir=$(distdir)/html
+ @mkdir $(distdir)/tmpl
+ @mkdir $(distdir)/html
+ @-cp ./tmpl/*.sgml $(distdir)/tmpl
+ @cp ./html/* $(distdir)/html
+ @-cp ./$(DOC_MODULE).pdf $(distdir)/
+ @-cp ./$(DOC_MODULE).types $(distdir)/
+ @-cp ./$(DOC_MODULE)-sections.txt $(distdir)/
+ @cd $(distdir) && rm -f $(DISTCLEANFILES)
+ @$(GTKDOC_REBASE) --online --relative --html-dir=$(distdir)/html
.PHONY : dist-hook-local docs
</authorgroup>
<copyright>
- <year>2009</year>
+ <year>2011</year>
<holder>The GUDev Authors</holder>
</copyright>
G_UDEV_CLIENT_CLASS
G_UDEV_IS_CLIENT_CLASS
G_UDEV_CLIENT_GET_CLASS
+<SUBSECTION Private>
+GUdevClientPrivate
</SECTION>
<SECTION>
G_UDEV_DEVICE_CLASS
G_UDEV_IS_DEVICE_CLASS
G_UDEV_DEVICE_GET_CLASS
+<SUBSECTION Private>
+GUdevDevicePrivate
</SECTION>
<SECTION>
G_UDEV_ENUMERATOR_CLASS
G_UDEV_IS_ENUMERATOR_CLASS
G_UDEV_ENUMERATOR_GET_CLASS
+<SUBSECTION Private>
+GUdevEnumeratorPrivate
+</SECTION>
+
+<SECTION>
+<FILE>gudevmarshal</FILE>
+<SUBSECTION Private>
+g_udev_marshal_VOID__STRING_OBJECT
+</SECTION>
+
+<SECTION>
+<FILE>gudevenumtypes</FILE>
+<SUBSECTION Private>
+G_TYPE_UDEV_DEVICE_TYPE
+g_udev_device_type_get_type
</SECTION>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GUdevClient</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="index.html" title="GUDev Reference Manual">
<link rel="up" href="ref-API.html" title="API Reference">
<link rel="prev" href="ref-API.html" title="API Reference">
<link rel="next" href="GUdevDevice.html" title="GUdevDevice">
-<meta name="generator" content="GTK-Doc V1.15 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<a href="#GUdevClient.signals" class="shortcut">Signals</a>
</td></tr>
</table>
-<div class="refentry" title="GUdevClient">
+<div class="refentry">
<a name="GUdevClient"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
</td>
<td valign="top" align="right"></td>
</tr></table></div>
-<div class="refsynopsisdiv" title="Synopsis">
+<div class="refsynopsisdiv">
<a name="GUdevClient.synopsis"></a><h2>Synopsis</h2>
-<pre class="synopsis"> <a class="link" href="GUdevClient.html#GUdevClient-struct" title="GUdevClient">GUdevClient</a>;
- <a class="link" href="GUdevClient.html#GUdevClientClass" title="GUdevClientClass">GUdevClientClass</a>;
-enum <a class="link" href="GUdevClient.html#GUdevDeviceType" title="enum GUdevDeviceType">GUdevDeviceType</a>;
+<a name="GUdevDeviceType"></a><pre class="synopsis"> <a class="link" href="GUdevClient.html#GUdevClient-struct" title="GUdevClient">GUdevClient</a>;
+struct <a class="link" href="GUdevClient.html#GUdevClientClass" title="struct GUdevClientClass">GUdevClientClass</a>;
+enum <a class="link" href="GUdevClient.html#GUdevDeviceType-enum" title="enum GUdevDeviceType">GUdevDeviceType</a>;
typedef <a class="link" href="GUdevClient.html#GUdevDeviceNumber" title="GUdevDeviceNumber">GUdevDeviceNumber</a>;
<a class="link" href="GUdevClient.html" title="GUdevClient"><span class="returnvalue">GUdevClient</span></a> * <a class="link" href="GUdevClient.html#g-udev-client-new" title="g_udev_client_new ()">g_udev_client_new</a> (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> * const *subsystems</code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Doubly-Linked-Lists.html#GList"><span class="returnvalue">GList</span></a> * <a class="link" href="GUdevClient.html#g-udev-client-query-by-subsystem" title="g_udev_client_query_by_subsystem ()">g_udev_client_query_by_subsystem</a> (<em class="parameter"><code><a class="link" href="GUdevClient.html" title="GUdevClient"><span class="type">GUdevClient</span></a> *client</code></em>,
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *subsystem</code></em>);
<a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="returnvalue">GUdevDevice</span></a> * <a class="link" href="GUdevClient.html#g-udev-client-query-by-device-number" title="g_udev_client_query_by_device_number ()">g_udev_client_query_by_device_number</a>
(<em class="parameter"><code><a class="link" href="GUdevClient.html" title="GUdevClient"><span class="type">GUdevClient</span></a> *client</code></em>,
- <em class="parameter"><code><a class="link" href="GUdevClient.html#GUdevDeviceType" title="enum GUdevDeviceType"><span class="type">GUdevDeviceType</span></a> type</code></em>,
+ <em class="parameter"><code><a class="link" href="GUdevClient.html#GUdevDeviceType"><span class="type">GUdevDeviceType</span></a> type</code></em>,
<em class="parameter"><code><a class="link" href="GUdevClient.html#GUdevDeviceNumber" title="GUdevDeviceNumber"><span class="type">GUdevDeviceNumber</span></a> number</code></em>);
<a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="returnvalue">GUdevDevice</span></a> * <a class="link" href="GUdevClient.html#g-udev-client-query-by-device-file" title="g_udev_client_query_by_device_file ()">g_udev_client_query_by_device_file</a> (<em class="parameter"><code><a class="link" href="GUdevClient.html" title="GUdevClient"><span class="type">GUdevClient</span></a> *client</code></em>,
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *device_file</code></em>);
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *name</code></em>);
</pre>
</div>
-<div class="refsect1" title="Object Hierarchy">
+<div class="refsect1">
<a name="GUdevClient.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="synopsis">
<a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObject">GObject</a>
+----GUdevClient
</pre>
+<pre class="synopsis">
+ GEnum
+ +----GUdevDeviceType
+</pre>
</div>
-<div class="refsect1" title="Properties">
+<div class="refsect1">
<a name="GUdevClient.properties"></a><h2>Properties</h2>
<pre class="synopsis">
- "<a class="link" href="GUdevClient.html#GUdevClient--subsystems" title='The "subsystems" property'>subsystems</a>" <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Boxed-Types.html#GStrv"><span class="type">GStrv</span></a>* : Read / Write / Construct Only
+ "<a class="link" href="GUdevClient.html#GUdevClient--subsystems" title='The "subsystems" property'>subsystems</a>" <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Boxed-Types.html#GStrv"><span class="type">GStrv</span></a> : Read / Write / Construct Only
</pre>
</div>
-<div class="refsect1" title="Signals">
+<div class="refsect1">
<a name="GUdevClient.signals"></a><h2>Signals</h2>
<pre class="synopsis">
- "<a class="link" href="GUdevClient.html#GUdevClient-uevent" title='The "uevent" signal'>uevent</a>" : Run Last
+ "<a class="link" href="GUdevClient.html#GUdevClient-uevent" title='The "uevent" signal'>uevent</a>" : <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html#G-SIGNAL-RUN-LAST:CAPS"><code class="literal">Run Last</code></a>
</pre>
</div>
-<div class="refsect1" title="Description">
+<div class="refsect1">
<a name="GUdevClient.description"></a><h2>Description</h2>
<p>
<a class="link" href="GUdevClient.html" title="GUdevClient"><span class="type">GUdevClient</span></a> is used to query information about devices on a Linux
To listen to uevents, connect to the <a class="link" href="GUdevClient.html#GUdevClient-uevent" title='The "uevent" signal'><span class="type">"uevent"</span></a> signal.
</p>
</div>
-<div class="refsect1" title="Details">
+<div class="refsect1">
<a name="GUdevClient.details"></a><h2>Details</h2>
-<div class="refsect2" title="GUdevClient">
+<div class="refsect2">
<a name="GUdevClient-struct"></a><h3>GUdevClient</h3>
<pre class="programlisting">typedef struct _GUdevClient GUdevClient;</pre>
<p>
The <a class="link" href="GUdevClient.html" title="GUdevClient"><span class="type">GUdevClient</span></a> struct is opaque and should not be accessed directly.
</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody></tbody>
-</table></div>
</div>
<hr>
-<div class="refsect2" title="GUdevClientClass">
-<a name="GUdevClientClass"></a><h3>GUdevClientClass</h3>
-<pre class="programlisting">typedef struct {
+<div class="refsect2">
+<a name="GUdevClientClass"></a><h3>struct GUdevClientClass</h3>
+<pre class="programlisting">struct GUdevClientClass {
GObjectClass parent_class;
/* signals */
void (*uevent) (GUdevClient *client,
const gchar *action,
GUdevDevice *device);
-} GUdevClientClass;
+};
</pre>
<p>
Class structure for <a class="link" href="GUdevClient.html" title="GUdevClient"><span class="type">GUdevClient</span></a>.
<tbody>
<tr>
<td><p><span class="term"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObjectClass"><span class="type">GObjectClass</span></a> <em class="structfield"><code><a name="GUdevClientClass.parent-class"></a>parent_class</code></em>;</span></p></td>
-<td>Parent class.
-</td>
+<td>Parent class.</td>
</tr>
<tr>
<td><p><span class="term"><em class="structfield"><code><a name="GUdevClientClass.uevent"></a>uevent</code></em> ()</span></p></td>
-<td>Signal class handler for the <a class="link" href="GUdevClient.html#GUdevClient-uevent" title='The "uevent" signal'><span class="type">"uevent"</span></a> signal.
-</td>
+<td>Signal class handler for the <a class="link" href="GUdevClient.html#GUdevClient-uevent" title='The "uevent" signal'><span class="type">"uevent"</span></a> signal.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="enum GUdevDeviceType">
-<a name="GUdevDeviceType"></a><h3>enum GUdevDeviceType</h3>
-<pre class="programlisting">typedef enum
-{
+<div class="refsect2">
+<a name="GUdevDeviceType-enum"></a><h3>enum GUdevDeviceType</h3>
+<pre class="programlisting">typedef enum {
G_UDEV_DEVICE_TYPE_NONE = 0,
G_UDEV_DEVICE_TYPE_BLOCK = 'b',
G_UDEV_DEVICE_TYPE_CHAR = 'c',
</table></div>
</div>
<hr>
-<div class="refsect2" title="GUdevDeviceNumber">
+<div class="refsect2">
<a name="GUdevDeviceNumber"></a><h3>GUdevDeviceNumber</h3>
+<pre class="programlisting">typedef guint64 GUdevDeviceNumber; /* __UQUAD_TYPE */
+</pre>
<p>
Corresponds to the standard <span class="type">dev_t</span> type as defined by POSIX (Until
bug 584517 is resolved this work-around is needed).
</p>
</div>
<hr>
-<div class="refsect2" title="g_udev_client_new ()">
+<div class="refsect2">
<a name="g-udev-client-new"></a><h3>g_udev_client_new ()</h3>
<pre class="programlisting"><a class="link" href="GUdevClient.html" title="GUdevClient"><span class="returnvalue">GUdevClient</span></a> * g_udev_client_new (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> * const *subsystems</code></em>);</pre>
<p>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>subsystems</code></em> :</span></p></td>
-<td> A <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> terminated string array of subsystems to listen for uevents on, <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to not listen on uevents at all, or an empty array to listen to uevents on all subsystems. See the documentation for the <a class="link" href="GUdevClient.html#GUdevClient--subsystems" title='The "subsystems" property'><span class="type">"subsystems"</span></a> property for details on this parameter. <span class="annotation">[<a href="http://foldoc.org/array"><span class="acronym">array</span></a> zero-terminated=1][<a href="http://foldoc.org/element-type"><span class="acronym">element-type</span></a> utf8][<a href="http://foldoc.org/transfer%20none"><span class="acronym">transfer none</span></a> utf8][<a href="http://foldoc.org/allow-none"><span class="acronym">allow-none</span></a> utf8]</span>
+<td>A <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> terminated string array of subsystems to listen for uevents on, <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to not listen on uevents at all, or an empty array to listen to uevents on all subsystems. See the documentation for the <a class="link" href="GUdevClient.html#GUdevClient--subsystems" title='The "subsystems" property'><span class="type">"subsystems"</span></a> property for details on this parameter. <span class="annotation">[<a href="http://foldoc.org/array"><span class="acronym">array</span></a> zero-terminated=1][<a href="http://foldoc.org/element-type"><span class="acronym">element-type</span></a> utf8][<a href="http://foldoc.org/transfer%20none"><span class="acronym">transfer none</span></a>][<a href="http://foldoc.org/allow-none"><span class="acronym">allow-none</span></a>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> A new <a class="link" href="GUdevClient.html" title="GUdevClient"><span class="type">GUdevClient</span></a> object. Free with <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#g-object-unref"><code class="function">g_object_unref()</code></a>.
-</td>
+<td>A new <a class="link" href="GUdevClient.html" title="GUdevClient"><span class="type">GUdevClient</span></a> object. Free with <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#g-object-unref"><code class="function">g_object_unref()</code></a>.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="g_udev_client_query_by_subsystem ()">
+<div class="refsect2">
<a name="g-udev-client-query-by-subsystem"></a><h3>g_udev_client_query_by_subsystem ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Doubly-Linked-Lists.html#GList"><span class="returnvalue">GList</span></a> * g_udev_client_query_by_subsystem (<em class="parameter"><code><a class="link" href="GUdevClient.html" title="GUdevClient"><span class="type">GUdevClient</span></a> *client</code></em>,
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *subsystem</code></em>);</pre>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>client</code></em> :</span></p></td>
-<td>A <a class="link" href="GUdevClient.html" title="GUdevClient"><span class="type">GUdevClient</span></a>.
-</td>
+<td>A <a class="link" href="GUdevClient.html" title="GUdevClient"><span class="type">GUdevClient</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>subsystem</code></em> :</span></p></td>
-<td> The subsystem to get devices for or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to get all devices. <span class="annotation">[<a href="http://foldoc.org/allow-none"><span class="acronym">allow-none</span></a>]</span>
+<td>The subsystem to get devices for or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to get all devices. <span class="annotation">[<a href="http://foldoc.org/allow-none"><span class="acronym">allow-none</span></a>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> A list of <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> objects. The caller should free the result by using <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#g-object-unref"><code class="function">g_object_unref()</code></a> on each element in the list and then <a href="http://library.gnome.org/devel/glib/unstable/glib-Doubly-Linked-Lists.html#g-list-free"><code class="function">g_list_free()</code></a> on the list. <span class="annotation">[<a href="http://foldoc.org/element-type"><span class="acronym">element-type</span></a> GUdevDevice][<a href="http://foldoc.org/transfer%20full"><span class="acronym">transfer full</span></a> GUdevDevice]</span>
+<td>A list of <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> objects. The caller should free the result by using <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#g-object-unref"><code class="function">g_object_unref()</code></a> on each element in the list and then <a href="http://library.gnome.org/devel/glib/unstable/glib-Doubly-Linked-Lists.html#g-list-free"><code class="function">g_list_free()</code></a> on the list. <span class="annotation">[<a href="http://foldoc.org/element-type"><span class="acronym">element-type</span></a> GUdevDevice][<a href="http://foldoc.org/transfer%20full"><span class="acronym">transfer full</span></a>]</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="g_udev_client_query_by_device_number ()">
+<div class="refsect2">
<a name="g-udev-client-query-by-device-number"></a><h3>g_udev_client_query_by_device_number ()</h3>
<pre class="programlisting"><a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="returnvalue">GUdevDevice</span></a> * g_udev_client_query_by_device_number
(<em class="parameter"><code><a class="link" href="GUdevClient.html" title="GUdevClient"><span class="type">GUdevClient</span></a> *client</code></em>,
- <em class="parameter"><code><a class="link" href="GUdevClient.html#GUdevDeviceType" title="enum GUdevDeviceType"><span class="type">GUdevDeviceType</span></a> type</code></em>,
+ <em class="parameter"><code><a class="link" href="GUdevClient.html#GUdevDeviceType"><span class="type">GUdevDeviceType</span></a> type</code></em>,
<em class="parameter"><code><a class="link" href="GUdevClient.html#GUdevDeviceNumber" title="GUdevDeviceNumber"><span class="type">GUdevDeviceNumber</span></a> number</code></em>);</pre>
<p>
Looks up a device for a type and device number.
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>client</code></em> :</span></p></td>
-<td>A <a class="link" href="GUdevClient.html" title="GUdevClient"><span class="type">GUdevClient</span></a>.
-</td>
+<td>A <a class="link" href="GUdevClient.html" title="GUdevClient"><span class="type">GUdevClient</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td>
-<td>A value from the <a class="link" href="GUdevClient.html#GUdevDeviceType" title="enum GUdevDeviceType"><span class="type">GUdevDeviceType</span></a> enumeration.
-</td>
+<td>A value from the <a class="link" href="GUdevClient.html#GUdevDeviceType"><span class="type">GUdevDeviceType</span></a> enumeration.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>number</code></em> :</span></p></td>
-<td>A device number.
-</td>
+<td>A device number.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> object or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if the device was not found. Free with <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#g-object-unref"><code class="function">g_object_unref()</code></a>. <span class="annotation">[<a href="http://foldoc.org/transfer%20full"><span class="acronym">transfer full</span></a>]</span>
+<td>A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> object or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if the device was not found. Free with <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#g-object-unref"><code class="function">g_object_unref()</code></a>. <span class="annotation">[<a href="http://foldoc.org/transfer%20full"><span class="acronym">transfer full</span></a>]</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="g_udev_client_query_by_device_file ()">
+<div class="refsect2">
<a name="g-udev-client-query-by-device-file"></a><h3>g_udev_client_query_by_device_file ()</h3>
<pre class="programlisting"><a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="returnvalue">GUdevDevice</span></a> * g_udev_client_query_by_device_file (<em class="parameter"><code><a class="link" href="GUdevClient.html" title="GUdevClient"><span class="type">GUdevClient</span></a> *client</code></em>,
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *device_file</code></em>);</pre>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>client</code></em> :</span></p></td>
-<td>A <a class="link" href="GUdevClient.html" title="GUdevClient"><span class="type">GUdevClient</span></a>.
-</td>
+<td>A <a class="link" href="GUdevClient.html" title="GUdevClient"><span class="type">GUdevClient</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>device_file</code></em> :</span></p></td>
-<td>A device file.
-</td>
+<td>A device file.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> object or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if the device was not found. Free with <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#g-object-unref"><code class="function">g_object_unref()</code></a>. <span class="annotation">[<a href="http://foldoc.org/transfer%20full"><span class="acronym">transfer full</span></a>]</span>
+<td>A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> object or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if the device was not found. Free with <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#g-object-unref"><code class="function">g_object_unref()</code></a>. <span class="annotation">[<a href="http://foldoc.org/transfer%20full"><span class="acronym">transfer full</span></a>]</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="g_udev_client_query_by_sysfs_path ()">
+<div class="refsect2">
<a name="g-udev-client-query-by-sysfs-path"></a><h3>g_udev_client_query_by_sysfs_path ()</h3>
<pre class="programlisting"><a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="returnvalue">GUdevDevice</span></a> * g_udev_client_query_by_sysfs_path (<em class="parameter"><code><a class="link" href="GUdevClient.html" title="GUdevClient"><span class="type">GUdevClient</span></a> *client</code></em>,
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *sysfs_path</code></em>);</pre>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>client</code></em> :</span></p></td>
-<td>A <a class="link" href="GUdevClient.html" title="GUdevClient"><span class="type">GUdevClient</span></a>.
-</td>
+<td>A <a class="link" href="GUdevClient.html" title="GUdevClient"><span class="type">GUdevClient</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>sysfs_path</code></em> :</span></p></td>
-<td>A sysfs path.
-</td>
+<td>A sysfs path.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
+<td>A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> object or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if the device was not found. Free with <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#g-object-unref"><code class="function">g_object_unref()</code></a>. <span class="annotation">[<a href="http://foldoc.org/transfer%20full"><span class="acronym">transfer full</span></a>]</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="g_udev_client_query_by_subsystem_and_name ()">
+<div class="refsect2">
<a name="g-udev-client-query-by-subsystem-and-name"></a><h3>g_udev_client_query_by_subsystem_and_name ()</h3>
<pre class="programlisting"><a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="returnvalue">GUdevDevice</span></a> * g_udev_client_query_by_subsystem_and_name
(<em class="parameter"><code><a class="link" href="GUdevClient.html" title="GUdevClient"><span class="type">GUdevClient</span></a> *client</code></em>,
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>client</code></em> :</span></p></td>
-<td>A <a class="link" href="GUdevClient.html" title="GUdevClient"><span class="type">GUdevClient</span></a>.
-</td>
+<td>A <a class="link" href="GUdevClient.html" title="GUdevClient"><span class="type">GUdevClient</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>subsystem</code></em> :</span></p></td>
-<td>A subsystem name.
-</td>
+<td>A subsystem name.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
-<td>The name of the device.
-</td>
+<td>The name of the device.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> object or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if the device was not found. Free with <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#g-object-unref"><code class="function">g_object_unref()</code></a>. <span class="annotation">[<a href="http://foldoc.org/transfer%20full"><span class="acronym">transfer full</span></a>]</span>
+<td>A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> object or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if the device was not found. Free with <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#g-object-unref"><code class="function">g_object_unref()</code></a>. <span class="annotation">[<a href="http://foldoc.org/transfer%20full"><span class="acronym">transfer full</span></a>]</span>
</td>
</tr>
</tbody>
</table></div>
</div>
</div>
-<div class="refsect1" title="Property Details">
+<div class="refsect1">
<a name="GUdevClient.property-details"></a><h2>Property Details</h2>
-<div class="refsect2" title='The "subsystems" property'>
+<div class="refsect2">
<a name="GUdevClient--subsystems"></a><h3>The <code class="literal">"subsystems"</code> property</h3>
-<pre class="programlisting"> "subsystems" <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Boxed-Types.html#GStrv"><span class="type">GStrv</span></a>* : Read / Write / Construct Only</pre>
+<pre class="programlisting"> "subsystems" <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Boxed-Types.html#GStrv"><span class="type">GStrv</span></a> : Read / Write / Construct Only</pre>
<p>
The subsystems to listen for uevents on.
</p>
</p>
</div>
</div>
-<div class="refsect1" title="Signal Details">
+<div class="refsect1">
<a name="GUdevClient.signal-details"></a><h2>Signal Details</h2>
-<div class="refsect2" title='The "uevent" signal'>
+<div class="refsect2">
<a name="GUdevClient-uevent"></a><h3>The <code class="literal">"uevent"</code> signal</h3>
<pre class="programlisting"><span class="returnvalue">void</span> user_function (<a class="link" href="GUdevClient.html" title="GUdevClient"><span class="type">GUdevClient</span></a> *client,
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *action,
<a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> *device,
- <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data) : Run Last</pre>
+ <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data) : <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html#G-SIGNAL-RUN-LAST:CAPS"><code class="literal">Run Last</code></a></pre>
<p>
Emitted when <em class="parameter"><code>client</code></em> receives an uevent.
</p>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>client</code></em> :</span></p></td>
-<td>The <a class="link" href="GUdevClient.html" title="GUdevClient"><span class="type">GUdevClient</span></a> receiving the event.
-</td>
+<td>The <a class="link" href="GUdevClient.html" title="GUdevClient"><span class="type">GUdevClient</span></a> receiving the event.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>action</code></em> :</span></p></td>
-<td>The action for the uevent e.g. "add", "remove", "change", "move", etc.
-</td>
+<td>The action for the uevent e.g. "add", "remove", "change", "move", etc.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>device</code></em> :</span></p></td>
-<td>Details about the <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> the event is for.
-</td>
+<td>Details about the <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> the event is for.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
</div>
<div class="footer">
<hr>
- Generated by GTK-Doc V1.15</div>
+ Generated by GTK-Doc V1.18</div>
</body>
</html>
\ No newline at end of file
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GUdevDevice</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="index.html" title="GUDev Reference Manual">
<link rel="up" href="ref-API.html" title="API Reference">
<link rel="prev" href="GUdevClient.html" title="GUdevClient">
<link rel="next" href="GUdevEnumerator.html" title="GUdevEnumerator">
-<meta name="generator" content="GTK-Doc V1.15 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<a href="#GUdevDevice.object-hierarchy" class="shortcut">Object Hierarchy</a>
</td></tr>
</table>
-<div class="refentry" title="GUdevDevice">
+<div class="refentry">
<a name="GUdevDevice"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
</td>
<td valign="top" align="right"></td>
</tr></table></div>
-<div class="refsynopsisdiv" title="Synopsis">
+<div class="refsynopsisdiv">
<a name="GUdevDevice.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis"> <a class="link" href="GUdevDevice.html#GUdevDevice-struct" title="GUdevDevice">GUdevDevice</a>;
- <a class="link" href="GUdevDevice.html#GUdevDeviceClass" title="GUdevDeviceClass">GUdevDeviceClass</a>;
+struct <a class="link" href="GUdevDevice.html#GUdevDeviceClass" title="struct GUdevDeviceClass">GUdevDeviceClass</a>;
const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * <a class="link" href="GUdevDevice.html#g-udev-device-get-subsystem" title="g_udev_device_get_subsystem ()">g_udev_device_get_subsystem</a> (<em class="parameter"><code><a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> *device</code></em>);
const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * <a class="link" href="GUdevDevice.html#g-udev-device-get-devtype" title="g_udev_device_get_devtype ()">g_udev_device_get_devtype</a> (<em class="parameter"><code><a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> *device</code></em>);
const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * <a class="link" href="GUdevDevice.html#g-udev-device-get-name" title="g_udev_device_get_name ()">g_udev_device_get_name</a> (<em class="parameter"><code><a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> *device</code></em>);
const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * <a class="link" href="GUdevDevice.html#g-udev-device-get-driver" title="g_udev_device_get_driver ()">g_udev_device_get_driver</a> (<em class="parameter"><code><a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> *device</code></em>);
const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * <a class="link" href="GUdevDevice.html#g-udev-device-get-action" title="g_udev_device_get_action ()">g_udev_device_get_action</a> (<em class="parameter"><code><a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> *device</code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint64"><span class="returnvalue">guint64</span></a> <a class="link" href="GUdevDevice.html#g-udev-device-get-seqnum" title="g_udev_device_get_seqnum ()">g_udev_device_get_seqnum</a> (<em class="parameter"><code><a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> *device</code></em>);
-<a class="link" href="GUdevClient.html#GUdevDeviceType" title="enum GUdevDeviceType"><span class="returnvalue">GUdevDeviceType</span></a> <a class="link" href="GUdevDevice.html#g-udev-device-get-device-type" title="g_udev_device_get_device_type ()">g_udev_device_get_device_type</a> (<em class="parameter"><code><a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> *device</code></em>);
+<a class="link" href="GUdevClient.html#GUdevDeviceType"><span class="returnvalue">GUdevDeviceType</span></a> <a class="link" href="GUdevDevice.html#g-udev-device-get-device-type" title="g_udev_device_get_device_type ()">g_udev_device_get_device_type</a> (<em class="parameter"><code><a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> *device</code></em>);
<a class="link" href="GUdevClient.html#GUdevDeviceNumber" title="GUdevDeviceNumber"><span class="returnvalue">GUdevDeviceNumber</span></a> <a class="link" href="GUdevDevice.html#g-udev-device-get-device-number" title="g_udev_device_get_device_number ()">g_udev_device_get_device_number</a> (<em class="parameter"><code><a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> *device</code></em>);
const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * <a class="link" href="GUdevDevice.html#g-udev-device-get-device-file" title="g_udev_device_get_device_file ()">g_udev_device_get_device_file</a> (<em class="parameter"><code><a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> *device</code></em>);
-const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a>* const * <a class="link" href="GUdevDevice.html#g-udev-device-get-device-file-symlinks" title="g_udev_device_get_device_file_symlinks ()">g_udev_device_get_device_file_symlinks</a>
+const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * const * <a class="link" href="GUdevDevice.html#g-udev-device-get-device-file-symlinks" title="g_udev_device_get_device_file_symlinks ()">g_udev_device_get_device_file_symlinks</a>
(<em class="parameter"><code><a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> *device</code></em>);
<a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="returnvalue">GUdevDevice</span></a> * <a class="link" href="GUdevDevice.html#g-udev-device-get-parent" title="g_udev_device_get_parent ()">g_udev_device_get_parent</a> (<em class="parameter"><code><a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> *device</code></em>);
<a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="returnvalue">GUdevDevice</span></a> * <a class="link" href="GUdevDevice.html#g-udev-device-get-parent-with-subsystem" title="g_udev_device_get_parent_with_subsystem ()">g_udev_device_get_parent_with_subsystem</a>
(<em class="parameter"><code><a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> *device</code></em>,
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *subsystem</code></em>,
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *devtype</code></em>);
-const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a>* const * <a class="link" href="GUdevDevice.html#g-udev-device-get-tags" title="g_udev_device_get_tags ()">g_udev_device_get_tags</a> (<em class="parameter"><code><a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> *device</code></em>);
+const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * const * <a class="link" href="GUdevDevice.html#g-udev-device-get-tags" title="g_udev_device_get_tags ()">g_udev_device_get_tags</a> (<em class="parameter"><code><a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> *device</code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="GUdevDevice.html#g-udev-device-get-is-initialized" title="g_udev_device_get_is_initialized ()">g_udev_device_get_is_initialized</a> (<em class="parameter"><code><a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> *device</code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint64"><span class="returnvalue">guint64</span></a> <a class="link" href="GUdevDevice.html#g-udev-device-get-usec-since-initialized" title="g_udev_device_get_usec_since_initialized ()">g_udev_device_get_usec_since_initialized</a>
(<em class="parameter"><code><a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> *device</code></em>);
-const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a>* const * <a class="link" href="GUdevDevice.html#g-udev-device-get-property-keys" title="g_udev_device_get_property_keys ()">g_udev_device_get_property_keys</a> (<em class="parameter"><code><a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> *device</code></em>);
+const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * const * <a class="link" href="GUdevDevice.html#g-udev-device-get-property-keys" title="g_udev_device_get_property_keys ()">g_udev_device_get_property_keys</a> (<em class="parameter"><code><a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> *device</code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="GUdevDevice.html#g-udev-device-has-property" title="g_udev_device_has_property ()">g_udev_device_has_property</a> (<em class="parameter"><code><a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> *device</code></em>,
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *key</code></em>);
const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * <a class="link" href="GUdevDevice.html#g-udev-device-get-property" title="g_udev_device_get_property ()">g_udev_device_get_property</a> (<em class="parameter"><code><a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> *device</code></em>,
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="GUdevDevice.html#g-udev-device-get-property-as-boolean" title="g_udev_device_get_property_as_boolean ()">g_udev_device_get_property_as_boolean</a>
(<em class="parameter"><code><a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> *device</code></em>,
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *key</code></em>);
-const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a>* const * <a class="link" href="GUdevDevice.html#g-udev-device-get-property-as-strv" title="g_udev_device_get_property_as_strv ()">g_udev_device_get_property_as_strv</a> (<em class="parameter"><code><a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> *device</code></em>,
+const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * const * <a class="link" href="GUdevDevice.html#g-udev-device-get-property-as-strv" title="g_udev_device_get_property_as_strv ()">g_udev_device_get_property_as_strv</a>
+ (<em class="parameter"><code><a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> *device</code></em>,
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *key</code></em>);
const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * <a class="link" href="GUdevDevice.html#g-udev-device-get-sysfs-attr" title="g_udev_device_get_sysfs_attr ()">g_udev_device_get_sysfs_attr</a> (<em class="parameter"><code><a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> *device</code></em>,
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *name</code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="GUdevDevice.html#g-udev-device-get-sysfs-attr-as-boolean" title="g_udev_device_get_sysfs_attr_as_boolean ()">g_udev_device_get_sysfs_attr_as_boolean</a>
(<em class="parameter"><code><a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> *device</code></em>,
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *name</code></em>);
-const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a>* const * <a class="link" href="GUdevDevice.html#g-udev-device-get-sysfs-attr-as-strv" title="g_udev_device_get_sysfs_attr_as_strv ()">g_udev_device_get_sysfs_attr_as_strv</a>
+const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * const * <a class="link" href="GUdevDevice.html#g-udev-device-get-sysfs-attr-as-strv" title="g_udev_device_get_sysfs_attr_as_strv ()">g_udev_device_get_sysfs_attr_as_strv</a>
(<em class="parameter"><code><a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> *device</code></em>,
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *name</code></em>);
</pre>
</div>
-<div class="refsect1" title="Object Hierarchy">
+<div class="refsect1">
<a name="GUdevDevice.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="synopsis">
<a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObject">GObject</a>
+----GUdevDevice
</pre>
</div>
-<div class="refsect1" title="Description">
+<div class="refsect1">
<a name="GUdevDevice.description"></a><h2>Description</h2>
<p>
The <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> class is used to get information about a specific
<a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> whenever an event happens.
</p>
</div>
-<div class="refsect1" title="Details">
+<div class="refsect1">
<a name="GUdevDevice.details"></a><h2>Details</h2>
-<div class="refsect2" title="GUdevDevice">
+<div class="refsect2">
<a name="GUdevDevice-struct"></a><h3>GUdevDevice</h3>
<pre class="programlisting">typedef struct _GUdevDevice GUdevDevice;</pre>
<p>
The <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> struct is opaque and should not be accessed directly.
</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody></tbody>
-</table></div>
</div>
<hr>
-<div class="refsect2" title="GUdevDeviceClass">
-<a name="GUdevDeviceClass"></a><h3>GUdevDeviceClass</h3>
-<pre class="programlisting">typedef struct {
+<div class="refsect2">
+<a name="GUdevDeviceClass"></a><h3>struct GUdevDeviceClass</h3>
+<pre class="programlisting">struct GUdevDeviceClass {
GObjectClass parent_class;
-} GUdevDeviceClass;
+};
</pre>
<p>
Class structure for <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a>.
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObjectClass"><span class="type">GObjectClass</span></a> <em class="structfield"><code><a name="GUdevDeviceClass.parent-class"></a>parent_class</code></em>;</span></p></td>
-<td>Parent class.
-</td>
+<td>Parent class.</td>
</tr></tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="g_udev_device_get_subsystem ()">
+<div class="refsect2">
<a name="g-udev-device-get-subsystem"></a><h3>g_udev_device_get_subsystem ()</h3>
<pre class="programlisting">const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * g_udev_device_get_subsystem (<em class="parameter"><code><a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> *device</code></em>);</pre>
<p>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>device</code></em> :</span></p></td>
-<td>A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a>.
-</td>
+<td>A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> The subsystem for <em class="parameter"><code>device</code></em>.
-</td>
+<td>The subsystem for <em class="parameter"><code>device</code></em>.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="g_udev_device_get_devtype ()">
+<div class="refsect2">
<a name="g-udev-device-get-devtype"></a><h3>g_udev_device_get_devtype ()</h3>
<pre class="programlisting">const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * g_udev_device_get_devtype (<em class="parameter"><code><a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> *device</code></em>);</pre>
<p>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>device</code></em> :</span></p></td>
-<td>A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a>.
-</td>
+<td>A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> The devtype for <em class="parameter"><code>device</code></em>.
-</td>
+<td>The devtype for <em class="parameter"><code>device</code></em>.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="g_udev_device_get_name ()">
+<div class="refsect2">
<a name="g-udev-device-get-name"></a><h3>g_udev_device_get_name ()</h3>
<pre class="programlisting">const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * g_udev_device_get_name (<em class="parameter"><code><a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> *device</code></em>);</pre>
<p>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>device</code></em> :</span></p></td>
-<td>A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a>.
-</td>
+<td>A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> The name of <em class="parameter"><code>device</code></em>.
-</td>
+<td>The name of <em class="parameter"><code>device</code></em>.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="g_udev_device_get_number ()">
+<div class="refsect2">
<a name="g-udev-device-get-number"></a><h3>g_udev_device_get_number ()</h3>
<pre class="programlisting">const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * g_udev_device_get_number (<em class="parameter"><code><a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> *device</code></em>);</pre>
<p>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>device</code></em> :</span></p></td>
-<td>A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a>.
-</td>
+<td>A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> The number of <em class="parameter"><code>device</code></em>.
-</td>
+<td>The number of <em class="parameter"><code>device</code></em>.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="g_udev_device_get_sysfs_path ()">
+<div class="refsect2">
<a name="g-udev-device-get-sysfs-path"></a><h3>g_udev_device_get_sysfs_path ()</h3>
<pre class="programlisting">const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * g_udev_device_get_sysfs_path (<em class="parameter"><code><a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> *device</code></em>);</pre>
<p>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>device</code></em> :</span></p></td>
-<td>A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a>.
-</td>
+<td>A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> The sysfs path for <em class="parameter"><code>device</code></em>.
-</td>
+<td>The sysfs path for <em class="parameter"><code>device</code></em>.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="g_udev_device_get_driver ()">
+<div class="refsect2">
<a name="g-udev-device-get-driver"></a><h3>g_udev_device_get_driver ()</h3>
<pre class="programlisting">const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * g_udev_device_get_driver (<em class="parameter"><code><a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> *device</code></em>);</pre>
<p>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>device</code></em> :</span></p></td>
-<td>A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a>.
-</td>
+<td>A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> The name of the driver for <em class="parameter"><code>device</code></em> or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if unknown.
-</td>
+<td>The name of the driver for <em class="parameter"><code>device</code></em> or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if unknown.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="g_udev_device_get_action ()">
+<div class="refsect2">
<a name="g-udev-device-get-action"></a><h3>g_udev_device_get_action ()</h3>
<pre class="programlisting">const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * g_udev_device_get_action (<em class="parameter"><code><a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> *device</code></em>);</pre>
<p>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>device</code></em> :</span></p></td>
-<td>A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a>.
-</td>
+<td>A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> An action string.
-</td>
+<td>An action string.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="g_udev_device_get_seqnum ()">
+<div class="refsect2">
<a name="g-udev-device-get-seqnum"></a><h3>g_udev_device_get_seqnum ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint64"><span class="returnvalue">guint64</span></a> g_udev_device_get_seqnum (<em class="parameter"><code><a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> *device</code></em>);</pre>
<p>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>device</code></em> :</span></p></td>
-<td>A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a>.
-</td>
+<td>A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> A sequence number.
-</td>
+<td>A sequence number.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="g_udev_device_get_device_type ()">
+<div class="refsect2">
<a name="g-udev-device-get-device-type"></a><h3>g_udev_device_get_device_type ()</h3>
-<pre class="programlisting"><a class="link" href="GUdevClient.html#GUdevDeviceType" title="enum GUdevDeviceType"><span class="returnvalue">GUdevDeviceType</span></a> g_udev_device_get_device_type (<em class="parameter"><code><a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> *device</code></em>);</pre>
+<pre class="programlisting"><a class="link" href="GUdevClient.html#GUdevDeviceType"><span class="returnvalue">GUdevDeviceType</span></a> g_udev_device_get_device_type (<em class="parameter"><code><a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> *device</code></em>);</pre>
<p>
Gets the type of the device file, if any, for <em class="parameter"><code>device</code></em>.
</p>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>device</code></em> :</span></p></td>
-<td>A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a>.
-</td>
+<td>A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> The device number for <em class="parameter"><code>device</code></em> or <a class="link" href="GUdevClient.html#G-UDEV-DEVICE-TYPE-NONE:CAPS"><span class="type">G_UDEV_DEVICE_TYPE_NONE</span></a> if the device does not have a device file.
-</td>
+<td>The device number for <em class="parameter"><code>device</code></em> or <a class="link" href="GUdevClient.html#G-UDEV-DEVICE-TYPE-NONE:CAPS"><span class="type">G_UDEV_DEVICE_TYPE_NONE</span></a> if the device does not have a device file.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="g_udev_device_get_device_number ()">
+<div class="refsect2">
<a name="g-udev-device-get-device-number"></a><h3>g_udev_device_get_device_number ()</h3>
<pre class="programlisting"><a class="link" href="GUdevClient.html#GUdevDeviceNumber" title="GUdevDeviceNumber"><span class="returnvalue">GUdevDeviceNumber</span></a> g_udev_device_get_device_number (<em class="parameter"><code><a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> *device</code></em>);</pre>
<p>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>device</code></em> :</span></p></td>
-<td>A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a>.
-</td>
+<td>A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> The device number for <em class="parameter"><code>device</code></em> or 0 if unknown.
-</td>
+<td>The device number for <em class="parameter"><code>device</code></em> or 0 if unknown.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="g_udev_device_get_device_file ()">
+<div class="refsect2">
<a name="g-udev-device-get-device-file"></a><h3>g_udev_device_get_device_file ()</h3>
<pre class="programlisting">const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * g_udev_device_get_device_file (<em class="parameter"><code><a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> *device</code></em>);</pre>
<p>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>device</code></em> :</span></p></td>
-<td>A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a>.
-</td>
+<td>A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> The device file for <em class="parameter"><code>device</code></em> or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if no device file
-exists.
-</td>
+<td>The device file for <em class="parameter"><code>device</code></em> or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if no device file
+exists.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="g_udev_device_get_device_file_symlinks ()">
+<div class="refsect2">
<a name="g-udev-device-get-device-file-symlinks"></a><h3>g_udev_device_get_device_file_symlinks ()</h3>
-<pre class="programlisting">const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a>* const * g_udev_device_get_device_file_symlinks
+<pre class="programlisting">const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * const * g_udev_device_get_device_file_symlinks
(<em class="parameter"><code><a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> *device</code></em>);</pre>
<p>
Gets a list of symlinks (in <code class="literal">/dev</code>) that points to
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>device</code></em> :</span></p></td>
-<td>A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a>.
-</td>
+<td>A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> A <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> terminated string array of symlinks. This array is owned by <em class="parameter"><code>device</code></em> and should not be freed by the caller. <span class="annotation">[<a href="http://foldoc.org/transfer%20none"><span class="acronym">transfer none</span></a>][<a href="http://foldoc.org/array"><span class="acronym">array</span></a> zero-terminated=1][<a href="http://foldoc.org/element-type"><span class="acronym">element-type</span></a> utf8]</span>
+<td>A <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> terminated string array of symlinks. This array is owned by <em class="parameter"><code>device</code></em> and should not be freed by the caller. <span class="annotation">[<a href="http://foldoc.org/transfer%20none"><span class="acronym">transfer none</span></a>][<a href="http://foldoc.org/array"><span class="acronym">array</span></a> zero-terminated=1][<a href="http://foldoc.org/element-type"><span class="acronym">element-type</span></a> utf8]</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="g_udev_device_get_parent ()">
+<div class="refsect2">
<a name="g-udev-device-get-parent"></a><h3>g_udev_device_get_parent ()</h3>
<pre class="programlisting"><a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="returnvalue">GUdevDevice</span></a> * g_udev_device_get_parent (<em class="parameter"><code><a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> *device</code></em>);</pre>
<p>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>device</code></em> :</span></p></td>
-<td>A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a>.
-</td>
+<td>A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if <em class="parameter"><code>device</code></em> has no parent. Free with <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#g-object-unref"><code class="function">g_object_unref()</code></a>.
-</td>
+<td>A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if <em class="parameter"><code>device</code></em> has no parent. Free with <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#g-object-unref"><code class="function">g_object_unref()</code></a>.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="g_udev_device_get_parent_with_subsystem ()">
+<div class="refsect2">
<a name="g-udev-device-get-parent-with-subsystem"></a><h3>g_udev_device_get_parent_with_subsystem ()</h3>
<pre class="programlisting"><a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="returnvalue">GUdevDevice</span></a> * g_udev_device_get_parent_with_subsystem
(<em class="parameter"><code><a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> *device</code></em>,
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>device</code></em> :</span></p></td>
-<td>A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a>.
-</td>
+<td>A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>subsystem</code></em> :</span></p></td>
-<td>The subsystem of the parent to get.
-</td>
+<td>The subsystem of the parent to get.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>devtype</code></em> :</span></p></td>
-<td> The devtype of the parent to get or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<a href="http://foldoc.org/allow-none"><span class="acronym">allow-none</span></a>]</span>
+<td>The devtype of the parent to get or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<a href="http://foldoc.org/allow-none"><span class="acronym">allow-none</span></a>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if <em class="parameter"><code>device</code></em> has no parent with <em class="parameter"><code>subsystem</code></em> and <em class="parameter"><code>devtype</code></em>. Free with <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#g-object-unref"><code class="function">g_object_unref()</code></a>.
-</td>
+<td>A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if <em class="parameter"><code>device</code></em> has no parent with <em class="parameter"><code>subsystem</code></em> and <em class="parameter"><code>devtype</code></em>. Free with <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#g-object-unref"><code class="function">g_object_unref()</code></a>.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="g_udev_device_get_tags ()">
+<div class="refsect2">
<a name="g-udev-device-get-tags"></a><h3>g_udev_device_get_tags ()</h3>
-<pre class="programlisting">const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a>* const * g_udev_device_get_tags (<em class="parameter"><code><a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> *device</code></em>);</pre>
+<pre class="programlisting">const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * const * g_udev_device_get_tags (<em class="parameter"><code><a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> *device</code></em>);</pre>
<p>
Gets all tags for <em class="parameter"><code>device</code></em>.
</p>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>device</code></em> :</span></p></td>
-<td>A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a>.
-</td>
+<td>A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> A <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> terminated string array of tags. This array is owned by <em class="parameter"><code>device</code></em> and should not be freed by the caller. <span class="annotation">[<a href="http://foldoc.org/transfer%20none"><span class="acronym">transfer none</span></a>][<a href="http://foldoc.org/array"><span class="acronym">array</span></a> zero-terminated=1][<a href="http://foldoc.org/element-type"><span class="acronym">element-type</span></a> utf8]</span>
+<td>A <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> terminated string array of tags. This array is owned by <em class="parameter"><code>device</code></em> and should not be freed by the caller. <span class="annotation">[<a href="http://foldoc.org/transfer%20none"><span class="acronym">transfer none</span></a>][<a href="http://foldoc.org/array"><span class="acronym">array</span></a> zero-terminated=1][<a href="http://foldoc.org/element-type"><span class="acronym">element-type</span></a> utf8]</span>
</td>
</tr>
</tbody>
<p class="since">Since 165</p>
</div>
<hr>
-<div class="refsect2" title="g_udev_device_get_is_initialized ()">
+<div class="refsect2">
<a name="g-udev-device-get-is-initialized"></a><h3>g_udev_device_get_is_initialized ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> g_udev_device_get_is_initialized (<em class="parameter"><code><a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> *device</code></em>);</pre>
<p>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>device</code></em> :</span></p></td>
-<td>A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a>.
-</td>
+<td>A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> Whether <em class="parameter"><code>device</code></em> has been initialized.
-
-</td>
+<td>Whether <em class="parameter"><code>device</code></em> has been initialized.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 165</p>
</div>
<hr>
-<div class="refsect2" title="g_udev_device_get_usec_since_initialized ()">
+<div class="refsect2">
<a name="g-udev-device-get-usec-since-initialized"></a><h3>g_udev_device_get_usec_since_initialized ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint64"><span class="returnvalue">guint64</span></a> g_udev_device_get_usec_since_initialized
(<em class="parameter"><code><a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> *device</code></em>);</pre>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>device</code></em> :</span></p></td>
-<td>A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a>.
-</td>
+<td>A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> Number of micro-seconds since <em class="parameter"><code>device</code></em> was initialized or 0 if unknown.
-
-</td>
+<td>Number of micro-seconds since <em class="parameter"><code>device</code></em> was initialized or 0 if unknown.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 165</p>
</div>
<hr>
-<div class="refsect2" title="g_udev_device_get_property_keys ()">
+<div class="refsect2">
<a name="g-udev-device-get-property-keys"></a><h3>g_udev_device_get_property_keys ()</h3>
-<pre class="programlisting">const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a>* const * g_udev_device_get_property_keys (<em class="parameter"><code><a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> *device</code></em>);</pre>
+<pre class="programlisting">const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * const * g_udev_device_get_property_keys (<em class="parameter"><code><a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> *device</code></em>);</pre>
<p>
Gets all keys for properties on <em class="parameter"><code>device</code></em>.
</p>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>device</code></em> :</span></p></td>
-<td>A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a>.
-</td>
+<td>A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> A <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> terminated string array of property keys. This array is owned by <em class="parameter"><code>device</code></em> and should not be freed by the caller. <span class="annotation">[<a href="http://foldoc.org/transfer%20none"><span class="acronym">transfer none</span></a>][<a href="http://foldoc.org/array"><span class="acronym">array</span></a> zero-terminated=1][<a href="http://foldoc.org/element-type"><span class="acronym">element-type</span></a> utf8]</span>
+<td>A <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> terminated string array of property keys. This array is owned by <em class="parameter"><code>device</code></em> and should not be freed by the caller. <span class="annotation">[<a href="http://foldoc.org/transfer%20none"><span class="acronym">transfer none</span></a>][<a href="http://foldoc.org/array"><span class="acronym">array</span></a> zero-terminated=1][<a href="http://foldoc.org/element-type"><span class="acronym">element-type</span></a> utf8]</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="g_udev_device_has_property ()">
+<div class="refsect2">
<a name="g-udev-device-has-property"></a><h3>g_udev_device_has_property ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> g_udev_device_has_property (<em class="parameter"><code><a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> *device</code></em>,
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *key</code></em>);</pre>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>device</code></em> :</span></p></td>
-<td>A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a>.
-</td>
+<td>A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>key</code></em> :</span></p></td>
-<td>Name of property.
-</td>
+<td>Name of property.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> only if the value for <em class="parameter"><code>key</code></em> exist.
-</td>
+<td>
+<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> only if the value for <em class="parameter"><code>key</code></em> exist.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="g_udev_device_get_property ()">
+<div class="refsect2">
<a name="g-udev-device-get-property"></a><h3>g_udev_device_get_property ()</h3>
<pre class="programlisting">const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * g_udev_device_get_property (<em class="parameter"><code><a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> *device</code></em>,
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *key</code></em>);</pre>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>device</code></em> :</span></p></td>
-<td>A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a>.
-</td>
+<td>A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>key</code></em> :</span></p></td>
-<td>Name of property.
-</td>
+<td>Name of property.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> The value for <em class="parameter"><code>key</code></em> or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if <em class="parameter"><code>key</code></em> doesn't exist on <em class="parameter"><code>device</code></em>. Do not free this string, it is owned by <em class="parameter"><code>device</code></em>.
-</td>
+<td>The value for <em class="parameter"><code>key</code></em> or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if <em class="parameter"><code>key</code></em> doesn't exist on <em class="parameter"><code>device</code></em>. Do not free this string, it is owned by <em class="parameter"><code>device</code></em>.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="g_udev_device_get_property_as_int ()">
+<div class="refsect2">
<a name="g-udev-device-get-property-as-int"></a><h3>g_udev_device_get_property_as_int ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a> g_udev_device_get_property_as_int (<em class="parameter"><code><a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> *device</code></em>,
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *key</code></em>);</pre>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>device</code></em> :</span></p></td>
-<td>A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a>.
-</td>
+<td>A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>key</code></em> :</span></p></td>
-<td>Name of property.
-</td>
+<td>Name of property.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> The value for <em class="parameter"><code>key</code></em> or 0 if <em class="parameter"><code>key</code></em> doesn't exist or
-isn't an integer.
-</td>
+<td>The value for <em class="parameter"><code>key</code></em> or 0 if <em class="parameter"><code>key</code></em> doesn't exist or
+isn't an integer.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="g_udev_device_get_property_as_uint64 ()">
+<div class="refsect2">
<a name="g-udev-device-get-property-as-uint64"></a><h3>g_udev_device_get_property_as_uint64 ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint64"><span class="returnvalue">guint64</span></a> g_udev_device_get_property_as_uint64
(<em class="parameter"><code><a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> *device</code></em>,
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>device</code></em> :</span></p></td>
-<td>A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a>.
-</td>
+<td>A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>key</code></em> :</span></p></td>
-<td>Name of property.
-</td>
+<td>Name of property.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> The value for <em class="parameter"><code>key</code></em> or 0 if <em class="parameter"><code>key</code></em> doesn't exist or isn't a
-<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint64"><span class="type">guint64</span></a>.
-</td>
+<td>The value for <em class="parameter"><code>key</code></em> or 0 if <em class="parameter"><code>key</code></em> doesn't exist or isn't a
+<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint64"><span class="type">guint64</span></a>.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="g_udev_device_get_property_as_double ()">
+<div class="refsect2">
<a name="g-udev-device-get-property-as-double"></a><h3>g_udev_device_get_property_as_double ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gdouble"><span class="returnvalue">gdouble</span></a> g_udev_device_get_property_as_double
(<em class="parameter"><code><a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> *device</code></em>,
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>device</code></em> :</span></p></td>
-<td>A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a>.
-</td>
+<td>A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>key</code></em> :</span></p></td>
-<td>Name of property.
-</td>
+<td>Name of property.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> The value for <em class="parameter"><code>key</code></em> or 0.0 if <em class="parameter"><code>key</code></em> doesn't exist or isn't a
-<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a>.
-</td>
+<td>The value for <em class="parameter"><code>key</code></em> or 0.0 if <em class="parameter"><code>key</code></em> doesn't exist or isn't a
+<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a>.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="g_udev_device_get_property_as_boolean ()">
+<div class="refsect2">
<a name="g-udev-device-get-property-as-boolean"></a><h3>g_udev_device_get_property_as_boolean ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> g_udev_device_get_property_as_boolean
(<em class="parameter"><code><a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> *device</code></em>,
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>device</code></em> :</span></p></td>
-<td>A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a>.
-</td>
+<td>A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>key</code></em> :</span></p></td>
-<td>Name of property.
-</td>
+<td>Name of property.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> The value for <em class="parameter"><code>key</code></em> or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> if <em class="parameter"><code>key</code></em> doesn't exist or
-isn't a <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a>.
-</td>
+<td>The value for <em class="parameter"><code>key</code></em> or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> if <em class="parameter"><code>key</code></em> doesn't exist or
+isn't a <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a>.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="g_udev_device_get_property_as_strv ()">
+<div class="refsect2">
<a name="g-udev-device-get-property-as-strv"></a><h3>g_udev_device_get_property_as_strv ()</h3>
-<pre class="programlisting">const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a>* const * g_udev_device_get_property_as_strv (<em class="parameter"><code><a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> *device</code></em>,
+<pre class="programlisting">const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * const * g_udev_device_get_property_as_strv
+ (<em class="parameter"><code><a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> *device</code></em>,
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *key</code></em>);</pre>
<p>
Look up the value for <em class="parameter"><code>key</code></em> on <em class="parameter"><code>device</code></em> and return the result of
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>device</code></em> :</span></p></td>
-<td>A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a>.
-</td>
+<td>A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>key</code></em> :</span></p></td>
-<td>Name of property.
-</td>
+<td>Name of property.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> The value of <em class="parameter"><code>key</code></em> on <em class="parameter"><code>device</code></em> split into tokens or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if <em class="parameter"><code>key</code></em> doesn't exist. This array is owned by <em class="parameter"><code>device</code></em> and should not be freed by the caller. <span class="annotation">[<a href="http://foldoc.org/transfer%20none"><span class="acronym">transfer none</span></a>][<a href="http://foldoc.org/array"><span class="acronym">array</span></a> zero-terminated=1][<a href="http://foldoc.org/element-type"><span class="acronym">element-type</span></a> utf8]</span>
+<td>The value of <em class="parameter"><code>key</code></em> on <em class="parameter"><code>device</code></em> split into tokens or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if <em class="parameter"><code>key</code></em> doesn't exist. This array is owned by <em class="parameter"><code>device</code></em> and should not be freed by the caller. <span class="annotation">[<a href="http://foldoc.org/transfer%20none"><span class="acronym">transfer none</span></a>][<a href="http://foldoc.org/array"><span class="acronym">array</span></a> zero-terminated=1][<a href="http://foldoc.org/element-type"><span class="acronym">element-type</span></a> utf8]</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="g_udev_device_get_sysfs_attr ()">
+<div class="refsect2">
<a name="g-udev-device-get-sysfs-attr"></a><h3>g_udev_device_get_sysfs_attr ()</h3>
<pre class="programlisting">const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * g_udev_device_get_sysfs_attr (<em class="parameter"><code><a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> *device</code></em>,
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *name</code></em>);</pre>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>device</code></em> :</span></p></td>
-<td>A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a>.
-</td>
+<td>A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
-<td>Name of the sysfs attribute.
-</td>
+<td>Name of the sysfs attribute.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> The value of the sysfs attribute or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if there is no
-such attribute. Do not free this string, it is owned by <em class="parameter"><code>device</code></em>.
-</td>
+<td>The value of the sysfs attribute or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if there is no
+such attribute. Do not free this string, it is owned by <em class="parameter"><code>device</code></em>.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="g_udev_device_get_sysfs_attr_as_int ()">
+<div class="refsect2">
<a name="g-udev-device-get-sysfs-attr-as-int"></a><h3>g_udev_device_get_sysfs_attr_as_int ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a> g_udev_device_get_sysfs_attr_as_int (<em class="parameter"><code><a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> *device</code></em>,
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *name</code></em>);</pre>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>device</code></em> :</span></p></td>
-<td>A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a>.
-</td>
+<td>A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
-<td>Name of the sysfs attribute.
-</td>
+<td>Name of the sysfs attribute.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> The value of the sysfs attribute or 0 if there is no such
-attribute.
-</td>
+<td>The value of the sysfs attribute or 0 if there is no such
+attribute.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="g_udev_device_get_sysfs_attr_as_uint64 ()">
+<div class="refsect2">
<a name="g-udev-device-get-sysfs-attr-as-uint64"></a><h3>g_udev_device_get_sysfs_attr_as_uint64 ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint64"><span class="returnvalue">guint64</span></a> g_udev_device_get_sysfs_attr_as_uint64
(<em class="parameter"><code><a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> *device</code></em>,
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>device</code></em> :</span></p></td>
-<td>A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a>.
-</td>
+<td>A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
-<td>Name of the sysfs attribute.
-</td>
+<td>Name of the sysfs attribute.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> The value of the sysfs attribute or 0 if there is no such
-attribute.
-</td>
+<td>The value of the sysfs attribute or 0 if there is no such
+attribute.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="g_udev_device_get_sysfs_attr_as_double ()">
+<div class="refsect2">
<a name="g-udev-device-get-sysfs-attr-as-double"></a><h3>g_udev_device_get_sysfs_attr_as_double ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gdouble"><span class="returnvalue">gdouble</span></a> g_udev_device_get_sysfs_attr_as_double
(<em class="parameter"><code><a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> *device</code></em>,
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>device</code></em> :</span></p></td>
-<td>A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a>.
-</td>
+<td>A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
-<td>Name of the sysfs attribute.
-</td>
+<td>Name of the sysfs attribute.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> The value of the sysfs attribute or 0.0 if there is no such
-attribute.
-</td>
+<td>The value of the sysfs attribute or 0.0 if there is no such
+attribute.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="g_udev_device_get_sysfs_attr_as_boolean ()">
+<div class="refsect2">
<a name="g-udev-device-get-sysfs-attr-as-boolean"></a><h3>g_udev_device_get_sysfs_attr_as_boolean ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> g_udev_device_get_sysfs_attr_as_boolean
(<em class="parameter"><code><a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> *device</code></em>,
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>device</code></em> :</span></p></td>
-<td>A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a>.
-</td>
+<td>A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
-<td>Name of the sysfs attribute.
-</td>
+<td>Name of the sysfs attribute.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> The value of the sysfs attribute or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> if there is no such
-attribute.
-</td>
+<td>The value of the sysfs attribute or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> if there is no such
+attribute.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="g_udev_device_get_sysfs_attr_as_strv ()">
+<div class="refsect2">
<a name="g-udev-device-get-sysfs-attr-as-strv"></a><h3>g_udev_device_get_sysfs_attr_as_strv ()</h3>
-<pre class="programlisting">const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a>* const * g_udev_device_get_sysfs_attr_as_strv
+<pre class="programlisting">const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * const * g_udev_device_get_sysfs_attr_as_strv
(<em class="parameter"><code><a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> *device</code></em>,
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *name</code></em>);</pre>
<p>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>device</code></em> :</span></p></td>
-<td>A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a>.
-</td>
+<td>A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
-<td>Name of the sysfs attribute.
-</td>
+<td>Name of the sysfs attribute.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> The value of the sysfs attribute split into tokens or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if there is no such attribute. This array is owned by <em class="parameter"><code>device</code></em> and should not be freed by the caller. <span class="annotation">[<a href="http://foldoc.org/transfer%20none"><span class="acronym">transfer none</span></a>][<a href="http://foldoc.org/array"><span class="acronym">array</span></a> zero-terminated=1][<a href="http://foldoc.org/element-type"><span class="acronym">element-type</span></a> utf8]</span>
+<td>The value of the sysfs attribute split into tokens or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if there is no such attribute. This array is owned by <em class="parameter"><code>device</code></em> and should not be freed by the caller. <span class="annotation">[<a href="http://foldoc.org/transfer%20none"><span class="acronym">transfer none</span></a>][<a href="http://foldoc.org/array"><span class="acronym">array</span></a> zero-terminated=1][<a href="http://foldoc.org/element-type"><span class="acronym">element-type</span></a> utf8]</span>
</td>
</tr>
</tbody>
</div>
<div class="footer">
<hr>
- Generated by GTK-Doc V1.15</div>
+ Generated by GTK-Doc V1.18</div>
</body>
</html>
\ No newline at end of file
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GUdevEnumerator</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="index.html" title="GUDev Reference Manual">
<link rel="up" href="ref-API.html" title="API Reference">
<link rel="prev" href="GUdevDevice.html" title="GUdevDevice">
<link rel="next" href="gudev-hierarchy.html" title="Object Hierarchy">
-<meta name="generator" content="GTK-Doc V1.15 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<a href="#GUdevEnumerator.properties" class="shortcut">Properties</a>
</td></tr>
</table>
-<div class="refentry" title="GUdevEnumerator">
+<div class="refentry">
<a name="GUdevEnumerator"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
</td>
<td valign="top" align="right"></td>
</tr></table></div>
-<div class="refsynopsisdiv" title="Synopsis">
+<div class="refsynopsisdiv">
<a name="GUdevEnumerator.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis"> <a class="link" href="GUdevEnumerator.html#GUdevEnumerator-struct" title="GUdevEnumerator">GUdevEnumerator</a>;
- <a class="link" href="GUdevEnumerator.html#GUdevEnumeratorClass" title="GUdevEnumeratorClass">GUdevEnumeratorClass</a>;
+struct <a class="link" href="GUdevEnumerator.html#GUdevEnumeratorClass" title="struct GUdevEnumeratorClass">GUdevEnumeratorClass</a>;
<a class="link" href="GUdevEnumerator.html" title="GUdevEnumerator"><span class="returnvalue">GUdevEnumerator</span></a> * <a class="link" href="GUdevEnumerator.html#g-udev-enumerator-new" title="g_udev_enumerator_new ()">g_udev_enumerator_new</a> (<em class="parameter"><code><a class="link" href="GUdevClient.html" title="GUdevClient"><span class="type">GUdevClient</span></a> *client</code></em>);
<a class="link" href="GUdevEnumerator.html" title="GUdevEnumerator"><span class="returnvalue">GUdevEnumerator</span></a> * <a class="link" href="GUdevEnumerator.html#g-udev-enumerator-add-match-subsystem" title="g_udev_enumerator_add_match_subsystem ()">g_udev_enumerator_add_match_subsystem</a>
(<em class="parameter"><code><a class="link" href="GUdevEnumerator.html" title="GUdevEnumerator"><span class="type">GUdevEnumerator</span></a> *enumerator</code></em>,
<a href="http://library.gnome.org/devel/glib/unstable/glib-Doubly-Linked-Lists.html#GList"><span class="returnvalue">GList</span></a> * <a class="link" href="GUdevEnumerator.html#g-udev-enumerator-execute" title="g_udev_enumerator_execute ()">g_udev_enumerator_execute</a> (<em class="parameter"><code><a class="link" href="GUdevEnumerator.html" title="GUdevEnumerator"><span class="type">GUdevEnumerator</span></a> *enumerator</code></em>);
</pre>
</div>
-<div class="refsect1" title="Object Hierarchy">
+<div class="refsect1">
<a name="GUdevEnumerator.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="synopsis">
<a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObject">GObject</a>
+----GUdevEnumerator
</pre>
</div>
-<div class="refsect1" title="Properties">
+<div class="refsect1">
<a name="GUdevEnumerator.properties"></a><h2>Properties</h2>
<pre class="synopsis">
"<a class="link" href="GUdevEnumerator.html#GUdevEnumerator--client" title='The "client" property'>client</a>" <a class="link" href="GUdevClient.html" title="GUdevClient"><span class="type">GUdevClient</span></a>* : Read / Write / Construct Only
</pre>
</div>
-<div class="refsect1" title="Description">
+<div class="refsect1">
<a name="GUdevEnumerator.description"></a><h2>Description</h2>
<p>
<a class="link" href="GUdevEnumerator.html" title="GUdevEnumerator"><span class="type">GUdevEnumerator</span></a> is used to lookup and sort devices.
</p>
</div>
-<div class="refsect1" title="Details">
+<div class="refsect1">
<a name="GUdevEnumerator.details"></a><h2>Details</h2>
-<div class="refsect2" title="GUdevEnumerator">
+<div class="refsect2">
<a name="GUdevEnumerator-struct"></a><h3>GUdevEnumerator</h3>
<pre class="programlisting">typedef struct _GUdevEnumerator GUdevEnumerator;</pre>
<p>
The <a class="link" href="GUdevEnumerator.html" title="GUdevEnumerator"><span class="type">GUdevEnumerator</span></a> struct is opaque and should not be accessed directly.
</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody></tbody>
-</table></div>
<p class="since">Since 165</p>
</div>
<hr>
-<div class="refsect2" title="GUdevEnumeratorClass">
-<a name="GUdevEnumeratorClass"></a><h3>GUdevEnumeratorClass</h3>
-<pre class="programlisting">typedef struct {
+<div class="refsect2">
+<a name="GUdevEnumeratorClass"></a><h3>struct GUdevEnumeratorClass</h3>
+<pre class="programlisting">struct GUdevEnumeratorClass {
GObjectClass parent_class;
-} GUdevEnumeratorClass;
+};
</pre>
<p>
Class structure for <a class="link" href="GUdevEnumerator.html" title="GUdevEnumerator"><span class="type">GUdevEnumerator</span></a>.
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObjectClass"><span class="type">GObjectClass</span></a> <em class="structfield"><code><a name="GUdevEnumeratorClass.parent-class"></a>parent_class</code></em>;</span></p></td>
-<td>Parent class.
-</td>
+<td>Parent class.</td>
</tr></tbody>
</table></div>
<p class="since">Since 165</p>
</div>
<hr>
-<div class="refsect2" title="g_udev_enumerator_new ()">
+<div class="refsect2">
<a name="g-udev-enumerator-new"></a><h3>g_udev_enumerator_new ()</h3>
<pre class="programlisting"><a class="link" href="GUdevEnumerator.html" title="GUdevEnumerator"><span class="returnvalue">GUdevEnumerator</span></a> * g_udev_enumerator_new (<em class="parameter"><code><a class="link" href="GUdevClient.html" title="GUdevClient"><span class="type">GUdevClient</span></a> *client</code></em>);</pre>
<p>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>client</code></em> :</span></p></td>
-<td>A <a class="link" href="GUdevClient.html" title="GUdevClient"><span class="type">GUdevClient</span></a> to enumerate devices from.
-</td>
+<td>A <a class="link" href="GUdevClient.html" title="GUdevClient"><span class="type">GUdevClient</span></a> to enumerate devices from.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> A new <a class="link" href="GUdevEnumerator.html" title="GUdevEnumerator"><span class="type">GUdevEnumerator</span></a> object. Free with <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#g-object-unref"><code class="function">g_object_unref()</code></a>.
-
-</td>
+<td>A new <a class="link" href="GUdevEnumerator.html" title="GUdevEnumerator"><span class="type">GUdevEnumerator</span></a> object. Free with <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#g-object-unref"><code class="function">g_object_unref()</code></a>.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 165</p>
</div>
<hr>
-<div class="refsect2" title="g_udev_enumerator_add_match_subsystem ()">
+<div class="refsect2">
<a name="g-udev-enumerator-add-match-subsystem"></a><h3>g_udev_enumerator_add_match_subsystem ()</h3>
<pre class="programlisting"><a class="link" href="GUdevEnumerator.html" title="GUdevEnumerator"><span class="returnvalue">GUdevEnumerator</span></a> * g_udev_enumerator_add_match_subsystem
(<em class="parameter"><code><a class="link" href="GUdevEnumerator.html" title="GUdevEnumerator"><span class="type">GUdevEnumerator</span></a> *enumerator</code></em>,
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>enumerator</code></em> :</span></p></td>
-<td>A <a class="link" href="GUdevEnumerator.html" title="GUdevEnumerator"><span class="type">GUdevEnumerator</span></a>.
-</td>
+<td>A <a class="link" href="GUdevEnumerator.html" title="GUdevEnumerator"><span class="type">GUdevEnumerator</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>subsystem</code></em> :</span></p></td>
-<td>Wildcard for subsystem name e.g. 'scsi' or 'a*'.
-</td>
+<td>Wildcard for subsystem name e.g. 'scsi' or 'a*'.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> The passed in <em class="parameter"><code>enumerator</code></em>. <span class="annotation">[<a href="http://foldoc.org/transfer%20none"><span class="acronym">transfer none</span></a>]</span>
+<td>The passed in <em class="parameter"><code>enumerator</code></em>. <span class="annotation">[<a href="http://foldoc.org/transfer%20none"><span class="acronym">transfer none</span></a>]</span>
</td>
</tr>
</tbody>
<p class="since">Since 165</p>
</div>
<hr>
-<div class="refsect2" title="g_udev_enumerator_add_nomatch_subsystem ()">
+<div class="refsect2">
<a name="g-udev-enumerator-add-nomatch-subsystem"></a><h3>g_udev_enumerator_add_nomatch_subsystem ()</h3>
<pre class="programlisting"><a class="link" href="GUdevEnumerator.html" title="GUdevEnumerator"><span class="returnvalue">GUdevEnumerator</span></a> * g_udev_enumerator_add_nomatch_subsystem
(<em class="parameter"><code><a class="link" href="GUdevEnumerator.html" title="GUdevEnumerator"><span class="type">GUdevEnumerator</span></a> *enumerator</code></em>,
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>enumerator</code></em> :</span></p></td>
-<td>A <a class="link" href="GUdevEnumerator.html" title="GUdevEnumerator"><span class="type">GUdevEnumerator</span></a>.
-</td>
+<td>A <a class="link" href="GUdevEnumerator.html" title="GUdevEnumerator"><span class="type">GUdevEnumerator</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>subsystem</code></em> :</span></p></td>
-<td>Wildcard for subsystem name e.g. 'scsi' or 'a*'.
-</td>
+<td>Wildcard for subsystem name e.g. 'scsi' or 'a*'.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> The passed in <em class="parameter"><code>enumerator</code></em>. <span class="annotation">[<a href="http://foldoc.org/transfer%20none"><span class="acronym">transfer none</span></a>]</span>
+<td>The passed in <em class="parameter"><code>enumerator</code></em>. <span class="annotation">[<a href="http://foldoc.org/transfer%20none"><span class="acronym">transfer none</span></a>]</span>
</td>
</tr>
</tbody>
<p class="since">Since 165</p>
</div>
<hr>
-<div class="refsect2" title="g_udev_enumerator_add_match_sysfs_attr ()">
+<div class="refsect2">
<a name="g-udev-enumerator-add-match-sysfs-attr"></a><h3>g_udev_enumerator_add_match_sysfs_attr ()</h3>
<pre class="programlisting"><a class="link" href="GUdevEnumerator.html" title="GUdevEnumerator"><span class="returnvalue">GUdevEnumerator</span></a> * g_udev_enumerator_add_match_sysfs_attr
(<em class="parameter"><code><a class="link" href="GUdevEnumerator.html" title="GUdevEnumerator"><span class="type">GUdevEnumerator</span></a> *enumerator</code></em>,
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>enumerator</code></em> :</span></p></td>
-<td>A <a class="link" href="GUdevEnumerator.html" title="GUdevEnumerator"><span class="type">GUdevEnumerator</span></a>.
-</td>
+<td>A <a class="link" href="GUdevEnumerator.html" title="GUdevEnumerator"><span class="type">GUdevEnumerator</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
-<td>Wildcard filter for sysfs attribute key.
-</td>
+<td>Wildcard filter for sysfs attribute key.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
-<td>Wildcard filter for sysfs attribute value.
-</td>
+<td>Wildcard filter for sysfs attribute value.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> The passed in <em class="parameter"><code>enumerator</code></em>. <span class="annotation">[<a href="http://foldoc.org/transfer%20none"><span class="acronym">transfer none</span></a>]</span>
+<td>The passed in <em class="parameter"><code>enumerator</code></em>. <span class="annotation">[<a href="http://foldoc.org/transfer%20none"><span class="acronym">transfer none</span></a>]</span>
</td>
</tr>
</tbody>
<p class="since">Since 165</p>
</div>
<hr>
-<div class="refsect2" title="g_udev_enumerator_add_nomatch_sysfs_attr ()">
+<div class="refsect2">
<a name="g-udev-enumerator-add-nomatch-sysfs-attr"></a><h3>g_udev_enumerator_add_nomatch_sysfs_attr ()</h3>
<pre class="programlisting"><a class="link" href="GUdevEnumerator.html" title="GUdevEnumerator"><span class="returnvalue">GUdevEnumerator</span></a> * g_udev_enumerator_add_nomatch_sysfs_attr
(<em class="parameter"><code><a class="link" href="GUdevEnumerator.html" title="GUdevEnumerator"><span class="type">GUdevEnumerator</span></a> *enumerator</code></em>,
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>enumerator</code></em> :</span></p></td>
-<td>A <a class="link" href="GUdevEnumerator.html" title="GUdevEnumerator"><span class="type">GUdevEnumerator</span></a>.
-</td>
+<td>A <a class="link" href="GUdevEnumerator.html" title="GUdevEnumerator"><span class="type">GUdevEnumerator</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
-<td>Wildcard filter for sysfs attribute key.
-</td>
+<td>Wildcard filter for sysfs attribute key.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
-<td>Wildcard filter for sysfs attribute value.
-</td>
+<td>Wildcard filter for sysfs attribute value.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> The passed in <em class="parameter"><code>enumerator</code></em>. <span class="annotation">[<a href="http://foldoc.org/transfer%20none"><span class="acronym">transfer none</span></a>]</span>
+<td>The passed in <em class="parameter"><code>enumerator</code></em>. <span class="annotation">[<a href="http://foldoc.org/transfer%20none"><span class="acronym">transfer none</span></a>]</span>
</td>
</tr>
</tbody>
<p class="since">Since 165</p>
</div>
<hr>
-<div class="refsect2" title="g_udev_enumerator_add_match_property ()">
+<div class="refsect2">
<a name="g-udev-enumerator-add-match-property"></a><h3>g_udev_enumerator_add_match_property ()</h3>
<pre class="programlisting"><a class="link" href="GUdevEnumerator.html" title="GUdevEnumerator"><span class="returnvalue">GUdevEnumerator</span></a> * g_udev_enumerator_add_match_property
(<em class="parameter"><code><a class="link" href="GUdevEnumerator.html" title="GUdevEnumerator"><span class="type">GUdevEnumerator</span></a> *enumerator</code></em>,
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>enumerator</code></em> :</span></p></td>
-<td>A <a class="link" href="GUdevEnumerator.html" title="GUdevEnumerator"><span class="type">GUdevEnumerator</span></a>.
-</td>
+<td>A <a class="link" href="GUdevEnumerator.html" title="GUdevEnumerator"><span class="type">GUdevEnumerator</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
-<td>Wildcard filter for property name.
-</td>
+<td>Wildcard filter for property name.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
-<td>Wildcard filter for property value.
-</td>
+<td>Wildcard filter for property value.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> The passed in <em class="parameter"><code>enumerator</code></em>. <span class="annotation">[<a href="http://foldoc.org/transfer%20none"><span class="acronym">transfer none</span></a>]</span>
+<td>The passed in <em class="parameter"><code>enumerator</code></em>. <span class="annotation">[<a href="http://foldoc.org/transfer%20none"><span class="acronym">transfer none</span></a>]</span>
</td>
</tr>
</tbody>
<p class="since">Since 165</p>
</div>
<hr>
-<div class="refsect2" title="g_udev_enumerator_add_match_name ()">
+<div class="refsect2">
<a name="g-udev-enumerator-add-match-name"></a><h3>g_udev_enumerator_add_match_name ()</h3>
<pre class="programlisting"><a class="link" href="GUdevEnumerator.html" title="GUdevEnumerator"><span class="returnvalue">GUdevEnumerator</span></a> * g_udev_enumerator_add_match_name (<em class="parameter"><code><a class="link" href="GUdevEnumerator.html" title="GUdevEnumerator"><span class="type">GUdevEnumerator</span></a> *enumerator</code></em>,
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *name</code></em>);</pre>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>enumerator</code></em> :</span></p></td>
-<td>A <a class="link" href="GUdevEnumerator.html" title="GUdevEnumerator"><span class="type">GUdevEnumerator</span></a>.
-</td>
+<td>A <a class="link" href="GUdevEnumerator.html" title="GUdevEnumerator"><span class="type">GUdevEnumerator</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
-<td>Wildcard filter for kernel name e.g. "sda*".
-</td>
+<td>Wildcard filter for kernel name e.g. "sda*".</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> The passed in <em class="parameter"><code>enumerator</code></em>. <span class="annotation">[<a href="http://foldoc.org/transfer%20none"><span class="acronym">transfer none</span></a>]</span>
+<td>The passed in <em class="parameter"><code>enumerator</code></em>. <span class="annotation">[<a href="http://foldoc.org/transfer%20none"><span class="acronym">transfer none</span></a>]</span>
</td>
</tr>
</tbody>
<p class="since">Since 165</p>
</div>
<hr>
-<div class="refsect2" title="g_udev_enumerator_add_match_tag ()">
+<div class="refsect2">
<a name="g-udev-enumerator-add-match-tag"></a><h3>g_udev_enumerator_add_match_tag ()</h3>
<pre class="programlisting"><a class="link" href="GUdevEnumerator.html" title="GUdevEnumerator"><span class="returnvalue">GUdevEnumerator</span></a> * g_udev_enumerator_add_match_tag (<em class="parameter"><code><a class="link" href="GUdevEnumerator.html" title="GUdevEnumerator"><span class="type">GUdevEnumerator</span></a> *enumerator</code></em>,
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *tag</code></em>);</pre>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>enumerator</code></em> :</span></p></td>
-<td>A <a class="link" href="GUdevEnumerator.html" title="GUdevEnumerator"><span class="type">GUdevEnumerator</span></a>.
-</td>
+<td>A <a class="link" href="GUdevEnumerator.html" title="GUdevEnumerator"><span class="type">GUdevEnumerator</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>tag</code></em> :</span></p></td>
-<td>A udev tag e.g. "udev-acl".
-</td>
+<td>A udev tag e.g. "udev-acl".</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> The passed in <em class="parameter"><code>enumerator</code></em>. <span class="annotation">[<a href="http://foldoc.org/transfer%20none"><span class="acronym">transfer none</span></a>]</span>
+<td>The passed in <em class="parameter"><code>enumerator</code></em>. <span class="annotation">[<a href="http://foldoc.org/transfer%20none"><span class="acronym">transfer none</span></a>]</span>
</td>
</tr>
</tbody>
<p class="since">Since 165</p>
</div>
<hr>
-<div class="refsect2" title="g_udev_enumerator_add_match_is_initialized ()">
+<div class="refsect2">
<a name="g-udev-enumerator-add-match-is-initialized"></a><h3>g_udev_enumerator_add_match_is_initialized ()</h3>
<pre class="programlisting"><a class="link" href="GUdevEnumerator.html" title="GUdevEnumerator"><span class="returnvalue">GUdevEnumerator</span></a> * g_udev_enumerator_add_match_is_initialized
(<em class="parameter"><code><a class="link" href="GUdevEnumerator.html" title="GUdevEnumerator"><span class="type">GUdevEnumerator</span></a> *enumerator</code></em>);</pre>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>enumerator</code></em> :</span></p></td>
-<td>A <a class="link" href="GUdevEnumerator.html" title="GUdevEnumerator"><span class="type">GUdevEnumerator</span></a>.
-</td>
+<td>A <a class="link" href="GUdevEnumerator.html" title="GUdevEnumerator"><span class="type">GUdevEnumerator</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> The passed in <em class="parameter"><code>enumerator</code></em>. <span class="annotation">[<a href="http://foldoc.org/transfer%20none"><span class="acronym">transfer none</span></a>]</span>
+<td>The passed in <em class="parameter"><code>enumerator</code></em>. <span class="annotation">[<a href="http://foldoc.org/transfer%20none"><span class="acronym">transfer none</span></a>]</span>
</td>
</tr>
</tbody>
<p class="since">Since 165</p>
</div>
<hr>
-<div class="refsect2" title="g_udev_enumerator_add_sysfs_path ()">
+<div class="refsect2">
<a name="g-udev-enumerator-add-sysfs-path"></a><h3>g_udev_enumerator_add_sysfs_path ()</h3>
<pre class="programlisting"><a class="link" href="GUdevEnumerator.html" title="GUdevEnumerator"><span class="returnvalue">GUdevEnumerator</span></a> * g_udev_enumerator_add_sysfs_path (<em class="parameter"><code><a class="link" href="GUdevEnumerator.html" title="GUdevEnumerator"><span class="type">GUdevEnumerator</span></a> *enumerator</code></em>,
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *sysfs_path</code></em>);</pre>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>enumerator</code></em> :</span></p></td>
-<td>A <a class="link" href="GUdevEnumerator.html" title="GUdevEnumerator"><span class="type">GUdevEnumerator</span></a>.
-</td>
+<td>A <a class="link" href="GUdevEnumerator.html" title="GUdevEnumerator"><span class="type">GUdevEnumerator</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>sysfs_path</code></em> :</span></p></td>
-<td>A sysfs path, e.g. "/sys/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda"
-</td>
+<td>A sysfs path, e.g. "/sys/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda"</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> The passed in <em class="parameter"><code>enumerator</code></em>. <span class="annotation">[<a href="http://foldoc.org/transfer%20none"><span class="acronym">transfer none</span></a>]</span>
+<td>The passed in <em class="parameter"><code>enumerator</code></em>. <span class="annotation">[<a href="http://foldoc.org/transfer%20none"><span class="acronym">transfer none</span></a>]</span>
</td>
</tr>
</tbody>
<p class="since">Since 165</p>
</div>
<hr>
-<div class="refsect2" title="g_udev_enumerator_execute ()">
+<div class="refsect2">
<a name="g-udev-enumerator-execute"></a><h3>g_udev_enumerator_execute ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Doubly-Linked-Lists.html#GList"><span class="returnvalue">GList</span></a> * g_udev_enumerator_execute (<em class="parameter"><code><a class="link" href="GUdevEnumerator.html" title="GUdevEnumerator"><span class="type">GUdevEnumerator</span></a> *enumerator</code></em>);</pre>
<p>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>enumerator</code></em> :</span></p></td>
-<td>A <a class="link" href="GUdevEnumerator.html" title="GUdevEnumerator"><span class="type">GUdevEnumerator</span></a>.
-</td>
+<td>A <a class="link" href="GUdevEnumerator.html" title="GUdevEnumerator"><span class="type">GUdevEnumerator</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> A list of <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> objects. The caller should free the result by using <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#g-object-unref"><code class="function">g_object_unref()</code></a> on each element in the list and then <a href="http://library.gnome.org/devel/glib/unstable/glib-Doubly-Linked-Lists.html#g-list-free"><code class="function">g_list_free()</code></a> on the list. <span class="annotation">[<a href="http://foldoc.org/element-type"><span class="acronym">element-type</span></a> GUdevDevice][<a href="http://foldoc.org/transfer%20full"><span class="acronym">transfer full</span></a> GUdevDevice]</span>
+<td>A list of <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> objects. The caller should free the result by using <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#g-object-unref"><code class="function">g_object_unref()</code></a> on each element in the list and then <a href="http://library.gnome.org/devel/glib/unstable/glib-Doubly-Linked-Lists.html#g-list-free"><code class="function">g_list_free()</code></a> on the list. <span class="annotation">[<a href="http://foldoc.org/element-type"><span class="acronym">element-type</span></a> GUdevDevice][<a href="http://foldoc.org/transfer%20full"><span class="acronym">transfer full</span></a>]</span>
</td>
</tr>
</tbody>
<p class="since">Since 165</p>
</div>
</div>
-<div class="refsect1" title="Property Details">
+<div class="refsect1">
<a name="GUdevEnumerator.property-details"></a><h2>Property Details</h2>
-<div class="refsect2" title='The "client" property'>
+<div class="refsect2">
<a name="GUdevEnumerator--client"></a><h3>The <code class="literal">"client"</code> property</h3>
<pre class="programlisting"> "client" <a class="link" href="GUdevClient.html" title="GUdevClient"><span class="type">GUdevClient</span></a>* : Read / Write / Construct Only</pre>
<p>
</div>
<div class="footer">
<hr>
- Generated by GTK-Doc V1.15</div>
+ Generated by GTK-Doc V1.18</div>
</body>
</html>
\ No newline at end of file
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Object Hierarchy</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="index.html" title="GUDev Reference Manual">
<link rel="up" href="index.html" title="GUDev Reference Manual">
<link rel="prev" href="GUdevEnumerator.html" title="GUdevEnumerator">
<link rel="next" href="ix01.html" title="Index">
-<meta name="generator" content="GTK-Doc V1.15 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<th width="100%" align="center">GUDev Reference Manual</th>
<td><a accesskey="n" href="ix01.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr></table>
-<div class="chapter" title="Object Hierarchy">
+<div class="chapter">
<div class="titlepage"><div><div><h2 class="title">
<a name="gudev-hierarchy"></a>Object Hierarchy</h2></div></div></div>
<pre class="screen">
<a class="link" href="GUdevDevice.html" title="GUdevDevice">GUdevDevice</a>
<a class="link" href="GUdevClient.html" title="GUdevClient">GUdevClient</a>
<a class="link" href="GUdevEnumerator.html" title="GUdevEnumerator">GUdevEnumerator</a>
+ GEnum
+ <a class="link" href="GUdevClient.html#GUdevDeviceType">GUdevDeviceType</a>
</pre>
</div>
<div class="footer">
<hr>
- Generated by GTK-Doc V1.15</div>
+ Generated by GTK-Doc V1.18</div>
</body>
</html>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="utf-8" standalone="no"?>
-<!DOCTYPE book PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "">
-<book xmlns="http://www.devhelp.net/book" title="GUDev Reference Manual" link="index.html" author="David ZeuthenBastien Nocera" name="gudev">
- <chapters>
- <sub name="API Reference" link="ref-API.html">
- <sub name="GUdevClient" link="GUdevClient.html"/>
- <sub name="GUdevDevice" link="GUdevDevice.html"/>
- <sub name="GUdevEnumerator" link="GUdevEnumerator.html"/>
- </sub>
- <sub name="Object Hierarchy" link="gudev-hierarchy.html"/>
- <sub name="Index" link="ix01.html"/>
- <sub name="Index of new symbols in 165" link="ix02.html"/>
- </chapters>
- <functions>
- <function name="GUdevClient" link="GUdevClient.html#GUdevClient-struct"/>
- <function name="GUdevClientClass" link="GUdevClient.html#GUdevClientClass"/>
- <function name="enum GUdevDeviceType" link="GUdevClient.html#GUdevDeviceType"/>
- <function name="GUdevDeviceNumber" link="GUdevClient.html#GUdevDeviceNumber"/>
- <function name="g_udev_client_new ()" link="GUdevClient.html#g-udev-client-new"/>
- <function name="g_udev_client_query_by_subsystem ()" link="GUdevClient.html#g-udev-client-query-by-subsystem"/>
- <function name="g_udev_client_query_by_device_number ()" link="GUdevClient.html#g-udev-client-query-by-device-number"/>
- <function name="g_udev_client_query_by_device_file ()" link="GUdevClient.html#g-udev-client-query-by-device-file"/>
- <function name="g_udev_client_query_by_sysfs_path ()" link="GUdevClient.html#g-udev-client-query-by-sysfs-path"/>
- <function name="g_udev_client_query_by_subsystem_and_name ()" link="GUdevClient.html#g-udev-client-query-by-subsystem-and-name"/>
- <function name="The "subsystems" property" link="GUdevClient.html#GUdevClient--subsystems"/>
- <function name="The "uevent" signal" link="GUdevClient.html#GUdevClient-uevent"/>
- <function name="GUdevDevice" link="GUdevDevice.html#GUdevDevice-struct"/>
- <function name="GUdevDeviceClass" link="GUdevDevice.html#GUdevDeviceClass"/>
- <function name="g_udev_device_get_subsystem ()" link="GUdevDevice.html#g-udev-device-get-subsystem"/>
- <function name="g_udev_device_get_devtype ()" link="GUdevDevice.html#g-udev-device-get-devtype"/>
- <function name="g_udev_device_get_name ()" link="GUdevDevice.html#g-udev-device-get-name"/>
- <function name="g_udev_device_get_number ()" link="GUdevDevice.html#g-udev-device-get-number"/>
- <function name="g_udev_device_get_sysfs_path ()" link="GUdevDevice.html#g-udev-device-get-sysfs-path"/>
- <function name="g_udev_device_get_driver ()" link="GUdevDevice.html#g-udev-device-get-driver"/>
- <function name="g_udev_device_get_action ()" link="GUdevDevice.html#g-udev-device-get-action"/>
- <function name="g_udev_device_get_seqnum ()" link="GUdevDevice.html#g-udev-device-get-seqnum"/>
- <function name="g_udev_device_get_device_type ()" link="GUdevDevice.html#g-udev-device-get-device-type"/>
- <function name="g_udev_device_get_device_number ()" link="GUdevDevice.html#g-udev-device-get-device-number"/>
- <function name="g_udev_device_get_device_file ()" link="GUdevDevice.html#g-udev-device-get-device-file"/>
- <function name="g_udev_device_get_device_file_symlinks ()" link="GUdevDevice.html#g-udev-device-get-device-file-symlinks"/>
- <function name="g_udev_device_get_parent ()" link="GUdevDevice.html#g-udev-device-get-parent"/>
- <function name="g_udev_device_get_parent_with_subsystem ()" link="GUdevDevice.html#g-udev-device-get-parent-with-subsystem"/>
- <function name="g_udev_device_get_tags ()" link="GUdevDevice.html#g-udev-device-get-tags"/>
- <function name="g_udev_device_get_is_initialized ()" link="GUdevDevice.html#g-udev-device-get-is-initialized"/>
- <function name="g_udev_device_get_usec_since_initialized ()" link="GUdevDevice.html#g-udev-device-get-usec-since-initialized"/>
- <function name="g_udev_device_get_property_keys ()" link="GUdevDevice.html#g-udev-device-get-property-keys"/>
- <function name="g_udev_device_has_property ()" link="GUdevDevice.html#g-udev-device-has-property"/>
- <function name="g_udev_device_get_property ()" link="GUdevDevice.html#g-udev-device-get-property"/>
- <function name="g_udev_device_get_property_as_int ()" link="GUdevDevice.html#g-udev-device-get-property-as-int"/>
- <function name="g_udev_device_get_property_as_uint64 ()" link="GUdevDevice.html#g-udev-device-get-property-as-uint64"/>
- <function name="g_udev_device_get_property_as_double ()" link="GUdevDevice.html#g-udev-device-get-property-as-double"/>
- <function name="g_udev_device_get_property_as_boolean ()" link="GUdevDevice.html#g-udev-device-get-property-as-boolean"/>
- <function name="g_udev_device_get_property_as_strv ()" link="GUdevDevice.html#g-udev-device-get-property-as-strv"/>
- <function name="g_udev_device_get_sysfs_attr ()" link="GUdevDevice.html#g-udev-device-get-sysfs-attr"/>
- <function name="g_udev_device_get_sysfs_attr_as_int ()" link="GUdevDevice.html#g-udev-device-get-sysfs-attr-as-int"/>
- <function name="g_udev_device_get_sysfs_attr_as_uint64 ()" link="GUdevDevice.html#g-udev-device-get-sysfs-attr-as-uint64"/>
- <function name="g_udev_device_get_sysfs_attr_as_double ()" link="GUdevDevice.html#g-udev-device-get-sysfs-attr-as-double"/>
- <function name="g_udev_device_get_sysfs_attr_as_boolean ()" link="GUdevDevice.html#g-udev-device-get-sysfs-attr-as-boolean"/>
- <function name="g_udev_device_get_sysfs_attr_as_strv ()" link="GUdevDevice.html#g-udev-device-get-sysfs-attr-as-strv"/>
- <function name="GUdevEnumerator" link="GUdevEnumerator.html#GUdevEnumerator-struct"/>
- <function name="GUdevEnumeratorClass" link="GUdevEnumerator.html#GUdevEnumeratorClass"/>
- <function name="g_udev_enumerator_new ()" link="GUdevEnumerator.html#g-udev-enumerator-new"/>
- <function name="g_udev_enumerator_add_match_subsystem ()" link="GUdevEnumerator.html#g-udev-enumerator-add-match-subsystem"/>
- <function name="g_udev_enumerator_add_nomatch_subsystem ()" link="GUdevEnumerator.html#g-udev-enumerator-add-nomatch-subsystem"/>
- <function name="g_udev_enumerator_add_match_sysfs_attr ()" link="GUdevEnumerator.html#g-udev-enumerator-add-match-sysfs-attr"/>
- <function name="g_udev_enumerator_add_nomatch_sysfs_attr ()" link="GUdevEnumerator.html#g-udev-enumerator-add-nomatch-sysfs-attr"/>
- <function name="g_udev_enumerator_add_match_property ()" link="GUdevEnumerator.html#g-udev-enumerator-add-match-property"/>
- <function name="g_udev_enumerator_add_match_name ()" link="GUdevEnumerator.html#g-udev-enumerator-add-match-name"/>
- <function name="g_udev_enumerator_add_match_tag ()" link="GUdevEnumerator.html#g-udev-enumerator-add-match-tag"/>
- <function name="g_udev_enumerator_add_match_is_initialized ()" link="GUdevEnumerator.html#g-udev-enumerator-add-match-is-initialized"/>
- <function name="g_udev_enumerator_add_sysfs_path ()" link="GUdevEnumerator.html#g-udev-enumerator-add-sysfs-path"/>
- <function name="g_udev_enumerator_execute ()" link="GUdevEnumerator.html#g-udev-enumerator-execute"/>
- <function name="The "client" property" link="GUdevEnumerator.html#GUdevEnumerator--client"/>
- </functions>
-</book>
</chapters>
<functions>
<keyword type="struct" name="GUdevClient" link="GUdevClient.html#GUdevClient-struct"/>
- <keyword type="struct" name="GUdevClientClass" link="GUdevClient.html#GUdevClientClass"/>
- <keyword type="enum" name="enum GUdevDeviceType" link="GUdevClient.html#GUdevDeviceType"/>
+ <keyword type="struct" name="struct GUdevClientClass" link="GUdevClient.html#GUdevClientClass"/>
+ <keyword type="enum" name="enum GUdevDeviceType" link="GUdevClient.html#GUdevDeviceType-enum"/>
<keyword type="typedef" name="GUdevDeviceNumber" link="GUdevClient.html#GUdevDeviceNumber"/>
<keyword type="function" name="g_udev_client_new ()" link="GUdevClient.html#g-udev-client-new"/>
<keyword type="function" name="g_udev_client_query_by_subsystem ()" link="GUdevClient.html#g-udev-client-query-by-subsystem"/>
<keyword type="property" name="The "subsystems" property" link="GUdevClient.html#GUdevClient--subsystems"/>
<keyword type="signal" name="The "uevent" signal" link="GUdevClient.html#GUdevClient-uevent"/>
<keyword type="struct" name="GUdevDevice" link="GUdevDevice.html#GUdevDevice-struct"/>
- <keyword type="struct" name="GUdevDeviceClass" link="GUdevDevice.html#GUdevDeviceClass"/>
+ <keyword type="struct" name="struct GUdevDeviceClass" link="GUdevDevice.html#GUdevDeviceClass"/>
<keyword type="function" name="g_udev_device_get_subsystem ()" link="GUdevDevice.html#g-udev-device-get-subsystem"/>
<keyword type="function" name="g_udev_device_get_devtype ()" link="GUdevDevice.html#g-udev-device-get-devtype"/>
<keyword type="function" name="g_udev_device_get_name ()" link="GUdevDevice.html#g-udev-device-get-name"/>
<keyword type="function" name="g_udev_device_get_sysfs_attr_as_boolean ()" link="GUdevDevice.html#g-udev-device-get-sysfs-attr-as-boolean"/>
<keyword type="function" name="g_udev_device_get_sysfs_attr_as_strv ()" link="GUdevDevice.html#g-udev-device-get-sysfs-attr-as-strv"/>
<keyword type="struct" name="GUdevEnumerator" link="GUdevEnumerator.html#GUdevEnumerator-struct"/>
- <keyword type="struct" name="GUdevEnumeratorClass" link="GUdevEnumerator.html#GUdevEnumeratorClass" since="165"/>
+ <keyword type="struct" name="struct GUdevEnumeratorClass" link="GUdevEnumerator.html#GUdevEnumeratorClass" since="165"/>
<keyword type="function" name="g_udev_enumerator_new ()" link="GUdevEnumerator.html#g-udev-enumerator-new" since="165"/>
<keyword type="function" name="g_udev_enumerator_add_match_subsystem ()" link="GUdevEnumerator.html#g-udev-enumerator-add-match-subsystem" since="165"/>
<keyword type="function" name="g_udev_enumerator_add_nomatch_subsystem ()" link="GUdevEnumerator.html#g-udev-enumerator-add-nomatch-subsystem" since="165"/>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GUDev Reference Manual</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="index.html" title="GUDev Reference Manual">
<link rel="next" href="ref-API.html" title="API Reference">
-<meta name="generator" content="GTK-Doc V1.15 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<div class="book" title="GUDev Reference Manual">
+<div class="book">
<div class="titlepage">
<div>
<div><table class="navigation" id="top" width="100%" cellpadding="2" cellspacing="0"><tr><th valign="middle"><p class="title">GUDev Reference Manual</p></th></tr></table></div>
</p></div></div>
</div>
</div></div>
-<div><p class="releaseinfo">For GUdev version 166
+<div><p class="releaseinfo">For GUdev version 174
</p></div>
-<div><p class="copyright">Copyright © 2009 The GUDev Authors</p></div>
-<div><div class="legalnotice" title="Legal Notice">
-<a name="id300276"></a><p>
+<div><p class="copyright">Copyright © 2011 The GUDev Authors</p></div>
+<div><div class="legalnotice">
+<a name="id528600"></a><p>
Permission is granted to copy, distribute and/or modify this
document under the terms of the <em class="citetitle">GNU Free
Documentation License</em>, Version 1.1 or any later
</div>
<div class="footer">
<hr>
- Generated by GTK-Doc V1.15</div>
+ Generated by GTK-Doc V1.18</div>
</body>
</html>
\ No newline at end of file
<ANCHOR id="GUdevClient" href="gudev/GUdevClient.html">
<ANCHOR id="GUdevClient.synopsis" href="gudev/GUdevClient.html#GUdevClient.synopsis">
+<ANCHOR id="GUdevDeviceType" href="gudev/GUdevClient.html#GUdevDeviceType">
<ANCHOR id="GUdevClient.object-hierarchy" href="gudev/GUdevClient.html#GUdevClient.object-hierarchy">
<ANCHOR id="GUdevClient.properties" href="gudev/GUdevClient.html#GUdevClient.properties">
<ANCHOR id="GUdevClient.signals" href="gudev/GUdevClient.html#GUdevClient.signals">
<ANCHOR id="GUdevClient.details" href="gudev/GUdevClient.html#GUdevClient.details">
<ANCHOR id="GUdevClient-struct" href="gudev/GUdevClient.html#GUdevClient-struct">
<ANCHOR id="GUdevClientClass" href="gudev/GUdevClient.html#GUdevClientClass">
-<ANCHOR id="GUdevDeviceType" href="gudev/GUdevClient.html#GUdevDeviceType">
+<ANCHOR id="GUdevDeviceType-enum" href="gudev/GUdevClient.html#GUdevDeviceType-enum">
<ANCHOR id="G-UDEV-DEVICE-TYPE-NONE:CAPS" href="gudev/GUdevClient.html#G-UDEV-DEVICE-TYPE-NONE:CAPS">
<ANCHOR id="G-UDEV-DEVICE-TYPE-BLOCK:CAPS" href="gudev/GUdevClient.html#G-UDEV-DEVICE-TYPE-BLOCK:CAPS">
<ANCHOR id="G-UDEV-DEVICE-TYPE-CHAR:CAPS" href="gudev/GUdevClient.html#G-UDEV-DEVICE-TYPE-CHAR:CAPS">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Index</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="index.html" title="GUDev Reference Manual">
<link rel="up" href="index.html" title="GUDev Reference Manual">
<link rel="prev" href="gudev-hierarchy.html" title="Object Hierarchy">
<link rel="next" href="ix02.html" title="Index of new symbols in 165">
-<meta name="generator" content="GTK-Doc V1.15 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<th width="100%" align="center">GUDev Reference Manual</th>
<td><a accesskey="n" href="ix02.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr></table>
-<div class="index" title="Index">
+<div class="index">
<div class="titlepage"><div><div><h2 class="title">
-<a name="id298813"></a>Index</h2></div></div></div>
+<a name="id499060"></a>Index</h2></div></div></div>
<div class="index">
<div class="indexdiv">
<h3>C</h3>
</dt>
<dt>GUdevClient:subsystems, <a class="indexterm" href="GUdevClient.html#GUdevClient--subsystems">The "subsystems" property</a>
</dt>
-<dt>GUdevClientClass, <a class="indexterm" href="GUdevClient.html#GUdevClientClass">GUdevClientClass</a>
+<dt>GUdevClientClass, <a class="indexterm" href="GUdevClient.html#GUdevClientClass">struct GUdevClientClass</a>
</dt>
<dt>GUdevDevice, <a class="indexterm" href="GUdevDevice.html#GUdevDevice-struct">GUdevDevice</a>
</dt>
-<dt>GUdevDeviceClass, <a class="indexterm" href="GUdevDevice.html#GUdevDeviceClass">GUdevDeviceClass</a>
+<dt>GUdevDeviceClass, <a class="indexterm" href="GUdevDevice.html#GUdevDeviceClass">struct GUdevDeviceClass</a>
</dt>
<dt>GUdevDeviceNumber, <a class="indexterm" href="GUdevClient.html#GUdevDeviceNumber">GUdevDeviceNumber</a>
</dt>
-<dt>GUdevDeviceType, <a class="indexterm" href="GUdevClient.html#GUdevDeviceType">enum GUdevDeviceType</a>
+<dt>GUdevDeviceType, <a class="indexterm" href="GUdevClient.html#GUdevDeviceType-enum">enum GUdevDeviceType</a>
</dt>
<dt>GUdevEnumerator, <a class="indexterm" href="GUdevEnumerator.html#GUdevEnumerator-struct">GUdevEnumerator</a>
</dt>
<dt>GUdevEnumerator:client, <a class="indexterm" href="GUdevEnumerator.html#GUdevEnumerator--client">The "client" property</a>
</dt>
-<dt>GUdevEnumeratorClass, <a class="indexterm" href="GUdevEnumerator.html#GUdevEnumeratorClass">GUdevEnumeratorClass</a>
+<dt>GUdevEnumeratorClass, <a class="indexterm" href="GUdevEnumerator.html#GUdevEnumeratorClass">struct GUdevEnumeratorClass</a>
</dt>
</dl>
</div>
</div>
<div class="footer">
<hr>
- Generated by GTK-Doc V1.15</div>
+ Generated by GTK-Doc V1.18</div>
</body>
</html>
\ No newline at end of file
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Index of new symbols in 165</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="index.html" title="GUDev Reference Manual">
<link rel="up" href="index.html" title="GUDev Reference Manual">
<link rel="prev" href="ix01.html" title="Index">
-<meta name="generator" content="GTK-Doc V1.15 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<a class="shortcut" href="#idxG">G</a>
</td></tr>
</table>
-<div class="index" title="Index of new symbols in 165">
+<div class="index">
<div class="titlepage"><div><div><h2 class="title">
-<a name="id298821"></a>Index of new symbols in 165</h2></div></div></div>
+<a name="id498248"></a>Index of new symbols in 165</h2></div></div></div>
<a name="idx"></a><a name="idxD"></a><h3 class="title">D</h3>
<dt>
<a class="link" href="GUdevDevice.html#g-udev-device-get-is-initialized" title="g_udev_device_get_is_initialized ()">g_udev_device_get_is_initialized</a>, function in <a class="link" href="GUdevDevice.html" title="GUdevDevice">GUdevDevice</a>
</dt>
<dd></dd>
<dt>
-<a class="link" href="GUdevEnumerator.html#GUdevEnumeratorClass" title="GUdevEnumeratorClass">GUdevEnumeratorClass</a>, struct in <a class="link" href="GUdevEnumerator.html" title="GUdevEnumerator">GUdevEnumerator</a>
+<a class="link" href="GUdevEnumerator.html#GUdevEnumeratorClass" title="struct GUdevEnumeratorClass">GUdevEnumeratorClass</a>, struct in <a class="link" href="GUdevEnumerator.html" title="GUdevEnumerator">GUdevEnumerator</a>
</dt>
<dd></dd>
</div>
<div class="footer">
<hr>
- Generated by GTK-Doc V1.15</div>
+ Generated by GTK-Doc V1.18</div>
</body>
</html>
\ No newline at end of file
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>API Reference</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="index.html" title="GUDev Reference Manual">
<link rel="up" href="index.html" title="GUDev Reference Manual">
<link rel="prev" href="index.html" title="GUDev Reference Manual">
<link rel="next" href="GUdevClient.html" title="GUdevClient">
-<meta name="generator" content="GTK-Doc V1.15 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<th width="100%" align="center">GUDev Reference Manual</th>
<td><a accesskey="n" href="GUdevClient.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr></table>
-<div class="reference" title="API Reference">
+<div class="reference">
<div class="titlepage">
<div><div><h1 class="title">
<a name="ref-API"></a>API Reference</h1></div></div>
<hr>
</div>
-<div class="partintro" title="API Reference">
+<div class="partintro">
<div></div>
<p>
This part presents the class and function reference for the
</div>
<div class="footer">
<hr>
- Generated by GTK-Doc V1.15</div>
+ Generated by GTK-Doc V1.18</div>
</body>
</html>
\ No newline at end of file
/* this is needed so that the local anchors are displayed below the naviagtion */
div.footnote a[name], div.refnamediv a[name], div.refsect1 a[name], div.refsect2 a[name], div.index a[name], div.glossary a[name], div.sect1 a[name]
{
+ display: inline-block;
position: relative;
- padding-top:4.5em;
+ top:-5em;
}
/* this seems to be a bug in the xsl style sheets when generating indexes */
div.index div.index
--- /dev/null
+<!-- ##### SECTION Title ##### -->
+gudevenumtypes
+
+<!-- ##### SECTION Short_Description ##### -->
+
+
+<!-- ##### SECTION Long_Description ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION See_Also ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION Stability_Level ##### -->
+
+
+<!-- ##### SECTION Image ##### -->
+
+
--- /dev/null
+<!-- ##### SECTION Title ##### -->
+gudevmarshal
+
+<!-- ##### SECTION Short_Description ##### -->
+
+
+<!-- ##### SECTION Long_Description ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION See_Also ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION Stability_Level ##### -->
+
+
+<!-- ##### SECTION Image ##### -->
+
+
--- /dev/null
+#!/usr/bin/env gjs-console
+
+// This currently depends on the following patches to gjs
+//
+// http://bugzilla.gnome.org/show_bug.cgi?id=584558
+// http://bugzilla.gnome.org/show_bug.cgi?id=584560
+// http://bugzilla.gnome.org/show_bug.cgi?id=584568
+
+const GUdev = imports.gi.GUdev;
+const Mainloop = imports.mainloop;
+
+function print_device (device) {
+ print (" subsystem: " + device.get_subsystem ());
+ print (" devtype: " + device.get_devtype ());
+ print (" name: " + device.get_name ());
+ print (" number: " + device.get_number ());
+ print (" sysfs_path: " + device.get_sysfs_path ());
+ print (" driver: " + device.get_driver ());
+ print (" action: " + device.get_action ());
+ print (" seqnum: " + device.get_seqnum ());
+ print (" device type: " + device.get_device_type ());
+ print (" device number: " + device.get_device_number ());
+ print (" device file: " + device.get_device_file ());
+ print (" device file symlinks: " + device.get_device_file_symlinks ());
+ print (" foo: " + device.get_sysfs_attr_as_strv ("stat"));
+ var keys = device.get_property_keys ();
+ for (var n = 0; n < keys.length; n++) {
+ print (" " + keys[n] + "=" + device.get_property (keys[n]));
+ }
+}
+
+function on_uevent (client, action, device) {
+ print ("action " + action + " on device " + device.get_sysfs_path());
+ print_device (device);
+ print ("");
+}
+
+var client = new GUdev.Client ({subsystems: ["block", "usb/usb_interface"]});
+client.connect ("uevent", on_uevent);
+
+var block_devices = client.query_by_subsystem ("block");
+for (var n = 0; n < block_devices.length; n++) {
+ print ("block device: " + block_devices[n].get_device_file ());
+}
+
+var d;
+
+d = client.query_by_device_number (GUdev.DeviceType.BLOCK, 0x0810);
+if (d == null) {
+ print ("query_by_device_number 0x810 -> null");
+} else {
+ print ("query_by_device_number 0x810 -> " + d.get_device_file ());
+ var dd = d.get_parent_with_subsystem ("usb", null);
+ print_device (dd);
+ print ("--------------------------------------------------------------------------");
+ while (d != null) {
+ print_device (d);
+ print ("");
+ d = d.get_parent ();
+ }
+}
+
+d = client.query_by_sysfs_path ("/sys/block/sda/sda1");
+print ("query_by_sysfs_path (\"/sys/block/sda1\") -> " + d.get_device_file ());
+
+d = client.query_by_subsystem_and_name ("block", "sda2");
+print ("query_by_subsystem_and_name (\"block\", \"sda2\") -> " + d.get_device_file ());
+
+d = client.query_by_device_file ("/dev/sda");
+print ("query_by_device_file (\"/dev/sda\") -> " + d.get_device_file ());
+
+d = client.query_by_device_file ("/dev/block/8:0");
+print ("query_by_device_file (\"/dev/block/8:0\") -> " + d.get_device_file ());
+
+Mainloop.run('udev-example');
* @sysfs_path: A sysfs path.
*
* Looks up a device for a sysfs path.
+ *
+ * Returns: (transfer full): A #GUdevDevice object or %NULL if the device was not found. Free with g_object_unref().
*/
GUdevDevice *
g_udev_client_query_by_sysfs_path (GUdevClient *client,
/**
* GUdevClient:
- * @parent: Parent instance.
*
* The #GUdevClient struct is opaque and should not be accessed directly.
*/
/**
* GUdevDevice:
- * @parent: Parent instance.
*
* The #GUdevDevice struct is opaque and should not be accessed directly.
*/
/**
* GUdevEnumerator:
- * @parent: Parent instance.
*
* The #GUdevEnumerator struct is opaque and should not be accessed directly.
*
--- /dev/null
+#!/usr/bin/env seed
+
+const GLib = imports.gi.GLib;
+const GUdev = imports.gi.GUdev;
+
+function print_device(device) {
+ print(" initialized: " + device.get_is_initialized());
+ print(" usec since initialized: " + device.get_usec_since_initialized());
+ print(" subsystem: " + device.get_subsystem());
+ print(" devtype: " + device.get_devtype());
+ print(" name: " + device.get_name());
+ print(" number: " + device.get_number());
+ print(" sysfs_path: " + device.get_sysfs_path());
+ print(" driver: " + device.get_driver());
+ print(" action: " + device.get_action());
+ print(" seqnum: " + device.get_seqnum());
+ print(" device type: " + device.get_device_type());
+ print(" device number: " + device.get_device_number());
+ print(" device file: " + device.get_device_file());
+ print(" device file symlinks: " + device.get_device_file_symlinks());
+ print(" tags: " + device.get_tags());
+ var keys = device.get_property_keys();
+ for (var n = 0; n < keys.length; n++) {
+ print(" " + keys[n] + "=" + device.get_property(keys[n]));
+ }
+}
+
+var client = new GUdev.Client({subsystems: []});
+var enumerator = new GUdev.Enumerator({client: client});
+enumerator.add_match_subsystem('b*')
+
+var devices = enumerator.execute();
+
+for (var n=0; n < devices.length; n++) {
+ var device = devices[n];
+ print_device(device);
+ print("");
+}
--- /dev/null
+#!/usr/bin/env seed
+
+// seed example
+
+const GLib = imports.gi.GLib;
+const GUdev = imports.gi.GUdev;
+
+function print_device (device) {
+ print (" subsystem: " + device.get_subsystem ());
+ print (" devtype: " + device.get_devtype ());
+ print (" name: " + device.get_name ());
+ print (" number: " + device.get_number ());
+ print (" sysfs_path: " + device.get_sysfs_path ());
+ print (" driver: " + device.get_driver ());
+ print (" action: " + device.get_action ());
+ print (" seqnum: " + device.get_seqnum ());
+ print (" device type: " + device.get_device_type ());
+ print (" device number: " + device.get_device_number ());
+ print (" device file: " + device.get_device_file ());
+ print (" device file symlinks: " + device.get_device_file_symlinks ());
+ print (" foo: " + device.get_sysfs_attr_as_strv ("stat"));
+ var keys = device.get_property_keys ();
+ for (var n = 0; n < keys.length; n++) {
+ print (" " + keys[n] + "=" + device.get_property (keys[n]));
+ }
+}
+
+function on_uevent (client, action, device) {
+ print ("action " + action + " on device " + device.get_sysfs_path());
+ print_device (device);
+ print ("");
+}
+
+var client = new GUdev.Client ({subsystems: ["block", "usb/usb_interface"]});
+client.signal.connect ("uevent", on_uevent);
+
+var block_devices = client.query_by_subsystem ("block");
+for (var n = 0; n < block_devices.length; n++) {
+ print ("block device: " + block_devices[n].get_device_file ());
+}
+
+var d;
+
+d = client.query_by_device_number (GUdev.DeviceType.BLOCK, 0x0810);
+if (d == null) {
+ print ("query_by_device_number 0x810 -> null");
+} else {
+ print ("query_by_device_number 0x810 -> " + d.get_device_file ());
+ dd = d.get_parent_with_subsystem ("usb", null);
+ print_device (dd);
+ print ("--------------------------------------------------------------------------");
+ while (d != null) {
+ print_device (d);
+ print ("");
+ d = d.get_parent ();
+ }
+}
+
+d = client.query_by_sysfs_path ("/sys/block/sda/sda1");
+print ("query_by_sysfs_path (\"/sys/block/sda1\") -> " + d.get_device_file ());
+
+d = client.query_by_subsystem_and_name ("block", "sda2");
+print ("query_by_subsystem_and_name (\"block\", \"sda2\") -> " + d.get_device_file ());
+
+d = client.query_by_device_file ("/dev/sda");
+print ("query_by_device_file (\"/dev/sda\") -> " + d.get_device_file ());
+
+d = client.query_by_device_file ("/dev/block/8:0");
+print ("query_by_device_file (\"/dev/block/8:0\") -> " + d.get_device_file ());
+
+var mainloop = GLib.main_loop_new ();
+GLib.main_loop_run (mainloop);
+++ /dev/null
-# do not edit this file, it will be overwritten on update
-
-ACTION=="remove", GOTO="hid2hci_end"
-SUBSYSTEM!="usb", GOTO="hid2hci_end"
-
-# Variety of Dell Bluetooth devices - match on a mouse device that is
-# self powered and where a HID report needs to be sent to switch modes
-# Known supported devices: 413c:8154, 413c:8158, 413c:8162
-ATTR{bInterfaceClass}=="03", ATTR{bInterfaceSubClass}=="01", ATTR{bInterfaceProtocol}=="02", \
- ATTRS{bDeviceClass}=="00", ATTRS{idVendor}=="413c", ATTRS{bmAttributes}=="e0", \
- RUN+="hid2hci --method=dell --devpath=%p", ENV{HID2HCI_SWITCH}="1"
-
-# Logitech devices
-KERNEL=="hiddev*", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c70[35e]", \
- RUN+="hid2hci --method=logitech-hid --devpath=%p"
-KERNEL=="hidraw*", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c70[4abc]|c71[34bc]", \
- RUN+="hid2hci --method=logitech-hid --devpath=%p"
-
-ENV{DEVTYPE}!="usb_device", GOTO="hid2hci_end"
-
-# When a Dell device recovers from S3, the mouse child needs to be repoked
-# Unfortunately the only event seen is the BT device disappearing, so the mouse
-# device needs to be chased down on the USB bus.
-ATTR{bDeviceClass}=="e0", ATTR{bDeviceSubClass}=="01", ATTR{bDeviceProtocol}=="01", ATTR{idVendor}=="413c", \
- ENV{REMOVE_CMD}="/sbin/udevadm trigger --action=change --subsystem-match=usb --property-match=HID2HCI_SWITCH=1"
-
-# CSR devices
-ATTR{idVendor}=="0a12|0458|05ac", ATTR{idProduct}=="1000", RUN+="hid2hci --method=csr --devpath=%p"
-
-LABEL="hid2hci_end"
+++ /dev/null
-/*
- * hid2hci : switch the radio on devices that support
- * it from HID to HCI and back
- *
- * Copyright (C) 2003-2009 Marcel Holtmann <marcel@holtmann.org>
- * Copyright (C) 2008-2009 Mario Limonciello <mario_limonciello@dell.com>
- * Copyright (C) 2009 Kay Sievers <kay.sievers@vrfy.org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdio.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <stdint.h>
-#include <string.h>
-#include <getopt.h>
-#include <sys/ioctl.h>
-#include <linux/types.h>
-#include <linux/hiddev.h>
-#include <usb.h>
-
-#include "libudev.h"
-#include "libudev-private.h"
-
-enum mode {
- HCI = 0,
- HID = 1,
-};
-
-static int usb_switch_csr(struct usb_dev_handle *dev, enum mode mode)
-{
- int err;
-
- err = usb_control_msg(dev,
- USB_ENDPOINT_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
- 0, mode, 0, NULL, 0, 10000);
- if (err == 0) {
- err = -1;
- errno = EALREADY;
- } else {
- if (errno == ETIMEDOUT)
- err = 0;
- }
- return err;
-}
-
-static int hid_logitech_send_report(int fd, const char *buf, size_t size)
-{
- struct hiddev_report_info rinfo;
- struct hiddev_usage_ref uref;
- unsigned int i;
- int err;
-
- for (i = 0; i < size; i++) {
- memset(&uref, 0, sizeof(uref));
- uref.report_type = HID_REPORT_TYPE_OUTPUT;
- uref.report_id = 0x10;
- uref.field_index = 0;
- uref.usage_index = i;
- uref.usage_code = 0xff000001;
- uref.value = buf[i] & 0x000000ff;
- err = ioctl(fd, HIDIOCSUSAGE, &uref);
- if (err < 0)
- return err;
- }
-
- memset(&rinfo, 0, sizeof(rinfo));
- rinfo.report_type = HID_REPORT_TYPE_OUTPUT;
- rinfo.report_id = 0x10;
- rinfo.num_fields = 1;
- err = ioctl(fd, HIDIOCSREPORT, &rinfo);
-
- return err;
-}
-
-static int hid_switch_logitech(const char *filename)
-{
- char rep1[] = { 0xff, 0x80, 0x80, 0x01, 0x00, 0x00 };
- char rep2[] = { 0xff, 0x80, 0x00, 0x00, 0x30, 0x00 };
- char rep3[] = { 0xff, 0x81, 0x80, 0x00, 0x00, 0x00 };
- int fd;
- int err = -1;
-
- fd = open(filename, O_RDWR);
- if (fd < 0)
- return err;
-
- err = ioctl(fd, HIDIOCINITREPORT, 0);
- if (err < 0)
- goto out;
-
- err = hid_logitech_send_report(fd, rep1, sizeof(rep1));
- if (err < 0)
- goto out;
-
- err = hid_logitech_send_report(fd, rep2, sizeof(rep2));
- if (err < 0)
- goto out;
-
- err = hid_logitech_send_report(fd, rep3, sizeof(rep3));
-out:
- close(fd);
- return err;
-}
-
-static int usb_switch_dell(struct usb_dev_handle *dev, enum mode mode)
-{
- char report[] = { 0x7f, 0x00, 0x00, 0x00 };
- int err;
-
- switch (mode) {
- case HCI:
- report[1] = 0x13;
- break;
- case HID:
- report[1] = 0x14;
- break;
- }
-
- /* Don't need to check return, as might not be in use */
- usb_detach_kernel_driver_np(dev, 0);
-
- if (usb_claim_interface(dev, 0) < 0)
- return -EIO;
-
- err = usb_control_msg(dev,
- USB_ENDPOINT_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE,
- USB_REQ_SET_CONFIGURATION, 0x7f | (0x03 << 8), 0,
- report, sizeof(report), 5000);
-
- if (err == 0) {
- err = -1;
- errno = EALREADY;
- } else {
- if (errno == ETIMEDOUT)
- err = 0;
- }
- return err;
-}
-
-/*
- * The braindead libusb needs to scan and open all devices, just to
- * to find the device we already have. This needs to be fixed in libusb
- * or it will be ripped out and we carry our own code.
- */
-static struct usb_device *usb_device_open_from_udev(struct udev_device *usb_dev)
-{
- struct usb_bus *bus;
- const char *str;
- int busnum;
- int devnum;
-
- str = udev_device_get_sysattr_value(usb_dev, "busnum");
- if (str == NULL)
- return NULL;
- busnum = strtol(str, NULL, 0);
-
- str = udev_device_get_sysattr_value(usb_dev, "devnum");
- if (str == NULL)
- return NULL;
- devnum = strtol(str, NULL, 0);
-
- usb_init();
- usb_find_busses();
- usb_find_devices();
-
- for (bus = usb_get_busses(); bus; bus = bus->next) {
- struct usb_device *dev;
-
- if (strtol(bus->dirname, NULL, 10) != busnum)
- continue;
-
- for (dev = bus->devices; dev; dev = dev->next) {
- if (dev->devnum == devnum)
- return dev;
- }
- }
-
- return NULL;
-}
-
-static struct usb_dev_handle *find_device(struct udev_device *udev_dev)
-{
- struct usb_device *dev;
-
- dev = usb_device_open_from_udev(udev_dev);
- if (dev == NULL)
- return NULL;
- return usb_open(dev);
-}
-
-static void usage(const char *error)
-{
- if (error)
- fprintf(stderr,"\n%s\n", error);
- else
- printf("hid2hci - Bluetooth HID to HCI mode switching utility\n\n");
-
- printf("Usage: hid2hci [options]\n"
- " --mode= mode to switch to [hid|hci] (default hci)\n"
- " --devpath= sys device path\n"
- " --method= method to use to switch [csr|logitech-hid|dell]\n"
- " --help\n\n");
-}
-
-int main(int argc, char *argv[])
-{
- static const struct option options[] = {
- { "help", no_argument, NULL, 'h' },
- { "mode", required_argument, NULL, 'm' },
- { "devpath", required_argument, NULL, 'p' },
- { "method", required_argument, NULL, 'M' },
- { }
- };
- enum method {
- METHOD_UNDEF,
- METHOD_CSR,
- METHOD_LOGITECH_HID,
- METHOD_DELL,
- } method = METHOD_UNDEF;
- struct udev *udev;
- struct udev_device *udev_dev = NULL;
- char syspath[UTIL_PATH_SIZE];
- int (*usb_switch)(struct usb_dev_handle *dev, enum mode mode) = NULL;
- enum mode mode = HCI;
- const char *devpath = NULL;
- int err = -1;
- int rc = 1;
-
- for (;;) {
- int option;
-
- option = getopt_long(argc, argv, "m:p:M:qh", options, NULL);
- if (option == -1)
- break;
-
- switch (option) {
- case 'm':
- if (!strcmp(optarg, "hid")) {
- mode = HID;
- } else if (!strcmp(optarg, "hci")) {
- mode = HCI;
- } else {
- usage("error: undefined radio mode\n");
- exit(1);
- }
- break;
- case 'p':
- devpath = optarg;
- break;
- case 'M':
- if (!strcmp(optarg, "csr")) {
- method = METHOD_CSR;
- usb_switch = usb_switch_csr;
- } else if (!strcmp(optarg, "logitech-hid")) {
- method = METHOD_LOGITECH_HID;
- } else if (!strcmp(optarg, "dell")) {
- method = METHOD_DELL;
- usb_switch = usb_switch_dell;
- } else {
- usage("error: undefined switching method\n");
- exit(1);
- }
- break;
- case 'h':
- usage(NULL);
- default:
- exit(1);
- }
- }
-
- if (!devpath || method == METHOD_UNDEF) {
- usage("error: --devpath= and --method= must be defined\n");
- exit(1);
- }
-
- udev = udev_new();
- if (udev == NULL)
- goto exit;
-
- util_strscpyl(syspath, sizeof(syspath), udev_get_sys_path(udev), devpath, NULL);
- udev_dev = udev_device_new_from_syspath(udev, syspath);
- if (udev_dev == NULL) {
- fprintf(stderr, "error: could not find '%s'\n", devpath);
- goto exit;
- }
-
- switch (method) {
- case METHOD_CSR:
- case METHOD_DELL: {
- struct udev_device *dev;
- struct usb_dev_handle *handle;
- const char *type;
-
- /* get the parent usb_device if needed */
- dev = udev_dev;
- type = udev_device_get_devtype(dev);
- if (type == NULL || strcmp(type, "usb_device") != 0) {
- dev = udev_device_get_parent_with_subsystem_devtype(dev, "usb", "usb_device");
- if (dev == NULL) {
- fprintf(stderr, "error: could not find usb_device for '%s'\n", devpath);
- goto exit;
- }
- }
-
- handle = find_device(dev);
- if (handle == NULL) {
- fprintf(stderr, "error: unable to handle '%s'\n",
- udev_device_get_syspath(dev));
- goto exit;
- }
- err = usb_switch(handle, mode);
- break;
- }
- case METHOD_LOGITECH_HID: {
- const char *device;
-
- device = udev_device_get_devnode(udev_dev);
- if (device == NULL) {
- fprintf(stderr, "error: could not find hiddev device node\n");
- goto exit;
- }
- err = hid_switch_logitech(device);
- break;
- }
- default:
- break;
- }
-
- if (err < 0)
- fprintf(stderr, "error: switching device '%s' failed.\n",
- udev_device_get_syspath(udev_dev));
-exit:
- udev_device_unref(udev_dev);
- udev_unref(udev);
- return rc;
-}
+++ /dev/null
-/*
- * input_id - input device classification
- *
- * Copyright (C) 2009 Martin Pitt <martin.pitt@ubuntu.com>
- * Portions Copyright (C) 2004 David Zeuthen, <david@fubar.dk>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with keymap; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <limits.h>
-#include <linux/limits.h>
-#include <linux/input.h>
-
-#include "libudev.h"
-
-/* we must use this kernel-compatible implementation */
-#define BITS_PER_LONG (sizeof(unsigned long) * 8)
-#define NBITS(x) ((((x)-1)/BITS_PER_LONG)+1)
-#define OFF(x) ((x)%BITS_PER_LONG)
-#define BIT(x) (1UL<<OFF(x))
-#define LONG(x) ((x)/BITS_PER_LONG)
-#define test_bit(bit, array) ((array[LONG(bit)] >> OFF(bit)) & 1)
-
-/*
- * Read a capability attribute and return bitmask.
- * @param dev udev_device
- * @param attr sysfs attribute name (e. g. "capabilities/key")
- * @param bitmask: Output array; must have max_size elements
- */
-static void get_cap_mask (struct udev_device *dev, const char* attr,
- unsigned long *bitmask, size_t max_size)
-{
- char text[4096];
- int i;
- char* word;
- unsigned long val;
-
- snprintf(text, sizeof(text), "%s", udev_device_get_sysattr_value(dev, attr));
-
- memset (bitmask, 0, max_size);
- i = 0;
- while ((word = strrchr(text, ' ')) != NULL) {
- val = strtoul (word+1, NULL, 16);
- bitmask[i] = val;
- *word = '\0';
- ++i;
- }
- val = strtoul (text, NULL, 16);
- bitmask[i] = val;
-}
-
-/* pointer devices */
-static void test_pointers (const unsigned long* bitmask_ev,
- const unsigned long* bitmask_abs,
- const unsigned long* bitmask_key,
- const unsigned long* bitmask_rel)
-{
- int is_mouse = 0;
- int is_touchpad = 0;
-
- if (!test_bit (EV_KEY, bitmask_ev))
- return;
-
- if (test_bit (EV_ABS, bitmask_ev) &&
- test_bit (ABS_X, bitmask_abs) && test_bit (ABS_Y, bitmask_abs)) {
- if (test_bit (BTN_STYLUS, bitmask_key) || test_bit (BTN_TOOL_PEN, bitmask_key))
- puts("ID_INPUT_TABLET=1");
- else if (test_bit (BTN_TOOL_FINGER, bitmask_key) && !test_bit (BTN_TOOL_PEN, bitmask_key))
- is_touchpad = 1;
- else if (test_bit (BTN_TRIGGER, bitmask_key) ||
- test_bit (BTN_A, bitmask_key) ||
- test_bit (BTN_1, bitmask_key))
- puts("ID_INPUT_JOYSTICK=1");
- else if (test_bit (BTN_MOUSE, bitmask_key))
- /* This path is taken by VMware's USB mouse, which has
- * absolute axes, but no touch/pressure button. */
- is_mouse = 1;
- else if (test_bit (BTN_TOUCH, bitmask_key))
- puts("ID_INPUT_TOUCHSCREEN=1");
- }
-
- if (test_bit (EV_REL, bitmask_ev) &&
- test_bit (REL_X, bitmask_rel) && test_bit (REL_Y, bitmask_rel) &&
- test_bit (BTN_MOUSE, bitmask_key))
- is_mouse = 1;
-
- if (is_mouse)
- puts("ID_INPUT_MOUSE=1");
- if (is_touchpad)
- puts("ID_INPUT_TOUCHPAD=1");
-}
-
-/* key like devices */
-static void test_key (const unsigned long* bitmask_ev,
- const unsigned long* bitmask_key)
-{
- unsigned i;
- unsigned long acc;
- unsigned long mask;
-
- /* do we have any KEY_* capability? */
- if (!test_bit (EV_KEY, bitmask_ev))
- return;
-
- acc = 0;
- for (i = 0; i < BTN_MISC/BITS_PER_LONG; ++i)
- acc |= bitmask_key[i];
- if (acc > 0)
- puts("ID_INPUT_KEY=1");
-
- /* the first 32 bits are ESC, numbers, and Q to D; if we have all of
- * those, consider it a full keyboard; do not test KEY_RESERVED, though */
- mask = 0xFFFFFFFE;
- if ((bitmask_key[0] & mask) == mask)
- puts("ID_INPUT_KEYBOARD=1");
-}
-
-int main (int argc, char** argv)
-{
- struct udev *udev;
- struct udev_device *dev;
-
- char devpath[PATH_MAX];
- unsigned long bitmask_ev[NBITS(EV_MAX)];
- unsigned long bitmask_abs[NBITS(ABS_MAX)];
- unsigned long bitmask_key[NBITS(KEY_MAX)];
- unsigned long bitmask_rel[NBITS(REL_MAX)];
-
- if (argc != 2) {
- fprintf(stderr, "Usage: %s <device path (without /sys)>\n", argv[0]);
- exit(1);
- }
-
- /* get the device */
- udev = udev_new();
- if (udev == NULL)
- return 1;
-
- snprintf(devpath, sizeof(devpath), "%s/%s", udev_get_sys_path(udev), argv[1]);
- dev = udev_device_new_from_syspath(udev, devpath);
- if (dev == NULL) {
- fprintf(stderr, "unable to access '%s'\n", devpath);
- return 1;
- }
-
- /* walk up the parental chain until we find the real input device; the
- * argument is very likely a subdevice of this, like eventN */
- while (dev != NULL && udev_device_get_sysattr_value(dev, "capabilities/ev") == NULL)
- dev = udev_device_get_parent_with_subsystem_devtype(dev, "input", NULL);
-
- /* not an "input" class device */
- if (dev == NULL)
- return 0;
-
- /* Use this as a flag that input devices were detected, so that this
- * program doesn't need to be called more than once per device */
- puts("ID_INPUT=1");
-
- get_cap_mask (dev, "capabilities/ev", bitmask_ev, sizeof (bitmask_ev));
- get_cap_mask (dev, "capabilities/abs", bitmask_abs, sizeof (bitmask_abs));
- get_cap_mask (dev, "capabilities/rel", bitmask_rel, sizeof (bitmask_rel));
- get_cap_mask (dev, "capabilities/key", bitmask_key, sizeof (bitmask_key));
-
- test_pointers(bitmask_ev, bitmask_abs, bitmask_key, bitmask_rel);
-
- test_key(bitmask_ev, bitmask_key);
-
- return 0;
-}
ENV{DMI_VENDOR}=="PEGATRON CORP.", ATTR{[dmi/id]product_name}=="Spring Peak", RUN+="keyboard-force-release.sh $devpath common-volume-keys"
-ENV{DMI_VENDOR}=="TOSHIBA", ATTR{[dmi/id]product_name}=="Satellite U300|Satellite Pro U300|Satellite U305|SATELLITE U500", RUN+="keyboard-force-release.sh $devpath common-volume-keys"
+ENV{DMI_VENDOR}=="TOSHIBA", ATTR{[dmi/id]product_name}=="Satellite [uU]300*|Satellite Pro [uU]300*|Satellite [uU]305*|SATELLITE [uU]500*", RUN+="keyboard-force-release.sh $devpath common-volume-keys"
ENV{DMI_VENDOR}=="Viooo Corporation", ATTR{[dmi/id]product_name}=="PT17", RUN+="keyboard-force-release.sh $devpath common-volume-keys"
ENV{DMI_VENDOR}=="Zepto", ATTR{[dmi/id]product_name}=="Znote", ATTR{[dmi/id]product_version}=="6625WD", RUN+="keyboard-force-release.sh $devpath common-volume-keys"
+ENV{DMI_VENDOR}=="HANNspree", ATTR{[dmi/id]product_name}=="SN10E100", RUN+="keyboard-force-release.sh $devpath common-volume-keys"
+
LABEL="force_release_end"
# pairs.
ACTION=="remove", GOTO="keyboard_end"
-SUBSYSTEM!="input", GOTO="keyboard_end"
KERNEL!="event*", GOTO="keyboard_end"
+ENV{ID_INPUT_KEY}=="", GOTO="keyboard_end"
+SUBSYSTEMS=="bluetooth", GOTO="keyboard_end"
-SUBSYSTEMS=="usb", ENV{ID_VENDOR}=="", IMPORT{program}="usb_id --export %p"
+SUBSYSTEMS=="usb", IMPORT{builtin}="usb_id"
SUBSYSTEMS=="usb", GOTO="keyboard_usbcheck"
GOTO="keyboard_modulecheck"
LABEL="keyboard_usbcheck"
+ENV{ID_VENDOR}=="Genius", ENV{ID_MODEL_ID}=="0708", ENV{ID_USB_INTERFACE_NUM}=="01", RUN+="keymap $name genius-slimstar-320"
ENV{ID_VENDOR}=="Logitech*", ATTRS{name}=="Logitech USB Multimedia Keyboard", RUN+="keymap $name logitech-wave"
ENV{ID_VENDOR}=="Logitech*", ATTRS{name}=="Logitech USB Receiver", RUN+="keymap $name logitech-wave-cordless"
# Logitech Cordless Wave Pro looks slightly weird; some hotkeys are coming through the mouse interface
-ENV{ID_VENDOR_ID}=="046d", ENV{ID_MODEL_ID}=="c529", ATTRS{name}=="Logitech USB Receiver", RUN+="keymap $name logitech-wave-pro-cordless"
+ENV{ID_VENDOR_ID}=="046d", ENV{ID_MODEL_ID}=="c52[9b]", ATTRS{name}=="Logitech USB Receiver", RUN+="keymap $name logitech-wave-pro-cordless"
ENV{ID_VENDOR}=="Lite-On_Technology_Corp*", ATTRS{name}=="Lite-On Technology Corp. ThinkPad USB Keyboard with TrackPoint", RUN+="keymap $name lenovo-thinkpad-usb-keyboard-trackpoint"
ENV{ID_VENDOR_ID}=="04b3", ENV{ID_MODEL_ID}=="301[89]", RUN+="keymap $name ibm-thinkpad-usb-keyboard-trackpoint"
+ENV{ID_VENDOR}=="Microsoft", ENV{ID_MODEL_ID}=="00db", RUN+="keymap $name 0xc022d zoomin 0xc022e zoomout"
+
GOTO="keyboard_end"
#
ENV{DMI_VENDOR}=="Sony*", KERNELS=="input*", ATTRS{name}=="Sony Vaio Keys", RUN+="keymap $name module-sony"
ENV{DMI_VENDOR}=="ASUS*", KERNELS=="input*", ATTRS{name}=="Eee PC WMI hotkeys", RUN+="keymap $name 0x6B f21"
ENV{DMI_VENDOR}=="ASUS*", KERNELS=="input*", ATTRS{name}=="Eee PC Hotkey Driver", RUN+="keymap $name 0x37 f21"
+ENV{DMI_VENDOR}=="Acer*", KERNELS=="input*", ATTRS{name}=="Acer WMI hotkeys", RUN+="keymap $name 0x82 f21"
+ENV{DMI_VENDOR}=="MICRO-STAR*|Micro-Star*", KERNELS=="input*", ATTRS{name}=="MSI Laptop hotkeys", RUN+="keymap $name 0x213 f22 0x214 f23"
# Older Vaios have some different keys
ENV{DMI_VENDOR}=="Sony*", ATTR{[dmi/id]product_name}=="*PCG-C1*|*PCG-K25*|*PCG-F1*|*PCG-F2*|*PCG-F3*|*PCG-F4*|*PCG-F5*|*PCG-F6*|*PCG-FX*|*PCG-FRV*|*PCG-GR*|*PCG-TR*|*PCG-NV*|*PCG-Z*|*VGN-S360*", ATTRS{name}=="Sony Vaio Keys", RUN+="keymap $name module-sony-old"
ENV{DMI_VENDOR}=="Dell*", RUN+="keymap $name dell"
ENV{DMI_VENDOR}=="Dell*", ATTR{[dmi/id]product_name}=="Inspiron 910|Inspiron 1010|Inspiron 1011|Inspiron 1012|Inspiron 1110|Inspiron 1210", RUN+="keymap $name 0x84 wlan"
+ENV{DMI_VENDOR}=="Dell*", ATTR{[dmi/id]product_name}=="Latitude XT2", RUN+="keymap $name dell-latitude-xt2"
ENV{DMI_VENDOR}=="Compaq*", ATTR{[dmi/id]product_name}=="*E500*|*Evo N*", RUN+="keymap $name compaq-e_evo"
ENV{DMI_VENDOR}=="LENOVO*", ATTR{[dmi/id]product_version}=="*3000*", RUN+="keymap $name lenovo-3000"
-ENV{DMI_VENDOR}=="LENOVO*", ATTR{[dmi/id]product_version}=="ThinkPad X6*", ATTR{[dmi/id]product_version}=="* Tablet" RUN+="keymap $name lenovo-thinkpad_x6_tablet"
-ENV{DMI_VENDOR}=="LENOVO*", ATTR{[dmi/id]product_version}=="ThinkPad X20* Tablet*", ATTR{[dmi/id]product_version}=="* Tablet" RUN+="keymap $name lenovo-thinkpad_x200_tablet"
+ENV{DMI_VENDOR}=="LENOVO*", ATTR{[dmi/id]product_version}=="ThinkPad X6*", ATTR{[dmi/id]product_version}=="* Tablet", RUN+="keymap $name lenovo-thinkpad_x6_tablet"
+ENV{DMI_VENDOR}=="LENOVO*", ATTR{[dmi/id]product_version}=="ThinkPad X20* Tablet*", ATTR{[dmi/id]product_version}=="* Tablet", RUN+="keymap $name lenovo-thinkpad_x200_tablet"
ENV{DMI_VENDOR}=="LENOVO*", ATTR{[dmi/id]product_version}=="*IdeaPad*", RUN+="keymap $name lenovo-ideapad"
ENV{DMI_VENDOR}=="LENOVO*", ATTR{[dmi/id]product_name}=="S10-*", RUN+="keymap $name lenovo-ideapad"
ENV{DMI_VENDOR}=="LENOVO", ATTR{[dmi/id]product_version}=="*IdeaPad Y550*", RUN+="keymap $name 0x95 media 0xA3 play"
ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="Aspire 5920G", RUN+="keymap $name acer-aspire_5920g"
ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="Aspire 5720*", RUN+="keymap $name acer-aspire_5720"
ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="Aspire 8930", RUN+="keymap $name acer-aspire_8930"
+ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_serial}=="ZG8*", RUN+="keymap $name acer-aspire_5720"
ENV{DMI_VENDOR}=="*BenQ*", ATTR{[dmi/id]product_name}=="*Joybook R22*", RUN+="keymap $name 0x6E wlan"
ENV{DMI_VENDOR}=="MEDION*", ATTR{[dmi/id]product_name}=="*FID2060*", RUN+="keymap $name medion-fid2060"
ENV{DMI_VENDOR}=="MEDIONNB", ATTR{[dmi/id]product_name}=="A555*", RUN+="keymap $name medionnb-a555"
-ENV{DMI_VENDOR}=="MICRO-STAR*", RUN+="keymap $name micro-star"
-ENV{DMI_VENDOR}=="Micro-Star International", RUN+="keymap $name micro-star"
+ENV{DMI_VENDOR}=="MICRO-STAR*|Micro-Star*", RUN+="keymap $name micro-star"
# some MSI models generate ACPI/input events on the LNXVIDEO input devices,
# plus some extra synthesized ones on atkbd as an echo of actually changing the
int keycode;
if ((keycode = evdev_get_keycode(fd, scancode, 1)) < 0) {
- if (keycode != -2)
- r = -1;
+ if (keycode == -2)
+ continue;
+ r = -1;
break;
}
scancode, k->id);
}
-static int merge_table(int fd, const char *filename) {
+static int merge_table(int fd, FILE *f) {
int r = 0;
int line = 0;
- FILE* f;
-
- f = fopen(filename, "r");
- if (!f) {
- perror(filename);
- r = -1;
- goto fail;
- }
while (!feof(f)) {
char s[256], *p;
scancode, new_keycode, old_keycode);
}
fail:
+ fclose(f);
return r;
}
-static const char* default_keymap_path(const char* path)
-{
- static char result[PATH_MAX];
-
- /* If keymap file is given without a path, assume udev directory; must end with '/' * */
- if (!strchr(path, '/')) {
- snprintf(result, sizeof(result), "%s%s", LIBEXECDIR "/keymaps/", path);
- return result;
- }
- return path;
-}
/* read one event; return 1 if valid */
static int read_event(int fd, struct input_event* ev)
/* two arguments (device, mapfile): set map file */
if (argc == optind+2) {
- merge_table(fd, default_keymap_path(argv[optind+1]));
+ const char *filearg = argv[optind+1];
+ if (strchr(filearg, '/')) {
+ /* Keymap file argument is a path */
+ FILE *f = fopen(filearg, "r");
+ if (f)
+ merge_table(fd, f);
+ else
+ perror(filearg);
+ } else {
+ /* Keymap file argument is a filename */
+ /* Open override file if present, otherwise default file */
+ char keymap_path[PATH_MAX];
+ snprintf(keymap_path, sizeof(keymap_path), "%s%s", SYSCONFDIR "/udev/keymaps/", filearg);
+ FILE *f = fopen(keymap_path, "r");
+ if (f) {
+ merge_table(fd, f);
+ } else {
+ snprintf(keymap_path, sizeof(keymap_path), "%s%s", LIBEXECDIR "/keymaps/", filearg);
+ f = fopen(keymap_path, "r");
+ if (f)
+ merge_table(fd, f);
+ else
+ perror(keymap_path);
+ }
+ }
return 0;
}
0x8A media
+0x92 media
+0xA6 setup
0xB2 www
-0x92 prog2
0xD9 bluetooth # (toggle) on-to-off
--- /dev/null
+0x9B up # tablet rocker up
+0x9E enter # tablet rocker press
+0x9F back # tablet back
+0xA3 down # tablet rocker down
--- /dev/null
+# Genius SlimStar 320
+#
+# Only buttons which are not properly mapped yet are configured below
+
+# "Scroll wheel", a circular up/down/left/right button. Aimed for scolling,
+# but since there are no scrollleft/scrollright, let's map to back/forward.
+0x900f0 scrollup
+0x900f1 scrolldown
+0x900f3 back
+0x900f2 forward
+
+# Multimedia buttons, left side (from left to right)
+# [W]
+0x900f5 wordprocessor
+# [Ex]
+0x900f6 spreadsheet
+# [P]
+0x900f4 presentation
+# Other five (calculator, playpause, stop, mute and eject) are OK
+
+# Right side, from left to right
+# [e]
+0xc0223 www
+# "man"
+0x900f7 chat
+# "Y"
+0x900fb prog1
+# [X]
+0x900f8 close
+# "picture"
+0x900f9 graphicseditor
+# "two windows"
+0x900fd scale
+# "lock"
+0x900fc screenlock
0x90011 prog1 # Thinkvantage button
0x90015 camera # Fn+F6 headset/camera VoIP key ??
-# 0x90010 # Microphone mute button ??
+0x90010 micmute # Microphone mute button
0x15 volumedown
0x16 mute
0x17 prog1 # ThinkPad/ThinkVantage button (high keycode: "vendor")
+0x1A prog2 # Microphone mute
0x81 fn_esc
0xF9 camera
0xF8 sound # Fn-CAMERA = Mic
-0xBB fn_f1
-0xBC fn_f2
-0xBD fn_f3
-0xBE fn_f4
-0xBF fn_f5
-0xC0 fn_f6
-0xC1 fn_f7
-0xC2 fn_f8
-0xC3 fn_f9
-0xC4 fn_f10
-0xD7 fn_f11
-0xD8 fn_f12
+
+
+# Function key mappings, as per
+# http://dev.laptop.org/ticket/10213#comment:20
+#
+# Unmodified F1-F8 produce F1-F8, so no remap necessary.
+# Unmodified F9-F12 control brightness and volume.
+0x43 brightnessdown
+0x44 brightnessup
+0x57 volumedown
+0x58 volumeup
+
+# fn-modified fkeys all produce the unmodified version of the key.
+0xBB f1
+0xBC f2
+0xBD f3
+0xBE f4
+0xBF f5
+0xC0 f6
+0xC1 f7
+0xC2 f8
+0xC3 f9
+0xC4 f10
+0xD7 f11
+0xD8 f12
+
# Using F13-F21 for the .5 F keys right now.
0xF7 f13
+++ /dev/null
-ACTION!="add", GOTO="mobile_action_end"
-
-# ATTENTION: DO NOT USE THIS FILE FOR ANYTHING EXCEPT
-# MOBILE ACTION CABLES. DO NOT USE IT FOR 3G DEVICES!
-
-SUBSYSTEM=="usb", ATTR{bDeviceClass}=="00|ff", ATTR{bDeviceSubClass}=="00|ff", ENV{DEVTYPE}=="usb_device", GOTO="mobile_action_switch"
-GOTO="mobile_action_end"
-
-LABEL="mobile_action_switch"
-
-# Mobile Action cables like the 8280p and 8230p
-ATTRS{idVendor}=="0df7", ATTRS{idProduct}=="0800", RUN+="mobile-action-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t mobile-action-8280p"
-
-LABEL="mobile_action_end"
-
+++ /dev/null
-/* http://www.natox.be/ma8280p/
- * http://www.leopold.dk/~martin/ma-8230p.html
- * http://figvam.blogspot.com/2007/01/mobile-action-8730p-usb-cable-and-linux.html
- */
-
-/*
- *
- * Code by davy hollevoet. This is simply an adaptation of code
- * generated by usbsnoop2libusb. (http://iki.fi/lindi/usb/usbsnoop2libusb.pl)
- *
- * This code is released under both the GPL version 2 and BSD licenses.
- * Either license may be used.
- *
- * GPLv2
- * ********
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * In addition:
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. The name of the author may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
- * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * BSD
- * ******
- * Copyright (c) 1998, Regents of the University of California
- * All rights reserved.
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * * Neither the name of the University of California, Berkeley nor the
- * names of its contributors may be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-/* This file is (mostly) generated with usbsnoop2libusb.pl from a usbsnoop log file. */
-/* Latest version of the script should be in http://iki.fi/lindi/usb/usbsnoop2libusb.pl */
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-#include <signal.h>
-#include <ctype.h>
-#include <time.h>
-#include <usb.h>
-
-#include "utils.h"
-#include "ma8280p_us.h"
-
-static void msleep(long msec)
-{
- struct timespec duration = { 0, msec * 1000 * 1000 };
-
- nanosleep(&duration, NULL);
-}
-
-int ma8280p_switch (struct usb_dev_handle *devh, struct usb_device *dev)
-{
- int ret = 1;
- char *buf = NULL;
-
- buf = malloc (65535);
- if (!buf) {
- error ("%s: not enough memory", dev->filename, ret);
- return -1;
- }
-
- usb_get_descriptor(devh, 0x0000001, 0x0000000, buf, 0x0000012);
- msleep(6);
- usb_get_descriptor(devh, 0x0000001, 0x0000000, buf, 0x0000012);
- msleep(6);
- usb_get_descriptor(devh, 0x0000002, 0x0000000, buf, 0x0000400);
- msleep(10);
- ret = usb_release_interface(devh, 0);
- if (ret != 0)
- debug ("%s: failed to release interface before set_configuration: %d", dev->filename, ret);
- usb_set_configuration(devh, 0x0000001);
- ret = usb_claim_interface(devh, 0);
- if (ret != 0)
- debug ("%s: claim after set_configuration failed with error %d", dev->filename, ret);
- //usb_set_altinterface(devh, 0);
- //msleep(33);
- usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE + USB_ENDPOINT_IN, 0x0000001, 0x0000300, 0x0000000, buf, 0x0000008, 1000);
- msleep(5);
- memcpy(buf, "\xb0\x04\x00\x00\x02\x90\x26\x86", 0x0000008);
- usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE, 0x0000009, 0x0000300, 0x0000000, buf, 0x0000008, 1000);
- msleep(4);
- memcpy(buf, "\xb0\x04\x00\x00\x02\x90\x26\x86", 0x0000008);
- usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE, 0x0000009, 0x0000300, 0x0000000, buf, 0x0000008, 1000);
- msleep(4);
-
- msleep(4);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(6);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(1);
- //URB_FUNCTION_GET_STATUS_FROM_ENDPOINT skipped
- msleep(4);
- memcpy(buf, "\x37\x01\xfe\xdb\xc1\x33\x1f\x83", 0x0000008);
- usb_interrupt_write(devh, 0x00000002, buf, 0x0000008, 1000);
- msleep(3);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(1);
- memcpy(buf, "\x37\x0e\xb5\x9d\x3b\x8a\x91\x51", 0x0000008);
- usb_interrupt_write(devh, 0x00000002, buf, 0x0000008, 1000);
- msleep(7);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(1);
- memcpy(buf, "\x34\x87\xba\x0d\xfc\x8a\x91\x51", 0x0000008);
- usb_interrupt_write(devh, 0x00000002, buf, 0x0000008, 1000);
- msleep(7);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(2);
- //URB_FUNCTION_GET_STATUS_FROM_ENDPOINT skipped
- msleep(4);
- memcpy(buf, "\x37\x01\xfe\xdb\xc1\x33\x1f\x83", 0x0000008);
- usb_interrupt_write(devh, 0x00000002, buf, 0x0000008, 1000);
- msleep(2);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(1);
- memcpy(buf, "\x37\x0e\xb5\x9d\x3b\x8a\x91\x51", 0x0000008);
- usb_interrupt_write(devh, 0x00000002, buf, 0x0000008, 1000);
- msleep(7);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(1);
- memcpy(buf, "\x34\x87\xba\x0d\xfc\x8a\x91\x51", 0x0000008);
- usb_interrupt_write(devh, 0x00000002, buf, 0x0000008, 1000);
- msleep(7);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(8);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(1);
- //URB_FUNCTION_GET_STATUS_FROM_ENDPOINT skipped
- msleep(4);
- memcpy(buf, "\x33\x04\xfe\x00\xf4\x6c\x1f\xf0", 0x0000008);
- usb_interrupt_write(devh, 0x00000002, buf, 0x0000008, 1000);
- msleep(3);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
- msleep(1);
- //URB_FUNCTION_GET_STATUS_FROM_ENDPOINT skipped
- msleep(4);
- memcpy(buf, "\x32\x07\xfe\xf0\x29\xb9\x3a\xf0", 0x0000008);
- usb_interrupt_write(devh, 0x00000002, buf, 0x0000008, 1000);
- msleep(3);
- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
-
- if (buf)
- free (buf);
- return 0;
-}
+++ /dev/null
-/*
- * Modem mode switcher
- *
- * Copyright (C) 2009 Dan Williams <dcbw@redhat.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details:
- */
-
-#ifndef __MA8280P_H__
-#define __MA8280P_H__
-
-#include <usb.h>
-
-int ma8280p_switch (struct usb_dev_handle *devh, struct usb_device *dev);
-
-#endif /* __MA8280P_H__ */
+++ /dev/null
-/*
- * Mobile action cable mode switcher
- *
- * Copyright (C) 2008 - 2010 Dan Williams <dcbw@redhat.com>
- * Copyright (C) 2008 Peter Henn <support@option.com>
- *
- * Heavily based on the 'ozerocdoff' tool by Peter Henn.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details:
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <signal.h>
-#include <stdarg.h>
-#include <getopt.h>
-
-#include <usb.h>
-
-#include "utils.h"
-
-#include "ma8280p_us.h"
-
-struct usb_dev_handle *handle = NULL;
-
-typedef struct usb_device * (*FindFunc) (int vid, int pid);
-typedef int (*SwitchFunc) (struct usb_dev_handle *dh, struct usb_device *dev);
-
-typedef enum {
- ST_UNKNOWN = 0,
- ST_MA8280P
-} SwitchType;
-
-typedef struct SwitchEntry {
- SwitchType st;
- const char *clopt;
- FindFunc find_func;
- SwitchFunc switch_func;
-} SwitchEntry;
-
-static SwitchEntry switch_types[] = {
- { ST_MA8280P, "mobile-action-8280p", NULL, ma8280p_switch },
- { ST_UNKNOWN, NULL, NULL }
-};
-
-static struct usb_device *
-generic_find (int vid, int pid)
-{
- struct usb_bus *bus;
- struct usb_device *dev;
-
- for (bus = usb_get_busses(); bus; bus = bus->next) {
- for (dev = bus->devices; dev; dev = dev->next) {
- if (dev->descriptor.idVendor == vid && dev->descriptor.idProduct == pid) {
- debug ("Found device '%s'", dev->filename);
- return dev;
- }
- }
- }
- return NULL;
-}
-
-static void
-release_usb_device (int param)
-{
- usb_release_interface (handle, 0);
- usb_close (handle);
-}
-
-static void
-print_usage (void)
-{
- printf ("Usage: mobile-action-modeswitch [-hdq] [-l <file>] -v <vendor-id> -p <product-id> -t <type>\n"
- " -h, --help show this help message\n"
- " -v, --vendor <n> target USB vendor ID\n"
- " -p, --product <n> target USB product ID\n"
- " -t, --type <type> type of switch to attempt, varies by device:\n"
- " mobile-action-8280p - For Mobile Action 8xxxP USB cables\n"
- " -l, --log <file> log output to a file\n"
- " -q, --quiet don't print anything to stdout\n"
- " -d, --debug display debugging messages\n\n"
- "Examples:\n"
- " mobile-action-modeswitch -v 0x0df7 -p 0x8000 -t mobile-action-8280p\n");
-}
-
-static SwitchEntry *
-parse_type (const char *s)
-{
- SwitchEntry *entry = &switch_types[0];
-
- while (entry->clopt) {
- if (!strcmp (entry->clopt, s))
- return entry;
- entry++;
- }
-
- return NULL;
-}
-
-static void
-do_exit (int val)
-{
- log_shutdown ();
- exit (val);
-}
-
-int main(int argc, char **argv)
-{
- static struct option options[] = {
- { "help", no_argument, NULL, 'h' },
- { "vendor", required_argument, NULL, 'v' },
- { "product", required_argument, NULL, 'p' },
- { "type", required_argument, NULL, 't' },
- { "log", required_argument, NULL, 'l' },
- { "debug", no_argument, NULL, 'd' },
- { "quiet", no_argument, NULL, 'q' },
- { NULL, 0, NULL, 0}
- };
-
- struct usb_device *dev;
- int vid = 0, pid = 0;
- const char *logpath = NULL;
- char buffer[256];
- int ret, quiet = 0, debug = 0;
- SwitchEntry *sentry = NULL;
-
- while (1) {
- int option;
-
- option = getopt_long(argc, argv, "hv:p:l:t:dq", options, NULL);
- if (option == -1)
- break;
-
- switch (option) {
- case 'v':
- vid = strtol (optarg, NULL, 0);
- break;
- case 'p':
- pid = strtol (optarg, NULL, 0);
- break;
- case 't':
- sentry = parse_type (optarg);
- if (!sentry) {
- error ("unknown switch type '%s'", optarg);
- print_usage ();
- exit (1);
- }
- break;
- case 'l':
- logpath = optarg;
- break;
- case 'q':
- quiet = 1;
- break;
- case 'd':
- debug = 1;
- break;
- case 'h':
- default:
- print_usage ();
- exit (1);
- }
- }
-
- if (log_startup (logpath, debug, quiet)) {
- fprintf (stderr, "Couldn't open/create logfile %s", logpath);
- exit (2);
- }
-
- if (!sentry) {
- if (!quiet)
- print_usage ();
- else
- error ("missing device switch type.");
- do_exit (3);
- }
-
- if (!vid || !pid) {
- if (!quiet)
- print_usage ();
- else
- error ("missing vendor and device IDs.");
- do_exit (3);
- }
-
- usb_init();
-
- if (usb_find_busses() < 0) {
- error ("no USB busses found.");
- do_exit (4);
- }
-
- if (usb_find_devices() < 0) {
- error ("no USB devices found.");
- do_exit (4);
- }
-
- if (sentry->find_func)
- dev = (*sentry->find_func) (vid, pid);
- else
- dev = generic_find (vid, pid);
- if (dev == NULL) {
- error ("no device found.");
- do_exit (5);
- }
-
- handle = usb_open (dev);
- if (handle == NULL) {
- error ("%s: could not access the device.",
- dev->filename);
- do_exit (6);
- }
-
- /* detach running default driver */
- signal (SIGTERM, release_usb_device);
- ret = usb_get_driver_np (handle, 0, buffer, sizeof (buffer));
- if (ret == 0) {
- debug ("%s: found already attached driver '%s'", dev->filename, buffer);
-
- ret = usb_detach_kernel_driver_np (handle, 0);
- if (ret != 0) {
- debug ("%s: error: unable to detach current driver.", dev->filename);
- usb_close (handle);
- do_exit (7);
- }
- }
-
- ret = usb_claim_interface (handle, 0);
- if (ret != 0) {
- debug ("%s: couldn't claim device's USB interface: %d.",
- dev->filename, ret);
- usb_close (handle);
- do_exit (8);
- }
-
- ret = (*sentry->switch_func) (handle, dev);
- if (ret < 0) {
- debug ("%s: failed to switch device to serial mode.", dev->filename);
- usb_release_interface (handle, 0);
- usb_close (handle);
- do_exit(9);
- }
-
- usb_release_interface (handle, 0);
-
- ret = usb_close (handle);
- if (ret < 0)
- debug ("%s: failed to close the device.", dev->filename);
-
- do_exit (0);
- return 0;
-}
+++ /dev/null
-/*
- * Modem mode switcher
- *
- * Copyright (C) 2009 Dan Williams <dcbw@redhat.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details:
- */
-
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <time.h>
-
-#include "utils.h"
-
-static int debug_on = 0;
-static int quiet = 0;
-FILE *logfile = NULL;
-
-void
-do_log (int level, const char *fmt, ...)
-{
- va_list args;
- char buffer[1024];
- char tag = 'L';
-
- if (level >= LOG_DBG && !debug_on)
- return;
-
- va_start (args, fmt);
- vsnprintf (buffer, sizeof (buffer), fmt, args);
- va_end (args);
-
- if (level == LOG_ERR)
- tag = 'E';
- else if (level == LOG_MSG)
- tag = 'L';
- else if (level == LOG_DBG)
- tag = 'D';
-
- if (logfile)
- fprintf (logfile, "%c: %s\n", tag, buffer);
- if (!quiet)
- fprintf ((level == LOG_ERR) ? stderr : stdout, "%c: %s\n", tag, buffer);
-}
-
-int
-log_startup (const char *path, int do_debug, int be_quiet)
-{
- time_t t;
-
- quiet = be_quiet;
- debug_on = do_debug;
-
- if (!path)
- return 0;
-
- logfile = fopen (path, "a+");
- if (!logfile)
- return 1;
-
- t = time (NULL);
- message ("\n**** Started: %s\n", ctime (&t));
- return 0;
-}
-
-void
-log_shutdown (void)
-{
- if (logfile)
- fclose (logfile);
-}
-
+++ /dev/null
-/*
- * Modem mode switcher
- *
- * Copyright (C) 2009 Dan Williams <dcbw@redhat.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details:
- */
-
-#ifndef __UTILS_H__
-#define __UTILS_H__
-
-#define LOG_ERR 0
-#define LOG_MSG 1
-#define LOG_DBG 2
-
-#define message(fmt, args...) do_log (LOG_MSG, fmt, ##args);
-#define error(fmt, args...) do_log (LOG_ERR, fmt, ##args);
-#define debug(fmt, args...) do_log (LOG_DBG, fmt, ##args);
-
-void do_log (int level, const char *fmt, ...);
-int log_startup (const char *path, int do_debug, int be_quiet);
-void log_shutdown (void);
-
-#endif /* __UTILS_H__ */
ENV{MATCHADDR}=="52:54:00:*", GOTO="persistent_net_generator_end"
# ignore VMWare virtual interfaces
ENV{MATCHADDR}=="00:0c:29:*|00:50:56:*", GOTO="persistent_net_generator_end"
+# ignore Hyper-V virtual interfaces
+ENV{MATCHADDR}=="00:15:5d:*", GOTO="persistent_net_generator_end"
# These vendors are known to violate the local MAC address assignment scheme
# Interlan, DEC (UNIBUS or QBUS), Apollo, Cisco, Racal-Datacom
# Create a lock file for the current rules file.
lock_rules_file() {
- [ -e /dev/.udev/ ] || return 0
+ RUNDIR=$(udevadm info --run)
+ [ -e "$RUNDIR" ] || return 0
- RULES_LOCK="/dev/.udev/.lock-${RULES_FILE##*/}"
+ RULES_LOCK="$RUNDIR/.lock-${RULES_FILE##*/}"
retry=30
while ! mkdir $RULES_LOCK 2> /dev/null; do
# Choose the real rules file if it is writeable or a temporary file if not.
# Both files should be checked later when looking for existing rules.
choose_rules_file() {
- local tmp_rules_file="/dev/.udev/tmp-rules--${RULES_FILE##*/}"
+ RUNDIR=$(udevadm info --run)
+ local tmp_rules_file="$RUNDIR/tmp-rules--${RULES_FILE##*/}"
[ -e "$RULES_FILE" -o -e "$tmp_rules_file" ] || PRINT_HEADER=1
if writeable ${RULES_FILE%/*}; then
--- /dev/null
+scsi_id - generate a SCSI unique identifier for a given SCSI device
+
+Please send questions, comments or patches to <patmans@us.ibm.com> or
+<linux-hotplug-devel@lists.sourceforge.net>.
*/
buffer = malloc(MAX_BUFFER_LEN);
if (!buffer) {
+ fclose(fd);
err(udev, "can't allocate memory\n");
return -1;
}
udev_util_encode_string(dev_scsi->vendor, vendor_enc_str, sizeof(vendor_enc_str));
udev_util_encode_string(dev_scsi->model, model_enc_str, sizeof(model_enc_str));
- udev_util_replace_whitespace(dev_scsi->vendor, vendor_str, sizeof(vendor_str));
- udev_util_replace_chars(vendor_str, NULL);
- udev_util_replace_whitespace(dev_scsi->model, model_str, sizeof(model_str));
- udev_util_replace_chars(model_str, NULL);
+ util_replace_whitespace(dev_scsi->vendor, vendor_str, sizeof(vendor_str));
+ util_replace_chars(vendor_str, NULL);
+ util_replace_whitespace(dev_scsi->model, model_str, sizeof(model_str));
+ util_replace_chars(model_str, NULL);
set_type(dev_scsi->type, type_str, sizeof(type_str));
- udev_util_replace_whitespace(dev_scsi->revision, revision_str, sizeof(revision_str));
- udev_util_replace_chars(revision_str, NULL);
+ util_replace_whitespace(dev_scsi->revision, revision_str, sizeof(revision_str));
+ util_replace_chars(revision_str, NULL);
return 0;
}
printf("ID_REVISION=%s\n", revision_str);
printf("ID_TYPE=%s\n", type_str);
if (dev_scsi.serial[0] != '\0') {
- udev_util_replace_whitespace(dev_scsi.serial, serial_str, sizeof(serial_str));
- udev_util_replace_chars(serial_str, NULL);
+ util_replace_whitespace(dev_scsi.serial, serial_str, sizeof(serial_str));
+ util_replace_chars(serial_str, NULL);
printf("ID_SERIAL=%s\n", serial_str);
- udev_util_replace_whitespace(dev_scsi.serial_short, serial_str, sizeof(serial_str));
- udev_util_replace_chars(serial_str, NULL);
+ util_replace_whitespace(dev_scsi.serial_short, serial_str, sizeof(serial_str));
+ util_replace_chars(serial_str, NULL);
printf("ID_SERIAL_SHORT=%s\n", serial_str);
}
if (dev_scsi.wwn[0] != '\0') {
if (reformat_serial) {
char serial_str[MAX_SERIAL_LEN];
- udev_util_replace_whitespace(dev_scsi.serial, serial_str, sizeof(serial_str));
- udev_util_replace_chars(serial_str, NULL);
+ util_replace_whitespace(dev_scsi.serial, serial_str, sizeof(serial_str));
+ util_replace_chars(serial_str, NULL);
printf("%s\n", serial_str);
goto out;
}
}
return SG_ERR_CAT_SENSE;
}
- if (!host_status) {
+ if (host_status) {
if ((host_status == DID_NO_CONNECT) ||
(host_status == DID_BUS_BUSY) ||
(host_status == DID_TIME_OUT))
return SG_ERR_CAT_TIMEOUT;
}
- if (!driver_status) {
+ if (driver_status) {
if (driver_status == DRIVER_TIMEOUT)
return SG_ERR_CAT_TIMEOUT;
}
{ INQUIRY_CMD, evpd, page, 0, buflen, 0 };
unsigned char sense[SENSE_BUFF_LEN];
void *io_buf;
- int retval;
+ struct sg_io_v4 io_v4;
+ struct sg_io_hdr io_hdr;
int retry = 3; /* rather random */
+ int retval;
if (buflen > SCSI_INQ_BUFF_LEN) {
info(udev, "buflen %d too long\n", buflen);
dbg(udev, "%s evpd %d, page 0x%x\n", dev_scsi->kernel, evpd, page);
if (dev_scsi->use_sg == 4) {
- struct sg_io_v4 io_v4;
-
memset(&io_v4, 0, sizeof(struct sg_io_v4));
io_v4.guard = 'Q';
io_v4.protocol = BSG_PROTOCOL_SCSI;
io_v4.din_xferp = (uintptr_t)buf;
io_buf = (void *)&io_v4;
} else {
- struct sg_io_hdr io_hdr;
-
memset(&io_hdr, 0, sizeof(struct sg_io_hdr));
io_hdr.interface_id = 'S';
io_hdr.cmd_len = sizeof(inq_cmd);
ENV{MAJOR}=="", GOTO="acl_end"
ACTION=="remove", GOTO="acl_apply"
+# systemd replaces udev-acl entirely, skip if active
+TEST=="/sys/fs/cgroup/systemd", TAG=="uaccess", GOTO="acl_end"
+
# PTP/MTP protocol devices, cameras, portable media players
-SUBSYSTEM=="usb", ENV{ID_USB_INTERFACES}=="", ENV{DEVTYPE}=="usb_device", IMPORT{program}="usb_id --export %p"
SUBSYSTEM=="usb", ENV{ID_USB_INTERFACES}=="*:060101:*", TAG+="udev-acl"
# digicams with proprietary protocol
# optical drives
SUBSYSTEM=="block", ENV{ID_CDROM}=="1", TAG+="udev-acl"
+SUBSYSTEM=="scsi_generic", SUBSYSTEMS=="scsi", ATTRS{type}=="4|5", TAG+="udev-acl"
# sound devices
SUBSYSTEM=="sound", TAG+="udev-acl"
# PDA devices
ENV{ID_PDA}=="*?", TAG+="udev-acl"
+# Programmable remote control
+ENV{ID_REMOTE_CONTROL}=="1", TAG+="udev-acl"
+
# joysticks
SUBSYSTEM=="input", ENV{ID_INPUT_JOYSTICK}=="?*", TAG+="udev-acl"
u = u2;
}
break;
- case ACTION_NONE:
- break;
- default:
- g_assert_not_reached();
- break;
}
*remove_session_id = old_session;
if (device == NULL)
continue;
node = udev_device_get_devnode(device);
- if (node == NULL)
+ if (node == NULL) {
+ udev_device_unref(device);
continue;
+ }
set_facl(node, uid, add);
udev_device_unref(device);
}
break;
case 'h':
printf("Usage: udev-acl --action=ACTION [--device=DEVICEFILE] [--user=UID]\n\n");
- default:
goto out;
}
}
IMPORT{program}="v4l_id $tempnode"
-SUBSYSTEMS=="usb", IMPORT{program}="usb_id --export %p"
+SUBSYSTEMS=="usb", IMPORT{builtin}="usb_id"
KERNEL=="video*", ENV{ID_SERIAL}=="?*", SYMLINK+="v4l/by-id/$env{ID_BUS}-$env{ID_SERIAL}-video-index$attr{index}"
# check for valid "index" number
TEST!="index", GOTO="persistent_v4l_end"
ATTR{index}!="?*", GOTO="persistent_v4l_end"
-IMPORT{program}="path_id %p"
+IMPORT{builtin}="path_id"
ENV{ID_PATH}=="?*", KERNEL=="video*|vbi*", SYMLINK+="v4l/by-path/$env{ID_PATH}-video-index$attr{index}"
ENV{ID_PATH}=="?*", KERNEL=="audio*", SYMLINK+="v4l/by-path/$env{ID_PATH}-audio-index$attr{index}"
#include <sys/types.h>
#include <sys/time.h>
#include <sys/ioctl.h>
-#include <linux/videodev.h>
#include <linux/videodev2.h>
int main (int argc, char *argv[])
};
int fd;
char *device;
- struct video_capability v1cap;
struct v4l2_capability v2cap;
while (1) {
if ((v2cap.capabilities & V4L2_CAP_RADIO) > 0)
printf("radio:");
printf("\n");
- } else if (ioctl (fd, VIDIOCGCAP, &v1cap) == 0) {
- printf("ID_V4L_VERSION=1\n");
- printf("ID_V4L_PRODUCT=%s\n", v1cap.name);
- printf("ID_V4L_CAPABILITIES=:");
- if ((v1cap.type & VID_TYPE_CAPTURE) > 0)
- printf("capture:");
- if ((v1cap.type & VID_TYPE_OVERLAY) > 0)
- printf("video_overlay:");
- if (v1cap.audios > 0)
- printf("audio:");
- if ((v1cap.type & VID_TYPE_TUNER) > 0)
- printf("tuner:");
- printf("\n");
}
close (fd);
####################################
if GTK_DOC_USE_LIBTOOL
-GTKDOC_CC = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-GTKDOC_LD = $(LIBTOOL) --tag=CC --mode=link $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS)
+GTKDOC_CC = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+GTKDOC_LD = $(LIBTOOL) --tag=CC --mode=link $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS)
GTKDOC_RUN = $(LIBTOOL) --mode=execute
else
-GTKDOC_CC = $(CC) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-GTKDOC_LD = $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS)
+GTKDOC_CC = $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+GTKDOC_LD = $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS)
GTKDOC_RUN =
endif
TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE)
-EXTRA_DIST = \
+SETUP_FILES = \
$(content_files) \
- $(HTML_IMAGES) \
$(DOC_MAIN_SGML_FILE) \
$(DOC_MODULE)-sections.txt \
$(DOC_MODULE)-overrides.txt
-DOC_STAMPS=scan-build.stamp tmpl-build.stamp sgml-build.stamp html-build.stamp \
- pdf-build.stamp \
- $(srcdir)/tmpl.stamp $(srcdir)/sgml.stamp $(srcdir)/html.stamp \
- $(srcdir)/pdf.stamp
+EXTRA_DIST = \
+ $(HTML_IMAGES) \
+ $(SETUP_FILES)
+
+DOC_STAMPS=setup-build.stamp scan-build.stamp tmpl-build.stamp sgml-build.stamp \
+ html-build.stamp pdf-build.stamp \
+ tmpl.stamp sgml.stamp html.stamp pdf.stamp
SCANOBJ_FILES = \
$(DOC_MODULE).args \
$(REPORT_FILES): sgml-build.stamp
+#### setup ####
+
+setup-build.stamp:
+ -@if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \
+ echo ' DOC Preparing build'; \
+ files=`echo $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types`; \
+ if test "x$$files" != "x" ; then \
+ for file in $$files ; do \
+ test -f $(abs_srcdir)/$$file && \
+ cp -pu $(abs_srcdir)/$$file $(abs_builddir)/ || true; \
+ done; \
+ fi; \
+ test -d $(abs_srcdir)/tmpl && \
+ { cp -rp $(abs_srcdir)/tmpl $(abs_builddir)/; \
+ chmod -R u+w $(abs_builddir)/tmpl; } \
+ fi
+ @touch setup-build.stamp
+
#### scan ####
scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB)
- @echo 'gtk-doc: Scanning header files'
- @-chmod -R u+w $(srcdir)
- @_source_dir='' ; for i in $(DOC_SOURCE_DIR) ; do \
+ @echo ' DOC Scanning header files'
+ @_source_dir='' ; \
+ for i in $(DOC_SOURCE_DIR) ; do \
_source_dir="$${_source_dir} --source-dir=$$i" ; \
- done ; \
- cd $(srcdir) && \
- gtkdoc-scan --module=$(DOC_MODULE) --ignore-headers="$(IGNORE_HFILES)" $${_source_dir} $(SCAN_OPTIONS) $(EXTRA_HFILES)
- @if grep -l '^..*$$' $(srcdir)/$(DOC_MODULE).types > /dev/null 2>&1 ; then \
- CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" gtkdoc-scangobj $(SCANGOBJ_OPTIONS) --module=$(DOC_MODULE) --output-dir=$(srcdir) ; \
+ done ; \
+ gtkdoc-scan --module=$(DOC_MODULE) --ignore-headers="$(IGNORE_HFILES)" $${_source_dir} $(SCAN_OPTIONS) $(EXTRA_HFILES)
+ @if grep -l '^..*$$' $(DOC_MODULE).types > /dev/null 2>&1 ; then \
+ echo " DOC Introspecting gobjects"; \
+ scanobj_options=""; \
+ gtkdoc-scangobj 2>&1 --help | grep >/dev/null "\-\-verbose"; \
+ if test "$(?)" = "0"; then \
+ if test "x$(V)" = "x1"; then \
+ scanobj_options="--verbose"; \
+ fi; \
+ fi; \
+ CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" \
+ gtkdoc-scangobj $(SCANGOBJ_OPTIONS) $$scanobj_options --module=$(DOC_MODULE); \
else \
- cd $(srcdir) ; \
for i in $(SCANOBJ_FILES) ; do \
- test -f $$i || touch $$i ; \
+ test -f $$i || touch $$i ; \
done \
fi
@touch scan-build.stamp
#### templates ####
-tmpl-build.stamp: $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt
- @echo 'gtk-doc: Rebuilding template files'
- @-chmod -R u+w $(srcdir)
- @cd $(srcdir) && gtkdoc-mktmpl --module=$(DOC_MODULE) $(MKTMPL_OPTIONS)
+tmpl-build.stamp: setup-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt
+ @echo ' DOC Rebuilding template files'
+ @gtkdoc-mktmpl --module=$(DOC_MODULE) $(MKTMPL_OPTIONS)
+ @if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \
+ if test -w $(abs_srcdir) ; then \
+ cp -rp $(abs_builddir)/tmpl $(abs_srcdir)/; \
+ fi \
+ fi
@touch tmpl-build.stamp
tmpl.stamp: tmpl-build.stamp
#### xml ####
sgml-build.stamp: tmpl.stamp $(DOC_MODULE)-sections.txt $(srcdir)/tmpl/*.sgml $(expand_content_files)
- @echo 'gtk-doc: Building XML'
+ @echo ' DOC Building XML'
@-chmod -R u+w $(srcdir)
- @_source_dir='' ; for i in $(DOC_SOURCE_DIR) ; do \
+ @_source_dir='' ; \
+ for i in $(DOC_SOURCE_DIR) ; do \
_source_dir="$${_source_dir} --source-dir=$$i" ; \
- done ; \
- cd $(srcdir) && \
- gtkdoc-mkdb --module=$(DOC_MODULE) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $${_source_dir} $(MKDB_OPTIONS)
+ done ; \
+ gtkdoc-mkdb --module=$(DOC_MODULE) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $${_source_dir} $(MKDB_OPTIONS)
@touch sgml-build.stamp
sgml.stamp: sgml-build.stamp
#### html ####
html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files)
- @echo 'gtk-doc: Building HTML'
- @-chmod -R u+w $(srcdir)
- @rm -rf $(srcdir)/html
- @mkdir $(srcdir)/html
+ @echo ' DOC Building HTML'
+ @rm -rf html
+ @mkdir html
@mkhtml_options=""; \
+ gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-verbose"; \
+ if test "$(?)" = "0"; then \
+ if test "x$(V)" = "x1"; then \
+ mkhtml_options="$$mkhtml_options --verbose"; \
+ fi; \
+ fi; \
gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-path"; \
if test "$(?)" = "0"; then \
- mkhtml_options=--path="$(srcdir)"; \
+ mkhtml_options="$$mkhtml_options --path=\"$(abs_srcdir)\""; \
fi; \
- cd $(srcdir)/html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE)
- @test "x$(HTML_IMAGES)" = "x" || ( cd $(srcdir) && cp $(HTML_IMAGES) html )
- @echo 'gtk-doc: Fixing cross-references'
- @cd $(srcdir) && gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS)
+ cd html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE)
+ -@test "x$(HTML_IMAGES)" = "x" || \
+ for file in $(HTML_IMAGES) ; do \
+ if test -f $(abs_srcdir)/$$file ; then \
+ cp $(abs_srcdir)/$$file $(abs_builddir)/html; \
+ fi; \
+ if test -f $(abs_builddir)/$$file ; then \
+ cp $(abs_builddir)/$$file $(abs_builddir)/html; \
+ fi; \
+ done;
+ @echo ' DOC Fixing cross-references'
+ @gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS)
@touch html-build.stamp
#### pdf ####
pdf-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files)
- @echo 'gtk-doc: Building PDF'
- @-chmod -R u+w $(srcdir)
- @rm -rf $(srcdir)/$(DOC_MODULE).pdf
- @mkpdf_imgdirs=""; \
+ @echo ' DOC Building PDF'
+ @rm -f $(DOC_MODULE).pdf
+ @mkpdf_options=""; \
+ gtkdoc-mkpdf 2>&1 --help | grep >/dev/null "\-\-verbose"; \
+ if test "$(?)" = "0"; then \
+ if test "x$(V)" = "x1"; then \
+ mkpdf_options="$$mkpdf_options --verbose"; \
+ fi; \
+ fi; \
if test "x$(HTML_IMAGES)" != "x"; then \
for img in $(HTML_IMAGES); do \
part=`dirname $$img`; \
- echo $$mkpdf_imgdirs | grep >/dev/null "\-\-imgdir=$$part "; \
+ echo $$mkpdf_options | grep >/dev/null "\-\-imgdir=$$part "; \
if test $$? != 0; then \
- mkpdf_imgdirs="$$mkpdf_imgdirs --imgdir=$$part"; \
+ mkpdf_options="$$mkpdf_options --imgdir=$$part"; \
fi; \
done; \
fi; \
- cd $(srcdir) && gtkdoc-mkpdf --path="$(abs_srcdir)" $$mkpdf_imgdirs $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS)
+ gtkdoc-mkpdf --path="$(abs_srcdir)" $$mkpdf_options $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS)
@touch pdf-build.stamp
##############
clean-local:
- rm -f *~ *.bak
- rm -rf .libs
+ @rm -f *~ *.bak
+ @rm -rf .libs
distclean-local:
- cd $(srcdir) && \
- rm -rf xml $(REPORT_FILES) $(DOC_MODULE).pdf \
- $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt
+ @rm -rf xml html $(REPORT_FILES) $(DOC_MODULE).pdf \
+ $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt
+ @if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \
+ rm -f $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types; \
+ rm -rf tmpl; \
+ fi
maintainer-clean-local: clean
- cd $(srcdir) && rm -rf xml html
+ @rm -rf xml html
install-data-local:
- @installfiles=`echo $(srcdir)/html/*`; \
- if test "$$installfiles" = '$(srcdir)/html/*'; \
- then echo '-- Nothing to install' ; \
+ @installfiles=`echo $(builddir)/html/*`; \
+ if test "$$installfiles" = '$(builddir)/html/*'; \
+ then echo 1>&2 'Nothing to install' ; \
else \
if test -n "$(DOC_MODULE_VERSION)"; then \
installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \
fi; \
$(mkinstalldirs) $${installdir} ; \
for i in $$installfiles; do \
- echo '-- Installing '$$i ; \
+ echo ' $(INSTALL_DATA) '$$i ; \
$(INSTALL_DATA) $$i $${installdir}; \
done; \
if test -n "$(DOC_MODULE_VERSION)"; then \
mv -f $${installdir}/$(DOC_MODULE).devhelp2 \
$${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp2; \
- mv -f $${installdir}/$(DOC_MODULE).devhelp \
- $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp; \
fi; \
$(GTKDOC_REBASE) --relative --dest-dir=$(DESTDIR) --html-dir=$${installdir}; \
fi
endif
dist-hook: dist-check-gtkdoc dist-hook-local
- mkdir $(distdir)/tmpl
- mkdir $(distdir)/html
- -cp $(srcdir)/tmpl/*.sgml $(distdir)/tmpl
- cp $(srcdir)/html/* $(distdir)/html
- -cp $(srcdir)/$(DOC_MODULE).pdf $(distdir)/
- -cp $(srcdir)/$(DOC_MODULE).types $(distdir)/
- -cp $(srcdir)/$(DOC_MODULE)-sections.txt $(distdir)/
- cd $(distdir) && rm -f $(DISTCLEANFILES)
- $(GTKDOC_REBASE) --online --relative --html-dir=$(distdir)/html
+ @mkdir $(distdir)/tmpl
+ @mkdir $(distdir)/html
+ @-cp ./tmpl/*.sgml $(distdir)/tmpl
+ @cp ./html/* $(distdir)/html
+ @-cp ./$(DOC_MODULE).pdf $(distdir)/
+ @-cp ./$(DOC_MODULE).types $(distdir)/
+ @-cp ./$(DOC_MODULE)-sections.txt $(distdir)/
+ @cd $(distdir) && rm -f $(DISTCLEANFILES)
+ @$(GTKDOC_REBASE) --online --relative --html-dir=$(distdir)/html
.PHONY : dist-hook-local docs
--- /dev/null
+[Unit]
+Description=udev Control Socket
+DefaultDependencies=no
+ConditionCapability=CAP_MKNOD
+
+[Socket]
+Service=udev.service
+ListenSequentialPacket=/run/udev/control
--- /dev/null
+[Unit]
+Description=udev Kernel Socket
+DefaultDependencies=no
+ConditionCapability=CAP_MKNOD
+
+[Socket]
+Service=udev.service
+ReceiveBuffer=134217728
+ListenNetlink=kobject-uevent 1
+++ /dev/null
-[Unit]
-Description=udev Retry Failed Events
-DefaultDependencies=no
-After=local-fs.target udev.service
-Before=basic.target
-
-[Service]
-Type=oneshot
-RemainAfterExit=yes
-ExecStart=@sbindir@/udevadm trigger --type=failed --action=add
+# This service is usually not enabled by default. If enabled, it
+# acts as a barrier for basic.target -- so all later services will
+# wait for udev completely finishing its coldplug run.
+#
+# If needed, to work around broken or non-hotplug-aware services,
+# it might be enabled unconditionally, or pulled-in on-demand by
+# the services that assume a fully populated /dev at startup. It
+# should not be used or pulled-in ever on systems without such
+# legacy services running.
+
[Unit]
Description=udev Wait for Complete Device Initialization
DefaultDependencies=no
-After=udev.service
+Wants=udev.service
+After=udev-trigger.service
Before=basic.target
[Service]
Type=oneshot
+TimeoutSec=180
RemainAfterExit=yes
ExecStart=@sbindir@/udevadm settle
+
+[Install]
+WantedBy=basic.target
--- /dev/null
+[Unit]
+Description=udev Coldplug all Devices
+Wants=udev.service
+After=udev-kernel.socket udev-control.socket
+DefaultDependencies=no
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=@sbindir@/udevadm trigger --type=subsystems --action=add ; @sbindir@/udevadm trigger --type=devices --action=add
[Unit]
Description=udev Kernel Device Manager
-DefaultDependencies=no
+Wants=udev-control.socket udev-kernel.socket
+After=udev-control.socket udev-kernel.socket
Before=basic.target
+DefaultDependencies=no
+ConditionCapability=CAP_MKNOD
[Service]
Type=notify
-ExecStart=@sbindir@/udevd
-ExecStartPost=@sbindir@/udevadm trigger --type=subsystems --action=add ; @sbindir@/udevadm trigger --type=devices --action=add
+OOMScoreAdjust=-1000
+Sockets=udev-control.socket udev-kernel.socket
+Restart=on-failure
+ExecStart=@libexecdir@/udevd
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
GPERF = @GPERF@
GREP = @GREP@
GTKDOC_CHECK = @GTKDOC_CHECK@
+GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@
+GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@
GTKDOC_MKPDF = @GTKDOC_MKPDF@
GTKDOC_REBASE = @GTKDOC_REBASE@
G_IR_COMPILER = @G_IR_COMPILER@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
-LIBUSB_CFLAGS = @LIBUSB_CFLAGS@
-LIBUSB_LIBS = @LIBUSB_LIBS@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
# e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib)
GTKDOC_CFLAGS =
GTKDOC_LIBS =
-@GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_CC = $(CC) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-@GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_CC = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-@GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_LD = $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS)
-@GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_LD = $(LIBTOOL) --tag=CC --mode=link $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS)
+@GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_CC = $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+@GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_CC = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+@GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_LD = $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS)
+@GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_LD = $(LIBTOOL) --tag=CC --mode=link $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS)
@GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_RUN =
@GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_RUN = $(LIBTOOL) --mode=execute
#
GPATH = $(srcdir)
TARGET_DIR = $(HTML_DIR)/$(DOC_MODULE)
+SETUP_FILES = \
+ $(content_files) \
+ $(DOC_MAIN_SGML_FILE) \
+ $(DOC_MODULE)-sections.txt \
+ $(DOC_MODULE)-overrides.txt
+
# This includes the standard gtk-doc make rules, copied by gtkdocize.
# Other files to distribute
# e.g. EXTRA_DIST += version.xml.in
-EXTRA_DIST = $(content_files) $(HTML_IMAGES) $(DOC_MAIN_SGML_FILE) \
- $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt \
- version.xml.in
-DOC_STAMPS = scan-build.stamp tmpl-build.stamp sgml-build.stamp html-build.stamp \
- pdf-build.stamp \
- $(srcdir)/tmpl.stamp $(srcdir)/sgml.stamp $(srcdir)/html.stamp \
- $(srcdir)/pdf.stamp
+EXTRA_DIST = $(HTML_IMAGES) $(SETUP_FILES) version.xml.in
+DOC_STAMPS = setup-build.stamp scan-build.stamp tmpl-build.stamp sgml-build.stamp \
+ html-build.stamp pdf-build.stamp \
+ tmpl.stamp sgml.stamp html.stamp pdf.stamp
SCANOBJ_FILES = \
$(DOC_MODULE).args \
$(REPORT_FILES): sgml-build.stamp
+#### setup ####
+
+setup-build.stamp:
+ -@if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \
+ echo ' DOC Preparing build'; \
+ files=`echo $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types`; \
+ if test "x$$files" != "x" ; then \
+ for file in $$files ; do \
+ test -f $(abs_srcdir)/$$file && \
+ cp -pu $(abs_srcdir)/$$file $(abs_builddir)/ || true; \
+ done; \
+ fi; \
+ test -d $(abs_srcdir)/tmpl && \
+ { cp -rp $(abs_srcdir)/tmpl $(abs_builddir)/; \
+ chmod -R u+w $(abs_builddir)/tmpl; } \
+ fi
+ @touch setup-build.stamp
+
#### scan ####
scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB)
- @echo 'gtk-doc: Scanning header files'
- @-chmod -R u+w $(srcdir)
- @_source_dir='' ; for i in $(DOC_SOURCE_DIR) ; do \
+ @echo ' DOC Scanning header files'
+ @_source_dir='' ; \
+ for i in $(DOC_SOURCE_DIR) ; do \
_source_dir="$${_source_dir} --source-dir=$$i" ; \
- done ; \
- cd $(srcdir) && \
- gtkdoc-scan --module=$(DOC_MODULE) --ignore-headers="$(IGNORE_HFILES)" $${_source_dir} $(SCAN_OPTIONS) $(EXTRA_HFILES)
- @if grep -l '^..*$$' $(srcdir)/$(DOC_MODULE).types > /dev/null 2>&1 ; then \
- CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" gtkdoc-scangobj $(SCANGOBJ_OPTIONS) --module=$(DOC_MODULE) --output-dir=$(srcdir) ; \
+ done ; \
+ gtkdoc-scan --module=$(DOC_MODULE) --ignore-headers="$(IGNORE_HFILES)" $${_source_dir} $(SCAN_OPTIONS) $(EXTRA_HFILES)
+ @if grep -l '^..*$$' $(DOC_MODULE).types > /dev/null 2>&1 ; then \
+ echo " DOC Introspecting gobjects"; \
+ scanobj_options=""; \
+ gtkdoc-scangobj 2>&1 --help | grep >/dev/null "\-\-verbose"; \
+ if test "$(?)" = "0"; then \
+ if test "x$(V)" = "x1"; then \
+ scanobj_options="--verbose"; \
+ fi; \
+ fi; \
+ CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" \
+ gtkdoc-scangobj $(SCANGOBJ_OPTIONS) $$scanobj_options --module=$(DOC_MODULE); \
else \
- cd $(srcdir) ; \
for i in $(SCANOBJ_FILES) ; do \
- test -f $$i || touch $$i ; \
+ test -f $$i || touch $$i ; \
done \
fi
@touch scan-build.stamp
#### templates ####
-tmpl-build.stamp: $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt
- @echo 'gtk-doc: Rebuilding template files'
- @-chmod -R u+w $(srcdir)
- @cd $(srcdir) && gtkdoc-mktmpl --module=$(DOC_MODULE) $(MKTMPL_OPTIONS)
+tmpl-build.stamp: setup-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt
+ @echo ' DOC Rebuilding template files'
+ @gtkdoc-mktmpl --module=$(DOC_MODULE) $(MKTMPL_OPTIONS)
+ @if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \
+ if test -w $(abs_srcdir) ; then \
+ cp -rp $(abs_builddir)/tmpl $(abs_srcdir)/; \
+ fi \
+ fi
@touch tmpl-build.stamp
tmpl.stamp: tmpl-build.stamp
#### xml ####
sgml-build.stamp: tmpl.stamp $(DOC_MODULE)-sections.txt $(srcdir)/tmpl/*.sgml $(expand_content_files)
- @echo 'gtk-doc: Building XML'
+ @echo ' DOC Building XML'
@-chmod -R u+w $(srcdir)
- @_source_dir='' ; for i in $(DOC_SOURCE_DIR) ; do \
+ @_source_dir='' ; \
+ for i in $(DOC_SOURCE_DIR) ; do \
_source_dir="$${_source_dir} --source-dir=$$i" ; \
- done ; \
- cd $(srcdir) && \
- gtkdoc-mkdb --module=$(DOC_MODULE) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $${_source_dir} $(MKDB_OPTIONS)
+ done ; \
+ gtkdoc-mkdb --module=$(DOC_MODULE) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $${_source_dir} $(MKDB_OPTIONS)
@touch sgml-build.stamp
sgml.stamp: sgml-build.stamp
#### html ####
html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files)
- @echo 'gtk-doc: Building HTML'
- @-chmod -R u+w $(srcdir)
- @rm -rf $(srcdir)/html
- @mkdir $(srcdir)/html
+ @echo ' DOC Building HTML'
+ @rm -rf html
+ @mkdir html
@mkhtml_options=""; \
+ gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-verbose"; \
+ if test "$(?)" = "0"; then \
+ if test "x$(V)" = "x1"; then \
+ mkhtml_options="$$mkhtml_options --verbose"; \
+ fi; \
+ fi; \
gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-path"; \
if test "$(?)" = "0"; then \
- mkhtml_options=--path="$(srcdir)"; \
+ mkhtml_options="$$mkhtml_options --path=\"$(abs_srcdir)\""; \
fi; \
- cd $(srcdir)/html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE)
- @test "x$(HTML_IMAGES)" = "x" || ( cd $(srcdir) && cp $(HTML_IMAGES) html )
- @echo 'gtk-doc: Fixing cross-references'
- @cd $(srcdir) && gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS)
+ cd html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE)
+ -@test "x$(HTML_IMAGES)" = "x" || \
+ for file in $(HTML_IMAGES) ; do \
+ if test -f $(abs_srcdir)/$$file ; then \
+ cp $(abs_srcdir)/$$file $(abs_builddir)/html; \
+ fi; \
+ if test -f $(abs_builddir)/$$file ; then \
+ cp $(abs_builddir)/$$file $(abs_builddir)/html; \
+ fi; \
+ done;
+ @echo ' DOC Fixing cross-references'
+ @gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS)
@touch html-build.stamp
#### pdf ####
pdf-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files)
- @echo 'gtk-doc: Building PDF'
- @-chmod -R u+w $(srcdir)
- @rm -rf $(srcdir)/$(DOC_MODULE).pdf
- @mkpdf_imgdirs=""; \
+ @echo ' DOC Building PDF'
+ @rm -f $(DOC_MODULE).pdf
+ @mkpdf_options=""; \
+ gtkdoc-mkpdf 2>&1 --help | grep >/dev/null "\-\-verbose"; \
+ if test "$(?)" = "0"; then \
+ if test "x$(V)" = "x1"; then \
+ mkpdf_options="$$mkpdf_options --verbose"; \
+ fi; \
+ fi; \
if test "x$(HTML_IMAGES)" != "x"; then \
for img in $(HTML_IMAGES); do \
part=`dirname $$img`; \
- echo $$mkpdf_imgdirs | grep >/dev/null "\-\-imgdir=$$part "; \
+ echo $$mkpdf_options | grep >/dev/null "\-\-imgdir=$$part "; \
if test $$? != 0; then \
- mkpdf_imgdirs="$$mkpdf_imgdirs --imgdir=$$part"; \
+ mkpdf_options="$$mkpdf_options --imgdir=$$part"; \
fi; \
done; \
fi; \
- cd $(srcdir) && gtkdoc-mkpdf --path="$(abs_srcdir)" $$mkpdf_imgdirs $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS)
+ gtkdoc-mkpdf --path="$(abs_srcdir)" $$mkpdf_options $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS)
@touch pdf-build.stamp
##############
clean-local:
- rm -f *~ *.bak
- rm -rf .libs
+ @rm -f *~ *.bak
+ @rm -rf .libs
distclean-local:
- cd $(srcdir) && \
- rm -rf xml $(REPORT_FILES) $(DOC_MODULE).pdf \
- $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt
+ @rm -rf xml html $(REPORT_FILES) $(DOC_MODULE).pdf \
+ $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt
+ @if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \
+ rm -f $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types; \
+ rm -rf tmpl; \
+ fi
maintainer-clean-local: clean
- cd $(srcdir) && rm -rf xml html
+ @rm -rf xml html
install-data-local:
- @installfiles=`echo $(srcdir)/html/*`; \
- if test "$$installfiles" = '$(srcdir)/html/*'; \
- then echo '-- Nothing to install' ; \
+ @installfiles=`echo $(builddir)/html/*`; \
+ if test "$$installfiles" = '$(builddir)/html/*'; \
+ then echo 1>&2 'Nothing to install' ; \
else \
if test -n "$(DOC_MODULE_VERSION)"; then \
installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \
fi; \
$(mkinstalldirs) $${installdir} ; \
for i in $$installfiles; do \
- echo '-- Installing '$$i ; \
+ echo ' $(INSTALL_DATA) '$$i ; \
$(INSTALL_DATA) $$i $${installdir}; \
done; \
if test -n "$(DOC_MODULE_VERSION)"; then \
mv -f $${installdir}/$(DOC_MODULE).devhelp2 \
$${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp2; \
- mv -f $${installdir}/$(DOC_MODULE).devhelp \
- $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp; \
fi; \
$(GTKDOC_REBASE) --relative --dest-dir=$(DESTDIR) --html-dir=$${installdir}; \
fi
@ENABLE_GTK_DOC_FALSE@ @false
dist-hook: dist-check-gtkdoc dist-hook-local
- mkdir $(distdir)/tmpl
- mkdir $(distdir)/html
- -cp $(srcdir)/tmpl/*.sgml $(distdir)/tmpl
- cp $(srcdir)/html/* $(distdir)/html
- -cp $(srcdir)/$(DOC_MODULE).pdf $(distdir)/
- -cp $(srcdir)/$(DOC_MODULE).types $(distdir)/
- -cp $(srcdir)/$(DOC_MODULE)-sections.txt $(distdir)/
- cd $(distdir) && rm -f $(DISTCLEANFILES)
- $(GTKDOC_REBASE) --online --relative --html-dir=$(distdir)/html
+ @mkdir $(distdir)/tmpl
+ @mkdir $(distdir)/html
+ @-cp ./tmpl/*.sgml $(distdir)/tmpl
+ @cp ./html/* $(distdir)/html
+ @-cp ./$(DOC_MODULE).pdf $(distdir)/
+ @-cp ./$(DOC_MODULE).types $(distdir)/
+ @-cp ./$(DOC_MODULE)-sections.txt $(distdir)/
+ @cd $(distdir) && rm -f $(DISTCLEANFILES)
+ @$(GTKDOC_REBASE) --online --relative --html-dir=$(distdir)/html
.PHONY : dist-hook-local docs
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>API Index</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="index.html" title="libudev Reference Manual">
<link rel="up" href="index.html" title="libudev Reference Manual">
-<link rel="prev" href="libudev-udev-queue.html" title="udev_queue">
-<meta name="generator" content="GTK-Doc V1.15 (XML mode)">
+<link rel="prev" href="libudev-udev-util.html" title="udev_util">
+<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
-<td><a accesskey="p" href="libudev-udev-queue.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
+<td><a accesskey="p" href="libudev-udev-util.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td> </td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">libudev Reference Manual</th>
<a class="shortcut" href="#idxU">U</a>
</td></tr>
</table>
-<div class="index" title="API Index">
+<div class="index">
<div class="titlepage"><div><div><h2 class="title">
<a name="api-index-full"></a>API Index</h2></div></div></div>
<a name="idx"></a><a name="idx"></a><h3 class="title"></h3>
</dt>
<dd></dd>
<dt>
+<a class="link" href="libudev-udev-device.html#udev-device-get-sysattr-list-entry" title="udev_device_get_sysattr_list_entry ()">udev_device_get_sysattr_list_entry</a>, function in <a class="link" href="libudev-udev-device.html" title="udev_device">udev_device</a>
+</dt>
+<dd></dd>
+<dt>
<a class="link" href="libudev-udev-device.html#udev-device-get-sysattr-value" title="udev_device_get_sysattr_value ()">udev_device_get_sysattr_value</a>, function in <a class="link" href="libudev-udev-device.html" title="udev_device">udev_device</a>
</dt>
<dd></dd>
</dt>
<dd></dd>
<dt>
+<a class="link" href="libudev-udev-device.html#udev-device-has-tag" title="udev_device_has_tag ()">udev_device_has_tag</a>, function in <a class="link" href="libudev-udev-device.html" title="udev_device">udev_device</a>
+</dt>
+<dd></dd>
+<dt>
<a class="link" href="libudev-udev-device.html#udev-device-new-from-devnum" title="udev_device_new_from_devnum ()">udev_device_new_from_devnum</a>, function in <a class="link" href="libudev-udev-device.html" title="udev_device">udev_device</a>
</dt>
<dd></dd>
</dt>
<dd></dd>
<dt>
+<a class="link" href="libudev-udev-enumerate.html#udev-enumerate-add-match-parent" title="udev_enumerate_add_match_parent ()">udev_enumerate_add_match_parent</a>, function in <a class="link" href="libudev-udev-enumerate.html" title="udev_enumerate">udev_enumerate</a>
+</dt>
+<dd></dd>
+<dt>
<a class="link" href="libudev-udev-enumerate.html#udev-enumerate-add-match-property" title="udev_enumerate_add_match_property ()">udev_enumerate_add_match_property</a>, function in <a class="link" href="libudev-udev-enumerate.html" title="udev_enumerate">udev_enumerate</a>
</dt>
<dd></dd>
</dt>
<dd></dd>
<dt>
+<a class="link" href="libudev-udev.html#udev-get-run-path" title="udev_get_run_path ()">udev_get_run_path</a>, function in <a class="link" href="libudev-udev.html" title="udev">udev</a>
+</dt>
+<dd></dd>
+<dt>
<a class="link" href="libudev-udev.html#udev-get-sys-path" title="udev_get_sys_path ()">udev_get_sys_path</a>, function in <a class="link" href="libudev-udev.html" title="udev">udev</a>
</dt>
<dd></dd>
</dt>
<dd></dd>
<dt>
-<a class="link" href="libudev-udev-queue.html#udev-queue-get-failed-list-entry" title="udev_queue_get_failed_list_entry ()">udev_queue_get_failed_list_entry</a>, function in <a class="link" href="libudev-udev-queue.html" title="udev_queue">udev_queue</a>
-</dt>
-<dd></dd>
-<dt>
<a class="link" href="libudev-udev-queue.html#udev-queue-get-kernel-seqnum" title="udev_queue_get_kernel_seqnum ()">udev_queue_get_kernel_seqnum</a>, function in <a class="link" href="libudev-udev-queue.html" title="udev_queue">udev_queue</a>
</dt>
<dd></dd>
<a class="link" href="libudev-udev.html#udev-unref" title="udev_unref ()">udev_unref</a>, function in <a class="link" href="libudev-udev.html" title="udev">udev</a>
</dt>
<dd></dd>
+<dt>
+<a class="link" href="libudev-udev-util.html#udev-util-encode-string" title="udev_util_encode_string ()">udev_util_encode_string</a>, function in <a class="link" href="libudev-udev-util.html" title="udev_util">udev_util</a>
+</dt>
+<dd></dd>
</div>
<div class="footer">
<hr>
- Generated by GTK-Doc V1.15</div>
+ Generated by GTK-Doc V1.18</div>
</body>
</html>
\ No newline at end of file
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>libudev</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="index.html" title="libudev Reference Manual">
<link rel="up" href="index.html" title="libudev Reference Manual">
<link rel="prev" href="index.html" title="libudev Reference Manual">
<link rel="next" href="libudev-udev.html" title="udev">
-<meta name="generator" content="GTK-Doc V1.15 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<th width="100%" align="center">libudev Reference Manual</th>
<td><a accesskey="n" href="libudev-udev.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr></table>
-<div class="chapter" title="libudev">
+<div class="chapter">
<div class="titlepage"><div><div><h2 class="title">
-<a name="id318503"></a>libudev</h2></div></div></div>
+<a name="id572578"></a>libudev</h2></div></div></div>
<div class="toc"><dl>
<dt>
<span class="refentrytitle"><a href="libudev-udev.html">udev</a></span><span class="refpurpose"> — libudev context</span>
<dt>
<span class="refentrytitle"><a href="libudev-udev-queue.html">udev_queue</a></span><span class="refpurpose"> — access to currently active events</span>
</dt>
+<dt>
+<span class="refentrytitle"><a href="libudev-udev-util.html">udev_util</a></span><span class="refpurpose"> — utils</span>
+</dt>
</dl></div>
</div>
<div class="footer">
<hr>
- Generated by GTK-Doc V1.15</div>
+ Generated by GTK-Doc V1.18</div>
</body>
</html>
\ No newline at end of file
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>libudev Reference Manual</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="index.html" title="libudev Reference Manual">
<link rel="next" href="ch01.html" title="libudev">
-<meta name="generator" content="GTK-Doc V1.15 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<div class="book" title="libudev Reference Manual">
+<div class="book">
<div class="titlepage">
<div>
<div><table class="navigation" id="top" width="100%" cellpadding="2" cellspacing="0"><tr><th valign="middle"><p class="title">libudev Reference Manual</p></th></tr></table></div>
-<div><p class="releaseinfo">for libudev version 166
+<div><p class="releaseinfo">for libudev version 174
</p></div>
-<div><p class="copyright">Copyright © 2009-2010 Kay Sievers <kay.sievers@vrfy.org></p></div>
+<div><p class="copyright">Copyright © 2009-2011 Kay Sievers <kay.sievers@vrfy.org></p></div>
</div>
<hr>
</div>
<dt>
<span class="refentrytitle"><a href="libudev-udev-queue.html">udev_queue</a></span><span class="refpurpose"> — access to currently active events</span>
</dt>
+<dt>
+<span class="refentrytitle"><a href="libudev-udev-util.html">udev_util</a></span><span class="refpurpose"> — utils</span>
+</dt>
</dl></dd>
<dt><span class="index"><a href="api-index-full.html">API Index</a></span></dt>
</dl></div>
</div>
<div class="footer">
<hr>
- Generated by GTK-Doc V1.15</div>
+ Generated by GTK-Doc V1.18</div>
</body>
</html>
\ No newline at end of file
<ANCHOR id="udev-set-log-priority" href="libudev/libudev-udev.html#udev-set-log-priority">
<ANCHOR id="udev-get-sys-path" href="libudev/libudev-udev.html#udev-get-sys-path">
<ANCHOR id="udev-get-dev-path" href="libudev/libudev-udev.html#udev-get-dev-path">
+<ANCHOR id="udev-get-run-path" href="libudev/libudev-udev.html#udev-get-run-path">
<ANCHOR id="udev-get-userdata" href="libudev/libudev-udev.html#udev-get-userdata">
<ANCHOR id="udev-set-userdata" href="libudev/libudev-udev.html#udev-set-userdata">
<ANCHOR id="libudev-udev-list" href="libudev/libudev-udev-list.html">
<ANCHOR id="udev-device-get-devnum" href="libudev/libudev-udev-device.html#udev-device-get-devnum">
<ANCHOR id="udev-device-get-action" href="libudev/libudev-udev-device.html#udev-device-get-action">
<ANCHOR id="udev-device-get-sysattr-value" href="libudev/libudev-udev-device.html#udev-device-get-sysattr-value">
+<ANCHOR id="udev-device-get-sysattr-list-entry" href="libudev/libudev-udev-device.html#udev-device-get-sysattr-list-entry">
<ANCHOR id="udev-device-get-seqnum" href="libudev/libudev-udev-device.html#udev-device-get-seqnum">
<ANCHOR id="udev-device-get-usec-since-initialized" href="libudev/libudev-udev-device.html#udev-device-get-usec-since-initialized">
+<ANCHOR id="udev-device-has-tag" href="libudev/libudev-udev-device.html#udev-device-has-tag">
<ANCHOR id="libudev-udev-monitor" href="libudev/libudev-udev-monitor.html">
<ANCHOR id="libudev-udev-monitor.synopsis" href="libudev/libudev-udev-monitor.html#libudev-udev-monitor.synopsis">
<ANCHOR id="libudev-udev-monitor.description" href="libudev/libudev-udev-monitor.html#libudev-udev-monitor.description">
<ANCHOR id="udev-enumerate-add-nomatch-sysattr" href="libudev/libudev-udev-enumerate.html#udev-enumerate-add-nomatch-sysattr">
<ANCHOR id="udev-enumerate-add-match-property" href="libudev/libudev-udev-enumerate.html#udev-enumerate-add-match-property">
<ANCHOR id="udev-enumerate-add-match-tag" href="libudev/libudev-udev-enumerate.html#udev-enumerate-add-match-tag">
+<ANCHOR id="udev-enumerate-add-match-parent" href="libudev/libudev-udev-enumerate.html#udev-enumerate-add-match-parent">
<ANCHOR id="udev-enumerate-add-match-is-initialized" href="libudev/libudev-udev-enumerate.html#udev-enumerate-add-match-is-initialized">
<ANCHOR id="udev-enumerate-add-match-sysname" href="libudev/libudev-udev-enumerate.html#udev-enumerate-add-match-sysname">
<ANCHOR id="udev-enumerate-add-syspath" href="libudev/libudev-udev-enumerate.html#udev-enumerate-add-syspath">
<ANCHOR id="udev-queue-get-seqnum-is-finished" href="libudev/libudev-udev-queue.html#udev-queue-get-seqnum-is-finished">
<ANCHOR id="udev-queue-get-seqnum-sequence-is-finished" href="libudev/libudev-udev-queue.html#udev-queue-get-seqnum-sequence-is-finished">
<ANCHOR id="udev-queue-get-queued-list-entry" href="libudev/libudev-udev-queue.html#udev-queue-get-queued-list-entry">
-<ANCHOR id="udev-queue-get-failed-list-entry" href="libudev/libudev-udev-queue.html#udev-queue-get-failed-list-entry">
<ANCHOR id="udev-queue-get-kernel-seqnum" href="libudev/libudev-udev-queue.html#udev-queue-get-kernel-seqnum">
<ANCHOR id="udev-queue-get-udev-seqnum" href="libudev/libudev-udev-queue.html#udev-queue-get-udev-seqnum">
+<ANCHOR id="libudev-udev-util" href="libudev/libudev-udev-util.html">
+<ANCHOR id="libudev-udev-util.synopsis" href="libudev/libudev-udev-util.html#libudev-udev-util.synopsis">
+<ANCHOR id="libudev-udev-util.description" href="libudev/libudev-udev-util.html#libudev-udev-util.description">
+<ANCHOR id="libudev-udev-util.details" href="libudev/libudev-udev-util.html#libudev-udev-util.details">
+<ANCHOR id="udev-util-encode-string" href="libudev/libudev-udev-util.html#udev-util-encode-string">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>udev_device</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="index.html" title="libudev Reference Manual">
<link rel="up" href="ch01.html" title="libudev">
<link rel="prev" href="libudev-udev-list.html" title="udev_list">
<link rel="next" href="libudev-udev-monitor.html" title="udev_monitor">
-<meta name="generator" content="GTK-Doc V1.15 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<a href="#libudev-udev-device.description" class="shortcut">Description</a>
</td></tr>
</table>
-<div class="refentry" title="udev_device">
+<div class="refentry">
<a name="libudev-udev-device"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
</td>
<td valign="top" align="right"></td>
</tr></table></div>
-<div class="refsynopsisdiv" title="Synopsis">
+<div class="refsynopsisdiv">
<a name="libudev-udev-device.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">struct <a class="link" href="libudev-udev-device.html#udev-device" title="struct udev_device">udev_device</a>;
struct <a class="link" href="libudev-udev-device.html#udev-device" title="struct udev_device"><span class="returnvalue">udev_device</span></a> * <a class="link" href="libudev-udev-device.html#udev-device-ref" title="udev_device_ref ()">udev_device_ref</a> (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>);
const <span class="returnvalue">char</span> * <a class="link" href="libudev-udev-device.html#udev-device-get-action" title="udev_device_get_action ()">udev_device_get_action</a> (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>);
const <span class="returnvalue">char</span> * <a class="link" href="libudev-udev-device.html#udev-device-get-sysattr-value" title="udev_device_get_sysattr_value ()">udev_device_get_sysattr_value</a> (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *sysattr</code></em>);
-unsigned long long <span class="returnvalue">int</span> <a class="link" href="libudev-udev-device.html#udev-device-get-seqnum" title="udev_device_get_seqnum ()">udev_device_get_seqnum</a> (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>);
-unsigned long long <span class="returnvalue">int</span> <a class="link" href="libudev-udev-device.html#udev-device-get-usec-since-initialized" title="udev_device_get_usec_since_initialized ()">udev_device_get_usec_since_initialized</a>
+struct <a class="link" href="libudev-udev-list.html#udev-list-entry" title="struct udev_list_entry"><span class="returnvalue">udev_list_entry</span></a> * <a class="link" href="libudev-udev-device.html#udev-device-get-sysattr-list-entry" title="udev_device_get_sysattr_list_entry ()">udev_device_get_sysattr_list_entry</a>
(<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>);
+unsigned long long <span class="returnvalue">int</span> <a class="link" href="libudev-udev-device.html#udev-device-get-seqnum" title="udev_device_get_seqnum ()">udev_device_get_seqnum</a> (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>);
+unsigned long long <span class="returnvalue">int</span> <a class="link" href="libudev-udev-device.html#udev-device-get-usec-since-initialized" title="udev_device_get_usec_since_initialized ()">udev_device_get_usec_since_initialized</a>
+ (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>);
+<span class="returnvalue">int</span> <a class="link" href="libudev-udev-device.html#udev-device-has-tag" title="udev_device_has_tag ()">udev_device_has_tag</a> (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>,
+ <em class="parameter"><code>const <span class="type">char</span> *tag</code></em>);
</pre>
</div>
-<div class="refsect1" title="Description">
+<div class="refsect1">
<a name="libudev-udev-device.description"></a><h2>Description</h2>
<p>
Representation of kernel sys devices. Devices are uniquely identified
a unique name inside that subsystem.
</p>
</div>
-<div class="refsect1" title="Details">
+<div class="refsect1">
<a name="libudev-udev-device.details"></a><h2>Details</h2>
-<div class="refsect2" title="struct udev_device">
+<div class="refsect2">
<a name="udev-device"></a><h3>struct udev_device</h3>
<pre class="programlisting">struct udev_device;</pre>
<p>
</p>
</div>
<hr>
-<div class="refsect2" title="udev_device_ref ()">
+<div class="refsect2">
<a name="udev-device-ref"></a><h3>udev_device_ref ()</h3>
<pre class="programlisting">struct <a class="link" href="libudev-udev-device.html#udev-device" title="struct udev_device"><span class="returnvalue">udev_device</span></a> * udev_device_ref (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>);</pre>
<p>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>udev_device</code></em> :</span></p></td>
-<td>udev device
-</td>
+<td>udev device</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> the passed udev device
-</td>
+<td>the passed udev device</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_device_unref ()">
+<div class="refsect2">
<a name="udev-device-unref"></a><h3>udev_device_unref ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> udev_device_unref (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>);</pre>
<p>
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>udev_device</code></em> :</span></p></td>
-<td>udev device
-</td>
+<td>udev device</td>
</tr></tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_device_get_udev ()">
+<div class="refsect2">
<a name="udev-device-get-udev"></a><h3>udev_device_get_udev ()</h3>
<pre class="programlisting">struct <a class="link" href="libudev-udev.html#udev" title="struct udev"><span class="returnvalue">udev</span></a> * udev_device_get_udev (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>);</pre>
<p>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>udev_device</code></em> :</span></p></td>
-<td>udev device
-</td>
+<td>udev device</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> the udev library context
-</td>
+<td>the udev library context</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_device_new_from_syspath ()">
+<div class="refsect2">
<a name="udev-device-new-from-syspath"></a><h3>udev_device_new_from_syspath ()</h3>
<pre class="programlisting">struct <a class="link" href="libudev-udev-device.html#udev-device" title="struct udev_device"><span class="returnvalue">udev_device</span></a> * udev_device_new_from_syspath (<em class="parameter"><code><span class="type">struct udev</span> *udev</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *syspath</code></em>);</pre>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>udev</code></em> :</span></p></td>
-<td>udev library context
-</td>
+<td>udev library context</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>syspath</code></em> :</span></p></td>
-<td>sys device path including sys directory
-</td>
+<td>sys device path including sys directory</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> a new udev device, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><span class="type">NULL</span></a>, if it does not exist
-</td>
+<td>a new udev device, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><span class="type">NULL</span></a>, if it does not exist</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_device_new_from_devnum ()">
+<div class="refsect2">
<a name="udev-device-new-from-devnum"></a><h3>udev_device_new_from_devnum ()</h3>
<pre class="programlisting">struct <a class="link" href="libudev-udev-device.html#udev-device" title="struct udev_device"><span class="returnvalue">udev_device</span></a> * udev_device_new_from_devnum (<em class="parameter"><code><span class="type">struct udev</span> *udev</code></em>,
<em class="parameter"><code><span class="type">char</span> type</code></em>,
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>udev</code></em> :</span></p></td>
-<td>udev library context
-</td>
+<td>udev library context</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td>
-<td>char or block device
-</td>
+<td>char or block device</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>devnum</code></em> :</span></p></td>
-<td>device major/minor number
-</td>
+<td>device major/minor number</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> a new udev device, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><span class="type">NULL</span></a>, if it does not exist
-</td>
+<td>a new udev device, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><span class="type">NULL</span></a>, if it does not exist</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_device_new_from_subsystem_sysname ()">
+<div class="refsect2">
<a name="udev-device-new-from-subsystem-sysname"></a><h3>udev_device_new_from_subsystem_sysname ()</h3>
<pre class="programlisting">struct <a class="link" href="libudev-udev-device.html#udev-device" title="struct udev_device"><span class="returnvalue">udev_device</span></a> * udev_device_new_from_subsystem_sysname
(<em class="parameter"><code><span class="type">struct udev</span> *udev</code></em>,
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>udev</code></em> :</span></p></td>
-<td>udev library context
-</td>
+<td>udev library context</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>subsystem</code></em> :</span></p></td>
-<td>the subsystem of the device
-</td>
+<td>the subsystem of the device</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>sysname</code></em> :</span></p></td>
-<td>the name of the device
-</td>
+<td>the name of the device</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> a new udev device, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><span class="type">NULL</span></a>, if it does not exist
-</td>
+<td>a new udev device, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><span class="type">NULL</span></a>, if it does not exist</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_device_new_from_environment ()">
+<div class="refsect2">
<a name="udev-device-new-from-environment"></a><h3>udev_device_new_from_environment ()</h3>
<pre class="programlisting">struct <a class="link" href="libudev-udev-device.html#udev-device" title="struct udev_device"><span class="returnvalue">udev_device</span></a> * udev_device_new_from_environment (<em class="parameter"><code><span class="type">struct udev</span> *udev</code></em>);</pre>
<p>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>udev</code></em> :</span></p></td>
-<td>udev library context
-</td>
+<td>udev library context</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> a new udev device, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><span class="type">NULL</span></a>, if it does not exist
-</td>
+<td>a new udev device, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><span class="type">NULL</span></a>, if it does not exist</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_device_get_parent ()">
+<div class="refsect2">
<a name="udev-device-get-parent"></a><h3>udev_device_get_parent ()</h3>
<pre class="programlisting">struct <a class="link" href="libudev-udev-device.html#udev-device" title="struct udev_device"><span class="returnvalue">udev_device</span></a> * udev_device_get_parent (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>);</pre>
<p>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>udev_device</code></em> :</span></p></td>
-<td>the device to start searching from
-</td>
+<td>the device to start searching from</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> a new udev device, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><span class="type">NULL</span></a>, if it no parent exist.
-</td>
+<td>a new udev device, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><span class="type">NULL</span></a>, if it no parent exist.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_device_get_parent_with_subsystem_devtype ()">
+<div class="refsect2">
<a name="udev-device-get-parent-with-subsystem-devtype"></a><h3>udev_device_get_parent_with_subsystem_devtype ()</h3>
<pre class="programlisting">struct <a class="link" href="libudev-udev-device.html#udev-device" title="struct udev_device"><span class="returnvalue">udev_device</span></a> * udev_device_get_parent_with_subsystem_devtype
(<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>,
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>udev_device</code></em> :</span></p></td>
-<td>udev device to start searching from
-</td>
+<td>udev device to start searching from</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>subsystem</code></em> :</span></p></td>
-<td>the subsystem of the device
-</td>
+<td>the subsystem of the device</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>devtype</code></em> :</span></p></td>
-<td>the type (DEVTYPE) of the device
-</td>
+<td>the type (DEVTYPE) of the device</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> a new udev device, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><span class="type">NULL</span></a> if no matching parent exists.
-</td>
+<td>a new udev device, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><span class="type">NULL</span></a> if no matching parent exists.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_device_get_devpath ()">
+<div class="refsect2">
<a name="udev-device-get-devpath"></a><h3>udev_device_get_devpath ()</h3>
<pre class="programlisting">const <span class="returnvalue">char</span> * udev_device_get_devpath (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>);</pre>
<p>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>udev_device</code></em> :</span></p></td>
-<td>udev device
-</td>
+<td>udev device</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> the devpath of the udev device
-</td>
+<td>the devpath of the udev device</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_device_get_subsystem ()">
+<div class="refsect2">
<a name="udev-device-get-subsystem"></a><h3>udev_device_get_subsystem ()</h3>
<pre class="programlisting">const <span class="returnvalue">char</span> * udev_device_get_subsystem (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>);</pre>
<p>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>udev_device</code></em> :</span></p></td>
-<td>udev device
-</td>
+<td>udev device</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> the subsystem name of the udev device, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><span class="type">NULL</span></a> if it can not be determined
-</td>
+<td>the subsystem name of the udev device, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><span class="type">NULL</span></a> if it can not be determined</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_device_get_devtype ()">
+<div class="refsect2">
<a name="udev-device-get-devtype"></a><h3>udev_device_get_devtype ()</h3>
<pre class="programlisting">const <span class="returnvalue">char</span> * udev_device_get_devtype (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>);</pre>
<p>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>udev_device</code></em> :</span></p></td>
-<td>udev device
-</td>
+<td>udev device</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> the devtype name of the udev device, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><span class="type">NULL</span></a> if it can not be determined
-</td>
+<td>the devtype name of the udev device, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><span class="type">NULL</span></a> if it can not be determined</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_device_get_syspath ()">
+<div class="refsect2">
<a name="udev-device-get-syspath"></a><h3>udev_device_get_syspath ()</h3>
<pre class="programlisting">const <span class="returnvalue">char</span> * udev_device_get_syspath (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>);</pre>
<p>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>udev_device</code></em> :</span></p></td>
-<td>udev device
-</td>
+<td>udev device</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> the sys path of the udev device
-</td>
+<td>the sys path of the udev device</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_device_get_sysname ()">
+<div class="refsect2">
<a name="udev-device-get-sysname"></a><h3>udev_device_get_sysname ()</h3>
<pre class="programlisting">const <span class="returnvalue">char</span> * udev_device_get_sysname (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>);</pre>
<div class="variablelist"><table border="0">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>udev_device</code></em> :</span></p></td>
-<td>udev device
-</td>
+<td>udev device</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> the sys name of the device device
-</td>
+<td>the sys name of the device device</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_device_get_sysnum ()">
+<div class="refsect2">
<a name="udev-device-get-sysnum"></a><h3>udev_device_get_sysnum ()</h3>
<pre class="programlisting">const <span class="returnvalue">char</span> * udev_device_get_sysnum (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>);</pre>
<div class="variablelist"><table border="0">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>udev_device</code></em> :</span></p></td>
-<td>udev device
-</td>
+<td>udev device</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> the trailing number of of the device name
-</td>
+<td>the trailing number of of the device name</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_device_get_devnode ()">
+<div class="refsect2">
<a name="udev-device-get-devnode"></a><h3>udev_device_get_devnode ()</h3>
<pre class="programlisting">const <span class="returnvalue">char</span> * udev_device_get_devnode (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>);</pre>
<p>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>udev_device</code></em> :</span></p></td>
-<td>udev device
-</td>
+<td>udev device</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> the device node file name of the udev device, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><span class="type">NULL</span></a> if no device node exists
-</td>
+<td>the device node file name of the udev device, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><span class="type">NULL</span></a> if no device node exists</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_device_get_is_initialized ()">
+<div class="refsect2">
<a name="udev-device-get-is-initialized"></a><h3>udev_device_get_is_initialized ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span> udev_device_get_is_initialized (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>);</pre>
<p>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>udev_device</code></em> :</span></p></td>
-<td>udev device
-</td>
+<td>udev device</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> 1 if the device is set up. 0 otherwise.
-</td>
+<td>1 if the device is set up. 0 otherwise.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_device_get_devlinks_list_entry ()">
+<div class="refsect2">
<a name="udev-device-get-devlinks-list-entry"></a><h3>udev_device_get_devlinks_list_entry ()</h3>
<pre class="programlisting">struct <a class="link" href="libudev-udev-list.html#udev-list-entry" title="struct udev_list_entry"><span class="returnvalue">udev_list_entry</span></a> * udev_device_get_devlinks_list_entry
(<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>);</pre>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>udev_device</code></em> :</span></p></td>
-<td>udev device
-</td>
+<td>udev device</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> the first entry of the device node link list
-</td>
+<td>the first entry of the device node link list</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_device_get_properties_list_entry ()">
+<div class="refsect2">
<a name="udev-device-get-properties-list-entry"></a><h3>udev_device_get_properties_list_entry ()</h3>
<pre class="programlisting">struct <a class="link" href="libudev-udev-list.html#udev-list-entry" title="struct udev_list_entry"><span class="returnvalue">udev_list_entry</span></a> * udev_device_get_properties_list_entry
(<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>);</pre>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>udev_device</code></em> :</span></p></td>
-<td>udev device
-</td>
+<td>udev device</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> the first entry of the property list
-</td>
+<td>the first entry of the property list</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_device_get_tags_list_entry ()">
+<div class="refsect2">
<a name="udev-device-get-tags-list-entry"></a><h3>udev_device_get_tags_list_entry ()</h3>
<pre class="programlisting">struct <a class="link" href="libudev-udev-list.html#udev-list-entry" title="struct udev_list_entry"><span class="returnvalue">udev_list_entry</span></a> * udev_device_get_tags_list_entry
(<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>);</pre>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>udev_device</code></em> :</span></p></td>
-<td>udev device
-</td>
+<td>udev device</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> the first entry of the tag list
-</td>
+<td>the first entry of the tag list</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_device_get_property_value ()">
+<div class="refsect2">
<a name="udev-device-get-property-value"></a><h3>udev_device_get_property_value ()</h3>
<pre class="programlisting">const <span class="returnvalue">char</span> * udev_device_get_property_value (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *key</code></em>);</pre>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>udev_device</code></em> :</span></p></td>
-<td>udev device
-</td>
+<td>udev device</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>key</code></em> :</span></p></td>
-<td>property name
-</td>
+<td>property name</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> the value of a device property, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><span class="type">NULL</span></a> if there is no such property.
-</td>
+<td>the value of a device property, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><span class="type">NULL</span></a> if there is no such property.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_device_get_driver ()">
+<div class="refsect2">
<a name="udev-device-get-driver"></a><h3>udev_device_get_driver ()</h3>
<pre class="programlisting">const <span class="returnvalue">char</span> * udev_device_get_driver (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>);</pre>
<div class="variablelist"><table border="0">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>udev_device</code></em> :</span></p></td>
-<td>udev device
-</td>
+<td>udev device</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> the driver string, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><span class="type">NULL</span></a> if there is no driver attached.
-</td>
+<td>the driver string, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><span class="type">NULL</span></a> if there is no driver attached.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_device_get_devnum ()">
+<div class="refsect2">
<a name="udev-device-get-devnum"></a><h3>udev_device_get_devnum ()</h3>
<pre class="programlisting"><span class="returnvalue">dev_t</span> udev_device_get_devnum (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>);</pre>
-<p>
-This is only valid if the device was received through a monitor. Devices read from
-sys do not have a sequence number.
-</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>udev_device</code></em> :</span></p></td>
-<td>udev device
-</td>
+<td>udev device</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> the kernel event sequence number, or 0 if there is no sequence number available.
-</td>
+<td>the device major/minor number.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_device_get_action ()">
+<div class="refsect2">
<a name="udev-device-get-action"></a><h3>udev_device_get_action ()</h3>
<pre class="programlisting">const <span class="returnvalue">char</span> * udev_device_get_action (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>);</pre>
<p>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>udev_device</code></em> :</span></p></td>
-<td>udev device
-</td>
+<td>udev device</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> the kernel action value, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><span class="type">NULL</span></a> if there is no action value available.
-</td>
+<td>the kernel action value, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><span class="type">NULL</span></a> if there is no action value available.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_device_get_sysattr_value ()">
+<div class="refsect2">
<a name="udev-device-get-sysattr-value"></a><h3>udev_device_get_sysattr_value ()</h3>
<pre class="programlisting">const <span class="returnvalue">char</span> * udev_device_get_sysattr_value (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *sysattr</code></em>);</pre>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>udev_device</code></em> :</span></p></td>
-<td>udev device
-</td>
+<td>udev device</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>sysattr</code></em> :</span></p></td>
-<td>attribute name
-</td>
+<td>attribute name</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> the content of a sys attribute file, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><span class="type">NULL</span></a> if there is no sys attribute value.
-</td>
+<td>the content of a sys attribute file, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><span class="type">NULL</span></a> if there is no sys attribute value.</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2">
+<a name="udev-device-get-sysattr-list-entry"></a><h3>udev_device_get_sysattr_list_entry ()</h3>
+<pre class="programlisting">struct <a class="link" href="libudev-udev-list.html#udev-list-entry" title="struct udev_list_entry"><span class="returnvalue">udev_list_entry</span></a> * udev_device_get_sysattr_list_entry
+ (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>);</pre>
+<p>
+Retrieve the list of available sysattrs, with value being empty;
+This just return all available sysfs attributes for a particular
+device without reading their values.
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody>
+<tr>
+<td><p><span class="term"><em class="parameter"><code>udev_device</code></em> :</span></p></td>
+<td>udev device</td>
+</tr>
+<tr>
+<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
+<td>the first entry of the property list</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_device_get_seqnum ()">
+<div class="refsect2">
<a name="udev-device-get-seqnum"></a><h3>udev_device_get_seqnum ()</h3>
-<pre class="programlisting">unsigned long long <span class="returnvalue">int</span> udev_device_get_seqnum (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>);</pre>
+<pre class="programlisting">unsigned long long <span class="returnvalue">int</span> udev_device_get_seqnum (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>);</pre>
<p>
+This is only valid if the device was received through a monitor. Devices read from
+sys do not have a sequence number.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>udev_device</code></em> :</span></p></td>
-<td>
-</td>
+<td>udev device</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
+<td>the kernel event sequence number, or 0 if there is no sequence number available.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_device_get_usec_since_initialized ()">
+<div class="refsect2">
<a name="udev-device-get-usec-since-initialized"></a><h3>udev_device_get_usec_since_initialized ()</h3>
-<pre class="programlisting">unsigned long long <span class="returnvalue">int</span> udev_device_get_usec_since_initialized
+<pre class="programlisting">unsigned long long <span class="returnvalue">int</span> udev_device_get_usec_since_initialized
(<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>);</pre>
<p>
Return the number of microseconds passed since udev set up the
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>udev_device</code></em> :</span></p></td>
-<td>udev device
-</td>
+<td>udev device</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> the number of microseconds since the device was first seen.
-</td>
+<td>the number of microseconds since the device was first seen.</td>
</tr>
</tbody>
</table></div>
</div>
+<hr>
+<div class="refsect2">
+<a name="udev-device-has-tag"></a><h3>udev_device_has_tag ()</h3>
+<pre class="programlisting"><span class="returnvalue">int</span> udev_device_has_tag (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>,
+ <em class="parameter"><code>const <span class="type">char</span> *tag</code></em>);</pre>
+<p>
+</p>
+</div>
</div>
</div>
<div class="footer">
<hr>
- Generated by GTK-Doc V1.15</div>
+ Generated by GTK-Doc V1.18</div>
</body>
</html>
\ No newline at end of file
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>udev_enumerate</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="index.html" title="libudev Reference Manual">
<link rel="up" href="ch01.html" title="libudev">
<link rel="prev" href="libudev-udev-monitor.html" title="udev_monitor">
<link rel="next" href="libudev-udev-queue.html" title="udev_queue">
-<meta name="generator" content="GTK-Doc V1.15 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<a href="#libudev-udev-enumerate.description" class="shortcut">Description</a>
</td></tr>
</table>
-<div class="refentry" title="udev_enumerate">
+<div class="refentry">
<a name="libudev-udev-enumerate"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
</td>
<td valign="top" align="right"></td>
</tr></table></div>
-<div class="refsynopsisdiv" title="Synopsis">
+<div class="refsynopsisdiv">
<a name="libudev-udev-enumerate.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">struct <a class="link" href="libudev-udev-enumerate.html#udev-enumerate" title="struct udev_enumerate">udev_enumerate</a>;
struct <a class="link" href="libudev-udev-enumerate.html#udev-enumerate" title="struct udev_enumerate"><span class="returnvalue">udev_enumerate</span></a> * <a class="link" href="libudev-udev-enumerate.html#udev-enumerate-ref" title="udev_enumerate_ref ()">udev_enumerate_ref</a> (<em class="parameter"><code><span class="type">struct udev_enumerate</span> *udev_enumerate</code></em>);
<em class="parameter"><code>const <span class="type">char</span> *value</code></em>);
<span class="returnvalue">int</span> <a class="link" href="libudev-udev-enumerate.html#udev-enumerate-add-match-tag" title="udev_enumerate_add_match_tag ()">udev_enumerate_add_match_tag</a> (<em class="parameter"><code><span class="type">struct udev_enumerate</span> *udev_enumerate</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *tag</code></em>);
+<span class="returnvalue">int</span> <a class="link" href="libudev-udev-enumerate.html#udev-enumerate-add-match-parent" title="udev_enumerate_add_match_parent ()">udev_enumerate_add_match_parent</a> (<em class="parameter"><code><span class="type">struct udev_enumerate</span> *udev_enumerate</code></em>,
+ <em class="parameter"><code><span class="type">struct udev_device</span> *parent</code></em>);
<span class="returnvalue">int</span> <a class="link" href="libudev-udev-enumerate.html#udev-enumerate-add-match-is-initialized" title="udev_enumerate_add_match_is_initialized ()">udev_enumerate_add_match_is_initialized</a>
(<em class="parameter"><code><span class="type">struct udev_enumerate</span> *udev_enumerate</code></em>);
<span class="returnvalue">int</span> <a class="link" href="libudev-udev-enumerate.html#udev-enumerate-add-match-sysname" title="udev_enumerate_add_match_sysname ()">udev_enumerate_add_match_sysname</a> (<em class="parameter"><code><span class="type">struct udev_enumerate</span> *udev_enumerate</code></em>,
struct <a class="link" href="libudev-udev-list.html#udev-list-entry" title="struct udev_list_entry"><span class="returnvalue">udev_list_entry</span></a> * <a class="link" href="libudev-udev-enumerate.html#udev-enumerate-get-list-entry" title="udev_enumerate_get_list_entry ()">udev_enumerate_get_list_entry</a> (<em class="parameter"><code><span class="type">struct udev_enumerate</span> *udev_enumerate</code></em>);
</pre>
</div>
-<div class="refsect1" title="Description">
+<div class="refsect1">
<a name="libudev-udev-enumerate.description"></a><h2>Description</h2>
<p>
Lookup devices in the sys filesystem, filter devices by properties,
and return a sorted list of devices.
</p>
</div>
-<div class="refsect1" title="Details">
+<div class="refsect1">
<a name="libudev-udev-enumerate.details"></a><h2>Details</h2>
-<div class="refsect2" title="struct udev_enumerate">
+<div class="refsect2">
<a name="udev-enumerate"></a><h3>struct udev_enumerate</h3>
<pre class="programlisting">struct udev_enumerate;</pre>
<p>
</p>
</div>
<hr>
-<div class="refsect2" title="udev_enumerate_ref ()">
+<div class="refsect2">
<a name="udev-enumerate-ref"></a><h3>udev_enumerate_ref ()</h3>
<pre class="programlisting">struct <a class="link" href="libudev-udev-enumerate.html#udev-enumerate" title="struct udev_enumerate"><span class="returnvalue">udev_enumerate</span></a> * udev_enumerate_ref (<em class="parameter"><code><span class="type">struct udev_enumerate</span> *udev_enumerate</code></em>);</pre>
<p>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>udev_enumerate</code></em> :</span></p></td>
-<td>context
-</td>
+<td>context</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> the passed enumeration context
-</td>
+<td>the passed enumeration context</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_enumerate_unref ()">
+<div class="refsect2">
<a name="udev-enumerate-unref"></a><h3>udev_enumerate_unref ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> udev_enumerate_unref (<em class="parameter"><code><span class="type">struct udev_enumerate</span> *udev_enumerate</code></em>);</pre>
<p>
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>udev_enumerate</code></em> :</span></p></td>
-<td>context
-</td>
+<td>context</td>
</tr></tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_enumerate_get_udev ()">
+<div class="refsect2">
<a name="udev-enumerate-get-udev"></a><h3>udev_enumerate_get_udev ()</h3>
<pre class="programlisting">struct <a class="link" href="libudev-udev.html#udev" title="struct udev"><span class="returnvalue">udev</span></a> * udev_enumerate_get_udev (<em class="parameter"><code><span class="type">struct udev_enumerate</span> *udev_enumerate</code></em>);</pre>
<div class="variablelist"><table border="0">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>udev_enumerate</code></em> :</span></p></td>
-<td>context
-</td>
+<td>context</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> the udev library context.
-</td>
+<td>the udev library context.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_enumerate_new ()">
+<div class="refsect2">
<a name="udev-enumerate-new"></a><h3>udev_enumerate_new ()</h3>
<pre class="programlisting">struct <a class="link" href="libudev-udev-enumerate.html#udev-enumerate" title="struct udev_enumerate"><span class="returnvalue">udev_enumerate</span></a> * udev_enumerate_new (<em class="parameter"><code><span class="type">struct udev</span> *udev</code></em>);</pre>
<div class="variablelist"><table border="0">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>udev</code></em> :</span></p></td>
-<td>udev library context
-</td>
+<td>udev library context</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> an enumeration context
-</td>
+<td>an enumeration context</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_enumerate_add_match_subsystem ()">
+<div class="refsect2">
<a name="udev-enumerate-add-match-subsystem"></a><h3>udev_enumerate_add_match_subsystem ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span> udev_enumerate_add_match_subsystem (<em class="parameter"><code><span class="type">struct udev_enumerate</span> *udev_enumerate</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *subsystem</code></em>);</pre>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>udev_enumerate</code></em> :</span></p></td>
-<td>context
-</td>
+<td>context</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>subsystem</code></em> :</span></p></td>
-<td>filter for a subsystem of the device to include in the list
-</td>
+<td>filter for a subsystem of the device to include in the list</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> 0 on success, otherwise a negative error value.
-</td>
+<td>0 on success, otherwise a negative error value.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_enumerate_add_nomatch_subsystem ()">
+<div class="refsect2">
<a name="udev-enumerate-add-nomatch-subsystem"></a><h3>udev_enumerate_add_nomatch_subsystem ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span> udev_enumerate_add_nomatch_subsystem
(<em class="parameter"><code><span class="type">struct udev_enumerate</span> *udev_enumerate</code></em>,
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>udev_enumerate</code></em> :</span></p></td>
-<td>context
-</td>
+<td>context</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>subsystem</code></em> :</span></p></td>
-<td>filter for a subsystem of the device to exclude from the list
-</td>
+<td>filter for a subsystem of the device to exclude from the list</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> 0 on success, otherwise a negative error value.
-</td>
+<td>0 on success, otherwise a negative error value.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_enumerate_add_match_sysattr ()">
+<div class="refsect2">
<a name="udev-enumerate-add-match-sysattr"></a><h3>udev_enumerate_add_match_sysattr ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span> udev_enumerate_add_match_sysattr (<em class="parameter"><code><span class="type">struct udev_enumerate</span> *udev_enumerate</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *sysattr</code></em>,
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>udev_enumerate</code></em> :</span></p></td>
-<td>context
-</td>
+<td>context</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>sysattr</code></em> :</span></p></td>
-<td>filter for a sys attribute at the device to include in the list
-</td>
+<td>filter for a sys attribute at the device to include in the list</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
-<td>optional value of the sys attribute
-</td>
+<td>optional value of the sys attribute</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> 0 on success, otherwise a negative error value.
-</td>
+<td>0 on success, otherwise a negative error value.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_enumerate_add_nomatch_sysattr ()">
+<div class="refsect2">
<a name="udev-enumerate-add-nomatch-sysattr"></a><h3>udev_enumerate_add_nomatch_sysattr ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span> udev_enumerate_add_nomatch_sysattr (<em class="parameter"><code><span class="type">struct udev_enumerate</span> *udev_enumerate</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *sysattr</code></em>,
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>udev_enumerate</code></em> :</span></p></td>
-<td>context
-</td>
+<td>context</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>sysattr</code></em> :</span></p></td>
-<td>filter for a sys attribute at the device to exclude from the list
-</td>
+<td>filter for a sys attribute at the device to exclude from the list</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
-<td>optional value of the sys attribute
-</td>
+<td>optional value of the sys attribute</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> 0 on success, otherwise a negative error value.
-</td>
+<td>0 on success, otherwise a negative error value.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_enumerate_add_match_property ()">
+<div class="refsect2">
<a name="udev-enumerate-add-match-property"></a><h3>udev_enumerate_add_match_property ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span> udev_enumerate_add_match_property (<em class="parameter"><code><span class="type">struct udev_enumerate</span> *udev_enumerate</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *property</code></em>,
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>udev_enumerate</code></em> :</span></p></td>
-<td>context
-</td>
+<td>context</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>property</code></em> :</span></p></td>
-<td>filter for a property of the device to include in the list
-</td>
+<td>filter for a property of the device to include in the list</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
-<td>value of the property
-</td>
+<td>value of the property</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> 0 on success, otherwise a negative error value.
-</td>
+<td>0 on success, otherwise a negative error value.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_enumerate_add_match_tag ()">
+<div class="refsect2">
<a name="udev-enumerate-add-match-tag"></a><h3>udev_enumerate_add_match_tag ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span> udev_enumerate_add_match_tag (<em class="parameter"><code><span class="type">struct udev_enumerate</span> *udev_enumerate</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *tag</code></em>);</pre>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>udev_enumerate</code></em> :</span></p></td>
-<td>context
-</td>
+<td>context</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>tag</code></em> :</span></p></td>
-<td>filter for a tag of the device to include in the list
-</td>
+<td>filter for a tag of the device to include in the list</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> 0 on success, otherwise a negative error value.
-</td>
+<td>0 on success, otherwise a negative error value.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_enumerate_add_match_is_initialized ()">
+<div class="refsect2">
+<a name="udev-enumerate-add-match-parent"></a><h3>udev_enumerate_add_match_parent ()</h3>
+<pre class="programlisting"><span class="returnvalue">int</span> udev_enumerate_add_match_parent (<em class="parameter"><code><span class="type">struct udev_enumerate</span> *udev_enumerate</code></em>,
+ <em class="parameter"><code><span class="type">struct udev_device</span> *parent</code></em>);</pre>
+<p>
+Return the devices on the subtree of one given device. The parent
+itself is included in the list.
+</p>
+<p>
+A reference for the device is held until the udev_enumerate context
+is cleaned up.
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody>
+<tr>
+<td><p><span class="term"><em class="parameter"><code>udev_enumerate</code></em> :</span></p></td>
+<td>context</td>
+</tr>
+<tr>
+<td><p><span class="term"><em class="parameter"><code>parent</code></em> :</span></p></td>
+<td>parent device where to start searching</td>
+</tr>
+<tr>
+<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
+<td>0 on success, otherwise a negative error value.</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2">
<a name="udev-enumerate-add-match-is-initialized"></a><h3>udev_enumerate_add_match_is_initialized ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span> udev_enumerate_add_match_is_initialized
(<em class="parameter"><code><span class="type">struct udev_enumerate</span> *udev_enumerate</code></em>);</pre>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>udev_enumerate</code></em> :</span></p></td>
-<td>context
-</td>
+<td>context</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> 0 on success, otherwise a negative error value.
-</td>
+<td>0 on success, otherwise a negative error value.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_enumerate_add_match_sysname ()">
+<div class="refsect2">
<a name="udev-enumerate-add-match-sysname"></a><h3>udev_enumerate_add_match_sysname ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span> udev_enumerate_add_match_sysname (<em class="parameter"><code><span class="type">struct udev_enumerate</span> *udev_enumerate</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *sysname</code></em>);</pre>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>udev_enumerate</code></em> :</span></p></td>
-<td>context
-</td>
+<td>context</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>sysname</code></em> :</span></p></td>
-<td>filter for the name of the device to include in the list
-</td>
+<td>filter for the name of the device to include in the list</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> 0 on success, otherwise a negative error value.
-</td>
+<td>0 on success, otherwise a negative error value.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_enumerate_add_syspath ()">
+<div class="refsect2">
<a name="udev-enumerate-add-syspath"></a><h3>udev_enumerate_add_syspath ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span> udev_enumerate_add_syspath (<em class="parameter"><code><span class="type">struct udev_enumerate</span> *udev_enumerate</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *syspath</code></em>);</pre>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>udev_enumerate</code></em> :</span></p></td>
-<td>context
-</td>
+<td>context</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>syspath</code></em> :</span></p></td>
-<td>path of a device
-</td>
+<td>path of a device</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> 0 on success, otherwise a negative error value.
-</td>
+<td>0 on success, otherwise a negative error value.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_enumerate_scan_devices ()">
+<div class="refsect2">
<a name="udev-enumerate-scan-devices"></a><h3>udev_enumerate_scan_devices ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span> udev_enumerate_scan_devices (<em class="parameter"><code><span class="type">struct udev_enumerate</span> *udev_enumerate</code></em>);</pre>
<div class="variablelist"><table border="0">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>udev_enumerate</code></em> :</span></p></td>
-<td>udev enumeration context
-</td>
+<td>udev enumeration context</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> 0 on success, otherwise a negative error value.
-</td>
+<td>0 on success, otherwise a negative error value.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_enumerate_scan_subsystems ()">
+<div class="refsect2">
<a name="udev-enumerate-scan-subsystems"></a><h3>udev_enumerate_scan_subsystems ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span> udev_enumerate_scan_subsystems (<em class="parameter"><code><span class="type">struct udev_enumerate</span> *udev_enumerate</code></em>);</pre>
<div class="variablelist"><table border="0">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>udev_enumerate</code></em> :</span></p></td>
-<td>udev enumeration context
-</td>
+<td>udev enumeration context</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> 0 on success, otherwise a negative error value.
-</td>
+<td>0 on success, otherwise a negative error value.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_enumerate_get_list_entry ()">
+<div class="refsect2">
<a name="udev-enumerate-get-list-entry"></a><h3>udev_enumerate_get_list_entry ()</h3>
<pre class="programlisting">struct <a class="link" href="libudev-udev-list.html#udev-list-entry" title="struct udev_list_entry"><span class="returnvalue">udev_list_entry</span></a> * udev_enumerate_get_list_entry (<em class="parameter"><code><span class="type">struct udev_enumerate</span> *udev_enumerate</code></em>);</pre>
<div class="variablelist"><table border="0">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>udev_enumerate</code></em> :</span></p></td>
-<td>context
-</td>
+<td>context</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> the first entry of the sorted list of device paths.
-</td>
+<td>the first entry of the sorted list of device paths.</td>
</tr>
</tbody>
</table></div>
</div>
<div class="footer">
<hr>
- Generated by GTK-Doc V1.15</div>
+ Generated by GTK-Doc V1.18</div>
</body>
</html>
\ No newline at end of file
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>udev_list</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="index.html" title="libudev Reference Manual">
<link rel="up" href="ch01.html" title="libudev">
<link rel="prev" href="libudev-udev.html" title="udev">
<link rel="next" href="libudev-udev-device.html" title="udev_device">
-<meta name="generator" content="GTK-Doc V1.15 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<a href="#libudev-udev-list.description" class="shortcut">Description</a>
</td></tr>
</table>
-<div class="refentry" title="udev_list">
+<div class="refentry">
<a name="libudev-udev-list"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
</td>
<td valign="top" align="right"></td>
</tr></table></div>
-<div class="refsynopsisdiv" title="Synopsis">
+<div class="refsynopsisdiv">
<a name="libudev-udev-list.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">struct <a class="link" href="libudev-udev-list.html#udev-list-entry" title="struct udev_list_entry">udev_list_entry</a>;
struct <a class="link" href="libudev-udev-list.html#udev-list-entry" title="struct udev_list_entry"><span class="returnvalue">udev_list_entry</span></a> * <a class="link" href="libudev-udev-list.html#udev-list-entry-get-next" title="udev_list_entry_get_next ()">udev_list_entry_get_next</a> (<em class="parameter"><code><span class="type">struct udev_list_entry</span> *list_entry</code></em>);
first_entry)
</pre>
</div>
-<div class="refsect1" title="Description">
+<div class="refsect1">
<a name="libudev-udev-list.description"></a><h2>Description</h2>
<p>
Libudev list operations.
</p>
</div>
-<div class="refsect1" title="Details">
+<div class="refsect1">
<a name="libudev-udev-list.details"></a><h2>Details</h2>
-<div class="refsect2" title="struct udev_list_entry">
+<div class="refsect2">
<a name="udev-list-entry"></a><h3>struct udev_list_entry</h3>
<pre class="programlisting">struct udev_list_entry;</pre>
<p>
</p>
</div>
<hr>
-<div class="refsect2" title="udev_list_entry_get_next ()">
+<div class="refsect2">
<a name="udev-list-entry-get-next"></a><h3>udev_list_entry_get_next ()</h3>
<pre class="programlisting">struct <a class="link" href="libudev-udev-list.html#udev-list-entry" title="struct udev_list_entry"><span class="returnvalue">udev_list_entry</span></a> * udev_list_entry_get_next (<em class="parameter"><code><span class="type">struct udev_list_entry</span> *list_entry</code></em>);</pre>
<div class="variablelist"><table border="0">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>list_entry</code></em> :</span></p></td>
-<td>current entry
-</td>
+<td>current entry</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> the next entry from the list, <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><span class="type">NULL</span></a> is no more entries are found.
-</td>
+<td>the next entry from the list, <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><span class="type">NULL</span></a> is no more entries are found.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_list_entry_get_by_name ()">
+<div class="refsect2">
<a name="udev-list-entry-get-by-name"></a><h3>udev_list_entry_get_by_name ()</h3>
<pre class="programlisting">struct <a class="link" href="libudev-udev-list.html#udev-list-entry" title="struct udev_list_entry"><span class="returnvalue">udev_list_entry</span></a> * udev_list_entry_get_by_name (<em class="parameter"><code><span class="type">struct udev_list_entry</span> *list_entry</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *name</code></em>);</pre>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>list_entry</code></em> :</span></p></td>
-<td>current entry
-</td>
+<td>current entry</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
-<td>name string to match
-</td>
+<td>name string to match</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> the entry where <em class="parameter"><code>name</code></em> matched, <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><span class="type">NULL</span></a> if no matching entry is found.
-</td>
+<td>the entry where <em class="parameter"><code>name</code></em> matched, <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><span class="type">NULL</span></a> if no matching entry is found.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_list_entry_get_name ()">
+<div class="refsect2">
<a name="udev-list-entry-get-name"></a><h3>udev_list_entry_get_name ()</h3>
<pre class="programlisting">const <span class="returnvalue">char</span> * udev_list_entry_get_name (<em class="parameter"><code><span class="type">struct udev_list_entry</span> *list_entry</code></em>);</pre>
<div class="variablelist"><table border="0">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>list_entry</code></em> :</span></p></td>
-<td>current entry
-</td>
+<td>current entry</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> the name string of this entry.
-</td>
+<td>the name string of this entry.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_list_entry_get_value ()">
+<div class="refsect2">
<a name="udev-list-entry-get-value"></a><h3>udev_list_entry_get_value ()</h3>
<pre class="programlisting">const <span class="returnvalue">char</span> * udev_list_entry_get_value (<em class="parameter"><code><span class="type">struct udev_list_entry</span> *list_entry</code></em>);</pre>
<div class="variablelist"><table border="0">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>list_entry</code></em> :</span></p></td>
-<td>current entry
-</td>
+<td>current entry</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> the value string of this entry.
-</td>
+<td>the value string of this entry.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_list_entry_foreach()">
+<div class="refsect2">
<a name="udev-list-entry-foreach"></a><h3>udev_list_entry_foreach()</h3>
<pre class="programlisting">#define udev_list_entry_foreach(list_entry, first_entry)</pre>
<p>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>list_entry</code></em> :</span></p></td>
-<td>entry to store the current position
-</td>
+<td>entry to store the current position</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>first_entry</code></em> :</span></p></td>
-<td>first entry to start with
-</td>
+<td>first entry to start with</td>
</tr>
</tbody>
</table></div>
</div>
<div class="footer">
<hr>
- Generated by GTK-Doc V1.15</div>
+ Generated by GTK-Doc V1.18</div>
</body>
</html>
\ No newline at end of file
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>udev_monitor</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="index.html" title="libudev Reference Manual">
<link rel="up" href="ch01.html" title="libudev">
<link rel="prev" href="libudev-udev-device.html" title="udev_device">
<link rel="next" href="libudev-udev-enumerate.html" title="udev_enumerate">
-<meta name="generator" content="GTK-Doc V1.15 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<a href="#libudev-udev-monitor.description" class="shortcut">Description</a>
</td></tr>
</table>
-<div class="refentry" title="udev_monitor">
+<div class="refentry">
<a name="libudev-udev-monitor"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
</td>
<td valign="top" align="right"></td>
</tr></table></div>
-<div class="refsynopsisdiv" title="Synopsis">
+<div class="refsynopsisdiv">
<a name="libudev-udev-monitor.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">struct <a class="link" href="libudev-udev-monitor.html#udev-monitor" title="struct udev_monitor">udev_monitor</a>;
struct <a class="link" href="libudev-udev-monitor.html#udev-monitor" title="struct udev_monitor"><span class="returnvalue">udev_monitor</span></a> * <a class="link" href="libudev-udev-monitor.html#udev-monitor-ref" title="udev_monitor_ref ()">udev_monitor_ref</a> (<em class="parameter"><code><span class="type">struct udev_monitor</span> *udev_monitor</code></em>);
<span class="returnvalue">int</span> <a class="link" href="libudev-udev-monitor.html#udev-monitor-filter-remove" title="udev_monitor_filter_remove ()">udev_monitor_filter_remove</a> (<em class="parameter"><code><span class="type">struct udev_monitor</span> *udev_monitor</code></em>);
</pre>
</div>
-<div class="refsect1" title="Description">
+<div class="refsect1">
<a name="libudev-udev-monitor.description"></a><h2>Description</h2>
<p>
Connects to a device event source.
</p>
</div>
-<div class="refsect1" title="Details">
+<div class="refsect1">
<a name="libudev-udev-monitor.details"></a><h2>Details</h2>
-<div class="refsect2" title="struct udev_monitor">
+<div class="refsect2">
<a name="udev-monitor"></a><h3>struct udev_monitor</h3>
<pre class="programlisting">struct udev_monitor;</pre>
<p>
-Opaque object handling one event source.
+Opaque object handling an event source.
</p>
</div>
<hr>
-<div class="refsect2" title="udev_monitor_ref ()">
+<div class="refsect2">
<a name="udev-monitor-ref"></a><h3>udev_monitor_ref ()</h3>
<pre class="programlisting">struct <a class="link" href="libudev-udev-monitor.html#udev-monitor" title="struct udev_monitor"><span class="returnvalue">udev_monitor</span></a> * udev_monitor_ref (<em class="parameter"><code><span class="type">struct udev_monitor</span> *udev_monitor</code></em>);</pre>
<p>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>udev_monitor</code></em> :</span></p></td>
-<td>udev monitor
-</td>
+<td>udev monitor</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> the passed udev monitor
-</td>
+<td>the passed udev monitor</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_monitor_unref ()">
+<div class="refsect2">
<a name="udev-monitor-unref"></a><h3>udev_monitor_unref ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> udev_monitor_unref (<em class="parameter"><code><span class="type">struct udev_monitor</span> *udev_monitor</code></em>);</pre>
<p>
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>udev_monitor</code></em> :</span></p></td>
-<td>udev monitor
-</td>
+<td>udev monitor</td>
</tr></tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_monitor_get_udev ()">
+<div class="refsect2">
<a name="udev-monitor-get-udev"></a><h3>udev_monitor_get_udev ()</h3>
<pre class="programlisting">struct <a class="link" href="libudev-udev.html#udev" title="struct udev"><span class="returnvalue">udev</span></a> * udev_monitor_get_udev (<em class="parameter"><code><span class="type">struct udev_monitor</span> *udev_monitor</code></em>);</pre>
<p>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>udev_monitor</code></em> :</span></p></td>
-<td>udev monitor
-</td>
+<td>udev monitor</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> the udev library context
-</td>
+<td>the udev library context</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_monitor_new_from_netlink ()">
+<div class="refsect2">
<a name="udev-monitor-new-from-netlink"></a><h3>udev_monitor_new_from_netlink ()</h3>
<pre class="programlisting">struct <a class="link" href="libudev-udev-monitor.html#udev-monitor" title="struct udev_monitor"><span class="returnvalue">udev_monitor</span></a> * udev_monitor_new_from_netlink (<em class="parameter"><code><span class="type">struct udev</span> *udev</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *name</code></em>);</pre>
Applications should usually not connect directly to the
"kernel" events, because the devices might not be useable
at that time, before udev has configured them, and created
-device nodes.
-</p>
-<p>
-Accessing devices at the same time as udev, might result
-in unpredictable behavior.
-</p>
-<p>
-The "udev" events are sent out after udev has finished its
-event processing, all rules have been processed, and needed
-device nodes are created.
+device nodes. Accessing devices at the same time as udev,
+might result in unpredictable behavior. The "udev" events
+are sent out after udev has finished its event processing,
+all rules have been processed, and needed device nodes are
+created.
</p>
<p>
The initial refcount is 1, and needs to be decremented to
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>udev</code></em> :</span></p></td>
-<td>udev library context
-</td>
+<td>udev library context</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
-<td>name of event source
-</td>
+<td>name of event source</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> a new udev monitor, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><span class="type">NULL</span></a>, in case of an error
-</td>
+<td>a new udev monitor, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><span class="type">NULL</span></a>, in case of an error</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_monitor_new_from_socket ()">
+<div class="refsect2">
<a name="udev-monitor-new-from-socket"></a><h3>udev_monitor_new_from_socket ()</h3>
<pre class="programlisting">struct <a class="link" href="libudev-udev-monitor.html#udev-monitor" title="struct udev_monitor"><span class="returnvalue">udev_monitor</span></a> * udev_monitor_new_from_socket (<em class="parameter"><code><span class="type">struct udev</span> *udev</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *socket_path</code></em>);</pre>
<p>
-Create new udev monitor and connect to a specified socket. The
+This function should not be used in any new application. The
+kernel's netlink socket multiplexes messages to all interested
+clients. Creating custom sockets from udev to applications
+should be avoided.
+</p>
+<p>
+Create a new udev monitor and connect to a specified socket. The
path to a socket either points to an existing socket file, or if
the socket path starts with a '@' character, an abstract namespace
socket will be used.
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>udev</code></em> :</span></p></td>
-<td>udev library context
-</td>
+<td>udev library context</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>socket_path</code></em> :</span></p></td>
-<td>unix socket path
-</td>
+<td>unix socket path</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> a new udev monitor, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><span class="type">NULL</span></a>, in case of an error
-</td>
+<td>a new udev monitor, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><span class="type">NULL</span></a>, in case of an error</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_monitor_enable_receiving ()">
+<div class="refsect2">
<a name="udev-monitor-enable-receiving"></a><h3>udev_monitor_enable_receiving ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span> udev_monitor_enable_receiving (<em class="parameter"><code><span class="type">struct udev_monitor</span> *udev_monitor</code></em>);</pre>
<p>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>udev_monitor</code></em> :</span></p></td>
-<td>the monitor which should receive events
-</td>
+<td>the monitor which should receive events</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> 0 on success, otherwise a negative error value.
-</td>
+<td>0 on success, otherwise a negative error value.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_monitor_set_receive_buffer_size ()">
+<div class="refsect2">
<a name="udev-monitor-set-receive-buffer-size"></a><h3>udev_monitor_set_receive_buffer_size ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span> udev_monitor_set_receive_buffer_size
(<em class="parameter"><code><span class="type">struct udev_monitor</span> *udev_monitor</code></em>,
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>udev_monitor</code></em> :</span></p></td>
-<td>the monitor which should receive events
-</td>
+<td>the monitor which should receive events</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>size</code></em> :</span></p></td>
-<td>the size in bytes
-</td>
+<td>the size in bytes</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> 0 on success, otherwise -1 on error.
-</td>
+<td>0 on success, otherwise -1 on error.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_monitor_get_fd ()">
+<div class="refsect2">
<a name="udev-monitor-get-fd"></a><h3>udev_monitor_get_fd ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span> udev_monitor_get_fd (<em class="parameter"><code><span class="type">struct udev_monitor</span> *udev_monitor</code></em>);</pre>
<p>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>udev_monitor</code></em> :</span></p></td>
-<td>udev monitor
-</td>
+<td>udev monitor</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> the socket file descriptor
-</td>
+<td>the socket file descriptor</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_monitor_receive_device ()">
+<div class="refsect2">
<a name="udev-monitor-receive-device"></a><h3>udev_monitor_receive_device ()</h3>
<pre class="programlisting">struct <a class="link" href="libudev-udev-device.html#udev-device" title="struct udev_device"><span class="returnvalue">udev_device</span></a> * udev_monitor_receive_device (<em class="parameter"><code><span class="type">struct udev_monitor</span> *udev_monitor</code></em>);</pre>
<p>
device, fill in the received data, and return the device.
</p>
<p>
-Only socket connections with uid=0 are accepted. The caller
-needs to make sure that there is data to read from the socket.
-The call will block until the socket becomes readable.
+Only socket connections with uid=0 are accepted.
</p>
<p>
The initial refcount is 1, and needs to be decremented to
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>udev_monitor</code></em> :</span></p></td>
-<td>udev monitor
-</td>
+<td>udev monitor</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> a new udev device, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><span class="type">NULL</span></a>, in case of an error
-</td>
+<td>a new udev device, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><span class="type">NULL</span></a>, in case of an error</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_monitor_filter_add_match_subsystem_devtype ()">
+<div class="refsect2">
<a name="udev-monitor-filter-add-match-subsystem-devtype"></a><h3>udev_monitor_filter_add_match_subsystem_devtype ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span> udev_monitor_filter_add_match_subsystem_devtype
(<em class="parameter"><code><span class="type">struct udev_monitor</span> *udev_monitor</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *subsystem</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *devtype</code></em>);</pre>
<p>
-This filer is efficiently executed inside the kernel, and libudev subscribers
+This filter is efficiently executed inside the kernel, and libudev subscribers
will usually not be woken up for devices which do not match.
</p>
<p>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>udev_monitor</code></em> :</span></p></td>
-<td>the monitor
-</td>
+<td>the monitor</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>subsystem</code></em> :</span></p></td>
-<td>the subsystem value to match the incoming devices against
-</td>
+<td>the subsystem value to match the incoming devices against</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>devtype</code></em> :</span></p></td>
-<td>the devtype value to match the incoming devices against
-</td>
+<td>the devtype value to match the incoming devices against</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> 0 on success, otherwise a negative error value.
-</td>
+<td>0 on success, otherwise a negative error value.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_monitor_filter_add_match_tag ()">
+<div class="refsect2">
<a name="udev-monitor-filter-add-match-tag"></a><h3>udev_monitor_filter_add_match_tag ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span> udev_monitor_filter_add_match_tag (<em class="parameter"><code><span class="type">struct udev_monitor</span> *udev_monitor</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *tag</code></em>);</pre>
<p>
-This filer is efficiently executed inside the kernel, and libudev subscribers
+This filter is efficiently executed inside the kernel, and libudev subscribers
will usually not be woken up for devices which do not match.
</p>
<p>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>udev_monitor</code></em> :</span></p></td>
-<td>the monitor
-</td>
+<td>the monitor</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>tag</code></em> :</span></p></td>
-<td>the name of a tag
-</td>
+<td>the name of a tag</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> 0 on success, otherwise a negative error value.
-</td>
+<td>0 on success, otherwise a negative error value.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_monitor_filter_update ()">
+<div class="refsect2">
<a name="udev-monitor-filter-update"></a><h3>udev_monitor_filter_update ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span> udev_monitor_filter_update (<em class="parameter"><code><span class="type">struct udev_monitor</span> *udev_monitor</code></em>);</pre>
<p>
-Update the installed filter. This might only be needed, if the filter was removed or changed.
+Update the installed socket filter. This is only needed,
+if the filter was removed or changed.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>udev_monitor</code></em> :</span></p></td>
-<td>monitor
-</td>
+<td>monitor</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> 0 on success, otherwise a negative error value.
-</td>
+<td>0 on success, otherwise a negative error value.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_monitor_filter_remove ()">
+<div class="refsect2">
<a name="udev-monitor-filter-remove"></a><h3>udev_monitor_filter_remove ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span> udev_monitor_filter_remove (<em class="parameter"><code><span class="type">struct udev_monitor</span> *udev_monitor</code></em>);</pre>
<p>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>udev_monitor</code></em> :</span></p></td>
-<td>monitor
-</td>
+<td>monitor</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> 0 on success, otherwise a negative error value.
-</td>
+<td>0 on success, otherwise a negative error value.</td>
</tr>
</tbody>
</table></div>
</div>
<div class="footer">
<hr>
- Generated by GTK-Doc V1.15</div>
+ Generated by GTK-Doc V1.18</div>
</body>
</html>
\ No newline at end of file
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>udev_queue</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="index.html" title="libudev Reference Manual">
<link rel="up" href="ch01.html" title="libudev">
<link rel="prev" href="libudev-udev-enumerate.html" title="udev_enumerate">
-<link rel="next" href="api-index-full.html" title="API Index">
-<meta name="generator" content="GTK-Doc V1.15 (XML mode)">
+<link rel="next" href="libudev-udev-util.html" title="udev_util">
+<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<td><a accesskey="u" href="ch01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">libudev Reference Manual</th>
-<td><a accesskey="n" href="api-index-full.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
+<td><a accesskey="n" href="libudev-udev-util.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#libudev-udev-queue.synopsis" class="shortcut">Top</a>
<a href="#libudev-udev-queue.description" class="shortcut">Description</a>
</td></tr>
</table>
-<div class="refentry" title="udev_queue">
+<div class="refentry">
<a name="libudev-udev-queue"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
</td>
<td valign="top" align="right"></td>
</tr></table></div>
-<div class="refsynopsisdiv" title="Synopsis">
+<div class="refsynopsisdiv">
<a name="libudev-udev-queue.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">struct <a class="link" href="libudev-udev-queue.html#udev-queue" title="struct udev_queue">udev_queue</a>;
struct <a class="link" href="libudev-udev-queue.html#udev-queue" title="struct udev_queue"><span class="returnvalue">udev_queue</span></a> * <a class="link" href="libudev-udev-queue.html#udev-queue-ref" title="udev_queue_ref ()">udev_queue_ref</a> (<em class="parameter"><code><span class="type">struct udev_queue</span> *udev_queue</code></em>);
<span class="returnvalue">int</span> <a class="link" href="libudev-udev-queue.html#udev-queue-get-udev-is-active" title="udev_queue_get_udev_is_active ()">udev_queue_get_udev_is_active</a> (<em class="parameter"><code><span class="type">struct udev_queue</span> *udev_queue</code></em>);
<span class="returnvalue">int</span> <a class="link" href="libudev-udev-queue.html#udev-queue-get-queue-is-empty" title="udev_queue_get_queue_is_empty ()">udev_queue_get_queue_is_empty</a> (<em class="parameter"><code><span class="type">struct udev_queue</span> *udev_queue</code></em>);
<span class="returnvalue">int</span> <a class="link" href="libudev-udev-queue.html#udev-queue-get-seqnum-is-finished" title="udev_queue_get_seqnum_is_finished ()">udev_queue_get_seqnum_is_finished</a> (<em class="parameter"><code><span class="type">struct udev_queue</span> *udev_queue</code></em>,
- <em class="parameter"><code>long <span class="type">int</span> seqnum</code></em>);
+ <em class="parameter"><code>unsigned long long <span class="type">int</span> seqnum</code></em>);
<span class="returnvalue">int</span> <a class="link" href="libudev-udev-queue.html#udev-queue-get-seqnum-sequence-is-finished" title="udev_queue_get_seqnum_sequence_is_finished ()">udev_queue_get_seqnum_sequence_is_finished</a>
(<em class="parameter"><code><span class="type">struct udev_queue</span> *udev_queue</code></em>,
- <em class="parameter"><code>long <span class="type">int</span> start</code></em>,
- <em class="parameter"><code>long <span class="type">int</span> end</code></em>);
+ <em class="parameter"><code>unsigned long long <span class="type">int</span> start</code></em>,
+ <em class="parameter"><code>unsigned long long <span class="type">int</span> end</code></em>);
struct <a class="link" href="libudev-udev-list.html#udev-list-entry" title="struct udev_list_entry"><span class="returnvalue">udev_list_entry</span></a> * <a class="link" href="libudev-udev-queue.html#udev-queue-get-queued-list-entry" title="udev_queue_get_queued_list_entry ()">udev_queue_get_queued_list_entry</a>
(<em class="parameter"><code><span class="type">struct udev_queue</span> *udev_queue</code></em>);
-struct <a class="link" href="libudev-udev-list.html#udev-list-entry" title="struct udev_list_entry"><span class="returnvalue">udev_list_entry</span></a> * <a class="link" href="libudev-udev-queue.html#udev-queue-get-failed-list-entry" title="udev_queue_get_failed_list_entry ()">udev_queue_get_failed_list_entry</a>
- (<em class="parameter"><code><span class="type">struct udev_queue</span> *udev_queue</code></em>);
-unsigned long long <span class="returnvalue">int</span> <a class="link" href="libudev-udev-queue.html#udev-queue-get-kernel-seqnum" title="udev_queue_get_kernel_seqnum ()">udev_queue_get_kernel_seqnum</a> (<em class="parameter"><code><span class="type">struct udev_queue</span> *udev_queue</code></em>);
-unsigned long long <span class="returnvalue">int</span> <a class="link" href="libudev-udev-queue.html#udev-queue-get-udev-seqnum" title="udev_queue_get_udev_seqnum ()">udev_queue_get_udev_seqnum</a> (<em class="parameter"><code><span class="type">struct udev_queue</span> *udev_queue</code></em>);
+unsigned long long <span class="returnvalue">int</span> <a class="link" href="libudev-udev-queue.html#udev-queue-get-kernel-seqnum" title="udev_queue_get_kernel_seqnum ()">udev_queue_get_kernel_seqnum</a> (<em class="parameter"><code><span class="type">struct udev_queue</span> *udev_queue</code></em>);
+unsigned long long <span class="returnvalue">int</span> <a class="link" href="libudev-udev-queue.html#udev-queue-get-udev-seqnum" title="udev_queue_get_udev_seqnum ()">udev_queue_get_udev_seqnum</a> (<em class="parameter"><code><span class="type">struct udev_queue</span> *udev_queue</code></em>);
</pre>
</div>
-<div class="refsect1" title="Description">
+<div class="refsect1">
<a name="libudev-udev-queue.description"></a><h2>Description</h2>
<p>
The udev daemon processes events asynchronously. All events which do not have
and the udev daemon.
</p>
</div>
-<div class="refsect1" title="Details">
+<div class="refsect1">
<a name="libudev-udev-queue.details"></a><h2>Details</h2>
-<div class="refsect2" title="struct udev_queue">
+<div class="refsect2">
<a name="udev-queue"></a><h3>struct udev_queue</h3>
<pre class="programlisting">struct udev_queue;</pre>
<p>
</p>
</div>
<hr>
-<div class="refsect2" title="udev_queue_ref ()">
+<div class="refsect2">
<a name="udev-queue-ref"></a><h3>udev_queue_ref ()</h3>
<pre class="programlisting">struct <a class="link" href="libudev-udev-queue.html#udev-queue" title="struct udev_queue"><span class="returnvalue">udev_queue</span></a> * udev_queue_ref (<em class="parameter"><code><span class="type">struct udev_queue</span> *udev_queue</code></em>);</pre>
<p>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>udev_queue</code></em> :</span></p></td>
-<td>udev queue context
-</td>
+<td>udev queue context</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> the same udev queue context.
-</td>
+<td>the same udev queue context.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_queue_unref ()">
+<div class="refsect2">
<a name="udev-queue-unref"></a><h3>udev_queue_unref ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> udev_queue_unref (<em class="parameter"><code><span class="type">struct udev_queue</span> *udev_queue</code></em>);</pre>
<p>
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>udev_queue</code></em> :</span></p></td>
-<td>udev queue context
-</td>
+<td>udev queue context</td>
</tr></tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_queue_get_udev ()">
+<div class="refsect2">
<a name="udev-queue-get-udev"></a><h3>udev_queue_get_udev ()</h3>
<pre class="programlisting">struct <a class="link" href="libudev-udev.html#udev" title="struct udev"><span class="returnvalue">udev</span></a> * udev_queue_get_udev (<em class="parameter"><code><span class="type">struct udev_queue</span> *udev_queue</code></em>);</pre>
<p>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>udev_queue</code></em> :</span></p></td>
-<td>udev queue context
-</td>
+<td>udev queue context</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> the udev library context.
-</td>
+<td>the udev library context.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_queue_new ()">
+<div class="refsect2">
<a name="udev-queue-new"></a><h3>udev_queue_new ()</h3>
<pre class="programlisting">struct <a class="link" href="libudev-udev-queue.html#udev-queue" title="struct udev_queue"><span class="returnvalue">udev_queue</span></a> * udev_queue_new (<em class="parameter"><code><span class="type">struct udev</span> *udev</code></em>);</pre>
<p>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>udev</code></em> :</span></p></td>
-<td>udev library context
-</td>
+<td>udev library context</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> the udev queue context, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><span class="type">NULL</span></a> on error.
-</td>
+<td>the udev queue context, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><span class="type">NULL</span></a> on error.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_queue_get_udev_is_active ()">
+<div class="refsect2">
<a name="udev-queue-get-udev-is-active"></a><h3>udev_queue_get_udev_is_active ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span> udev_queue_get_udev_is_active (<em class="parameter"><code><span class="type">struct udev_queue</span> *udev_queue</code></em>);</pre>
<div class="variablelist"><table border="0">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>udev_queue</code></em> :</span></p></td>
-<td>udev queue context
-</td>
+<td>udev queue context</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> a flag indicating if udev is active.
-</td>
+<td>a flag indicating if udev is active.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_queue_get_queue_is_empty ()">
+<div class="refsect2">
<a name="udev-queue-get-queue-is-empty"></a><h3>udev_queue_get_queue_is_empty ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span> udev_queue_get_queue_is_empty (<em class="parameter"><code><span class="type">struct udev_queue</span> *udev_queue</code></em>);</pre>
<div class="variablelist"><table border="0">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>udev_queue</code></em> :</span></p></td>
-<td>udev queue context
-</td>
+<td>udev queue context</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> a flag indicating if udev is currently handling events.
-</td>
+<td>a flag indicating if udev is currently handling events.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_queue_get_seqnum_is_finished ()">
+<div class="refsect2">
<a name="udev-queue-get-seqnum-is-finished"></a><h3>udev_queue_get_seqnum_is_finished ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span> udev_queue_get_seqnum_is_finished (<em class="parameter"><code><span class="type">struct udev_queue</span> *udev_queue</code></em>,
- <em class="parameter"><code>long <span class="type">int</span> seqnum</code></em>);</pre>
+ <em class="parameter"><code>unsigned long long <span class="type">int</span> seqnum</code></em>);</pre>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>udev_queue</code></em> :</span></p></td>
-<td>udev queue context
-</td>
+<td>udev queue context</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>seqnum</code></em> :</span></p></td>
-<td>sequence number
-</td>
+<td>sequence number</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> a flag indicating if the given sequence number is handled.
-</td>
+<td>a flag indicating if the given sequence number is currently active.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_queue_get_seqnum_sequence_is_finished ()">
+<div class="refsect2">
<a name="udev-queue-get-seqnum-sequence-is-finished"></a><h3>udev_queue_get_seqnum_sequence_is_finished ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span> udev_queue_get_seqnum_sequence_is_finished
(<em class="parameter"><code><span class="type">struct udev_queue</span> *udev_queue</code></em>,
- <em class="parameter"><code>long <span class="type">int</span> start</code></em>,
- <em class="parameter"><code>long <span class="type">int</span> end</code></em>);</pre>
+ <em class="parameter"><code>unsigned long long <span class="type">int</span> start</code></em>,
+ <em class="parameter"><code>unsigned long long <span class="type">int</span> end</code></em>);</pre>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>udev_queue</code></em> :</span></p></td>
-<td>udev queue context
-</td>
+<td>udev queue context</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>start</code></em> :</span></p></td>
-<td>first event sequence number
-</td>
+<td>first event sequence number</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>end</code></em> :</span></p></td>
-<td>last event sequence number
-</td>
+<td>last event sequence number</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> if any of the sequence numbers in the given range is currently active.
-</td>
+<td>a flag indicating if any of the sequence numbers in the given range is currently active.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_queue_get_queued_list_entry ()">
+<div class="refsect2">
<a name="udev-queue-get-queued-list-entry"></a><h3>udev_queue_get_queued_list_entry ()</h3>
<pre class="programlisting">struct <a class="link" href="libudev-udev-list.html#udev-list-entry" title="struct udev_list_entry"><span class="returnvalue">udev_list_entry</span></a> * udev_queue_get_queued_list_entry
(<em class="parameter"><code><span class="type">struct udev_queue</span> *udev_queue</code></em>);</pre>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>udev_queue</code></em> :</span></p></td>
-<td>udev queue context
-</td>
+<td>udev queue context</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> the first entry of the list of queued events.
-</td>
+<td>the first entry of the list of queued events.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_queue_get_failed_list_entry ()">
-<a name="udev-queue-get-failed-list-entry"></a><h3>udev_queue_get_failed_list_entry ()</h3>
-<pre class="programlisting">struct <a class="link" href="libudev-udev-list.html#udev-list-entry" title="struct udev_list_entry"><span class="returnvalue">udev_list_entry</span></a> * udev_queue_get_failed_list_entry
- (<em class="parameter"><code><span class="type">struct udev_queue</span> *udev_queue</code></em>);</pre>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>udev_queue</code></em> :</span></p></td>
-<td>udev queue context
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> the first entry of the list of recorded failed events.
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="udev_queue_get_kernel_seqnum ()">
+<div class="refsect2">
<a name="udev-queue-get-kernel-seqnum"></a><h3>udev_queue_get_kernel_seqnum ()</h3>
-<pre class="programlisting">unsigned long long <span class="returnvalue">int</span> udev_queue_get_kernel_seqnum (<em class="parameter"><code><span class="type">struct udev_queue</span> *udev_queue</code></em>);</pre>
+<pre class="programlisting">unsigned long long <span class="returnvalue">int</span> udev_queue_get_kernel_seqnum (<em class="parameter"><code><span class="type">struct udev_queue</span> *udev_queue</code></em>);</pre>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>udev_queue</code></em> :</span></p></td>
-<td>udev queue context
-</td>
+<td>udev queue context</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> the current kernel event sequence number.
-</td>
+<td>the current kernel event sequence number.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_queue_get_udev_seqnum ()">
+<div class="refsect2">
<a name="udev-queue-get-udev-seqnum"></a><h3>udev_queue_get_udev_seqnum ()</h3>
-<pre class="programlisting">unsigned long long <span class="returnvalue">int</span> udev_queue_get_udev_seqnum (<em class="parameter"><code><span class="type">struct udev_queue</span> *udev_queue</code></em>);</pre>
+<pre class="programlisting">unsigned long long <span class="returnvalue">int</span> udev_queue_get_udev_seqnum (<em class="parameter"><code><span class="type">struct udev_queue</span> *udev_queue</code></em>);</pre>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>udev_queue</code></em> :</span></p></td>
-<td>udev queue context
-</td>
+<td>udev queue context</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> the last known udev event sequence number.
-</td>
+<td>the last known udev event sequence number.</td>
</tr>
</tbody>
</table></div>
</div>
<div class="footer">
<hr>
- Generated by GTK-Doc V1.15</div>
+ Generated by GTK-Doc V1.18</div>
</body>
</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>udev_util</title>
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="index.html" title="libudev Reference Manual">
+<link rel="up" href="ch01.html" title="libudev">
+<link rel="prev" href="libudev-udev-queue.html" title="udev_queue">
+<link rel="next" href="api-index-full.html" title="API Index">
+<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
+<link rel="stylesheet" href="style.css" type="text/css">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
+<tr valign="middle">
+<td><a accesskey="p" href="libudev-udev-queue.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
+<td><a accesskey="u" href="ch01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
+<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
+<th width="100%" align="center">libudev Reference Manual</th>
+<td><a accesskey="n" href="api-index-full.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
+</tr>
+<tr><td colspan="5" class="shortcuts">
+<a href="#libudev-udev-util.synopsis" class="shortcut">Top</a>
+ |
+ <a href="#libudev-udev-util.description" class="shortcut">Description</a>
+</td></tr>
+</table>
+<div class="refentry">
+<a name="libudev-udev-util"></a><div class="titlepage"></div>
+<div class="refnamediv"><table width="100%"><tr>
+<td valign="top">
+<h2><span class="refentrytitle"><a name="libudev-udev-util.top_of_page"></a>udev_util</span></h2>
+<p>udev_util — utils</p>
+</td>
+<td valign="top" align="right"></td>
+</tr></table></div>
+<div class="refsynopsisdiv">
+<a name="libudev-udev-util.synopsis"></a><h2>Synopsis</h2>
+<pre class="synopsis"><span class="returnvalue">int</span> <a class="link" href="libudev-udev-util.html#udev-util-encode-string" title="udev_util_encode_string ()">udev_util_encode_string</a> (<em class="parameter"><code>const <span class="type">char</span> *str</code></em>,
+ <em class="parameter"><code><span class="type">char</span> *str_enc</code></em>,
+ <em class="parameter"><code><span class="type">size_t</span> len</code></em>);
+</pre>
+</div>
+<div class="refsect1">
+<a name="libudev-udev-util.description"></a><h2>Description</h2>
+</div>
+<div class="refsect1">
+<a name="libudev-udev-util.details"></a><h2>Details</h2>
+<div class="refsect2">
+<a name="udev-util-encode-string"></a><h3>udev_util_encode_string ()</h3>
+<pre class="programlisting"><span class="returnvalue">int</span> udev_util_encode_string (<em class="parameter"><code>const <span class="type">char</span> *str</code></em>,
+ <em class="parameter"><code><span class="type">char</span> *str_enc</code></em>,
+ <em class="parameter"><code><span class="type">size_t</span> len</code></em>);</pre>
+<p>
+Encode all potentially unsafe characters of a string to the
+corresponding 2 char hex value prefixed by '\x'.
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody>
+<tr>
+<td><p><span class="term"><em class="parameter"><code>str</code></em> :</span></p></td>
+<td>input string to be encoded</td>
+</tr>
+<tr>
+<td><p><span class="term"><em class="parameter"><code>str_enc</code></em> :</span></p></td>
+<td>output string to store the encoded input string</td>
+</tr>
+<tr>
+<td><p><span class="term"><em class="parameter"><code>len</code></em> :</span></p></td>
+<td>maximum size of the output string, which may be
+four times as long as the input string</td>
+</tr>
+<tr>
+<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
+<td>0 if the entire string was copied, non-zero otherwise.</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+</div>
+</div>
+<div class="footer">
+<hr>
+ Generated by GTK-Doc V1.18</div>
+</body>
+</html>
\ No newline at end of file
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>udev</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="index.html" title="libudev Reference Manual">
<link rel="up" href="ch01.html" title="libudev">
<link rel="prev" href="ch01.html" title="libudev">
<link rel="next" href="libudev-udev-list.html" title="udev_list">
-<meta name="generator" content="GTK-Doc V1.15 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<a href="#libudev-udev.description" class="shortcut">Description</a>
</td></tr>
</table>
-<div class="refentry" title="udev">
+<div class="refentry">
<a name="libudev-udev"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
</td>
<td valign="top" align="right"></td>
</tr></table></div>
-<div class="refsynopsisdiv" title="Synopsis">
+<div class="refsynopsisdiv">
<a name="libudev-udev.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">struct <a class="link" href="libudev-udev.html#udev" title="struct udev">udev</a>;
struct <a class="link" href="libudev-udev.html#udev" title="struct udev"><span class="returnvalue">udev</span></a> * <a class="link" href="libudev-udev.html#udev-ref" title="udev_ref ()">udev_ref</a> (<em class="parameter"><code><span class="type">struct udev</span> *udev</code></em>);
<span class="returnvalue">void</span> <a class="link" href="libudev-udev.html#udev-unref" title="udev_unref ()">udev_unref</a> (<em class="parameter"><code><span class="type">struct udev</span> *udev</code></em>);
struct <a class="link" href="libudev-udev.html#udev" title="struct udev"><span class="returnvalue">udev</span></a> * <a class="link" href="libudev-udev.html#udev-new" title="udev_new ()">udev_new</a> (<em class="parameter"><code><span class="type">void</span></code></em>);
<span class="returnvalue">void</span> <a class="link" href="libudev-udev.html#udev-set-log-fn" title="udev_set_log_fn ()">udev_set_log_fn</a> (<em class="parameter"><code><span class="type">struct udev</span> *udev</code></em>,
- <em class="parameter"><code><span class="type">void</span> (log_fnstruct udev *udev, int priority, const char *file, int line, const char *fn, const char *format, va_list args) ()</code></em>);
+ <em class="parameter"><code><span class="type">void</span> (*log_fn) (struct udev *udev, int priority, const char *file, int line, const char *fn, const char *format, va_list args)</code></em>);
<span class="returnvalue">int</span> <a class="link" href="libudev-udev.html#udev-get-log-priority" title="udev_get_log_priority ()">udev_get_log_priority</a> (<em class="parameter"><code><span class="type">struct udev</span> *udev</code></em>);
<span class="returnvalue">void</span> <a class="link" href="libudev-udev.html#udev-set-log-priority" title="udev_set_log_priority ()">udev_set_log_priority</a> (<em class="parameter"><code><span class="type">struct udev</span> *udev</code></em>,
<em class="parameter"><code><span class="type">int</span> priority</code></em>);
const <span class="returnvalue">char</span> * <a class="link" href="libudev-udev.html#udev-get-sys-path" title="udev_get_sys_path ()">udev_get_sys_path</a> (<em class="parameter"><code><span class="type">struct udev</span> *udev</code></em>);
const <span class="returnvalue">char</span> * <a class="link" href="libudev-udev.html#udev-get-dev-path" title="udev_get_dev_path ()">udev_get_dev_path</a> (<em class="parameter"><code><span class="type">struct udev</span> *udev</code></em>);
+const <span class="returnvalue">char</span> * <a class="link" href="libudev-udev.html#udev-get-run-path" title="udev_get_run_path ()">udev_get_run_path</a> (<em class="parameter"><code><span class="type">struct udev</span> *udev</code></em>);
<span class="returnvalue">void</span> * <a class="link" href="libudev-udev.html#udev-get-userdata" title="udev_get_userdata ()">udev_get_userdata</a> (<em class="parameter"><code><span class="type">struct udev</span> *udev</code></em>);
<span class="returnvalue">void</span> <a class="link" href="libudev-udev.html#udev-set-userdata" title="udev_set_userdata ()">udev_set_userdata</a> (<em class="parameter"><code><span class="type">struct udev</span> *udev</code></em>,
<em class="parameter"><code><span class="type">void</span> *userdata</code></em>);
</pre>
</div>
-<div class="refsect1" title="Description">
+<div class="refsect1">
<a name="libudev-udev.description"></a><h2>Description</h2>
<p>
The context contains the default values read from the udev config file,
and is passed to all library operations.
</p>
</div>
-<div class="refsect1" title="Details">
+<div class="refsect1">
<a name="libudev-udev.details"></a><h2>Details</h2>
-<div class="refsect2" title="struct udev">
+<div class="refsect2">
<a name="udev"></a><h3>struct udev</h3>
<pre class="programlisting">struct udev;</pre>
<p>
</p>
</div>
<hr>
-<div class="refsect2" title="udev_ref ()">
+<div class="refsect2">
<a name="udev-ref"></a><h3>udev_ref ()</h3>
<pre class="programlisting">struct <a class="link" href="libudev-udev.html#udev" title="struct udev"><span class="returnvalue">udev</span></a> * udev_ref (<em class="parameter"><code><span class="type">struct udev</span> *udev</code></em>);</pre>
<p>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>udev</code></em> :</span></p></td>
-<td>udev library context
-</td>
+<td>udev library context</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> the passed udev library context
-</td>
+<td>the passed udev library context</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_unref ()">
+<div class="refsect2">
<a name="udev-unref"></a><h3>udev_unref ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> udev_unref (<em class="parameter"><code><span class="type">struct udev</span> *udev</code></em>);</pre>
<p>
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>udev</code></em> :</span></p></td>
-<td>udev library context
-</td>
+<td>udev library context</td>
</tr></tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_new ()">
+<div class="refsect2">
<a name="udev-new"></a><h3>udev_new ()</h3>
<pre class="programlisting">struct <a class="link" href="libudev-udev.html#udev" title="struct udev"><span class="returnvalue">udev</span></a> * udev_new (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> a new udev library context
-</td>
+<td>a new udev library context</td>
</tr></tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_set_log_fn ()">
+<div class="refsect2">
<a name="udev-set-log-fn"></a><h3>udev_set_log_fn ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> udev_set_log_fn (<em class="parameter"><code><span class="type">struct udev</span> *udev</code></em>,
- <em class="parameter"><code><span class="type">void</span> (log_fnstruct udev *udev, int priority, const char *file, int line, const char *fn, const char *format, va_list args) ()</code></em>);</pre>
+ <em class="parameter"><code><span class="type">void</span> (*log_fn) (struct udev *udev, int priority, const char *file, int line, const char *fn, const char *format, va_list args)</code></em>);</pre>
<p>
The built-in logging writes to stderr. It can be
overridden by a custom function, to plug log messages
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
-<tbody><tr>
+<tbody>
+<tr>
<td><p><span class="term"><em class="parameter"><code>udev</code></em> :</span></p></td>
-<td>udev library context
-</td>
-</tr></tbody>
+<td>udev library context</td>
+</tr>
+<tr>
+<td><p><span class="term"><em class="parameter"><code>log_fn</code></em> :</span></p></td>
+<td>function to be called for logging messages</td>
+</tr>
+</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_get_log_priority ()">
+<div class="refsect2">
<a name="udev-get-log-priority"></a><h3>udev_get_log_priority ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span> udev_get_log_priority (<em class="parameter"><code><span class="type">struct udev</span> *udev</code></em>);</pre>
<p>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>udev</code></em> :</span></p></td>
-<td>udev library context
-</td>
+<td>udev library context</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> the current logging priority
-</td>
+<td>the current logging priority</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_set_log_priority ()">
+<div class="refsect2">
<a name="udev-set-log-priority"></a><h3>udev_set_log_priority ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> udev_set_log_priority (<em class="parameter"><code><span class="type">struct udev</span> *udev</code></em>,
<em class="parameter"><code><span class="type">int</span> priority</code></em>);</pre>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>udev</code></em> :</span></p></td>
-<td>udev library context
-</td>
+<td>udev library context</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>priority</code></em> :</span></p></td>
-<td>the new logging priority
-</td>
+<td>the new logging priority</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_get_sys_path ()">
+<div class="refsect2">
<a name="udev-get-sys-path"></a><h3>udev_get_sys_path ()</h3>
<pre class="programlisting">const <span class="returnvalue">char</span> * udev_get_sys_path (<em class="parameter"><code><span class="type">struct udev</span> *udev</code></em>);</pre>
<p>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>udev</code></em> :</span></p></td>
-<td>udev library context
-</td>
+<td>udev library context</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> the sys mount point
-</td>
+<td>the sys mount point</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_get_dev_path ()">
+<div class="refsect2">
<a name="udev-get-dev-path"></a><h3>udev_get_dev_path ()</h3>
<pre class="programlisting">const <span class="returnvalue">char</span> * udev_get_dev_path (<em class="parameter"><code><span class="type">struct udev</span> *udev</code></em>);</pre>
<p>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>udev</code></em> :</span></p></td>
-<td>udev library context
-</td>
+<td>udev library context</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> the device directory path
-</td>
+<td>the device directory path</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2">
+<a name="udev-get-run-path"></a><h3>udev_get_run_path ()</h3>
+<pre class="programlisting">const <span class="returnvalue">char</span> * udev_get_run_path (<em class="parameter"><code><span class="type">struct udev</span> *udev</code></em>);</pre>
+<p>
+Retrieve the udev runtime directory path. The default is "/run/udev".
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody>
+<tr>
+<td><p><span class="term"><em class="parameter"><code>udev</code></em> :</span></p></td>
+<td>udev library context</td>
+</tr>
+<tr>
+<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
+<td>the runtime directory path</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_get_userdata ()">
+<div class="refsect2">
<a name="udev-get-userdata"></a><h3>udev_get_userdata ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> * udev_get_userdata (<em class="parameter"><code><span class="type">struct udev</span> *udev</code></em>);</pre>
<p>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>udev</code></em> :</span></p></td>
-<td>udev library context
-</td>
+<td>udev library context</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> stored userdata
-</td>
+<td>stored userdata</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
-<div class="refsect2" title="udev_set_userdata ()">
+<div class="refsect2">
<a name="udev-set-userdata"></a><h3>udev_set_userdata ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> udev_set_userdata (<em class="parameter"><code><span class="type">struct udev</span> *udev</code></em>,
<em class="parameter"><code><span class="type">void</span> *userdata</code></em>);</pre>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>udev</code></em> :</span></p></td>
-<td>udev library context
-</td>
+<td>udev library context</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>userdata</code></em> :</span></p></td>
-<td>data pointer
-</td>
+<td>data pointer</td>
</tr>
</tbody>
</table></div>
</div>
<div class="footer">
<hr>
- Generated by GTK-Doc V1.15</div>
+ Generated by GTK-Doc V1.18</div>
</body>
</html>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="utf-8" standalone="no"?>
-<!DOCTYPE book PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "">
-<book xmlns="http://www.devhelp.net/book" title="libudev Reference Manual" link="index.html" author="" name="libudev">
- <chapters>
- <sub name="libudev" link="ch01.html">
- <sub name="udev" link="libudev-udev.html"/>
- <sub name="udev_list" link="libudev-udev-list.html"/>
- <sub name="udev_device" link="libudev-udev-device.html"/>
- <sub name="udev_monitor" link="libudev-udev-monitor.html"/>
- <sub name="udev_enumerate" link="libudev-udev-enumerate.html"/>
- <sub name="udev_queue" link="libudev-udev-queue.html"/>
- </sub>
- <sub name="API Index" link="api-index-full.html"/>
- </chapters>
- <functions>
- <function name="struct udev" link="libudev-udev.html#udev"/>
- <function name="udev_ref ()" link="libudev-udev.html#udev-ref"/>
- <function name="udev_unref ()" link="libudev-udev.html#udev-unref"/>
- <function name="udev_new ()" link="libudev-udev.html#udev-new"/>
- <function name="udev_set_log_fn ()" link="libudev-udev.html#udev-set-log-fn"/>
- <function name="udev_get_log_priority ()" link="libudev-udev.html#udev-get-log-priority"/>
- <function name="udev_set_log_priority ()" link="libudev-udev.html#udev-set-log-priority"/>
- <function name="udev_get_sys_path ()" link="libudev-udev.html#udev-get-sys-path"/>
- <function name="udev_get_dev_path ()" link="libudev-udev.html#udev-get-dev-path"/>
- <function name="udev_get_userdata ()" link="libudev-udev.html#udev-get-userdata"/>
- <function name="udev_set_userdata ()" link="libudev-udev.html#udev-set-userdata"/>
- <function name="struct udev_list_entry" link="libudev-udev-list.html#udev-list-entry"/>
- <function name="udev_list_entry_get_next ()" link="libudev-udev-list.html#udev-list-entry-get-next"/>
- <function name="udev_list_entry_get_by_name ()" link="libudev-udev-list.html#udev-list-entry-get-by-name"/>
- <function name="udev_list_entry_get_name ()" link="libudev-udev-list.html#udev-list-entry-get-name"/>
- <function name="udev_list_entry_get_value ()" link="libudev-udev-list.html#udev-list-entry-get-value"/>
- <function name="udev_list_entry_foreach()" link="libudev-udev-list.html#udev-list-entry-foreach"/>
- <function name="struct udev_device" link="libudev-udev-device.html#udev-device"/>
- <function name="udev_device_ref ()" link="libudev-udev-device.html#udev-device-ref"/>
- <function name="udev_device_unref ()" link="libudev-udev-device.html#udev-device-unref"/>
- <function name="udev_device_get_udev ()" link="libudev-udev-device.html#udev-device-get-udev"/>
- <function name="udev_device_new_from_syspath ()" link="libudev-udev-device.html#udev-device-new-from-syspath"/>
- <function name="udev_device_new_from_devnum ()" link="libudev-udev-device.html#udev-device-new-from-devnum"/>
- <function name="udev_device_new_from_subsystem_sysname ()" link="libudev-udev-device.html#udev-device-new-from-subsystem-sysname"/>
- <function name="udev_device_new_from_environment ()" link="libudev-udev-device.html#udev-device-new-from-environment"/>
- <function name="udev_device_get_parent ()" link="libudev-udev-device.html#udev-device-get-parent"/>
- <function name="udev_device_get_parent_with_subsystem_devtype ()" link="libudev-udev-device.html#udev-device-get-parent-with-subsystem-devtype"/>
- <function name="udev_device_get_devpath ()" link="libudev-udev-device.html#udev-device-get-devpath"/>
- <function name="udev_device_get_subsystem ()" link="libudev-udev-device.html#udev-device-get-subsystem"/>
- <function name="udev_device_get_devtype ()" link="libudev-udev-device.html#udev-device-get-devtype"/>
- <function name="udev_device_get_syspath ()" link="libudev-udev-device.html#udev-device-get-syspath"/>
- <function name="udev_device_get_sysname ()" link="libudev-udev-device.html#udev-device-get-sysname"/>
- <function name="udev_device_get_sysnum ()" link="libudev-udev-device.html#udev-device-get-sysnum"/>
- <function name="udev_device_get_devnode ()" link="libudev-udev-device.html#udev-device-get-devnode"/>
- <function name="udev_device_get_is_initialized ()" link="libudev-udev-device.html#udev-device-get-is-initialized"/>
- <function name="udev_device_get_devlinks_list_entry ()" link="libudev-udev-device.html#udev-device-get-devlinks-list-entry"/>
- <function name="udev_device_get_properties_list_entry ()" link="libudev-udev-device.html#udev-device-get-properties-list-entry"/>
- <function name="udev_device_get_tags_list_entry ()" link="libudev-udev-device.html#udev-device-get-tags-list-entry"/>
- <function name="udev_device_get_property_value ()" link="libudev-udev-device.html#udev-device-get-property-value"/>
- <function name="udev_device_get_driver ()" link="libudev-udev-device.html#udev-device-get-driver"/>
- <function name="udev_device_get_devnum ()" link="libudev-udev-device.html#udev-device-get-devnum"/>
- <function name="udev_device_get_action ()" link="libudev-udev-device.html#udev-device-get-action"/>
- <function name="udev_device_get_sysattr_value ()" link="libudev-udev-device.html#udev-device-get-sysattr-value"/>
- <function name="udev_device_get_seqnum ()" link="libudev-udev-device.html#udev-device-get-seqnum"/>
- <function name="udev_device_get_usec_since_initialized ()" link="libudev-udev-device.html#udev-device-get-usec-since-initialized"/>
- <function name="struct udev_monitor" link="libudev-udev-monitor.html#udev-monitor"/>
- <function name="udev_monitor_ref ()" link="libudev-udev-monitor.html#udev-monitor-ref"/>
- <function name="udev_monitor_unref ()" link="libudev-udev-monitor.html#udev-monitor-unref"/>
- <function name="udev_monitor_get_udev ()" link="libudev-udev-monitor.html#udev-monitor-get-udev"/>
- <function name="udev_monitor_new_from_netlink ()" link="libudev-udev-monitor.html#udev-monitor-new-from-netlink"/>
- <function name="udev_monitor_new_from_socket ()" link="libudev-udev-monitor.html#udev-monitor-new-from-socket"/>
- <function name="udev_monitor_enable_receiving ()" link="libudev-udev-monitor.html#udev-monitor-enable-receiving"/>
- <function name="udev_monitor_set_receive_buffer_size ()" link="libudev-udev-monitor.html#udev-monitor-set-receive-buffer-size"/>
- <function name="udev_monitor_get_fd ()" link="libudev-udev-monitor.html#udev-monitor-get-fd"/>
- <function name="udev_monitor_receive_device ()" link="libudev-udev-monitor.html#udev-monitor-receive-device"/>
- <function name="udev_monitor_filter_add_match_subsystem_devtype ()" link="libudev-udev-monitor.html#udev-monitor-filter-add-match-subsystem-devtype"/>
- <function name="udev_monitor_filter_add_match_tag ()" link="libudev-udev-monitor.html#udev-monitor-filter-add-match-tag"/>
- <function name="udev_monitor_filter_update ()" link="libudev-udev-monitor.html#udev-monitor-filter-update"/>
- <function name="udev_monitor_filter_remove ()" link="libudev-udev-monitor.html#udev-monitor-filter-remove"/>
- <function name="struct udev_enumerate" link="libudev-udev-enumerate.html#udev-enumerate"/>
- <function name="udev_enumerate_ref ()" link="libudev-udev-enumerate.html#udev-enumerate-ref"/>
- <function name="udev_enumerate_unref ()" link="libudev-udev-enumerate.html#udev-enumerate-unref"/>
- <function name="udev_enumerate_get_udev ()" link="libudev-udev-enumerate.html#udev-enumerate-get-udev"/>
- <function name="udev_enumerate_new ()" link="libudev-udev-enumerate.html#udev-enumerate-new"/>
- <function name="udev_enumerate_add_match_subsystem ()" link="libudev-udev-enumerate.html#udev-enumerate-add-match-subsystem"/>
- <function name="udev_enumerate_add_nomatch_subsystem ()" link="libudev-udev-enumerate.html#udev-enumerate-add-nomatch-subsystem"/>
- <function name="udev_enumerate_add_match_sysattr ()" link="libudev-udev-enumerate.html#udev-enumerate-add-match-sysattr"/>
- <function name="udev_enumerate_add_nomatch_sysattr ()" link="libudev-udev-enumerate.html#udev-enumerate-add-nomatch-sysattr"/>
- <function name="udev_enumerate_add_match_property ()" link="libudev-udev-enumerate.html#udev-enumerate-add-match-property"/>
- <function name="udev_enumerate_add_match_tag ()" link="libudev-udev-enumerate.html#udev-enumerate-add-match-tag"/>
- <function name="udev_enumerate_add_match_is_initialized ()" link="libudev-udev-enumerate.html#udev-enumerate-add-match-is-initialized"/>
- <function name="udev_enumerate_add_match_sysname ()" link="libudev-udev-enumerate.html#udev-enumerate-add-match-sysname"/>
- <function name="udev_enumerate_add_syspath ()" link="libudev-udev-enumerate.html#udev-enumerate-add-syspath"/>
- <function name="udev_enumerate_scan_devices ()" link="libudev-udev-enumerate.html#udev-enumerate-scan-devices"/>
- <function name="udev_enumerate_scan_subsystems ()" link="libudev-udev-enumerate.html#udev-enumerate-scan-subsystems"/>
- <function name="udev_enumerate_get_list_entry ()" link="libudev-udev-enumerate.html#udev-enumerate-get-list-entry"/>
- <function name="struct udev_queue" link="libudev-udev-queue.html#udev-queue"/>
- <function name="udev_queue_ref ()" link="libudev-udev-queue.html#udev-queue-ref"/>
- <function name="udev_queue_unref ()" link="libudev-udev-queue.html#udev-queue-unref"/>
- <function name="udev_queue_get_udev ()" link="libudev-udev-queue.html#udev-queue-get-udev"/>
- <function name="udev_queue_new ()" link="libudev-udev-queue.html#udev-queue-new"/>
- <function name="udev_queue_get_udev_is_active ()" link="libudev-udev-queue.html#udev-queue-get-udev-is-active"/>
- <function name="udev_queue_get_queue_is_empty ()" link="libudev-udev-queue.html#udev-queue-get-queue-is-empty"/>
- <function name="udev_queue_get_seqnum_is_finished ()" link="libudev-udev-queue.html#udev-queue-get-seqnum-is-finished"/>
- <function name="udev_queue_get_seqnum_sequence_is_finished ()" link="libudev-udev-queue.html#udev-queue-get-seqnum-sequence-is-finished"/>
- <function name="udev_queue_get_queued_list_entry ()" link="libudev-udev-queue.html#udev-queue-get-queued-list-entry"/>
- <function name="udev_queue_get_failed_list_entry ()" link="libudev-udev-queue.html#udev-queue-get-failed-list-entry"/>
- <function name="udev_queue_get_kernel_seqnum ()" link="libudev-udev-queue.html#udev-queue-get-kernel-seqnum"/>
- <function name="udev_queue_get_udev_seqnum ()" link="libudev-udev-queue.html#udev-queue-get-udev-seqnum"/>
- </functions>
-</book>
<sub name="udev_monitor" link="libudev-udev-monitor.html"/>
<sub name="udev_enumerate" link="libudev-udev-enumerate.html"/>
<sub name="udev_queue" link="libudev-udev-queue.html"/>
+ <sub name="udev_util" link="libudev-udev-util.html"/>
</sub>
<sub name="API Index" link="api-index-full.html"/>
</chapters>
<keyword type="function" name="udev_set_log_priority ()" link="libudev-udev.html#udev-set-log-priority"/>
<keyword type="function" name="udev_get_sys_path ()" link="libudev-udev.html#udev-get-sys-path"/>
<keyword type="function" name="udev_get_dev_path ()" link="libudev-udev.html#udev-get-dev-path"/>
+ <keyword type="function" name="udev_get_run_path ()" link="libudev-udev.html#udev-get-run-path"/>
<keyword type="function" name="udev_get_userdata ()" link="libudev-udev.html#udev-get-userdata"/>
<keyword type="function" name="udev_set_userdata ()" link="libudev-udev.html#udev-set-userdata"/>
<keyword type="struct" name="struct udev_list_entry" link="libudev-udev-list.html#udev-list-entry"/>
<keyword type="function" name="udev_device_get_devnum ()" link="libudev-udev-device.html#udev-device-get-devnum"/>
<keyword type="function" name="udev_device_get_action ()" link="libudev-udev-device.html#udev-device-get-action"/>
<keyword type="function" name="udev_device_get_sysattr_value ()" link="libudev-udev-device.html#udev-device-get-sysattr-value"/>
+ <keyword type="function" name="udev_device_get_sysattr_list_entry ()" link="libudev-udev-device.html#udev-device-get-sysattr-list-entry"/>
<keyword type="function" name="udev_device_get_seqnum ()" link="libudev-udev-device.html#udev-device-get-seqnum"/>
<keyword type="function" name="udev_device_get_usec_since_initialized ()" link="libudev-udev-device.html#udev-device-get-usec-since-initialized"/>
+ <keyword type="function" name="udev_device_has_tag ()" link="libudev-udev-device.html#udev-device-has-tag"/>
<keyword type="struct" name="struct udev_monitor" link="libudev-udev-monitor.html#udev-monitor"/>
<keyword type="function" name="udev_monitor_ref ()" link="libudev-udev-monitor.html#udev-monitor-ref"/>
<keyword type="function" name="udev_monitor_unref ()" link="libudev-udev-monitor.html#udev-monitor-unref"/>
<keyword type="function" name="udev_enumerate_add_nomatch_sysattr ()" link="libudev-udev-enumerate.html#udev-enumerate-add-nomatch-sysattr"/>
<keyword type="function" name="udev_enumerate_add_match_property ()" link="libudev-udev-enumerate.html#udev-enumerate-add-match-property"/>
<keyword type="function" name="udev_enumerate_add_match_tag ()" link="libudev-udev-enumerate.html#udev-enumerate-add-match-tag"/>
+ <keyword type="function" name="udev_enumerate_add_match_parent ()" link="libudev-udev-enumerate.html#udev-enumerate-add-match-parent"/>
<keyword type="function" name="udev_enumerate_add_match_is_initialized ()" link="libudev-udev-enumerate.html#udev-enumerate-add-match-is-initialized"/>
<keyword type="function" name="udev_enumerate_add_match_sysname ()" link="libudev-udev-enumerate.html#udev-enumerate-add-match-sysname"/>
<keyword type="function" name="udev_enumerate_add_syspath ()" link="libudev-udev-enumerate.html#udev-enumerate-add-syspath"/>
<keyword type="function" name="udev_queue_get_seqnum_is_finished ()" link="libudev-udev-queue.html#udev-queue-get-seqnum-is-finished"/>
<keyword type="function" name="udev_queue_get_seqnum_sequence_is_finished ()" link="libudev-udev-queue.html#udev-queue-get-seqnum-sequence-is-finished"/>
<keyword type="function" name="udev_queue_get_queued_list_entry ()" link="libudev-udev-queue.html#udev-queue-get-queued-list-entry"/>
- <keyword type="function" name="udev_queue_get_failed_list_entry ()" link="libudev-udev-queue.html#udev-queue-get-failed-list-entry"/>
<keyword type="function" name="udev_queue_get_kernel_seqnum ()" link="libudev-udev-queue.html#udev-queue-get-kernel-seqnum"/>
<keyword type="function" name="udev_queue_get_udev_seqnum ()" link="libudev-udev-queue.html#udev-queue-get-udev-seqnum"/>
+ <keyword type="function" name="udev_util_encode_string ()" link="libudev-udev-util.html#udev-util-encode-string"/>
</functions>
</book>
/* this is needed so that the local anchors are displayed below the naviagtion */
div.footnote a[name], div.refnamediv a[name], div.refsect1 a[name], div.refsect2 a[name], div.index a[name], div.glossary a[name], div.sect1 a[name]
{
+ display: inline-block;
position: relative;
- padding-top:4.5em;
+ top:-5em;
}
/* this seems to be a bug in the xsl style sheets when generating indexes */
div.index div.index
<title>libudev Reference Manual</title>
<releaseinfo>for libudev version &version;</releaseinfo>
<copyright>
- <year>2009-2010</year>
+ <year>2009-2011</year>
<holder>Kay Sievers <kay.sievers@vrfy.org></holder>
</copyright>
</bookinfo>
<xi:include href="xml/libudev-monitor.xml"/>
<xi:include href="xml/libudev-enumerate.xml"/>
<xi:include href="xml/libudev-queue.xml"/>
+ <xi:include href="xml/libudev-util.xml"/>
</chapter>
<index id="api-index-full">
udev_set_log_priority
udev_get_sys_path
udev_get_dev_path
+udev_get_run_path
udev_get_userdata
udev_set_userdata
</SECTION>
udev_device_get_devnum
udev_device_get_action
udev_device_get_sysattr_value
+udev_device_get_sysattr_list_entry
udev_device_get_seqnum
udev_device_get_usec_since_initialized
+udev_device_has_tag
</SECTION>
<SECTION>
udev_enumerate_add_nomatch_sysattr
udev_enumerate_add_match_property
udev_enumerate_add_match_tag
+udev_enumerate_add_match_parent
udev_enumerate_add_match_is_initialized
udev_enumerate_add_match_sysname
udev_enumerate_add_syspath
udev_queue_get_seqnum_is_finished
udev_queue_get_seqnum_sequence_is_finished
udev_queue_get_queued_list_entry
-udev_queue_get_failed_list_entry
udev_queue_get_kernel_seqnum
udev_queue_get_udev_seqnum
</SECTION>
+<SECTION>
+<FILE>libudev-util</FILE>
+<TITLE>udev_util</TITLE>
+udev_util_encode_string
+</SECTION>
@Returns:
+<!-- ##### FUNCTION udev_device_get_sysattr_list_entry ##### -->
+<para>
+
+</para>
+
+@udev_device:
+@Returns:
+
+
<!-- ##### FUNCTION udev_device_get_seqnum ##### -->
<para>
@Returns:
+<!-- ##### FUNCTION udev_device_has_tag ##### -->
+<para>
+
+</para>
+
+@udev_device:
+@tag:
+@Returns:
+
+
@Returns:
+<!-- ##### FUNCTION udev_enumerate_add_match_parent ##### -->
+<para>
+
+</para>
+
+@udev_enumerate:
+@parent:
+@Returns:
+
+
<!-- ##### FUNCTION udev_enumerate_add_match_is_initialized ##### -->
<para>
@Returns:
-<!-- ##### FUNCTION udev_queue_get_failed_list_entry ##### -->
-<para>
-
-</para>
-
-@udev_queue:
-@Returns:
-
-
<!-- ##### FUNCTION udev_queue_get_kernel_seqnum ##### -->
<para>
--- /dev/null
+<!-- ##### SECTION Title ##### -->
+udev_util
+
+<!-- ##### SECTION Short_Description ##### -->
+
+
+<!-- ##### SECTION Long_Description ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION See_Also ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION Stability_Level ##### -->
+
+
+<!-- ##### SECTION Image ##### -->
+
+
+<!-- ##### FUNCTION udev_util_encode_string ##### -->
+<para>
+
+</para>
+
+@str:
+@str_enc:
+@len:
+@Returns:
+
+
</para>
@udev:
-@struct udev *udev, int priority, const char *file, int line, const char *fn, const char *format, va_list args:
+@log_fn:
<!-- ##### FUNCTION udev_get_log_priority ##### -->
@Returns:
+<!-- ##### FUNCTION udev_get_run_path ##### -->
+<para>
+
+</para>
+
+@udev:
+@Returns:
+
+
<!-- ##### FUNCTION udev_get_userdata ##### -->
<para>
+++ /dev/null
-udev_new
-udev_ref
-udev_unref
-udev_set_log_fn
-udev_get_log_priority
-udev_set_log_priority
-udev_get_userdata
-udev_set_userdata
-udev_get_sys_path
-udev_get_dev_path
-udev_list_entry_get_next
-udev_list_entry_get_by_name
-udev_list_entry_get_name
-udev_list_entry_get_value
-udev_device_new_from_syspath
-udev_device_new_from_devnum
-udev_device_new_from_subsystem_sysname
-udev_device_new_from_environment
-udev_device_get_parent
-udev_device_get_parent_with_subsystem_devtype
-udev_device_ref
-udev_device_unref
-udev_device_get_udev
-udev_device_get_syspath
-udev_device_get_devpath
-udev_device_get_devnode
-udev_device_get_sysname
-udev_device_get_sysnum
-udev_device_get_subsystem
-udev_device_get_devtype
-udev_device_get_is_initialized
-udev_device_get_devlinks_list_entry
-udev_device_get_properties_list_entry
-udev_device_get_tags_list_entry
-udev_device_get_property_value
-udev_device_get_action
-udev_device_get_driver
-udev_device_get_devnum
-udev_device_get_seqnum
-udev_device_get_usec_since_initialized
-udev_device_get_sysattr_value
-udev_enumerate_new
-udev_enumerate_ref
-udev_enumerate_unref
-udev_enumerate_get_udev
-udev_enumerate_get_list_entry
-udev_enumerate_add_match_subsystem
-udev_enumerate_add_nomatch_subsystem
-udev_enumerate_add_match_sysattr
-udev_enumerate_add_nomatch_sysattr
-udev_enumerate_add_match_property
-udev_enumerate_add_match_tag
-udev_enumerate_add_match_is_initialized
-udev_enumerate_add_match_sysname
-udev_enumerate_scan_devices
-udev_enumerate_scan_subsystems
-udev_enumerate_add_syspath
-udev_monitor_new_from_socket
-udev_monitor_new_from_netlink
-udev_monitor_set_receive_buffer_size
-udev_monitor_enable_receiving
-udev_monitor_ref
-udev_monitor_unref
-udev_monitor_get_udev
-udev_monitor_get_fd
-udev_monitor_receive_device
-udev_monitor_filter_add_match_subsystem_devtype
-udev_monitor_filter_add_match_tag
-udev_monitor_filter_update
-udev_monitor_filter_remove
-udev_queue_new
-udev_queue_ref
-udev_queue_unref
-udev_queue_get_udev
-udev_queue_get_kernel_seqnum
-udev_queue_get_udev_seqnum
-udev_queue_get_udev_is_active
-udev_queue_get_queue_is_empty
-udev_queue_get_seqnum_is_finished
-udev_queue_get_seqnum_sequence_is_finished
-udev_queue_get_queued_list_entry
-udev_queue_get_failed_list_entry
+++ /dev/null
-/*
- * libudev - interface to udev device information
- *
- * Copyright (C) 2008 Kay Sievers <kay.sievers@vrfy.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- */
-
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <stddef.h>
-#include <string.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/un.h>
-
-#include "libudev.h"
-#include "libudev-private.h"
-
-/* wire protocol magic must match */
-#define UDEV_CTRL_MAGIC 0xdead1dea
-
-enum udev_ctrl_msg_type {
- UDEV_CTRL_UNKNOWN,
- UDEV_CTRL_SET_LOG_LEVEL,
- UDEV_CTRL_STOP_EXEC_QUEUE,
- UDEV_CTRL_START_EXEC_QUEUE,
- UDEV_CTRL_RELOAD_RULES,
- UDEV_CTRL_SET_ENV,
- UDEV_CTRL_SET_CHILDREN_MAX,
- UDEV_CTRL_SETTLE,
-};
-
-struct udev_ctrl_msg_wire {
- char version[16];
- unsigned int magic;
- enum udev_ctrl_msg_type type;
- union {
- int intval;
- char buf[256];
- };
-};
-
-struct udev_ctrl_msg {
- int refcount;
- struct udev_ctrl *uctrl;
- struct udev_ctrl_msg_wire ctrl_msg_wire;
- pid_t pid;
-};
-
-struct udev_ctrl {
- int refcount;
- struct udev *udev;
- int sock;
- struct sockaddr_un saddr;
- socklen_t addrlen;
-};
-
-struct udev_ctrl *udev_ctrl_new_from_socket(struct udev *udev, const char *socket_path)
-{
- struct udev_ctrl *uctrl;
-
- uctrl = calloc(1, sizeof(struct udev_ctrl));
- if (uctrl == NULL)
- return NULL;
- uctrl->refcount = 1;
- uctrl->udev = udev;
-
- uctrl->sock = socket(AF_LOCAL, SOCK_DGRAM, 0);
- if (uctrl->sock < 0) {
- err(udev, "error getting socket: %m\n");
- udev_ctrl_unref(uctrl);
- return NULL;
- }
-
- uctrl->saddr.sun_family = AF_LOCAL;
- strcpy(uctrl->saddr.sun_path, socket_path);
- uctrl->addrlen = offsetof(struct sockaddr_un, sun_path) + strlen(uctrl->saddr.sun_path);
- /* translate leading '@' to abstract namespace */
- if (uctrl->saddr.sun_path[0] == '@')
- uctrl->saddr.sun_path[0] = '\0';
-
- return uctrl;
-}
-
-int udev_ctrl_enable_receiving(struct udev_ctrl *uctrl)
-{
- int err;
- const int feature_on = 1;
-
- err= bind(uctrl->sock, (struct sockaddr *)&uctrl->saddr, uctrl->addrlen);
- if (err < 0) {
- err(uctrl->udev, "bind failed: %m\n");
- return err;
- }
-
- /* enable receiving of the sender credentials */
- setsockopt(uctrl->sock, SOL_SOCKET, SO_PASSCRED, &feature_on, sizeof(feature_on));
- return 0;
-}
-
-struct udev *udev_ctrl_get_udev(struct udev_ctrl *uctrl)
-{
- return uctrl->udev;
-}
-
-struct udev_ctrl *udev_ctrl_ref(struct udev_ctrl *uctrl)
-{
- if (uctrl == NULL)
- return NULL;
- uctrl->refcount++;
- return uctrl;
-}
-
-void udev_ctrl_unref(struct udev_ctrl *uctrl)
-{
- if (uctrl == NULL)
- return;
- uctrl->refcount--;
- if (uctrl->refcount > 0)
- return;
- if (uctrl->sock >= 0)
- close(uctrl->sock);
- free(uctrl);
-}
-
-int udev_ctrl_get_fd(struct udev_ctrl *uctrl)
-{
- if (uctrl == NULL)
- return -1;
- return uctrl->sock;
-}
-
-static int ctrl_send(struct udev_ctrl *uctrl, enum udev_ctrl_msg_type type, int intval, const char *buf)
-{
- struct udev_ctrl_msg_wire ctrl_msg_wire;
- int err;
-
- memset(&ctrl_msg_wire, 0x00, sizeof(struct udev_ctrl_msg_wire));
- strcpy(ctrl_msg_wire.version, "udev-" VERSION);
- ctrl_msg_wire.magic = UDEV_CTRL_MAGIC;
- ctrl_msg_wire.type = type;
-
- if (buf != NULL)
- util_strscpy(ctrl_msg_wire.buf, sizeof(ctrl_msg_wire.buf), buf);
- else
- ctrl_msg_wire.intval = intval;
-
- err = sendto(uctrl->sock, &ctrl_msg_wire, sizeof(ctrl_msg_wire), 0,
- (struct sockaddr *)&uctrl->saddr, uctrl->addrlen);
- if (err == -1) {
- err(uctrl->udev, "error sending message: %m\n");
- }
- return err;
-}
-
-int udev_ctrl_send_set_log_level(struct udev_ctrl *uctrl, int priority)
-{
- return ctrl_send(uctrl, UDEV_CTRL_SET_LOG_LEVEL, priority, NULL);
-}
-
-int udev_ctrl_send_stop_exec_queue(struct udev_ctrl *uctrl)
-{
- return ctrl_send(uctrl, UDEV_CTRL_STOP_EXEC_QUEUE, 0, NULL);
-}
-
-int udev_ctrl_send_start_exec_queue(struct udev_ctrl *uctrl)
-{
- return ctrl_send(uctrl, UDEV_CTRL_START_EXEC_QUEUE, 0, NULL);
-}
-
-int udev_ctrl_send_reload_rules(struct udev_ctrl *uctrl)
-{
- return ctrl_send(uctrl, UDEV_CTRL_RELOAD_RULES, 0, NULL);
-}
-
-int udev_ctrl_send_set_env(struct udev_ctrl *uctrl, const char *key)
-{
- return ctrl_send(uctrl, UDEV_CTRL_SET_ENV, 0, key);
-}
-
-int udev_ctrl_send_set_children_max(struct udev_ctrl *uctrl, int count)
-{
- return ctrl_send(uctrl, UDEV_CTRL_SET_CHILDREN_MAX, count, NULL);
-}
-
-int udev_ctrl_send_settle(struct udev_ctrl *uctrl)
-{
- return ctrl_send(uctrl, UDEV_CTRL_SETTLE, 0, NULL);
-}
-
-struct udev_ctrl_msg *udev_ctrl_receive_msg(struct udev_ctrl *uctrl)
-{
- struct udev_ctrl_msg *uctrl_msg;
- ssize_t size;
- struct msghdr smsg;
- struct cmsghdr *cmsg;
- struct iovec iov;
- struct ucred *cred;
- char cred_msg[CMSG_SPACE(sizeof(struct ucred))];
-
- uctrl_msg = calloc(1, sizeof(struct udev_ctrl_msg));
- if (uctrl_msg == NULL)
- return NULL;
- uctrl_msg->refcount = 1;
- uctrl_msg->uctrl = uctrl;
-
- iov.iov_base = &uctrl_msg->ctrl_msg_wire;
- iov.iov_len = sizeof(struct udev_ctrl_msg_wire);
-
- memset(&smsg, 0x00, sizeof(struct msghdr));
- smsg.msg_iov = &iov;
- smsg.msg_iovlen = 1;
- smsg.msg_control = cred_msg;
- smsg.msg_controllen = sizeof(cred_msg);
-
- size = recvmsg(uctrl->sock, &smsg, 0);
- if (size < 0) {
- err(uctrl->udev, "unable to receive user udevd message: %m\n");
- goto err;
- }
- cmsg = CMSG_FIRSTHDR(&smsg);
- cred = (struct ucred *) CMSG_DATA(cmsg);
-
- if (cmsg == NULL || cmsg->cmsg_type != SCM_CREDENTIALS) {
- err(uctrl->udev, "no sender credentials received, message ignored\n");
- goto err;
- }
-
- if (cred->uid != 0) {
- err(uctrl->udev, "sender uid=%i, message ignored\n", cred->uid);
- goto err;
- }
-
- uctrl_msg->pid = cred->pid;
-
- if (uctrl_msg->ctrl_msg_wire.magic != UDEV_CTRL_MAGIC) {
- err(uctrl->udev, "message magic 0x%08x doesn't match, ignore it\n", uctrl_msg->ctrl_msg_wire.magic);
- goto err;
- }
-
- dbg(uctrl->udev, "created ctrl_msg %p (%i)\n", uctrl_msg, uctrl_msg->ctrl_msg_wire.type);
- return uctrl_msg;
-err:
- udev_ctrl_msg_unref(uctrl_msg);
- return NULL;
-}
-
-struct udev_ctrl_msg *udev_ctrl_msg_ref(struct udev_ctrl_msg *ctrl_msg)
-{
- if (ctrl_msg == NULL)
- return NULL;
- ctrl_msg->refcount++;
- return ctrl_msg;
-}
-
-void udev_ctrl_msg_unref(struct udev_ctrl_msg *ctrl_msg)
-{
- if (ctrl_msg == NULL)
- return;
- ctrl_msg->refcount--;
- if (ctrl_msg->refcount > 0)
- return;
- dbg(ctrl_msg->uctrl->udev, "release ctrl_msg %p\n", ctrl_msg);
- free(ctrl_msg);
-}
-
-int udev_ctrl_get_set_log_level(struct udev_ctrl_msg *ctrl_msg)
-{
- if (ctrl_msg->ctrl_msg_wire.type == UDEV_CTRL_SET_LOG_LEVEL)
- return ctrl_msg->ctrl_msg_wire.intval;
- return -1;
-}
-
-int udev_ctrl_get_stop_exec_queue(struct udev_ctrl_msg *ctrl_msg)
-{
- if (ctrl_msg->ctrl_msg_wire.type == UDEV_CTRL_STOP_EXEC_QUEUE)
- return 1;
- return -1;
-}
-
-int udev_ctrl_get_start_exec_queue(struct udev_ctrl_msg *ctrl_msg)
-{
- if (ctrl_msg->ctrl_msg_wire.type == UDEV_CTRL_START_EXEC_QUEUE)
- return 1;
- return -1;
-}
-
-int udev_ctrl_get_reload_rules(struct udev_ctrl_msg *ctrl_msg)
-{
- if (ctrl_msg->ctrl_msg_wire.type == UDEV_CTRL_RELOAD_RULES)
- return 1;
- return -1;
-}
-
-const char *udev_ctrl_get_set_env(struct udev_ctrl_msg *ctrl_msg)
-{
- if (ctrl_msg->ctrl_msg_wire.type == UDEV_CTRL_SET_ENV)
- return ctrl_msg->ctrl_msg_wire.buf;
- return NULL;
-}
-
-int udev_ctrl_get_set_children_max(struct udev_ctrl_msg *ctrl_msg)
-{
- if (ctrl_msg->ctrl_msg_wire.type == UDEV_CTRL_SET_CHILDREN_MAX)
- return ctrl_msg->ctrl_msg_wire.intval;
- return -1;
-}
-
-pid_t udev_ctrl_get_settle(struct udev_ctrl_msg *ctrl_msg)
-{
- if (ctrl_msg->ctrl_msg_wire.type == UDEV_CTRL_SETTLE)
- return ctrl_msg->pid;
- return -1;
-}
id = udev_device_get_id_filename(dev);
if (id == NULL)
return;
- util_strscpyl(filename, sizeof(filename), udev_get_dev_path(udev), "/.udev/tags/", tag, "/", id, NULL);
+ util_strscpyl(filename, sizeof(filename), udev_get_run_path(udev), "/tags/", tag, "/", id, NULL);
if (add) {
int fd;
if (udev_device_get_devlink_priority(udev_device) != 0)
return true;
udev_list_entry_foreach(list_entry, udev_device_get_properties_list_entry(udev_device))
- if (udev_list_entry_get_flags(list_entry))
+ if (udev_list_entry_get_num(list_entry))
return true;
if (udev_device_get_tags_list_entry(udev_device) != NULL)
return true;
return -1;
has_info = device_has_info(udev_device);
- util_strscpyl(filename, sizeof(filename), udev_get_dev_path(udev), "/.udev/db/", id, NULL);
+ util_strscpyl(filename, sizeof(filename), udev_get_run_path(udev), "/data/", id, NULL);
/* do not store anything for otherwise empty devices */
if (!has_info &&
return -1;
}
+ /*
+ * set 'sticky' bit to indicate that we should not clean the
+ * database when we transition from initramfs to the real root
+ */
+ if (udev_device_get_db_persist(udev_device))
+ fchmod(fileno(f), 01644);
+
if (has_info) {
size_t devlen = strlen(udev_get_dev_path(udev))+1;
struct udev_list_entry *list_entry;
if (udev_device_get_usec_initialized(udev_device) > 0)
fprintf(f, "I:%llu\n", udev_device_get_usec_initialized(udev_device));
udev_list_entry_foreach(list_entry, udev_device_get_properties_list_entry(udev_device)) {
- if (!udev_list_entry_get_flags(list_entry))
+ if (!udev_list_entry_get_num(list_entry))
continue;
fprintf(f, "E:%s=%s\n",
udev_list_entry_get_name(list_entry),
id = udev_device_get_id_filename(udev_device);
if (id == NULL)
return -1;
- util_strscpyl(filename, sizeof(filename), udev_get_dev_path(udev), "/.udev/db/", id, NULL);
+ util_strscpyl(filename, sizeof(filename), udev_get_run_path(udev), "/data/", id, NULL);
unlink(filename);
return 0;
}
#include <dirent.h>
#include <fcntl.h>
#include <ctype.h>
+#include <net/if.h>
#include <sys/stat.h>
+#include <sys/ioctl.h>
+#include <sys/socket.h>
+#include <linux/sockios.h>
#include "libudev.h"
#include "libudev-private.h"
char *sysname;
const char *sysnum;
char *devnode;
+ mode_t devnode_mode;
char *subsystem;
char *devtype;
char *driver;
char *action;
char *devpath_old;
- char *sysname_old;
char *knodename;
char *id_filename;
char **envp;
char *monitor_buf;
size_t monitor_buf_len;
- struct udev_list_node devlinks_list;
- struct udev_list_node properties_list;
- struct udev_list_node sysattr_list;
- struct udev_list_node tags_list;
+ struct udev_list devlinks_list;
+ struct udev_list properties_list;
+ struct udev_list sysattr_value_list;
+ struct udev_list sysattr_list;
+ struct udev_list tags_list;
unsigned long long int seqnum;
unsigned long long int usec_initialized;
- int event_timeout;
int timeout;
int devlink_priority;
int refcount;
bool db_loaded;
bool uevent_loaded;
bool is_initialized;
+ bool sysattr_list_read;
+ bool db_persist;
};
+/**
+ * udev_device_get_seqnum:
+ * @udev_device: udev device
+ *
+ * This is only valid if the device was received through a monitor. Devices read from
+ * sys do not have a sequence number.
+ *
+ * Returns: the kernel event sequence number, or 0 if there is no sequence number available.
+ **/
+UDEV_EXPORT unsigned long long int udev_device_get_seqnum(struct udev_device *udev_device)
+{
+ if (udev_device == NULL)
+ return 0;
+ return udev_device->seqnum;
+}
+
+static int udev_device_set_seqnum(struct udev_device *udev_device, unsigned long long int seqnum)
+{
+ char num[32];
+
+ udev_device->seqnum = seqnum;
+ snprintf(num, sizeof(num), "%llu", seqnum);
+ udev_device_add_property(udev_device, "SEQNUM", num);
+ return 0;
+}
+
+int udev_device_get_ifindex(struct udev_device *udev_device)
+{
+ if (!udev_device->info_loaded)
+ udev_device_read_uevent_file(udev_device);
+ return udev_device->ifindex;
+}
+
+static int udev_device_set_ifindex(struct udev_device *udev_device, int ifindex)
+{
+ char num[32];
+
+ udev_device->ifindex = ifindex;
+ snprintf(num, sizeof(num), "%u", ifindex);
+ udev_device_add_property(udev_device, "IFINDEX", num);
+ return 0;
+}
+
+/**
+ * udev_device_get_devnum:
+ * @udev_device: udev device
+ *
+ * Returns: the device major/minor number.
+ **/
+UDEV_EXPORT dev_t udev_device_get_devnum(struct udev_device *udev_device)
+{
+ if (udev_device == NULL)
+ return makedev(0, 0);
+ if (!udev_device->info_loaded)
+ udev_device_read_uevent_file(udev_device);
+ return udev_device->devnum;
+}
+
+static int udev_device_set_devnum(struct udev_device *udev_device, dev_t devnum)
+{
+ char num[32];
+
+ udev_device->devnum = devnum;
+
+ snprintf(num, sizeof(num), "%u", major(devnum));
+ udev_device_add_property(udev_device, "MAJOR", num);
+ snprintf(num, sizeof(num), "%u", minor(devnum));
+ udev_device_add_property(udev_device, "MINOR", num);
+ return 0;
+}
+
+int udev_device_get_timeout(struct udev_device *udev_device)
+{
+ return udev_device->timeout;
+}
+
+static int udev_device_set_timeout(struct udev_device *udev_device, int timeout)
+{
+ char num[32];
+
+ udev_device->timeout = timeout;
+ snprintf(num, sizeof(num), "%u", timeout);
+ udev_device_add_property(udev_device, "TIMEOUT", num);
+ return 0;
+}
+
+const char *udev_device_get_knodename(struct udev_device *udev_device)
+{
+ return udev_device->knodename;
+}
+
+static int udev_device_set_knodename(struct udev_device *udev_device, const char *knodename)
+{
+ free(udev_device->knodename);
+ udev_device->knodename = strdup(knodename);
+ if (udev_device->knodename == NULL)
+ return -ENOMEM;
+ /* do not overwrite the udev property with the kernel property */
+ if (udev_device->devnode == NULL)
+ udev_device_add_property(udev_device, "DEVNAME", udev_device->knodename);
+ return 0;
+}
+
+const char *udev_device_get_devpath_old(struct udev_device *udev_device)
+{
+ return udev_device->devpath_old;
+}
+
+static int udev_device_set_devpath_old(struct udev_device *udev_device, const char *devpath_old)
+{
+ const char *pos;
+
+ free(udev_device->devpath_old);
+ udev_device->devpath_old = strdup(devpath_old);
+ if (udev_device->devpath_old == NULL)
+ return -ENOMEM;
+ udev_device_add_property(udev_device, "DEVPATH_OLD", udev_device->devpath_old);
+
+ pos = strrchr(udev_device->devpath_old, '/');
+ if (pos == NULL)
+ return -EINVAL;
+ return 0;
+}
+
+/**
+ * udev_device_get_driver:
+ * @udev_device: udev device
+ *
+ * Returns: the driver string, or #NULL if there is no driver attached.
+ **/
+UDEV_EXPORT const char *udev_device_get_driver(struct udev_device *udev_device)
+{
+ char driver[UTIL_NAME_SIZE];
+
+ if (udev_device == NULL)
+ return NULL;
+ if (!udev_device->driver_set) {
+ udev_device->driver_set = true;
+ if (util_get_sys_core_link_value(udev_device->udev, "driver", udev_device->syspath, driver, sizeof(driver)) > 0)
+ udev_device->driver = strdup(driver);
+ }
+ return udev_device->driver;
+}
+
+static int udev_device_set_driver(struct udev_device *udev_device, const char *driver)
+{
+ free(udev_device->driver);
+ udev_device->driver = strdup(driver);
+ if (udev_device->driver == NULL)
+ return -ENOMEM;
+ udev_device->driver_set = true;
+ udev_device_add_property(udev_device, "DRIVER", udev_device->driver);
+ return 0;
+}
+
+/**
+ * udev_device_get_devtype:
+ * @udev_device: udev device
+ *
+ * Retrieve the devtype string of the udev device.
+ *
+ * Returns: the devtype name of the udev device, or #NULL if it can not be determined
+ **/
+UDEV_EXPORT const char *udev_device_get_devtype(struct udev_device *udev_device)
+{
+ if (udev_device == NULL)
+ return NULL;
+ if (!udev_device->devtype_set) {
+ udev_device->devtype_set = true;
+ udev_device_read_uevent_file(udev_device);
+ }
+ return udev_device->devtype;
+}
+
+static int udev_device_set_devtype(struct udev_device *udev_device, const char *devtype)
+{
+ free(udev_device->devtype);
+ udev_device->devtype = strdup(devtype);
+ if (udev_device->devtype == NULL)
+ return -ENOMEM;
+ udev_device->devtype_set = true;
+ udev_device_add_property(udev_device, "DEVTYPE", udev_device->devtype);
+ return 0;
+}
+
+static int udev_device_set_subsystem(struct udev_device *udev_device, const char *subsystem)
+{
+ free(udev_device->subsystem);
+ udev_device->subsystem = strdup(subsystem);
+ if (udev_device->subsystem == NULL)
+ return -ENOMEM;
+ udev_device->subsystem_set = true;
+ udev_device_add_property(udev_device, "SUBSYSTEM", udev_device->subsystem);
+ return 0;
+}
+
+/**
+ * udev_device_get_subsystem:
+ * @udev_device: udev device
+ *
+ * Retrieve the subsystem string of the udev device. The string does not
+ * contain any "/".
+ *
+ * Returns: the subsystem name of the udev device, or #NULL if it can not be determined
+ **/
+UDEV_EXPORT const char *udev_device_get_subsystem(struct udev_device *udev_device)
+{
+ char subsystem[UTIL_NAME_SIZE];
+
+ if (udev_device == NULL)
+ return NULL;
+ if (!udev_device->subsystem_set) {
+ udev_device->subsystem_set = true;
+ /* read "subsystem" link */
+ if (util_get_sys_core_link_value(udev_device->udev, "subsystem", udev_device->syspath, subsystem, sizeof(subsystem)) > 0) {
+ udev_device_set_subsystem(udev_device, subsystem);
+ return udev_device->subsystem;
+ }
+ /* implicit names */
+ if (strncmp(udev_device->devpath, "/module/", 8) == 0) {
+ udev_device_set_subsystem(udev_device, "module");
+ return udev_device->subsystem;
+ }
+ if (strstr(udev_device->devpath, "/drivers/") != NULL) {
+ udev_device_set_subsystem(udev_device, "drivers");
+ return udev_device->subsystem;
+ }
+ if (strncmp(udev_device->devpath, "/subsystem/", 11) == 0 ||
+ strncmp(udev_device->devpath, "/class/", 7) == 0 ||
+ strncmp(udev_device->devpath, "/bus/", 5) == 0) {
+ udev_device_set_subsystem(udev_device, "subsystem");
+ return udev_device->subsystem;
+ }
+ }
+ return udev_device->subsystem;
+}
+
+mode_t udev_device_get_devnode_mode(struct udev_device *udev_device)
+{
+ if (!udev_device->info_loaded)
+ udev_device_read_uevent_file(udev_device);
+ return udev_device->devnode_mode;
+}
+
+static int udev_device_set_devnode_mode(struct udev_device *udev_device, mode_t mode)
+{
+ char num[32];
+
+ udev_device->devnode_mode = mode;
+ snprintf(num, sizeof(num), "%#o", mode);
+ udev_device_add_property(udev_device, "DEVMODE", num);
+ return 0;
+}
+
struct udev_list_entry *udev_device_add_property(struct udev_device *udev_device, const char *key, const char *value)
{
udev_device->envp_uptodate = false;
udev_list_entry_delete(list_entry);
return NULL;
}
- return udev_list_entry_add(udev_device->udev, &udev_device->properties_list, key, value, 1, 0);
+ return udev_list_entry_add(&udev_device->properties_list, key, value);
}
static struct udev_list_entry *udev_device_add_property_from_string(struct udev_device *udev_device, const char *property)
udev_device_add_tag(udev_device, tag);
}
}
+ } else if (strncmp(property, "USEC_INITIALIZED=", 19) == 0) {
+ udev_device_set_usec_initialized(udev_device, strtoull(&property[19], NULL, 10));
} else if (strncmp(property, "DRIVER=", 7) == 0) {
udev_device_set_driver(udev_device, &property[7]);
} else if (strncmp(property, "ACTION=", 7) == 0) {
udev_device_set_timeout(udev_device, strtoull(&property[8], NULL, 10));
} else if (strncmp(property, "IFINDEX=", 8) == 0) {
udev_device_set_ifindex(udev_device, strtoull(&property[8], NULL, 10));
+ } else if (strncmp(property, "DEVMODE=", 8) == 0) {
+ udev_device_set_devnode_mode(udev_device, strtoul(&property[8], NULL, 8));
} else {
udev_device_add_property_from_string(udev_device, property);
}
*
* Returns: the value of a device property, or #NULL if there is no such property.
**/
-const char *udev_device_get_property_value(struct udev_device *udev_device, const char *key)
+UDEV_EXPORT const char *udev_device_get_property_value(struct udev_device *udev_device, const char *key)
{
struct udev_list_entry *list_entry;
return NULL;
list_entry = udev_device_get_properties_list_entry(udev_device);
- list_entry = udev_list_entry_get_by_name(list_entry, key);
+ list_entry = udev_list_entry_get_by_name(list_entry, key);
return udev_list_entry_get_value(list_entry);
}
-int udev_device_read_db(struct udev_device *udev_device)
+int udev_device_read_db(struct udev_device *udev_device, const char *dbfile)
{
- const char *id;
char filename[UTIL_PATH_SIZE];
char line[UTIL_LINE_SIZE];
FILE *f;
- if (udev_device->db_loaded)
- return 0;
- udev_device->db_loaded = true;
+ /* providing a database file will always force-load it */
+ if (dbfile == NULL) {
+ const char *id;
- id = udev_device_get_id_filename(udev_device);
- if (id == NULL)
- return -1;
- util_strscpyl(filename, sizeof(filename), udev_get_dev_path(udev_device->udev), "/.udev/db/", id, NULL);
- f = fopen(filename, "re");
+ if (udev_device->db_loaded)
+ return 0;
+ udev_device->db_loaded = true;
+
+ id = udev_device_get_id_filename(udev_device);
+ if (id == NULL)
+ return -1;
+ util_strscpyl(filename, sizeof(filename), udev_get_run_path(udev_device->udev), "/data/", id, NULL);
+ dbfile = filename;
+ }
+
+ f = fopen(dbfile, "re");
if (f == NULL) {
- info(udev_device->udev, "no db file to read %s: %m\n", filename);
+ info(udev_device->udev, "no db file to read %s: %m\n", dbfile);
return -1;
}
udev_device->is_initialized = true;
break;
case 'E':
entry = udev_device_add_property_from_string(udev_device, val);
- udev_list_entry_set_flags(entry, 1);
+ udev_list_entry_set_num(entry, true);
break;
case 'G':
udev_device_add_tag(udev_device, val);
udev_device_set_ifindex(udev_device, strtoull(&line[8], NULL, 10));
else if (strncmp(line, "DEVNAME=", 8) == 0)
udev_device_set_knodename(udev_device, &line[8]);
+ else if (strncmp(line, "DEVMODE=", 8) == 0)
+ udev_device->devnode_mode = strtoul(&line[8], NULL, 8);
udev_device_add_property_from_string(udev_device, line);
}
return NULL;
udev_device->refcount = 1;
udev_device->udev = udev;
- udev_list_init(&udev_device->devlinks_list);
- udev_list_init(&udev_device->properties_list);
- udev_list_init(&udev_device->sysattr_list);
- udev_list_init(&udev_device->tags_list);
- udev_device->event_timeout = -1;
+ udev_list_init(udev, &udev_device->devlinks_list, true);
+ udev_list_init(udev, &udev_device->properties_list, true);
+ udev_list_init(udev, &udev_device->sysattr_value_list, true);
+ udev_list_init(udev, &udev_device->sysattr_list, false);
+ udev_list_init(udev, &udev_device->tags_list, true);
+ udev_device->timeout = -1;
udev_device->watch_handle = -1;
/* copy global properties */
udev_list_entry_foreach(list_entry, udev_get_properties_list_entry(udev))
*
* Returns: a new udev device, or #NULL, if it does not exist
**/
-struct udev_device *udev_device_new_from_syspath(struct udev *udev, const char *syspath)
+UDEV_EXPORT struct udev_device *udev_device_new_from_syspath(struct udev *udev, const char *syspath)
{
size_t len;
const char *subdir;
*
* Returns: a new udev device, or #NULL, if it does not exist
**/
-struct udev_device *udev_device_new_from_devnum(struct udev *udev, char type, dev_t devnum)
+UDEV_EXPORT struct udev_device *udev_device_new_from_devnum(struct udev *udev, char type, dev_t devnum)
{
char path[UTIL_PATH_SIZE];
const char *type_str;
if (sscanf(id, "%c%i:%i", &type, &maj, &min) != 3)
return NULL;
return udev_device_new_from_devnum(udev, type, makedev(maj, min));
+ case 'n': {
+ int sk;
+ struct ifreq ifr;
+ struct udev_device *dev;
+ int ifindex;
+
+ ifindex = strtoul(&id[1], NULL, 10);
+ if (ifindex <= 0)
+ return NULL;
+
+ sk = socket(PF_INET, SOCK_DGRAM, 0);
+ if (sk < 0)
+ return NULL;
+ memset(&ifr, 0x00, sizeof(struct ifreq));
+ ifr.ifr_ifindex = ifindex;
+ if (ioctl(sk, SIOCGIFNAME, &ifr) != 0) {
+ close(sk);
+ return NULL;
+ }
+ close(sk);
+
+ dev = udev_device_new_from_subsystem_sysname(udev, "net", ifr.ifr_name);
+ if (dev == NULL)
+ return NULL;
+ if (udev_device_get_ifindex(dev) == ifindex)
+ return dev;
+ udev_device_unref(dev);
+ return NULL;
+ }
case '+':
util_strscpy(subsys, sizeof(subsys), &id[1]);
sysname = strchr(subsys, ':');
*
* Returns: a new udev device, or #NULL, if it does not exist
**/
-struct udev_device *udev_device_new_from_subsystem_sysname(struct udev *udev, const char *subsystem, const char *sysname)
+UDEV_EXPORT struct udev_device *udev_device_new_from_subsystem_sysname(struct udev *udev, const char *subsystem, const char *sysname)
{
char path_full[UTIL_PATH_SIZE];
char *path;
*
* Returns: a new udev device, or #NULL, if it does not exist
**/
-struct udev_device *udev_device_new_from_environment(struct udev *udev)
+UDEV_EXPORT struct udev_device *udev_device_new_from_environment(struct udev *udev)
{
int i;
struct udev_device *udev_device;
*
* Returns: a new udev device, or #NULL, if it no parent exist.
**/
-struct udev_device *udev_device_get_parent(struct udev_device *udev_device)
+UDEV_EXPORT struct udev_device *udev_device_get_parent(struct udev_device *udev_device)
{
if (udev_device == NULL)
return NULL;
*
* Returns: a new udev device, or #NULL if no matching parent exists.
**/
-struct udev_device *udev_device_get_parent_with_subsystem_devtype(struct udev_device *udev_device, const char *subsystem, const char *devtype)
+UDEV_EXPORT struct udev_device *udev_device_get_parent_with_subsystem_devtype(struct udev_device *udev_device, const char *subsystem, const char *devtype)
{
struct udev_device *parent;
*
* Returns: the udev library context
**/
-struct udev *udev_device_get_udev(struct udev_device *udev_device)
+UDEV_EXPORT struct udev *udev_device_get_udev(struct udev_device *udev_device)
{
if (udev_device == NULL)
return NULL;
*
* Returns: the passed udev device
**/
-struct udev_device *udev_device_ref(struct udev_device *udev_device)
+UDEV_EXPORT struct udev_device *udev_device_ref(struct udev_device *udev_device)
{
if (udev_device == NULL)
return NULL;
* the resources of the device will be released.
*
**/
-void udev_device_unref(struct udev_device *udev_device)
+UDEV_EXPORT void udev_device_unref(struct udev_device *udev_device)
{
if (udev_device == NULL)
return;
free(udev_device->devnode);
free(udev_device->subsystem);
free(udev_device->devtype);
- udev_list_cleanup_entries(udev_device->udev, &udev_device->devlinks_list);
- udev_list_cleanup_entries(udev_device->udev, &udev_device->properties_list);
- udev_list_cleanup_entries(udev_device->udev, &udev_device->sysattr_list);
- udev_list_cleanup_entries(udev_device->udev, &udev_device->tags_list);
+ udev_list_cleanup(&udev_device->devlinks_list);
+ udev_list_cleanup(&udev_device->properties_list);
+ udev_list_cleanup(&udev_device->sysattr_value_list);
+ udev_list_cleanup(&udev_device->sysattr_list);
+ udev_list_cleanup(&udev_device->tags_list);
free(udev_device->action);
free(udev_device->driver);
free(udev_device->devpath_old);
- free(udev_device->sysname_old);
free(udev_device->knodename);
free(udev_device->id_filename);
free(udev_device->envp);
*
* Returns: the devpath of the udev device
**/
-const char *udev_device_get_devpath(struct udev_device *udev_device)
+UDEV_EXPORT const char *udev_device_get_devpath(struct udev_device *udev_device)
{
if (udev_device == NULL)
return NULL;
*
* Returns: the sys path of the udev device
**/
-const char *udev_device_get_syspath(struct udev_device *udev_device)
+UDEV_EXPORT const char *udev_device_get_syspath(struct udev_device *udev_device)
{
if (udev_device == NULL)
return NULL;
*
* Returns: the sys name of the device device
**/
-const char *udev_device_get_sysname(struct udev_device *udev_device)
+UDEV_EXPORT const char *udev_device_get_sysname(struct udev_device *udev_device)
{
if (udev_device == NULL)
return NULL;
*
* Returns: the trailing number of of the device name
**/
-const char *udev_device_get_sysnum(struct udev_device *udev_device)
+UDEV_EXPORT const char *udev_device_get_sysnum(struct udev_device *udev_device)
{
if (udev_device == NULL)
return NULL;
*
* Returns: the device node file name of the udev device, or #NULL if no device node exists
**/
-const char *udev_device_get_devnode(struct udev_device *udev_device)
+UDEV_EXPORT const char *udev_device_get_devnode(struct udev_device *udev_device)
{
if (udev_device == NULL)
return NULL;
if (!udev_device->info_loaded) {
udev_device_read_uevent_file(udev_device);
- udev_device_read_db(udev_device);
+ udev_device_read_db(udev_device, NULL);
}
/* we might get called before we handled an event and have a db, use the kernel-provided name */
}
/**
- * udev_device_get_subsystem:
+ * udev_device_get_devlinks_list_entry:
* @udev_device: udev device
*
- * Retrieve the subsystem string of the udev device. The string does not
- * contain any "/".
- *
- * Returns: the subsystem name of the udev device, or #NULL if it can not be determined
- **/
-const char *udev_device_get_subsystem(struct udev_device *udev_device)
-{
- char subsystem[UTIL_NAME_SIZE];
-
- if (udev_device == NULL)
- return NULL;
- if (!udev_device->subsystem_set) {
- udev_device->subsystem_set = true;
- /* read "subsystem" link */
- if (util_get_sys_subsystem(udev_device->udev, udev_device->syspath, subsystem, sizeof(subsystem)) > 0) {
- udev_device_set_subsystem(udev_device, subsystem);
- return udev_device->subsystem;
- }
- /* implicit names */
- if (strncmp(udev_device->devpath, "/module/", 8) == 0) {
- udev_device_set_subsystem(udev_device, "module");
- return udev_device->subsystem;
- }
- if (strstr(udev_device->devpath, "/drivers/") != NULL) {
- udev_device_set_subsystem(udev_device, "drivers");
- return udev_device->subsystem;
- }
- if (strncmp(udev_device->devpath, "/subsystem/", 11) == 0 ||
- strncmp(udev_device->devpath, "/class/", 7) == 0 ||
- strncmp(udev_device->devpath, "/bus/", 5) == 0) {
- udev_device_set_subsystem(udev_device, "subsystem");
- return udev_device->subsystem;
- }
- }
- return udev_device->subsystem;
-}
-
-/**
- * udev_device_get_devtype:
- * @udev_device: udev device
- *
- * Retrieve the devtype string of the udev device.
- *
- * Returns: the devtype name of the udev device, or #NULL if it can not be determined
- **/
-const char *udev_device_get_devtype(struct udev_device *udev_device)
-{
- if (udev_device == NULL)
- return NULL;
- if (!udev_device->devtype_set) {
- udev_device->devtype_set = true;
- udev_device_read_uevent_file(udev_device);
- }
- return udev_device->devtype;
-}
-
-/**
- * udev_device_get_devlinks_list_entry:
- * @udev_device: udev device
- *
- * Retrieve the list of device links pointing to the device file of
- * the udev device. The next list entry can be retrieved with
- * udev_list_entry_next(), which returns #NULL if no more entries exist.
- * The devlink path can be retrieved from the list entry by
- * udev_list_entry_get_name(). The path is an absolute path, and starts with
- * the device directory.
+ * Retrieve the list of device links pointing to the device file of
+ * the udev device. The next list entry can be retrieved with
+ * udev_list_entry_next(), which returns #NULL if no more entries exist.
+ * The devlink path can be retrieved from the list entry by
+ * udev_list_entry_get_name(). The path is an absolute path, and starts with
+ * the device directory.
*
* Returns: the first entry of the device node link list
**/
-struct udev_list_entry *udev_device_get_devlinks_list_entry(struct udev_device *udev_device)
+UDEV_EXPORT struct udev_list_entry *udev_device_get_devlinks_list_entry(struct udev_device *udev_device)
{
if (udev_device == NULL)
return NULL;
if (!udev_device->info_loaded)
- udev_device_read_db(udev_device);
+ udev_device_read_db(udev_device, NULL);
return udev_list_get_entry(&udev_device->devlinks_list);
}
void udev_device_cleanup_devlinks_list(struct udev_device *udev_device)
{
udev_device->devlinks_uptodate = false;
- udev_list_cleanup_entries(udev_device->udev, &udev_device->devlinks_list);
+ udev_list_cleanup(&udev_device->devlinks_list);
}
/**
*
* Returns: the first entry of the property list
**/
-struct udev_list_entry *udev_device_get_properties_list_entry(struct udev_device *udev_device)
+UDEV_EXPORT struct udev_list_entry *udev_device_get_properties_list_entry(struct udev_device *udev_device)
{
if (udev_device == NULL)
return NULL;
if (!udev_device->info_loaded) {
udev_device_read_uevent_file(udev_device);
- udev_device_read_db(udev_device);
+ udev_device_read_db(udev_device, NULL);
}
if (!udev_device->devlinks_uptodate) {
char symlinks[UTIL_PATH_SIZE];
}
/**
- * udev_device_get_driver:
- * @udev_device: udev device
- *
- * Returns: the driver string, or #NULL if there is no driver attached.
- **/
-const char *udev_device_get_driver(struct udev_device *udev_device)
-{
- char driver[UTIL_NAME_SIZE];
-
- if (udev_device == NULL)
- return NULL;
- if (!udev_device->driver_set) {
- udev_device->driver_set = true;
- if (util_get_sys_driver(udev_device->udev, udev_device->syspath, driver, sizeof(driver)) > 0)
- udev_device->driver = strdup(driver);
- }
- return udev_device->driver;
-}
-
-/**
- * udev_device_get_devnum:
- * @udev_device: udev device
- *
- * Returns: the device major/minor number.
- **/
-dev_t udev_device_get_devnum(struct udev_device *udev_device)
-{
- if (udev_device == NULL)
- return makedev(0, 0);
- if (!udev_device->info_loaded)
- udev_device_read_uevent_file(udev_device);
- return udev_device->devnum;
-}
-
-/**
* udev_device_get_action:
* @udev_device: udev device
*
*
* Returns: the kernel action value, or #NULL if there is no action value available.
**/
-const char *udev_device_get_action(struct udev_device *udev_device)
+UDEV_EXPORT const char *udev_device_get_action(struct udev_device *udev_device)
{
if (udev_device == NULL)
return NULL;
}
/**
- * udev_device_get_devnum:
- * @udev_device: udev device
- *
- * This is only valid if the device was received through a monitor. Devices read from
- * sys do not have a sequence number.
- *
- * Returns: the kernel event sequence number, or 0 if there is no sequence number available.
- **/
-unsigned long long int udev_device_get_seqnum(struct udev_device *udev_device)
-{
- if (udev_device == NULL)
- return 0;
- return udev_device->seqnum;
-}
-
-/**
* udev_device_get_usec_since_initialized:
* @udev_device: udev device
*
*
* Returns: the number of microseconds since the device was first seen.
**/
-unsigned long long int udev_device_get_usec_since_initialized(struct udev_device *udev_device)
+UDEV_EXPORT unsigned long long int udev_device_get_usec_since_initialized(struct udev_device *udev_device)
{
unsigned long long now;
if (udev_device == NULL)
return 0;
if (!udev_device->info_loaded)
- udev_device_read_db(udev_device);
+ udev_device_read_db(udev_device, NULL);
if (udev_device->usec_initialized == 0)
return 0;
- now = usec_monotonic();
+ now = now_usec();
if (now == 0)
return 0;
return now - udev_device->usec_initialized;
void udev_device_set_usec_initialized(struct udev_device *udev_device, unsigned long long usec_initialized)
{
+ char num[32];
+
udev_device->usec_initialized = usec_initialized;
+ snprintf(num, sizeof(num), "%llu", usec_initialized);
+ udev_device_add_property(udev_device, "USEC_INITIALIZED", num);
}
/**
*
* Returns: the content of a sys attribute file, or #NULL if there is no sys attribute value.
**/
-const char *udev_device_get_sysattr_value(struct udev_device *udev_device, const char *sysattr)
+UDEV_EXPORT const char *udev_device_get_sysattr_value(struct udev_device *udev_device, const char *sysattr)
{
struct udev_list_entry *list_entry;
char path[UTIL_PATH_SIZE];
return NULL;
/* look for possibly already cached result */
- udev_list_entry_foreach(list_entry, udev_list_get_entry(&udev_device->sysattr_list)) {
- if (strcmp(udev_list_entry_get_name(list_entry), sysattr) == 0) {
- dbg(udev_device->udev, "got '%s' (%s) from cache\n",
- sysattr, udev_list_entry_get_value(list_entry));
- return udev_list_entry_get_value(list_entry);
- }
+ list_entry = udev_list_get_entry(&udev_device->sysattr_value_list);
+ list_entry = udev_list_entry_get_by_name(list_entry, sysattr);
+ if (list_entry != NULL) {
+ dbg(udev_device->udev, "got '%s' (%s) from cache\n",
+ sysattr, udev_list_entry_get_value(list_entry));
+ return udev_list_entry_get_value(list_entry);
}
util_strscpyl(path, sizeof(path), udev_device_get_syspath(udev_device), "/", sysattr, NULL);
if (lstat(path, &statbuf) != 0) {
dbg(udev_device->udev, "no attribute '%s', keep negative entry\n", path);
- udev_list_entry_add(udev_device->udev, &udev_device->sysattr_list, sysattr, NULL, 0, 0);
+ udev_list_entry_add(&udev_device->sysattr_value_list, sysattr, NULL);
goto out;
}
if (S_ISLNK(statbuf.st_mode)) {
- char target[UTIL_NAME_SIZE];
- int len;
- char *pos;
-
- /* some core links return the last element of the target path */
- if (strcmp(sysattr, "driver") != 0 &&
- strcmp(sysattr, "subsystem") != 0 &&
- strcmp(sysattr, "module") != 0)
- goto out;
-
- len = readlink(path, target, sizeof(target));
- if (len <= 0 || len == sizeof(target))
+ struct udev_device *dev;
+
+ /*
+ * Some core links return only the last element of the target path,
+ * these are just values, the paths should not be exposed.
+ */
+ if (strcmp(sysattr, "driver") == 0 ||
+ strcmp(sysattr, "subsystem") == 0 ||
+ strcmp(sysattr, "module") == 0) {
+ if (util_get_sys_core_link_value(udev_device->udev, sysattr,
+ udev_device->syspath, value, sizeof(value)) < 0)
+ return NULL;
+ dbg(udev_device->udev, "cache '%s' with link value '%s'\n", sysattr, value);
+ list_entry = udev_list_entry_add(&udev_device->sysattr_value_list, sysattr, value);
+ val = udev_list_entry_get_value(list_entry);
goto out;
- target[len] = '\0';
+ }
- pos = strrchr(target, '/');
- if (pos != NULL) {
- pos = &pos[1];
- dbg(udev_device->udev, "cache '%s' with link value '%s'\n", sysattr, pos);
- list_entry = udev_list_entry_add(udev_device->udev, &udev_device->sysattr_list, sysattr, pos, 0, 0);
+ /* resolve link to a device and return its syspath */
+ util_strscpyl(path, sizeof(path), udev_device->syspath, "/", sysattr, NULL);
+ dev = udev_device_new_from_syspath(udev_device->udev, path);
+ if (dev != NULL) {
+ list_entry = udev_list_entry_add(&udev_device->sysattr_value_list, sysattr,
+ udev_device_get_syspath(dev));
val = udev_list_entry_get_value(list_entry);
+ udev_device_unref(dev);
}
goto out;
value[size] = '\0';
util_remove_trailing_chars(value, '\n');
dbg(udev_device->udev, "'%s' has attribute value '%s'\n", path, value);
- list_entry = udev_list_entry_add(udev_device->udev, &udev_device->sysattr_list, sysattr, value, 0, 0);
+ list_entry = udev_list_entry_add(&udev_device->sysattr_value_list, sysattr, value);
val = udev_list_entry_get_value(list_entry);
out:
return val;
}
+static int udev_device_sysattr_list_read(struct udev_device *udev_device)
+{
+ struct dirent *dent;
+ DIR *dir;
+ int num = 0;
+
+ if (udev_device == NULL)
+ return -1;
+ if (udev_device->sysattr_list_read)
+ return 0;
+
+ dir = opendir(udev_device_get_syspath(udev_device));
+ if (!dir) {
+ dbg(udev_device->udev, "sysfs dir '%s' can not be opened\n",
+ udev_device_get_syspath(udev_device));
+ return -1;
+ }
+
+ for (dent = readdir(dir); dent != NULL; dent = readdir(dir)) {
+ char path[UTIL_PATH_SIZE];
+ struct stat statbuf;
+
+ /* only handle symlinks and regular files */
+ if (dent->d_type != DT_LNK && dent->d_type != DT_REG)
+ continue;
+
+ util_strscpyl(path, sizeof(path), udev_device_get_syspath(udev_device), "/", dent->d_name, NULL);
+ if (lstat(path, &statbuf) != 0)
+ continue;
+ if ((statbuf.st_mode & S_IRUSR) == 0)
+ continue;
+
+ udev_list_entry_add(&udev_device->sysattr_list, dent->d_name, NULL);
+ num++;
+ }
+
+ closedir(dir);
+ dbg(udev_device->udev, "found %d sysattrs for '%s'\n", num, udev_device_get_syspath(udev_device));
+ udev_device->sysattr_list_read = true;
+
+ return num;
+}
+
+/**
+ * udev_device_get_sysattr_list_entry:
+ * @udev_device: udev device
+ *
+ * Retrieve the list of available sysattrs, with value being empty;
+ * This just return all available sysfs attributes for a particular
+ * device without reading their values.
+ *
+ * Returns: the first entry of the property list
+ **/
+UDEV_EXPORT struct udev_list_entry *udev_device_get_sysattr_list_entry(struct udev_device *udev_device)
+{
+ if (!udev_device->sysattr_list_read) {
+ int ret;
+ ret = udev_device_sysattr_list_read(udev_device);
+ if (0 > ret)
+ return NULL;
+ }
+
+ return udev_list_get_entry(&udev_device->sysattr_list);
+}
+
int udev_device_set_syspath(struct udev_device *udev_device, const char *syspath)
{
const char *pos;
return 0;
}
-int udev_device_set_subsystem(struct udev_device *udev_device, const char *subsystem)
-{
- free(udev_device->subsystem);
- udev_device->subsystem = strdup(subsystem);
- if (udev_device->subsystem == NULL)
- return -ENOMEM;
- udev_device->subsystem_set = true;
- udev_device_add_property(udev_device, "SUBSYSTEM", udev_device->subsystem);
- return 0;
-}
-
-int udev_device_set_devtype(struct udev_device *udev_device, const char *devtype)
-{
- free(udev_device->devtype);
- udev_device->devtype = strdup(devtype);
- if (udev_device->devtype == NULL)
- return -ENOMEM;
- udev_device->devtype_set = true;
- udev_device_add_property(udev_device, "DEVTYPE", udev_device->devtype);
- return 0;
-}
-
int udev_device_set_devnode(struct udev_device *udev_device, const char *devnode)
{
free(udev_device->devnode);
struct udev_list_entry *list_entry;
udev_device->devlinks_uptodate = false;
- list_entry = udev_list_entry_add(udev_device->udev, &udev_device->devlinks_list, devlink, NULL, 1, 0);
+ list_entry = udev_list_entry_add(&udev_device->devlinks_list, devlink, NULL);
if (list_entry == NULL)
return -ENOMEM;
if (unique)
- udev_list_entry_set_flags(list_entry, 1);
+ udev_list_entry_set_num(list_entry, true);
return 0;
}
*
* Returns: 1 if the device is set up. 0 otherwise.
**/
-int udev_device_get_is_initialized(struct udev_device *udev_device)
+UDEV_EXPORT int udev_device_get_is_initialized(struct udev_device *udev_device)
{
if (!udev_device->info_loaded)
- udev_device_read_db(udev_device);
+ udev_device_read_db(udev_device, NULL);
return udev_device->is_initialized;
}
if (strchr(tag, ':') != NULL || strchr(tag, ' ') != NULL)
return -EINVAL;
udev_device->tags_uptodate = false;
- if (udev_list_entry_add(udev_device->udev, &udev_device->tags_list, tag, NULL, 1, 0) != NULL)
+ if (udev_list_entry_add(&udev_device->tags_list, tag, NULL) != NULL)
return 0;
return -ENOMEM;
}
void udev_device_cleanup_tags_list(struct udev_device *udev_device)
{
udev_device->tags_uptodate = false;
- udev_list_cleanup_entries(udev_device->udev, &udev_device->tags_list);
+ udev_list_cleanup(&udev_device->tags_list);
}
/**
*
* Returns: the first entry of the tag list
**/
-struct udev_list_entry *udev_device_get_tags_list_entry(struct udev_device *udev_device)
+UDEV_EXPORT struct udev_list_entry *udev_device_get_tags_list_entry(struct udev_device *udev_device)
{
if (udev_device == NULL)
return NULL;
+ if (!udev_device->info_loaded)
+ udev_device_read_db(udev_device, NULL);
return udev_list_get_entry(&udev_device->tags_list);
}
-int udev_device_has_tag(struct udev_device *udev_device, const char *tag)
+UDEV_EXPORT int udev_device_has_tag(struct udev_device *udev_device, const char *tag)
{
struct udev_list_entry *list_entry;
+ if (udev_device == NULL)
+ return false;
if (!udev_device->info_loaded)
- udev_device_read_db(udev_device);
+ udev_device_read_db(udev_device, NULL);
list_entry = udev_device_get_tags_list_entry(udev_device);
- list_entry = udev_list_entry_get_by_name(list_entry, tag);
- if (list_entry != NULL)
- return 1;
- return 0;
+ if (udev_list_entry_get_by_name(list_entry, tag) != NULL)
+ return true;
+ return false;
}
#define ENVP_SIZE 128
return 0;
}
-int udev_device_set_driver(struct udev_device *udev_device, const char *driver)
-{
- free(udev_device->driver);
- udev_device->driver = strdup(driver);
- if (udev_device->driver == NULL)
- return -ENOMEM;
- udev_device->driver_set = true;
- udev_device_add_property(udev_device, "DRIVER", udev_device->driver);
- return 0;
-}
-
-const char *udev_device_get_devpath_old(struct udev_device *udev_device)
-{
- return udev_device->devpath_old;
-}
-
-int udev_device_set_devpath_old(struct udev_device *udev_device, const char *devpath_old)
-{
- const char *pos;
- size_t len;
-
- free(udev_device->devpath_old);
- udev_device->devpath_old = strdup(devpath_old);
- if (udev_device->devpath_old == NULL)
- return -ENOMEM;
- udev_device_add_property(udev_device, "DEVPATH_OLD", udev_device->devpath_old);
-
- pos = strrchr(udev_device->devpath_old, '/');
- if (pos == NULL)
- return -EINVAL;
- udev_device->sysname_old = strdup(&pos[1]);
- if (udev_device->sysname_old == NULL)
- return -ENOMEM;
-
- /* some devices have '!' in their name, change that to '/' */
- len = 0;
- while (udev_device->sysname_old[len] != '\0') {
- if (udev_device->sysname_old[len] == '!')
- udev_device->sysname_old[len] = '/';
- len++;
- }
- return 0;
-}
-
-const char *udev_device_get_sysname_old(struct udev_device *udev_device)
-{
- if (udev_device == NULL)
- return NULL;
- return udev_device->sysname_old;
-}
-
-const char *udev_device_get_knodename(struct udev_device *udev_device)
-{
- return udev_device->knodename;
-}
-
-int udev_device_set_knodename(struct udev_device *udev_device, const char *knodename)
-{
- free(udev_device->knodename);
- udev_device->knodename = strdup(knodename);
- if (udev_device->knodename == NULL)
- return -ENOMEM;
- /* do not overwrite the udev property with the kernel property */
- if (udev_device->devnode == NULL)
- udev_device_add_property(udev_device, "DEVNAME", udev_device->knodename);
- return 0;
-}
-
-int udev_device_get_timeout(struct udev_device *udev_device)
-{
- return udev_device->timeout;
-}
-
-int udev_device_set_timeout(struct udev_device *udev_device, int timeout)
-{
- udev_device->timeout = timeout;
- return 0;
-}
-int udev_device_get_event_timeout(struct udev_device *udev_device)
-{
- if (!udev_device->info_loaded)
- udev_device_read_db(udev_device);
- return udev_device->event_timeout;
-}
-
-int udev_device_set_event_timeout(struct udev_device *udev_device, int event_timeout)
-{
- char num[32];
-
- udev_device->event_timeout = event_timeout;
- snprintf(num, sizeof(num), "%u", event_timeout);
- udev_device_add_property(udev_device, "TIMEOUT", num);
- return 0;
-}
-
-int udev_device_set_seqnum(struct udev_device *udev_device, unsigned long long int seqnum)
-{
- char num[32];
-
- udev_device->seqnum = seqnum;
- snprintf(num, sizeof(num), "%llu", seqnum);
- udev_device_add_property(udev_device, "SEQNUM", num);
- return 0;
-}
-
-int udev_device_set_devnum(struct udev_device *udev_device, dev_t devnum)
-{
- char num[32];
-
- udev_device->devnum = devnum;
-
- snprintf(num, sizeof(num), "%u", major(devnum));
- udev_device_add_property(udev_device, "MAJOR", num);
- snprintf(num, sizeof(num), "%u", minor(devnum));
- udev_device_add_property(udev_device, "MINOR", num);
- return 0;
-}
-
int udev_device_get_devlink_priority(struct udev_device *udev_device)
{
if (!udev_device->info_loaded)
- udev_device_read_db(udev_device);
+ udev_device_read_db(udev_device, NULL);
return udev_device->devlink_priority;
}
int udev_device_get_watch_handle(struct udev_device *udev_device)
{
if (!udev_device->info_loaded)
- udev_device_read_db(udev_device);
+ udev_device_read_db(udev_device, NULL);
return udev_device->watch_handle;
}
return 0;
}
-int udev_device_get_ifindex(struct udev_device *udev_device)
+bool udev_device_get_db_persist(struct udev_device *udev_device)
{
- if (!udev_device->info_loaded)
- udev_device_read_uevent_file(udev_device);
- return udev_device->ifindex;
+ return udev_device->db_persist;
}
-int udev_device_set_ifindex(struct udev_device *udev_device, int ifindex)
+void udev_device_set_db_persist(struct udev_device *udev_device)
{
- char num[32];
-
- udev_device->ifindex = ifindex;
- snprintf(num, sizeof(num), "%u", ifindex);
- udev_device_add_property(udev_device, "IFINDEX", num);
- return 0;
+ udev_device->db_persist = true;
}
struct udev_enumerate {
struct udev *udev;
int refcount;
- struct udev_list_node sysattr_match_list;
- struct udev_list_node sysattr_nomatch_list;
- struct udev_list_node subsystem_match_list;
- struct udev_list_node subsystem_nomatch_list;
- struct udev_list_node sysname_match_list;
- struct udev_list_node properties_match_list;
- struct udev_list_node tags_match_list;
- struct udev_list_node devices_list;
+ struct udev_list sysattr_match_list;
+ struct udev_list sysattr_nomatch_list;
+ struct udev_list subsystem_match_list;
+ struct udev_list subsystem_nomatch_list;
+ struct udev_list sysname_match_list;
+ struct udev_list properties_match_list;
+ struct udev_list tags_match_list;
+ struct udev_device *parent_match;
+ struct udev_list devices_list;
struct syspath *devices;
unsigned int devices_cur;
unsigned int devices_max;
*
* Returns: an enumeration context
**/
-struct udev_enumerate *udev_enumerate_new(struct udev *udev)
+UDEV_EXPORT struct udev_enumerate *udev_enumerate_new(struct udev *udev)
{
struct udev_enumerate *udev_enumerate;
return NULL;
udev_enumerate->refcount = 1;
udev_enumerate->udev = udev;
- udev_list_init(&udev_enumerate->sysattr_match_list);
- udev_list_init(&udev_enumerate->sysattr_nomatch_list);
- udev_list_init(&udev_enumerate->subsystem_match_list);
- udev_list_init(&udev_enumerate->subsystem_nomatch_list);
- udev_list_init(&udev_enumerate->sysname_match_list);
- udev_list_init(&udev_enumerate->properties_match_list);
- udev_list_init(&udev_enumerate->tags_match_list);
- udev_list_init(&udev_enumerate->devices_list);
+ udev_list_init(udev, &udev_enumerate->sysattr_match_list, false);
+ udev_list_init(udev, &udev_enumerate->sysattr_nomatch_list, false);
+ udev_list_init(udev, &udev_enumerate->subsystem_match_list, true);
+ udev_list_init(udev, &udev_enumerate->subsystem_nomatch_list, true);
+ udev_list_init(udev, &udev_enumerate->sysname_match_list, true);
+ udev_list_init(udev, &udev_enumerate->properties_match_list, false);
+ udev_list_init(udev, &udev_enumerate->tags_match_list, true);
+ udev_list_init(udev, &udev_enumerate->devices_list, false);
return udev_enumerate;
}
*
* Returns: the passed enumeration context
**/
-struct udev_enumerate *udev_enumerate_ref(struct udev_enumerate *udev_enumerate)
+UDEV_EXPORT struct udev_enumerate *udev_enumerate_ref(struct udev_enumerate *udev_enumerate)
{
if (udev_enumerate == NULL)
return NULL;
* Drop a reference of an enumeration context. If the refcount reaches zero,
* all resources of the enumeration context will be released.
**/
-void udev_enumerate_unref(struct udev_enumerate *udev_enumerate)
+UDEV_EXPORT void udev_enumerate_unref(struct udev_enumerate *udev_enumerate)
{
unsigned int i;
udev_enumerate->refcount--;
if (udev_enumerate->refcount > 0)
return;
- udev_list_cleanup_entries(udev_enumerate->udev, &udev_enumerate->sysattr_match_list);
- udev_list_cleanup_entries(udev_enumerate->udev, &udev_enumerate->sysattr_nomatch_list);
- udev_list_cleanup_entries(udev_enumerate->udev, &udev_enumerate->subsystem_match_list);
- udev_list_cleanup_entries(udev_enumerate->udev, &udev_enumerate->subsystem_nomatch_list);
- udev_list_cleanup_entries(udev_enumerate->udev, &udev_enumerate->sysname_match_list);
- udev_list_cleanup_entries(udev_enumerate->udev, &udev_enumerate->properties_match_list);
- udev_list_cleanup_entries(udev_enumerate->udev, &udev_enumerate->tags_match_list);
- udev_list_cleanup_entries(udev_enumerate->udev, &udev_enumerate->devices_list);
+ udev_list_cleanup(&udev_enumerate->sysattr_match_list);
+ udev_list_cleanup(&udev_enumerate->sysattr_nomatch_list);
+ udev_list_cleanup(&udev_enumerate->subsystem_match_list);
+ udev_list_cleanup(&udev_enumerate->subsystem_nomatch_list);
+ udev_list_cleanup(&udev_enumerate->sysname_match_list);
+ udev_list_cleanup(&udev_enumerate->properties_match_list);
+ udev_list_cleanup(&udev_enumerate->tags_match_list);
+ udev_device_unref(udev_enumerate->parent_match);
+ udev_list_cleanup(&udev_enumerate->devices_list);
for (i = 0; i < udev_enumerate->devices_cur; i++)
free(udev_enumerate->devices[i].syspath);
free(udev_enumerate->devices);
*
* Returns: the udev library context.
*/
-struct udev *udev_enumerate_get_udev(struct udev_enumerate *udev_enumerate)
+UDEV_EXPORT struct udev *udev_enumerate_get_udev(struct udev_enumerate *udev_enumerate)
{
if (udev_enumerate == NULL)
return NULL;
*
* Returns: the first entry of the sorted list of device paths.
*/
-struct udev_list_entry *udev_enumerate_get_list_entry(struct udev_enumerate *udev_enumerate)
+UDEV_EXPORT struct udev_list_entry *udev_enumerate_get_list_entry(struct udev_enumerate *udev_enumerate)
{
if (udev_enumerate == NULL)
return NULL;
struct syspath *prev = NULL, *move_later = NULL;
size_t move_later_prefix = 0;
- udev_list_cleanup_entries(udev_enumerate->udev, &udev_enumerate->devices_list);
+ udev_list_cleanup(&udev_enumerate->devices_list);
qsort(udev_enumerate->devices, udev_enumerate->devices_cur, sizeof(struct syspath), syspath_cmp);
max = udev_enumerate->devices_cur;
/* skip to be delayed devices, and add them to the end of the list */
if (devices_delay_end(udev_enumerate->udev, entry->syspath)) {
syspath_add(udev_enumerate, entry->syspath);
+ /* need to update prev here for the case realloc() gives a different address */
+ prev = &udev_enumerate->devices[i];
continue;
}
if (move_later &&
strncmp(entry->syspath, move_later->syspath, move_later_prefix) != 0) {
- udev_list_entry_add(udev_enumerate->udev, &udev_enumerate->devices_list,
- move_later->syspath, NULL, 0, 0);
+ udev_list_entry_add(&udev_enumerate->devices_list, move_later->syspath, NULL);
move_later = NULL;
}
- udev_list_entry_add(udev_enumerate->udev, &udev_enumerate->devices_list,
- entry->syspath, NULL, 0, 0);
+ udev_list_entry_add(&udev_enumerate->devices_list, entry->syspath, NULL);
}
if (move_later)
- udev_list_entry_add(udev_enumerate->udev, &udev_enumerate->devices_list,
- move_later->syspath, NULL, 0, 0);
+ udev_list_entry_add(&udev_enumerate->devices_list, move_later->syspath, NULL);
/* add and cleanup delayed devices from end of list */
for (i = max; i < udev_enumerate->devices_cur; i++) {
struct syspath *entry = &udev_enumerate->devices[i];
- udev_list_entry_add(udev_enumerate->udev, &udev_enumerate->devices_list,
- entry->syspath, NULL, 0, 0);
+ udev_list_entry_add(&udev_enumerate->devices_list, entry->syspath, NULL);
free(entry->syspath);
}
udev_enumerate->devices_cur = max;
*
* Returns: 0 on success, otherwise a negative error value.
*/
-int udev_enumerate_add_match_subsystem(struct udev_enumerate *udev_enumerate, const char *subsystem)
+UDEV_EXPORT int udev_enumerate_add_match_subsystem(struct udev_enumerate *udev_enumerate, const char *subsystem)
{
if (udev_enumerate == NULL)
return -EINVAL;
if (subsystem == NULL)
return 0;
- if (udev_list_entry_add(udev_enumerate_get_udev(udev_enumerate),
- &udev_enumerate->subsystem_match_list, subsystem, NULL, 1, 0) == NULL)
+ if (udev_list_entry_add(&udev_enumerate->subsystem_match_list, subsystem, NULL) == NULL)
return -ENOMEM;
return 0;
}
*
* Returns: 0 on success, otherwise a negative error value.
*/
-int udev_enumerate_add_nomatch_subsystem(struct udev_enumerate *udev_enumerate, const char *subsystem)
+UDEV_EXPORT int udev_enumerate_add_nomatch_subsystem(struct udev_enumerate *udev_enumerate, const char *subsystem)
{
if (udev_enumerate == NULL)
return -EINVAL;
if (subsystem == NULL)
return 0;
- if (udev_list_entry_add(udev_enumerate_get_udev(udev_enumerate),
- &udev_enumerate->subsystem_nomatch_list, subsystem, NULL, 1, 0) == NULL)
+ if (udev_list_entry_add(&udev_enumerate->subsystem_nomatch_list, subsystem, NULL) == NULL)
return -ENOMEM;
return 0;
}
*
* Returns: 0 on success, otherwise a negative error value.
*/
-int udev_enumerate_add_match_sysattr(struct udev_enumerate *udev_enumerate, const char *sysattr, const char *value)
+UDEV_EXPORT int udev_enumerate_add_match_sysattr(struct udev_enumerate *udev_enumerate, const char *sysattr, const char *value)
{
if (udev_enumerate == NULL)
return -EINVAL;
if (sysattr == NULL)
return 0;
- if (udev_list_entry_add(udev_enumerate_get_udev(udev_enumerate),
- &udev_enumerate->sysattr_match_list, sysattr, value, 0, 0) == NULL)
+ if (udev_list_entry_add(&udev_enumerate->sysattr_match_list, sysattr, value) == NULL)
return -ENOMEM;
return 0;
}
*
* Returns: 0 on success, otherwise a negative error value.
*/
-int udev_enumerate_add_nomatch_sysattr(struct udev_enumerate *udev_enumerate, const char *sysattr, const char *value)
+UDEV_EXPORT int udev_enumerate_add_nomatch_sysattr(struct udev_enumerate *udev_enumerate, const char *sysattr, const char *value)
{
if (udev_enumerate == NULL)
return -EINVAL;
if (sysattr == NULL)
return 0;
- if (udev_list_entry_add(udev_enumerate_get_udev(udev_enumerate),
- &udev_enumerate->sysattr_nomatch_list, sysattr, value, 0, 0) == NULL)
+ if (udev_list_entry_add(&udev_enumerate->sysattr_nomatch_list, sysattr, value) == NULL)
return -ENOMEM;
return 0;
}
*
* Returns: 0 on success, otherwise a negative error value.
*/
-int udev_enumerate_add_match_property(struct udev_enumerate *udev_enumerate, const char *property, const char *value)
+UDEV_EXPORT int udev_enumerate_add_match_property(struct udev_enumerate *udev_enumerate, const char *property, const char *value)
{
if (udev_enumerate == NULL)
return -EINVAL;
if (property == NULL)
return 0;
- if (udev_list_entry_add(udev_enumerate_get_udev(udev_enumerate),
- &udev_enumerate->properties_match_list, property, value, 0, 0) == NULL)
+ if (udev_list_entry_add(&udev_enumerate->properties_match_list, property, value) == NULL)
return -ENOMEM;
return 0;
}
*
* Returns: 0 on success, otherwise a negative error value.
*/
-int udev_enumerate_add_match_tag(struct udev_enumerate *udev_enumerate, const char *tag)
+UDEV_EXPORT int udev_enumerate_add_match_tag(struct udev_enumerate *udev_enumerate, const char *tag)
{
if (udev_enumerate == NULL)
return -EINVAL;
if (tag == NULL)
return 0;
- if (udev_list_entry_add(udev_enumerate_get_udev(udev_enumerate),
- &udev_enumerate->tags_match_list, tag, NULL, 1, 0) == NULL)
+ if (udev_list_entry_add(&udev_enumerate->tags_match_list, tag, NULL) == NULL)
return -ENOMEM;
return 0;
}
/**
+ * udev_enumerate_add_match_parent:
+ * @udev_enumerate: context
+ * @parent: parent device where to start searching
+ *
+ * Return the devices on the subtree of one given device. The parent
+ * itself is included in the list.
+ *
+ * A reference for the device is held until the udev_enumerate context
+ * is cleaned up.
+ *
+ * Returns: 0 on success, otherwise a negative error value.
+ */
+UDEV_EXPORT int udev_enumerate_add_match_parent(struct udev_enumerate *udev_enumerate, struct udev_device *parent)
+{
+ if (udev_enumerate == NULL)
+ return -EINVAL;
+ if (parent == NULL)
+ return 0;
+ if (udev_enumerate->parent_match != NULL)
+ udev_device_unref(udev_enumerate->parent_match);
+ udev_enumerate->parent_match = udev_device_ref(parent);
+ return 0;
+}
+
+/**
* udev_enumerate_add_match_is_initialized:
* @udev_enumerate: context
*
*
* Returns: 0 on success, otherwise a negative error value.
*/
-int udev_enumerate_add_match_is_initialized(struct udev_enumerate *udev_enumerate)
+UDEV_EXPORT int udev_enumerate_add_match_is_initialized(struct udev_enumerate *udev_enumerate)
{
if (udev_enumerate == NULL)
return -EINVAL;
*
* Returns: 0 on success, otherwise a negative error value.
*/
-int udev_enumerate_add_match_sysname(struct udev_enumerate *udev_enumerate, const char *sysname)
+UDEV_EXPORT int udev_enumerate_add_match_sysname(struct udev_enumerate *udev_enumerate, const char *sysname)
{
if (udev_enumerate == NULL)
return -EINVAL;
if (sysname == NULL)
return 0;
- if (udev_list_entry_add(udev_enumerate_get_udev(udev_enumerate),
- &udev_enumerate->sysname_match_list, sysname, NULL, 1, 0) == NULL)
+ if (udev_list_entry_add(&udev_enumerate->sysname_match_list, sysname, NULL) == NULL)
return -ENOMEM;
return 0;
}
return true;
}
+static bool match_parent(struct udev_enumerate *udev_enumerate, struct udev_device *dev)
+{
+ const char *parent;
+
+ if (udev_enumerate->parent_match == NULL)
+ return true;
+
+ parent = udev_device_get_devpath(udev_enumerate->parent_match);
+ return strncmp(parent, udev_device_get_devpath(dev), strlen(parent)) == 0;
+}
+
static bool match_sysname(struct udev_enumerate *udev_enumerate, const char *sysname)
{
struct udev_list_entry *list_entry;
(major(udev_device_get_devnum(dev)) > 0 || udev_device_get_ifindex(dev) > 0))
goto nomatch;
}
+ if (!match_parent(udev_enumerate, dev))
+ goto nomatch;
if (!match_tag(udev_enumerate, dev))
goto nomatch;
if (!match_property(udev_enumerate, dev))
*
* Returns: 0 on success, otherwise a negative error value.
*/
-int udev_enumerate_add_syspath(struct udev_enumerate *udev_enumerate, const char *syspath)
+UDEV_EXPORT int udev_enumerate_add_syspath(struct udev_enumerate *udev_enumerate, const char *syspath)
{
struct udev_device *udev_device;
return 0;
}
-/**
- * udev_enumerate_scan_devices:
- * @udev_enumerate: udev enumeration context
- *
- * Returns: 0 on success, otherwise a negative error value.
- **/
-int udev_enumerate_scan_devices(struct udev_enumerate *udev_enumerate)
+static int scan_devices_tags(struct udev_enumerate *udev_enumerate)
{
struct udev *udev = udev_enumerate_get_udev(udev_enumerate);
- char base[UTIL_PATH_SIZE];
- struct stat statbuf;
+ struct udev_list_entry *list_entry;
- if (udev_enumerate == NULL)
- return -EINVAL;
+ /* scan only tagged devices, use tags reverse-index, instead of searching all devices in /sys */
+ udev_list_entry_foreach(list_entry, udev_list_get_entry(&udev_enumerate->tags_match_list)) {
+ DIR *dir;
+ struct dirent *dent;
+ char path[UTIL_PATH_SIZE];
- if (udev_list_get_entry(&udev_enumerate->tags_match_list) != NULL) {
- struct udev_list_entry *list_entry;
+ util_strscpyl(path, sizeof(path), udev_get_run_path(udev), "/tags/",
+ udev_list_entry_get_name(list_entry), NULL);
+ dir = opendir(path);
+ if (dir == NULL)
+ continue;
+ for (dent = readdir(dir); dent != NULL; dent = readdir(dir)) {
+ struct udev_device *dev;
- /* scan only tagged devices, use tags reverse-index, instead of searching all devices in /sys */
- udev_list_entry_foreach(list_entry, udev_list_get_entry(&udev_enumerate->tags_match_list)) {
- DIR *dir;
- struct dirent *dent;
- char path[UTIL_PATH_SIZE];
+ if (dent->d_name[0] == '.')
+ continue;
- util_strscpyl(path, sizeof(path), udev_get_dev_path(udev), "/.udev/tags/",
- udev_list_entry_get_name(list_entry), NULL);
- dir = opendir(path);
- if (dir == NULL)
+ dev = udev_device_new_from_id_filename(udev_enumerate->udev, dent->d_name);
+ if (dev == NULL)
continue;
- for (dent = readdir(dir); dent != NULL; dent = readdir(dir)) {
- struct udev_device *dev;
- if (dent->d_name[0] == '.')
- continue;
+ if (!match_subsystem(udev_enumerate, udev_device_get_subsystem(dev)))
+ goto nomatch;
+ if (!match_sysname(udev_enumerate, udev_device_get_sysname(dev)))
+ goto nomatch;
+ if (!match_parent(udev_enumerate, dev))
+ goto nomatch;
+ if (!match_property(udev_enumerate, dev))
+ goto nomatch;
+ if (!match_sysattr(udev_enumerate, dev))
+ goto nomatch;
- dev = udev_device_new_from_id_filename(udev_enumerate->udev, dent->d_name);
- if (dev == NULL)
- continue;
- syspath_add(udev_enumerate, udev_device_get_syspath(dev));
- udev_device_unref(dev);
- }
- closedir(dir);
+ syspath_add(udev_enumerate, udev_device_get_syspath(dev));
+nomatch:
+ udev_device_unref(dev);
}
+ closedir(dir);
+ }
+ return 0;
+}
+
+static int parent_add_child(struct udev_enumerate *enumerate, const char *path)
+{
+ struct udev_device *dev;
+
+ dev = udev_device_new_from_syspath(enumerate->udev, path);
+ if (dev == NULL)
+ return -ENODEV;
+
+ if (!match_subsystem(enumerate, udev_device_get_subsystem(dev)))
+ return 0;
+ if (!match_sysname(enumerate, udev_device_get_sysname(dev)))
+ return 0;
+ if (!match_property(enumerate, dev))
+ return 0;
+ if (!match_sysattr(enumerate, dev))
+ return 0;
+
+ syspath_add(enumerate, udev_device_get_syspath(dev));
+ udev_device_unref(dev);
+ return 1;
+}
+
+static int parent_crawl_children(struct udev_enumerate *enumerate, const char *path, int maxdepth)
+{
+ DIR *d;
+ struct dirent *dent;
+
+ d = opendir(path);
+ if (d == NULL)
+ return -errno;
+
+ for (dent = readdir(d); dent != NULL; dent = readdir(d)) {
+ char *child;
+
+ if (dent->d_name[0] == '.')
+ continue;
+ if (dent->d_type != DT_DIR)
+ continue;
+ if (asprintf(&child, "%s/%s", path, dent->d_name) < 0)
+ continue;
+ parent_add_child(enumerate, child);
+ if (maxdepth > 0)
+ parent_crawl_children(enumerate, child, maxdepth-1);
+ free(child);
+ }
+
+ closedir(d);
+ return 0;
+}
+
+static int scan_devices_children(struct udev_enumerate *enumerate)
+{
+ const char *path;
+
+ path = udev_device_get_syspath(enumerate->parent_match);
+ parent_add_child(enumerate, path);
+ return parent_crawl_children(enumerate, path, 256);
+}
+
+static int scan_devices_all(struct udev_enumerate *udev_enumerate)
+{
+ struct udev *udev = udev_enumerate_get_udev(udev_enumerate);
+ char base[UTIL_PATH_SIZE];
+ struct stat statbuf;
+
+ util_strscpyl(base, sizeof(base), udev_get_sys_path(udev), "/subsystem", NULL);
+ if (stat(base, &statbuf) == 0) {
+ /* we have /subsystem/, forget all the old stuff */
+ dbg(udev, "searching '/subsystem/*/devices/*' dir\n");
+ scan_dir(udev_enumerate, "subsystem", "devices", NULL);
} else {
- util_strscpyl(base, sizeof(base), udev_get_sys_path(udev), "/subsystem", NULL);
- if (stat(base, &statbuf) == 0) {
- /* we have /subsystem/, forget all the old stuff */
- dbg(udev, "searching '/subsystem/*/devices/*' dir\n");
- scan_dir(udev_enumerate, "subsystem", "devices", NULL);
- } else {
dbg(udev, "searching '/bus/*/devices/*' dir\n");
- scan_dir(udev_enumerate, "bus", "devices", NULL);
- dbg(udev, "searching '/class/*' dir\n");
- scan_dir(udev_enumerate, "class", NULL, NULL);
- }
+ scan_dir(udev_enumerate, "bus", "devices", NULL);
+ dbg(udev, "searching '/class/*' dir\n");
+ scan_dir(udev_enumerate, "class", NULL, NULL);
}
-
return 0;
}
/**
+ * udev_enumerate_scan_devices:
+ * @udev_enumerate: udev enumeration context
+ *
+ * Returns: 0 on success, otherwise a negative error value.
+ **/
+UDEV_EXPORT int udev_enumerate_scan_devices(struct udev_enumerate *udev_enumerate)
+{
+ if (udev_enumerate == NULL)
+ return -EINVAL;
+
+ /* efficiently lookup tags only, we maintain a reverse-index */
+ if (udev_list_get_entry(&udev_enumerate->tags_match_list) != NULL)
+ return scan_devices_tags(udev_enumerate);
+
+ /* walk the subtree of one parent device only */
+ if (udev_enumerate->parent_match != NULL)
+ return scan_devices_children(udev_enumerate);
+
+ /* scan devices of all subsystems */
+ return scan_devices_all(udev_enumerate);
+}
+
+/**
* udev_enumerate_scan_subsystems:
* @udev_enumerate: udev enumeration context
*
* Returns: 0 on success, otherwise a negative error value.
**/
-int udev_enumerate_scan_subsystems(struct udev_enumerate *udev_enumerate)
+UDEV_EXPORT int udev_enumerate_scan_subsystems(struct udev_enumerate *udev_enumerate)
{
struct udev *udev = udev_enumerate_get_udev(udev_enumerate);
char base[UTIL_PATH_SIZE];
if (udev_enumerate == NULL)
return -EINVAL;
+ /* all kernel modules */
+ if (match_subsystem(udev_enumerate, "module")) {
+ dbg(udev, "searching '%s/modules/*' dir\n", subsysdir);
+ scan_dir_and_add_devices(udev_enumerate, "module", NULL, NULL);
+ }
+
util_strscpyl(base, sizeof(base), udev_get_sys_path(udev), "/subsystem", NULL);
if (stat(base, &statbuf) == 0)
subsysdir = "subsystem";
else
subsysdir = "bus";
+
+ /* all subsystems (only buses support coldplug) */
if (match_subsystem(udev_enumerate, "subsystem")) {
dbg(udev, "searching '%s/*' dir\n", subsysdir);
scan_dir_and_add_devices(udev_enumerate, subsysdir, NULL, NULL);
}
+
+ /* all subsystem drivers */
if (match_subsystem(udev_enumerate, "drivers")) {
dbg(udev, "searching '%s/*/drivers/*' dir\n", subsysdir);
scan_dir(udev_enumerate, subsysdir, "drivers", "drivers");
*/
struct udev_list_entry {
struct udev_list_node node;
- struct udev *udev;
- struct udev_list_node *list;
+ struct udev_list *list;
char *name;
char *value;
- unsigned int flags;
+ int num;
};
-/* list head point to itself if empty */
-void udev_list_init(struct udev_list_node *list)
+/* the list's head points to itself if empty */
+void udev_list_node_init(struct udev_list_node *list)
{
list->next = list;
list->prev = list;
}
-int udev_list_is_empty(struct udev_list_node *list)
+int udev_list_node_is_empty(struct udev_list_node *list)
{
return list->next == list;
}
return (struct udev_list_entry *)list;
}
-/* insert entry into a list as the last element */
-void udev_list_entry_append(struct udev_list_entry *new, struct udev_list_node *list)
+void udev_list_init(struct udev *udev, struct udev_list *list, bool unique)
{
- /* inserting before the list head make the node the last node in the list */
- udev_list_node_insert_between(&new->node, list->prev, list);
- new->list = list;
+ memset(list, 0x00, sizeof(struct udev_list));
+ list->udev = udev;
+ list->unique = unique;
+ udev_list_node_init(&list->node);
}
-/* remove entry from a list */
-void udev_list_entry_remove(struct udev_list_entry *entry)
+/* insert entry into a list as the last element */
+void udev_list_entry_append(struct udev_list_entry *new, struct udev_list *list)
{
- udev_list_node_remove(&entry->node);
- entry->list = NULL;
+ /* inserting before the list head make the node the last node in the list */
+ udev_list_node_insert_between(&new->node, list->node.prev, &list->node);
+ new->list = list;
}
/* insert entry into a list, before a given existing entry */
new->list = entry->list;
}
-struct udev_list_entry *udev_list_entry_add(struct udev *udev, struct udev_list_node *list,
- const char *name, const char *value,
- int unique, int sort)
+/* binary search in sorted array */
+static int list_search(struct udev_list *list, const char *name)
{
- struct udev_list_entry *entry_loop = NULL;
- struct udev_list_entry *entry_new;
-
- if (unique)
- udev_list_entry_foreach(entry_loop, udev_list_get_entry(list)) {
- if (strcmp(entry_loop->name, name) == 0) {
- dbg(udev, "'%s' is already in the list\n", name);
- free(entry_loop->value);
- if (value == NULL) {
- entry_loop->value = NULL;
- dbg(udev, "'%s' value unset\n", name);
- return entry_loop;
- }
- entry_loop->value = strdup(value);
- if (entry_loop->value == NULL)
- return NULL;
- dbg(udev, "'%s' value replaced with '%s'\n", name, value);
- return entry_loop;
- }
- }
+ unsigned int first, last;
+
+ first = 0;
+ last = list->entries_cur;
+ while (first < last) {
+ unsigned int i;
+ int cmp;
+
+ i = (first + last)/2;
+ cmp = strcmp(name, list->entries[i]->name);
+ if (cmp < 0)
+ last = i;
+ else if (cmp > 0)
+ first = i+1;
+ else
+ return i;
+ }
+
+ /* not found, return negative insertion-index+1 */
+ return -(first+1);
+}
- if (sort)
- udev_list_entry_foreach(entry_loop, udev_list_get_entry(list)) {
- if (strcmp(entry_loop->name, name) > 0)
- break;
+struct udev_list_entry *udev_list_entry_add(struct udev_list *list, const char *name, const char *value)
+{
+ struct udev_list_entry *entry;
+ int i = 0;
+
+ if (list->unique) {
+ /* lookup existing name or insertion-index */
+ i = list_search(list, name);
+ if (i >= 0) {
+ entry = list->entries[i];
+
+ dbg(list->udev, "'%s' is already in the list\n", name);
+ free(entry->value);
+ if (value == NULL) {
+ entry->value = NULL;
+ dbg(list->udev, "'%s' value unset\n", name);
+ return entry;
+ }
+ entry->value = strdup(value);
+ if (entry->value == NULL)
+ return NULL;
+ dbg(list->udev, "'%s' value replaced with '%s'\n", name, value);
+ return entry;
}
+ }
- entry_new = malloc(sizeof(struct udev_list_entry));
- if (entry_new == NULL)
+ /* add new name */
+ entry = calloc(1, sizeof(struct udev_list_entry));
+ if (entry == NULL)
return NULL;
- memset(entry_new, 0x00, sizeof(struct udev_list_entry));
- entry_new->udev = udev;
- entry_new->name = strdup(name);
- if (entry_new->name == NULL) {
- free(entry_new);
+ entry->name = strdup(name);
+ if (entry->name == NULL) {
+ free(entry);
return NULL;
}
if (value != NULL) {
- entry_new->value = strdup(value);
- if (entry_new->value == NULL) {
- free(entry_new->name);
- free(entry_new);
+ entry->value = strdup(value);
+ if (entry->value == NULL) {
+ free(entry->name);
+ free(entry);
return NULL;
}
}
- if (entry_loop != NULL)
- udev_list_entry_insert_before(entry_new, entry_loop);
- else
- udev_list_entry_append(entry_new, list);
- dbg(udev, "'%s=%s' added\n", entry_new->name, entry_new->value);
- return entry_new;
+
+ if (list->unique) {
+ /* allocate or enlarge sorted array if needed */
+ if (list->entries_cur >= list->entries_max) {
+ unsigned int add;
+
+ add = list->entries_max;
+ if (add < 1)
+ add = 64;
+ list->entries = realloc(list->entries, (list->entries_max + add) * sizeof(struct udev_list_entry *));
+ if (list->entries == NULL) {
+ free(entry->name);
+ free(entry->value);
+ return NULL;
+ }
+ list->entries_max += add;
+ }
+
+ /* the negative i returned the insertion index */
+ i = (-i)-1;
+
+ /* insert into sorted list */
+ if ((unsigned int)i < list->entries_cur)
+ udev_list_entry_insert_before(entry, list->entries[i]);
+ else
+ udev_list_entry_append(entry, list);
+
+ /* insert into sorted array */
+ memmove(&list->entries[i+1], &list->entries[i],
+ (list->entries_cur - i) * sizeof(struct udev_list_entry *));
+ list->entries[i] = entry;
+ list->entries_cur++;
+ } else {
+ udev_list_entry_append(entry, list);
+ }
+
+ dbg(list->udev, "'%s=%s' added\n", entry->name, entry->value);
+ return entry;
}
void udev_list_entry_delete(struct udev_list_entry *entry)
{
+ if (entry->list->entries != NULL) {
+ int i;
+ struct udev_list *list = entry->list;
+
+ /* remove entry from sorted array */
+ i = list_search(list, entry->name);
+ if (i >= 0) {
+ memmove(&list->entries[i], &list->entries[i+1],
+ ((list->entries_cur-1) - i) * sizeof(struct udev_list_entry *));
+ list->entries_cur--;
+ }
+ }
+
udev_list_node_remove(&entry->node);
free(entry->name);
free(entry->value);
free(entry);
}
-void udev_list_cleanup_entries(struct udev *udev, struct udev_list_node *list)
+void udev_list_cleanup(struct udev_list *list)
{
struct udev_list_entry *entry_loop;
struct udev_list_entry *entry_tmp;
+ free(list->entries);
+ list->entries = NULL;
+ list->entries_cur = 0;
+ list->entries_max = 0;
udev_list_entry_foreach_safe(entry_loop, entry_tmp, udev_list_get_entry(list))
udev_list_entry_delete(entry_loop);
}
-struct udev_list_entry *udev_list_get_entry(struct udev_list_node *list)
+struct udev_list_entry *udev_list_get_entry(struct udev_list *list)
{
- if (udev_list_is_empty(list))
+ if (udev_list_node_is_empty(&list->node))
return NULL;
- return list_node_to_entry(list->next);
+ return list_node_to_entry(list->node.next);
}
/**
*
* Returns: the next entry from the list, #NULL is no more entries are found.
*/
-struct udev_list_entry *udev_list_entry_get_next(struct udev_list_entry *list_entry)
+UDEV_EXPORT struct udev_list_entry *udev_list_entry_get_next(struct udev_list_entry *list_entry)
{
struct udev_list_node *next;
return NULL;
next = list_entry->node.next;
/* empty list or no more entries */
- if (next == list_entry->list)
+ if (next == &list_entry->list->node)
return NULL;
return list_node_to_entry(next);
}
*
* Returns: the entry where @name matched, #NULL if no matching entry is found.
*/
-struct udev_list_entry *udev_list_entry_get_by_name(struct udev_list_entry *list_entry, const char *name)
+UDEV_EXPORT struct udev_list_entry *udev_list_entry_get_by_name(struct udev_list_entry *list_entry, const char *name)
{
- struct udev_list_entry *entry;
+ int i;
- udev_list_entry_foreach(entry, list_entry) {
- if (strcmp(udev_list_entry_get_name(entry), name) == 0) {
- dbg(entry->udev, "found '%s=%s'\n", entry->name, entry->value);
- return entry;
- }
- }
- return NULL;
+ if (list_entry == NULL)
+ return NULL;
+
+ if (!list_entry->list->unique)
+ return NULL;
+
+ i = list_search(list_entry->list, name);
+ if (i < 0)
+ return NULL;
+ return list_entry->list->entries[i];
}
/**
*
* Returns: the name string of this entry.
*/
-const char *udev_list_entry_get_name(struct udev_list_entry *list_entry)
+UDEV_EXPORT const char *udev_list_entry_get_name(struct udev_list_entry *list_entry)
{
if (list_entry == NULL)
return NULL;
*
* Returns: the value string of this entry.
*/
-const char *udev_list_entry_get_value(struct udev_list_entry *list_entry)
+UDEV_EXPORT const char *udev_list_entry_get_value(struct udev_list_entry *list_entry)
{
if (list_entry == NULL)
return NULL;
return list_entry->value;
}
-unsigned int udev_list_entry_get_flags(struct udev_list_entry *list_entry)
+int udev_list_entry_get_num(struct udev_list_entry *list_entry)
{
if (list_entry == NULL)
return -EINVAL;
- return list_entry->flags;
+ return list_entry->num;
}
-void udev_list_entry_set_flags(struct udev_list_entry *list_entry, unsigned int flags)
+void udev_list_entry_set_num(struct udev_list_entry *list_entry, int num)
{
if (list_entry == NULL)
return;
- list_entry->flags = flags;
+ list_entry->num = num;
}
/**
* udev_monitor:
*
- * Opaque object handling one event source.
+ * Opaque object handling an event source.
*/
struct udev_monitor {
struct udev *udev;
struct sockaddr_nl snl_destination;
struct sockaddr_un sun;
socklen_t addrlen;
- struct udev_list_node filter_subsystem_list;
- struct udev_list_node filter_tag_list;
+ struct udev_list filter_subsystem_list;
+ struct udev_list filter_tag_list;
+ bool bound;
};
enum udev_monitor_netlink_group {
return NULL;
udev_monitor->refcount = 1;
udev_monitor->udev = udev;
- udev_list_init(&udev_monitor->filter_subsystem_list);
- udev_list_init(&udev_monitor->filter_tag_list);
+ udev_list_init(udev, &udev_monitor->filter_subsystem_list, false);
+ udev_list_init(udev, &udev_monitor->filter_tag_list, true);
return udev_monitor;
}
* @udev: udev library context
* @socket_path: unix socket path
*
- * Create new udev monitor and connect to a specified socket. The
+ * This function should not be used in any new application. The
+ * kernel's netlink socket multiplexes messages to all interested
+ * clients. Creating custom sockets from udev to applications
+ * should be avoided.
+ *
+ * Create a new udev monitor and connect to a specified socket. The
* path to a socket either points to an existing socket file, or if
* the socket path starts with a '@' character, an abstract namespace
* socket will be used.
*
* Returns: a new udev monitor, or #NULL, in case of an error
**/
-struct udev_monitor *udev_monitor_new_from_socket(struct udev *udev, const char *socket_path)
+UDEV_EXPORT struct udev_monitor *udev_monitor_new_from_socket(struct udev *udev, const char *socket_path)
{
struct udev_monitor *udev_monitor;
struct stat statbuf;
util_strscpy(&udev_monitor->sun.sun_path[1], sizeof(udev_monitor->sun.sun_path)-1, socket_path);
udev_monitor->addrlen = offsetof(struct sockaddr_un, sun_path) + strlen(socket_path)+1;
}
- udev_monitor->sock = socket(AF_LOCAL, SOCK_DGRAM|SOCK_CLOEXEC, 0);
+ udev_monitor->sock = socket(AF_LOCAL, SOCK_DGRAM|SOCK_NONBLOCK|SOCK_CLOEXEC, 0);
if (udev_monitor->sock == -1) {
err(udev, "error getting socket: %m\n");
free(udev_monitor);
return udev_monitor;
}
-/**
- * udev_monitor_new_from_netlink:
- * @udev: udev library context
- * @name: name of event source
- *
- * Create new udev monitor and connect to a specified event
- * source. Valid sources identifiers are "udev" and "kernel".
- *
- * Applications should usually not connect directly to the
- * "kernel" events, because the devices might not be useable
- * at that time, before udev has configured them, and created
- * device nodes.
- *
- * Accessing devices at the same time as udev, might result
- * in unpredictable behavior.
- *
- * The "udev" events are sent out after udev has finished its
- * event processing, all rules have been processed, and needed
- * device nodes are created.
- *
- * The initial refcount is 1, and needs to be decremented to
- * release the resources of the udev monitor.
- *
- * Returns: a new udev monitor, or #NULL, in case of an error
- **/
-struct udev_monitor *udev_monitor_new_from_netlink(struct udev *udev, const char *name)
+struct udev_monitor *udev_monitor_new_from_netlink_fd(struct udev *udev, const char *name, int fd)
{
struct udev_monitor *udev_monitor;
unsigned int group;
if (udev_monitor == NULL)
return NULL;
- udev_monitor->sock = socket(PF_NETLINK, SOCK_DGRAM|SOCK_CLOEXEC, NETLINK_KOBJECT_UEVENT);
- if (udev_monitor->sock == -1) {
- err(udev, "error getting socket: %m\n");
- free(udev_monitor);
- return NULL;
+ if (fd < 0) {
+ udev_monitor->sock = socket(PF_NETLINK, SOCK_RAW|SOCK_CLOEXEC|SOCK_NONBLOCK, NETLINK_KOBJECT_UEVENT);
+ if (udev_monitor->sock == -1) {
+ err(udev, "error getting socket: %m\n");
+ free(udev_monitor);
+ return NULL;
+ }
+ } else {
+ udev_monitor->bound = true;
+ udev_monitor->sock = fd;
}
udev_monitor->snl.nl_family = AF_NETLINK;
return udev_monitor;
}
+/**
+ * udev_monitor_new_from_netlink:
+ * @udev: udev library context
+ * @name: name of event source
+ *
+ * Create new udev monitor and connect to a specified event
+ * source. Valid sources identifiers are "udev" and "kernel".
+ *
+ * Applications should usually not connect directly to the
+ * "kernel" events, because the devices might not be useable
+ * at that time, before udev has configured them, and created
+ * device nodes. Accessing devices at the same time as udev,
+ * might result in unpredictable behavior. The "udev" events
+ * are sent out after udev has finished its event processing,
+ * all rules have been processed, and needed device nodes are
+ * created.
+ *
+ * The initial refcount is 1, and needs to be decremented to
+ * release the resources of the udev monitor.
+ *
+ * Returns: a new udev monitor, or #NULL, in case of an error
+ **/
+UDEV_EXPORT struct udev_monitor *udev_monitor_new_from_netlink(struct udev *udev, const char *name)
+{
+ return udev_monitor_new_from_netlink_fd(udev, name, -1);
+}
+
static inline void bpf_stmt(struct sock_filter *inss, unsigned int *i,
unsigned short code, unsigned int data)
{
* udev_monitor_filter_update:
* @udev_monitor: monitor
*
- * Update the installed filter. This might only be needed, if the filter was removed or changed.
+ * Update the installed socket filter. This is only needed,
+ * if the filter was removed or changed.
*
* Returns: 0 on success, otherwise a negative error value.
*/
-int udev_monitor_filter_update(struct udev_monitor *udev_monitor)
+UDEV_EXPORT int udev_monitor_filter_update(struct udev_monitor *udev_monitor)
{
struct sock_filter ins[512];
struct sock_fprog filter;
bpf_stmt(ins, &i, BPF_RET|BPF_K, 0xffffffff);
/* install filter */
+ memset(&filter, 0x00, sizeof(filter));
filter.len = i;
filter.filter = ins;
err = setsockopt(udev_monitor->sock, SOL_SOCKET, SO_ATTACH_FILTER, &filter, sizeof(filter));
*
* Returns: 0 on success, otherwise a negative error value.
*/
-int udev_monitor_enable_receiving(struct udev_monitor *udev_monitor)
+UDEV_EXPORT int udev_monitor_enable_receiving(struct udev_monitor *udev_monitor)
{
- int err;
+ int err = 0;
const int on = 1;
if (udev_monitor->sun.sun_family != 0) {
- err = bind(udev_monitor->sock,
- (struct sockaddr *)&udev_monitor->sun, udev_monitor->addrlen);
+ if (!udev_monitor->bound) {
+ err = bind(udev_monitor->sock,
+ (struct sockaddr *)&udev_monitor->sun, udev_monitor->addrlen);
+ if (err == 0)
+ udev_monitor->bound = true;
+ }
} else if (udev_monitor->snl.nl_family != 0) {
udev_monitor_filter_update(udev_monitor);
- err = bind(udev_monitor->sock,
- (struct sockaddr *)&udev_monitor->snl, sizeof(struct sockaddr_nl));
+ if (!udev_monitor->bound) {
+ err = bind(udev_monitor->sock,
+ (struct sockaddr *)&udev_monitor->snl, sizeof(struct sockaddr_nl));
+ if (err == 0)
+ udev_monitor->bound = true;
+ }
if (err == 0) {
struct sockaddr_nl snl;
socklen_t addrlen;
*
* Returns: 0 on success, otherwise -1 on error.
*/
-int udev_monitor_set_receive_buffer_size(struct udev_monitor *udev_monitor, int size)
+UDEV_EXPORT int udev_monitor_set_receive_buffer_size(struct udev_monitor *udev_monitor, int size)
{
if (udev_monitor == NULL)
return -1;
*
* Returns: the passed udev monitor
**/
-struct udev_monitor *udev_monitor_ref(struct udev_monitor *udev_monitor)
+UDEV_EXPORT struct udev_monitor *udev_monitor_ref(struct udev_monitor *udev_monitor)
{
if (udev_monitor == NULL)
return NULL;
* will be released.
*
**/
-void udev_monitor_unref(struct udev_monitor *udev_monitor)
+UDEV_EXPORT void udev_monitor_unref(struct udev_monitor *udev_monitor)
{
if (udev_monitor == NULL)
return;
return;
if (udev_monitor->sock >= 0)
close(udev_monitor->sock);
- udev_list_cleanup_entries(udev_monitor->udev, &udev_monitor->filter_subsystem_list);
- udev_list_cleanup_entries(udev_monitor->udev, &udev_monitor->filter_tag_list);
+ udev_list_cleanup(&udev_monitor->filter_subsystem_list);
+ udev_list_cleanup(&udev_monitor->filter_tag_list);
dbg(udev_monitor->udev, "monitor %p released\n", udev_monitor);
free(udev_monitor);
}
*
* Returns: the udev library context
**/
-struct udev *udev_monitor_get_udev(struct udev_monitor *udev_monitor)
+UDEV_EXPORT struct udev *udev_monitor_get_udev(struct udev_monitor *udev_monitor)
{
if (udev_monitor == NULL)
return NULL;
*
* Returns: the socket file descriptor
**/
-int udev_monitor_get_fd(struct udev_monitor *udev_monitor)
+UDEV_EXPORT int udev_monitor_get_fd(struct udev_monitor *udev_monitor)
{
if (udev_monitor == NULL)
return -1;
* Receive data from the udev monitor socket, allocate a new udev
* device, fill in the received data, and return the device.
*
- * Only socket connections with uid=0 are accepted. The caller
- * needs to make sure that there is data to read from the socket.
- * The call will block until the socket becomes readable.
+ * Only socket connections with uid=0 are accepted.
*
* The initial refcount is 1, and needs to be decremented to
* release the resources of the udev device.
*
* Returns: a new udev device, or #NULL, in case of an error
**/
-struct udev_device *udev_monitor_receive_device(struct udev_monitor *udev_monitor)
+UDEV_EXPORT struct udev_device *udev_monitor_receive_device(struct udev_monitor *udev_monitor)
{
struct udev_device *udev_device;
struct msghdr smsg;
/* udev message needs proper version magic */
nlh = (struct udev_monitor_netlink_header *) buf;
if (nlh->magic != htonl(UDEV_MONITOR_MAGIC)) {
- err(udev_monitor->udev, "ignored a message from an invalid release of udevadm (%x != %x)\n",
+ err(udev_monitor->udev, "unrecognized message signature (%x != %x)\n",
nlh->magic, htonl(UDEV_MONITOR_MAGIC));
return NULL;
}
* @subsystem: the subsystem value to match the incoming devices against
* @devtype: the devtype value to match the incoming devices against
*
- * This filer is efficiently executed inside the kernel, and libudev subscribers
+ * This filter is efficiently executed inside the kernel, and libudev subscribers
* will usually not be woken up for devices which do not match.
*
* The filter must be installed before the monitor is switched to listening mode.
*
* Returns: 0 on success, otherwise a negative error value.
*/
-int udev_monitor_filter_add_match_subsystem_devtype(struct udev_monitor *udev_monitor, const char *subsystem, const char *devtype)
+UDEV_EXPORT int udev_monitor_filter_add_match_subsystem_devtype(struct udev_monitor *udev_monitor, const char *subsystem, const char *devtype)
{
if (udev_monitor == NULL)
return -EINVAL;
if (subsystem == NULL)
return -EINVAL;
- if (udev_list_entry_add(udev_monitor->udev,
- &udev_monitor->filter_subsystem_list, subsystem, devtype, 0, 0) == NULL)
+ if (udev_list_entry_add(&udev_monitor->filter_subsystem_list, subsystem, devtype) == NULL)
return -ENOMEM;
return 0;
}
* @udev_monitor: the monitor
* @tag: the name of a tag
*
- * This filer is efficiently executed inside the kernel, and libudev subscribers
+ * This filter is efficiently executed inside the kernel, and libudev subscribers
* will usually not be woken up for devices which do not match.
*
* The filter must be installed before the monitor is switched to listening mode.
*
* Returns: 0 on success, otherwise a negative error value.
*/
-int udev_monitor_filter_add_match_tag(struct udev_monitor *udev_monitor, const char *tag)
+UDEV_EXPORT int udev_monitor_filter_add_match_tag(struct udev_monitor *udev_monitor, const char *tag)
{
if (udev_monitor == NULL)
return -EINVAL;
if (tag == NULL)
return -EINVAL;
- if (udev_list_entry_add(udev_monitor->udev,
- &udev_monitor->filter_tag_list, tag, NULL, 0, 0) == NULL)
+ if (udev_list_entry_add(&udev_monitor->filter_tag_list, tag, NULL) == NULL)
return -ENOMEM;
return 0;
}
*
* Returns: 0 on success, otherwise a negative error value.
*/
-int udev_monitor_filter_remove(struct udev_monitor *udev_monitor)
+UDEV_EXPORT int udev_monitor_filter_remove(struct udev_monitor *udev_monitor)
{
static struct sock_fprog filter = { 0, NULL };
- udev_list_cleanup_entries(udev_monitor->udev, &udev_monitor->filter_subsystem_list);
+ udev_list_cleanup(&udev_monitor->filter_subsystem_list);
return setsockopt(udev_monitor->sock, SOL_SOCKET, SO_ATTACH_FILTER, &filter, sizeof(filter));
}
# define err(udev, arg...) udev_log_null(udev, ## arg)
#endif
+#define UDEV_EXPORT __attribute__ ((visibility("default")))
+
static inline void udev_log_init(const char *program_name)
{
openlog(program_name, LOG_PID | LOG_CONS, LOG_DAEMON);
const char *format, ...)
__attribute__((format(printf, 6, 7)));
const char *udev_get_rules_path(struct udev *udev);
+const char *udev_get_run_config_path(struct udev *udev);
+const char *udev_set_run_path(struct udev *udev, const char *path);
struct udev_list_entry *udev_add_property(struct udev *udev, const char *key, const char *value);
struct udev_list_entry *udev_get_properties_list_entry(struct udev *udev);
/* libudev-device.c */
struct udev_device *udev_device_new(struct udev *udev);
struct udev_device *udev_device_new_from_id_filename(struct udev *udev, char *id);
+mode_t udev_device_get_devnode_mode(struct udev_device *udev_device);
int udev_device_set_syspath(struct udev_device *udev_device, const char *syspath);
-int udev_device_set_subsystem(struct udev_device *udev_device, const char *subsystem);
-int udev_device_set_devtype(struct udev_device *udev_device, const char *devtype);
int udev_device_set_devnode(struct udev_device *udev_device, const char *devnode);
int udev_device_add_devlink(struct udev_device *udev_device, const char *devlink, int unique);
void udev_device_cleanup_devlinks_list(struct udev_device *udev_device);
int udev_device_add_property_from_string_parse_finish(struct udev_device *udev_device);
char **udev_device_get_properties_envp(struct udev_device *udev_device);
ssize_t udev_device_get_properties_monitor_buf(struct udev_device *udev_device, const char **buf);
-int udev_device_read_db(struct udev_device *udev_device);
+int udev_device_read_db(struct udev_device *udev_device, const char *dbfile);
int udev_device_read_uevent_file(struct udev_device *udev_device);
int udev_device_set_action(struct udev_device *udev_device, const char *action);
-int udev_device_set_driver(struct udev_device *udev_device, const char *driver);
const char *udev_device_get_devpath_old(struct udev_device *udev_device);
-const char *udev_device_get_sysname_old(struct udev_device *udev_device);
-int udev_device_set_devpath_old(struct udev_device *udev_device, const char *devpath_old);
const char *udev_device_get_knodename(struct udev_device *udev_device);
const char *udev_device_get_id_filename(struct udev_device *udev_device);
void udev_device_set_is_initialized(struct udev_device *udev_device);
int udev_device_add_tag(struct udev_device *udev_device, const char *tag);
void udev_device_cleanup_tags_list(struct udev_device *udev_device);
-int udev_device_has_tag(struct udev_device *udev_device, const char *tag);
-int udev_device_set_knodename(struct udev_device *udev_device, const char *knodename);
int udev_device_get_timeout(struct udev_device *udev_device);
-int udev_device_set_timeout(struct udev_device *udev_device, int timeout);
-int udev_device_get_event_timeout(struct udev_device *udev_device);
-int udev_device_set_event_timeout(struct udev_device *udev_device, int event_timeout);
-int udev_device_set_devnum(struct udev_device *udev_device, dev_t devnum);
-int udev_device_set_seqnum(struct udev_device *udev_device, unsigned long long int seqnum);
unsigned long long udev_device_get_usec_initialized(struct udev_device *udev_device);
void udev_device_set_usec_initialized(struct udev_device *udev_device, unsigned long long usec_initialized);
int udev_device_get_devlink_priority(struct udev_device *udev_device);
int udev_device_get_watch_handle(struct udev_device *udev_device);
int udev_device_set_watch_handle(struct udev_device *udev_device, int handle);
int udev_device_get_ifindex(struct udev_device *udev_device);
-int udev_device_set_ifindex(struct udev_device *udev_device, int ifindex);
void udev_device_set_info_loaded(struct udev_device *device);
+bool udev_device_get_db_persist(struct udev_device *udev_device);
+void udev_device_set_db_persist(struct udev_device *udev_device);
/* libudev-device-private.c */
int udev_device_update_db(struct udev_device *udev_device);
int udev_monitor_allow_unicast_sender(struct udev_monitor *udev_monitor, struct udev_monitor *sender);
int udev_monitor_send_device(struct udev_monitor *udev_monitor,
struct udev_monitor *destination, struct udev_device *udev_device);
-
-/* libudev-ctrl.c - daemon runtime setup */
-struct udev_ctrl;
-struct udev_ctrl *udev_ctrl_new_from_socket(struct udev *udev, const char *socket_path);
-int udev_ctrl_enable_receiving(struct udev_ctrl *uctrl);
-struct udev_ctrl *udev_ctrl_ref(struct udev_ctrl *uctrl);
-void udev_ctrl_unref(struct udev_ctrl *uctrl);
-struct udev *udev_ctrl_get_udev(struct udev_ctrl *uctrl);
-int udev_ctrl_get_fd(struct udev_ctrl *uctrl);
-int udev_ctrl_send_set_log_level(struct udev_ctrl *uctrl, int priority);
-int udev_ctrl_send_stop_exec_queue(struct udev_ctrl *uctrl);
-int udev_ctrl_send_start_exec_queue(struct udev_ctrl *uctrl);
-int udev_ctrl_send_reload_rules(struct udev_ctrl *uctrl);
-int udev_ctrl_send_settle(struct udev_ctrl *uctrl);
-int udev_ctrl_send_set_env(struct udev_ctrl *uctrl, const char *key);
-int udev_ctrl_send_set_children_max(struct udev_ctrl *uctrl, int count);
-struct udev_ctrl_msg;
-struct udev_ctrl_msg *udev_ctrl_msg(struct udev_ctrl *uctrl);
-struct udev_ctrl_msg *udev_ctrl_receive_msg(struct udev_ctrl *uctrl);
-struct udev_ctrl_msg *udev_ctrl_msg_ref(struct udev_ctrl_msg *ctrl_msg);
-void udev_ctrl_msg_unref(struct udev_ctrl_msg *ctrl_msg);
-int udev_ctrl_get_set_log_level(struct udev_ctrl_msg *ctrl_msg);
-int udev_ctrl_get_stop_exec_queue(struct udev_ctrl_msg *ctrl_msg);
-int udev_ctrl_get_start_exec_queue(struct udev_ctrl_msg *ctrl_msg);
-int udev_ctrl_get_reload_rules(struct udev_ctrl_msg *ctrl_msg);
-pid_t udev_ctrl_get_settle(struct udev_ctrl_msg *ctrl_msg);
-const char *udev_ctrl_get_set_env(struct udev_ctrl_msg *ctrl_msg);
-int udev_ctrl_get_set_children_max(struct udev_ctrl_msg *ctrl_msg);
+struct udev_monitor *udev_monitor_new_from_netlink_fd(struct udev *udev, const char *name, int fd);
/* libudev-list.c */
struct udev_list_node {
struct udev_list_node *next, *prev;
};
-void udev_list_init(struct udev_list_node *list);
-int udev_list_is_empty(struct udev_list_node *list);
+struct udev_list {
+ struct udev *udev;
+ struct udev_list_node node;
+ struct udev_list_entry **entries;
+ unsigned int entries_cur;
+ unsigned int entries_max;
+ bool unique;
+};
+#define UDEV_LIST(list) struct udev_list_node list = { &(list), &(list) }
+void udev_list_node_init(struct udev_list_node *list);
+int udev_list_node_is_empty(struct udev_list_node *list);
void udev_list_node_append(struct udev_list_node *new, struct udev_list_node *list);
void udev_list_node_remove(struct udev_list_node *entry);
#define udev_list_node_foreach(node, list) \
for (node = (list)->next, tmp = (node)->next; \
node != list; \
node = tmp, tmp = (tmp)->next)
-struct udev_list_entry *udev_list_entry_add(struct udev *udev, struct udev_list_node *list,
- const char *name, const char *value,
- int unique, int sort);
+void udev_list_init(struct udev *udev, struct udev_list *list, bool unique);
+void udev_list_cleanup(struct udev_list *list);
+struct udev_list_entry *udev_list_get_entry(struct udev_list *list);
+struct udev_list_entry *udev_list_entry_add(struct udev_list *list, const char *name, const char *value);
void udev_list_entry_delete(struct udev_list_entry *entry);
-void udev_list_entry_remove(struct udev_list_entry *entry);
void udev_list_entry_insert_before(struct udev_list_entry *new, struct udev_list_entry *entry);
-void udev_list_entry_append(struct udev_list_entry *new, struct udev_list_node *list);
-void udev_list_cleanup_entries(struct udev *udev, struct udev_list_node *name_list);
-struct udev_list_entry *udev_list_get_entry(struct udev_list_node *list);
-unsigned int udev_list_entry_get_flags(struct udev_list_entry *list_entry);
-void udev_list_entry_set_flags(struct udev_list_entry *list_entry, unsigned int flags);
+void udev_list_entry_append(struct udev_list_entry *new, struct udev_list *list);
+int udev_list_entry_get_num(struct udev_list_entry *list_entry);
+void udev_list_entry_set_num(struct udev_list_entry *list_entry, int num);
#define udev_list_entry_foreach_safe(entry, tmp, first) \
for (entry = first, tmp = udev_list_entry_get_next(entry); \
entry != NULL; \
/* libudev-queue-private.c */
struct udev_queue_export *udev_queue_export_new(struct udev *udev);
-void udev_queue_export_unref(struct udev_queue_export *udev_queue_export);
+struct udev_queue_export *udev_queue_export_unref(struct udev_queue_export *udev_queue_export);
void udev_queue_export_cleanup(struct udev_queue_export *udev_queue_export);
int udev_queue_export_device_queued(struct udev_queue_export *udev_queue_export, struct udev_device *udev_device);
int udev_queue_export_device_finished(struct udev_queue_export *udev_queue_export, struct udev_device *udev_device);
-int udev_queue_export_device_failed(struct udev_queue_export *udev_queue_export, struct udev_device *udev_device);
/* libudev-util.c */
#define UTIL_PATH_SIZE 1024
#define UTIL_NAME_SIZE 512
#define UTIL_LINE_SIZE 16384
#define UDEV_ALLOWED_CHARS_INPUT "/ $%?,"
-ssize_t util_get_sys_subsystem(struct udev *udev, const char *syspath, char *subsystem, size_t size);
-ssize_t util_get_sys_driver(struct udev *udev, const char *syspath, char *driver, size_t size);
+ssize_t util_get_sys_core_link_value(struct udev *udev, const char *slink, const char *syspath, char *value, size_t size);
int util_resolve_sys_link(struct udev *udev, char *syspath, size_t size);
int util_log_priority(const char *priority);
size_t util_path_encode(const char *src, char *dest, size_t size);
size_t util_strpcpyl(char **dest, size_t size, const char *src, ...) __attribute__((sentinel));
size_t util_strscpy(char *dest, size_t size, const char *src);
size_t util_strscpyl(char *dest, size_t size, const char *src, ...) __attribute__((sentinel));
-int udev_util_replace_whitespace(const char *str, char *to, size_t len);
-int udev_util_replace_chars(char *str, const char *white);
-int udev_util_encode_string(const char *str, char *str_enc, size_t len);
+int util_replace_whitespace(const char *str, char *to, size_t len);
+int util_replace_chars(char *str, const char *white);
unsigned int util_string_hash32(const char *key);
uint64_t util_string_bloom64(const char *str);
/* libudev-util-private.c */
int util_create_path(struct udev *udev, const char *path);
+int util_create_path_selinux(struct udev *udev, const char *path);
int util_delete_path(struct udev *udev, const char *path);
int util_unlink_secure(struct udev *udev, const char *filename);
uid_t util_lookup_user(struct udev *udev, const char *user);
gid_t util_lookup_group(struct udev *udev, const char *group);
-int util_run_program(struct udev *udev, const char *command, char **envp,
- char *result, size_t ressize, size_t *reslen,
- const sigset_t *sigmask, bool reset_prio);
int util_resolve_subsys_kernel(struct udev *udev, const char *string,
char *result, size_t maxsize, int read_value);
-unsigned long long usec_monotonic(void);
+unsigned long long now_usec(void);
/* libudev-selinux-private.c */
#ifndef WITH_SELINUX
struct udev_queue_export {
struct udev *udev;
- int failed_count; /* number of failed events exported */
int queued_count; /* number of unfinished events exported in queue file */
FILE *queue_file;
unsigned long long int seqnum_max; /* earliest sequence number in queue file */
return udev_queue_export;
}
-void udev_queue_export_unref(struct udev_queue_export *udev_queue_export)
+struct udev_queue_export *udev_queue_export_unref(struct udev_queue_export *udev_queue_export)
{
if (udev_queue_export == NULL)
- return;
+ return NULL;
if (udev_queue_export->queue_file != NULL)
fclose(udev_queue_export->queue_file);
free(udev_queue_export);
+ return NULL;
}
void udev_queue_export_cleanup(struct udev_queue_export *udev_queue_export)
{
char filename[UTIL_PATH_SIZE];
- util_strscpyl(filename, sizeof(filename), udev_get_dev_path(udev_queue_export->udev), "/.udev/queue.tmp", NULL);
+ if (udev_queue_export == NULL)
+ return;
+ util_strscpyl(filename, sizeof(filename), udev_get_run_path(udev_queue_export->udev), "/queue.tmp", NULL);
unlink(filename);
-
- util_strscpyl(filename, sizeof(filename), udev_get_dev_path(udev_queue_export->udev), "/.udev/queue.bin", NULL);
+ util_strscpyl(filename, sizeof(filename), udev_get_run_path(udev_queue_export->udev), "/queue.bin", NULL);
unlink(filename);
}
devpaths->devpaths_size = range + 1;
/* read all records and populate the table */
- while(1) {
+ for (;;) {
if (udev_queue_read_seqnum(udev_queue_export->queue_file, &seqnum) < 0)
break;
n = seqnum - udev_queue_export->seqnum_max;
}
/* create new queue file */
- util_strscpyl(filename_tmp, sizeof(filename_tmp), udev_get_dev_path(udev_queue_export->udev), "/.udev/queue.tmp", NULL);
+ util_strscpyl(filename_tmp, sizeof(filename_tmp), udev_get_run_path(udev_queue_export->udev), "/queue.tmp", NULL);
new_queue_file = fopen(filename_tmp, "w+");
if (new_queue_file == NULL)
goto error;
goto error;
/* rename the new file on top of the old one */
- util_strscpyl(filename, sizeof(filename), udev_get_dev_path(udev_queue_export->udev), "/.udev/queue.bin", NULL);
+ util_strscpyl(filename, sizeof(filename), udev_get_run_path(udev_queue_export->udev), "/queue.bin", NULL);
if (rename(filename_tmp, filename) != 0)
goto error;
len = (devpath_len < USHRT_MAX) ? devpath_len : USHRT_MAX;
if (fwrite(&len, sizeof(unsigned short), 1, udev_queue_export->queue_file) != 1)
goto write_error;
- if (fwrite(devpath, 1, len, udev_queue_export->queue_file) != len)
- goto write_error;
+ if (len > 0) {
+ if (fwrite(devpath, 1, len, udev_queue_export->queue_file) != len)
+ goto write_error;
+ }
/* *must* flush output; caller may fork */
if (fflush(udev_queue_export->queue_file) != 0)
enum device_state {
DEVICE_QUEUED,
DEVICE_FINISHED,
- DEVICE_FAILED,
};
static inline size_t queue_record_size(size_t devpath_len)
int bytes;
int err;
+ /* FINISHED records have a zero length devpath */
if (state == DEVICE_QUEUED) {
devpath = udev_device_get_devpath(udev_device);
devpath_len = strlen(devpath);
return -1;
}
- /* when the queue file grows too large, garbage-collect and rebuild it */
- bytes = ftell(udev_queue_export->queue_file) + queue_record_size(devpath_len);
-
/* if we're removing the last event from the queue, that's the best time to rebuild it */
- if (state != DEVICE_QUEUED && udev_queue_export->queued_count == 1 && bytes > 2048) {
- /* because we don't need to read the old queue file */
+ if (state != DEVICE_QUEUED && udev_queue_export->queued_count == 1) {
+ /* we don't need to read the old queue file */
fclose(udev_queue_export->queue_file);
udev_queue_export->queue_file = NULL;
rebuild_queue_file(udev_queue_export);
}
/* try to rebuild the queue files before they grow larger than one page. */
+ bytes = ftell(udev_queue_export->queue_file) + queue_record_size(devpath_len);
if ((udev_queue_export->waste_bytes > bytes / 2) && bytes > 4096)
rebuild_queue_file(udev_queue_export);
return err;
}
-static void update_failed(struct udev_queue_export *udev_queue_export,
- struct udev_device *udev_device, enum device_state state)
-{
- struct udev *udev = udev_device_get_udev(udev_device);
- char filename[UTIL_PATH_SIZE];
-
- if (state != DEVICE_FAILED && udev_queue_export->failed_count == 0)
- return;
-
- /* location of failed file */
- util_strscpyl(filename, sizeof(filename), udev_get_dev_path(udev), "/.udev/failed/",
- udev_device_get_subsystem(udev_device), ":", udev_device_get_sysname(udev_device), NULL);
-
- switch (state) {
- case DEVICE_FAILED:
- /* record event in the failed directory */
- udev_queue_export->failed_count++;
- util_create_path(udev, filename);
- udev_selinux_setfscreatecon(udev, filename, S_IFLNK);
- symlink(udev_device_get_devpath(udev_device), filename);
- udev_selinux_resetfscreatecon(udev);
- break;
-
- case DEVICE_QUEUED:
- /* delete failed file */
- if (unlink(filename) == 0) {
- util_delete_path(udev, filename);
- udev_queue_export->failed_count--;
- }
- break;
-
- case DEVICE_FINISHED:
- break;
- }
-
- return;
-}
-
static int update(struct udev_queue_export *udev_queue_export,
struct udev_device *udev_device, enum device_state state)
{
- update_failed(udev_queue_export, udev_device, state);
-
if (update_queue(udev_queue_export, udev_device, state) != 0)
return -1;
{
return update(udev_queue_export, udev_device, DEVICE_FINISHED);
}
-
-int udev_queue_export_device_failed(struct udev_queue_export *udev_queue_export, struct udev_device *udev_device)
-{
- return update(udev_queue_export, udev_device, DEVICE_FAILED);
-}
struct udev_queue {
struct udev *udev;
int refcount;
- struct udev_list_node queue_list;
- struct udev_list_node failed_list;
+ struct udev_list queue_list;
};
/**
*
* Returns: the udev queue context, or #NULL on error.
**/
-struct udev_queue *udev_queue_new(struct udev *udev)
+UDEV_EXPORT struct udev_queue *udev_queue_new(struct udev *udev)
{
struct udev_queue *udev_queue;
return NULL;
udev_queue->refcount = 1;
udev_queue->udev = udev;
- udev_list_init(&udev_queue->queue_list);
- udev_list_init(&udev_queue->failed_list);
+ udev_list_init(udev, &udev_queue->queue_list, false);
return udev_queue;
}
*
* Returns: the same udev queue context.
**/
-struct udev_queue *udev_queue_ref(struct udev_queue *udev_queue)
+UDEV_EXPORT struct udev_queue *udev_queue_ref(struct udev_queue *udev_queue)
{
if (udev_queue == NULL)
return NULL;
* Drop a reference of a udev queue context. If the refcount reaches zero,
* the resources of the queue context will be released.
**/
-void udev_queue_unref(struct udev_queue *udev_queue)
+UDEV_EXPORT void udev_queue_unref(struct udev_queue *udev_queue)
{
if (udev_queue == NULL)
return;
udev_queue->refcount--;
if (udev_queue->refcount > 0)
return;
- udev_list_cleanup_entries(udev_queue->udev, &udev_queue->queue_list);
- udev_list_cleanup_entries(udev_queue->udev, &udev_queue->failed_list);
+ udev_list_cleanup(&udev_queue->queue_list);
free(udev_queue);
}
*
* Returns: the udev library context.
**/
-struct udev *udev_queue_get_udev(struct udev_queue *udev_queue)
+UDEV_EXPORT struct udev *udev_queue_get_udev(struct udev_queue *udev_queue)
{
if (udev_queue == NULL)
return NULL;
*
* Returns: the current kernel event sequence number.
**/
-unsigned long long int udev_queue_get_kernel_seqnum(struct udev_queue *udev_queue)
+UDEV_EXPORT unsigned long long int udev_queue_get_kernel_seqnum(struct udev_queue *udev_queue)
{
unsigned long long int seqnum;
char filename[UTIL_PATH_SIZE];
FILE *queue_file;
- util_strscpyl(filename, sizeof(filename), udev_get_dev_path(udev_queue->udev), "/.udev/queue.bin", NULL);
+ util_strscpyl(filename, sizeof(filename), udev_get_run_path(udev_queue->udev), "/queue.bin", NULL);
queue_file = fopen(filename, "re");
if (queue_file == NULL)
return NULL;
*
* Returns: the last known udev event sequence number.
**/
-unsigned long long int udev_queue_get_udev_seqnum(struct udev_queue *udev_queue)
+UDEV_EXPORT unsigned long long int udev_queue_get_udev_seqnum(struct udev_queue *udev_queue)
{
unsigned long long int seqnum_udev;
FILE *queue_file;
*
* Returns: a flag indicating if udev is active.
**/
-int udev_queue_get_udev_is_active(struct udev_queue *udev_queue)
+UDEV_EXPORT int udev_queue_get_udev_is_active(struct udev_queue *udev_queue)
{
unsigned long long int seqnum_start;
FILE *queue_file;
*
* Returns: a flag indicating if udev is currently handling events.
**/
-int udev_queue_get_queue_is_empty(struct udev_queue *udev_queue)
+UDEV_EXPORT int udev_queue_get_queue_is_empty(struct udev_queue *udev_queue)
{
unsigned long long int seqnum_kernel;
unsigned long long int seqnum_udev = 0;
* @start: first event sequence number
* @end: last event sequence number
*
- * Returns: if any of the sequence numbers in the given range is currently active.
+ * Returns: a flag indicating if any of the sequence numbers in the given range is currently active.
**/
-int udev_queue_get_seqnum_sequence_is_finished(struct udev_queue *udev_queue,
+UDEV_EXPORT int udev_queue_get_seqnum_sequence_is_finished(struct udev_queue *udev_queue,
unsigned long long int start, unsigned long long int end)
{
unsigned long long int seqnum;
* @udev_queue: udev queue context
* @seqnum: sequence number
*
- * Returns: a flag indicating if the given sequence number is handled.
+ * Returns: a flag indicating if the given sequence number is currently active.
**/
-int udev_queue_get_seqnum_is_finished(struct udev_queue *udev_queue, unsigned long long int seqnum)
+UDEV_EXPORT int udev_queue_get_seqnum_is_finished(struct udev_queue *udev_queue, unsigned long long int seqnum)
{
if (!udev_queue_get_seqnum_sequence_is_finished(udev_queue, seqnum, seqnum))
return 0;
*
* Returns: the first entry of the list of queued events.
**/
-struct udev_list_entry *udev_queue_get_queued_list_entry(struct udev_queue *udev_queue)
+UDEV_EXPORT struct udev_list_entry *udev_queue_get_queued_list_entry(struct udev_queue *udev_queue)
{
unsigned long long int seqnum;
FILE *queue_file;
if (udev_queue == NULL)
return NULL;
- udev_list_cleanup_entries(udev_queue->udev, &udev_queue->queue_list);
+ udev_list_cleanup(&udev_queue->queue_list);
queue_file = open_queue_file(udev_queue, &seqnum);
if (queue_file == NULL)
break;
if (len > 0) {
- udev_list_entry_add(udev_queue->udev, &udev_queue->queue_list, syspath, seqnum_str, 0, 0);
+ udev_list_entry_add(&udev_queue->queue_list, syspath, seqnum_str);
} else {
udev_list_entry_foreach(list_entry, udev_list_get_entry(&udev_queue->queue_list)) {
if (strcmp(seqnum_str, udev_list_entry_get_value(list_entry)) == 0) {
return udev_list_get_entry(&udev_queue->queue_list);
}
-/**
- * udev_queue_get_failed_list_entry:
- * @udev_queue: udev queue context
- *
- * Returns: the first entry of the list of recorded failed events.
- **/
-struct udev_list_entry *udev_queue_get_failed_list_entry(struct udev_queue *udev_queue)
+struct udev_list_entry *udev_queue_get_failed_list_entry(struct udev_queue *udev_queue);
+UDEV_EXPORT struct udev_list_entry *udev_queue_get_failed_list_entry(struct udev_queue *udev_queue)
{
- char path[UTIL_PATH_SIZE];
- DIR *dir;
- struct dirent *dent;
-
- if (udev_queue == NULL)
- return NULL;
- udev_list_cleanup_entries(udev_queue->udev, &udev_queue->failed_list);
- util_strscpyl(path, sizeof(path), udev_get_dev_path(udev_queue->udev), "/.udev/failed", NULL);
- dir = opendir(path);
- if (dir == NULL)
- return NULL;
- for (dent = readdir(dir); dent != NULL; dent = readdir(dir)) {
- char filename[UTIL_PATH_SIZE];
- char syspath[UTIL_PATH_SIZE];
- char *s;
- size_t l;
- ssize_t len;
- struct stat statbuf;
-
- if (dent->d_name[0] == '.')
- continue;
- s = syspath;
- l = util_strpcpyl(&s, sizeof(syspath), udev_get_sys_path(udev_queue->udev), NULL);
- len = readlinkat(dirfd(dir), dent->d_name, s, l);
- if (len <= 0 || (size_t)len == l)
- continue;
- s[len] = '\0';
- dbg(udev_queue->udev, "found '%s' [%s]\n", syspath, dent->d_name);
- util_strscpyl(filename, sizeof(filename), syspath, "/uevent", NULL);
- if (stat(filename, &statbuf) != 0)
- continue;
- udev_list_entry_add(udev_queue->udev, &udev_queue->failed_list, syspath, NULL, 0, 0);
- }
- closedir(dir);
- return udev_list_get_entry(&udev_queue->failed_list);
+ errno = ENOSYS;
+ return NULL;
}
#include <ctype.h>
#include <pwd.h>
#include <grp.h>
-#include <sys/wait.h>
#include <sys/param.h>
#include "libudev.h"
#include "libudev-private.h"
-int util_create_path(struct udev *udev, const char *path)
+static int create_path(struct udev *udev, const char *path, bool selinux)
{
char p[UTIL_PATH_SIZE];
char *pos;
return err;
dbg(udev, "mkdir '%s'\n", p);
- udev_selinux_setfscreatecon(udev, p, S_IFDIR|0755);
+ if (selinux)
+ udev_selinux_setfscreatecon(udev, p, S_IFDIR|0755);
err = mkdir(p, 0755);
if (err != 0) {
err = -errno;
err = -ENOTDIR;
}
}
- udev_selinux_resetfscreatecon(udev);
+ if (selinux)
+ udev_selinux_resetfscreatecon(udev);
return err;
}
+int util_create_path(struct udev *udev, const char *path)
+{
+ return create_path(udev, path, false);
+}
+
+int util_create_path_selinux(struct udev *udev, const char *path)
+{
+ return create_path(udev, path, true);
+}
+
int util_delete_path(struct udev *udev, const char *path)
{
char p[UTIL_PATH_SIZE];
uid_t util_lookup_user(struct udev *udev, const char *user)
{
char *endptr;
- int buflen = sysconf(_SC_GETPW_R_SIZE_MAX);
+ size_t buflen = sysconf(_SC_GETPW_R_SIZE_MAX);
char buf[buflen];
struct passwd pwbuf;
struct passwd *pw;
gid_t util_lookup_group(struct udev *udev, const char *group)
{
char *endptr;
- int buflen = sysconf(_SC_GETGR_R_SIZE_MAX);
+ size_t buflen = sysconf(_SC_GETGR_R_SIZE_MAX);
char *buf;
struct group grbuf;
struct group *gr;
udev_device_unref(dev);
return 0;
}
-
-int util_run_program(struct udev *udev, const char *command, char **envp,
- char *result, size_t ressize, size_t *reslen,
- const sigset_t *sigmask, bool reset_prio)
-{
- int status;
- int outpipe[2] = {-1, -1};
- int errpipe[2] = {-1, -1};
- pid_t pid;
- char arg[UTIL_PATH_SIZE];
- char program[UTIL_PATH_SIZE];
- char *argv[((sizeof(arg) + 1) / 2) + 1];
- int devnull;
- int i;
- int err = 0;
-
- info(udev, "'%s' started\n", command);
-
- /* build argv from command */
- util_strscpy(arg, sizeof(arg), command);
- i = 0;
- if (strchr(arg, ' ') != NULL) {
- char *pos = arg;
-
- while (pos != NULL && pos[0] != '\0') {
- if (pos[0] == '\'') {
- /* do not separate quotes */
- pos++;
- argv[i] = strsep(&pos, "\'");
- if (pos != NULL)
- while (pos[0] == ' ')
- pos++;
- } else {
- argv[i] = strsep(&pos, " ");
- if (pos != NULL)
- while (pos[0] == ' ')
- pos++;
- }
- dbg(udev, "arg[%i] '%s'\n", i, argv[i]);
- i++;
- }
- argv[i] = NULL;
- } else {
- argv[0] = arg;
- argv[1] = NULL;
- }
-
- /* prepare pipes from child to parent */
- if (result != NULL || udev_get_log_priority(udev) >= LOG_INFO) {
- if (pipe(outpipe) != 0) {
- err(udev, "pipe failed: %m\n");
- return -1;
- }
- }
- if (udev_get_log_priority(udev) >= LOG_INFO) {
- if (pipe(errpipe) != 0) {
- err(udev, "pipe failed: %m\n");
- return -1;
- }
- }
-
- /* allow programs in /lib/udev/ to be called without the path */
- if (argv[0][0] != '/') {
- util_strscpyl(program, sizeof(program), LIBEXECDIR "/", argv[0], NULL);
- argv[0] = program;
- }
-
- pid = fork();
- switch(pid) {
- case 0:
- /* child closes parent ends of pipes */
- if (outpipe[READ_END] > 0)
- close(outpipe[READ_END]);
- if (errpipe[READ_END] > 0)
- close(errpipe[READ_END]);
-
- /* discard child output or connect to pipe */
- devnull = open("/dev/null", O_RDWR);
- if (devnull > 0) {
- dup2(devnull, STDIN_FILENO);
- if (outpipe[WRITE_END] < 0)
- dup2(devnull, STDOUT_FILENO);
- if (errpipe[WRITE_END] < 0)
- dup2(devnull, STDERR_FILENO);
- close(devnull);
- } else
- err(udev, "open /dev/null failed: %m\n");
- if (outpipe[WRITE_END] > 0) {
- dup2(outpipe[WRITE_END], STDOUT_FILENO);
- close(outpipe[WRITE_END]);
- }
- if (errpipe[WRITE_END] > 0) {
- dup2(errpipe[WRITE_END], STDERR_FILENO);
- close(errpipe[WRITE_END]);
- }
-
- if (sigmask)
- sigprocmask(SIG_SETMASK, sigmask, NULL);
- if (reset_prio)
- setpriority(PRIO_PROCESS, 0, 0);
-
- execve(argv[0], argv, envp);
- if (errno == ENOENT || errno == ENOTDIR) {
- /* may be on a filesystem which is not mounted right now */
- info(udev, "program '%s' not found\n", argv[0]);
- } else {
- /* other problems */
- err(udev, "exec of program '%s' failed\n", argv[0]);
- }
- _exit(1);
- case -1:
- err(udev, "fork of '%s' failed: %m\n", argv[0]);
- return -1;
- default:
- /* read from child if requested */
- if (outpipe[READ_END] > 0 || errpipe[READ_END] > 0) {
- ssize_t count;
- size_t respos = 0;
-
- /* parent closes child ends of pipes */
- if (outpipe[WRITE_END] > 0)
- close(outpipe[WRITE_END]);
- if (errpipe[WRITE_END] > 0)
- close(errpipe[WRITE_END]);
-
- /* read child output */
- while (outpipe[READ_END] > 0 || errpipe[READ_END] > 0) {
- int fdcount;
- fd_set readfds;
-
- FD_ZERO(&readfds);
- if (outpipe[READ_END] > 0)
- FD_SET(outpipe[READ_END], &readfds);
- if (errpipe[READ_END] > 0)
- FD_SET(errpipe[READ_END], &readfds);
- fdcount = select(MAX(outpipe[READ_END], errpipe[READ_END])+1, &readfds, NULL, NULL, NULL);
- if (fdcount < 0) {
- if (errno == EINTR)
- continue;
- err = -1;
- break;
- }
-
- /* get stdout */
- if (outpipe[READ_END] > 0 && FD_ISSET(outpipe[READ_END], &readfds)) {
- char inbuf[1024];
- char *pos;
- char *line;
-
- count = read(outpipe[READ_END], inbuf, sizeof(inbuf)-1);
- if (count <= 0) {
- close(outpipe[READ_END]);
- outpipe[READ_END] = -1;
- if (count < 0) {
- err(udev, "stdin read failed: %m\n");
- err = -1;
- }
- continue;
- }
- inbuf[count] = '\0';
-
- /* store result for rule processing */
- if (result) {
- if (respos + count < ressize) {
- memcpy(&result[respos], inbuf, count);
- respos += count;
- } else {
- err(udev, "ressize %ld too short\n", (long)ressize);
- err = -1;
- }
- }
- pos = inbuf;
- while ((line = strsep(&pos, "\n")))
- if (pos || line[0] != '\0')
- info(udev, "'%s' (stdout) '%s'\n", argv[0], line);
- }
-
- /* get stderr */
- if (errpipe[READ_END] > 0 && FD_ISSET(errpipe[READ_END], &readfds)) {
- char errbuf[1024];
- char *pos;
- char *line;
-
- count = read(errpipe[READ_END], errbuf, sizeof(errbuf)-1);
- if (count <= 0) {
- close(errpipe[READ_END]);
- errpipe[READ_END] = -1;
- if (count < 0)
- err(udev, "stderr read failed: %m\n");
- continue;
- }
- errbuf[count] = '\0';
- pos = errbuf;
- while ((line = strsep(&pos, "\n")))
- if (pos || line[0] != '\0')
- info(udev, "'%s' (stderr) '%s'\n", argv[0], line);
- }
- }
- if (outpipe[READ_END] > 0)
- close(outpipe[READ_END]);
- if (errpipe[READ_END] > 0)
- close(errpipe[READ_END]);
-
- /* return the child's stdout string */
- if (result) {
- result[respos] = '\0';
- dbg(udev, "result='%s'\n", result);
- if (reslen)
- *reslen = respos;
- }
- }
- waitpid(pid, &status, 0);
- if (WIFEXITED(status)) {
- info(udev, "'%s' returned with exitcode %i\n", command, WEXITSTATUS(status));
- if (WEXITSTATUS(status) != 0)
- err = -1;
- } else {
- err(udev, "'%s' unexpected exit with status 0x%04x\n", command, status);
- err = -1;
- }
- }
- return err;
-}
/*
* libudev - interface to udev device information
*
- * Copyright (C) 2008-2009 Kay Sievers <kay.sievers@vrfy.org>
+ * Copyright (C) 2008-2011 Kay Sievers <kay.sievers@vrfy.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
#include "libudev.h"
#include "libudev-private.h"
-static ssize_t get_sys_link(struct udev *udev, const char *slink, const char *syspath, char *value, size_t size)
+/**
+ * SECTION:libudev-util
+ * @short_description: utils
+ */
+
+ssize_t util_get_sys_core_link_value(struct udev *udev, const char *slink, const char *syspath, char *value, size_t size)
{
char path[UTIL_PATH_SIZE];
char target[UTIL_PATH_SIZE];
return util_strscpy(value, size, pos);
}
-ssize_t util_get_sys_subsystem(struct udev *udev, const char *syspath, char *subsystem, size_t size)
-{
- return get_sys_link(udev, "subsystem", syspath, subsystem, size);
-}
-
-ssize_t util_get_sys_driver(struct udev *udev, const char *syspath, char *driver, size_t size)
-{
- return get_sys_link(udev, "driver", syspath, driver, size);
-}
-
int util_resolve_sys_link(struct udev *udev, char *syspath, size_t size)
{
char link_target[UTIL_PATH_SIZE];
return len;
}
-int udev_util_replace_whitespace(const char *str, char *to, size_t len)
+int util_replace_whitespace(const char *str, char *to, size_t len)
{
size_t i, j;
}
/* allow chars in whitelist, plain ascii, hex-escaping and valid utf8 */
-int udev_util_replace_chars(char *str, const char *white)
+int util_replace_chars(char *str, const char *white)
{
size_t i = 0;
int replaced = 0;
}
/**
- * util_encode_string:
+ * udev_util_encode_string:
* @str: input string to be encoded
* @str_enc: output string to store the encoded input string
* @len: maximum size of the output string, which may be
* four times as long as the input string
*
* Encode all potentially unsafe characters of a string to the
- * corresponding hex value prefixed by '\x'.
+ * corresponding 2 char hex value prefixed by '\x'.
*
* Returns: 0 if the entire string was copied, non-zero otherwise.
**/
-int udev_util_encode_string(const char *str, char *str_enc, size_t len)
+UDEV_EXPORT int udev_util_encode_string(const char *str, char *str_enc, size_t len)
{
size_t i, j;
#define USEC_PER_SEC 1000000ULL
#define NSEC_PER_USEC 1000ULL
-unsigned long long usec_monotonic(void)
+unsigned long long now_usec(void)
{
struct timespec ts;
char *sys_path;
char *dev_path;
char *rules_path;
- struct udev_list_node properties_list;
+ char *run_config_path;
+ char *run_path;
+ struct udev_list properties_list;
int log_priority;
};
*
* Returns: stored userdata
**/
-void *udev_get_userdata(struct udev *udev)
+UDEV_EXPORT void *udev_get_userdata(struct udev *udev)
{
if (udev == NULL)
return NULL;
*
* Store custom @userdata in the library context.
**/
-void udev_set_userdata(struct udev *udev, void *userdata)
+UDEV_EXPORT void udev_set_userdata(struct udev *udev, void *userdata)
{
if (udev == NULL)
return;
udev->userdata = userdata;
}
+static char *set_value(char **s, const char *v)
+{
+ free(*s);
+ *s = strdup(v);
+ util_remove_trailing_chars(*s, '/');
+ return *s;
+}
+
/**
* udev_new:
*
*
* Returns: a new udev library context
**/
-struct udev *udev_new(void)
+UDEV_EXPORT struct udev *udev_new(void)
{
struct udev *udev;
const char *env;
- char *config_file;
+ char *config_file = NULL;
FILE *f;
udev = calloc(1, sizeof(struct udev));
udev->refcount = 1;
udev->log_fn = log_stderr;
udev->log_priority = LOG_ERR;
- udev_list_init(&udev->properties_list);
- udev->dev_path = strdup("/dev");
- udev->sys_path = strdup("/sys");
- config_file = strdup(SYSCONFDIR "/udev/udev.conf");
- if (udev->dev_path == NULL ||
- udev->sys_path == NULL ||
- config_file == NULL)
- goto err;
-
- /* settings by environment and config file */
- env = getenv("SYSFS_PATH");
- if (env != NULL) {
- free(udev->sys_path);
- udev->sys_path = strdup(env);
- util_remove_trailing_chars(udev->sys_path, '/');
- udev_add_property(udev, "SYSFS_PATH", udev->sys_path);
- }
+ udev_list_init(udev, &udev->properties_list, true);
+ /* custom config file */
env = getenv("UDEV_CONFIG_FILE");
if (env != NULL) {
- free(config_file);
- config_file = strdup(env);
- util_remove_trailing_chars(config_file, '/');
+ if (set_value(&config_file, env) == NULL)
+ goto err;
+ udev_add_property(udev, "UDEV_CONFIG_FILE", config_file);
}
+
+ /* default config file */
+ if (config_file == NULL)
+ config_file = strdup(SYSCONFDIR "/udev/udev.conf");
if (config_file == NULL)
goto err;
+
f = fopen(config_file, "re");
if (f != NULL) {
char line[UTIL_LINE_SIZE];
continue;
}
if (strcmp(key, "udev_root") == 0) {
- free(udev->dev_path);
- udev->dev_path = strdup(val);
- util_remove_trailing_chars(udev->dev_path, '/');
+ set_value(&udev->dev_path, val);
+ continue;
+ }
+ if (strcmp(key, "udev_run") == 0) {
+ set_value(&udev->run_config_path, val);
continue;
}
if (strcmp(key, "udev_rules") == 0) {
- free(udev->rules_path);
- udev->rules_path = strdup(val);
- util_remove_trailing_chars(udev->rules_path, '/');
+ set_value(&udev->rules_path, val);
continue;
}
}
fclose(f);
}
+ /* environment overwrites config */
+ env = getenv("UDEV_LOG");
+ if (env != NULL)
+ udev_set_log_priority(udev, util_log_priority(env));
+
env = getenv("UDEV_ROOT");
if (env != NULL) {
- free(udev->dev_path);
- udev->dev_path = strdup(env);
- util_remove_trailing_chars(udev->dev_path, '/');
+ set_value(&udev->dev_path, env);
udev_add_property(udev, "UDEV_ROOT", udev->dev_path);
}
- env = getenv("UDEV_LOG");
- if (env != NULL)
- udev_set_log_priority(udev, util_log_priority(env));
+ env = getenv("SYSFS_PATH");
+ if (env != NULL) {
+ set_value(&udev->sys_path, env);
+ udev_add_property(udev, "SYSFS_PATH", udev->sys_path);
+ }
+
+ /* set defaults */
+ if (udev->dev_path == NULL)
+ if (set_value(&udev->dev_path, "/dev") == NULL)
+ goto err;
+
+ if (udev->sys_path == NULL)
+ if (set_value(&udev->sys_path, "/sys") == NULL)
+ goto err;
+
+ if (udev->run_config_path == NULL)
+ if (set_value(&udev->run_config_path, "/run/udev") == NULL)
+ goto err;
- if (udev->dev_path == NULL || udev->sys_path == NULL)
- goto err;
dbg(udev, "context %p created\n", udev);
dbg(udev, "log_priority=%d\n", udev->log_priority);
dbg(udev, "config_file='%s'\n", config_file);
dbg(udev, "dev_path='%s'\n", udev->dev_path);
dbg(udev, "sys_path='%s'\n", udev->sys_path);
+ dbg(udev, "run_path='%s'\n", udev->run_config_path);
if (udev->rules_path != NULL)
dbg(udev, "rules_path='%s'\n", udev->rules_path);
free(config_file);
*
* Returns: the passed udev library context
**/
-struct udev *udev_ref(struct udev *udev)
+UDEV_EXPORT struct udev *udev_ref(struct udev *udev)
{
if (udev == NULL)
return NULL;
* reaches zero, the resources of the context will be released.
*
**/
-void udev_unref(struct udev *udev)
+UDEV_EXPORT void udev_unref(struct udev *udev)
{
if (udev == NULL)
return;
udev->refcount--;
if (udev->refcount > 0)
return;
- udev_list_cleanup_entries(udev, &udev->properties_list);
+ udev_list_cleanup(&udev->properties_list);
free(udev->dev_path);
free(udev->sys_path);
free(udev->rules_path);
+ free(udev->run_path);
+ free(udev->run_config_path);
dbg(udev, "context %p released\n", udev);
free(udev);
}
* into the users' logging functionality.
*
**/
-void udev_set_log_fn(struct udev *udev,
+UDEV_EXPORT void udev_set_log_fn(struct udev *udev,
void (*log_fn)(struct udev *udev,
int priority, const char *file, int line, const char *fn,
const char *format, va_list args))
*
* Returns: the current logging priority
**/
-int udev_get_log_priority(struct udev *udev)
+UDEV_EXPORT int udev_get_log_priority(struct udev *udev)
{
return udev->log_priority;
}
* Set the current logging priority. The value controls which messages
* are logged.
**/
-void udev_set_log_priority(struct udev *udev, int priority)
+UDEV_EXPORT void udev_set_log_priority(struct udev *udev, int priority)
{
char num[32];
*
* Returns: the sys mount point
**/
-const char *udev_get_sys_path(struct udev *udev)
+UDEV_EXPORT const char *udev_get_sys_path(struct udev *udev)
{
if (udev == NULL)
return NULL;
*
* Returns: the device directory path
**/
-const char *udev_get_dev_path(struct udev *udev)
+UDEV_EXPORT const char *udev_get_dev_path(struct udev *udev)
{
if (udev == NULL)
return NULL;
return udev->dev_path;
}
+const char *udev_get_run_config_path(struct udev *udev)
+{
+ return udev->run_config_path;
+}
+
+/**
+ * udev_get_run_path:
+ * @udev: udev library context
+ *
+ * Retrieve the udev runtime directory path. The default is "/run/udev".
+ *
+ * Returns: the runtime directory path
+ **/
+UDEV_EXPORT const char *udev_get_run_path(struct udev *udev)
+{
+ if (udev->run_path != NULL)
+ return udev->run_path;
+
+ /* check if configured path exists */
+ if (access(udev->run_config_path, F_OK) < 0) {
+ char filename[UTIL_PATH_SIZE];
+
+ /* fall back to /dev/.udev if that exists */
+ util_strscpyl(filename, sizeof(filename), udev_get_dev_path(udev), "/.udev", NULL);
+ if (access(filename, F_OK) >= 0)
+ if (set_value(&udev->run_path, filename) != NULL)
+ return udev->run_path;
+ }
+
+ /* use default path */
+ set_value(&udev->run_path, udev->run_config_path);
+ if (udev->run_path == NULL)
+ return udev->run_config_path;
+ return udev->run_path;
+}
+
+const char *udev_set_run_path(struct udev *udev, const char *path)
+{
+ return set_value(&udev->run_path, path);
+}
+
struct udev_list_entry *udev_add_property(struct udev *udev, const char *key, const char *value)
{
if (value == NULL) {
udev_list_entry_delete(list_entry);
return NULL;
}
- return udev_list_entry_add(udev, &udev->properties_list, key, value, 1, 0);
+ return udev_list_entry_add(&udev->properties_list, key, value);
}
struct udev_list_entry *udev_get_properties_list_entry(struct udev *udev)
/*
* libudev - interface to udev device information
*
- * Copyright (C) 2008-2010 Kay Sievers <kay.sievers@vrfy.org>
+ * Copyright (C) 2008-2011 Kay Sievers <kay.sievers@vrfy.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
void udev_set_log_priority(struct udev *udev, int priority);
const char *udev_get_sys_path(struct udev *udev);
const char *udev_get_dev_path(struct udev *udev);
+const char *udev_get_run_path(struct udev *udev);
void *udev_get_userdata(struct udev *udev);
void udev_set_userdata(struct udev *udev, void *userdata);
struct udev_list_entry *udev_device_get_devlinks_list_entry(struct udev_device *udev_device);
struct udev_list_entry *udev_device_get_properties_list_entry(struct udev_device *udev_device);
struct udev_list_entry *udev_device_get_tags_list_entry(struct udev_device *udev_device);
+struct udev_list_entry *udev_device_get_sysattr_list_entry(struct udev_device *udev_device);
const char *udev_device_get_property_value(struct udev_device *udev_device, const char *key);
const char *udev_device_get_driver(struct udev_device *udev_device);
dev_t udev_device_get_devnum(struct udev_device *udev_device);
unsigned long long int udev_device_get_seqnum(struct udev_device *udev_device);
unsigned long long int udev_device_get_usec_since_initialized(struct udev_device *udev_device);
const char *udev_device_get_sysattr_value(struct udev_device *udev_device, const char *sysattr);
+int udev_device_has_tag(struct udev_device *udev_device, const char *tag);
/*
* udev_monitor
int udev_enumerate_add_match_property(struct udev_enumerate *udev_enumerate, const char *property, const char *value);
int udev_enumerate_add_match_sysname(struct udev_enumerate *udev_enumerate, const char *sysname);
int udev_enumerate_add_match_tag(struct udev_enumerate *udev_enumerate, const char *tag);
+int udev_enumerate_add_match_parent(struct udev_enumerate *udev_enumerate, struct udev_device *parent);
int udev_enumerate_add_match_is_initialized(struct udev_enumerate *udev_enumerate);
int udev_enumerate_add_syspath(struct udev_enumerate *udev_enumerate, const char *syspath);
/* run enumeration with active filters */
int udev_queue_get_seqnum_sequence_is_finished(struct udev_queue *udev_queue,
unsigned long long int start, unsigned long long int end);
struct udev_list_entry *udev_queue_get_queued_list_entry(struct udev_queue *udev_queue);
-struct udev_list_entry *udev_queue_get_failed_list_entry(struct udev_queue *udev_queue);
+
+/*
+ * udev_util
+ *
+ * udev specific utilities
+ */
+int udev_util_encode_string(const char *str, char *str_enc, size_t len);
+
#ifdef __cplusplus
} /* extern "C" */
#include <getopt.h>
#include <syslog.h>
#include <fcntl.h>
-#include <sys/select.h>
+#include <sys/epoll.h>
#include "libudev.h"
+#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
+
static void log_fn(struct udev *udev,
int priority, const char *file, int line, const char *fn,
const char *format, va_list args)
static int test_monitor(struct udev *udev)
{
- struct udev_monitor *udev_monitor;
- fd_set readfds;
- int fd;
+ struct udev_monitor *udev_monitor = NULL;
+ int fd_ep;
+ int fd_udev = -1;
+ struct epoll_event ep_udev, ep_stdin;
+
+ fd_ep = epoll_create1(EPOLL_CLOEXEC);
+ if (fd_ep < 0) {
+ printf("error creating epoll fd: %m\n");
+ goto out;
+ }
udev_monitor = udev_monitor_new_from_netlink(udev, "udev");
if (udev_monitor == NULL) {
printf("no socket\n");
- return -1;
+ goto out;
}
+ fd_udev = udev_monitor_get_fd(udev_monitor);
+
if (udev_monitor_filter_add_match_subsystem_devtype(udev_monitor, "block", NULL) < 0 ||
udev_monitor_filter_add_match_subsystem_devtype(udev_monitor, "tty", NULL) < 0 ||
udev_monitor_filter_add_match_subsystem_devtype(udev_monitor, "usb", "usb_device") < 0) {
printf("filter failed\n");
- return -1;
+ goto out;
}
+
if (udev_monitor_enable_receiving(udev_monitor) < 0) {
printf("bind failed\n");
- return -1;
+ goto out;
}
- fd = udev_monitor_get_fd(udev_monitor);
- FD_ZERO(&readfds);
+ memset(&ep_udev, 0, sizeof(struct epoll_event));
+ ep_udev.events = EPOLLIN;
+ ep_udev.data.fd = fd_udev;
+ if (epoll_ctl(fd_ep, EPOLL_CTL_ADD, fd_udev, &ep_udev) < 0) {
+ printf("fail to add fd to epoll: %m\n");
+ goto out;
+ }
+
+ memset(&ep_stdin, 0, sizeof(struct epoll_event));
+ ep_stdin.events = EPOLLIN;
+ ep_stdin.data.fd = STDIN_FILENO;
+ if (epoll_ctl(fd_ep, EPOLL_CTL_ADD, STDIN_FILENO, &ep_stdin) < 0) {
+ printf("fail to add fd to epoll: %m\n");
+ goto out;
+ }
for (;;) {
- struct udev_device *device;
int fdcount;
-
- FD_SET(STDIN_FILENO, &readfds);
- FD_SET(fd, &readfds);
+ struct epoll_event ev[4];
+ struct udev_device *device;
+ int i;
printf("waiting for events from udev, press ENTER to exit\n");
- fdcount = select(fd+1, &readfds, NULL, NULL, NULL);
- printf("select fd count: %i\n", fdcount);
-
- if (FD_ISSET(fd, &readfds)) {
- device = udev_monitor_receive_device(udev_monitor);
- if (device == NULL) {
- printf("no device from socket\n");
- continue;
+ fdcount = epoll_wait(fd_ep, ev, ARRAY_SIZE(ev), -1);
+ printf("epoll fd count: %i\n", fdcount);
+
+ for (i = 0; i < fdcount; i++) {
+ if (ev[i].data.fd == fd_udev && ev[i].events & EPOLLIN) {
+ device = udev_monitor_receive_device(udev_monitor);
+ if (device == NULL) {
+ printf("no device from socket\n");
+ continue;
+ }
+ print_device(device);
+ udev_device_unref(device);
+ } else if (ev[i].data.fd == STDIN_FILENO && ev[i].events & EPOLLIN) {
+ printf("exiting loop\n");
+ goto out;
}
- print_device(device);
- udev_device_unref(device);
- }
-
- if (FD_ISSET(STDIN_FILENO, &readfds)) {
- printf("exiting loop\n");
- break;
}
}
-
+out:
+ if (fd_ep >= 0)
+ close(fd_ep);
udev_monitor_unref(udev_monitor);
return 0;
}
udev_list_entry_foreach(list_entry, udev_queue_get_queued_list_entry(udev_queue))
printf("queued: '%s' [%s]\n", udev_list_entry_get_name(list_entry), udev_list_entry_get_value(list_entry));
printf("\n");
- printf("get failed list\n");
- udev_list_entry_foreach(list_entry, udev_queue_get_failed_list_entry(udev_queue))
- printf("failed: '%s'\n", udev_list_entry_get_name(list_entry));
- printf("\n");
list_entry = udev_queue_get_queued_list_entry(udev_queue);
if (list_entry != NULL) {
for (;;) {
int option;
- option = getopt_long(argc, argv, "+dhV", options, NULL);
+ option = getopt_long(argc, argv, "+p:s:dhV", options, NULL);
if (option == -1)
break;
dnl GTK_DOC_CHECK([minimum-gtk-doc-version])
AC_DEFUN([GTK_DOC_CHECK],
[
+ AC_REQUIRE([PKG_PROG_PKG_CONFIG])
AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first
AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first
AC_MSG_ERROR([gtk-doc not installed and --enable-gtk-doc requested]))],
[PKG_CHECK_EXISTS([gtk-doc >= $1],,
AC_MSG_ERROR([You need to have gtk-doc >= $1 installed to build $PACKAGE_NAME]))])
+ dnl don't check for glib if we build glib
+ if test "x$PACKAGE_NAME" != "xglib"; then
+ dnl don't fail if someone does not have glib
+ PKG_CHECK_MODULES(GTKDOC_DEPS, glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0,,)
+ fi
fi
AC_MSG_CHECKING([whether to build gtk-doc documentation])
# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
#
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-# 2006, 2007, 2008 Free Software Foundation, Inc.
+# 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
+# Inc.
# Written by Gordon Matzigkeit, 1996
#
# This file is free software; the Free Software Foundation gives
m4_define([_LT_COPYING], [dnl
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-# 2006, 2007, 2008 Free Software Foundation, Inc.
+# 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
+# Inc.
# Written by Gordon Matzigkeit, 1996
#
# This file is part of GNU Libtool.
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
])
-# serial 56 LT_INIT
+# serial 57 LT_INIT
# LT_PREREQ(VERSION)
# ------------------
AC_DEFUN([LT_INIT],
[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
+AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
AC_BEFORE([$0], [LT_LANG])dnl
AC_BEFORE([$0], [LT_OUTPUT])dnl
AC_BEFORE([$0], [LTDL_INIT])dnl
AC_REQUIRE([LTOBSOLETE_VERSION])dnl
m4_require([_LT_PROG_LTMAIN])dnl
+_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
+
dnl Parse OPTIONS
_LT_SET_OPTIONS([$0], [$1])
*) break;;
esac
done
-cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
])
m4_defun([_LT_SETUP],
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
+AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
+
_LT_DECL([], [host_alias], [0], [The host system])dnl
_LT_DECL([], [host], [0])dnl
_LT_DECL([], [host_os], [0])dnl
dnl
m4_require([_LT_FILEUTILS_DEFAULTS])dnl
m4_require([_LT_CHECK_SHELL_FEATURES])dnl
+m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
m4_require([_LT_CMD_RELOAD])dnl
m4_require([_LT_CHECK_MAGIC_METHOD])dnl
+m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
m4_require([_LT_CMD_OLD_ARCHIVE])dnl
m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
+m4_require([_LT_WITH_SYSROOT])dnl
_LT_CONFIG_LIBTOOL_INIT([
# See if we are running on zsh, and set the options which allow our
_LT_CHECK_OBJDIR
m4_require([_LT_TAG_COMPILER])dnl
-_LT_PROG_ECHO_BACKSLASH
case $host_os in
aix3*)
;;
esac
-# Sed substitution that helps us do robust quoting. It backslashifies
-# metacharacters that are still active within double-quoted strings.
-sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
-
-# Same as above, but do not quote variable references.
-double_quote_subst='s/\([["`\\]]\)/\\\1/g'
-
-# Sed substitution to delay expansion of an escaped shell variable in a
-# double_quote_subst'ed string.
-delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
-
-# Sed substitution to delay expansion of an escaped single quote.
-delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
-
-# Sed substitution to avoid accidental globbing in evaled expressions
-no_glob_subst='s/\*/\\\*/g'
-
# Global variables:
ofile=libtool
can_build_shared=yes
])# _LT_SETUP
+# _LT_PREPARE_SED_QUOTE_VARS
+# --------------------------
+# Define a few sed substitution that help us do robust quoting.
+m4_defun([_LT_PREPARE_SED_QUOTE_VARS],
+[# Backslashify metacharacters that are still active within
+# double-quoted strings.
+sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\([["`\\]]\)/\\\1/g'
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to delay expansion of an escaped single quote.
+delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+])
+
# _LT_PROG_LTMAIN
# ---------------
# Note that this code is called both from `configure', and `config.status'
# declaration there will have the same value as in `configure'. VARNAME
# must have a single quote delimited value for this to work.
m4_define([_LT_CONFIG_STATUS_DECLARE],
-[$1='`$ECHO "X$][$1" | $Xsed -e "$delay_single_quote_subst"`'])
+[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
# _LT_CONFIG_STATUS_DECLARATIONS
# embedded single quotes properly. In configure, this macro expands
# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
#
-# <var>='`$ECHO "X$<var>" | $Xsed -e "$delay_single_quote_subst"`'
+# <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
[m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
LTCFLAGS='$LTCFLAGS'
compiler='$compiler_DEFAULT'
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+ eval 'cat <<_LTECHO_EOF
+\$[]1
+_LTECHO_EOF'
+}
+
# Quote evaled strings.
for var in lt_decl_all_varnames([[ \
]], lt_decl_quote_varnames); do
- case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
+ case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
*[[\\\\\\\`\\"\\\$]]*)
- eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
;;
*)
eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
# Double-quote double-evaled strings.
for var in lt_decl_all_varnames([[ \
]], lt_decl_dquote_varnames); do
- case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
+ case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
*[[\\\\\\\`\\"\\\$]]*)
- eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
;;
*)
eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
esac
done
-# Fix-up fallback echo if it was mangled by the above quoting rules.
-case \$lt_ECHO in
-*'\\\[$]0 --fallback-echo"')dnl "
- lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\`
- ;;
-esac
-
_LT_OUTPUT_LIBTOOL_INIT
])
+# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
+# ------------------------------------
+# Generate a child script FILE with all initialization necessary to
+# reuse the environment learned by the parent script, and make the
+# file executable. If COMMENT is supplied, it is inserted after the
+# `#!' sequence but before initialization text begins. After this
+# macro, additional text can be appended to FILE to form the body of
+# the child script. The macro ends with non-zero status if the
+# file could not be fully written (such as if the disk is full).
+m4_ifdef([AS_INIT_GENERATED],
+[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
+[m4_defun([_LT_GENERATED_FILE_INIT],
+[m4_require([AS_PREPARE])]dnl
+[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
+[lt_write_fail=0
+cat >$1 <<_ASEOF || lt_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+$2
+SHELL=\${CONFIG_SHELL-$SHELL}
+export SHELL
+_ASEOF
+cat >>$1 <<\_ASEOF || lt_write_fail=1
+AS_SHELL_SANITIZE
+_AS_PREPARE
+exec AS_MESSAGE_FD>&1
+_ASEOF
+test $lt_write_fail = 0 && chmod +x $1[]dnl
+m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
# LT_OUTPUT
# ---------
AC_DEFUN([LT_OUTPUT],
[: ${CONFIG_LT=./config.lt}
AC_MSG_NOTICE([creating $CONFIG_LT])
-cat >"$CONFIG_LT" <<_LTEOF
-#! $SHELL
-# Generated by $as_me.
-# Run this file to recreate a libtool stub with the current configuration.
-
-lt_cl_silent=false
-SHELL=\${CONFIG_SHELL-$SHELL}
-_LTEOF
+_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
+[# Run this file to recreate a libtool stub with the current configuration.])
cat >>"$CONFIG_LT" <<\_LTEOF
-AS_SHELL_SANITIZE
-_AS_PREPARE
-
-exec AS_MESSAGE_FD>&1
+lt_cl_silent=false
exec AS_MESSAGE_LOG_FD>>config.log
{
echo
m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
configured by $[0], generated by m4_PACKAGE_STRING.
-Copyright (C) 2008 Free Software Foundation, Inc.
+Copyright (C) 2010 Free Software Foundation, Inc.
This config.lt script is free software; the Free Software Foundation
gives unlimited permision to copy, distribute and modify it."
# appending to config.log, which fails on DOS, as config.log is still kept
# open by configure. Here we exec the FD to /dev/null, effectively closing
# config.log, so it can be properly (re)opened and appended to by config.lt.
-if test "$no_create" != yes; then
- lt_cl_success=:
- test "$silent" = yes &&
- lt_config_lt_args="$lt_config_lt_args --quiet"
- exec AS_MESSAGE_LOG_FD>/dev/null
- $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
- exec AS_MESSAGE_LOG_FD>>config.log
- $lt_cl_success || AS_EXIT(1)
-fi
+lt_cl_success=:
+test "$silent" = yes &&
+ lt_config_lt_args="$lt_config_lt_args --quiet"
+exec AS_MESSAGE_LOG_FD>/dev/null
+$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
+exec AS_MESSAGE_LOG_FD>>config.log
+$lt_cl_success || AS_EXIT(1)
])# LT_OUTPUT
# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
# NOTE: Changes made to this file will be lost: look at ltmain.sh.
#
_LT_COPYING
# if finds mixed CR/LF and LF-only lines. Since sed operates in
# text mode, it properly converts lines to CR/LF. This bash problem
# is reportedly fixed, but why not run on old versions too?
- sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
- || (rm -f "$cfgfile"; exit 1)
+ sed '$q' "$ltmain" >> "$cfgfile" \
+ || (rm -f "$cfgfile"; exit 1)
- _LT_PROG_XSI_SHELLFNS
+ _LT_PROG_REPLACE_SHELLFNS
- sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
- || (rm -f "$cfgfile"; exit 1)
-
- mv -f "$cfgfile" "$ofile" ||
+ mv -f "$cfgfile" "$ofile" ||
(rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
chmod +x "$ofile"
],
AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
+AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
dnl AC_DEFUN([AC_LIBTOOL_F77], [])
dnl AC_DEFUN([AC_LIBTOOL_FC], [])
dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
+dnl AC_DEFUN([AC_LIBTOOL_RC], [])
# _LT_TAG_COMPILER
[lt_cv_ld_exported_symbols_list=no])
LDFLAGS="$save_LDFLAGS"
])
+ AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
+ [lt_cv_ld_force_load=no
+ cat > conftest.c << _LT_EOF
+int forced_loaded() { return 2;}
+_LT_EOF
+ echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
+ $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
+ echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
+ $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
+ echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
+ $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
+ cat > conftest.c << _LT_EOF
+int main() { return 0;}
+_LT_EOF
+ echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
+ $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
+ _lt_result=$?
+ if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then
+ lt_cv_ld_force_load=yes
+ else
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ fi
+ rm -f conftest.err libconftest.a conftest conftest.c
+ rm -rf conftest.dSYM
+ ])
case $host_os in
rhapsody* | darwin1.[[012]])
_lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
else
_lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
fi
- if test "$DSYMUTIL" != ":"; then
+ if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
_lt_dsymutil='~$DSYMUTIL $lib || :'
else
_lt_dsymutil=
_LT_TAGVAR(hardcode_direct, $1)=no
_LT_TAGVAR(hardcode_automatic, $1)=yes
_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
- _LT_TAGVAR(whole_archive_flag_spec, $1)=''
+ if test "$lt_cv_ld_force_load" = "yes"; then
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+ else
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=''
+ fi
_LT_TAGVAR(link_all_deplibs, $1)=yes
_LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
case $cc_basename in
*) _lt_dar_can_shared=$GCC ;;
esac
if test "$_lt_dar_can_shared" = "yes"; then
- output_verbose_link_cmd=echo
+ output_verbose_link_cmd=func_echo_all
_LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
_LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
_LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
fi
])
-# _LT_SYS_MODULE_PATH_AIX
-# -----------------------
+# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
+# ----------------------------------
# Links a minimal program and checks the executable
# for the system default hardcoded library path. In most cases,
# this is /usr/lib:/lib, but when the MPI compilers are used
# the location of the communication and MPI libs are included too.
# If we don't find anything, use the default library path according
# to the aix ld manual.
+# Store the results from the different compilers for each TAGNAME.
+# Allow to override them for all tags through lt_cv_aix_libpath.
m4_defun([_LT_SYS_MODULE_PATH_AIX],
[m4_require([_LT_DECL_SED])dnl
-AC_LINK_IFELSE(AC_LANG_PROGRAM,[
-lt_aix_libpath_sed='
- /Import File Strings/,/^$/ {
- /^0/ {
- s/^0 *\(.*\)$/\1/
- p
- }
- }'
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then
- aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-fi],[])
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+if test "${lt_cv_aix_libpath+set}" = set; then
+ aix_libpath=$lt_cv_aix_libpath
+else
+ AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
+ [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
+ lt_aix_libpath_sed='[
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\([^ ]*\) *$/\1/
+ p
+ }
+ }]'
+ _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ # Check for a 64-bit object if we didn't find anything.
+ if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
+ _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ fi],[])
+ if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
+ _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
+ fi
+ ])
+ aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
+fi
])# _LT_SYS_MODULE_PATH_AIX
# _LT_SHELL_INIT(ARG)
# -------------------
m4_define([_LT_SHELL_INIT],
-[ifdef([AC_DIVERSION_NOTICE],
- [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
- [AC_DIVERT_PUSH(NOTICE)])
-$1
-AC_DIVERT_POP
-])# _LT_SHELL_INIT
+[m4_divert_text([M4SH-INIT], [$1
+])])# _LT_SHELL_INIT
+
# _LT_PROG_ECHO_BACKSLASH
# -----------------------
-# Add some code to the start of the generated configure script which
-# will find an echo command which doesn't interpret backslashes.
+# Find how we can fake an echo command that does not interpret backslash.
+# In particular, with Autoconf 2.60 or later we add some code to the start
+# of the generated configure script which will find a shell with a builtin
+# printf (which we can use as an echo command).
m4_defun([_LT_PROG_ECHO_BACKSLASH],
-[_LT_SHELL_INIT([
-# Check that we are running under the correct shell.
-SHELL=${CONFIG_SHELL-/bin/sh}
-
-case X$lt_ECHO in
-X*--fallback-echo)
- # Remove one level of quotation (which was required for Make).
- ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
- ;;
-esac
-
-ECHO=${lt_ECHO-echo}
-if test "X[$]1" = X--no-reexec; then
- # Discard the --no-reexec flag, and continue.
- shift
-elif test "X[$]1" = X--fallback-echo; then
- # Avoid inline document here, it may be left over
- :
-elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then
- # Yippee, $ECHO works!
- :
+[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+
+AC_MSG_CHECKING([how to print strings])
+# Test print first, because it will be a builtin if present.
+if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
+ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+ ECHO='print -r --'
+elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+ ECHO='printf %s\n'
else
- # Restart under the correct shell.
- exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
-fi
-
-if test "X[$]1" = X--fallback-echo; then
- # used as fallback echo
- shift
- cat <<_LT_EOF
-[$]*
-_LT_EOF
- exit 0
+ # Use this function as a fallback that always works.
+ func_fallback_echo ()
+ {
+ eval 'cat <<_LTECHO_EOF
+$[]1
+_LTECHO_EOF'
+ }
+ ECHO='func_fallback_echo'
fi
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-if test -z "$lt_ECHO"; then
- if test "X${echo_test_string+set}" != Xset; then
- # find a string as large as possible, as long as the shell can cope with it
- for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
- # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
- if { echo_test_string=`eval $cmd`; } 2>/dev/null &&
- { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null
- then
- break
- fi
- done
- fi
-
- if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
- echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- :
- else
- # The Solaris, AIX, and Digital Unix default echo programs unquote
- # backslashes. This makes it impossible to quote backslashes using
- # echo "$something" | sed 's/\\/\\\\/g'
- #
- # So, first we look for a working echo in the user's PATH.
-
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
- for dir in $PATH /usr/ucb; do
- IFS="$lt_save_ifs"
- if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
- test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
- echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- ECHO="$dir/echo"
- break
- fi
- done
- IFS="$lt_save_ifs"
-
- if test "X$ECHO" = Xecho; then
- # We didn't find a better echo, so look for alternatives.
- if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' &&
- echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- # This shell has a builtin print -r that does the trick.
- ECHO='print -r'
- elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } &&
- test "X$CONFIG_SHELL" != X/bin/ksh; then
- # If we have ksh, try running configure again with it.
- ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
- export ORIGINAL_CONFIG_SHELL
- CONFIG_SHELL=/bin/ksh
- export CONFIG_SHELL
- exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
- else
- # Try using printf.
- ECHO='printf %s\n'
- if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
- echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- # Cool, printf works
- :
- elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
- test "X$echo_testing_string" = 'X\t' &&
- echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
- export CONFIG_SHELL
- SHELL="$CONFIG_SHELL"
- export SHELL
- ECHO="$CONFIG_SHELL [$]0 --fallback-echo"
- elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
- test "X$echo_testing_string" = 'X\t' &&
- echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- ECHO="$CONFIG_SHELL [$]0 --fallback-echo"
- else
- # maybe with a smaller string...
- prev=:
-
- for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
- if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null
- then
- break
- fi
- prev="$cmd"
- done
+# func_echo_all arg...
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+ $ECHO "$*"
+}
- if test "$prev" != 'sed 50q "[$]0"'; then
- echo_test_string=`eval $prev`
- export echo_test_string
- exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
- else
- # Oops. We lost completely, so just stick with echo.
- ECHO=echo
- fi
- fi
- fi
- fi
- fi
-fi
+case "$ECHO" in
+ printf*) AC_MSG_RESULT([printf]) ;;
+ print*) AC_MSG_RESULT([print -r]) ;;
+ *) AC_MSG_RESULT([cat]) ;;
+esac
-# Copy echo and quote the copy suitably for passing to libtool from
-# the Makefile, instead of quoting the original, which is used later.
-lt_ECHO=$ECHO
-if test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
- lt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
-fi
+m4_ifdef([_AS_DETECT_SUGGESTED],
+[_AS_DETECT_SUGGESTED([
+ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
+ ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+ PATH=/empty FPATH=/empty; export PATH FPATH
+ test "X`printf %s $ECHO`" = "X$ECHO" \
+ || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
-AC_SUBST(lt_ECHO)
-])
_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
-_LT_DECL([], [ECHO], [1],
- [An echo program that does not interpret backslashes])
+_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
])# _LT_PROG_ECHO_BACKSLASH
+# _LT_WITH_SYSROOT
+# ----------------
+AC_DEFUN([_LT_WITH_SYSROOT],
+[AC_MSG_CHECKING([for sysroot])
+AC_ARG_WITH([sysroot],
+[ --with-sysroot[=DIR] Search for dependent libraries within DIR
+ (or the compiler's sysroot if not specified).],
+[], [with_sysroot=no])
+
+dnl lt_sysroot will always be passed unquoted. We quote it here
+dnl in case the user passed a directory name.
+lt_sysroot=
+case ${with_sysroot} in #(
+ yes)
+ if test "$GCC" = yes; then
+ lt_sysroot=`$CC --print-sysroot 2>/dev/null`
+ fi
+ ;; #(
+ /*)
+ lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
+ ;; #(
+ no|'')
+ ;; #(
+ *)
+ AC_MSG_RESULT([${with_sysroot}])
+ AC_MSG_ERROR([The sysroot must be an absolute path.])
+ ;;
+esac
+
+ AC_MSG_RESULT([${lt_sysroot:-no}])
+_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
+[dependent libraries, and in which our libraries should be installed.])])
+
# _LT_ENABLE_LOCK
# ---------------
m4_defun([_LT_ENABLE_LOCK],
;;
*-*-irix6*)
# Find out which ABI we are using.
- echo '[#]line __oline__ "configure"' > conftest.$ac_ext
+ echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
if AC_TRY_EVAL(ac_compile); then
if test "$lt_cv_prog_gnu_ld" = yes; then
case `/usr/bin/file conftest.$ac_objext` in
])# _LT_ENABLE_LOCK
+# _LT_PROG_AR
+# -----------
+m4_defun([_LT_PROG_AR],
+[AC_CHECK_TOOLS(AR, [ar], false)
+: ${AR=ar}
+: ${AR_FLAGS=cru}
+_LT_DECL([], [AR], [1], [The archiver])
+_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
+
+AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
+ [lt_cv_ar_at_file=no
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
+ [echo conftest.$ac_objext > conftest.lst
+ lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
+ AC_TRY_EVAL([lt_ar_try])
+ if test "$ac_status" -eq 0; then
+ # Ensure the archiver fails upon bogus file names.
+ rm -f conftest.$ac_objext libconftest.a
+ AC_TRY_EVAL([lt_ar_try])
+ if test "$ac_status" -ne 0; then
+ lt_cv_ar_at_file=@
+ fi
+ fi
+ rm -f conftest.* libconftest.a
+ ])
+ ])
+
+if test "x$lt_cv_ar_at_file" = xno; then
+ archiver_list_spec=
+else
+ archiver_list_spec=$lt_cv_ar_at_file
+fi
+_LT_DECL([], [archiver_list_spec], [1],
+ [How to feed a file listing to the archiver])
+])# _LT_PROG_AR
+
+
# _LT_CMD_OLD_ARCHIVE
# -------------------
m4_defun([_LT_CMD_OLD_ARCHIVE],
-[AC_CHECK_TOOL(AR, ar, false)
-test -z "$AR" && AR=ar
-test -z "$AR_FLAGS" && AR_FLAGS=cru
-_LT_DECL([], [AR], [1], [The archiver])
-_LT_DECL([], [AR_FLAGS], [1])
+[_LT_PROG_AR
AC_CHECK_TOOL(STRIP, strip, :)
test -z "$STRIP" && STRIP=:
esac
old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
fi
+
+case $host_os in
+ darwin*)
+ lock_old_archive_extraction=yes ;;
+ *)
+ lock_old_archive_extraction=no ;;
+esac
_LT_DECL([], [old_postinstall_cmds], [2])
_LT_DECL([], [old_postuninstall_cmds], [2])
_LT_TAGDECL([], [old_archive_cmds], [2],
[Commands used to build an old-style archive])
+_LT_DECL([], [lock_old_archive_extraction], [0],
+ [Whether to use a lock for old archive extraction])
])# _LT_CMD_OLD_ARCHIVE
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&AS_MESSAGE_LOG_FD
- echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+ echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
- $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
$SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
$2=yes
if test -s conftest.err; then
# Append any errors to the config.log.
cat conftest.err 1>&AS_MESSAGE_LOG_FD
- $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
+ $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
$SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
if diff conftest.exp conftest.er2 >/dev/null; then
$2=yes
lt_cv_sys_max_cmd_len=8192;
;;
+ mint*)
+ # On MiNT this can take a long time and run out of memory.
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
amigaos*)
# On AmigaOS with pdksh, this test takes hours, literally.
# So we just punt and use a minimum line length of 8192.
# If test is not a shell built-in, we'll probably end up computing a
# maximum length that is only half of the actual maximum length, but
# we can't tell.
- while { test "X"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \
- = "XX$teststring$teststring"; } >/dev/null 2>&1 &&
+ while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \
+ = "X$teststring$teststring"; } >/dev/null 2>&1 &&
test $i != 17 # 1/2 MB should be enough
do
i=`expr $i + 1`
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-[#line __oline__ "configure"
+[#line $LINENO "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
# endif
#endif
-void fnord() { int i=42;}
+/* When -fvisbility=hidden is used, assume the code has been annotated
+ correspondingly for the symbols needed. */
+#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+int fnord () __attribute__((visibility("default")));
+#endif
+
+int fnord () { return 42; }
int main ()
{
void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
if (self)
{
if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
- else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ else
+ {
+ if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ else puts (dlerror ());
+ }
/* dlclose (self); */
}
else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&AS_MESSAGE_LOG_FD
- echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+ echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
- $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
$SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
m4_require([_LT_FILEUTILS_DEFAULTS])dnl
m4_require([_LT_DECL_OBJDUMP])dnl
m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_CHECK_SHELL_FEATURES])dnl
AC_MSG_CHECKING([dynamic linker characteristics])
m4_if([$1],
[], [
darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
*) lt_awk_arg="/^libraries:/" ;;
esac
- lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
- if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then
+ case $host_os in
+ mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
+ *) lt_sed_strip_eq="s,=/,/,g" ;;
+ esac
+ lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
+ case $lt_search_path_spec in
+ *\;*)
# if the path contains ";" then we assume it to be the separator
# otherwise default to the standard path separator (i.e. ":") - it is
# assumed that no part of a normal pathname contains ";" but that should
# okay in the real world where ";" in dirpaths is itself problematic.
- lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'`
- else
- lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- fi
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
+ ;;
+ *)
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
+ ;;
+ esac
# Ok, now we have the path, separated by spaces, we can step through it
# and add multilib dir if necessary.
lt_tmp_lt_search_path_spec=
lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
fi
done
- lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk '
+ lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
BEGIN {RS=" "; FS="/|\n";} {
lt_foo="";
lt_count=0;
if (lt_foo != "") { lt_freq[[lt_foo]]++; }
if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
}'`
- sys_lib_search_path_spec=`$ECHO $lt_search_path_spec`
+ # AWK program above erroneously prepends '/' to C:/dos/paths
+ # for these hosts.
+ case $host_os in
+ mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
+ $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
+ esac
+ sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
else
sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
fi])
m68k)
library_names_spec='$libname.ixlibrary $libname.a'
# Create ${libname}_ixlibrary.a entries in /sys/libs.
- finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
;;
esac
;;
need_version=no
need_lib_prefix=no
- case $GCC,$host_os in
- yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
+ case $GCC,$cc_basename in
+ yes,*)
+ # gcc
library_names_spec='$libname.dll.a'
# DLL is installed to $(libdir)/../bin by postinstall_cmds
postinstall_cmds='base_file=`basename \${file}`~
cygwin*)
# Cygwin DLLs use 'cyg' prefix rather than 'lib'
soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
- sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+m4_if([$1], [],[
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
;;
mingw* | cegcc*)
# MinGW DLLs use traditional 'lib' prefix
soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
- sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
- if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
- # It is most probably a Windows format PATH printed by
- # mingw gcc, but we are running on Cygwin. Gcc prints its search
- # path with ; separators, and with drive letters. We can handle the
- # drive letters (cygwin fileutils understands them), so leave them,
- # especially as we might pass files found there to a mingw objdump,
- # which wouldn't understand a cygwinified path. Ahh.
- sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
- else
- sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- fi
;;
pw32*)
# pw32 DLLs use 'pw' prefix rather than 'lib'
library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
;;
esac
+ dynamic_linker='Win32 ld.exe'
+ ;;
+
+ *,cl*)
+ # Native MSVC
+ libname_spec='$name'
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+ library_names_spec='${libname}.dll.lib'
+
+ case $build_os in
+ mingw*)
+ sys_lib_search_path_spec=
+ lt_save_ifs=$IFS
+ IFS=';'
+ for lt_path in $LIB
+ do
+ IFS=$lt_save_ifs
+ # Let DOS variable expansion print the short 8.3 style file name.
+ lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
+ sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
+ done
+ IFS=$lt_save_ifs
+ # Convert to MSYS style.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
+ ;;
+ cygwin*)
+ # Convert to unix form, then to dos form, then back to unix form
+ # but this time dos style (no spaces!) so that the unix form looks
+ # like /cygdrive/c/PROGRA~1:/cygdr...
+ sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
+ sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
+ sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ ;;
+ *)
+ sys_lib_search_path_spec="$LIB"
+ if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
+ # It is most probably a Windows format PATH.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ # FIXME: find the short name or the path components, as spaces are
+ # common. (e.g. "Program Files" -> "PROGRA~1")
+ ;;
+ esac
+
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ shlibpath_overrides_runpath=yes
+ dynamic_linker='Win32 link.exe'
;;
*)
+ # Assume MSVC wrapper
library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
+ dynamic_linker='Win32 ld.exe'
;;
esac
- dynamic_linker='Win32 ld.exe'
# FIXME: first we should search . and the directory the executable is in
shlibpath_var=PATH
;;
hardcode_into_libs=yes
;;
+haiku*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ dynamic_linker="$host_os runtime_loader"
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+ hardcode_into_libs=yes
+ ;;
+
hpux9* | hpux10* | hpux11*)
# Give a soname corresponding to the major version so that dld.sl refuses to
# link against other versions.
soname_spec='${libname}${release}${shared_ext}$major'
;;
esac
- # HP-UX runs *really* slowly unless shared libraries are mode 555.
+ # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
postinstall_cmds='chmod 555 $lib'
+ # or fails outright, so override atomically:
+ install_override_mode=555
;;
interix[[3-9]]*)
;;
# This must be Linux ELF.
-linux* | k*bsd*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
version_type=linux
need_lib_prefix=no
need_version=no
finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=no
+
# Some binutils ld are patched to set DT_RUNPATH
- save_LDFLAGS=$LDFLAGS
- save_libdir=$libdir
- eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
- LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
- AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
- [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
- [shlibpath_overrides_runpath=yes])])
- LDFLAGS=$save_LDFLAGS
- libdir=$save_libdir
+ AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
+ [lt_cv_shlibpath_overrides_runpath=no
+ save_LDFLAGS=$LDFLAGS
+ save_libdir=$libdir
+ eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
+ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+ [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
+ [lt_cv_shlibpath_overrides_runpath=yes])])
+ LDFLAGS=$save_LDFLAGS
+ libdir=$save_libdir
+ ])
+ shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
# This implies no fast_install, which is unacceptable.
# Some rework will be needed to allow for fast_install
# before this can be enabled.
hardcode_into_libs=yes
+ # Add ABI-specific directories to the system library path.
+ sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib"
+
# Append ld.so.conf contents to the search path
if test -f /etc/ld.so.conf; then
- lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
- sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+ sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
+
fi
# We used to test for /lib/ld.so.1 and disable shared libraries on
The last name is the one that the linker finds with -lNAME]])
_LT_DECL([], [soname_spec], [1],
[[The coded name of the library, if different from the real name]])
+_LT_DECL([], [install_override_mode], [1],
+ [Permission mode override for installation of shared libraries])
_LT_DECL([], [postinstall_cmds], [2],
[Command to use after installation of a shared archive])
_LT_DECL([], [postuninstall_cmds], [2],
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
m4_require([_LT_DECL_SED])dnl
m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_PROG_ECHO_BACKSLASH])dnl
AC_ARG_WITH([gnu-ld],
[AS_HELP_STRING([--with-gnu-ld],
esac
reload_cmds='$LD$reload_flag -o $output$reload_objs'
case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ if test "$GCC" != yes; then
+ reload_cmds=false
+ fi
+ ;;
darwin*)
if test "$GCC" = yes; then
reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
fi
;;
esac
-_LT_DECL([], [reload_flag], [1], [How to create reloadable object files])dnl
-_LT_DECL([], [reload_cmds], [2])dnl
+_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
+_LT_TAGDECL([], [reload_cmds], [2])dnl
])# _LT_CMD_RELOAD
# Base MSYS/MinGW do not provide the 'file' command needed by
# func_win32_libid shell function, so use a weaker test based on 'objdump',
# unless we find 'file', for example because we are cross-compiling.
- if ( file / ) >/dev/null 2>&1; then
+ # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
+ if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
lt_cv_file_magic_cmd='func_win32_libid'
else
- lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+ # Keep this pattern in sync with the one in func_win32_libid.
+ lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
lt_cv_file_magic_cmd='$OBJDUMP -f'
fi
;;
-cegcc)
+cegcc*)
# use the weaker test based on 'objdump'. See mingw*.
lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
lt_cv_file_magic_cmd='$OBJDUMP -f'
lt_cv_deplibs_check_method=pass_all
;;
+haiku*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
hpux10.20* | hpux11*)
lt_cv_file_magic_cmd=/usr/bin/file
case $host_cpu in
lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
;;
hppa*64*)
- [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]']
+ [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]']
lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
;;
*)
- lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
+ lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
lt_cv_file_magic_test_file=/usr/lib/libc.sl
;;
esac
;;
# This must be Linux ELF.
-linux* | k*bsd*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
lt_cv_deplibs_check_method=pass_all
;;
;;
esac
])
+
+file_magic_glob=
+want_nocaseglob=no
+if test "$build" = "$host"; then
+ case $host_os in
+ mingw* | pw32*)
+ if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
+ want_nocaseglob=yes
+ else
+ file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
+ fi
+ ;;
+ esac
+fi
+
file_magic_cmd=$lt_cv_file_magic_cmd
deplibs_check_method=$lt_cv_deplibs_check_method
test -z "$deplibs_check_method" && deplibs_check_method=unknown
_LT_DECL([], [deplibs_check_method], [1],
[Method to check whether dependent libraries are shared objects])
_LT_DECL([], [file_magic_cmd], [1],
- [Command to use when deplibs_check_method == "file_magic"])
+ [Command to use when deplibs_check_method = "file_magic"])
+_LT_DECL([], [file_magic_glob], [1],
+ [How to find potential files when deplibs_check_method = "file_magic"])
+_LT_DECL([], [want_nocaseglob], [1],
+ [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
])# _LT_CHECK_MAGIC_METHOD
NM="$lt_cv_path_NM"
else
# Didn't find any BSD compatible name lister, look for dumpbin.
- AC_CHECK_TOOLS(DUMPBIN, ["dumpbin -symbols" "link -dump -symbols"], :)
+ if test -n "$DUMPBIN"; then :
+ # Let the user override the test.
+ else
+ AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
+ case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
+ *COFF*)
+ DUMPBIN="$DUMPBIN -symbols"
+ ;;
+ *)
+ DUMPBIN=:
+ ;;
+ esac
+ fi
AC_SUBST([DUMPBIN])
if test "$DUMPBIN" != ":"; then
NM="$DUMPBIN"
AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
[lt_cv_nm_interface="BSD nm"
echo "int some_variable = 0;" > conftest.$ac_ext
- (eval echo "\"\$as_me:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
+ (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
(eval "$ac_compile" 2>conftest.err)
cat conftest.err >&AS_MESSAGE_LOG_FD
- (eval echo "\"\$as_me:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
+ (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
(eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
cat conftest.err >&AS_MESSAGE_LOG_FD
- (eval echo "\"\$as_me:__oline__: output\"" >&AS_MESSAGE_LOG_FD)
+ (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
cat conftest.out >&AS_MESSAGE_LOG_FD
if $GREP 'External.*some_variable' conftest.out > /dev/null; then
lt_cv_nm_interface="MS dumpbin"
dnl AC_DEFUN([AM_PROG_NM], [])
dnl AC_DEFUN([AC_PROG_NM], [])
+# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
+# --------------------------------
+# how to determine the name of the shared library
+# associated with a specific link library.
+# -- PORTME fill in with the dynamic library characteristics
+m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
+[m4_require([_LT_DECL_EGREP])
+m4_require([_LT_DECL_OBJDUMP])
+m4_require([_LT_DECL_DLLTOOL])
+AC_CACHE_CHECK([how to associate runtime and link libraries],
+lt_cv_sharedlib_from_linklib_cmd,
+[lt_cv_sharedlib_from_linklib_cmd='unknown'
+
+case $host_os in
+cygwin* | mingw* | pw32* | cegcc*)
+ # two different shell functions defined in ltmain.sh
+ # decide which to use based on capabilities of $DLLTOOL
+ case `$DLLTOOL --help 2>&1` in
+ *--identify-strict*)
+ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
+ ;;
+ *)
+ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
+ ;;
+ esac
+ ;;
+*)
+ # fallback: assume linklib IS sharedlib
+ lt_cv_sharedlib_from_linklib_cmd="$ECHO"
+ ;;
+esac
+])
+sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
+test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
+
+_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
+ [Command to associate shared and link libraries])
+])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
+
+
+# _LT_PATH_MANIFEST_TOOL
+# ----------------------
+# locate the manifest tool
+m4_defun([_LT_PATH_MANIFEST_TOOL],
+[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
+test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
+AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
+ [lt_cv_path_mainfest_tool=no
+ echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
+ $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ if $GREP 'Manifest Tool' conftest.out > /dev/null; then
+ lt_cv_path_mainfest_tool=yes
+ fi
+ rm -f conftest*])
+if test "x$lt_cv_path_mainfest_tool" != xyes; then
+ MANIFEST_TOOL=:
+fi
+_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
+])# _LT_PATH_MANIFEST_TOOL
+
# LT_LIB_M
# --------
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
LIBM=
case $host in
-*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
+*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
# These system don't have libm, or don't need it
;;
*-ncr-sysv4.3*)
_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
if test "$GCC" = yes; then
- _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+ case $cc_basename in
+ nvcc*)
+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
+ esac
_LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
lt_cv_prog_compiler_rtti_exceptions,
m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_PROG_AWK])dnl
AC_REQUIRE([LT_PATH_NM])dnl
AC_REQUIRE([LT_PATH_LD])dnl
m4_require([_LT_DECL_SED])dnl
lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
# Transform an extracted symbol line into symbol name and symbol address
-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'"
-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
# Handle CRLF in mingw tool chain
opt_cr=
else
lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
fi
+ lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
# Check to see that the pipe works correctly.
pipe_works=no
if AC_TRY_EVAL(ac_compile); then
# Now try to grab the symbols.
nlist=conftest.nm
- if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
+ if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
# Try sorting and uniquifying the output.
if sort "$nlist" | uniq > "$nlist"T; then
mv -f "$nlist"T "$nlist"
if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
cat <<_LT_EOF > conftest.$ac_ext
+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
+/* DATA imports from DLLs on WIN32 con't be const, because runtime
+ relocations are performed -- see ld's documentation on pseudo-relocs. */
+# define LT@&t@_DLSYM_CONST
+#elif defined(__osf__)
+/* This system does not cope well with relocations in const data. */
+# define LT@&t@_DLSYM_CONST
+#else
+# define LT@&t@_DLSYM_CONST const
+#endif
+
#ifdef __cplusplus
extern "C" {
#endif
cat <<_LT_EOF >> conftest.$ac_ext
/* The mapping between symbol names and symbols. */
-const struct {
+LT@&t@_DLSYM_CONST struct {
const char *name;
void *address;
}
_LT_EOF
# Now try linking the two files.
mv conftest.$ac_objext conftstm.$ac_objext
- lt_save_LIBS="$LIBS"
- lt_save_CFLAGS="$CFLAGS"
+ lt_globsym_save_LIBS=$LIBS
+ lt_globsym_save_CFLAGS=$CFLAGS
LIBS="conftstm.$ac_objext"
CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
pipe_works=yes
fi
- LIBS="$lt_save_LIBS"
- CFLAGS="$lt_save_CFLAGS"
+ LIBS=$lt_globsym_save_LIBS
+ CFLAGS=$lt_globsym_save_CFLAGS
else
echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
fi
AC_MSG_RESULT(ok)
fi
+# Response file support.
+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+ nm_file_list_spec='@'
+elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
+ nm_file_list_spec='@'
+fi
+
_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
[Take the output of nm and produce a listing of raw symbols and C names])
_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
[lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
[Transform the output of nm in a C name address pair when lib prefix is needed])
+_LT_DECL([], [nm_file_list_spec], [1],
+ [Specify filename containing input files for $NM])
]) # _LT_CMD_GLOBAL_SYMBOLS
_LT_TAGVAR(lt_prog_compiler_pic, $1)=
_LT_TAGVAR(lt_prog_compiler_static, $1)=
-AC_MSG_CHECKING([for $compiler option to produce PIC])
m4_if([$1], [CXX], [
# C++ specific cases for pic, static, wl, etc.
if test "$GXX" = yes; then
# DJGPP does not support shared libraries at all
_LT_TAGVAR(lt_prog_compiler_pic, $1)=
;;
+ haiku*)
+ # PIC is the default for Haiku.
+ # The "-static" flag exists, but is broken.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)=
+ ;;
interix[[3-9]]*)
# Interix 3.x gcc -fpic/-fPIC options generate broken code.
# Instead, we relocate shared libraries at runtime.
;;
esac
;;
+ mingw* | cygwin* | os2* | pw32* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ m4_if([$1], [GCJ], [],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ ;;
dgux*)
case $cc_basename in
ec++*)
;;
esac
;;
- linux* | k*bsd*-gnu)
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
case $cc_basename in
KCC*)
# KAI C++ Compiler
_LT_TAGVAR(lt_prog_compiler_pic, $1)=
_LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
;;
- xlc* | xlC*)
- # IBM XL 8.0 on PPC
+ xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
+ # IBM XL 8.0, 9.0 on PPC and BlueGene
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
;;
solaris*)
case $cc_basename in
- CC*)
+ CC* | sunCC*)
# Sun C++ 4.2, 5.x and Centerline C++
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
;;
+ haiku*)
+ # PIC is the default for Haiku.
+ # The "-static" flag exists, but is broken.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)=
+ ;;
+
hpux*)
# PIC is the default for 64-bit PA HP-UX, but not for 32-bit
# PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
;;
esac
+
+ case $cc_basename in
+ nvcc*) # Cuda Compiler Driver 2.2
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Xcompiler -fPIC'
+ ;;
+ esac
else
# PORTME Check for flag to pass linker flags through the system compiler.
case $host_os in
_LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
;;
- linux* | k*bsd*-gnu)
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
case $cc_basename in
# old Intel for x86_64 which still supported -KPIC.
ecc*)
_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
;;
- pgcc* | pgf77* | pgf90* | pgf95*)
+ nagfor*)
+ # NAG Fortran compiler
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
# Portland Group compilers (*not* the Pentium gcc compiler,
# which looks to be a dead project)
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
# All Alpha code is PIC.
_LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
;;
- xl*)
- # IBM XL C 8.0/Fortran 10.1 on PPC
+ xl* | bgxl* | bgf* | mpixl*)
+ # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
;;
*)
case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*)
- # Sun C 5.9
+ *Sun\ F* | *Sun*Fortran*)
+ # Sun Fortran 8.3 passes all unrecognized flags to the linker
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
;;
- *Sun\ F*)
- # Sun Fortran 8.3 passes all unrecognized flags to the linker
+ *Sun\ C*)
+ # Sun C 5.9
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
;;
esac
;;
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
case $cc_basename in
- f77* | f90* | f95*)
+ f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
*)
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
_LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
;;
esac
-AC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
-_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
- [How to pass a linker flag through the compiler])
+
+AC_CACHE_CHECK([for $compiler option to produce PIC],
+ [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
+ [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
+_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
#
# Check to make sure the PIC flag actually works.
_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
[Additional compiler flags for building library objects])
+_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
+ [How to pass a linker flag through the compiler])
#
# Check to make sure the static flag actually works.
#
m4_defun([_LT_LINKER_SHLIBS],
[AC_REQUIRE([LT_PATH_LD])dnl
AC_REQUIRE([LT_PATH_NM])dnl
+m4_require([_LT_PATH_MANIFEST_TOOL])dnl
m4_require([_LT_FILEUTILS_DEFAULTS])dnl
m4_require([_LT_DECL_EGREP])dnl
m4_require([_LT_DECL_SED])dnl
AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
m4_if([$1], [CXX], [
_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
case $host_os in
aix[[4-9]]*)
# If we're using GNU nm, then we don't want the "-C" option.
# -C means demangle to AIX nm, but means don't demangle with GNU nm
+ # Also, AIX nm treats weak defined symbols like other global defined
+ # symbols, whereas GNU nm marks them as "W".
if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
- _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
else
_LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
fi
;;
pw32*)
_LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
- ;;
+ ;;
cygwin* | mingw* | cegcc*)
- _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
- ;;
+ case $cc_basename in
+ cl*) ;;
+ *)
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
+ ;;
+ esac
+ ;;
*)
_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- ;;
+ ;;
esac
- _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
], [
runpath_var=
_LT_TAGVAR(allow_undefined_flag, $1)=
esac
_LT_TAGVAR(ld_shlibs, $1)=yes
+
+ # On some targets, GNU ld is compatible enough with the native linker
+ # that we're better off using the native interface for both.
+ lt_use_gnu_ld_interface=no
if test "$with_gnu_ld" = yes; then
+ case $host_os in
+ aix*)
+ # The AIX port of GNU ld has always aspired to compatibility
+ # with the native linker. However, as the warning in the GNU ld
+ # block says, versions before 2.19.5* couldn't really create working
+ # shared libraries, regardless of the interface used.
+ case `$LD -v 2>&1` in
+ *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
+ *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
+ *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
+ *)
+ lt_use_gnu_ld_interface=yes
+ ;;
+ esac
+ ;;
+ *)
+ lt_use_gnu_ld_interface=yes
+ ;;
+ esac
+ fi
+
+ if test "$lt_use_gnu_ld_interface" = yes; then
# If archive_cmds runs LD, not CC, wlarc should be empty
wlarc='${wl}'
fi
supports_anon_versioning=no
case `$LD -v 2>&1` in
+ *GNU\ gold*) supports_anon_versioning=yes ;;
*\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
*\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
*\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
_LT_TAGVAR(ld_shlibs, $1)=no
cat <<_LT_EOF 1>&2
-*** Warning: the GNU linker, at least up to release 2.9.1, is reported
+*** Warning: the GNU linker, at least up to release 2.19, is reported
*** to be unable to reliably create shared libraries on AIX.
*** Therefore, libtool is disabling shared libraries support. If you
-*** really care for shared libraries, you may want to modify your PATH
-*** so that a non-GNU linker is found, and then restart.
+*** really care for shared libraries, you may want to install binutils
+*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
+*** You will then need to restart the configuration process.
_LT_EOF
fi
# _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
# as there is no search path for DLLs.
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
_LT_TAGVAR(always_export_symbols, $1)=no
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
- _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
fi
;;
+ haiku*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
interix[[3-9]]*)
_LT_TAGVAR(hardcode_direct, $1)=no
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
_LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
;;
- gnu* | linux* | tpf* | k*bsd*-gnu)
+ gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
tmp_diet=no
if test "$host_os" = linux-dietlibc; then
case $cc_basename in
if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
&& test "$tmp_diet" = no
then
- tmp_addflag=
+ tmp_addflag=' $pic_flag'
tmp_sharedflag='-shared'
case $cc_basename,$host_cpu in
pgcc*) # Portland Group C compiler
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
tmp_addflag=' $pic_flag'
;;
- pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+ pgf77* | pgf90* | pgf95* | pgfortran*)
+ # Portland Group f77 and f90 compilers
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
tmp_addflag=' $pic_flag -Mnomain' ;;
ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
tmp_addflag=' -i_dynamic' ;;
lf95*) # Lahey Fortran 8.1
_LT_TAGVAR(whole_archive_flag_spec, $1)=
tmp_sharedflag='--shared' ;;
- xl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
+ xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
tmp_sharedflag='-qmkshrobj'
tmp_addflag= ;;
+ nvcc*) # Cuda Compiler Driver 2.2
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ _LT_TAGVAR(compiler_needs_object, $1)=yes
+ ;;
esac
case `$CC -V 2>&1 | sed 5q` in
*Sun\ C*) # Sun C 5.9
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
_LT_TAGVAR(compiler_needs_object, $1)=yes
tmp_sharedflag='-G' ;;
*Sun\ F*) # Sun Fortran 8.3
fi
case $cc_basename in
- xlf*)
+ xlf* | bgf* | bgxlf* | mpixlf*)
# IBM XL Fortran 10.1 on PPC cannot create shared libs itself
_LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
- _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
if test "x$supports_anon_versioning" = xyes; then
_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
echo "local: *; };" >> $output_objdir/$libname.ver~
- $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
fi
;;
esac
_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
wlarc=
else
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
fi
;;
_LT_EOF
elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
else
_LT_TAGVAR(ld_shlibs, $1)=no
fi
*)
if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
else
_LT_TAGVAR(ld_shlibs, $1)=no
fi
else
# If we're using GNU nm, then we don't want the "-C" option.
# -C means demangle to AIX nm, but means don't demangle with GNU nm
+ # Also, AIX nm treats weak defined symbols like other global
+ # defined symbols, whereas GNU nm marks them as "W".
if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
- _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
else
_LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
fi
_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
# Determine the default libpath from the value encoded in an
# empty executable.
- _LT_SYS_MODULE_PATH_AIX
+ _LT_SYS_MODULE_PATH_AIX([$1])
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
else
if test "$host_cpu" = ia64; then
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
else
# Determine the default libpath from the value encoded in an
# empty executable.
- _LT_SYS_MODULE_PATH_AIX
+ _LT_SYS_MODULE_PATH_AIX([$1])
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
# Warning - without using the other run time loading flags,
# -berok will link without error, but may produce a broken library.
_LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
- # Exported symbols can be pulled into shared objects from archives
- _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+ if test "$with_gnu_ld" = yes; then
+ # We only use this code for GNU lds that support --whole-archive.
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ else
+ # Exported symbols can be pulled into shared objects from archives
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+ fi
_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
# This is similar to how AIX traditionally builds its shared libraries.
_LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
# Microsoft Visual C++.
# hardcode_libdir_flag_spec is actually meaningless, as there is
# no search path for DLLs.
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
- _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
- # Tell ltmain to make .lib files, not .a files.
- libext=lib
- # Tell ltmain to make .dll files, not .so files.
- shrext_cmds=".dll"
- # FIXME: Setting linknames here is a bad hack.
- _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames='
- # The linker will automatically build a .lib file if we build a DLL.
- _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
- # FIXME: Should let the user specify the lib program.
- _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
- _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
- _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ case $cc_basename in
+ cl*)
+ # Native MSVC
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='@'
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+ else
+ sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+ fi~
+ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+ linknames='
+ # The linker will not automatically build a static lib if we build a DLL.
+ # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
+ # Don't use ranlib
+ _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
+ _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
+ lt_tool_outputfile="@TOOL_OUTPUT@"~
+ case $lt_outputfile in
+ *.exe|*.EXE) ;;
+ *)
+ lt_outputfile="$lt_outputfile.exe"
+ lt_tool_outputfile="$lt_tool_outputfile.exe"
+ ;;
+ esac~
+ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
+ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+ $RM "$lt_outputfile.manifest";
+ fi'
+ ;;
+ *)
+ # Assume MSVC wrapper
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+ # The linker will automatically build a .lib file if we build a DLL.
+ _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+ # FIXME: Should let the user specify the lib program.
+ _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ ;;
+ esac
;;
darwin* | rhapsody*)
# FreeBSD 3 and greater uses gcc -shared to do shared libraries.
freebsd* | dragonfly*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
_LT_TAGVAR(hardcode_direct, $1)=yes
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
hpux9*)
if test "$GCC" = yes; then
- _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
else
_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
fi
;;
hpux10*)
- if test "$GCC" = yes -a "$with_gnu_ld" = no; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
else
_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
fi
;;
hpux11*)
- if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+ if test "$GCC" = yes && test "$with_gnu_ld" = no; then
case $host_cpu in
hppa*64*)
_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
;;
ia64*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
;;
*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
;;
esac
else
_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
;;
*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ m4_if($1, [], [
+ # Older versions of the 11.00 compiler do not understand -b yet
+ # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
+ _LT_LINKER_OPTION([if $CC understands -b],
+ _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
+ [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
+ [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
+ [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
;;
esac
fi
irix5* | irix6* | nonstopux*)
if test "$GCC" = yes; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
# Try to use the -exported_symbol ld option, if it does not
# work, assume that -exports_file does not work either and
# implicitly export all symbols.
- save_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
- AC_LINK_IFELSE(int foo(void) {},
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
- )
- LDFLAGS="$save_LDFLAGS"
+ # This should be the same for all languages, so no per-tag cache variable.
+ AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
+ [lt_cv_irix_exported_symbol],
+ [save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+ AC_LINK_IFELSE(
+ [AC_LANG_SOURCE(
+ [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
+ [C++], [[int foo (void) { return 0; }]],
+ [Fortran 77], [[
+ subroutine foo
+ end]],
+ [Fortran], [[
+ subroutine foo
+ end]])])],
+ [lt_cv_irix_exported_symbol=yes],
+ [lt_cv_irix_exported_symbol=no])
+ LDFLAGS="$save_LDFLAGS"])
+ if test "$lt_cv_irix_exported_symbol" = yes; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+ fi
else
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
fi
_LT_TAGVAR(archive_cmds_need_lc, $1)='no'
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
_LT_TAGVAR(hardcode_minus_L, $1)=yes
_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
- _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+ _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
_LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
;;
osf3*)
if test "$GCC" = yes; then
_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
else
_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
fi
_LT_TAGVAR(archive_cmds_need_lc, $1)='no'
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
osf4* | osf5*) # as osf3* with the addition of -msym flag
if test "$GCC" = yes; then
_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
else
_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
_LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
- $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
+ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
# Both c and cxx compiler support -rpath directly
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
_LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
if test "$GCC" = yes; then
wlarc='${wl}'
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
- $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
else
case `$CC -V 2>&1` in
*"Compilers 5.0"*)
# Test whether the compiler implicitly links with -lc since on some
# systems, -lgcc has to come before -lc. If gcc already passes -lc
# to ld, don't add -lc before -lgcc.
- AC_MSG_CHECKING([whether -lc should be explicitly linked in])
- $RM conftest*
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
- if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
- soname=conftest
- lib=conftest
- libobjs=conftest.$ac_objext
- deplibs=
- wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
- pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
- compiler_flags=-v
- linker_flags=-v
- verstring=
- output_objdir=.
- libname=conftest
- lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
- _LT_TAGVAR(allow_undefined_flag, $1)=
- if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
- then
- _LT_TAGVAR(archive_cmds_need_lc, $1)=no
- else
- _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
- fi
- _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
- else
- cat conftest.err 1>&5
- fi
- $RM conftest*
- AC_MSG_RESULT([$_LT_TAGVAR(archive_cmds_need_lc, $1)])
+ AC_CACHE_CHECK([whether -lc should be explicitly linked in],
+ [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
+ [$RM conftest*
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
+ soname=conftest
+ lib=conftest
+ libobjs=conftest.$ac_objext
+ deplibs=
+ wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
+ pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
+ compiler_flags=-v
+ linker_flags=-v
+ verstring=
+ output_objdir=.
+ libname=conftest
+ lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
+ _LT_TAGVAR(allow_undefined_flag, $1)=
+ if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
+ then
+ lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ else
+ lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+ fi
+ _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
+ else
+ cat conftest.err 1>&5
+ fi
+ $RM conftest*
+ ])
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
;;
esac
fi
to runtime path list])
_LT_TAGDECL([], [link_all_deplibs], [0],
[Whether libtool must link a program against all its dependency libraries])
-_LT_TAGDECL([], [fix_srcfile_path], [1],
- [Fix the shell variable $srcfile for the compiler])
_LT_TAGDECL([], [always_export_symbols], [0],
[Set to "yes" if exported symbols are required])
_LT_TAGDECL([], [export_symbols_cmds], [2],
[Symbols that must always be exported])
_LT_TAGDECL([], [prelink_cmds], [2],
[Commands necessary for linking programs (against libraries) with templates])
+_LT_TAGDECL([], [postlink_cmds], [2],
+ [Commands necessary for finishing linking programs])
_LT_TAGDECL([], [file_list_spec], [1],
[Specify filename containing input files])
dnl FIXME: Not yet implemented
])# _LT_LANG_C_CONFIG
-# _LT_PROG_CXX
-# ------------
-# Since AC_PROG_CXX is broken, in that it returns g++ if there is no c++
-# compiler, we have our own version here.
-m4_defun([_LT_PROG_CXX],
-[
-pushdef([AC_MSG_ERROR], [_lt_caught_CXX_error=yes])
-AC_PROG_CXX
-if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
- ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
- (test "X$CXX" != "Xg++"))) ; then
- AC_PROG_CXXCPP
-else
- _lt_caught_CXX_error=yes
-fi
-popdef([AC_MSG_ERROR])
-])# _LT_PROG_CXX
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([_LT_PROG_CXX], [])
-
-
# _LT_LANG_CXX_CONFIG([TAG])
# --------------------------
# Ensure that the configuration variables for a C++ compiler are suitably
# defined. These variables are subsequently used by _LT_CONFIG to write
# the compiler configuration to `libtool'.
m4_defun([_LT_LANG_CXX_CONFIG],
-[AC_REQUIRE([_LT_PROG_CXX])dnl
-m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_PATH_MANIFEST_TOOL])dnl
+if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+ ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+ (test "X$CXX" != "Xg++"))) ; then
+ AC_PROG_CXXCPP
+else
+ _lt_caught_CXX_error=yes
+fi
AC_LANG_PUSH(C++)
_LT_TAGVAR(archive_cmds_need_lc, $1)=no
_LT_TAGVAR(module_expsym_cmds, $1)=
_LT_TAGVAR(link_all_deplibs, $1)=unknown
_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
_LT_TAGVAR(no_undefined_flag, $1)=
_LT_TAGVAR(whole_archive_flag_spec, $1)=
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
# Allow CC to be a program name with arguments.
lt_save_CC=$CC
+ lt_save_CFLAGS=$CFLAGS
lt_save_LD=$LD
lt_save_GCC=$GCC
GCC=$GXX
fi
test -z "${LDCXX+set}" || LD=$LDCXX
CC=${CXX-"c++"}
+ CFLAGS=$CXXFLAGS
compiler=$CC
_LT_TAGVAR(compiler, $1)=$CC
_LT_CC_BASENAME([$compiler])
# Check if GNU C++ uses GNU ld as the underlying linker, since the
# archiving commands below assume that GNU ld is being used.
if test "$with_gnu_ld" = yes; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
# Commands to make compiler produce verbose output that lists
# what "hidden" libraries, object files and flags are used when
# linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
else
GXX=no
_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
# Determine the default libpath from the value encoded in an empty
# executable.
- _LT_SYS_MODULE_PATH_AIX
+ _LT_SYS_MODULE_PATH_AIX([$1])
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
else
if test "$host_cpu" = ia64; then
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
else
# Determine the default libpath from the value encoded in an
# empty executable.
- _LT_SYS_MODULE_PATH_AIX
+ _LT_SYS_MODULE_PATH_AIX([$1])
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
# Warning - without using the other run time loading flags,
# -berok will link without error, but may produce a broken library.
_LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
- # Exported symbols can be pulled into shared objects from archives
- _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+ if test "$with_gnu_ld" = yes; then
+ # We only use this code for GNU lds that support --whole-archive.
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ else
+ # Exported symbols can be pulled into shared objects from archives
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+ fi
_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
# This is similar to how AIX traditionally builds its shared
# libraries.
;;
cygwin* | mingw* | pw32* | cegcc*)
- # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
- # as there is no search path for DLLs.
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
- _LT_TAGVAR(always_export_symbols, $1)=no
- _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-
- if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- # If the export-symbols file already is a .def file (1st line
- # is EXPORTS), use it as is; otherwise, prepend...
- _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
- cp $export_symbols $output_objdir/$soname.def;
- else
- echo EXPORTS > $output_objdir/$soname.def;
- cat $export_symbols >> $output_objdir/$soname.def;
- fi~
- $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- else
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
+ case $GXX,$cc_basename in
+ ,cl* | no,cl*)
+ # Native MSVC
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='@'
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+ else
+ $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+ fi~
+ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+ linknames='
+ # The linker will not automatically build a static lib if we build a DLL.
+ # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ # Don't use ranlib
+ _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
+ _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
+ lt_tool_outputfile="@TOOL_OUTPUT@"~
+ case $lt_outputfile in
+ *.exe|*.EXE) ;;
+ *)
+ lt_outputfile="$lt_outputfile.exe"
+ lt_tool_outputfile="$lt_tool_outputfile.exe"
+ ;;
+ esac~
+ func_to_tool_file "$lt_outputfile"~
+ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
+ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+ $RM "$lt_outputfile.manifest";
+ fi'
+ ;;
+ *)
+ # g++
+ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+ # as there is no search path for DLLs.
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=no
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+
+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
darwin* | rhapsody*)
_LT_DARWIN_LINKER_FEATURES($1)
;;
gnu*)
;;
+ haiku*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
hpux9*)
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
_LT_TAGVAR(hardcode_libdir_separator, $1)=:
# explicitly linking system object files so we need to strip them
# from the output so that they don't get included in the library
# dependencies.
- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
;;
*)
if test "$GXX" = yes; then
- _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
else
# FIXME: insert proper C++ library support
_LT_TAGVAR(ld_shlibs, $1)=no
# explicitly linking system object files so we need to strip them
# from the output so that they don't get included in the library
# dependencies.
- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
;;
*)
if test "$GXX" = yes; then
_LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
;;
ia64*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
;;
*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
;;
esac
fi
case $cc_basename in
CC*)
# SGI C++
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
# Archives containing C++ object files must be created using
# "CC -ar", where "CC" is the IRIX C++ compiler. This is
*)
if test "$GXX" = yes; then
if test "$with_gnu_ld" = no; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
else
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
fi
fi
_LT_TAGVAR(link_all_deplibs, $1)=yes
_LT_TAGVAR(inherit_rpath, $1)=yes
;;
- linux* | k*bsd*-gnu)
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
case $cc_basename in
KCC*)
# Kuck and Associates, Inc. (KAI) C++ Compiler
# explicitly linking system object files so we need to strip them
# from the output so that they don't get included in the library
# dependencies.
- output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+ output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
pgCC* | pgcpp*)
# Portland Group C++ compiler
case `$CC -V` in
- *pgCC\ [[1-5]]* | *pgcpp\ [[1-5]]*)
+ *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
_LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
rm -rf $tpldir~
$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
- compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"'
+ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
_LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
rm -rf $tpldir~
$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
- $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~
+ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
$RANLIB $oldlib'
_LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
rm -rf $tpldir~
$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
- $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
_LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
rm -rf $tpldir~
$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
- $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
;;
- *) # Version 6 will use weak symbols
+ *) # Version 6 and above use weak symbols
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
;;
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
;;
cxx*)
# Compaq C++
# explicitly linking system object files so we need to strip them
# from the output so that they don't get included in the library
# dependencies.
- output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
;;
- xl*)
+ xl* | mpixl* | bgxl*)
# IBM XL 8.0 on PPC, with GNU ld
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
_LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
_LT_TAGVAR(compiler_needs_object, $1)=yes
# Not sure whether something based on
# $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
# would be better.
- output_verbose_link_cmd='echo'
+ output_verbose_link_cmd='func_echo_all'
# Archives containing C++ object files must be created using
# "CC -xar", where "CC" is the Sun C++ compiler. This is
_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
_LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
fi
- output_verbose_link_cmd=echo
+ output_verbose_link_cmd=func_echo_all
else
_LT_TAGVAR(ld_shlibs, $1)=no
fi
case $host in
osf3*)
_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
;;
*)
_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
_LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
echo "-hidden">> $lib.exp~
- $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~
+ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~
$RM $lib.exp'
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
;;
# explicitly linking system object files so we need to strip them
# from the output so that they don't get included in the library
# dependencies.
- output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
;;
*)
if test "$GXX" = yes && test "$with_gnu_ld" = no; then
_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
case $host in
osf3*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
;;
*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
;;
esac
# Commands to make compiler produce verbose output that lists
# what "hidden" libraries, object files and flags are used when
# linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
else
# FIXME: insert proper C++ library support
solaris*)
case $cc_basename in
- CC*)
+ CC* | sunCC*)
# Sun C++ 4.2, 5.x and Centerline C++
_LT_TAGVAR(archive_cmds_need_lc,$1)=yes
_LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
esac
_LT_TAGVAR(link_all_deplibs, $1)=yes
- output_verbose_link_cmd='echo'
+ output_verbose_link_cmd='func_echo_all'
# Archives containing C++ object files must be created using
# "CC -xar", where "CC" is the Sun C++ compiler. This is
if test "$GXX" = yes && test "$with_gnu_ld" = no; then
_LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
if $CC --version | $GREP -v '^2\.7' > /dev/null; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
- $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+ $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
# Commands to make compiler produce verbose output that lists
# what "hidden" libraries, object files and flags are used when
# linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
else
# g++ 2.7 appears to require `-G' NOT `-shared' on this
# platform.
# Commands to make compiler produce verbose output that lists
# what "hidden" libraries, object files and flags are used when
# linking a shared library.
- output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
+ output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
fi
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
CC*)
_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
+ '"$_LT_TAGVAR(old_archive_cmds, $1)"
+ _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
+ '"$_LT_TAGVAR(reload_cmds, $1)"
;;
*)
_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
fi # test -n "$compiler"
CC=$lt_save_CC
+ CFLAGS=$lt_save_CFLAGS
LDCXX=$LD
LD=$lt_save_LD
GCC=$lt_save_GCC
])# _LT_LANG_CXX_CONFIG
+# _LT_FUNC_STRIPNAME_CNF
+# ----------------------
+# func_stripname_cnf prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+#
+# This function is identical to the (non-XSI) version of func_stripname,
+# except this one can be used by m4 code that may be executed by configure,
+# rather than the libtool script.
+m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
+AC_REQUIRE([_LT_DECL_SED])
+AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
+func_stripname_cnf ()
+{
+ case ${2} in
+ .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+ *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+ esac
+} # func_stripname_cnf
+])# _LT_FUNC_STRIPNAME_CNF
+
# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
# ---------------------------------
# Figure out "hidden" library dependencies from verbose
# objects, libraries and library flags.
m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
# Dependencies to place before and after the object being linked:
_LT_TAGVAR(predep_objects, $1)=
_LT_TAGVAR(postdep_objects, $1)=
};
_LT_EOF
])
+
+_lt_libdeps_save_CFLAGS=$CFLAGS
+case "$CC $CFLAGS " in #(
+*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
+*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
+esac
+
dnl Parse the compiler output and extract the necessary
dnl objects, libraries and library flags.
if AC_TRY_EVAL(ac_compile); then
pre_test_object_deps_done=no
for p in `eval "$output_verbose_link_cmd"`; do
- case $p in
+ case ${prev}${p} in
-L* | -R* | -l*)
# Some compilers place space between "-{L,R}" and the path.
test $p = "-R"; then
prev=$p
continue
- else
- prev=
fi
+ # Expand the sysroot to ease extracting the directories later.
+ if test -z "$prev"; then
+ case $p in
+ -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
+ -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
+ -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
+ esac
+ fi
+ case $p in
+ =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
+ esac
if test "$pre_test_object_deps_done" = no; then
- case $p in
- -L* | -R*)
+ case ${prev} in
+ -L | -R)
# Internal compiler library paths should come after those
# provided the user. The postdeps already come after the
# user supplied libs so there is no need to process them.
_LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
fi
fi
+ prev=
;;
+ *.lto.$objext) ;; # Ignore GCC LTO objects
*.$objext)
# This assumes that the test object file only shows up
# once in the compiler output.
fi
$RM -f confest.$objext
+CFLAGS=$_lt_libdeps_save_CFLAGS
# PORTME: override above test on systems where it is broken
m4_if([$1], [CXX],
solaris*)
case $cc_basename in
- CC*)
+ CC* | sunCC*)
# The more standards-conforming stlport4 library is
# incompatible with the Cstd library. Avoid specifying
# it if it's in CXXFLAGS. Ignore libCrun as
])# _LT_SYS_HIDDEN_LIBDEPS
-# _LT_PROG_F77
-# ------------
-# Since AC_PROG_F77 is broken, in that it returns the empty string
-# if there is no fortran compiler, we have our own version here.
-m4_defun([_LT_PROG_F77],
-[
-pushdef([AC_MSG_ERROR], [_lt_disable_F77=yes])
-AC_PROG_F77
-if test -z "$F77" || test "X$F77" = "Xno"; then
- _lt_disable_F77=yes
-fi
-popdef([AC_MSG_ERROR])
-])# _LT_PROG_F77
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([_LT_PROG_F77], [])
-
-
# _LT_LANG_F77_CONFIG([TAG])
# --------------------------
# Ensure that the configuration variables for a Fortran 77 compiler are
# suitably defined. These variables are subsequently used by _LT_CONFIG
# to write the compiler configuration to `libtool'.
m4_defun([_LT_LANG_F77_CONFIG],
-[AC_REQUIRE([_LT_PROG_F77])dnl
-AC_LANG_PUSH(Fortran 77)
+[AC_LANG_PUSH(Fortran 77)
+if test -z "$F77" || test "X$F77" = "Xno"; then
+ _lt_disable_F77=yes
+fi
_LT_TAGVAR(archive_cmds_need_lc, $1)=no
_LT_TAGVAR(allow_undefined_flag, $1)=
_LT_TAGVAR(module_expsym_cmds, $1)=
_LT_TAGVAR(link_all_deplibs, $1)=unknown
_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
_LT_TAGVAR(no_undefined_flag, $1)=
_LT_TAGVAR(whole_archive_flag_spec, $1)=
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
# Allow CC to be a program name with arguments.
lt_save_CC="$CC"
lt_save_GCC=$GCC
+ lt_save_CFLAGS=$CFLAGS
CC=${F77-"f77"}
+ CFLAGS=$FFLAGS
compiler=$CC
_LT_TAGVAR(compiler, $1)=$CC
_LT_CC_BASENAME([$compiler])
GCC=$lt_save_GCC
CC="$lt_save_CC"
+ CFLAGS="$lt_save_CFLAGS"
fi # test "$_lt_disable_F77" != yes
AC_LANG_POP
])# _LT_LANG_F77_CONFIG
-# _LT_PROG_FC
-# -----------
-# Since AC_PROG_FC is broken, in that it returns the empty string
-# if there is no fortran compiler, we have our own version here.
-m4_defun([_LT_PROG_FC],
-[
-pushdef([AC_MSG_ERROR], [_lt_disable_FC=yes])
-AC_PROG_FC
-if test -z "$FC" || test "X$FC" = "Xno"; then
- _lt_disable_FC=yes
-fi
-popdef([AC_MSG_ERROR])
-])# _LT_PROG_FC
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([_LT_PROG_FC], [])
-
-
# _LT_LANG_FC_CONFIG([TAG])
# -------------------------
# Ensure that the configuration variables for a Fortran compiler are
# suitably defined. These variables are subsequently used by _LT_CONFIG
# to write the compiler configuration to `libtool'.
m4_defun([_LT_LANG_FC_CONFIG],
-[AC_REQUIRE([_LT_PROG_FC])dnl
-AC_LANG_PUSH(Fortran)
+[AC_LANG_PUSH(Fortran)
+
+if test -z "$FC" || test "X$FC" = "Xno"; then
+ _lt_disable_FC=yes
+fi
_LT_TAGVAR(archive_cmds_need_lc, $1)=no
_LT_TAGVAR(allow_undefined_flag, $1)=
_LT_TAGVAR(module_expsym_cmds, $1)=
_LT_TAGVAR(link_all_deplibs, $1)=unknown
_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
_LT_TAGVAR(no_undefined_flag, $1)=
_LT_TAGVAR(whole_archive_flag_spec, $1)=
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
# Allow CC to be a program name with arguments.
lt_save_CC="$CC"
lt_save_GCC=$GCC
+ lt_save_CFLAGS=$CFLAGS
CC=${FC-"f95"}
+ CFLAGS=$FCFLAGS
compiler=$CC
GCC=$ac_cv_fc_compiler_gnu
fi # test -n "$compiler"
GCC=$lt_save_GCC
- CC="$lt_save_CC"
+ CC=$lt_save_CC
+ CFLAGS=$lt_save_CFLAGS
fi # test "$_lt_disable_FC" != yes
AC_LANG_POP
_LT_LINKER_BOILERPLATE
# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
+lt_save_CC=$CC
+lt_save_CFLAGS=$CFLAGS
lt_save_GCC=$GCC
GCC=yes
CC=${GCJ-"gcj"}
+CFLAGS=$GCJFLAGS
compiler=$CC
_LT_TAGVAR(compiler, $1)=$CC
_LT_TAGVAR(LD, $1)="$LD"
_LT_TAGVAR(archive_cmds_need_lc, $1)=no
_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
## CAVEAT EMPTOR:
## There is no encapsulation within the following macros, do not change
AC_LANG_RESTORE
GCC=$lt_save_GCC
-CC="$lt_save_CC"
+CC=$lt_save_CC
+CFLAGS=$lt_save_CFLAGS
])# _LT_LANG_GCJ_CONFIG
# Allow CC to be a program name with arguments.
lt_save_CC="$CC"
+lt_save_CFLAGS=$CFLAGS
lt_save_GCC=$GCC
GCC=
CC=${RC-"windres"}
+CFLAGS=
compiler=$CC
_LT_TAGVAR(compiler, $1)=$CC
_LT_CC_BASENAME([$compiler])
GCC=$lt_save_GCC
AC_LANG_RESTORE
-CC="$lt_save_CC"
+CC=$lt_save_CC
+CFLAGS=$lt_save_CFLAGS
])# _LT_LANG_RC_CONFIG
AC_SUBST([OBJDUMP])
])
+# _LT_DECL_DLLTOOL
+# ----------------
+# Ensure DLLTOOL variable is set.
+m4_defun([_LT_DECL_DLLTOOL],
+[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
+AC_SUBST([DLLTOOL])
+])
# _LT_DECL_SED
# ------------
# Try some XSI features
xsi_shell=no
( _lt_dummy="a/b/c"
- test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
- = c,a/b,, \
+ test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
+ = c,a/b,b/c, \
&& eval 'test $(( 1 + 1 )) -eq 2 \
&& test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
&& xsi_shell=yes
])# _LT_CHECK_SHELL_FEATURES
-# _LT_PROG_XSI_SHELLFNS
-# ---------------------
-# Bourne and XSI compatible variants of some useful shell functions.
-m4_defun([_LT_PROG_XSI_SHELLFNS],
-[case $xsi_shell in
- yes)
- cat << \_LT_EOF >> "$cfgfile"
-
-# func_dirname file append nondir_replacement
-# Compute the dirname of FILE. If nonempty, add APPEND to the result,
-# otherwise set result to NONDIR_REPLACEMENT.
-func_dirname ()
-{
- case ${1} in
- */*) func_dirname_result="${1%/*}${2}" ;;
- * ) func_dirname_result="${3}" ;;
- esac
-}
-
-# func_basename file
-func_basename ()
-{
- func_basename_result="${1##*/}"
-}
-
-# func_dirname_and_basename file append nondir_replacement
-# perform func_basename and func_dirname in a single function
-# call:
-# dirname: Compute the dirname of FILE. If nonempty,
-# add APPEND to the result, otherwise set result
-# to NONDIR_REPLACEMENT.
-# value returned in "$func_dirname_result"
-# basename: Compute filename of FILE.
-# value retuned in "$func_basename_result"
-# Implementation must be kept synchronized with func_dirname
-# and func_basename. For efficiency, we do not delegate to
-# those functions but instead duplicate the functionality here.
-func_dirname_and_basename ()
-{
- case ${1} in
- */*) func_dirname_result="${1%/*}${2}" ;;
- * ) func_dirname_result="${3}" ;;
- esac
- func_basename_result="${1##*/}"
-}
-
-# func_stripname prefix suffix name
-# strip PREFIX and SUFFIX off of NAME.
-# PREFIX and SUFFIX must not contain globbing or regex special
-# characters, hashes, percent signs, but SUFFIX may contain a leading
-# dot (in which case that matches only a dot).
-func_stripname ()
-{
- # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
- # positional parameters, so assign one to ordinary parameter first.
- func_stripname_result=${3}
- func_stripname_result=${func_stripname_result#"${1}"}
- func_stripname_result=${func_stripname_result%"${2}"}
-}
-
-# func_opt_split
-func_opt_split ()
-{
- func_opt_split_opt=${1%%=*}
- func_opt_split_arg=${1#*=}
-}
-
-# func_lo2o object
-func_lo2o ()
-{
- case ${1} in
- *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
- *) func_lo2o_result=${1} ;;
- esac
-}
-
-# func_xform libobj-or-source
-func_xform ()
-{
- func_xform_result=${1%.*}.lo
-}
-
-# func_arith arithmetic-term...
-func_arith ()
-{
- func_arith_result=$(( $[*] ))
-}
-
-# func_len string
-# STRING may not start with a hyphen.
-func_len ()
-{
- func_len_result=${#1}
-}
+# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
+# ------------------------------------------------------
+# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
+# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
+m4_defun([_LT_PROG_FUNCTION_REPLACE],
+[dnl {
+sed -e '/^$1 ()$/,/^} # $1 /c\
+$1 ()\
+{\
+m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1])
+} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+])
-_LT_EOF
- ;;
- *) # Bourne compatible functions.
- cat << \_LT_EOF >> "$cfgfile"
-# func_dirname file append nondir_replacement
-# Compute the dirname of FILE. If nonempty, add APPEND to the result,
-# otherwise set result to NONDIR_REPLACEMENT.
-func_dirname ()
-{
- # Extract subdirectory from the argument.
- func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
- if test "X$func_dirname_result" = "X${1}"; then
- func_dirname_result="${3}"
- else
- func_dirname_result="$func_dirname_result${2}"
- fi
-}
+# _LT_PROG_REPLACE_SHELLFNS
+# -------------------------
+# Replace existing portable implementations of several shell functions with
+# equivalent extended shell implementations where those features are available..
+m4_defun([_LT_PROG_REPLACE_SHELLFNS],
+[if test x"$xsi_shell" = xyes; then
+ _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
+ case ${1} in
+ */*) func_dirname_result="${1%/*}${2}" ;;
+ * ) func_dirname_result="${3}" ;;
+ esac])
+
+ _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
+ func_basename_result="${1##*/}"])
+
+ _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
+ case ${1} in
+ */*) func_dirname_result="${1%/*}${2}" ;;
+ * ) func_dirname_result="${3}" ;;
+ esac
+ func_basename_result="${1##*/}"])
-# func_basename file
-func_basename ()
-{
- func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
-}
+ _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
+ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+ # positional parameters, so assign one to ordinary parameter first.
+ func_stripname_result=${3}
+ func_stripname_result=${func_stripname_result#"${1}"}
+ func_stripname_result=${func_stripname_result%"${2}"}])
-dnl func_dirname_and_basename
-dnl A portable version of this function is already defined in general.m4sh
-dnl so there is no need for it here.
+ _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
+ func_split_long_opt_name=${1%%=*}
+ func_split_long_opt_arg=${1#*=}])
-# func_stripname prefix suffix name
-# strip PREFIX and SUFFIX off of NAME.
-# PREFIX and SUFFIX must not contain globbing or regex special
-# characters, hashes, percent signs, but SUFFIX may contain a leading
-# dot (in which case that matches only a dot).
-# func_strip_suffix prefix name
-func_stripname ()
-{
- case ${2} in
- .*) func_stripname_result=`$ECHO "X${3}" \
- | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;;
- *) func_stripname_result=`$ECHO "X${3}" \
- | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;;
- esac
-}
+ _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
+ func_split_short_opt_arg=${1#??}
+ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
-# sed scripts:
-my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q'
-my_sed_long_arg='1s/^-[[^=]]*=//'
+ _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
+ case ${1} in
+ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
+ *) func_lo2o_result=${1} ;;
+ esac])
-# func_opt_split
-func_opt_split ()
-{
- func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"`
- func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"`
-}
+ _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo])
-# func_lo2o object
-func_lo2o ()
-{
- func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"`
-}
+ _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))])
-# func_xform libobj-or-source
-func_xform ()
-{
- func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[[^.]]*$/.lo/'`
-}
+ _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}])
+fi
-# func_arith arithmetic-term...
-func_arith ()
-{
- func_arith_result=`expr "$[@]"`
-}
+if test x"$lt_shell_append" = xyes; then
+ _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"])
-# func_len string
-# STRING may not start with a hyphen.
-func_len ()
-{
- func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len`
-}
+ _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
+ func_quote_for_eval "${2}"
+dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
+ eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
-_LT_EOF
-esac
+ # Save a `func_append' function call where possible by direct use of '+='
+ sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+ test 0 -eq $? || _lt_function_replace_fail=:
+else
+ # Save a `func_append' function call even when '+=' is not available
+ sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+ test 0 -eq $? || _lt_function_replace_fail=:
+fi
-case $lt_shell_append in
- yes)
- cat << \_LT_EOF >> "$cfgfile"
+if test x"$_lt_function_replace_fail" = x":"; then
+ AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
+fi
+])
-# func_append var value
-# Append VALUE to the end of shell variable VAR.
-func_append ()
-{
- eval "$[1]+=\$[2]"
-}
-_LT_EOF
+# _LT_PATH_CONVERSION_FUNCTIONS
+# -----------------------------
+# Determine which file name conversion functions should be used by
+# func_to_host_file (and, implicitly, by func_to_host_path). These are needed
+# for certain cross-compile configurations and native mingw.
+m4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+AC_MSG_CHECKING([how to convert $build file names to $host format])
+AC_CACHE_VAL(lt_cv_to_host_file_cmd,
+[case $host in
+ *-*-mingw* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
+ ;;
+ *-*-cygwin* )
+ lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
+ ;;
+ * ) # otherwise, assume *nix
+ lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
+ ;;
+ esac
;;
- *)
- cat << \_LT_EOF >> "$cfgfile"
-
-# func_append var value
-# Append VALUE to the end of shell variable VAR.
-func_append ()
-{
- eval "$[1]=\$$[1]\$[2]"
-}
-
-_LT_EOF
+ *-*-cygwin* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
+ ;;
+ *-*-cygwin* )
+ lt_cv_to_host_file_cmd=func_convert_file_noop
+ ;;
+ * ) # otherwise, assume *nix
+ lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
+ ;;
+ esac
;;
- esac
+ * ) # unhandled hosts (and "normal" native builds)
+ lt_cv_to_host_file_cmd=func_convert_file_noop
+ ;;
+esac
+])
+to_host_file_cmd=$lt_cv_to_host_file_cmd
+AC_MSG_RESULT([$lt_cv_to_host_file_cmd])
+_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
+ [0], [convert $build file names to $host format])dnl
+
+AC_MSG_CHECKING([how to convert $build file names to toolchain format])
+AC_CACHE_VAL(lt_cv_to_tool_file_cmd,
+[#assume ordinary cross tools, or native build.
+lt_cv_to_tool_file_cmd=func_convert_file_noop
+case $host in
+ *-*-mingw* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
+ ;;
+ esac
+ ;;
+esac
])
+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
+AC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
+_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
+ [0], [convert $build files to toolchain format])dnl
+])# _LT_PATH_CONVERSION_FUNCTIONS
# Helper functions for option handling. -*- Autoconf -*-
#
-# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
+# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
# Written by Gary V. Vaughan, 2004
#
# This file is free software; the Free Software Foundation gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
-# serial 6 ltoptions.m4
+# serial 7 ltoptions.m4
# This is to help aclocal find these macros, as it can't see m4_define.
AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
[enable_win32_dll=yes
case $host in
-*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*)
+*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
AC_CHECK_TOOL(AS, as, false)
AC_CHECK_TOOL(DLLTOOL, dlltool, false)
AC_CHECK_TOOL(OBJDUMP, objdump, false)
esac
test -z "$AS" && AS=as
-_LT_DECL([], [AS], [0], [Assembler program])dnl
+_LT_DECL([], [AS], [1], [Assembler program])dnl
test -z "$DLLTOOL" && DLLTOOL=dlltool
-_LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl
+_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
test -z "$OBJDUMP" && OBJDUMP=objdump
-_LT_DECL([], [OBJDUMP], [0], [Object dumper program])dnl
+_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
])# win32-dll
AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
-# Generated from ltversion.in.
+# @configure_input@
-# serial 3017 ltversion.m4
+# serial 3293 ltversion.m4
# This file is part of GNU Libtool
-m4_define([LT_PACKAGE_VERSION], [2.2.6b])
-m4_define([LT_PACKAGE_REVISION], [1.3017])
+m4_define([LT_PACKAGE_VERSION], [2.4])
+m4_define([LT_PACKAGE_REVISION], [1.3293])
AC_DEFUN([LTVERSION_VERSION],
-[macro_version='2.2.6b'
-macro_revision='1.3017'
+[macro_version='2.4'
+macro_revision='1.3293'
_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
_LT_DECL(, macro_revision, 0)
])
# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
#
-# Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc.
+# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
# Written by Scott James Remnant, 2004.
#
# This file is free software; the Free Software Foundation gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
-# serial 4 lt~obsolete.m4
+# serial 5 lt~obsolete.m4
# These exist entirely to fool aclocal when bootstrapping libtool.
#
m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])])
m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])])
m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])])
-m4_ifndef([AC_LIBTOOL_RC], [AC_DEFUN([AC_LIBTOOL_RC])])
m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])])
m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
+m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
+m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])])
+m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
+m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
+m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])])
+m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])])
+m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])])
--- /dev/null
+--- udev/rules/debian/80-drivers.rules 1970-01-01 09:00:00.000000000 +0900
++++ udev-174/rules/debian/80-drivers.rules 2012-07-30 17:13:38.353317439 +0900
+@@ -0,0 +1,58 @@
++ACTION=="remove", GOTO="drivers_end"
++
++# check if the device has already been claimed by a driver
++ENV{DRIVER}=="?*", SUBSYSTEM!="input", GOTO="hotplug_driver_loaded"
++
++# load the drivers
++ENV{MODALIAS}=="?*", RUN+="/sbin/modprobe -b $env{MODALIAS}"
++
++# workaround for kernels < 2.6.27-rc5
++SUBSYSTEM=="pnp", ENV{MODALIAS}!="?*", \
++ RUN+="/bin/sh -c '/sbin/modprobe --use-blacklist --all $$(while read id; do echo pnp:d$$id; done < /sys$devpath/id)'"
++
++SUBSYSTEM=="pcmcia_socket", RUN+="/sbin/modprobe -b pcmcia"
++
++# rules for subsystems which lack proper hotplug support
++SUBSYSTEM=="i2o", RUN+="/sbin/modprobe -b i2o_block"
++# workaround for kernels < 2.6.30
++SUBSYSTEM=="mmc", RUN+="/sbin/modprobe -b mmc_block"
++SUBSYSTEM=="memstick", RUN+="/sbin/modprobe -b --all ms_block mspro_block"
++SUBSYSTEM=="tifm", ENV{TIFM_CARD_TYPE}=="SD", \
++ RUN+="/sbin/modprobe -b tifm_sd"
++SUBSYSTEM=="tifm", ENV{TIFM_CARD_TYPE}=="MS", \
++ RUN+="/sbin/modprobe -b tifm_ms"
++
++SUBSYSTEM=="scsi_device", ATTRS{type}=="[235689]", TEST!="[module/sg]", \
++ RUN+="/sbin/modprobe -b sg"
++
++SUBSYSTEM=="ide", ATTR{media}=="tape", RUN+="/sbin/modprobe -b ide-scsi"
++
++# Load VIO modules based on the device type
++SUBSYSTEM!="vio", GOTO="hotplug_vio_end"
++ENV{MODALIAS}=="?*", GOTO="hotplug_vio_end"
++ENV{VIO_TYPE}!="?*", IMPORT{program}="vio_type --export $devpath"
++ENV{VIO_TYPE}=="serial", RUN+="/sbin/modprobe -b hvc_console"
++ENV{VIO_TYPE}=="serial-server", RUN+="/sbin/modprobe -b hvcs"
++ENV{VIO_TYPE}=="network", RUN+="/sbin/modprobe -b ibmveth"
++ENV{VIO_TYPE}=="vscsi", RUN+="/sbin/modprobe -b ibmvscsic"
++ENV{VIO_TYPE}=="vlan", RUN+="/sbin/modprobe -b iseries_veth"
++ENV{VIO_TYPE}=="viodasd", RUN+="/sbin/modprobe -b viodasd"
++ENV{VIO_TYPE}=="viocd", RUN+="/sbin/modprobe -b viocd"
++ENV{VIO_TYPE}=="vnet", RUN+="/sbin/modprobe -b sunvnet"
++ENV{VIO_TYPE}=="vdisk", RUN+="/sbin/modprobe -b sunvdc"
++LABEL="hotplug_vio_end"
++
++# From here on follows the hotplug agents which do not load modules
++LABEL="hotplug_driver_loaded"
++
++SUBSYSTEM=="firmware", RUN+="firmware.agent"
++
++LABEL="drivers_end"
++
++SUBSYSTEM=="net", RUN+="net.agent"
++
++SUBSYSTEM=="atm", RUN+="dsl-modem.agent"
++
++# Log every event to /dev/hotplug.log (for debugging).
++#SUBSYSTEM!="uids", RUN+="logger.agent"
++
--- /dev/null
+--- udev/extra/firmware.agent 1970-01-01 09:00:00.000000000 +0900
++++ udev-174/extra/firmware.agent 2012-07-30 17:13:34.629317386 +0900
+@@ -0,0 +1,35 @@
++#!/bin/sh -e
++#
++# firmware loader agent
++#
++
++cd /lib/udev/
++. ./hotplug.functions
++
++if [ ! -e /sys/$DEVPATH/loading ]; then
++ mesg "/sys/$DEVPATH/ does not exist"
++ exit 1
++fi
++
++FIRMWARE_DIRS="/lib/firmware/$(uname -r) /lib/firmware /usr/local/lib/firmware /usr/lib/hotplug/firmware"
++
++for DIR in $FIRMWARE_DIRS; do
++ [ -e "$DIR/$FIRMWARE" ] || continue
++ echo 1 > /sys/$DEVPATH/loading
++ cat "$DIR/$FIRMWARE" > /sys/$DEVPATH/data
++ echo 0 > /sys/$DEVPATH/loading
++ exit 0
++done
++
++# the firmware was not found
++echo -1 > /sys/$DEVPATH/loading
++
++if [ -d /dev/.udev/ ]; then
++ mkdir -p /dev/.udev/firmware-missing/
++ file=$(echo "$FIRMWARE" | sed -e 's#/#\\x2f#g')
++ ln -s -f "$DEVPATH" /dev/.udev/firmware-missing/$file
++fi
++
++debug_mesg "Cannot find the $FIRMWARE firmware"
++exit 1
++
--- /dev/null
+diff -ruN udev-166/extra/hotplug.functions udev/extra/hotplug.functions
+--- udev-166/extra/hotplug.functions 1970-01-01 09:00:00.000000000 +0900
++++ udev/extra/hotplug.functions 2011-05-25 20:30:10.000000000 +0900
+@@ -0,0 +1,61 @@
++# Setup and shell utility functions for use in hotplug agents.
++# vim: syntax=sh
++#
++# This program is free software; you can redistribute it and/or modify it
++# under the terms of the GNU General Public License as published by the
++# Free Software Foundation version 2 of the License.
++
++if [ "$UDEV_LOG" ] && [ "$UDEV_LOG" -ge 7 ]; then
++ DEBUG=yes
++fi
++
++PATH='/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin'
++
++[ -e /etc/default/hotplug ] && . /etc/default/hotplug
++
++
++if [ -x /usr/bin/logger ]; then
++ LOGGER=/usr/bin/logger
++elif [ -x /bin/logger ]; then
++ LOGGER=/bin/logger
++else
++ unset LOGGER
++fi
++
++# for diagnostics
++if [ -t 1 -a -z "$LOGGER" ] || [ ! -e '/dev/log' ]; then
++ mesg() {
++ echo "$@" >&2
++ }
++elif [ -t 1 ]; then
++ mesg() {
++ echo "$@"
++ $LOGGER -t "${0##*/}[$$]" "$@"
++ }
++else
++ mesg() {
++ $LOGGER -t "${0##*/}[$$]" "$@"
++ }
++fi
++
++debug_mesg() {
++ [ -z "$DEBUG" -o "$DEBUG" = no ] && return 0
++ mesg "$@"
++}
++
++wait_for_file() {
++ local file=$1
++ local timeout=$2
++ [ "$timeout" ] || timeout=120
++
++ local count=$timeout
++ while [ $count != 0 ]; do
++ [ -e "$file" ] && return 0
++ sleep 1
++ count=$(($count - 1))
++ done
++
++ mesg "$file did not appear before the timeout!"
++ exit 1
++}
++
+++ /dev/null
-#!/bin/sh -e
-### BEGIN INIT INFO
-# Provides: udev
-# Required-Start: mountkernfs
-# Required-Stop:
-# Default-Start: S
-# Default-Stop:
-# X-Interactive: true
-# Short-Description: Start udevd, populate /dev and load drivers.
-### END INIT INFO
-
-# we need to unmount /dev/pts/ and remount it later over the tmpfs
-unmount_devpts() {
- if mountpoint -q /dev/pts/; then
- umount -n -l /dev/pts/
- fi
-
- if mountpoint -q /dev/shm/; then
- umount -n -l /dev/shm/
- fi
-}
-
-# mount a tmpfs over /dev, if somebody did not already do it
-mount_tmpfs() {
- if grep -E -q "^[^[:space:]]+ /dev (dev)?tmpfs" /proc/mounts; then
- mount -n -o remount,${dev_mount_options} -t tmpfs tmpfs /dev
- return
- fi
-
- if ! mount -n -o $dev_mount_options -t tmpfs tmpfs /dev; then
- log_failure_msg "udev requires tmpfs support, not started."
- log_end_msg 1
- fi
-
- return 0
-}
-
-create_dev_makedev() {
- if [ -e /sbin/MAKEDEV ]; then
- ln -sf /sbin/MAKEDEV /dev/MAKEDEV
- else
- ln -sf /bin/true /dev/MAKEDEV
- fi
-}
-
-supported_kernel() {
- case "$(uname -r)" in
- 2.[012345].*|2.6.[0-9]|2.6.[0-9][!0-9]*) return 1 ;;
- 2.6.1[0-9]|2.6.1[0-9][!0-9]*) return 1 ;;
- 2.6.2[0-6]|2.6.2[0-6][!0-9]*) return 1 ;;
- esac
- return 0
-}
-
-# shell version of /usr/bin/tty
-my_tty() {
- [ -x /bin/readlink ] || return 0
- [ -e /proc/self/fd/0 ] || return 0
- readlink --silent /proc/self/fd/0 || true
-}
-
-warn_if_interactive() {
- if [ "$RUNLEVEL" = "S" -a "$PREVLEVEL" = "N" ]; then
- return
- fi
-
- TTY=$(my_tty)
- if [ -z "$TTY" -o "$TTY" = "/dev/console" -o "$TTY" = "/dev/null" ]; then
- return
- fi
-
- printf "\n\n\nIt has been detected that the command\n\n\t$0 $*\n\n"
- printf "has been run from an interactive shell.\n"
- printf "It will probably not do what you expect, so this script will wait\n"
- printf "60 seconds before continuing. Press ^C to stop it.\n"
- printf "RUNNING THIS COMMAND IS HIGHLY DISCOURAGED!\n\n\n\n"
- sleep 60
-}
-
-create_dev_root_rule() {
- local udevroot="$1"
- [ -e $udevroot/rules.d/61-dev-root-link.rules ] && return 0
-
- eval $(udevadm info --export --export-prefix=ROOT_ --device-id-of-file=/ \
- || true)
- [ "$ROOT_MAJOR" -a "$ROOT_MINOR" ] || return 0
-
- echo 'ACTION=="add|change", SUBSYSTEM=="block", ENV{MAJOR}=="'$ROOT_MAJOR'", ENV{MINOR}=="'$ROOT_MINOR'", SYMLINK+="root"' \
- > $udevroot/root-link-rule
- mv $udevroot/root-link-rule $udevroot/rules.d/61-dev-root-link.rules
-}
-
-##############################################################################
-
-[ -x /sbin/udevd ] || exit 0
-
-PATH="/sbin:/bin"
-
-# defaults
-tmpfs_size="10M"
-udev_root="/dev"
-
-if [ -e /etc/udev/udev.conf ]; then
- . /etc/udev/udev.conf
-fi
-
-. /lib/lsb/init-functions
-
-if ! supported_kernel; then
- log_failure_msg "udev requires a kernel >= 2.6.27, not started."
- log_end_msg 1
-fi
-
-if [ ! -e /proc/filesystems ]; then
- log_failure_msg "udev requires a mounted procfs, not started."
- log_end_msg 1
-fi
-
-if ! grep -q '[[:space:]]tmpfs$' /proc/filesystems; then
- log_failure_msg "udev requires tmpfs support, not started."
- log_end_msg 1
-fi
-
-if [ ! -d /sys/class/ ]; then
- log_failure_msg "udev requires a mounted sysfs, not started."
- log_end_msg 1
-fi
-
-if [ ! -e /sys/kernel/uevent_helper ]; then
- log_failure_msg "udev requires hotplug support, not started."
- log_end_msg 1
-fi
-
-##############################################################################
-
-# this is experimental and may not work well
-if [ "$UDEV_DISABLED" = "yes" ]; then
- udev_root=/etc/udev/.dev
- export UDEV_ROOT=$udev_root
-fi
-
-udev_root=${udev_root%/}
-
-dev_mount_options='mode=0755'
-if [ "$tmpfs_size" ]; then
- dev_mount_options="size=${tmpfs_size},${dev_mount_options}"
-fi
-
-if [ "$udev_root" != "/dev" ]; then
- log_warning_msg "udev_root != /dev/"
-
-case "$1" in
- start)
- if [ -e "$udev_root/.udev/" ]; then
- if mountpoint -q $udev_root/; then
- log_failure_msg "udev is already active on $udev_root."
- log_end_msg 1
- else
- log_warning_msg ".udev/ already exists on the static $udev_root!"
- fi
- fi
-
- echo > /sys/kernel/uevent_helper
-
- mount -n -o $dev_mount_options -t tmpfs tmpfs $udev_root
-
- log_daemon_msg "Starting the hotplug events dispatcher" "udevd"
- if udevd --daemon; then
- log_end_msg $?
- else
- log_end_msg $?
- fi
-
- mkdir -p $udev_root/.udev/rules.d/
- create_dev_root_rule $udev_root/.udev/
-
- log_action_begin_msg "Synthesizing initial hotplug events"
- if udevadm trigger --action=add; then
- log_action_end_msg $?
- else
- log_action_end_msg $?
- fi
-
- ;;
- stop)
- log_daemon_msg "Stopping the hotplug events dispatcher" "udevd"
- if start-stop-daemon --stop --name udevd --quiet --oknodo --retry 5; then
- log_end_msg $?
- else
- log_end_msg $?
- fi
-
- log_action_begin_msg "Unmounting $udev_root"
- # unmounting with -l should never fail
- if umount -n -l $udev_root; then
- log_action_end_msg $?
- else
- log_action_end_msg $?
- fi
- ;;
-
- restart)
- $0 stop
- $0 start
- ;;
-
- reload|force-reload)
- udevadm control --reload-rules
- ;;
-
- *)
- echo "Usage: /etc/init.d/udev {start|stop|restart|reload|force-reload}"
- exit 1
- ;;
-esac
-
- exit 0
-fi # udev_root != /dev
-
-##############################################################################
-
-# When modifying this script, do not forget that between the time that the
-# new /dev has been mounted and udevadm trigger has been run there will be
-# no /dev/null. This also means that you cannot use the "&" shell command.
-
-case "$1" in
- start)
- if [ -e "$udev_root/.udev/" ]; then
- if mountpoint -q $udev_root/; then
- TMPFS_MOUNTED=1
- else
- log_warning_msg ".udev/ already exists on the static $udev_root!"
- fi
- else
- warn_if_interactive
- fi
-
- echo > /sys/kernel/uevent_helper
-
- if [ -z "$TMPFS_MOUNTED" ]; then
- unmount_devpts
- mount_tmpfs
- [ -d /proc/1 ] || mount -n /proc
- else
- # and clean up the database of the initramfs udev
- rm -rf /dev/.udev/
- fi
-
- # set the SELinux context for devices created in the initramfs
- [ -x /sbin/restorecon ] && /sbin/restorecon -R /dev
-
- # /dev/null must be created before udevd is started
- /lib/udev/create_static_nodes || true
-
- log_daemon_msg "Starting the hotplug events dispatcher" "udevd"
- if udevd --daemon; then
- log_end_msg $?
- else
- log_end_msg $?
- fi
-
- mkdir -p /dev/.udev/rules.d/
- create_dev_root_rule /dev/.udev/
-
- log_action_begin_msg "Synthesizing the initial hotplug events"
- if udevadm trigger --action=add; then
- log_action_end_msg $?
- else
- log_action_end_msg $?
- fi
-
- create_dev_makedev
-
- # wait for the udevd childs to finish
- log_action_begin_msg "Waiting for /dev to be fully populated"
- if udevadm settle; then
- log_action_end_msg 0
- else
- log_action_end_msg 0 'timeout'
- fi
- ;;
-
- stop)
- log_daemon_msg "Stopping the hotplug events dispatcher" "udevd"
- if start-stop-daemon --stop --name udevd --quiet --oknodo --retry 5; then
- log_end_msg $?
- else
- log_end_msg $?
- fi
- ;;
-
- restart)
- log_daemon_msg "Stopping the hotplug events dispatcher" "udevd"
- if start-stop-daemon --stop --name udevd --quiet --oknodo --retry 5; then
- log_end_msg $?
- else
- log_end_msg $? || true
- fi
-
- log_daemon_msg "Starting the hotplug events dispatcher" "udevd"
- if udevd --daemon; then
- log_end_msg $?
- else
- log_end_msg $?
- fi
- ;;
-
- reload|force-reload)
- udevadm control --reload-rules
- ;;
-
- *)
- echo "Usage: /etc/init.d/udev {start|stop|restart|reload|force-reload}"
- exit 1
- ;;
-esac
-
-exit 0
-
Name: udev
-Version: 166
+Version: 174
Release: 1
License: GPLv2
Summary: A userspace implementation of devfs
Group: System/Base
Source0: http://www.kernel.org/pub/linux/utils/kernel/hotplug/%{name}-%{version}.tar.gz
-#Source1: start_udev
-Source2: udev.spec
-Source3: udev.udev-mtab.init
+Source1: start_udev
%define udev_libdir /lib/udev
%define firmwaredir /lib/firmware
+Patch0: udev-firmware.patch
+Patch1: udev-80-drivers.patch
+Patch2: udev-hotplug.patch
+
Url: http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html
BuildRequires: bison
BuildRequires: findutils
The udev package contains an implementation of devfs in
userspace using sysfs and netlink.
+%package rules-nondefault
+Summary: Udev rules not used in normal installs
+Group: System/base
+Requires: udev = %{version}
+
+%description rules-nondefault
+This package contains a set of udev rules not used in normal installs
+
%package -n libudev
Summary: Library for accessing udev functionality
Group: Development/Libraries
%prep
%setup -q
-
+%patch0 -p1
+%patch1 -p1
+%patch2 -p1
%build
libtoolize -f -c
%make_install
-mkdir -p %{buildroot}/etc/udev/
-mkdir -p %{buildroot}/etc/modprobe.d/
-mkdir -p %{buildroot}/etc/init.d/
-
-#install -m 0755 %{SOURCE1} $RPM_BUILD_ROOT/sbin/start_udev
+install -m 0755 %{SOURCE1} $RPM_BUILD_ROOT/sbin/start_udev
install -m 0755 ./udev/udevd $RPM_BUILD_ROOT/sbin/udevd
-install -m 644 extra/blacklist.conf extra/fbdev-blacklist.conf \
- %{buildroot}/etc/modprobe.d/
-cp -a extra/links.conf %{buildroot}/etc/udev/links.conf
-cp -a %{SOURCE2} %{buildroot}/etc/init.d/udev
-cp -a %{SOURCE3} %{buildroot}/etc/init.d/udev-mtab
+install -m 0755 extra/*.agent $RPM_BUILD_ROOT/lib/udev/
+cp extra/hotplug.functions $RPM_BUILD_ROOT/lib/udev/
+
+cp rules/debian/80-drivers.rules $RPM_BUILD_ROOT/lib/udev/rules.d/
%post
%postun -n libgudev1 -p /sbin/ldconfig
+%triggerpostun -- dev <= 0:3.12-1
+if [ $2 = 0 ]; then
+ if [ -x /sbin/MAKEDEV ]; then
+ /sbin/MAKEDEV null
+ else
+ /bin/mknod /dev/null c 1 3
+ fi
+ /sbin/start_udev >/dev/null 2>&1
+ if [ -e /dev/mapper/control -a -x /sbin/lvm ]; then
+ /sbin/lvm vgmknodes >/dev/null 2>&1
+ fi
+fi
+exit 0
+
+
+%triggerin -- MAKEDEV
+rm -f /var/lib/udev/makenode.d/* >/dev/null 2>&1 || :
+
%clean
rm -rf %{buildroot}
%files
%defattr(0644, root, root, 0755)
-%attr(0755,root,root) /sbin/udevadm
-%attr(0755,root,root) /sbin/udevd
+%doc COPYING README
%attr(0755,root,root) /%{_lib}/udev/keymaps/*
%attr(0755,root,root) /%{_lib}/udev/*
-
-/lib/udev/rules.d/*
-/lib/systemd/system/udev.service
-/lib/systemd/system/udev-retry.service
+%attr(0755,root,root) /sbin/start_udev
+%attr(0755,root,root) /sbin/udevd
+%attr(0755,root,root) /sbin/udevadm
+/etc/udev/udev.conf
+/lib/systemd/system/basic.target.wants/udev-trigger.service
/lib/systemd/system/basic.target.wants/udev.service
-/lib/systemd/system/basic.target.wants/udev-retry.service
-/lib/systemd/system/basic.target.wants/udev-settle.service
+/lib/systemd/system/sockets.target.wants/udev-control.socket
+/lib/systemd/system/sockets.target.wants/udev-kernel.socket
+/lib/systemd/system/udev-control.socket
+/lib/systemd/system/udev-kernel.socket
/lib/systemd/system/udev-settle.service
-/etc/udev/udev.conf
-/etc/udev/links.conf
-/etc/modprobe.d/fbdev-blacklist.conf
-/etc/modprobe.d/blacklist.conf
-/etc/init.d/udev
-/etc/init.d/udev-mtab
+/lib/systemd/system/udev-trigger.service
+/lib/systemd/system/udev.service
-#%files
+%files rules-nondefault
%attr(0755,root,root) %{udev_libdir}/rules.d/42-qemu-usb.rules
%attr(0755,root,root) %{udev_libdir}/rules.d/50-firmware.rules
%attr(0755,root,root) %{udev_libdir}/rules.d/50-udev-default.rules
%attr(0755,root,root) %{udev_libdir}/rules.d/60-persistent-storage-tape.rules
%attr(0755,root,root) %{udev_libdir}/rules.d/60-persistent-serial.rules
%attr(0755,root,root) %{udev_libdir}/rules.d/60-persistent-v4l.rules
-#%attr(0755,root,root) %{udev_libdir}/rules.d/61-accelerometer.rules
+%attr(0755,root,root) %{udev_libdir}/rules.d/61-accelerometer.rules
%attr(0755,root,root) %{udev_libdir}/rules.d/75-net-description.rules
%attr(0755,root,root) %{udev_libdir}/rules.d/75-probe_mtd.rules
%attr(0755,root,root) %{udev_libdir}/rules.d/75-tty-description.rules
%attr(0755,root,root) %{udev_libdir}/rules.d/95-udev-late.rules
%files -n libudev
-/%{_lib}/libudev.so.*
+%defattr(0644, root, root, 0755)
+%doc COPYING
+%attr(0755,root,root) /%{_lib}/libudev.so.*
%files -n libudev-devel
%defattr(0644, root, root, 0755)
+%doc COPYING
+%doc TODO ChangeLog extras/keymap/README.keymap.txt
%attr(0644,root,root) %{_mandir}/man8/udev*.8*
%attr(0644,root,root) %{_mandir}/man7/udev*.7*
%attr(0644,root,root) %{_mandir}/man8/scsi_id*.8*
/usr/include/libudev.h
/usr/lib/libudev.so
/usr/lib/pkgconfig/libudev.pc
+/usr/share/doc/udev/README.keymap.txt
/usr/share/pkgconfig/udev.pc
/usr/share/gtk-doc/html/libudev/*
-/usr/share/doc/udev/*
-%exclude %{_libdir}/ConsoleKit/*
%files -n libgudev1
-/%{_lib}/libgudev-1.0.so.*
+%defattr(0644, root, root, 0755)
+%doc COPYING
+%attr(0755,root,root) /%{_lib}/libgudev-1.0.so.*
%files -n libgudev1-devel
-%{_libdir}/libgudev-1.0.so
-%{_includedir}/gudev-1.0/gudev/*.h
-%{_libdir}/pkgconfig/gudev-1.0*
+%defattr(0644, root, root, 0755)
+%doc COPYING
+%attr(0755,root,root) %{_libdir}/libgudev-1.0.so
+%attr(0644,root,root) %{_includedir}/gudev-1.0/gudev/*.h
+%attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0*
%{_datadir}/gtk-doc/html/gudev/*
+++ /dev/null
-#!/bin/sh -e
-### BEGIN INIT INFO
-# Provides: udev-mtab
-# Required-Start: udev $local_fs
-# Required-Stop:
-# Default-Start: S
-# Default-Stop:
-# Short-Description: Add to mtab the entry for /dev.
-### END INIT INFO
-
-PATH="/sbin:/bin"
-
-case "$1" in
- start) ;;
- stop|restart|force-reload) exit 0 ;;
- *) echo "Usage: $0 {start|stop|restart|force-reload}" >&2; exit 1 ;;
-esac
-
-# copy the rules generated before / was mounted read-write
-for file in /dev/.udev/tmp-rules--*; do
- dest=${file##*tmp-rules--}
- [ "$dest" = '*' ] && break
- cat $file >> /etc/udev/rules.d/$dest
- rm -f $file
-done
-
-
-# if it's not, it's probably a symlink to /proc/mounts
-[ -w /etc/mtab ] || exit 0
-
-# defaults
-tmpfs_size="10M"
-udev_root="/dev/"
-
-if [ -e /etc/udev/udev.conf ]; then
- . /etc/udev/udev.conf
-fi
-
-# strip the trailing slash
-udev_root=${udev_root%/}
-
-if mountpoint -q $udev_root; then
- if ! grep -E --quiet --no-messages "^[^ ]+ +$udev_root +" /etc/mtab; then
- mtabline="$(grep -E --no-messages "^[^ ]+ +$udev_root +(dev)?tmpfs +" /proc/mounts || true)"
- if [ "$mtabline" ]; then
- echo "$mtabline" >> /etc/mtab
- fi
- fi
-fi
-
-exit 0
-
+++ /dev/null
-# import the properties of optical drives
-ACTION!="remove", SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", \
- KERNEL=="sr[0-9]*|hd[a-z]|pcd[0-9]|xvd*", \
- IMPORT{program}="cdrom_id --export $tempnode"
-
-# SCSI devices
-SUBSYSTEMS=="scsi", KERNEL=="sr[0-9]*", SYMLINK+="scd%n"
-SUBSYSTEM=="bsg", NAME="bsg/%k"
-
-# workaround for kernels < 2.6.30
-SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", WAIT_FOR="descriptors"
-
-# USB devices
-SUBSYSTEMS=="usb", KERNEL=="auer[0-9]*", NAME="usb/%k"
-SUBSYSTEMS=="usb", KERNEL=="cpad[0-9]*", NAME="usb/%k"
-SUBSYSTEMS=="usb", KERNEL=="dabusb[0-9]*", NAME="usb/%k"
-SUBSYSTEMS=="usb", KERNEL=="hiddev[0-9]*", NAME="usb/%k"
-SUBSYSTEMS=="usb", KERNEL=="legousbtower[0-9]*", NAME="usb/%k"
-SUBSYSTEMS=="usb", KERNEL=="lp[0-9]*", NAME="usb/%k"
-SUBSYSTEMS=="usb", KERNEL=="iowarrior[0-9]*", NAME="usb/%k"
-SUBSYSTEMS=="usb", KERNEL=="ttyUSB*", \
- ATTRS{product}=="[Hh]andspring*Treo*|[Hh]andspring*Visor*|[Pp]alm*Handheld*", \
- SYMLINK+="pilot"
-
-# usbfs-like devices
-SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", NAME="bus/usb/$env{BUSNUM}/$env{DEVNUM}"
-
-# serial devices
-KERNEL=="capi", NAME="capi20"
-KERNEL=="capi[0-9]*", NAME="capi/%n"
-
-# video devices
-KERNEL=="dvb*", ENV{DVB_ADAPTER_NUM}=="?*", NAME="dvb/adapter$env{DVB_ADAPTER_NUM}/$env{DVB_DEVICE_TYPE}$env{DVB_DEVICE_NUM}"
-# workaround for kernels < 2.6.29
-KERNEL=="dvb*", ENV{DVB_ADAPTER_NUM}=="", PROGRAM="/bin/sh -c 'K=%k; K=$${K#dvb}; printf dvb/adapter%%i/%%s $${K%%%%.*} $${K#*.}", ACTION!="remove", \
- NAME="$result"
-KERNEL=="card[0-9]*", NAME="dri/%k"
-
-# virtio serial / console ports
-KERNEL=="vport*", ATTR{name}=="?*", SYMLINK+="virtio-ports/$attr{name}"
-
-# misc devices
-KERNEL=="hw_random", NAME="hwrng"
-KERNEL=="tun", NAME="net/%k"
-KERNEL=="evtchn", NAME="xen/%k"
-SUBSYSTEM=="rtc", DRIVERS=="rtc_cmos", SYMLINK+="rtc"
-
-KERNEL=="rawctl", NAME="raw/rawctl"
-KERNEL=="cdemu[0-9]*", NAME="cdemu/%n"
-KERNEL=="pktcdvd[0-9]*", NAME="pktcdvd/%n"
-KERNEL=="pktcdvd", NAME="pktcdvd/control"
-
-KERNEL=="cpu[0-9]*", NAME="cpu/%n/cpuid"
-KERNEL=="msr[0-9]*", NAME="cpu/%n/msr"
-KERNEL=="microcode", NAME="cpu/microcode"
-
-KERNEL=="umad*", NAME="infiniband/%k"
-KERNEL=="issm*", NAME="infiniband/%k"
-KERNEL=="uverbs*", NAME="infiniband/%k"
-KERNEL=="ucm*", NAME="infiniband/%k"
-KERNEL=="uat", NAME="infiniband/%k"
-KERNEL=="ucma", NAME="infiniband/%k"
-KERNEL=="rdma_cm", NAME="infiniband/%k"
-
-# ALSA devices
-KERNEL=="controlC[0-9]*", NAME="snd/%k"
-KERNEL=="hwC[D0-9]*", NAME="snd/%k"
-KERNEL=="pcmC[D0-9cp]*", NAME="snd/%k"
-KERNEL=="midiC[D0-9]*", NAME="snd/%k"
-KERNEL=="timer", NAME="snd/%k"
-KERNEL=="seq", NAME="snd/%k"
-
-KERNEL=="snd", SUBSYSTEM=="module", ACTION=="add", \
- RUN+="/bin/ln -sf /proc/asound/oss/sndstat $root/sndstat"
-
-
-# ieee1394 devices
-KERNEL=="dv1394*", NAME="dv1394/%n"
-KERNEL=="video1394*", NAME="video1394/%n"
-
-# input devices
-KERNEL=="mice", NAME="input/%k"
-KERNEL=="mouse[0-9]*", NAME="input/%k"
-KERNEL=="event[0-9]*", NAME="input/%k"
-KERNEL=="js[0-9]*", NAME="input/%k"
-KERNEL=="ts[0-9]*", NAME="input/%k"
-
-# Zaptel
-KERNEL=="zapctl", NAME="zap/ctl"
-KERNEL=="zapchannel", NAME="zap/channel"
-KERNEL=="zappseudo", NAME="zap/pseudo"
-KERNEL=="zaptimer", NAME="zap/timer"
-KERNEL=="transcode", NAME="zap/transcode"
-KERNEL=="zap[0-9]*", NAME="zap/%n"
-
-# AOE character devices
-SUBSYSTEM=="aoe", NAME="etherd/%k"
-
-KERNEL=="device-mapper", NAME="mapper/control"
-
+++ /dev/null
-# This file contains the rules needed to create persistent device names.
-
-# we are only interested in add and change actions for block devices
-ACTION=="remove", GOTO="persistent_storage_tape_end"
-
-# "Medium Changers"
-SUBSYSTEM=="scsi_generic", SUBSYSTEMS=="scsi", ATTRS{type}=="8", \
- IMPORT{program}="scsi_id --export --sg-version=3 --whitelisted --device=$tempnode"
-
-KERNEL=="sg[0-9]*", ATTRS{type}=="8", ENV{ID_SERIAL}=="?*", \
- SYMLINK+="tape/by-id/scsi-$env{ID_SERIAL}"
-
-SUBSYSTEM!="scsi_tape", GOTO="persistent_storage_tape_end"
-
-KERNEL=="st*[0-9]|nst*[0-9]", ATTRS{ieee1394_id}=="?*", \
- ENV{ID_BUS}="ieee1394", ENV{ID_SERIAL}="$attr{ieee1394_id}"
-KERNEL=="st*[0-9]|nst*[0-9]", ENV{ID_SERIAL}!="?*", \
- SUBSYSTEMS=="usb", \
- IMPORT{program}="usb_id --export $devpath"
-
-KERNEL=="st*[0-9]|nst*[0-9]", ENV{ID_SERIAL}!="?*", \
- SUBSYSTEMS=="scsi", KERNELS=="[0-9]*:*[0-9]", \
- ENV{.BSG_DEV}="$root/bsg/$id"
-KERNEL=="st*[0-9]|nst*[0-9]", ENV{ID_SERIAL}!="?*", \
- WAIT_FOR="$env{.BSG_DEV}", \
- ENV{ID_BUS}="scsi", \
- IMPORT{program}="scsi_id --export --device=$env{.BSG_DEV}"
-
-KERNEL=="st*[0-9]|nst*[0-9]", ENV{ID_SERIAL}=="?*", \
- SYMLINK+="tape/by-id/$env{ID_BUS}-$env{ID_SERIAL}"
-
-KERNEL=="st*[0-9]|nst*[0-9]", \
- IMPORT{program}="path_id $devpath"
-KERNEL=="st*[0-9]", ENV{ID_PATH}=="?*", \
- SYMLINK+="tape/by-path/$env{ID_PATH}"
-KERNEL=="nst*[0-9]", ENV{ID_PATH}=="?*", \
- SYMLINK+="tape/by-path/$env{ID_PATH}-nst"
-
-# end of processing
-LABEL="persistent_storage_tape_end"
-
+++ /dev/null
-# This file contains the rules needed to create persistent device names.
-
-# forward scsi device events to the corresponding block device
-ACTION=="change", SUBSYSTEM=="scsi", ENV{DEVTYPE}=="scsi_device", \
- TEST=="block", ATTR{block/*/uevent}="change"
-
-# we are only interested in add and change actions for block devices
-ACTION=="remove", GOTO="persistent_storage_end"
-SUBSYSTEM!="block", GOTO="persistent_storage_end"
-
-# and we can safely ignore these kinds of devices
-KERNEL=="fd[0-9]*|mtd[0-9]*|mtdblock[0-9]*|nbd[0-9]*|gnbd[0-9]*|dm-[0-9]*|md[0-9]*|btibm[0-9]*", \
- GOTO="persistent_storage_end"
-
-# skip removable ide devices, because open(2) on them causes an events loop
-KERNEL=="hd*[!0-9]", ATTR{removable}=="1", \
- SUBSYSTEMS=="ide", ATTRS{media}=="disk|floppy", \
- GOTO="persistent_storage_end"
-KERNEL=="hd*[0-9]", ATTRS{removable}=="1", \
- GOTO="persistent_storage_end"
-
-# ignore partitions that span the entire disk
-TEST=="whole_disk", GOTO="persistent_storage_end"
-
-# workaround for kernels < 2.6.25-rc1
-ENV{DEVTYPE}!="?*", ATTR{range}=="?*", ENV{DEVTYPE}="disk"
-ENV{DEVTYPE}!="?*", ATTR{start}=="?*", ENV{DEVTYPE}="partition"
-
-# partitions do not have hardware identificators
-ENV{DEVTYPE}!="disk", GOTO="persistent_storage_not_a_disk"
-# nor do paravirtualized hard disks
-KERNEL=="vd*", GOTO="persistent_storage_not_a_disk"
-
-# look for different kinds of unique identificators
-KERNEL=="hd*", \
- IMPORT{program}="ata_id --export $tempnode"
-
-KERNEL=="mmcblk[0-9]", ATTRS{name}=="?*", ATTRS{serial}=="?*", \
- ENV{ID_BUS}="memstick", ENV{ID_SERIAL}="$attr{name}_$attr{serial}"
-KERNEL=="mspblk[0-9]", ATTRS{name}=="?*", ATTRS{serial}=="?*", \
- ENV{ID_BUS}="mmc", ENV{ID_SERIAL}="$attr{name}_$attr{serial}"
-
-KERNEL=="sd*|sr*", ATTRS{ieee1394_id}=="?*", \
- ENV{ID_BUS}="ieee1394", ENV{ID_SERIAL}="$attr{ieee1394_id}"
-
-KERNEL=="vd*", ATTRS{serial}=="?*", \
- ENV{ID_BUS}="virtio", ENV{ID_SERIAL}="$attr{serial}"
-
-# USB devices use their own serial number
-KERNEL=="sd*|sr*", ENV{ID_SERIAL}!="?*", \
- SUBSYSTEMS=="usb", \
- IMPORT{program}="usb_id --export $devpath"
-# ATA devices with their own "ata" kernel subsystem
-KERNEL=="sd*|sr*", ENV{ID_SERIAL}!="?*", \
- SUBSYSTEMS=="ata", \
- IMPORT{program}="ata_id --export $tempnode"
-# ATA devices using the "scsi" subsystem
-KERNEL=="sd*|sr*", ENV{ID_SERIAL}!="?*", \
- SUBSYSTEMS=="scsi", ATTRS{vendor}=="ATA", \
- IMPORT{program}="ata_id --export $tempnode"
-# scsi devices
-KERNEL=="sd*|sr*", ENV{ID_SERIAL}!="?*", \
- ENV{ID_BUS}="scsi", \
- IMPORT{program}="scsi_id --export --whitelisted --device=$tempnode"
-
-KERNEL=="cciss*", ENV{ID_SERIAL}!="?*", \
- ENV{ID_BUS}="cciss", \
- IMPORT{program}="scsi_id --export --whitelisted --device=$tempnode"
-
-KERNEL=="dasd*", \
- IMPORT{program}="dasd_id --export $tempnode"
-
-KERNEL=="sd*|hd*|cciss*", \
- IMPORT{program}="edd_id --export $tempnode"
-
-# scsi compat links for ATA devices
-KERNEL=="sd*", ENV{ID_BUS}=="ata", \
- PROGRAM="scsi_id --whitelisted --replace-whitespace -p0x80 -d$tempnode", \
- RESULT=="?*", ENV{ID_SCSI_COMPAT}="$result"
-
-# find the physical path of the device
-ENV{ID_PATH}=="", DEVPATH!="*/virtual/*", \
- IMPORT{program}="path_id $devpath"
-
-LABEL="persistent_storage_not_a_disk"
-
-# import the variables of partitions from the parent disks
-ENV{DEVTYPE}=="partition", IMPORT{parent}="ID_*"
-
-# by-id (hardware serial number)
-KERNEL=="hd*[!0-9]", ENV{ID_SERIAL}=="?*", \
- SYMLINK+="disk/by-id/ata-$env{ID_SERIAL}"
-KERNEL=="hd*[0-9]", ENV{ID_SERIAL}=="?*", \
- SYMLINK+="disk/by-id/ata-$env{ID_SERIAL}-part%n"
-
-KERNEL=="sd*[!0-9]", ENV{ID_SCSI_COMPAT}=="?*", \
- SYMLINK+="disk/by-id/scsi-$env{ID_SCSI_COMPAT}"
-KERNEL=="sd*[0-9]", ENV{ID_SCSI_COMPAT}=="?*", \
- SYMLINK+="disk/by-id/scsi-$env{ID_SCSI_COMPAT}-part%n"
-
-ENV{DEVTYPE}=="disk", ENV{ID_BUS}=="?*", ENV{ID_SERIAL}=="?*", \
- SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}"
-ENV{DEVTYPE}=="partition", ENV{ID_BUS}=="?*", ENV{ID_SERIAL}=="?*", \
- SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}-part%n"
-
-ENV{DEVTYPE}=="disk", ENV{ID_EDD}=="?*", \
- SYMLINK+="disk/by-id/edd-$env{ID_EDD}"
-ENV{DEVTYPE}=="partition", ENV{ID_EDD}=="?*", \
- SYMLINK+="disk/by-id/edd-$env{ID_EDD}-part%n"
-
-ENV{DEVTYPE}=="disk", ENV{ID_WWN}=="?*", \
- SYMLINK+="disk/by-id/wwn-$env{ID_WWN}"
-ENV{DEVTYPE}=="partition", ENV{ID_WWN}=="?*", \
- SYMLINK+="disk/by-id/wwn-$env{ID_WWN}-part%n"
-
-# by-path (parent device path)
-ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="?*", \
- SYMLINK+="disk/by-path/$env{ID_PATH}"
-ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="?*", \
- SYMLINK+="disk/by-path/$env{ID_PATH}-part%n"
-
-# skip unpartitioned removable media devices from drivers which do not send
-# "change" events
-ENV{DEVTYPE}=="disk", KERNEL!="sd*|sr*", ATTR{removable}=="1", \
- GOTO="persistent_storage_end"
-
-# probe filesystem metadata of optical drives which have a media inserted
-KERNEL=="sr*", ENV{ID_CDROM_MEDIA_TRACK_COUNT_DATA}=="?*", \
- ENV{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}=="?*", \
- IMPORT{program}="/sbin/blkid -o udev -p -u noraid -O $env{ID_CDROM_MEDIA_SESSION_LAST_OFFSET} $tempnode"
-# single-session CDs do not have ID_CDROM_MEDIA_SESSION_LAST_OFFSET
-KERNEL=="sr*", ENV{ID_CDROM_MEDIA_TRACK_COUNT_DATA}=="?*", \
- ENV{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}=="", \
- IMPORT{program}="/sbin/blkid -o udev -p -u noraid $tempnode"
-
-# probe filesystem metadata of disks
-KERNEL!="sr*", IMPORT{program}="/sbin/blkid -o udev -p $tempnode"
-
-# watch for future changes
-KERNEL!="sr*", OPTIONS+="watch"
-
-# by-label/by-uuid links (filesystem metadata)
-ENV{ID_FS_UUID_ENC}=="?*", ENV{ID_FS_USAGE}=="filesystem|other|crypto", \
- SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}"
-ENV{ID_FS_LABEL_ENC}=="?*", ENV{ID_FS_USAGE}=="filesystem|other", \
- SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}"
-
-LABEL="persistent_storage_end"
-
+++ /dev/null
-# These rules generate rules for the /dev/{cdrom,dvd,...} symlinks and
-# write them to /etc/udev/rules.d/70-persistent-cd.rules.
-
-ACTION=="add", SUBSYSTEM=="block", ENV{GENERATED}!="?*", ENV{ID_CDROM}=="?*", \
- SUBSYSTEMS!="usb|ieee1394", \
- PROGRAM="write_cd_rules", SYMLINK+="$result"
-
-ACTION=="add", SUBSYSTEM=="block", ENV{GENERATED}!="?*", ENV{ID_CDROM}=="?*", \
- SUBSYSTEMS=="usb|ieee1394", \
- PROGRAM="write_cd_rules by-id", SYMLINK+="$result"
-
+++ /dev/null
-# These rules generate rules to keep network interface names unchanged
-# across reboots and write them to /etc/udev/rules.d/70-persistent-net.rules.
-
-# variables used to communicate:
-# MATCHADDR MAC address used for the match
-# MATCHID bus_id used for the match
-# MATCHDRV driver name used for the match
-# MATCHIFTYPE interface type match
-# COMMENT comment to add to the generated rule
-# INTERFACE_NAME requested name supplied by external tool
-# INTERFACE_NEW new interface name returned by rule writer
-
-ACTION!="add", GOTO="persistent_net_generator_end"
-SUBSYSTEM!="net", GOTO="persistent_net_generator_end"
-
-# ignore the interface if a name has already been set
-NAME=="?*", GOTO="persistent_net_generator_end"
-
-# device name whitelist
-KERNEL!="eth*|ath*|wlan*[0-9]|msh*|ra*|sta*|ctc*|lcs*|hsi*", \
- GOTO="persistent_net_generator_end"
-
-# ignore Xen virtual interfaces
-SUBSYSTEMS=="xen", GOTO="persistent_net_generator_end"
-
-# ignore UML virtual interfaces
-DRIVERS=="uml-netdev", GOTO="persistent_net_generator_end"
-
-# ignore "secondary" raw interfaces of the madwifi driver
-KERNEL=="ath*", ATTRS{type}=="802", GOTO="persistent_net_generator_end"
-
-# ignore "secondary" monitor interfaces of mac80211 drivers
-KERNEL=="wlan*", ATTRS{type}=="803", GOTO="persistent_net_generator_end"
-
-# by default match on the MAC address and interface type
-ENV{MATCHADDR}="$attr{address}"
-ENV{MATCHIFTYPE}="$attr{type}"
-
-# match interface dev_id
-ATTR{dev_id}=="?*", ENV{MATCHDEVID}="$attr{dev_id}"
-
-# These vendors are known to violate the local MAC address assignment scheme
-# Interlan, DEC (UNIBUS or QBUS), Apollo, Cisco, Racal-Datacom
-ENV{MATCHADDR}=="02:07:01:*", GOTO="globally_administered_whitelist"
-# 3Com
-ENV{MATCHADDR}=="02:60:60:*", GOTO="globally_administered_whitelist"
-# 3Com IBM PC; Imagen; Valid; Cisco; Apple
-ENV{MATCHADDR}=="02:60:8c:*", GOTO="globally_administered_whitelist"
-# Intel
-ENV{MATCHADDR}=="02:a0:c9:*", GOTO="globally_administered_whitelist"
-# Olivetti
-ENV{MATCHADDR}=="02:aa:3c:*", GOTO="globally_administered_whitelist"
-# CMC Masscomp; Silicon Graphics; Prime EXL
-ENV{MATCHADDR}=="02:cf:1f:*", GOTO="globally_administered_whitelist"
-# Prominet Corporation Gigabit Ethernet Switch
-ENV{MATCHADDR}=="02:e0:3b:*", GOTO="globally_administered_whitelist"
-# BTI (Bus-Tech, Inc.) IBM Mainframes
-ENV{MATCHADDR}=="02:e6:d3:*", GOTO="globally_administered_whitelist"
-# Realtek
-ENV{MATCHADDR}=="52:54:00:*", GOTO="globally_administered_whitelist"
-# Novell 2000
-ENV{MATCHADDR}=="52:54:4c:*", GOTO="globally_administered_whitelist"
-# Realtec
-ENV{MATCHADDR}=="52:54:ab:*", GOTO="globally_administered_whitelist"
-# Kingston Technologies
-ENV{MATCHADDR}=="e2:0c:0f:*", GOTO="globally_administered_whitelist"
-
-# ignore interfaces with locally administered or null MAC addresses
-# and KVM and VMWare virtual interfaces
-ENV{MATCHADDR}=="?[2367abef]:*", ENV{MATCHADDR}=""
-ENV{MATCHADDR}=="00:00:00:00:00:00", ENV{MATCHADDR}=""
-ENV{MATCHADDR}=="00:0c:29:*|00:50:56:*", ENV{MATCHADDR}=""
-ENV{MATCHADDR}=="52:54:00:*|54:52:00:*", ENV{MATCHADDR}=""
-
-LABEL="globally_administered_whitelist"
-
-# ibmveth interfaces have stable locally administered MAC addresses
-SUBSYSTEMS=="ibmveth", ENV{MATCHADDR}="$attr{address}"
-
-# S/390 interfaces are matched only by id
-#SUBSYSTEMS=="ccwgroup", \
-# ENV{MATCHDRV}="$driver", ENV{MATCHID}="$id", ENV{MATCHADDR}=""
-
-# terminate processing if there are not enough conditions to create a rule
-ENV{MATCHADDR}=="", ENV{MATCHID}=="", ENV{INTERFACE_NAME}=="", \
- GOTO="persistent_net_generator_end"
-
-
-# provide nice comments for the generated rules
-SUBSYSTEMS=="pci", \
- ENV{COMMENT}="PCI device $attr{vendor}:$attr{device}"
-SUBSYSTEMS=="pcmcia", \
- ENV{COMMENT}="PCMCIA device $attr{card_id}:$attr{manf_id}"
-SUBSYSTEMS=="usb", \
- ENV{COMMENT}="USB device 0x$attr{idVendor}:0x$attr{idProduct}"
-SUBSYSTEMS=="ccwgroup", \
- ENV{COMMENT}="S/390 device at $id"
-SUBSYSTEMS=="ibmveth", \
- ENV{COMMENT}="LPAR virtual device at $id"
-SUBSYSTEMS=="ieee1394", \
- ENV{COMMENT}="Firewire device $attr{host_id}"
-ENV{COMMENT}=="", \
- ENV{COMMENT}="Unknown $env{SUBSYSTEM} device ($env{DEVPATH})"
-ATTRS{driver}=="?*", \
- ENV{COMMENT}="$env{COMMENT} ($attr{driver})"
-
-
-# ignore interfaces without a driver link like bridges and VLANs, otherwise
-# generate and write the rule
-DRIVERS=="?*", IMPORT{program}="write_net_rules"
-
-# rename the interface if requested
-ENV{INTERFACE_NEW}=="?*", NAME="$env{INTERFACE_NEW}"
-
-LABEL="persistent_net_generator_end"
-
+++ /dev/null
-ACTION=="remove", GOTO="drivers_end"
-
-# check if the device has already been claimed by a driver
-ENV{DRIVER}=="?*", SUBSYSTEM!="input", GOTO="hotplug_driver_loaded"
-
-# load the drivers
-ENV{MODALIAS}=="?*", RUN+="/sbin/modprobe -b $env{MODALIAS}"
-
-# workaround for kernels < 2.6.27-rc5
-SUBSYSTEM=="pnp", ENV{MODALIAS}!="?*", \
- RUN+="/bin/sh -c '/sbin/modprobe --use-blacklist --all $$(while read id; do echo pnp:d$$id; done < /sys$devpath/id)'"
-
-SUBSYSTEM=="pcmcia_socket", RUN+="/sbin/modprobe -b pcmcia"
-
-# rules for subsystems which lack proper hotplug support
-SUBSYSTEM=="i2o", RUN+="/sbin/modprobe -b i2o_block"
-# workaround for kernels < 2.6.30
-SUBSYSTEM=="mmc", RUN+="/sbin/modprobe -b mmc_block"
-SUBSYSTEM=="memstick", RUN+="/sbin/modprobe -b --all ms_block mspro_block"
-SUBSYSTEM=="tifm", ENV{TIFM_CARD_TYPE}=="SD", \
- RUN+="/sbin/modprobe -b tifm_sd"
-SUBSYSTEM=="tifm", ENV{TIFM_CARD_TYPE}=="MS", \
- RUN+="/sbin/modprobe -b tifm_ms"
-
-SUBSYSTEM=="scsi_device", ATTRS{type}=="[235689]", TEST!="[module/sg]", \
- RUN+="/sbin/modprobe -b sg"
-
-SUBSYSTEM=="ide", ATTR{media}=="tape", RUN+="/sbin/modprobe -b ide-scsi"
-
-# Load VIO modules based on the device type
-SUBSYSTEM!="vio", GOTO="hotplug_vio_end"
-ENV{MODALIAS}=="?*", GOTO="hotplug_vio_end"
-ENV{VIO_TYPE}!="?*", IMPORT{program}="vio_type --export $devpath"
-ENV{VIO_TYPE}=="serial", RUN+="/sbin/modprobe -b hvc_console"
-ENV{VIO_TYPE}=="serial-server", RUN+="/sbin/modprobe -b hvcs"
-ENV{VIO_TYPE}=="network", RUN+="/sbin/modprobe -b ibmveth"
-ENV{VIO_TYPE}=="vscsi", RUN+="/sbin/modprobe -b ibmvscsic"
-ENV{VIO_TYPE}=="vlan", RUN+="/sbin/modprobe -b iseries_veth"
-ENV{VIO_TYPE}=="viodasd", RUN+="/sbin/modprobe -b viodasd"
-ENV{VIO_TYPE}=="viocd", RUN+="/sbin/modprobe -b viocd"
-ENV{VIO_TYPE}=="vnet", RUN+="/sbin/modprobe -b sunvnet"
-ENV{VIO_TYPE}=="vdisk", RUN+="/sbin/modprobe -b sunvdc"
-LABEL="hotplug_vio_end"
-
-# From here on follows the hotplug agents which do not load modules
-LABEL="hotplug_driver_loaded"
-
-SUBSYSTEM=="firmware", RUN+="firmware.agent"
-
-LABEL="drivers_end"
-
-SUBSYSTEM=="net", RUN+="net.agent"
-
-SUBSYSTEM=="atm", RUN+="dsl-modem.agent"
-
-# Log every event to /dev/hotplug.log (for debugging).
-#SUBSYSTEM!="uids", RUN+="logger.agent"
-
+++ /dev/null
-ACTION=="remove", GOTO="permissions_end"
-
-# default permissions for block devices
-SUBSYSTEM=="block", GROUP="disk"
-SUBSYSTEM=="block", ATTRS{removable}=="1", GROUP="floppy"
-# the aacraid driver is broken and reports the disks as removable (see #404927)
-SUBSYSTEM=="block", DRIVERS=="aacraid", GROUP="disk"
-# all block devices on these buses are "removable"
-SUBSYSTEM=="block", SUBSYSTEMS=="usb|ieee1394|mmc|pcmcia", GROUP="floppy"
-
-KERNEL=="cbm", GROUP="floppy"
-
-# IDE devices
-ENV{ID_CDROM}=="?*", GROUP="cdrom"
-KERNEL=="ht[0-9]*", GROUP="tape"
-KERNEL=="nht[0-9]*", GROUP="tape"
-
-# SCSI devices
-SUBSYSTEM=="scsi_generic|scsi_tape", \
-SUBSYSTEMS=="scsi", ATTRS{type}=="1|8", GROUP="tape"
-SUBSYSTEM=="scsi_generic", \
-SUBSYSTEMS=="scsi", ATTRS{type}=="4|5", GROUP="cdrom"
-
-# USB devices
-KERNEL=="legousbtower*", MODE="0666"
-KERNEL=="lp[0-9]*", SUBSYSTEMS=="usb", GROUP="lp"
-# hplip and cups 1.4+ use raw USB devices, so permissions should be similar to
-# the ones from the old usblp kernel module
-SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", \
- ENV{ID_USB_INTERFACES}=="", IMPORT{program}="usb_id --export %p"
-SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", \
- ENV{ID_USB_INTERFACES}=="*:0701*:", GROUP="lp"
-
-# usbfs-like devices
-SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", \
- MODE="0664"
-
-# serial devices
-SUBSYSTEM=="tty", GROUP="dialout"
-SUBSYSTEM=="capi", GROUP="dialout"
-SUBSYSTEM=="slamr", GROUP="dialout"
-SUBSYSTEM=="zaptel", GROUP="dialout"
-KERNEL=="mISDNtimer", GROUP="dialout"
-KERNEL=="mwave", GROUP="dialout"
-KERNEL=="hvc*|hvsi*", GROUP="dialout"
-
-# vc devices (all members of the tty subsystem)
-KERNEL=="ptmx", MODE="0666", GROUP="root"
-KERNEL=="console", MODE="0600", GROUP="root"
-KERNEL=="tty", MODE="0666", GROUP="root"
-KERNEL=="tty[0-9]*", GROUP="root"
-KERNEL=="pty*", MODE="0666", GROUP="tty"
-
-# video devices
-SUBSYSTEM=="video4linux", GROUP="video"
-SUBSYSTEM=="drm", GROUP="video"
-SUBSYSTEM=="dvb", GROUP="video"
-SUBSYSTEM=="em8300", GROUP="video"
-SUBSYSTEM=="graphics", GROUP="video"
-SUBSYSTEM=="nvidia", GROUP="video"
-
-# misc devices
-KERNEL=="random", MODE="0666"
-KERNEL=="urandom", MODE="0666"
-KERNEL=="mem", MODE="0640", GROUP="kmem"
-KERNEL=="kmem", MODE="0640", GROUP="kmem"
-KERNEL=="port", MODE="0640", GROUP="kmem"
-KERNEL=="nvram", MODE="0640", GROUP="kmem"
-KERNEL=="full", MODE="0666"
-KERNEL=="null", MODE="0666"
-KERNEL=="zero", MODE="0666"
-KERNEL=="inotify", MODE="0666"
-KERNEL=="sonypi", MODE="0666"
-KERNEL=="cpu[0-9]*", MODE="0444"
-KERNEL=="agpgart", GROUP="video"
-KERNEL=="pmu", GROUP="video"
-KERNEL=="kqemu", MODE="0666"
-KERNEL=="tun", MODE="0666", OPTIONS+="static_node=net/tun"
-KERNEL=="rfkill", MODE="0644"
-
-KERNEL=="cdemu[0-9]*", GROUP="cdrom"
-KERNEL=="pktcdvd[0-9]*", GROUP="cdrom"
-KERNEL=="pktcdvd", MODE="0644"
-
-# printers and parallel devices
-SUBSYSTEM=="printer", GROUP="lp"
-SUBSYSTEM=="ppdev", GROUP="lp"
-KERNEL=="irlpt[0-9]*", GROUP="lp"
-KERNEL=="pt[0-9]*", GROUP="tape"
-KERNEL=="pht[0-9]*", GROUP="tape"
-
-# sound devices
-SUBSYSTEM=="sound", GROUP="audio"
-
-# ieee1394 devices
-SUBSYSTEM=="firewire", ATTR{units}=="*0x00a02d:0x00010*", GROUP="video"
-SUBSYSTEM=="firewire", ATTR{units}=="*0x00b09d:0x00010*", GROUP="video"
-SUBSYSTEM=="firewire", ATTR{units}=="*0x00a02d:0x010001*", GROUP="video"
-SUBSYSTEM=="firewire", ATTR{units}=="*0x00a02d:0x014001*", GROUP="video"
-KERNEL=="raw1394", GROUP="disk"
-KERNEL=="dv1394-[0-9]*", GROUP="video"
-KERNEL=="video1394-[0-9]*", GROUP="video"
-
-# input devices
-KERNEL=="event[0-9]*", ATTRS{name}=="*dvb*|*DVB*|* IR *", \
- MODE="0664", GROUP="video"
-KERNEL=="js[0-9]*", MODE="0664"
-KERNEL=="event[0-9]*", ENV{ID_CLASS}=="joystick", \
- MODE="0664", GROUP="audio"
-KERNEL=="lirc[0-9]*", GROUP="video"
-
-KERNEL=="sgi_*", MODE="0666"
-KERNEL=="z90crypt", MODE="0666"
-KERNEL=="iseries/ibmsis*", GROUP="disk"
-KERNEL=="iseries/nvt*", GROUP="disk"
-KERNEL=="iseries/vt*", GROUP="disk"
-KERNEL=="iseries/vtty*", GROUP="dialout"
-
-# AOE character devices
-SUBSYSTEM=="aoe", MODE="0220", GROUP="disk"
-SUBSYSTEM=="aoe", KERNEL=="err", MODE="0440", GROUP="disk"
-
-LABEL="permissions_end"
-
# do not edit this file, it will be overwritten on update
# Rules to support older kernels, which migth miss functionality needed
-# for the recent udev version.
+# for the recent udev rules.
#
# This file is used and maintained by Gentoo.
-ACTION=="remove", GOTO="kernel_compat_end"
-
-#
-# sysfs timing rules
-#
-
-# needed for kernels <2.6.30
-SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", WAIT_FOR="descriptors"
-
-#
-# naming device rules
-#
-
-# dvb device naming
-# needed for kernels <2.6.29-rc1
-SUBSYSTEM=="dvb", ENV{DVB_ADAPTER_NUM}=="", PROGRAM="/bin/sh -c 'K=%k; K=$${K#dvb}; printf dvb/adapter%%i/%%s $${K%%%%.*} $${K#*.}'", NAME="%c", GROUP="video"
-
-# naming rules for kernels <2.6.31
-
-# alsa names
-KERNEL=="controlC[0-9]*", NAME="snd/%k"
-KERNEL=="hwC[D0-9]*", NAME="snd/%k"
-KERNEL=="pcmC[D0-9cp]*", NAME="snd/%k"
-KERNEL=="midiC[D0-9]*", NAME="snd/%k"
-KERNEL=="timer", NAME="snd/%k"
-KERNEL=="seq", NAME="snd/%k"
-
-KERNEL=="mwave", NAME="modems/mwave"
-
-KERNEL=="mouse*|mice|event*", NAME="input/%k"
-KERNEL=="ts[0-9]*|uinput", NAME="input/%k"
-KERNEL=="js[0-9]*", NAME="input/%k"
-
-KERNEL=="card[0-9]*", NAME="dri/%k"
-
-SUBSYSTEM=="dvb", ENV{DVB_ADAPTER_NUM}=="?*", NAME="dvb/adapter$env{DVB_ADAPTER_NUM}/$env{DVB_DEVICE_TYPE}$env{DVB_DEVICE_NUM}"
-
-# libusb device nodes
-SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", NAME="bus/usb/$env{BUSNUM}/$env{DEVNUM}"
-
-# printer
-SUBSYSTEM=="usb", KERNEL=="lp*", NAME="usb/%k"
-
-# block
-KERNEL=="pktcdvd[0-9]*", NAME="pktcdvd/%k"
-KERNEL=="pktcdvd", NAME="pktcdvd/control"
-
-KERNEL=="rawctl", NAME="raw/rawctl"
-SUBSYSTEM=="raw", KERNEL=="raw[0-9]*", NAME="raw/%k"
-SUBSYSTEM=="bsg", NAME="bsg/%k"
-SUBSYSTEM=="aoe", NAME="etherd/%k"
-
-# network
-KERNEL=="tun", NAME="net/%k"
-
-# CPU
-KERNEL=="cpu[0-9]*", NAME="cpu/%n/cpuid"
-KERNEL=="msr[0-9]*", NAME="cpu/%n/msr"
-KERNEL=="microcode", NAME="cpu/microcode", MODE="0600"
-
-# miscellaneous
-KERNEL=="auer[0-9]*", NAME="usb/%k"
-KERNEL=="hw_random", NAME="hwrng"
-KERNEL=="sxctl", NAME="specialix_sxctl"
-KERNEL=="rioctl", NAME="specialix_rioctl"
-KERNEL=="iowarrior[0-9]*", NAME="usb/%k"
-KERNEL=="hiddev[0-9]*", NAME="usb/%k"
-KERNEL=="legousbtower[0-9]*", NAME="usb/%k"
-KERNEL=="dabusb[0-9]*", NAME="usb/%k"
-KERNEL=="usbdpfp[0-9]*", NAME="usb/%k"
-KERNEL=="cpad[0-9]*", NAME="usb/%k"
-
-# end of naming rules for kernel <2.6.31
-
-
-#
-# module loading rules
-#
ACTION!="add", GOTO="kernel_compat_end"
-# No need for more code, as MODALIAS is present
-ENV{MODALIAS}=="?*", GOTO="kernel_compat_end"
-
-# needed for kernel <2.6.30-rc1
-SUBSYSTEM=="scsi", ATTR{type}=="8", RUN+="/sbin/modprobe -b ch"
-SUBSYSTEM=="mmc", RUN+="/sbin/modprobe -b mmc_block"
-
-# needed for kernel <2.6.27-rc5
-# acpi will do on newer kernels
-SUBSYSTEM=="pnp", DRIVER!="?*", \
- RUN{ignore_error}+="/bin/sh -c '/sbin/modprobe -a $$(while read id; do echo pnp:d$$id; done < /sys$devpath/id)'"
-
# see extras/qemu/42-qemu-usb.rules, version for 2.6.32 + older.
ACTION=="add", SUBSYSTEM=="usb", ATTR{product}=="QEMU USB Mouse", ATTR{serial}=="42", TEST=="power/level", ATTR{power/level}="auto"
ACTION=="add", SUBSYSTEM=="usb", ATTR{product}=="QEMU USB Tablet", ATTR{serial}=="42", TEST=="power/level", ATTR{power/level}="auto"
KERNEL=="mem|kmem|port|nvram", GROUP="kmem", MODE="0640"
# input
+SUBSYSTEM=="input", ENV{ID_INPUT}=="", IMPORT{builtin}="input_id"
KERNEL=="mouse*|mice|event*", MODE="0640"
KERNEL=="ts[0-9]*|uinput", MODE="0640"
KERNEL=="js[0-9]*", MODE="0644"
SUBSYSTEM=="drm", GROUP="video"
# sound
-SUBSYSTEM=="sound", GROUP="audio"
+SUBSYSTEM=="sound", GROUP="audio", \
+ OPTIONS+="static_node=snd/seq", OPTIONS+="static_node=snd/timer"
# DVB (video)
SUBSYSTEM=="dvb", GROUP="video"
SUBSYSTEM=="firewire", ATTR{units}=="*0x00a02d:0x010001*", GROUP="video"
SUBSYSTEM=="firewire", ATTR{units}=="*0x00a02d:0x014001*", GROUP="video"
-# libusb device nodes
+# 'libusb' device nodes
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", MODE="0664"
+SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", IMPORT{builtin}="usb_id"
# printer
KERNEL=="parport[0-9]*", GROUP="lp"
SUBSYSTEM=="printer", KERNEL=="lp*", GROUP="lp"
SUBSYSTEM=="ppdev", GROUP="lp"
-SUBSYSTEM=="usb", KERNEL=="lp*", SYMLINK+="usb%k", GROUP="lp"
KERNEL=="lp[0-9]*", GROUP="lp"
KERNEL=="irlpt[0-9]*", GROUP="lp"
-# hplip and cups 1.4+ use raw USB devices, so permissions should be similar to
-# the ones from the old usblp kernel module
-SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ENV{ID_USB_INTERFACES}=="", IMPORT{program}="usb_id --export %p"
-SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ENV{ID_USB_INTERFACES}=="*:0701*:", GROUP="lp", MODE="0664"
+SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ENV{ID_USB_INTERFACES}=="*:0701??:*", GROUP="lp"
# block
SUBSYSTEM=="block", GROUP="disk"
SUBSYSTEM=="block", KERNEL=="fd[0-9]", GROUP="floppy"
# cdrom
-SUBSYSTEM=="block", KERNEL=="sr[0-9]*", SYMLINK+="scd%n", GROUP="cdrom"
SUBSYSTEM=="scsi_generic", SUBSYSTEMS=="scsi", ATTRS{type}=="4|5", GROUP="cdrom"
KERNEL=="pktcdvd[0-9]*", GROUP="cdrom"
KERNEL=="pktcdvd", GROUP="cdrom"
# CPU
KERNEL=="cpu[0-9]*", MODE="0444"
-KERNEL=="fuse", MODE="0666", OPTIONS+="static_node=fuse", \
- RUN+="/bin/mount -t fusectl fusectl /sys/fs/fuse/connections"
+KERNEL=="fuse", ACTION=="add", MODE="0666", OPTIONS+="static_node=fuse"
SUBSYSTEM=="rtc", DRIVERS=="rtc_cmos", SYMLINK+="rtc"
KERNEL=="mmtimer", MODE="0644"
SUBSYSTEM!="sound", GOTO="persistent_alsa_end"
KERNEL!="controlC[0-9]*", GOTO="persistent_alsa_end"
-SUBSYSTEMS=="usb", ENV{ID_MODEL}=="", IMPORT{program}="usb_id --export %p"
-SUBSYSTEMS=="usb", ENV{ID_IFACE}="$attr{bInterfaceNumber}"
-ENV{ID_SERIAL}=="?*", ENV{ID_IFACE}=="?*", SYMLINK+="snd/by-id/$env{ID_BUS}-$env{ID_SERIAL}-$env{ID_IFACE}"
-ENV{ID_SERIAL}=="?*", ENV{ID_IFACE}=="", SYMLINK+="snd/by-id/$env{ID_BUS}-$env{ID_SERIAL}"
+SUBSYSTEMS=="usb", ENV{ID_MODEL}=="", IMPORT{builtin}="usb_id"
+ENV{ID_SERIAL}=="?*", ENV{ID_USB_INTERFACE_NUM}=="?*", SYMLINK+="snd/by-id/$env{ID_BUS}-$env{ID_SERIAL}-$env{ID_USB_INTERFACE_NUM}"
+ENV{ID_SERIAL}=="?*", ENV{ID_USB_INTERFACE_NUM}=="", SYMLINK+="snd/by-id/$env{ID_BUS}-$env{ID_SERIAL}"
-ENV{ID_PATH}=="", IMPORT{program}="path_id %p"
+IMPORT{builtin}="path_id"
ENV{ID_PATH}=="?*", SYMLINK+="snd/by-path/$env{ID_PATH}"
LABEL="persistent_alsa_end"
ACTION=="remove", GOTO="persistent_input_end"
SUBSYSTEM!="input", GOTO="persistent_input_end"
-KERNEL=="input[0-9]*", GOTO="persistent_input_end"
+SUBSYSTEMS=="bluetooth", GOTO="persistent_input_end"
-ENV{ID_INPUT}=="", IMPORT{program}="input_id %p"
-SUBSYSTEMS=="usb", ENV{ID_BUS}=="", IMPORT{program}="usb_id --export %p"
+SUBSYSTEMS=="usb", ENV{ID_BUS}=="", IMPORT{builtin}="usb_id"
# determine class name for persistent symlinks
ENV{ID_INPUT_KEYBOARD}=="?*", ENV{.INPUT_CLASS}="kbd"
# by-id links
KERNEL=="mouse*|js*", ENV{ID_BUS}=="?*", ENV{.INPUT_CLASS}=="?*", SYMLINK+="input/by-id/$env{ID_BUS}-$env{ID_SERIAL}-$env{.INPUT_CLASS}"
+KERNEL=="mouse*|js*", ENV{ID_BUS}=="?*", ENV{.INPUT_CLASS}=="?*", ATTRS{bInterfaceNumber}=="?*", ATTRS{bInterfaceNumber}!="00", SYMLINK+="input/by-id/$env{ID_BUS}-$env{ID_SERIAL}-if$attr{bInterfaceNumber}-$env{.INPUT_CLASS}"
KERNEL=="event*", ENV{ID_BUS}=="?*", ENV{.INPUT_CLASS}=="?*", SYMLINK+="input/by-id/$env{ID_BUS}-$env{ID_SERIAL}-event-$env{.INPUT_CLASS}"
+KERNEL=="event*", ENV{ID_BUS}=="?*", ENV{.INPUT_CLASS}=="?*", ATTRS{bInterfaceNumber}=="?*", ATTRS{bInterfaceNumber}!="00", SYMLINK+="input/by-id/$env{ID_BUS}-$env{ID_SERIAL}-if$attr{bInterfaceNumber}-event-$env{.INPUT_CLASS}"
# allow empty class for USB devices, by appending the interface number
SUBSYSTEMS=="usb", ENV{ID_BUS}=="?*", KERNEL=="event*", ENV{.INPUT_CLASS}=="", ATTRS{bInterfaceNumber}=="?*", \
SYMLINK+="input/by-id/$env{ID_BUS}-$env{ID_SERIAL}-event-if$attr{bInterfaceNumber}"
# by-path
-SUBSYSTEMS=="pci|usb|platform", IMPORT{program}="path_id %p"
+SUBSYSTEMS=="pci|usb|platform|acpi", IMPORT{builtin}="path_id"
ENV{ID_PATH}=="?*", KERNEL=="mouse*|js*", ENV{.INPUT_CLASS}=="?*", SYMLINK+="input/by-path/$env{ID_PATH}-$env{.INPUT_CLASS}"
ENV{ID_PATH}=="?*", KERNEL=="event*", ENV{.INPUT_CLASS}=="?*", SYMLINK+="input/by-path/$env{ID_PATH}-event-$env{.INPUT_CLASS}"
# allow empty class for platform and usb devices; platform supports only a single interface that way
SUBSYSTEM!="tty", GOTO="persistent_serial_end"
KERNEL!="ttyUSB[0-9]*|ttyACM[0-9]*", GOTO="persistent_serial_end"
-SUBSYSTEMS=="usb-serial", ENV{ID_PORT}="$attr{port_number}"
+SUBSYSTEMS=="usb-serial", ENV{.ID_PORT}="$attr{port_number}"
-IMPORT="path_id %p"
-ENV{ID_PATH}=="?*", ENV{ID_PORT}=="", SYMLINK+="serial/by-path/$env{ID_PATH}"
-ENV{ID_PATH}=="?*", ENV{ID_PORT}=="?*", SYMLINK+="serial/by-path/$env{ID_PATH}-port$env{ID_PORT}"
+IMPORT{builtin}="path_id"
+ENV{ID_PATH}=="?*", ENV{.ID_PORT}=="", SYMLINK+="serial/by-path/$env{ID_PATH}"
+ENV{ID_PATH}=="?*", ENV{.ID_PORT}=="?*", SYMLINK+="serial/by-path/$env{ID_PATH}-port$env{.ID_PORT}"
-IMPORT="usb_id --export %p"
+IMPORT{builtin}="usb_id"
ENV{ID_SERIAL}=="", GOTO="persistent_serial_end"
-SUBSYSTEMS=="usb", ENV{ID_IFACE}="$attr{bInterfaceNumber}"
-ENV{ID_IFACE}=="", GOTO="persistent_serial_end"
-ENV{ID_PORT}=="", SYMLINK+="serial/by-id/$env{ID_BUS}-$env{ID_SERIAL}-if$env{ID_IFACE}"
-ENV{ID_PORT}=="?*", SYMLINK+="serial/by-id/$env{ID_BUS}-$env{ID_SERIAL}-if$env{ID_IFACE}-port$env{ID_PORT}"
+SUBSYSTEMS=="usb", ENV{ID_USB_INTERFACE_NUM}="$attr{bInterfaceNumber}"
+ENV{ID_USB_INTERFACE_NUM}=="", GOTO="persistent_serial_end"
+ENV{.ID_PORT}=="", SYMLINK+="serial/by-id/$env{ID_BUS}-$env{ID_SERIAL}-if$env{ID_USB_INTERFACE_NUM}"
+ENV{.ID_PORT}=="?*", SYMLINK+="serial/by-id/$env{ID_BUS}-$env{ID_SERIAL}-if$env{ID_USB_INTERFACE_NUM}-port$env{.ID_PORT}"
LABEL="persistent_serial_end"
ACTION=="remove", GOTO="persistent_storage_tape_end"
# type 8 devices are "Medium Changers"
-SUBSYSTEM=="scsi_generic", SUBSYSTEMS=="scsi", ATTRS{type}=="8", IMPORT{program}="scsi_id --sg-version=3 --export --whitelisted -d $tempnode", SYMLINK+="tape/by-id/scsi-$env{ID_SERIAL}"
+SUBSYSTEM=="scsi_generic", SUBSYSTEMS=="scsi", ATTRS{type}=="8", IMPORT{program}="scsi_id --sg-version=3 --export --whitelisted -d $tempnode", \
+ SYMLINK+="tape/by-id/scsi-$env{ID_SERIAL}"
SUBSYSTEM!="scsi_tape", GOTO="persistent_storage_tape_end"
KERNEL=="st*[0-9]|nst*[0-9]", ATTRS{ieee1394_id}=="?*", ENV{ID_SERIAL}="$attr{ieee1394_id}", ENV{ID_BUS}="ieee1394"
-KERNEL=="st*[0-9]|nst*[0-9]", ENV{ID_SERIAL}!="?*", SUBSYSTEMS=="usb", IMPORT{program}="usb_id --export %p"
+KERNEL=="st*[0-9]|nst*[0-9]", ENV{ID_SERIAL}!="?*", SUBSYSTEMS=="usb", IMPORT{builtin}="usb_id"
KERNEL=="st*[0-9]|nst*[0-9]", ENV{ID_SERIAL}!="?*", SUBSYSTEMS=="scsi", KERNELS=="[0-9]*:*[0-9]", ENV{.BSG_DEV}="$root/bsg/$id"
-KERNEL=="st*[0-9]|nst*[0-9]", ENV{ID_SERIAL}!="?*", IMPORT="scsi_id --whitelisted --export --device=$env{.BSG_DEV}", ENV{ID_BUS}="scsi"
+KERNEL=="st*[0-9]|nst*[0-9]", ENV{ID_SERIAL}!="?*", IMPORT{program}="scsi_id --whitelisted --export --device=$env{.BSG_DEV}", ENV{ID_BUS}="scsi"
KERNEL=="st*[0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="tape/by-id/$env{ID_BUS}-$env{ID_SERIAL}"
KERNEL=="nst*[0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="tape/by-id/$env{ID_BUS}-$env{ID_SERIAL}-nst"
# by-path (parent device path)
-KERNEL=="st*[0-9]|nst*[0-9]", IMPORT{program}="path_id %p"
+KERNEL=="st*[0-9]|nst*[0-9]", IMPORT{builtin}="path_id"
KERNEL=="st*[0-9]", ENV{ID_PATH}=="?*", SYMLINK+="tape/by-path/$env{ID_PATH}"
KERNEL=="nst*[0-9]", ENV{ID_PATH}=="?*", SYMLINK+="tape/by-path/$env{ID_PATH}-nst"
ACTION=="change", SUBSYSTEM=="scsi", ENV{DEVTYPE}=="scsi_device", TEST=="block", ATTR{block/*/uevent}="change"
ACTION=="remove", GOTO="persistent_storage_end"
+
+# enable in-kernel media-presence polling
+ACTION=="add", SUBSYSTEM=="module", KERNEL=="block", ATTR{parameters/events_dfl_poll_msecs}=="0", ATTR{parameters/events_dfl_poll_msecs}="2000"
+
SUBSYSTEM!="block", GOTO="persistent_storage_end"
# skip rules for inappropriate block devices
KERNEL=="vd*[!0-9]", ATTRS{serial}=="?*", ENV{ID_SERIAL}="$attr{serial}", SYMLINK+="disk/by-id/virtio-$env{ID_SERIAL}"
KERNEL=="vd*[0-9]", ATTRS{serial}=="?*", ENV{ID_SERIAL}="$attr{serial}", SYMLINK+="disk/by-id/virtio-$env{ID_SERIAL}-part%n"
-# USB devices use their own serial number
-KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", SUBSYSTEMS=="usb", IMPORT{program}="usb_id --export %p"
# ATA devices with their own "ata" kernel subsystem
KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", SUBSYSTEMS=="ata", IMPORT{program}="ata_id --export $tempnode"
# ATA devices using the "scsi" subsystem
KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", SUBSYSTEMS=="scsi", ATTRS{vendor}=="ATA", IMPORT{program}="ata_id --export $tempnode"
-# ATA/ATAPI devices using the "scsi" subsystem
-KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", SUBSYSTEMS=="scsi", ATTRS{type}=="5", IMPORT{program}="ata_id --export $tempnode"
+# ATA/ATAPI devices (SPC-3 or later) using the "scsi" subsystem
+KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", SUBSYSTEMS=="scsi", ATTRS{type}=="5", ATTRS{scsi_level}=="[6-9]*", IMPORT{program}="ata_id --export $tempnode"
+
+# Run ata_id on non-removable USB Mass Storage (SATA/PATA disks in enclosures)
+KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", ATTR{removable}=="0", SUBSYSTEMS=="usb", IMPORT{program}="ata_id --export $tempnode"
+# Otherwise fall back to using usb_id for USB devices
+KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", SUBSYSTEMS=="usb", IMPORT{builtin}="usb_id"
+
# scsi devices
KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", IMPORT{program}="scsi_id --export --whitelisted -d $tempnode", ENV{ID_BUS}="scsi"
KERNEL=="cciss*", ENV{DEVTYPE}=="disk", ENV{ID_SERIAL}!="?*", IMPORT{program}="scsi_id --export --whitelisted -d $tempnode", ENV{ID_BUS}="cciss"
KERNEL=="mspblk[0-9]p[0-9]", ENV{ID_NAME}=="?*", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/memstick-$env{ID_NAME}_$env{ID_SERIAL}-part%n"
# by-path (parent device path)
-ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="", DEVPATH!="*/virtual/*", IMPORT{program}="path_id %p"
+ENV{DEVTYPE}=="disk", DEVPATH!="*/virtual/*", IMPORT{builtin}="path_id"
ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}"
ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}-part%n"
ENV{DEVTYPE}=="disk", KERNEL!="sd*|sr*", ATTR{removable}=="1", GOTO="persistent_storage_end"
# probe filesystem metadata of optical drives which have a media inserted
-KERNEL=="sr*", ENV{ID_CDROM_MEDIA_TRACK_COUNT_DATA}=="?*", ENV{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}=="?*", IMPORT{program}="/sbin/blkid -o udev -p -u noraid -O $env{ID_CDROM_MEDIA_SESSION_LAST_OFFSET} $tempnode"
+KERNEL=="sr*", ENV{DISK_EJECT_REQUEST}!="?*", ENV{ID_CDROM_MEDIA_TRACK_COUNT_DATA}=="?*", ENV{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}=="?*", IMPORT{program}="/sbin/blkid -o udev -p -u noraid -O $env{ID_CDROM_MEDIA_SESSION_LAST_OFFSET} $tempnode"
# single-session CDs do not have ID_CDROM_MEDIA_SESSION_LAST_OFFSET
-KERNEL=="sr*", ENV{ID_CDROM_MEDIA_TRACK_COUNT_DATA}=="?*", ENV{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}=="", IMPORT{program}="/sbin/blkid -o udev -p -u noraid $tempnode"
+KERNEL=="sr*", ENV{DISK_EJECT_REQUEST}!="?*", ENV{ID_CDROM_MEDIA_TRACK_COUNT_DATA}=="?*", ENV{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}=="", IMPORT{program}="/sbin/blkid -o udev -p -u noraid $tempnode"
# probe filesystem metadata of disks
KERNEL!="sr*", IMPORT{program}="/sbin/blkid -o udev -p $tempnode"
-# watch for future changes
+# watch metadata changes by tools closing the device after writing
KERNEL!="sr*", OPTIONS+="watch"
# by-label/by-uuid links (filesystem metadata)
ENV{DEVTYPE}=="disk", ENV{ID_WWN_WITH_EXTENSION}=="?*", SYMLINK+="disk/by-id/wwn-$env{ID_WWN_WITH_EXTENSION}"
ENV{DEVTYPE}=="partition", ENV{ID_WWN_WITH_EXTENSION}=="?*", SYMLINK+="disk/by-id/wwn-$env{ID_WWN_WITH_EXTENSION}-part%n"
+# by-partlabel/by-partuuid links (partition metadata)
+ENV{ID_PART_ENTRY_SCHEME}=="gpt", ENV{ID_PART_ENTRY_UUID}=="?*", SYMLINK+="disk/by-partuuid/$env{ID_PART_ENTRY_UUID}"
+ENV{ID_PART_ENTRY_SCHEME}=="gpt", ENV{ID_PART_ENTRY_NAME}=="?*", SYMLINK+="disk/by-partlabel/$env{ID_PART_ENTRY_NAME}"
+
LABEL="persistent_storage_end"
ACTION=="remove", GOTO="net_end"
SUBSYSTEM!="net", GOTO="net_end"
-SUBSYSTEMS=="usb", ENV{ID_MODEL}=="", IMPORT{program}="usb_id --export %p"
+SUBSYSTEMS=="usb", ENV{ID_MODEL}=="", IMPORT{builtin}="usb_id"
SUBSYSTEMS=="usb", ENV{ID_MODEL_FROM_DATABASE}=="", IMPORT{program}="usb-db %p"
SUBSYSTEMS=="usb", ATTRS{idVendor}!="", ATTRS{idProduct}!="", ENV{ID_VENDOR_ID}="$attr{idVendor}", ENV{ID_MODEL_ID}="$attr{idProduct}"
SUBSYSTEMS=="usb", GOTO="net_end"
ACTION=="remove", GOTO="tty_end"
SUBSYSTEM!="tty", GOTO="tty_end"
-SUBSYSTEMS=="usb", ENV{ID_MODEL}=="", IMPORT{program}="usb_id --export %p"
+SUBSYSTEMS=="usb", ENV{ID_MODEL}=="", IMPORT{builtin}="usb_id"
SUBSYSTEMS=="usb", ENV{ID_MODEL_FROM_DATABASE}=="", IMPORT{program}="usb-db %p"
SUBSYSTEMS=="usb", ATTRS{idVendor}!="", ATTRS{idProduct}!="", ENV{ID_VENDOR_ID}="$attr{idVendor}", ENV{ID_MODEL_ID}="$attr{idProduct}"
SUBSYSTEMS=="usb", GOTO="tty_end"
ENV{SOUND_INITIALIZED}="1"
-SUBSYSTEMS=="usb", ENV{ID_MODEL}=="", IMPORT{program}="usb_id --export %p"
+SUBSYSTEMS=="usb", IMPORT{builtin}="usb_id"
SUBSYSTEMS=="usb", ENV{ID_VENDOR_FROM_DATABASE}=="", IMPORT{program}="usb-db %p"
-SUBSYSTEMS=="usb", ATTRS{idVendor}!="", ATTRS{idProduct}!="", ENV{ID_VENDOR_ID}="$attr{idVendor}", ENV{ID_MODEL_ID}="$attr{idProduct}"
-SUBSYSTEMS=="usb", ATTRS{bInterfaceNumber}!="", ENV{ID_IFACE}="$attr{bInterfaceNumber}"
SUBSYSTEMS=="usb", GOTO="skip_pci"
SUBSYSTEMS=="pci", ENV{ID_VENDOR_FROM_DATABASE}=="", IMPORT{program}="pci-db %p"
LABEL="skip_pci"
-ENV{ID_SERIAL}=="?*", ENV{ID_IFACE}=="?*", ENV{ID_ID}="$env{ID_BUS}-$env{ID_SERIAL}-$env{ID_IFACE}-$attr{id}"
-ENV{ID_SERIAL}=="?*", ENV{ID_IFACE}=="", ENV{ID_ID}="$env{ID_BUS}-$env{ID_SERIAL}-$attr{id}"
+ENV{ID_SERIAL}=="?*", ENV{ID_USB_INTERFACE_NUM}=="?*", ENV{ID_ID}="$env{ID_BUS}-$env{ID_SERIAL}-$env{ID_USB_INTERFACE_NUM}-$attr{id}"
+ENV{ID_SERIAL}=="?*", ENV{ID_USB_INTERFACE_NUM}=="", ENV{ID_ID}="$env{ID_BUS}-$env{ID_SERIAL}-$attr{id}"
-ENV{ID_PATH}=="", IMPORT{program}="path_id %p/controlC%n"
+IMPORT{builtin}="path_id"
# The values used here for $SOUND_FORM_FACTOR and $SOUND_CLASS should be kept
# in sync with those defined for PulseAudio's src/pulse/proplist.h
SUBSYSTEM=="tifm", ENV{TIFM_CARD_TYPE}=="MS", RUN+="/sbin/modprobe -bv tifm_ms"
SUBSYSTEM=="memstick", RUN+="/sbin/modprobe -bv --all ms_block mspro_block"
SUBSYSTEM=="i2o", RUN+="/sbin/modprobe -bv i2o_block"
-SUBSYSTEM=="scsi", ENV{DEVTYPE}=="scsi_device", TEST!="[module/sg]", RUN+="/sbin/modprobe -bv sg"
SUBSYSTEM=="module", KERNEL=="parport_pc", RUN+="/sbin/modprobe -bv ppdev"
LABEL="drivers_end"
if not (no_args_tests.match(clause) or args_tests.match(clause) or
no_args_assign.match(clause) or args_assign.match(clause)):
- print 'Invalid line %s:%i: %s' % (path, lineno, line)
- print ' clause:', clause
- print
+ print('Invalid line %s:%i: %s' % (path, lineno, line))
+ print(' clause:', clause)
+ print()
result = 1
break
# After creation and removal the result is checked against the
# expected value and the result is printed.
#
-# Copyright (C) 2004-2008 Kay Sievers <kay.sievers@vrfy.org>
+# Copyright (C) 2004-2011 Kay Sievers <kay.sievers@vrfy.org>
# Copyright (C) 2004 Leann Ogasawara <ogasawara@osdl.org>
use warnings;
devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
exp_name => "node12345678",
rules => <<EOF
-SUBSYSTEMS=="scsi", IMPORT="/bin/echo -e \' TEST_KEY=12345678\\n TEST_key2=98765\'", SYMLINK+="node\$env{TEST_KEY}"
+SUBSYSTEMS=="scsi", IMPORT{program}="/bin/echo -e \' TEST_KEY=12345678\\n TEST_key2=98765\'", SYMLINK+="node\$env{TEST_KEY}"
KERNEL=="ttyACM0", SYMLINK+="modem"
EOF
},
exp_name => "parent",
option => "keep",
rules => <<EOF
-KERNEL=="sda", IMPORT="/bin/echo -e \'PARENT_KEY=parent_right\\nWRONG_PARENT_KEY=parent_wrong'"
+KERNEL=="sda", IMPORT{program}="/bin/echo -e \'PARENT_KEY=parent_right\\nWRONG_PARENT_KEY=parent_wrong'"
KERNEL=="sda", SYMLINK+="parent"
EOF
},
subsys => "block",
devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
exp_name => "sda",
- exp_perms => "0:0:0600",
+ exp_perms => "0:0:0440",
exp_rem_error => "yes",
rules => <<EOF
KERNEL=="sda", MODE="440"
KERNEL=="sda", SYMLINK+="%k-%s{[dmi/id]product_name}-end", RUN+="socket:@/org/kernel/udev/monitor"
EOF
},
+ {
+ desc => "builtin path_id",
+ subsys => "block",
+ devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
+ exp_name => "disk/by-path/pci-0000:00:1f.2-scsi-0:0:0:0",
+ rules => <<EOF
+KERNEL=="sda", IMPORT{builtin}="path_id"
+KERNEL=="sda", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/\$env{ID_PATH}"
+EOF
+ },
);
# set env
# create config file
open CONF, ">$udev_conf" || die "unable to create config file: $udev_conf";
print CONF "udev_root=\"$udev_root\"\n";
+print CONF "udev_run=\"$udev_root/.udev\"\n";
print CONF "udev_rules=\"$PWD\"\n";
print CONF "udev_log=\"err\"\n";
close CONF;
#include <stdarg.h>
#include <stdio.h>
#include <stddef.h>
+#include <limits.h>
+
+#if defined(__linux__)
+#include <mqueue.h>
+#endif
#include "sd-daemon.h"
-int sd_listen_fds(int unset_environment) {
+#if (__GNUC__ >= 4)
+#ifdef SD_EXPORT_SYMBOLS
+/* Export symbols */
+#define _sd_export_ __attribute__ ((visibility("default")))
+#else
+/* Don't export the symbols */
+#define _sd_export_ __attribute__ ((visibility("hidden")))
+#endif
+#else
+#define _sd_export_
+#endif
+
+_sd_export_ int sd_listen_fds(int unset_environment) {
#if defined(DISABLE_SYSTEMD) || !defined(__linux__)
return 0;
#endif
}
-int sd_is_fifo(int fd, const char *path) {
+_sd_export_ int sd_is_fifo(int fd, const char *path) {
struct stat st_fd;
if (fd < 0)
return 1;
}
+_sd_export_ int sd_is_special(int fd, const char *path) {
+ struct stat st_fd;
+
+ if (fd < 0)
+ return -EINVAL;
+
+ if (fstat(fd, &st_fd) < 0)
+ return -errno;
+
+ if (!S_ISREG(st_fd.st_mode) && !S_ISCHR(st_fd.st_mode))
+ return 0;
+
+ if (path) {
+ struct stat st_path;
+
+ if (stat(path, &st_path) < 0) {
+
+ if (errno == ENOENT || errno == ENOTDIR)
+ return 0;
+
+ return -errno;
+ }
+
+ if (S_ISREG(st_fd.st_mode) && S_ISREG(st_path.st_mode))
+ return
+ st_path.st_dev == st_fd.st_dev &&
+ st_path.st_ino == st_fd.st_ino;
+ else if (S_ISCHR(st_fd.st_mode) && S_ISCHR(st_path.st_mode))
+ return st_path.st_rdev == st_fd.st_rdev;
+ else
+ return 0;
+ }
+
+ return 1;
+}
+
static int sd_is_socket_internal(int fd, int type, int listening) {
struct stat st_fd;
struct sockaddr_storage storage;
};
-int sd_is_socket(int fd, int family, int type, int listening) {
+_sd_export_ int sd_is_socket(int fd, int family, int type, int listening) {
int r;
if (family < 0)
if (getsockname(fd, &sockaddr.sa, &l) < 0)
return -errno;
- if (l < offsetof(struct sockaddr_un, sun_path))
+ if (l < sizeof(sa_family_t))
return -EINVAL;
return sockaddr.sa.sa_family == family;
return 1;
}
-int sd_is_socket_inet(int fd, int family, int type, int listening, uint16_t port) {
+_sd_export_ int sd_is_socket_inet(int fd, int family, int type, int listening, uint16_t port) {
union sockaddr_union sockaddr;
socklen_t l;
int r;
if (getsockname(fd, &sockaddr.sa, &l) < 0)
return -errno;
- if (l < offsetof(struct sockaddr_un, sun_path))
+ if (l < sizeof(sa_family_t))
return -EINVAL;
if (sockaddr.sa.sa_family != AF_INET &&
return 1;
}
-int sd_is_socket_unix(int fd, int type, int listening, const char *path, size_t length) {
+_sd_export_ int sd_is_socket_unix(int fd, int type, int listening, const char *path, size_t length) {
union sockaddr_union sockaddr;
socklen_t l;
int r;
if (getsockname(fd, &sockaddr.sa, &l) < 0)
return -errno;
- if (l < offsetof(struct sockaddr_un, sun_path))
+ if (l < sizeof(sa_family_t))
return -EINVAL;
if (sockaddr.sa.sa_family != AF_UNIX)
return 1;
}
-int sd_notify(int unset_environment, const char *state) {
+_sd_export_ int sd_is_mq(int fd, const char *path) {
+#if !defined(__linux__)
+ return 0;
+#else
+ struct mq_attr attr;
+
+ if (fd < 0)
+ return -EINVAL;
+
+ if (mq_getattr(fd, &attr) < 0)
+ return -errno;
+
+ if (path) {
+ char fpath[PATH_MAX];
+ struct stat a, b;
+
+ if (path[0] != '/')
+ return -EINVAL;
+
+ if (fstat(fd, &a) < 0)
+ return -errno;
+
+ strncpy(stpcpy(fpath, "/dev/mqueue"), path, sizeof(fpath) - 12);
+ fpath[sizeof(fpath)-1] = 0;
+
+ if (stat(fpath, &b) < 0)
+ return -errno;
+
+ if (a.st_dev != b.st_dev ||
+ a.st_ino != b.st_ino)
+ return 0;
+ }
+
+ return 1;
+#endif
+}
+
+_sd_export_ int sd_notify(int unset_environment, const char *state) {
#if defined(DISABLE_SYSTEMD) || !defined(__linux__) || !defined(SOCK_CLOEXEC)
return 0;
#else
#endif
}
-int sd_notifyf(int unset_environment, const char *format, ...) {
+_sd_export_ int sd_notifyf(int unset_environment, const char *format, ...) {
#if defined(DISABLE_SYSTEMD) || !defined(__linux__)
return 0;
#else
#endif
}
-int sd_booted(void) {
+_sd_export_ int sd_booted(void) {
#if defined(DISABLE_SYSTEMD) || !defined(__linux__)
return 0;
#else
#endif
#endif
-#ifndef _sd_hidden_
-#if (__GNUC__ >= 4) && !defined(SD_EXPORT_SYMBOLS)
-#define _sd_hidden_ __attribute__ ((visibility("hidden")))
-#else
-#define _sd_hidden_
-#endif
-#endif
-
/*
Log levels for usage on stderr:
See sd_listen_fds(3) for more information.
*/
-int sd_listen_fds(int unset_environment) _sd_hidden_;
+int sd_listen_fds(int unset_environment);
/*
Helper call for identifying a passed file descriptor. Returns 1 if
See sd_is_fifo(3) for more information.
*/
-int sd_is_fifo(int fd, const char *path) _sd_hidden_;
+int sd_is_fifo(int fd, const char *path);
+
+/*
+ Helper call for identifying a passed file descriptor. Returns 1 if
+ the file descriptor is a special character device on the file
+ system stored under the specified path, 0 otherwise.
+ If path is NULL a path name check will not be done and the call
+ only verifies if the file descriptor refers to a special character.
+ Returns a negative errno style error code on failure.
+
+ See sd_is_special(3) for more information.
+*/
+int sd_is_special(int fd, const char *path);
/*
Helper call for identifying a passed file descriptor. Returns 1 if
See sd_is_socket(3) for more information.
*/
-int sd_is_socket(int fd, int family, int type, int listening) _sd_hidden_;
+int sd_is_socket(int fd, int family, int type, int listening);
/*
Helper call for identifying a passed file descriptor. Returns 1 if
See sd_is_socket_inet(3) for more information.
*/
-int sd_is_socket_inet(int fd, int family, int type, int listening, uint16_t port) _sd_hidden_;
+int sd_is_socket_inet(int fd, int family, int type, int listening, uint16_t port);
/*
Helper call for identifying a passed file descriptor. Returns 1 if
See sd_is_socket_unix(3) for more information.
*/
-int sd_is_socket_unix(int fd, int type, int listening, const char *path, size_t length) _sd_hidden_;
+int sd_is_socket_unix(int fd, int type, int listening, const char *path, size_t length);
+
+/*
+ Helper call for identifying a passed file descriptor. Returns 1 if
+ the file descriptor is a POSIX Message Queue of the specified name,
+ 0 otherwise. If path is NULL a message queue name check is not
+ done. Returns a negative errno style error code on failure.
+*/
+int sd_is_mq(int fd, const char *path);
/*
Informs systemd about changed daemon state. This takes a number of
READY=1 Tells systemd that daemon startup is finished (only
relevant for services of Type=notify). The passed
argument is a boolean "1" or "0". Since there is
- little value in signalling non-readiness the only
+ little value in signaling non-readiness the only
value daemons should send is "READY=1".
STATUS=... Passes a single-line status string back to systemd
fork off the process itself. Example: "MAINPID=4711"
Daemons can choose to send additional variables. However, it is
- recommened to prefix variable names not listed above with X_.
+ recommended to prefix variable names not listed above with X_.
Returns a negative errno-style error code on failure. Returns > 0
if systemd could be notified, 0 if it couldn't possibly because
See sd_notify(3) for more information.
*/
-int sd_notify(int unset_environment, const char *state) _sd_hidden_;
+int sd_notify(int unset_environment, const char *state);
/*
Similar to sd_notify() but takes a format string.
See sd_notifyf(3) for more information.
*/
-int sd_notifyf(int unset_environment, const char *format, ...) _sd_printf_attr_(2,3) _sd_hidden_;
+int sd_notifyf(int unset_environment, const char *format, ...) _sd_printf_attr_(2,3);
/*
Returns > 0 if the system was booted with systemd. Returns < 0 on
fine. You should NOT protect them with a call to this function. Also
note that this function checks whether the system, not the user
session is controlled by systemd. However the functions above work
- for both session and system services.
+ for both user and system services.
See sd_booted(3) for more information.
*/
-int sd_booted(void) _sd_hidden_;
+int sd_booted(void);
#ifdef __cplusplus
}
#include <fcntl.h>
#include <ctype.h>
#include <errno.h>
-#include <signal.h>
#include <unistd.h>
#include <syslog.h>
#include <grp.h>
+#include <sys/signalfd.h>
#include "udev.h"
-static void sig_handler(int signum)
-{
- switch (signum) {
- case SIGALRM:
- _exit(1);
- case SIGINT:
- case SIGTERM:
- _exit(20 + signum);
- }
-}
-
int main(int argc, char *argv[])
{
struct udev *udev;
- struct udev_event *event;
- struct udev_device *dev;
- struct udev_rules *rules;
+ struct udev_event *event = NULL;
+ struct udev_device *dev = NULL;
+ struct udev_rules *rules = NULL;
char syspath[UTIL_PATH_SIZE];
const char *devpath;
const char *action;
const char *subsystem;
- struct sigaction act;
- sigset_t mask;
+ sigset_t mask, sigmask_orig;
int err = -EINVAL;
udev = udev_new();
info(udev, "version %s\n", VERSION);
udev_selinux_init(udev);
- /* set signal handlers */
- memset(&act, 0x00, sizeof(act));
- act.sa_handler = sig_handler;
- sigemptyset (&act.sa_mask);
- act.sa_flags = 0;
- sigaction(SIGALRM, &act, NULL);
- sigaction(SIGINT, &act, NULL);
- sigaction(SIGTERM, &act, NULL);
- sigemptyset(&mask);
- sigaddset(&mask, SIGALRM);
- sigaddset(&mask, SIGINT);
- sigaddset(&mask, SIGTERM);
- sigprocmask(SIG_UNBLOCK, &mask, NULL);
-
- /* trigger timeout to prevent hanging processes */
- alarm(UDEV_EVENT_TIMEOUT);
+ sigprocmask(SIG_SETMASK, NULL, &sigmask_orig);
action = getenv("ACTION");
devpath = getenv("DEVPATH");
if (action == NULL || subsystem == NULL || devpath == NULL) {
err(udev, "action, subsystem or devpath missing\n");
- goto exit;
+ goto out;
}
rules = udev_rules_new(udev, 1);
dev = udev_device_new_from_syspath(udev, syspath);
if (dev == NULL) {
info(udev, "unknown device '%s'\n", devpath);
- goto fail;
+ goto out;
}
/* skip reading of db, but read kernel parameters */
udev_device_set_action(dev, action);
event = udev_event_new(dev);
- err = udev_event_execute_rules(event, rules);
- /* rules may change/disable the timeout */
- if (udev_device_get_event_timeout(dev) >= 0)
- alarm(udev_device_get_event_timeout(dev));
+ sigfillset(&mask);
+ sigprocmask(SIG_SETMASK, &mask, &sigmask_orig);
+ event->fd_signal = signalfd(-1, &mask, SFD_NONBLOCK|SFD_CLOEXEC);
+ if (event->fd_signal < 0) {
+ fprintf(stderr, "error creating signalfd\n");
+ goto out;
+ }
+ err = udev_event_execute_rules(event, rules, &sigmask_orig);
if (err == 0)
udev_event_execute_run(event, NULL);
-
+out:
+ if (event != NULL && event->fd_signal >= 0)
+ close(event->fd_signal);
udev_event_unref(event);
udev_device_unref(dev);
-fail:
udev_rules_unref(rules);
-exit:
udev_selinux_exit(udev);
udev_unref(udev);
if (err != 0)
--- /dev/null
+/*
+ * compose persistent device path
+ *
+ * Copyright (C) 2009 Martin Pitt <martin.pitt@ubuntu.com>
+ * Portions Copyright (C) 2004 David Zeuthen, <david@fubar.dk>
+ * Copyright (C) 2011 Kay Sievers <kay.sievers@vrfy.org>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <unistd.h>
+#include <string.h>
+#include <errno.h>
+#include <linux/limits.h>
+#include <linux/input.h>
+
+#include "udev.h"
+
+/* we must use this kernel-compatible implementation */
+#define BITS_PER_LONG (sizeof(unsigned long) * 8)
+#define NBITS(x) ((((x)-1)/BITS_PER_LONG)+1)
+#define OFF(x) ((x)%BITS_PER_LONG)
+#define BIT(x) (1UL<<OFF(x))
+#define LONG(x) ((x)/BITS_PER_LONG)
+#define test_bit(bit, array) ((array[LONG(bit)] >> OFF(bit)) & 1)
+
+/*
+ * Read a capability attribute and return bitmask.
+ * @param dev udev_device
+ * @param attr sysfs attribute name (e. g. "capabilities/key")
+ * @param bitmask: Output array which has a sizeof of bitmask_size
+ */
+static void get_cap_mask(struct udev_device *dev,
+ struct udev_device *pdev, const char* attr,
+ unsigned long *bitmask, size_t bitmask_size,
+ bool test)
+{
+ struct udev *udev = udev_device_get_udev(dev);
+ char text[4096];
+ unsigned i;
+ char* word;
+ unsigned long val;
+
+ snprintf(text, sizeof(text), "%s", udev_device_get_sysattr_value(pdev, attr));
+ info(udev, "%s raw kernel attribute: %s\n", attr, text);
+
+ memset (bitmask, 0, bitmask_size);
+ i = 0;
+ while ((word = strrchr(text, ' ')) != NULL) {
+ val = strtoul (word+1, NULL, 16);
+ if (i < bitmask_size/sizeof(unsigned long))
+ bitmask[i] = val;
+ else
+ info(udev, "ignoring %s block %lX which is larger than maximum size\n", attr, val);
+ *word = '\0';
+ ++i;
+ }
+ val = strtoul (text, NULL, 16);
+ if (i < bitmask_size / sizeof(unsigned long))
+ bitmask[i] = val;
+ else
+ info(udev, "ignoring %s block %lX which is larger than maximum size\n", attr, val);
+
+ if (test) {
+ /* printf pattern with the right unsigned long number of hex chars */
+ snprintf(text, sizeof(text), " bit %%4u: %%0%zilX\n", 2 * sizeof(unsigned long));
+ info(udev, "%s decoded bit map:\n", attr);
+ val = bitmask_size / sizeof (unsigned long);
+ /* skip over leading zeros */
+ while (bitmask[val-1] == 0 && val > 0)
+ --val;
+ for (i = 0; i < val; ++i)
+ info(udev, text, i * BITS_PER_LONG, bitmask[i]);
+ }
+}
+
+/* pointer devices */
+static void test_pointers (struct udev_device *dev,
+ const unsigned long* bitmask_ev,
+ const unsigned long* bitmask_abs,
+ const unsigned long* bitmask_key,
+ const unsigned long* bitmask_rel,
+ bool test)
+{
+ int is_mouse = 0;
+ int is_touchpad = 0;
+
+ if (!test_bit (EV_KEY, bitmask_ev)) {
+ if (test_bit (EV_ABS, bitmask_ev) &&
+ test_bit (ABS_X, bitmask_abs) &&
+ test_bit (ABS_Y, bitmask_abs) &&
+ test_bit (ABS_Z, bitmask_abs))
+ udev_builtin_add_property(dev, test, "ID_INPUT_ACCELEROMETER", "1");
+ return;
+ }
+
+ if (test_bit (EV_ABS, bitmask_ev) &&
+ test_bit (ABS_X, bitmask_abs) && test_bit (ABS_Y, bitmask_abs)) {
+ if (test_bit (BTN_STYLUS, bitmask_key) || test_bit (BTN_TOOL_PEN, bitmask_key))
+ udev_builtin_add_property(dev, test, "ID_INPUT_TABLET", "1");
+ else if (test_bit (BTN_TOOL_FINGER, bitmask_key) && !test_bit (BTN_TOOL_PEN, bitmask_key))
+ is_touchpad = 1;
+ else if (test_bit (BTN_TRIGGER, bitmask_key) ||
+ test_bit (BTN_A, bitmask_key) ||
+ test_bit (BTN_1, bitmask_key))
+ udev_builtin_add_property(dev, test, "ID_INPUT_JOYSTICK", "1");
+ else if (test_bit (BTN_MOUSE, bitmask_key))
+ /* This path is taken by VMware's USB mouse, which has
+ * absolute axes, but no touch/pressure button. */
+ is_mouse = 1;
+ else if (test_bit (BTN_TOUCH, bitmask_key))
+ udev_builtin_add_property(dev, test, "ID_INPUT_TOUCHSCREEN", "1");
+ }
+
+ if (test_bit (EV_REL, bitmask_ev) &&
+ test_bit (REL_X, bitmask_rel) && test_bit (REL_Y, bitmask_rel) &&
+ test_bit (BTN_MOUSE, bitmask_key))
+ is_mouse = 1;
+
+ if (is_mouse)
+ udev_builtin_add_property(dev, test, "ID_INPUT_MOUSE", "1");
+ if (is_touchpad)
+ udev_builtin_add_property(dev, test, "ID_INPUT_TOUCHPAD", "1");
+}
+
+/* key like devices */
+static void test_key (struct udev_device *dev,
+ const unsigned long* bitmask_ev,
+ const unsigned long* bitmask_key,
+ bool test)
+{
+ struct udev *udev = udev_device_get_udev(dev);
+ unsigned i;
+ unsigned long found;
+ unsigned long mask;
+
+ /* do we have any KEY_* capability? */
+ if (!test_bit (EV_KEY, bitmask_ev)) {
+ info(udev, "test_key: no EV_KEY capability\n");
+ return;
+ }
+
+ /* only consider KEY_* here, not BTN_* */
+ found = 0;
+ for (i = 0; i < BTN_MISC/BITS_PER_LONG; ++i) {
+ found |= bitmask_key[i];
+ info(udev, "test_key: checking bit block %lu for any keys; found=%i\n", i*BITS_PER_LONG, found > 0);
+ }
+ /* If there are no keys in the lower block, check the higher block */
+ if (!found) {
+ for (i = KEY_OK; i < BTN_TRIGGER_HAPPY; ++i) {
+ if (test_bit (i, bitmask_key)) {
+ info(udev, "test_key: Found key %x in high block\n", i);
+ found = 1;
+ break;
+ }
+ }
+ }
+
+ if (found > 0)
+ udev_builtin_add_property(dev, test, "ID_INPUT_KEY", "1");
+
+ /* the first 32 bits are ESC, numbers, and Q to D; if we have all of
+ * those, consider it a full keyboard; do not test KEY_RESERVED, though */
+ mask = 0xFFFFFFFE;
+ if ((bitmask_key[0] & mask) == mask)
+ udev_builtin_add_property(dev, test, "ID_INPUT_KEYBOARD", "1");
+}
+
+static int builtin_input_id(struct udev_device *dev, bool test)
+{
+ struct udev_device *pdev;
+ unsigned long bitmask_ev[NBITS(EV_MAX)];
+ unsigned long bitmask_abs[NBITS(ABS_MAX)];
+ unsigned long bitmask_key[NBITS(KEY_MAX)];
+ unsigned long bitmask_rel[NBITS(REL_MAX)];
+
+ /* walk up the parental chain until we find the real input device; the
+ * argument is very likely a subdevice of this, like eventN */
+ pdev = dev;
+ while (pdev != NULL && udev_device_get_sysattr_value(pdev, "capabilities/ev") == NULL)
+ pdev = udev_device_get_parent_with_subsystem_devtype(pdev, "input", NULL);
+
+ /* not an "input" class device */
+ if (pdev == NULL)
+ return EXIT_SUCCESS;
+
+ /* Use this as a flag that input devices were detected, so that this
+ * program doesn't need to be called more than once per device */
+ udev_builtin_add_property(dev, test, "ID_INPUT", "1");
+ get_cap_mask(dev, pdev, "capabilities/ev", bitmask_ev, sizeof(bitmask_ev), test);
+ get_cap_mask(dev, pdev, "capabilities/abs", bitmask_abs, sizeof(bitmask_abs), test);
+ get_cap_mask(dev, pdev, "capabilities/rel", bitmask_rel, sizeof(bitmask_rel), test);
+ get_cap_mask(dev, pdev, "capabilities/key", bitmask_key, sizeof(bitmask_key), test);
+ test_pointers(dev, bitmask_ev, bitmask_abs, bitmask_key, bitmask_rel, test);
+ test_key(dev, bitmask_ev, bitmask_key, test);
+ return EXIT_SUCCESS;
+}
+
+const struct udev_builtin udev_builtin_input_id = {
+ .name = "input_id",
+ .cmd = builtin_input_id,
+ .help = "input device properties",
+};
/*
* compose persistent device path
*
- * Copyright (C) 2009 Kay Sievers <kay.sievers@vrfy.org>
+ * Copyright (C) 2009-2011 Kay Sievers <kay.sievers@vrfy.org>
*
* Logic based on Hannes Reinecke's shell script.
*
#include <dirent.h>
#include <getopt.h>
-#include "libudev.h"
-#include "libudev-private.h"
-
-static int debug;
-
-static void log_fn(struct udev *udev, int priority,
- const char *file, int line, const char *fn,
- const char *format, va_list args)
-{
- if (debug) {
- fprintf(stderr, "%s: ", fn != NULL ? fn : file);
- vfprintf(stderr, format, args);
- } else {
- vsyslog(priority, format, args);
- }
-}
+#include "udev.h"
static int path_prepend(char **path, const char *fmt, ...)
{
va_list va;
- char *old;
char *pre;
- int err;
-
- old = *path;
+ int err = 0;
va_start(va, fmt);
err = vasprintf(&pre, fmt, va);
va_end(va);
if (err < 0)
- return err;
+ goto out;
- if (old != NULL) {
- err = asprintf(path, "%s-%s", pre, old);
- if (err < 0)
- return err;
+ if (*path != NULL) {
+ char *new;
+
+ err = asprintf(&new, "%s-%s", pre, *path);
free(pre);
+ if (err < 0)
+ goto out;
+ free(*path);
+ *path = new;
} else {
*path = pre;
}
+out:
+ return err;
+}
- free(old);
- return 0;
+/*
+** Linux only supports 32 bit luns.
+** See drivers/scsi/scsi_scan.c::scsilun_to_int() for more details.
+*/
+static int format_lun_number(struct udev_device *dev, char **path)
+{
+ unsigned long lun = strtoul(udev_device_get_sysnum(dev), NULL, 10);
+
+ /* address method 0, peripheral device addressing with bus id of zero */
+ if (lun < 256)
+ return path_prepend(path, "lun-%d", lun);
+ /* handle all other lun addressing methods by using a variant of the original lun format */
+ return path_prepend(path, "lun-0x%04x%04x00000000", (lun & 0xffff), (lun >> 16) & 0xffff);
}
static struct udev_device *skip_subsystem(struct udev_device *dev, const char *subsys)
struct udev_device *targetdev;
struct udev_device *fcdev = NULL;
const char *port;
- unsigned int lun;
+ char *lun = NULL;;
targetdev = udev_device_get_parent_with_subsystem_devtype(parent, "scsi", "scsi_target");
if (targetdev == NULL)
goto out;
}
- lun = strtoul(udev_device_get_sysnum(parent), NULL, 10);
- path_prepend(path, "fc-%s:0x%04x%04x00000000", port, lun & 0xffff, (lun >> 16) & 0xffff);
+ format_lun_number(parent, &lun);
+ path_prepend(path, "fc-%s-%s", port, lun);
+ if (lun)
+ free(lun);
out:
udev_device_unref(fcdev);
return parent;
static struct udev_device *handle_scsi_sas(struct udev_device *parent, char **path)
{
- return NULL;
+ struct udev *udev = udev_device_get_udev(parent);
+ struct udev_device *targetdev;
+ struct udev_device *target_parent;
+ struct udev_device *sasdev;
+ const char *sas_address;
+ char *lun = NULL;
+
+ targetdev = udev_device_get_parent_with_subsystem_devtype(parent, "scsi", "scsi_target");
+ if (targetdev == NULL)
+ return NULL;
+
+ target_parent = udev_device_get_parent(targetdev);
+ if (target_parent == NULL)
+ return NULL;
+
+ sasdev = udev_device_new_from_subsystem_sysname(udev, "sas_device",
+ udev_device_get_sysname(target_parent));
+ if (sasdev == NULL)
+ return NULL;
+
+ sas_address = udev_device_get_sysattr_value(sasdev, "sas_address");
+ if (sas_address == NULL) {
+ parent = NULL;
+ goto out;
+ }
+
+ format_lun_number(parent, &lun);
+ path_prepend(path, "sas-%s-%s", sas_address, lun);
+ if (lun)
+ free(lun);
+out:
+ udev_device_unref(sasdev);
+ return parent;
}
static struct udev_device *handle_scsi_iscsi(struct udev_device *parent, char **path)
struct udev_device *conndev = NULL;
const char *addr;
const char *port;
+ char *lun = NULL;
/* find iscsi session */
transportdev = parent;
- while (1) {
+ for (;;) {
transportdev = udev_device_get_parent(transportdev);
if (transportdev == NULL)
return NULL;
if (strncmp(udev_device_get_sysname(transportdev), "session", 7) == 0)
break;
}
- if (transportdev == NULL)
- return NULL;
/* find iscsi session device */
sessiondev = udev_device_new_from_subsystem_sysname(udev, "iscsi_session", udev_device_get_sysname(transportdev));
goto out;
}
- path_prepend(path, "ip-%s:%s-iscsi-%s-lun-%s", addr, port, target, udev_device_get_sysnum(parent));
+ format_lun_number(parent, &lun);
+ path_prepend(path, "ip-%s:%s-iscsi-%s-%s", addr, port, target, lun);
+ if (lun)
+ free(lun);
out:
udev_device_unref(sessiondev);
udev_device_unref(conndev);
return parent;
}
-static void handle_scsi_tape(struct udev_device *dev, char **suffix)
+static void handle_scsi_tape(struct udev_device *dev, char **path)
{
const char *name;
+ /* must be the last device in the syspath */
+ if (*path != NULL)
+ return;
+
name = udev_device_get_sysname(dev);
if (strncmp(name, "nst", 3) == 0 && strchr("lma", name[3]) != NULL)
- asprintf(suffix, "nst%c", name[3]);
+ path_prepend(path, "nst%c", name[3]);
else if (strncmp(name, "st", 2) == 0 && strchr("lma", name[2]) != NULL)
- asprintf(suffix, "st%c", name[2]);
+ path_prepend(path, "st%c", name[2]);
}
static struct udev_device *handle_usb(struct udev_device *parent, char **path)
const char *port;
devtype = udev_device_get_devtype(parent);
- if (devtype == NULL || strcmp(devtype, "usb_interface") != 0)
+ if (devtype == NULL)
+ return parent;
+ if (strcmp(devtype, "usb_interface") != 0 && strcmp(devtype, "usb_device") != 0)
return parent;
str = udev_device_get_sysname(parent);
return parent;
}
-int main(int argc, char **argv)
+static int builtin_path_id(struct udev_device *dev, bool test)
{
- static const struct option options[] = {
- { "debug", no_argument, NULL, 'd' },
- { "help", no_argument, NULL, 'h' },
- {}
- };
- struct udev *udev;
- struct udev_device *dev;
struct udev_device *parent;
- char syspath[UTIL_PATH_SIZE];
- const char *devpath;
- char *path;
- char *path_suffix;
- int rc = 1;
-
- udev = udev_new();
- if (udev == NULL)
- goto exit;
-
- udev_log_init("path_id");
- udev_set_log_fn(udev, log_fn);
-
- while (1) {
- int option;
-
- option = getopt_long(argc, argv, "dh", options, NULL);
- if (option == -1)
- break;
-
- switch (option) {
- case 'd':
- debug = 1;
- if (udev_get_log_priority(udev) < LOG_INFO)
- udev_set_log_priority(udev, LOG_INFO);
- break;
- case 'h':
- printf("Usage: path_id [--debug] [--help] <devpath>\n"
- " --debug print debug information\n"
- " --help print this help text\n\n");
- default:
- rc = 1;
- goto exit;
- }
- }
-
- devpath = argv[optind];
- if (devpath == NULL) {
- fprintf(stderr, "No device specified\n");
- rc = 2;
- goto exit;
- }
-
- util_strscpyl(syspath, sizeof(syspath), udev_get_sys_path(udev), devpath, NULL);
- dev = udev_device_new_from_syspath(udev, syspath);
- if (dev == NULL) {
- fprintf(stderr, "unable to access '%s'\n", devpath);
- rc = 3;
- goto exit;
- }
-
- path = NULL;
- path_suffix = NULL;
+ char *path = NULL;
/* S390 ccw bus */
parent = udev_device_get_parent_with_subsystem_devtype(dev, "ccw", NULL);
const char *subsys;
subsys = udev_device_get_subsystem(parent);
-
if (subsys == NULL) {
;
} else if (strcmp(subsys, "scsi_tape") == 0) {
- handle_scsi_tape(parent, &path_suffix);
+ handle_scsi_tape(parent, &path);
} else if (strcmp(subsys, "scsi") == 0) {
parent = handle_scsi(parent, &path);
} else if (strcmp(subsys, "cciss") == 0) {
} else if (strcmp(subsys, "platform") == 0) {
path_prepend(&path, "platform-%s", udev_device_get_sysname(parent));
parent = skip_subsystem(parent, "platform");
+ } else if (strcmp(subsys, "acpi") == 0) {
+ path_prepend(&path, "acpi-%s", udev_device_get_sysname(parent));
+ parent = skip_subsystem(parent, "acpi");
} else if (strcmp(subsys, "xen") == 0) {
path_prepend(&path, "xen-%s", udev_device_get_sysname(parent));
parent = skip_subsystem(parent, "xen");
}
out:
if (path != NULL) {
- if (path_suffix != NULL) {
- printf("ID_PATH=%s%s\n", path, path_suffix);
- free(path_suffix);
- } else {
- printf("ID_PATH=%s\n", path);
+ char tag[UTIL_NAME_SIZE];
+ size_t i;
+ const char *p;
+
+ /* compose valid udev tag name */
+ for (p = path, i = 0; *p; p++) {
+ if ((*p >= '0' && *p <= '9') ||
+ (*p >= 'A' && *p <= 'Z') ||
+ (*p >= 'a' && *p <= 'z') ||
+ *p == '-') {
+ tag[i++] = *p;
+ continue;
+ }
+
+ /* skip all leading '_' */
+ if (i == 0)
+ continue;
+
+ /* avoid second '_' */
+ if (tag[i-1] == '_')
+ continue;
+
+ tag[i++] = '_';
}
+ /* strip trailing '_' */
+ while (i > 0 && tag[i-1] == '_')
+ i--;
+ tag[i] = '\0';
+
+ udev_builtin_add_property(dev, test, "ID_PATH", path);
+ udev_builtin_add_property(dev, test, "ID_PATH_TAG", tag);
free(path);
- rc = 0;
+ return EXIT_SUCCESS;
}
-
- udev_device_unref(dev);
-exit:
- udev_unref(udev);
- udev_log_close();
- return rc;
+ return EXIT_FAILURE;
}
+
+const struct udev_builtin udev_builtin_path_id = {
+ .name = "path_id",
+ .cmd = builtin_path_id,
+ .help = "compose persistent device path",
+};
/*
- * usb_id - identify an USB device
+ * USB device properties and persistent device path
*
* Copyright (c) 2005 SUSE Linux Products GmbH, Germany
+ * Author: Hannes Reinecke <hare@suse.de>
*
- * Author: Hannes Reinecke <hare@suse.de>
+ * Copyright (C) 2005-2011 Kay Sievers <kay.sievers@vrfy.org>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
#include <ctype.h>
#include <fcntl.h>
#include <errno.h>
-#include <getopt.h>
-#include "libudev.h"
-#include "libudev-private.h"
-
-int debug;
-
-static void log_fn(struct udev *udev, int priority,
- const char *file, int line, const char *fn,
- const char *format, va_list args)
-{
- if (debug) {
- fprintf(stderr, "%s: ", fn != NULL ? fn : file);
- vfprintf(stderr, format, args);
- } else {
- vsyslog(priority, format, args);
- }
-}
-
-static char vendor_str[64];
-static char vendor_str_enc[256];
-static const char *vendor_id = "";
-static char model_str[64];
-static char model_str_enc[256];
-static const char *product_id = "";
-static char serial_str[UTIL_NAME_SIZE];
-static char packed_if_str[UTIL_NAME_SIZE];
-static char revision_str[64];
-static char type_str[64];
-static char instance_str[64];
-static const char *ifnum;
-static const char *driver;
-
-static int use_usb_info;
-static int use_num_info;
+#include "udev.h"
static void set_usb_iftype(char *to, int if_class_num, size_t len)
{
err = -1;
goto out;
}
- fd = open(filename, O_RDONLY);
+ fd = open(filename, O_RDONLY|O_CLOEXEC);
if (fd < 0) {
fprintf(stderr, "error opening USB device 'descriptors' file\n");
err = -1;
pos = 0;
strpos = 0;
- while (pos < sizeof(buf) && strpos+7 < len) {
+ ifs_str[0] = '\0';
+ while (pos < sizeof(buf) && strpos+7 < len-2) {
struct usb_interface_descriptor *desc;
char if_str[8];
if (desc->bDescriptorType != USB_DT_INTERFACE)
continue;
- if (snprintf(if_str, 8, "%02x%02x%02x:",
+ if (snprintf(if_str, 8, ":%02x%02x%02x",
desc->bInterfaceClass,
desc->bInterfaceSubClass,
desc->bInterfaceProtocol) != 7)
memcpy(&ifs_str[strpos], if_str, 8),
strpos += 7;
}
+ if (strpos > 0) {
+ ifs_str[strpos++] = ':';
+ ifs_str[strpos++] = '\0';
+ }
out:
free(filename);
return err;
* 6.) If the device supplies a serial number, this number
* is concatenated with the identification with an underscore '_'.
*/
-static int usb_id(struct udev_device *dev)
+static int builtin_usb_id(struct udev_device *dev, bool test)
{
+ char vendor_str[64];
+ char vendor_str_enc[256];
+ const char *vendor_id;
+ char model_str[64];
+ char model_str_enc[256];
+ const char *product_id;
+ char serial_str[UTIL_NAME_SIZE];
+ char packed_if_str[UTIL_NAME_SIZE];
+ char revision_str[64];
+ char type_str[64];
+ char instance_str[64];
+ const char *ifnum = NULL;
+ const char *driver = NULL;
+ char serial[256];
+
struct udev *udev = udev_device_get_udev(dev);
struct udev_device *dev_interface = NULL;
struct udev_device *dev_usb = NULL;
const char *if_class, *if_subclass;
int if_class_num;
int protocol = 0;
+ size_t l;
+ char *s;
+
+ vendor_str[0] = '\0';
+ model_str[0] = '\0';
+ serial_str[0] = '\0';
+ packed_if_str[0] = '\0';
+ revision_str[0] = '\0';
+ type_str[0] = '\0';
+ instance_str[0] = '\0';
dbg(udev, "syspath %s\n", udev_device_get_syspath(dev));
if (dev_interface == NULL) {
info(udev, "unable to access usb_interface device of '%s'\n",
udev_device_get_syspath(dev));
- return 1;
+ return EXIT_FAILURE;
}
ifnum = udev_device_get_sysattr_value(dev_interface, "bInterfaceNumber");
if (!if_class) {
info(udev, "%s: cannot get bInterfaceClass attribute\n",
udev_device_get_sysname(dev));
- return 1;
+ return EXIT_FAILURE;
}
if_class_num = strtoul(if_class, NULL, 16);
if (!dev_usb) {
info(udev, "unable to find parent 'usb' device of '%s'\n",
udev_device_get_syspath(dev));
- return 1;
+ return EXIT_FAILURE;
}
/* all interfaces of the device in a single string */
dev_if_packed_info(dev_usb, packed_if_str, sizeof(packed_if_str));
/* mass storage : SCSI or ATAPI */
- if ((protocol == 6 || protocol == 2) && !use_usb_info) {
+ if ((protocol == 6 || protocol == 2)) {
struct udev_device *dev_scsi;
const char *scsi_model, *scsi_vendor, *scsi_type, *scsi_rev;
int host, bus, target, lun;
goto fallback;
}
udev_util_encode_string(scsi_vendor, vendor_str_enc, sizeof(vendor_str_enc));
- udev_util_replace_whitespace(scsi_vendor, vendor_str, sizeof(vendor_str)-1);
- udev_util_replace_chars(vendor_str, NULL);
+ util_replace_whitespace(scsi_vendor, vendor_str, sizeof(vendor_str)-1);
+ util_replace_chars(vendor_str, NULL);
scsi_model = udev_device_get_sysattr_value(dev_scsi, "model");
if (!scsi_model) {
goto fallback;
}
udev_util_encode_string(scsi_model, model_str_enc, sizeof(model_str_enc));
- udev_util_replace_whitespace(scsi_model, model_str, sizeof(model_str)-1);
- udev_util_replace_chars(model_str, NULL);
+ util_replace_whitespace(scsi_model, model_str, sizeof(model_str)-1);
+ util_replace_chars(model_str, NULL);
scsi_type = udev_device_get_sysattr_value(dev_scsi, "type");
if (!scsi_type) {
udev_device_get_sysname(dev_scsi));
goto fallback;
}
- udev_util_replace_whitespace(scsi_rev, revision_str, sizeof(revision_str)-1);
- udev_util_replace_chars(revision_str, NULL);
+ util_replace_whitespace(scsi_rev, revision_str, sizeof(revision_str)-1);
+ util_replace_chars(revision_str, NULL);
/*
* some broken devices have the same identifiers
if (vendor_str[0] == '\0') {
const char *usb_vendor = NULL;
- if (!use_num_info)
- usb_vendor = udev_device_get_sysattr_value(dev_usb, "manufacturer");
-
+ usb_vendor = udev_device_get_sysattr_value(dev_usb, "manufacturer");
if (!usb_vendor)
usb_vendor = vendor_id;
-
if (!usb_vendor) {
info(udev, "No USB vendor information available\n");
- return 1;
+ return EXIT_FAILURE;
}
udev_util_encode_string(usb_vendor, vendor_str_enc, sizeof(vendor_str_enc));
- udev_util_replace_whitespace(usb_vendor, vendor_str, sizeof(vendor_str)-1);
- udev_util_replace_chars(vendor_str, NULL);
+ util_replace_whitespace(usb_vendor, vendor_str, sizeof(vendor_str)-1);
+ util_replace_chars(vendor_str, NULL);
}
if (model_str[0] == '\0') {
const char *usb_model = NULL;
- if (!use_num_info)
- usb_model = udev_device_get_sysattr_value(dev_usb, "product");
-
+ usb_model = udev_device_get_sysattr_value(dev_usb, "product");
if (!usb_model)
usb_model = product_id;
-
if (!usb_model) {
dbg(udev, "No USB model information available\n");
- return 1;
+ return EXIT_FAILURE;
}
udev_util_encode_string(usb_model, model_str_enc, sizeof(model_str_enc));
- udev_util_replace_whitespace(usb_model, model_str, sizeof(model_str)-1);
- udev_util_replace_chars(model_str, NULL);
+ util_replace_whitespace(usb_model, model_str, sizeof(model_str)-1);
+ util_replace_chars(model_str, NULL);
}
if (revision_str[0] == '\0') {
usb_rev = udev_device_get_sysattr_value(dev_usb, "bcdDevice");
if (usb_rev) {
- udev_util_replace_whitespace(usb_rev, revision_str, sizeof(revision_str)-1);
- udev_util_replace_chars(revision_str, NULL);
+ util_replace_whitespace(usb_rev, revision_str, sizeof(revision_str)-1);
+ util_replace_chars(revision_str, NULL);
}
}
usb_serial = udev_device_get_sysattr_value(dev_usb, "serial");
if (usb_serial) {
- udev_util_replace_whitespace(usb_serial, serial_str, sizeof(serial_str)-1);
- udev_util_replace_chars(serial_str, NULL);
+ util_replace_whitespace(usb_serial, serial_str, sizeof(serial_str)-1);
+ util_replace_chars(serial_str, NULL);
}
}
- return 0;
-}
-
-int main(int argc, char **argv)
-{
- static const struct option options[] = {
- { "usb-info", no_argument, NULL, 'u' },
- { "num-info", no_argument, NULL, 'n' },
- { "export", no_argument, NULL, 'x' },
- { "debug", no_argument, NULL, 'd' },
- { "help", no_argument, NULL, 'h' },
- {}
- };
- struct udev *udev;
- struct udev_device *dev = NULL;
- static int export;
- int retval = 0;
-
- udev = udev_new();
- if (udev == NULL)
- goto exit;
-
- udev_log_init("usb_id");
- udev_set_log_fn(udev, log_fn);
-
- while (1) {
- int option;
-
- option = getopt_long(argc, argv, "dnuxh", options, NULL);
- if (option == -1)
- break;
- switch (option) {
- case 'd':
- debug = 1;
- if (udev_get_log_priority(udev) < LOG_INFO)
- udev_set_log_priority(udev, LOG_INFO);
- break;
- case 'n':
- use_num_info = 1;
- use_usb_info = 1;
- break;
- case 'u':
- use_usb_info = 1;
- break;
- case 'x':
- export = 1;
- break;
- case 'h':
- printf("Usage: usb_id [--usb-info] [--num-info] [--export] [--help] [<devpath>]\n"
- " --usb-info use usb strings instead\n"
- " --num-info use numerical values\n"
- " --export print values as environment keys\n"
- " --help print this help text\n\n");
- default:
- retval = 1;
- goto exit;
- }
- }
-
- dev = udev_device_new_from_environment(udev);
- if (dev == NULL) {
- char syspath[UTIL_PATH_SIZE];
- const char *devpath;
-
- devpath = argv[optind];
- if (devpath == NULL) {
- fprintf(stderr, "missing device\n");
- retval = 1;
- goto exit;
- }
-
- util_strscpyl(syspath, sizeof(syspath), udev_get_sys_path(udev), devpath, NULL);
- dev = udev_device_new_from_syspath(udev, syspath);
- if (dev == NULL) {
- err(udev, "unable to access '%s'\n", devpath);
- retval = 1;
- goto exit;
- return 1;
- }
- }
-
- retval = usb_id(dev);
- if (retval == 0) {
- char serial[256];
- size_t l;
- char *s;
-
- s = serial;
- l = util_strpcpyl(&s, sizeof(serial), vendor_str, "_", model_str, NULL);
- if (serial_str[0] != '\0')
- l = util_strpcpyl(&s, l, "_", serial_str, NULL);
- if (instance_str[0] != '\0')
- util_strpcpyl(&s, l, "-", instance_str, NULL);
-
- if (export) {
- printf("ID_VENDOR=%s\n", vendor_str);
- printf("ID_VENDOR_ENC=%s\n", vendor_str_enc);
- printf("ID_VENDOR_ID=%s\n", vendor_id);
- printf("ID_MODEL=%s\n", model_str);
- printf("ID_MODEL_ENC=%s\n", model_str_enc);
- printf("ID_MODEL_ID=%s\n", product_id);
- printf("ID_REVISION=%s\n", revision_str);
- printf("ID_SERIAL=%s\n", serial);
- if (serial_str[0] != '\0')
- printf("ID_SERIAL_SHORT=%s\n", serial_str);
- if (type_str[0] != '\0')
- printf("ID_TYPE=%s\n", type_str);
- if (instance_str[0] != '\0')
- printf("ID_INSTANCE=%s\n", instance_str);
- printf("ID_BUS=usb\n");
- if (packed_if_str[0] != '\0')
- printf("ID_USB_INTERFACES=:%s\n", packed_if_str);
- if (ifnum != NULL)
- printf("ID_USB_INTERFACE_NUM=%s\n", ifnum);
- if (driver != NULL)
- printf("ID_USB_DRIVER=%s\n", driver);
- } else
- printf("%s\n", serial);
- }
-
-exit:
- udev_device_unref(dev);
- udev_unref(udev);
- udev_log_close();
- return retval;
+ s = serial;
+ l = util_strpcpyl(&s, sizeof(serial), vendor_str, "_", model_str, NULL);
+ if (serial_str[0] != '\0')
+ l = util_strpcpyl(&s, l, "_", serial_str, NULL);
+
+ if (instance_str[0] != '\0')
+ util_strpcpyl(&s, l, "-", instance_str, NULL);
+
+ udev_builtin_add_property(dev, test, "ID_VENDOR", vendor_str);
+ udev_builtin_add_property(dev, test, "ID_VENDOR_ENC", vendor_str_enc);
+ udev_builtin_add_property(dev, test, "ID_VENDOR_ID", vendor_id);
+ udev_builtin_add_property(dev, test, "ID_MODEL", model_str);
+ udev_builtin_add_property(dev, test, "ID_MODEL_ENC", model_str_enc);
+ udev_builtin_add_property(dev, test, "ID_MODEL_ID", product_id);
+ udev_builtin_add_property(dev, test, "ID_REVISION", revision_str);
+ udev_builtin_add_property(dev, test, "ID_SERIAL", serial);
+ if (serial_str[0] != '\0')
+ udev_builtin_add_property(dev, test, "ID_SERIAL_SHORT", serial_str);
+ if (type_str[0] != '\0')
+ udev_builtin_add_property(dev, test, "ID_TYPE", type_str);
+ if (instance_str[0] != '\0')
+ udev_builtin_add_property(dev, test, "ID_INSTANCE", instance_str);
+ udev_builtin_add_property(dev, test, "ID_BUS", "usb");
+ if (packed_if_str[0] != '\0')
+ udev_builtin_add_property(dev, test, "ID_USB_INTERFACES", packed_if_str);
+ if (ifnum != NULL)
+ udev_builtin_add_property(dev, test, "ID_USB_INTERFACE_NUM", ifnum);
+ if (driver != NULL)
+ udev_builtin_add_property(dev, test, "ID_USB_DRIVER", driver);
+ return EXIT_SUCCESS;
}
+
+const struct udev_builtin udev_builtin_usb_id = {
+ .name = "usb_id",
+ .cmd = builtin_usb_id,
+ .help = "usb device properties",
+};
--- /dev/null
+/*
+ * Copyright (C) 2007-2009 Kay Sievers <kay.sievers@vrfy.org>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <unistd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <stddef.h>
+#include <string.h>
+#include <errno.h>
+#include <getopt.h>
+
+#include "udev.h"
+
+static const struct udev_builtin *builtins[] = {
+ [UDEV_BUILTIN_PATH_ID] = &udev_builtin_path_id,
+ [UDEV_BUILTIN_USB_ID] = &udev_builtin_usb_id,
+ [UDEV_BUILTIN_INPUT_ID] = &udev_builtin_input_id,
+};
+
+int udev_builtin_list(struct udev *udev)
+{
+ unsigned int i;
+
+ for (i = 0; i < ARRAY_SIZE(builtins); i++)
+ fprintf(stderr, " %-12s %s\n", builtins[i]->name, builtins[i]->help);
+ return 0;
+}
+
+const char *udev_builtin_name(enum udev_builtin_cmd cmd)
+{
+ return builtins[cmd]->name;
+}
+
+enum udev_builtin_cmd udev_builtin_lookup(const char *name)
+{
+ enum udev_builtin_cmd i;
+
+ for (i = 0; i < ARRAY_SIZE(builtins); i++)
+ if (strcmp(builtins[i]->name, name) == 0)
+ return i;
+ return UDEV_BUILTIN_MAX;
+}
+
+int udev_builtin_run(struct udev_device *dev, enum udev_builtin_cmd cmd, bool test)
+{
+ return builtins[cmd]->cmd(dev, test);
+}
+
+int udev_builtin_add_property(struct udev_device *dev, bool test, const char *key, const char *val, ...)
+{
+ struct udev_list_entry *entry;
+
+ entry = udev_device_add_property(dev, key, val);
+ /* store in db, skip private keys */
+ if (key[0] != '.')
+ udev_list_entry_set_num(entry, true);
+
+ info(udev_device_get_udev(dev), "%s=%s\n", key, val);
+ if (test)
+ printf("%s=%s\n", key, val);
+ return 0;
+}
--- /dev/null
+/*
+ * libudev - interface to udev device information
+ *
+ * Copyright (C) 2008 Kay Sievers <kay.sievers@vrfy.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ */
+
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <stddef.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/poll.h>
+#include <sys/socket.h>
+#include <sys/un.h>
+
+#include "udev.h"
+
+/* wire protocol magic must match */
+#define UDEV_CTRL_MAGIC 0xdead1dea
+
+enum udev_ctrl_msg_type {
+ UDEV_CTRL_UNKNOWN,
+ UDEV_CTRL_SET_LOG_LEVEL,
+ UDEV_CTRL_STOP_EXEC_QUEUE,
+ UDEV_CTRL_START_EXEC_QUEUE,
+ UDEV_CTRL_RELOAD_RULES,
+ UDEV_CTRL_SET_ENV,
+ UDEV_CTRL_SET_CHILDREN_MAX,
+ UDEV_CTRL_PING,
+ UDEV_CTRL_EXIT,
+};
+
+struct udev_ctrl_msg_wire {
+ char version[16];
+ unsigned int magic;
+ enum udev_ctrl_msg_type type;
+ union {
+ int intval;
+ char buf[256];
+ };
+};
+
+struct udev_ctrl_msg {
+ int refcount;
+ struct udev_ctrl_connection *conn;
+ struct udev_ctrl_msg_wire ctrl_msg_wire;
+};
+
+struct udev_ctrl {
+ int refcount;
+ struct udev *udev;
+ int sock;
+ struct sockaddr_un saddr;
+ socklen_t addrlen;
+ bool bound;
+ bool cleanup_socket;
+ bool connected;
+};
+
+struct udev_ctrl_connection {
+ int refcount;
+ struct udev_ctrl *uctrl;
+ int sock;
+};
+
+struct udev_ctrl *udev_ctrl_new_from_fd(struct udev *udev, int fd)
+{
+ struct udev_ctrl *uctrl;
+
+ uctrl = calloc(1, sizeof(struct udev_ctrl));
+ if (uctrl == NULL)
+ return NULL;
+ uctrl->refcount = 1;
+ uctrl->udev = udev;
+
+ if (fd < 0) {
+ uctrl->sock = socket(AF_LOCAL, SOCK_SEQPACKET|SOCK_NONBLOCK|SOCK_CLOEXEC, 0);
+ if (uctrl->sock < 0) {
+ err(udev, "error getting socket: %m\n");
+ udev_ctrl_unref(uctrl);
+ return NULL;
+ }
+ } else {
+ uctrl->bound = true;
+ uctrl->sock = fd;
+ }
+
+ uctrl->saddr.sun_family = AF_LOCAL;
+ util_strscpyl(uctrl->saddr.sun_path, sizeof(uctrl->saddr.sun_path),
+ udev_get_run_path(udev), "/control", NULL);
+ uctrl->addrlen = offsetof(struct sockaddr_un, sun_path) + strlen(uctrl->saddr.sun_path);
+ return uctrl;
+}
+
+struct udev_ctrl *udev_ctrl_new(struct udev *udev)
+{
+ return udev_ctrl_new_from_fd(udev, -1);
+}
+
+int udev_ctrl_enable_receiving(struct udev_ctrl *uctrl)
+{
+ int err;
+
+ if (!uctrl->bound) {
+ err = bind(uctrl->sock, (struct sockaddr *)&uctrl->saddr, uctrl->addrlen);
+ if (err < 0 && errno == EADDRINUSE) {
+ unlink(uctrl->saddr.sun_path);
+ err = bind(uctrl->sock, (struct sockaddr *)&uctrl->saddr, uctrl->addrlen);
+ }
+
+ if (err < 0) {
+ err = -errno;
+ err(uctrl->udev, "bind failed: %m\n");
+ return err;
+ }
+
+ err = listen(uctrl->sock, 0);
+ if (err < 0) {
+ err = -errno;
+ err(uctrl->udev, "listen failed: %m\n");
+ return err;
+ }
+
+ uctrl->bound = true;
+ uctrl->cleanup_socket = true;
+ }
+ return 0;
+}
+
+struct udev *udev_ctrl_get_udev(struct udev_ctrl *uctrl)
+{
+ return uctrl->udev;
+}
+
+struct udev_ctrl *udev_ctrl_ref(struct udev_ctrl *uctrl)
+{
+ if (uctrl == NULL)
+ return NULL;
+ uctrl->refcount++;
+ return uctrl;
+}
+
+struct udev_ctrl *udev_ctrl_unref(struct udev_ctrl *uctrl)
+{
+ if (uctrl == NULL)
+ return NULL;
+ uctrl->refcount--;
+ if (uctrl->refcount > 0)
+ return uctrl;
+ if (uctrl->sock >= 0)
+ close(uctrl->sock);
+ free(uctrl);
+ return NULL;
+}
+
+int udev_ctrl_cleanup(struct udev_ctrl *uctrl)
+{
+ if (uctrl == NULL)
+ return 0;
+ if (uctrl->cleanup_socket)
+ unlink(uctrl->saddr.sun_path);
+ return 0;
+}
+
+int udev_ctrl_get_fd(struct udev_ctrl *uctrl)
+{
+ if (uctrl == NULL)
+ return -EINVAL;
+ return uctrl->sock;
+}
+
+struct udev_ctrl_connection *udev_ctrl_get_connection(struct udev_ctrl *uctrl)
+{
+ struct udev_ctrl_connection *conn;
+ struct ucred ucred;
+ socklen_t slen;
+ const int on = 1;
+
+ conn = calloc(1, sizeof(struct udev_ctrl_connection));
+ if (conn == NULL)
+ return NULL;
+ conn->refcount = 1;
+ conn->uctrl = uctrl;
+
+ conn->sock = accept4(uctrl->sock, NULL, NULL, SOCK_CLOEXEC|SOCK_NONBLOCK);
+ if (conn->sock < 0) {
+ if (errno != EINTR)
+ err(uctrl->udev, "unable to receive ctrl connection: %m\n");
+ goto err;
+ }
+
+ /* check peer credential of connection */
+ slen = sizeof(ucred);
+ if (getsockopt(conn->sock, SOL_SOCKET, SO_PEERCRED, &ucred, &slen) < 0) {
+ err(uctrl->udev, "unable to receive credentials of ctrl connection: %m\n");
+ goto err;
+ }
+ if (ucred.uid > 0) {
+ err(uctrl->udev, "sender uid=%i, message ignored\n", ucred.uid);
+ goto err;
+ }
+
+ /* enable receiving of the sender credentials in the messages */
+ setsockopt(conn->sock, SOL_SOCKET, SO_PASSCRED, &on, sizeof(on));
+ udev_ctrl_ref(uctrl);
+ return conn;
+err:
+ if (conn->sock >= 0)
+ close(conn->sock);
+ free(conn);
+ return NULL;
+}
+
+struct udev_ctrl_connection *udev_ctrl_connection_ref(struct udev_ctrl_connection *conn)
+{
+ if (conn == NULL)
+ return NULL;
+ conn->refcount++;
+ return conn;
+}
+
+struct udev_ctrl_connection *udev_ctrl_connection_unref(struct udev_ctrl_connection *conn)
+{
+ if (conn == NULL)
+ return NULL;
+ conn->refcount--;
+ if (conn->refcount > 0)
+ return conn;
+ if (conn->sock >= 0)
+ close(conn->sock);
+ udev_ctrl_unref(conn->uctrl);
+ free(conn);
+ return NULL;
+}
+
+static int ctrl_send(struct udev_ctrl *uctrl, enum udev_ctrl_msg_type type, int intval, const char *buf, int timeout)
+{
+ struct udev_ctrl_msg_wire ctrl_msg_wire;
+ int err = 0;
+
+ memset(&ctrl_msg_wire, 0x00, sizeof(struct udev_ctrl_msg_wire));
+ strcpy(ctrl_msg_wire.version, "udev-" VERSION);
+ ctrl_msg_wire.magic = UDEV_CTRL_MAGIC;
+ ctrl_msg_wire.type = type;
+
+ if (buf != NULL)
+ util_strscpy(ctrl_msg_wire.buf, sizeof(ctrl_msg_wire.buf), buf);
+ else
+ ctrl_msg_wire.intval = intval;
+
+ if (!uctrl->connected) {
+ if (connect(uctrl->sock, (struct sockaddr *)&uctrl->saddr, uctrl->addrlen) < 0) {
+ err = -errno;
+ goto out;
+ }
+ uctrl->connected = true;
+ }
+ if (send(uctrl->sock, &ctrl_msg_wire, sizeof(ctrl_msg_wire), 0) < 0) {
+ err = -errno;
+ goto out;
+ }
+
+ /* wait for peer message handling or disconnect */
+ for (;;) {
+ struct pollfd pfd[1];
+ int r;
+
+ pfd[0].fd = uctrl->sock;
+ pfd[0].events = POLLIN;
+ r = poll(pfd, 1, timeout * 1000);
+ if (r < 0) {
+ if (errno == EINTR)
+ continue;
+ err = -errno;
+ break;
+ }
+
+ if (r > 0 && pfd[0].revents & POLLERR) {
+ err = -EIO;
+ break;
+ }
+
+ if (r == 0)
+ err = -ETIMEDOUT;
+ break;
+ }
+out:
+ return err;
+}
+
+int udev_ctrl_send_set_log_level(struct udev_ctrl *uctrl, int priority, int timeout)
+{
+ return ctrl_send(uctrl, UDEV_CTRL_SET_LOG_LEVEL, priority, NULL, timeout);
+}
+
+int udev_ctrl_send_stop_exec_queue(struct udev_ctrl *uctrl, int timeout)
+{
+ return ctrl_send(uctrl, UDEV_CTRL_STOP_EXEC_QUEUE, 0, NULL, timeout);
+}
+
+int udev_ctrl_send_start_exec_queue(struct udev_ctrl *uctrl, int timeout)
+{
+ return ctrl_send(uctrl, UDEV_CTRL_START_EXEC_QUEUE, 0, NULL, timeout);
+}
+
+int udev_ctrl_send_reload_rules(struct udev_ctrl *uctrl, int timeout)
+{
+ return ctrl_send(uctrl, UDEV_CTRL_RELOAD_RULES, 0, NULL, timeout);
+}
+
+int udev_ctrl_send_set_env(struct udev_ctrl *uctrl, const char *key, int timeout)
+{
+ return ctrl_send(uctrl, UDEV_CTRL_SET_ENV, 0, key, timeout);
+}
+
+int udev_ctrl_send_set_children_max(struct udev_ctrl *uctrl, int count, int timeout)
+{
+ return ctrl_send(uctrl, UDEV_CTRL_SET_CHILDREN_MAX, count, NULL, timeout);
+}
+
+int udev_ctrl_send_ping(struct udev_ctrl *uctrl, int timeout)
+{
+ return ctrl_send(uctrl, UDEV_CTRL_PING, 0, NULL, timeout);
+}
+
+int udev_ctrl_send_exit(struct udev_ctrl *uctrl, int timeout)
+{
+ return ctrl_send(uctrl, UDEV_CTRL_EXIT, 0, NULL, timeout);
+}
+
+struct udev_ctrl_msg *udev_ctrl_receive_msg(struct udev_ctrl_connection *conn)
+{
+ struct udev *udev = conn->uctrl->udev;
+ struct udev_ctrl_msg *uctrl_msg;
+ ssize_t size;
+ struct msghdr smsg;
+ struct cmsghdr *cmsg;
+ struct iovec iov;
+ struct ucred *cred;
+ char cred_msg[CMSG_SPACE(sizeof(struct ucred))];
+
+ uctrl_msg = calloc(1, sizeof(struct udev_ctrl_msg));
+ if (uctrl_msg == NULL)
+ return NULL;
+ uctrl_msg->refcount = 1;
+ uctrl_msg->conn = conn;
+ udev_ctrl_connection_ref(conn);
+
+ /* wait for the incoming message */
+ for(;;) {
+ struct pollfd pfd[1];
+ int r;
+
+ pfd[0].fd = conn->sock;
+ pfd[0].events = POLLIN;
+
+ r = poll(pfd, 1, 10000);
+ if (r < 0) {
+ if (errno == EINTR)
+ continue;
+ goto err;
+ } else if (r == 0) {
+ err(udev, "timeout waiting for ctrl message\n");
+ goto err;
+ } else {
+ if (!(pfd[0].revents & POLLIN)) {
+ err(udev, "ctrl connection error: %m\n");
+ goto err;
+ }
+ }
+
+ break;
+ }
+
+ iov.iov_base = &uctrl_msg->ctrl_msg_wire;
+ iov.iov_len = sizeof(struct udev_ctrl_msg_wire);
+ memset(&smsg, 0x00, sizeof(struct msghdr));
+ smsg.msg_iov = &iov;
+ smsg.msg_iovlen = 1;
+ smsg.msg_control = cred_msg;
+ smsg.msg_controllen = sizeof(cred_msg);
+ size = recvmsg(conn->sock, &smsg, 0);
+ if (size < 0) {
+ err(udev, "unable to receive ctrl message: %m\n");
+ goto err;
+ }
+ cmsg = CMSG_FIRSTHDR(&smsg);
+ cred = (struct ucred *) CMSG_DATA(cmsg);
+
+ if (cmsg == NULL || cmsg->cmsg_type != SCM_CREDENTIALS) {
+ err(udev, "no sender credentials received, message ignored\n");
+ goto err;
+ }
+
+ if (cred->uid != 0) {
+ err(udev, "sender uid=%i, message ignored\n", cred->uid);
+ goto err;
+ }
+
+ if (uctrl_msg->ctrl_msg_wire.magic != UDEV_CTRL_MAGIC) {
+ err(udev, "message magic 0x%08x doesn't match, ignore it\n", uctrl_msg->ctrl_msg_wire.magic);
+ goto err;
+ }
+
+ dbg(udev, "created ctrl_msg %p (%i)\n", uctrl_msg, uctrl_msg->ctrl_msg_wire.type);
+ return uctrl_msg;
+err:
+ udev_ctrl_msg_unref(uctrl_msg);
+ return NULL;
+}
+
+struct udev_ctrl_msg *udev_ctrl_msg_ref(struct udev_ctrl_msg *ctrl_msg)
+{
+ if (ctrl_msg == NULL)
+ return NULL;
+ ctrl_msg->refcount++;
+ return ctrl_msg;
+}
+
+struct udev_ctrl_msg *udev_ctrl_msg_unref(struct udev_ctrl_msg *ctrl_msg)
+{
+ if (ctrl_msg == NULL)
+ return NULL;
+ ctrl_msg->refcount--;
+ if (ctrl_msg->refcount > 0)
+ return ctrl_msg;
+ dbg(ctrl_msg->conn->uctrl->udev, "release ctrl_msg %p\n", ctrl_msg);
+ udev_ctrl_connection_unref(ctrl_msg->conn);
+ free(ctrl_msg);
+ return NULL;
+}
+
+int udev_ctrl_get_set_log_level(struct udev_ctrl_msg *ctrl_msg)
+{
+ if (ctrl_msg->ctrl_msg_wire.type == UDEV_CTRL_SET_LOG_LEVEL)
+ return ctrl_msg->ctrl_msg_wire.intval;
+ return -1;
+}
+
+int udev_ctrl_get_stop_exec_queue(struct udev_ctrl_msg *ctrl_msg)
+{
+ if (ctrl_msg->ctrl_msg_wire.type == UDEV_CTRL_STOP_EXEC_QUEUE)
+ return 1;
+ return -1;
+}
+
+int udev_ctrl_get_start_exec_queue(struct udev_ctrl_msg *ctrl_msg)
+{
+ if (ctrl_msg->ctrl_msg_wire.type == UDEV_CTRL_START_EXEC_QUEUE)
+ return 1;
+ return -1;
+}
+
+int udev_ctrl_get_reload_rules(struct udev_ctrl_msg *ctrl_msg)
+{
+ if (ctrl_msg->ctrl_msg_wire.type == UDEV_CTRL_RELOAD_RULES)
+ return 1;
+ return -1;
+}
+
+const char *udev_ctrl_get_set_env(struct udev_ctrl_msg *ctrl_msg)
+{
+ if (ctrl_msg->ctrl_msg_wire.type == UDEV_CTRL_SET_ENV)
+ return ctrl_msg->ctrl_msg_wire.buf;
+ return NULL;
+}
+
+int udev_ctrl_get_set_children_max(struct udev_ctrl_msg *ctrl_msg)
+{
+ if (ctrl_msg->ctrl_msg_wire.type == UDEV_CTRL_SET_CHILDREN_MAX)
+ return ctrl_msg->ctrl_msg_wire.intval;
+ return -1;
+}
+
+int udev_ctrl_get_ping(struct udev_ctrl_msg *ctrl_msg)
+{
+ if (ctrl_msg->ctrl_msg_wire.type == UDEV_CTRL_PING)
+ return 1;
+ return -1;
+}
+
+int udev_ctrl_get_exit(struct udev_ctrl_msg *ctrl_msg)
+{
+ if (ctrl_msg->ctrl_msg_wire.type == UDEV_CTRL_EXIT)
+ return 1;
+ return -1;
+}
#include <time.h>
#include <net/if.h>
#include <sys/ioctl.h>
+#include <sys/prctl.h>
+#include <sys/poll.h>
+#include <sys/epoll.h>
+#include <sys/wait.h>
#include <sys/socket.h>
+#include <sys/signalfd.h>
#include <linux/sockios.h>
#include "udev.h"
struct udev_event *udev_event_new(struct udev_device *dev)
{
+ struct udev *udev = udev_device_get_udev(dev);
struct udev_event *event;
event = calloc(1, sizeof(struct udev_event));
if (event == NULL)
return NULL;
- event->mode = 0600;
event->dev = dev;
- event->udev = udev_device_get_udev(dev);
- udev_list_init(&event->run_list);
+ event->udev = udev;
+ udev_list_init(udev, &event->run_list, false);
+ event->fd_signal = -1;
+ event->birth_usec = now_usec();
+ event->timeout_usec = 60 * 1000 * 1000;
dbg(event->udev, "allocated event %p\n", event);
return event;
}
{
if (event == NULL)
return;
- udev_list_cleanup_entries(event->udev, &event->run_list);
+ udev_list_cleanup(&event->run_list);
free(event->tmp_node);
free(event->program_result);
free(event->name);
- free(event->smack);
dbg(event->udev, "free event %p\n", event);
free(event);
}
len = strlen(vbuf);
while (len > 0 && isspace(vbuf[--len]))
vbuf[len] = '\0';
- count = udev_util_replace_chars(vbuf, UDEV_ALLOWED_CHARS_INPUT);
+ count = util_replace_chars(vbuf, UDEV_ALLOWED_CHARS_INPUT);
if (count > 0)
info(event->udev, "%i character(s) replaced\n" , count);
l = util_strpcpy(&s, l, vbuf);
minor(udev_device_get_devnum(dev)));
if (event->tmp_node == NULL)
break;
- udev_node_mknod(dev, event->tmp_node, 0600, 0, 0, NULL);
+ udev_node_mknod(dev, event->tmp_node, 0600, 0, 0);
l = util_strpcpy(&s, l, event->tmp_node);
break;
}
return l;
}
+static int spawn_exec(struct udev_event *event,
+ const char *cmd, char *const argv[], char **envp, const sigset_t *sigmask,
+ int fd_stdout, int fd_stderr)
+{
+ struct udev *udev = event->udev;
+ int err;
+ int fd;
+
+ /* discard child output or connect to pipe */
+ fd = open("/dev/null", O_RDWR);
+ if (fd >= 0) {
+ dup2(fd, STDIN_FILENO);
+ if (fd_stdout < 0)
+ dup2(fd, STDOUT_FILENO);
+ if (fd_stderr < 0)
+ dup2(fd, STDERR_FILENO);
+ close(fd);
+ } else {
+ err(udev, "open /dev/null failed: %m\n");
+ }
+
+ /* connect pipes to std{out,err} */
+ if (fd_stdout >= 0) {
+ dup2(fd_stdout, STDOUT_FILENO);
+ close(fd_stdout);
+ }
+ if (fd_stderr >= 0) {
+ dup2(fd_stderr, STDERR_FILENO);
+ close(fd_stderr);
+ }
+
+ /* terminate child in case parent goes away */
+ prctl(PR_SET_PDEATHSIG, SIGTERM);
+
+ /* restore original udev sigmask before exec */
+ if (sigmask)
+ sigprocmask(SIG_SETMASK, sigmask, NULL);
+
+ execve(argv[0], argv, envp);
+
+ /* exec failed */
+ err = -errno;
+ err(udev, "failed to execute '%s' '%s': %m\n", argv[0], cmd);
+ return err;
+}
+
+static int spawn_read(struct udev_event *event,
+ const char *cmd,
+ int fd_stdout, int fd_stderr,
+ char *result, size_t ressize)
+{
+ struct udev *udev = event->udev;
+ size_t respos = 0;
+ int fd_ep = -1;
+ struct epoll_event ep_outpipe, ep_errpipe;
+ int err = 0;
+
+ /* read from child if requested */
+ if (fd_stdout < 0 && fd_stderr < 0)
+ return 0;
+
+ fd_ep = epoll_create1(EPOLL_CLOEXEC);
+ if (fd_ep < 0) {
+ err = -errno;
+ err(udev, "error creating epoll fd: %m\n");
+ goto out;
+ }
+
+ if (fd_stdout >= 0) {
+ memset(&ep_outpipe, 0, sizeof(struct epoll_event));
+ ep_outpipe.events = EPOLLIN;
+ ep_outpipe.data.ptr = &fd_stdout;
+ if (epoll_ctl(fd_ep, EPOLL_CTL_ADD, fd_stdout, &ep_outpipe) < 0) {
+ err(udev, "fail to add fd to epoll: %m\n");
+ goto out;
+ }
+ }
+
+ if (fd_stderr >= 0) {
+ memset(&ep_errpipe, 0, sizeof(struct epoll_event));
+ ep_errpipe.events = EPOLLIN;
+ ep_errpipe.data.ptr = &fd_stderr;
+ if (epoll_ctl(fd_ep, EPOLL_CTL_ADD, fd_stderr, &ep_errpipe) < 0) {
+ err(udev, "fail to add fd to epoll: %m\n");
+ goto out;
+ }
+ }
+
+ /* read child output */
+ while (fd_stdout >= 0 || fd_stderr >= 0) {
+ int timeout;
+ int fdcount;
+ struct epoll_event ev[4];
+ int i;
+
+ if (event->timeout_usec > 0) {
+ unsigned long long age_usec;
+
+ age_usec = now_usec() - event->birth_usec;
+ if (age_usec >= event->timeout_usec) {
+ err = -ETIMEDOUT;
+ err(udev, "timeout '%s'\n", cmd);
+ goto out;
+ }
+ timeout = ((event->timeout_usec - age_usec) / 1000) + 1000;
+ } else {
+ timeout = -1;
+ }
+
+ fdcount = epoll_wait(fd_ep, ev, ARRAY_SIZE(ev), timeout);
+ if (fdcount < 0) {
+ if (errno == EINTR)
+ continue;
+ err = -errno;
+ err(udev, "failed to poll: %m\n");
+ goto out;
+ }
+ if (fdcount == 0) {
+ err = -ETIMEDOUT;
+ err(udev, "timeout '%s'\n", cmd);
+ goto out;
+ }
+
+ for (i = 0; i < fdcount; i++) {
+ int *fd = (int *)ev[i].data.ptr;
+
+ if (ev[i].events & EPOLLIN) {
+ ssize_t count;
+ char buf[4096];
+
+ count = read(*fd, buf, sizeof(buf)-1);
+ if (count <= 0)
+ continue;
+ buf[count] = '\0';
+
+ /* store stdout result */
+ if (result != NULL && *fd == fd_stdout) {
+ if (respos + count < ressize) {
+ memcpy(&result[respos], buf, count);
+ respos += count;
+ } else {
+ err(udev, "'%s' ressize %zd too short\n", cmd, ressize);
+ err = -ENOBUFS;
+ }
+ }
+
+ /* log debug output only if we watch stderr */
+ if (fd_stderr >= 0) {
+ char *pos;
+ char *line;
+
+ pos = buf;
+ while ((line = strsep(&pos, "\n"))) {
+ if (pos != NULL || line[0] != '\0')
+ info(udev, "'%s'(%s) '%s'\n", cmd, *fd == fd_stdout ? "out" : "err" , line);
+ }
+ }
+ } else if (ev[i].events & EPOLLHUP) {
+ if (epoll_ctl(fd_ep, EPOLL_CTL_DEL, *fd, NULL) < 0) {
+ err = -errno;
+ err(udev, "failed to remove fd from epoll: %m\n");
+ goto out;
+ }
+ *fd = -1;
+ }
+ }
+ }
+
+ /* return the child's stdout string */
+ if (result != NULL) {
+ result[respos] = '\0';
+ dbg(udev, "result='%s'\n", result);
+ }
+out:
+ if (fd_ep >= 0)
+ close(fd_ep);
+ return err;
+}
+
+static int spawn_wait(struct udev_event *event, const char *cmd, pid_t pid)
+{
+ struct udev *udev = event->udev;
+ struct pollfd pfd[1];
+ int err = 0;
+
+ pfd[0].events = POLLIN;
+ pfd[0].fd = event->fd_signal;
+
+ while (pid > 0) {
+ int timeout;
+ int fdcount;
+
+ if (event->timeout_usec > 0) {
+ unsigned long long age_usec;
+
+ age_usec = now_usec() - event->birth_usec;
+ if (age_usec >= event->timeout_usec)
+ timeout = 1000;
+ else
+ timeout = ((event->timeout_usec - age_usec) / 1000) + 1000;
+ } else {
+ timeout = -1;
+ }
+
+ fdcount = poll(pfd, 1, timeout);
+ if (fdcount < 0) {
+ if (errno == EINTR)
+ continue;
+ err = -errno;
+ err(udev, "failed to poll: %m\n");
+ goto out;
+ }
+ if (fdcount == 0) {
+ err(udev, "timeout: killing '%s' [%u]\n", cmd, pid);
+ kill(pid, SIGKILL);
+ }
+
+ if (pfd[0].revents & POLLIN) {
+ struct signalfd_siginfo fdsi;
+ int status;
+ ssize_t size;
+
+ size = read(event->fd_signal, &fdsi, sizeof(struct signalfd_siginfo));
+ if (size != sizeof(struct signalfd_siginfo))
+ continue;
+
+ switch (fdsi.ssi_signo) {
+ case SIGTERM:
+ event->sigterm = true;
+ break;
+ case SIGCHLD:
+ if (waitpid(pid, &status, WNOHANG) < 0)
+ break;
+ if (WIFEXITED(status)) {
+ info(udev, "'%s' [%u] exit with return code %i\n", cmd, pid, WEXITSTATUS(status));
+ if (WEXITSTATUS(status) != 0)
+ err = -1;
+ } else if (WIFSIGNALED(status)) {
+ err(udev, "'%s' [%u] terminated by signal %i (%s)\n", cmd, pid, WTERMSIG(status), strsignal(WTERMSIG(status)));
+ err = -1;
+ } else if (WIFSTOPPED(status)) {
+ err(udev, "'%s' [%u] stopped\n", cmd, pid);
+ err = -1;
+ } else if (WIFCONTINUED(status)) {
+ err(udev, "'%s' [%u] continued\n", cmd, pid);
+ err = -1;
+ } else {
+ err(udev, "'%s' [%u] exit with status 0x%04x\n", cmd, pid, status);
+ err = -1;
+ }
+ pid = 0;
+ break;
+ }
+ }
+ }
+out:
+ return err;
+}
+
+int udev_event_spawn(struct udev_event *event,
+ const char *cmd, char **envp, const sigset_t *sigmask,
+ char *result, size_t ressize)
+{
+ struct udev *udev = event->udev;
+ int outpipe[2] = {-1, -1};
+ int errpipe[2] = {-1, -1};
+ pid_t pid;
+ char arg[UTIL_PATH_SIZE];
+ char program[UTIL_PATH_SIZE];
+ char *argv[((sizeof(arg) + 1) / 2) + 1];
+ int i;
+ int err = 0;
+
+ /* build argv from command */
+ util_strscpy(arg, sizeof(arg), cmd);
+ i = 0;
+ if (strchr(arg, ' ') != NULL) {
+ char *pos = arg;
+
+ while (pos != NULL && pos[0] != '\0') {
+ if (pos[0] == '\'') {
+ /* do not separate quotes */
+ pos++;
+ argv[i] = strsep(&pos, "\'");
+ if (pos != NULL)
+ while (pos[0] == ' ')
+ pos++;
+ } else {
+ argv[i] = strsep(&pos, " ");
+ if (pos != NULL)
+ while (pos[0] == ' ')
+ pos++;
+ }
+ dbg(udev, "arg[%i] '%s'\n", i, argv[i]);
+ i++;
+ }
+ argv[i] = NULL;
+ } else {
+ argv[0] = arg;
+ argv[1] = NULL;
+ }
+
+ /* pipes from child to parent */
+ if (result != NULL || udev_get_log_priority(udev) >= LOG_INFO) {
+ if (pipe2(outpipe, O_NONBLOCK) != 0) {
+ err = -errno;
+ err(udev, "pipe failed: %m\n");
+ goto out;
+ }
+ }
+ if (udev_get_log_priority(udev) >= LOG_INFO) {
+ if (pipe2(errpipe, O_NONBLOCK) != 0) {
+ err = -errno;
+ err(udev, "pipe failed: %m\n");
+ goto out;
+ }
+ }
+
+ /* allow programs in /lib/udev/ to be called without the path */
+ if (argv[0][0] != '/') {
+ util_strscpyl(program, sizeof(program), LIBEXECDIR "/", argv[0], NULL);
+ argv[0] = program;
+ }
+
+ pid = fork();
+ switch(pid) {
+ case 0:
+ /* child closes parent's ends of pipes */
+ if (outpipe[READ_END] >= 0) {
+ close(outpipe[READ_END]);
+ outpipe[READ_END] = -1;
+ }
+ if (errpipe[READ_END] >= 0) {
+ close(errpipe[READ_END]);
+ errpipe[READ_END] = -1;
+ }
+
+ info(udev, "starting '%s'\n", cmd);
+
+ err = spawn_exec(event, cmd, argv, envp, sigmask,
+ outpipe[WRITE_END], errpipe[WRITE_END]);
+
+ _exit(2 );
+ case -1:
+ err(udev, "fork of '%s' failed: %m\n", cmd);
+ err = -1;
+ goto out;
+ default:
+ /* parent closed child's ends of pipes */
+ if (outpipe[WRITE_END] >= 0) {
+ close(outpipe[WRITE_END]);
+ outpipe[WRITE_END] = -1;
+ }
+ if (errpipe[WRITE_END] >= 0) {
+ close(errpipe[WRITE_END]);
+ errpipe[WRITE_END] = -1;
+ }
+
+ err = spawn_read(event, cmd,
+ outpipe[READ_END], errpipe[READ_END],
+ result, ressize);
+
+ err = spawn_wait(event, cmd, pid);
+ }
+
+out:
+ if (outpipe[READ_END] >= 0)
+ close(outpipe[READ_END]);
+ if (outpipe[WRITE_END] >= 0)
+ close(outpipe[WRITE_END]);
+ if (errpipe[READ_END] >= 0)
+ close(errpipe[READ_END]);
+ if (errpipe[WRITE_END] >= 0)
+ close(errpipe[WRITE_END]);
+ return err;
+}
+
static void rename_netif_kernel_log(struct ifreq ifr)
{
int klog;
return;
}
- fprintf(f, "<6>udev[%u]: renamed network interface %s to %s\n",
+ fprintf(f, "<30>udevd[%u]: renamed network interface %s to %s\n",
getpid(), ifr.ifr_name, ifr.ifr_newname);
fclose(f);
}
goto out;
/* free our own name, another process may wait for us */
- util_strscpyl(ifr.ifr_newname, IFNAMSIZ, udev_device_get_sysname(dev), "-", event->name, NULL);
+ snprintf(ifr.ifr_newname, IFNAMSIZ, "rename%u", udev_device_get_ifindex(dev));
err = ioctl(sk, SIOCSIFNAME, &ifr);
if (err < 0) {
err = -errno;
return err;
}
-int udev_event_execute_rules(struct udev_event *event, struct udev_rules *rules)
+int udev_event_execute_rules(struct udev_event *event, struct udev_rules *rules, const sigset_t *sigmask)
{
struct udev_device *dev = event->dev;
int err = 0;
return -1;
if (strcmp(udev_device_get_action(dev), "remove") == 0) {
- udev_device_read_db(dev);
+ udev_device_read_db(dev, NULL);
udev_device_delete_db(dev);
udev_device_tag_index(dev, NULL, false);
if (major(udev_device_get_devnum(dev)) != 0)
udev_watch_end(event->udev, dev);
- udev_rules_apply_to_event(rules, event);
+ udev_rules_apply_to_event(rules, event, sigmask);
if (major(udev_device_get_devnum(dev)) != 0)
err = udev_node_remove(dev);
} else {
event->dev_db = udev_device_new_from_syspath(event->udev, udev_device_get_syspath(dev));
if (event->dev_db != NULL) {
- udev_device_read_db(event->dev_db);
+ udev_device_read_db(event->dev_db, NULL);
udev_device_set_info_loaded(event->dev_db);
/* disable watch during event processing */
udev_watch_end(event->udev, event->dev_db);
}
- udev_rules_apply_to_event(rules, event);
+ udev_rules_apply_to_event(rules, event, sigmask);
/* rename a new network interface, if needed */
if (udev_device_get_ifindex(dev) > 0 && strcmp(udev_device_get_action(dev), "add") == 0 &&
if (err == 0) {
info(event->udev, "renamed netif to '%s'\n", event->name);
- /* delete stale db file */
- udev_device_delete_db(dev);
- udev_device_tag_index(dev, NULL, false);
-
/* remember old name */
udev_device_add_property(dev, "INTERFACE_OLD", udev_device_get_sysname(dev));
if (event->dev_db != NULL)
udev_node_update_old_links(dev, event->dev_db);
- /* change default 0600 to 0660 if a group is assigned */
- if (event->mode == 0600 && event->gid > 0)
- event->mode = 0660;
+ if (!event->mode_set) {
+ if (udev_device_get_devnode_mode(dev) > 0) {
+ /* kernel supplied value */
+ event->mode = udev_device_get_devnode_mode(dev);
+ } else if (event->gid > 0) {
+ /* default 0660 if a group is assigned */
+ event->mode = 0660;
+ } else {
+ /* default 0600 */
+ event->mode = 0600;
+ }
+ }
+
+ /* set sticky bit, so we do not remove the node on module unload */
+ if (event->static_node)
+ event->mode |= 01000;
- err = udev_node_add(dev, event->mode, event->uid, event->gid, event->smack);
+ err = udev_node_add(dev, event->mode, event->uid, event->gid);
}
/* preserve old, or get new initialization timestamp */
if (event->dev_db != NULL && udev_device_get_usec_initialized(event->dev_db) > 0)
udev_device_set_usec_initialized(event->dev, udev_device_get_usec_initialized(event->dev_db));
- else
- udev_device_set_usec_initialized(event->dev, usec_monotonic());
+ else if (udev_device_get_usec_initialized(event->dev) == 0)
+ udev_device_set_usec_initialized(event->dev, now_usec());
/* (re)write database file */
udev_device_update_db(dev);
char program[UTIL_PATH_SIZE];
char **envp;
- udev_event_apply_format(event, cmd, program, sizeof(program));
- envp = udev_device_get_properties_envp(event->dev);
if (event->exec_delay > 0) {
info(event->udev, "delay execution of '%s'\n", program);
sleep(event->exec_delay);
}
- if (util_run_program(event->udev, program, envp, NULL, 0, NULL, sigmask, true) != 0) {
- if (udev_list_entry_get_flags(list_entry))
+
+ udev_event_apply_format(event, cmd, program, sizeof(program));
+ envp = udev_device_get_properties_envp(event->dev);
+ if (udev_event_spawn(event, program, envp, sigmask, NULL, 0) < 0) {
+ if (udev_list_entry_get_num(list_entry))
err = -1;
}
}
#include <sys/time.h>
#include <sys/stat.h>
#include <sys/types.h>
-#include <sys/xattr.h>
#include "udev.h"
#define TMP_FILE_EXT ".udev-tmp"
-int udev_node_mknod(struct udev_device *dev, const char *file, mode_t mode, uid_t uid, gid_t gid, const char *smack)
+int udev_node_mknod(struct udev_device *dev, const char *file, mode_t mode, uid_t uid, gid_t gid)
{
struct udev *udev = udev_device_get_udev(dev);
dev_t devnum = udev_device_get_devnum(dev);
if (lstat(file, &stats) == 0) {
if (((stats.st_mode & S_IFMT) == (mode & S_IFMT)) && (stats.st_rdev == devnum)) {
info(udev, "preserve file '%s', because it has correct dev_t\n", file);
- if (stats.st_mode != mode || stats.st_uid != uid || stats.st_gid != gid) {
+ if ((stats.st_mode & 0777) != (mode & 0777) || stats.st_uid != uid || stats.st_gid != gid) {
+ /* preserve 'sticky' bit, if already set */
+ mode |= stats.st_mode & 01000;
info(udev, "set permissions %s, %#o, uid=%u, gid=%u\n", file, mode, uid, gid);
chmod(file, mode);
chown(file, uid, gid);
} else {
info(udev, "mknod '%s' %u:%u %#o\n", file, major(devnum), minor(devnum), mode);
do {
- err = util_create_path(udev, file);
+ err = util_create_path_selinux(udev, file);
if (err != 0 && err != -ENOENT)
break;
udev_selinux_setfscreatecon(udev, file, mode);
err = -errno;
udev_selinux_resetfscreatecon(udev);
} while (err == -ENOENT);
- if (err != 0)
+ if (err != 0 && err != -EEXIST)
err(udev, "mknod '%s' %u:%u %#o' failed: %m\n", file, major(devnum), minor(devnum), mode);
info(udev, "set permissions '%s' %#o uid=%u gid=%u\n", file, mode, uid, gid);
chmod(file, mode);
chown(file, uid, gid);
}
-
- if (smack != NULL) {
- err = lsetxattr(file, "security.SMACK64", smack, strlen(smack) + 1, 0);
- if (err != 0)
- err = -errno;
- }
-
exit:
return err;
}
} else {
info(udev, "creating symlink '%s' to '%s'\n", slink, target);
do {
- err = util_create_path(udev, slink);
+ err = util_create_path_selinux(udev, slink);
if (err != 0 && err != -ENOENT)
break;
udev_selinux_setfscreatecon(udev, slink, S_IFLNK);
util_strscpyl(slink_tmp, sizeof(slink_tmp), slink, TMP_FILE_EXT, NULL);
unlink(slink_tmp);
do {
- err = util_create_path(udev, slink_tmp);
+ err = util_create_path_selinux(udev, slink_tmp);
if (err != 0 && err != -ENOENT)
break;
udev_selinux_setfscreatecon(udev, slink_tmp, S_IFLNK);
dbg(udev, "update symlink '%s' of '%s'\n", slink, udev_device_get_syspath(dev));
util_path_encode(&slink[strlen(udev_get_dev_path(udev))+1], name_enc, sizeof(name_enc));
- util_strscpyl(dirname, sizeof(dirname), udev_get_dev_path(udev), "/.udev/links/", name_enc, NULL);
+ util_strscpyl(dirname, sizeof(dirname), udev_get_run_path(udev), "/links/", name_enc, NULL);
util_strscpyl(filename, sizeof(filename), dirname, "/", udev_device_get_id_filename(dev), NULL);
if (!add) {
}
}
-int udev_node_add(struct udev_device *dev, mode_t mode, uid_t uid, gid_t gid, const char *smack)
+int udev_node_add(struct udev_device *dev, mode_t mode, uid_t uid, gid_t gid)
{
struct udev *udev = udev_device_get_udev(dev);
char filename[UTIL_PATH_SIZE];
major(udev_device_get_devnum(dev)), minor(udev_device_get_devnum(dev)),
mode, uid, gid);
- if (udev_node_mknod(dev, NULL, mode, uid, gid, smack) != 0) {
+ if (udev_node_mknod(dev, NULL, mode, uid, gid) != 0) {
err = -1;
goto exit;
}
/* create/update symlinks, add symlinks to name index */
udev_list_entry_foreach(list_entry, udev_device_get_devlinks_list_entry(dev)) {
- if (udev_list_entry_get_flags(list_entry))
+ if (udev_list_entry_get_num(list_entry))
/* simple unmanaged link name */
node_symlink(udev, udev_device_get_devnode(dev), udev_list_entry_get_name(list_entry));
else
goto out;
}
+ if (stats.st_mode & 01000) {
+ info(udev, "device node '%s' has sticky bit set, skip removal\n", devnode);
+ goto out;
+ }
+
dev_check = udev_device_new_from_syspath(udev, udev_device_get_syspath(dev));
if (dev_check != NULL) {
/* do not remove device node if the same sys-device is re-created in the meantime */
#define PREALLOC_STRBUF 32 * 1024
#define PREALLOC_TRIE 256
-#define SMK_MAXLEN 23
-
struct uid_gid {
unsigned int name_off;
union {
TK_M_SUBSYSTEMS, /* val */
TK_M_DRIVERS, /* val */
TK_M_ATTRS, /* val, attr */
+ TK_M_TAGS, /* val */
TK_M_PARENTS_MAX,
TK_M_TEST, /* val, mode_t */
+ TK_M_EVENT_TIMEOUT, /* int */
TK_M_PROGRAM, /* val */
TK_M_IMPORT_FILE, /* val */
TK_M_IMPORT_PROG, /* val */
+ TK_M_IMPORT_BUILTIN, /* val */
TK_M_IMPORT_DB, /* val */
TK_M_IMPORT_CMDLINE, /* val */
TK_M_IMPORT_PARENT, /* val */
TK_A_STRING_ESCAPE_NONE,
TK_A_STRING_ESCAPE_REPLACE,
+ TK_A_DB_PERSIST,
TK_A_INOTIFY_WATCH, /* int */
TK_A_DEVLINK_PRIO, /* int */
TK_A_OWNER, /* val */
TK_A_TAG, /* val */
TK_A_NAME, /* val */
TK_A_DEVLINK, /* val */
- TK_A_EVENT_TIMEOUT, /* int */
TK_A_ATTR, /* val, attr */
TK_A_RUN, /* val, bool */
TK_A_GOTO, /* size_t */
- TK_A_SMACK, /* val */
TK_END,
};
union {
unsigned int attr_off;
int devlink_unique;
- int fail_on_error;
unsigned int rule_goto;
mode_t mode;
uid_t uid;
int devlink_prio;
int event_timeout;
int watch;
+ enum udev_builtin_cmd builtin_cmd;
};
} key;
};
[TK_M_SUBSYSTEMS] = "M SUBSYSTEMS",
[TK_M_DRIVERS] = "M DRIVERS",
[TK_M_ATTRS] = "M ATTRS",
+ [TK_M_TAGS] = "M TAGS",
[TK_M_PARENTS_MAX] = "M PARENTS_MAX",
[TK_M_TEST] = "M TEST",
+ [TK_M_EVENT_TIMEOUT] = "M EVENT_TIMEOUT",
[TK_M_PROGRAM] = "M PROGRAM",
[TK_M_IMPORT_FILE] = "M IMPORT_FILE",
[TK_M_IMPORT_PROG] = "M IMPORT_PROG",
+ [TK_M_IMPORT_BUILTIN] = "M IMPORT_BUILTIN",
[TK_M_IMPORT_DB] = "M IMPORT_DB",
[TK_M_IMPORT_CMDLINE] = "M IMPORT_CMDLINE",
[TK_M_IMPORT_PARENT] = "M IMPORT_PARENT",
[TK_A_STRING_ESCAPE_NONE] = "A STRING_ESCAPE_NONE",
[TK_A_STRING_ESCAPE_REPLACE] = "A STRING_ESCAPE_REPLACE",
+ [TK_A_DB_PERSIST] = "A DB_PERSIST",
[TK_A_INOTIFY_WATCH] = "A INOTIFY_WATCH",
[TK_A_DEVLINK_PRIO] = "A DEVLINK_PRIO",
[TK_A_OWNER] = "A OWNER",
[TK_A_TAG] = "A ENV",
[TK_A_NAME] = "A NAME",
[TK_A_DEVLINK] = "A DEVLINK",
- [TK_A_EVENT_TIMEOUT] = "A EVENT_TIMEOUT",
[TK_A_ATTR] = "A ATTR",
[TK_A_RUN] = "A RUN",
[TK_A_GOTO] = "A GOTO",
case TK_M_KERNELS:
case TK_M_SUBSYSTEMS:
case TK_M_DRIVERS:
+ case TK_M_TAGS:
case TK_M_PROGRAM:
case TK_M_IMPORT_FILE:
case TK_M_IMPORT_PROG:
dbg(rules->udev, "%s %s '%s'(%s)\n",
token_str(type), operation_str(op), value, string_glob_str(glob));
break;
+ case TK_M_IMPORT_BUILTIN:
+ dbg(rules->udev, "%s %i\n", token_str(type), token->key.builtin_cmd);
+ break;
case TK_M_ATTR:
case TK_M_ATTRS:
case TK_M_ENV:
break;
case TK_A_STRING_ESCAPE_NONE:
case TK_A_STRING_ESCAPE_REPLACE:
+ case TK_A_DB_PERSIST:
dbg(rules->udev, "%s\n", token_str(type));
break;
case TK_M_TEST:
case TK_A_STATIC_NODE:
dbg(rules->udev, "%s '%s'\n", token_str(type), value);
break;
- case TK_A_EVENT_TIMEOUT:
+ case TK_M_EVENT_TIMEOUT:
dbg(rules->udev, "%s %u\n", token_str(type), token->key.event_timeout);
break;
case TK_A_GOTO:
entry = udev_device_add_property(dev, key, val);
/* store in db, skip private keys */
if (key[0] != '.')
- udev_list_entry_set_flags(entry, 1);
+ udev_list_entry_set_num(entry, true);
}
return 0;
}
return 0;
}
-static int import_program_into_properties(struct udev_device *dev, const char *program)
+static int import_program_into_properties(struct udev_event *event, const char *program, const sigset_t *sigmask)
{
- struct udev *udev = udev_device_get_udev(dev);
+ struct udev_device *dev = event->dev;
char **envp;
char result[UTIL_LINE_SIZE];
- size_t reslen;
char *line;
+ int err;
envp = udev_device_get_properties_envp(dev);
- if (util_run_program(udev, program, envp, result, sizeof(result), &reslen, NULL, false) != 0)
- return -1;
+ err = udev_event_spawn(event, program, envp, sigmask, result, sizeof(result));
+ if (err < 0)
+ return err;
line = result;
while (line != NULL) {
entry = udev_device_add_property(dev, key, val);
/* store in db, skip private keys */
if (key[0] != '.')
- udev_list_entry_set_flags(entry, 1);
+ udev_list_entry_set_num(entry, true);
}
}
return 0;
case TK_M_KERNELS:
case TK_M_SUBSYSTEMS:
case TK_M_DRIVERS:
+ case TK_M_TAGS:
case TK_M_PROGRAM:
case TK_M_IMPORT_FILE:
case TK_M_IMPORT_PROG:
case TK_A_GOTO:
case TK_M_TAG:
case TK_A_TAG:
- case TK_A_SMACK:
token->key.value_off = add_string(rule_tmp->rules, value);
break;
+ case TK_M_IMPORT_BUILTIN:
+ token->key.builtin_cmd = *(enum udev_builtin_cmd *)data;
+ break;
case TK_M_ENV:
case TK_M_ATTR:
case TK_M_ATTRS:
break;
case TK_A_STRING_ESCAPE_NONE:
case TK_A_STRING_ESCAPE_REPLACE:
+ case TK_A_DB_PERSIST:
break;
case TK_A_RUN:
token->key.value_off = add_string(rule_tmp->rules, value);
- token->key.fail_on_error = *(int *)data;
break;
case TK_A_INOTIFY_WATCH:
case TK_A_DEVLINK_PRIO:
case TK_A_STATIC_NODE:
token->key.value_off = add_string(rule_tmp->rules, value);
break;
- case TK_A_EVENT_TIMEOUT:
+ case TK_M_EVENT_TIMEOUT:
token->key.event_timeout = *(int *)data;
break;
case TK_RULE:
char *linepos;
char *attr;
struct rule_tmp rule_tmp;
- bool bus_warn = false;
- bool sysfs_warn = false;
- bool id_warn = false;
memset(&rule_tmp, 0x00, sizeof(struct rule_tmp));
rule_tmp.rules = rules;
continue;
}
- if (strcmp(key, "ID") == 0) {
- if (!id_warn) {
- id_warn = true;
- err(rules->udev, "ID= will be removed in a future udev version, "
- "please use KERNEL= to match the event device, or KERNELS= "
- "to match a parent device, in %s:%u\n", filename, lineno);
- }
- if (op > OP_MATCH_MAX) {
- err(rules->udev, "invalid KERNELS operation\n");
- goto invalid;
- }
- rule_add_key(&rule_tmp, TK_M_KERNELS, op, value, NULL);
- continue;
- }
-
if (strcmp(key, "SUBSYSTEMS") == 0) {
if (op > OP_MATCH_MAX) {
err(rules->udev, "invalid SUBSYSTEMS operation\n");
continue;
}
- if (strcmp(key, "BUS") == 0) {
- if (!bus_warn) {
- bus_warn = true;
- err(rules->udev, "BUS= will be removed in a future udev version, "
- "please use SUBSYSTEM= to match the event device, or SUBSYSTEMS= "
- "to match a parent device, in %s:%u\n", filename, lineno);
- }
- if (op > OP_MATCH_MAX) {
- err(rules->udev, "invalid SUBSYSTEMS operation\n");
- goto invalid;
- }
- rule_add_key(&rule_tmp, TK_M_SUBSYSTEMS, op, value, NULL);
- continue;
- }
-
if (strcmp(key, "DRIVERS") == 0) {
if (op > OP_MATCH_MAX) {
err(rules->udev, "invalid DRIVERS operation\n");
continue;
}
- if (strncmp(key, "SYSFS{", sizeof("SYSFS{")-1) == 0) {
- if (!sysfs_warn) {
- sysfs_warn = true;
- err(rules->udev, "SYSFS{}= will be removed in a future udev version, "
- "please use ATTR{}= to match the event device, or ATTRS{}= "
- "to match a parent device, in %s:%u\n", filename, lineno);
- }
+ if (strcmp(key, "TAGS") == 0) {
if (op > OP_MATCH_MAX) {
- err(rules->udev, "invalid ATTRS operation\n");
- goto invalid;
- }
- attr = get_key_attribute(rules->udev, key + sizeof("ATTRS")-1);
- if (attr == NULL) {
- err(rules->udev, "error parsing ATTRS attribute\n");
+ err(rules->udev, "invalid TAGS operation\n");
goto invalid;
}
- rule_add_key(&rule_tmp, TK_M_ATTRS, op, value, attr);
+ rule_add_key(&rule_tmp, TK_M_TAGS, op, value, NULL);
continue;
}
if (rule_add_key(&rule_tmp, TK_M_ENV, op, value, attr) != 0)
goto invalid;
} else {
+ static const char *blacklist[] = {
+ "ACTION",
+ "SUBSYSTEM",
+ "DEVTYPE",
+ "MAJOR",
+ "MINOR",
+ "DRIVER",
+ "IFINDEX",
+ "DEVNAME",
+ "DEVLINKS",
+ "DEVPATH",
+ "TAGS",
+ };
+ unsigned int i;
+
+ for (i = 0; i < ARRAY_SIZE(blacklist); i++)
+ if (strcmp(attr, blacklist[i]) == 0) {
+ err(rules->udev, "invalid ENV attribute, '%s' can not be set %s:%u\n", attr, filename, lineno);
+ continue;
+ }
if (rule_add_key(&rule_tmp, TK_A_ENV, op, value, attr) != 0)
goto invalid;
}
if (strncmp(key, "IMPORT", sizeof("IMPORT")-1) == 0) {
attr = get_key_attribute(rules->udev, key + sizeof("IMPORT")-1);
- if (attr != NULL && strstr(attr, "program")) {
+ if (attr == NULL) {
+ err(rules->udev, "IMPORT{} type missing, ignoring IMPORT %s:%u\n", filename, lineno);
+ continue;
+ }
+ if (strstr(attr, "program")) {
+ /* find known built-in command */
+ if (value[0] != '/') {
+ char file[UTIL_PATH_SIZE];
+ char *pos;
+ enum udev_builtin_cmd cmd;
+
+ util_strscpy(file, sizeof(file), value);
+ pos = strchr(file, ' ');
+ if (pos)
+ pos[0] = '\0';
+ cmd = udev_builtin_lookup(file);
+ if (cmd < UDEV_BUILTIN_MAX) {
+ info(rules->udev, "IMPORT found builtin '%s', replacing %s:%u\n", file, filename, lineno);
+ rule_add_key(&rule_tmp, TK_M_IMPORT_BUILTIN, op, NULL, &cmd);
+ continue;
+ }
+ }
dbg(rules->udev, "IMPORT will be executed\n");
rule_add_key(&rule_tmp, TK_M_IMPORT_PROG, op, value, NULL);
- } else if (attr != NULL && strstr(attr, "file")) {
+ } else if (strstr(attr, "builtin")) {
+ enum udev_builtin_cmd cmd = udev_builtin_lookup(value);
+
+ dbg(rules->udev, "IMPORT execute builtin\n");
+ if (cmd < UDEV_BUILTIN_MAX)
+ rule_add_key(&rule_tmp, TK_M_IMPORT_BUILTIN, op, NULL, &cmd);
+ else
+ err(rules->udev, "IMPORT{builtin}: '%s' unknown %s:%u\n", value, filename, lineno);
+ } else if (strstr(attr, "file")) {
dbg(rules->udev, "IMPORT will be included as file\n");
rule_add_key(&rule_tmp, TK_M_IMPORT_FILE, op, value, NULL);
- } else if (attr != NULL && strstr(attr, "db")) {
+ } else if (strstr(attr, "db")) {
dbg(rules->udev, "IMPORT will include db values\n");
rule_add_key(&rule_tmp, TK_M_IMPORT_DB, op, value, NULL);
- } else if (attr != NULL && strstr(attr, "cmdline")) {
+ } else if (strstr(attr, "cmdline")) {
dbg(rules->udev, "IMPORT will include db values\n");
rule_add_key(&rule_tmp, TK_M_IMPORT_CMDLINE, op, value, NULL);
- } else if (attr != NULL && strstr(attr, "parent")) {
+ } else if (strstr(attr, "parent")) {
dbg(rules->udev, "IMPORT will include the parent values\n");
rule_add_key(&rule_tmp, TK_M_IMPORT_PARENT, op, value, NULL);
- } else {
- /* figure it out if it is executable */
- char file[UTIL_PATH_SIZE];
- char *pos;
- struct stat statbuf;
-
- /* allow programs in /lib/udev called without the path */
- if (value[0] != '/')
- util_strscpyl(file, sizeof(file), LIBEXECDIR "/", value, NULL);
- else
- util_strscpy(file, sizeof(file), value);
- pos = strchr(file, ' ');
- if (pos)
- pos[0] = '\0';
- dbg(rules->udev, "IMPORT auto mode for '%s'\n", file);
- if (stat(file, &statbuf) == 0 && (statbuf.st_mode & S_IXUSR)) {
- dbg(rules->udev, "IMPORT will be executed (autotype)\n");
- rule_add_key(&rule_tmp, TK_M_IMPORT_PROG, op, value, NULL);
- } else {
- dbg(rules->udev, "IMPORT will be included as file (autotype)\n");
- rule_add_key(&rule_tmp, TK_M_IMPORT_FILE, op, value, NULL);
- }
}
continue;
}
continue;
}
- if (strncmp(key, "RUN", sizeof("RUN")-1) == 0) {
- int flag = 0;
-
- attr = get_key_attribute(rules->udev, key + sizeof("RUN")-1);
- if (attr != NULL && strstr(attr, "fail_event_on_error"))
- flag = 1;
- rule_add_key(&rule_tmp, TK_A_RUN, op, value, &flag);
+ if (strcmp(key, "RUN") == 0) {
+ rule_add_key(&rule_tmp, TK_A_RUN, op, value, NULL);
continue;
}
continue;
}
- if (strncmp(key, "SMACK", sizeof("SMACK")-1) == 0) {
- if (value[0] == '\0') {
- info(rules->udev, "SMACK=\"\" is ignored, invalid label \"\" "
- "please remove it from %s:%u\n", filename, lineno);
- continue;
- }
-
- if (strnlen(value, SMK_MAXLEN + 1) > SMK_MAXLEN) {
- info(rules->udev, "SMACK=\"%s\" is ignored, label \"%s\" exceeds %d characters "
- "please remove it from %s:%u\n", value, value, SMK_MAXLEN, filename, lineno);
- continue;
- }
-
- rule_add_key(&rule_tmp, TK_A_SMACK, op, value, NULL);
- rule_tmp.rule.rule.can_set_name = true;
- continue;
- }
-
if (strcmp(key, "MODE") == 0) {
mode_t mode;
char *endptr;
rule_add_key(&rule_tmp, TK_A_DEVLINK_PRIO, op, NULL, &prio);
dbg(rules->udev, "link priority=%i\n", prio);
}
+
pos = strstr(value, "event_timeout=");
if (pos != NULL) {
int tout = atoi(&pos[strlen("event_timeout=")]);
- rule_add_key(&rule_tmp, TK_A_EVENT_TIMEOUT, op, NULL, &tout);
+ rule_add_key(&rule_tmp, TK_M_EVENT_TIMEOUT, op, NULL, &tout);
dbg(rules->udev, "event timeout=%i\n", tout);
}
+
pos = strstr(value, "string_escape=");
if (pos != NULL) {
pos = &pos[strlen("string_escape=")];
else if (strncmp(pos, "replace", strlen("replace")) == 0)
rule_add_key(&rule_tmp, TK_A_STRING_ESCAPE_REPLACE, op, NULL, NULL);
}
+
+ pos = strstr(value, "db_persist");
+ if (pos != NULL)
+ rule_add_key(&rule_tmp, TK_A_DB_PERSIST, op, NULL, NULL);
+
pos = strstr(value, "nowatch");
if (pos != NULL) {
const int off = 0;
dbg(rules->udev, "inotify watch of device requested\n");
}
}
+
pos = strstr(value, "static_node=");
if (pos != NULL) {
rule_add_key(&rule_tmp, TK_A_STATIC_NODE, op, &pos[strlen("static_node=")], NULL);
rule_tmp.rule.rule.has_static_node = true;
}
+
continue;
}
err(rules->udev, "unknown key '%s' in %s:%u\n", key, filename, lineno);
return 0;
}
-static int add_matching_files(struct udev *udev, struct udev_list_node *file_list, const char *dirname, const char *suffix)
+static int add_matching_files(struct udev *udev, struct udev_list *file_list, const char *dirname, const char *suffix)
{
DIR *dir;
+ struct dirent *dent;
char filename[UTIL_PATH_SIZE];
dbg(udev, "open directory '%s'\n", dirname);
return -1;
}
- for (;;) {
- struct dirent *dent;
-
- dent = readdir(dir);
- if (dent == NULL || dent->d_name[0] == '\0')
- break;
-
+ for (dent = readdir(dir); dent != NULL; dent = readdir(dir)) {
if (dent->d_name[0] == '.')
continue;
}
util_strscpyl(filename, sizeof(filename), dirname, "/", dent->d_name, NULL);
dbg(udev, "put file '%s' into list\n", filename);
- udev_list_entry_add(udev, file_list, filename, NULL, 1, 1);
+ /*
+ * the basename is the key, the filename the value
+ * identical basenames from different directories overwrite each other
+ * entries are sorted after basename
+ */
+ udev_list_entry_add(file_list, dent->d_name, filename);
}
closedir(dir);
struct udev_rules *udev_rules_new(struct udev *udev, int resolve_names)
{
struct udev_rules *rules;
- struct stat statbuf;
- struct udev_list_node file_list;
- struct udev_list_entry *file_loop, *file_tmp;
+ struct udev_list file_list;
+ struct udev_list_entry *file_loop;
struct token end_token;
rules = calloc(1, sizeof(struct udev_rules));
return NULL;
rules->udev = udev;
rules->resolve_names = resolve_names;
- udev_list_init(&file_list);
+ udev_list_init(udev, &file_list, true);
/* init token array and string buffer */
rules->tokens = malloc(PREALLOC_TOKEN * sizeof(struct token));
memset(rules->trie_nodes, 0x00, sizeof(struct trie_node));
rules->trie_nodes_cur = 1;
- if (udev_get_rules_path(udev) != NULL) {
- /* custom rules location for testing */
- add_matching_files(udev, &file_list, udev_get_rules_path(udev), ".rules");
- } else {
- char filename[PATH_MAX];
- struct udev_list_node sort_list;
- struct udev_list_entry *sort_loop, *sort_tmp;
-
- /* read user/custom rules */
- add_matching_files(udev, &file_list, SYSCONFDIR "/udev/rules.d", ".rules");
-
- /* read dynamic/temporary rules */
- util_strscpyl(filename, sizeof(filename), udev_get_dev_path(udev), "/.udev/rules.d", NULL);
- udev_list_init(&sort_list);
- add_matching_files(udev, &sort_list, filename, ".rules");
-
- /* read default rules */
- add_matching_files(udev, &sort_list, LIBEXECDIR "/rules.d", ".rules");
+ if (udev_get_rules_path(udev) == NULL) {
+ char filename[UTIL_PATH_SIZE];
- /* sort all rules files by basename into list of files */
- udev_list_entry_foreach_safe(sort_loop, sort_tmp, udev_list_get_entry(&sort_list)) {
- const char *sort_name = udev_list_entry_get_name(sort_loop);
- const char *sort_base = strrchr(sort_name, '/');
+ /* /lib/udev -- default/package rules */
+ add_matching_files(udev, &file_list, LIBEXECDIR "/rules.d", ".rules");
- if (sort_base == NULL)
- continue;
- /* sort entry into existing list */
- udev_list_entry_foreach_safe(file_loop, file_tmp, udev_list_get_entry(&file_list)) {
- const char *file_name = udev_list_entry_get_name(file_loop);
- const char *file_base = strrchr(file_name, '/');
+ /* /etc/udev -- system-specific/user/admin rules */
+ add_matching_files(udev, &file_list, SYSCONFDIR "/udev/rules.d", ".rules");
- if (file_base == NULL)
- continue;
- if (strcmp(file_base, sort_base) == 0) {
- info(udev, "rule file basename '%s' already added, ignoring '%s'\n",
- file_name, sort_name);
- udev_list_entry_delete(sort_loop);
- sort_loop = NULL;
- break;
- }
- if (strcmp(file_base, sort_base) > 0) {
- /* found later file, insert before */
- udev_list_entry_remove(sort_loop);
- udev_list_entry_insert_before(sort_loop, file_loop);
- sort_loop = NULL;
- break;
- }
- }
- /* current file already handled */
- if (sort_loop == NULL)
- continue;
- /* no later file, append to end of list */
- udev_list_entry_remove(sort_loop);
- udev_list_entry_append(sort_loop, &file_list);
- }
+ /* /run/udev -- throw-away/temporary rules */
+ util_strscpyl(filename, sizeof(filename), udev_get_run_path(udev), "/rules.d", NULL);
+ add_matching_files(udev, &file_list, filename, ".rules");
+ } else {
+ /* custom rules files location for testing */
+ add_matching_files(udev, &file_list, udev_get_rules_path(udev), ".rules");
}
/* add all filenames to the string buffer */
udev_list_entry_foreach(file_loop, udev_list_get_entry(&file_list)) {
- const char *filename = udev_list_entry_get_name(file_loop);
+ const char *filename = udev_list_entry_get_value(file_loop);
unsigned int filename_off;
filename_off = add_string(rules, filename);
/* the offset in the rule is limited to unsigned short */
if (filename_off < USHRT_MAX)
- udev_list_entry_set_flags(file_loop, filename_off);
+ udev_list_entry_set_num(file_loop, filename_off);
}
- /* parse list of files */
- udev_list_entry_foreach_safe(file_loop, file_tmp, udev_list_get_entry(&file_list)) {
- const char *filename = udev_list_entry_get_name(file_loop);
- unsigned int filename_off = udev_list_entry_get_flags(file_loop);
+ /* parse all rules files */
+ udev_list_entry_foreach(file_loop, udev_list_get_entry(&file_list)) {
+ const char *filename = udev_list_entry_get_value(file_loop);
+ unsigned int filename_off = udev_list_entry_get_num(file_loop);
+ struct stat st;
- if (stat(filename, &statbuf) == 0 && statbuf.st_size > 0)
- parse_file(rules, filename, filename_off);
- else
- err(udev, "can not read '%s'\n", filename);
- udev_list_entry_delete(file_loop);
+ if (stat(filename, &st) != 0) {
+ err(udev, "can not find '%s': %m\n", filename);
+ continue;
+ }
+ if (S_ISREG(st.st_mode) && st.st_size <= 0) {
+ info(udev, "ignore empty '%s'\n", filename);
+ continue;
+ }
+ if (S_ISCHR(st.st_mode)) {
+ info(udev, "ignore masked '%s'\n", filename);
+ continue;
+ }
+ parse_file(rules, filename, filename_off);
}
+ udev_list_cleanup(&file_list);
memset(&end_token, 0x00, sizeof(struct token));
end_token.type = TK_END;
ESCAPE_REPLACE,
};
-int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event)
+int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event, const sigset_t *sigmask)
{
struct token *cur;
struct token *rule;
if (match_key(rules, cur, udev_device_get_sysname(event->dev)) != 0)
goto nomatch;
break;
- case TK_M_DEVLINK:
- {
- size_t devlen = strlen(udev_get_dev_path(event->udev))+1;
- struct udev_list_entry *list_entry;
- bool match = false;
-
- udev_list_entry_foreach(list_entry, udev_device_get_devlinks_list_entry(event->dev)) {
- const char *devlink;
-
- devlink = &udev_list_entry_get_name(list_entry)[devlen];
- if (match_key(rules, cur, devlink) == 0) {
- match = true;
- break;
- }
+ case TK_M_DEVLINK: {
+ size_t devlen = strlen(udev_get_dev_path(event->udev))+1;
+ struct udev_list_entry *list_entry;
+ bool match = false;
+
+ udev_list_entry_foreach(list_entry, udev_device_get_devlinks_list_entry(event->dev)) {
+ const char *devlink;
+
+ devlink = &udev_list_entry_get_name(list_entry)[devlen];
+ if (match_key(rules, cur, devlink) == 0) {
+ match = true;
+ break;
}
- if (!match)
- goto nomatch;
- break;
}
+ if (!match)
+ goto nomatch;
+ break;
+ }
case TK_M_NAME:
if (match_key(rules, cur, event->name) != 0)
goto nomatch;
break;
- case TK_M_ENV:
- {
- const char *key_name = &rules->buf[cur->key.attr_off];
- const char *value;
-
- value = udev_device_get_property_value(event->dev, key_name);
- if (value == NULL) {
- dbg(event->udev, "ENV{%s} is not set, treat as empty\n", key_name);
- value = "";
- }
- if (match_key(rules, cur, value))
- goto nomatch;
- break;
+ case TK_M_ENV: {
+ const char *key_name = &rules->buf[cur->key.attr_off];
+ const char *value;
+
+ value = udev_device_get_property_value(event->dev, key_name);
+ if (value == NULL) {
+ dbg(event->udev, "ENV{%s} is not set, treat as empty\n", key_name);
+ value = "";
}
- case TK_M_TAG:
- {
- struct udev_list_entry *list_entry;
- bool match = false;
-
- udev_list_entry_foreach(list_entry, udev_device_get_tags_list_entry(event->dev)) {
- if (strcmp(&rules->buf[cur->key.value_off], udev_list_entry_get_name(list_entry)) == 0) {
- match = true;
- break;
- }
+ if (match_key(rules, cur, value))
+ goto nomatch;
+ break;
+ }
+ case TK_M_TAG: {
+ struct udev_list_entry *list_entry;
+ bool match = false;
+
+ udev_list_entry_foreach(list_entry, udev_device_get_tags_list_entry(event->dev)) {
+ if (strcmp(&rules->buf[cur->key.value_off], udev_list_entry_get_name(list_entry)) == 0) {
+ match = true;
+ break;
}
- if (!match && (cur->key.op != OP_NOMATCH))
- goto nomatch;
- break;
}
+ if (!match && (cur->key.op != OP_NOMATCH))
+ goto nomatch;
+ break;
+ }
case TK_M_SUBSYSTEM:
if (match_key(rules, cur, udev_device_get_subsystem(event->dev)) != 0)
goto nomatch;
if (match_key(rules, cur, udev_device_get_driver(event->dev)) != 0)
goto nomatch;
break;
- case TK_M_WAITFOR:
- {
- char filename[UTIL_PATH_SIZE];
- int found;
-
- udev_event_apply_format(event, &rules->buf[cur->key.value_off], filename, sizeof(filename));
- found = (wait_for_file(event->dev, filename, 10) == 0);
- if (!found && (cur->key.op != OP_NOMATCH))
- goto nomatch;
- break;
- }
+ case TK_M_WAITFOR: {
+ char filename[UTIL_PATH_SIZE];
+ int found;
+
+ udev_event_apply_format(event, &rules->buf[cur->key.value_off], filename, sizeof(filename));
+ found = (wait_for_file(event->dev, filename, 10) == 0);
+ if (!found && (cur->key.op != OP_NOMATCH))
+ goto nomatch;
+ break;
+ }
case TK_M_ATTR:
if (match_attr(rules, event->dev, event, cur) != 0)
goto nomatch;
case TK_M_SUBSYSTEMS:
case TK_M_DRIVERS:
case TK_M_ATTRS:
- {
- struct token *next;
+ case TK_M_TAGS: {
+ struct token *next;
- /* get whole sequence of parent matches */
- next = cur;
- while (next->type > TK_M_PARENTS_MIN && next->type < TK_M_PARENTS_MAX)
- next++;
+ /* get whole sequence of parent matches */
+ next = cur;
+ while (next->type > TK_M_PARENTS_MIN && next->type < TK_M_PARENTS_MAX)
+ next++;
- /* loop over parents */
- event->dev_parent = event->dev;
- for (;;) {
- struct token *key;
-
- dbg(event->udev, "parent: '%s'\n", udev_device_get_syspath(event->dev_parent));
- /* loop over sequence of parent match keys */
- for (key = cur; key < next; key++ ) {
- dump_token(rules, key);
- switch(key->type) {
- case TK_M_KERNELS:
- if (match_key(rules, key, udev_device_get_sysname(event->dev_parent)) != 0)
- goto try_parent;
- break;
- case TK_M_SUBSYSTEMS:
- if (match_key(rules, key, udev_device_get_subsystem(event->dev_parent)) != 0)
- goto try_parent;
- break;
- case TK_M_DRIVERS:
- if (match_key(rules, key, udev_device_get_driver(event->dev_parent)) != 0)
- goto try_parent;
- break;
- case TK_M_ATTRS:
- if (match_attr(rules, event->dev_parent, event, key) != 0)
- goto try_parent;
- break;
- default:
- goto nomatch;
- }
- dbg(event->udev, "parent key matched\n");
- }
- dbg(event->udev, "all parent keys matched\n");
- /* all keys matched */
- break;
+ /* loop over parents */
+ event->dev_parent = event->dev;
+ for (;;) {
+ struct token *key;
+
+ dbg(event->udev, "parent: '%s'\n", udev_device_get_syspath(event->dev_parent));
+ /* loop over sequence of parent match keys */
+ for (key = cur; key < next; key++ ) {
+ dump_token(rules, key);
+ switch(key->type) {
+ case TK_M_KERNELS:
+ if (match_key(rules, key, udev_device_get_sysname(event->dev_parent)) != 0)
+ goto try_parent;
+ break;
+ case TK_M_SUBSYSTEMS:
+ if (match_key(rules, key, udev_device_get_subsystem(event->dev_parent)) != 0)
+ goto try_parent;
+ break;
+ case TK_M_DRIVERS:
+ if (match_key(rules, key, udev_device_get_driver(event->dev_parent)) != 0)
+ goto try_parent;
+ break;
+ case TK_M_ATTRS:
+ if (match_attr(rules, event->dev_parent, event, key) != 0)
+ goto try_parent;
+ break;
+ case TK_M_TAGS: {
+ bool match = udev_device_has_tag(event->dev_parent, &rules->buf[cur->key.value_off]);
- try_parent:
- event->dev_parent = udev_device_get_parent(event->dev_parent);
- if (event->dev_parent == NULL)
+ if (match && key->key.op == OP_NOMATCH)
+ goto try_parent;
+ if (!match && key->key.op == OP_MATCH)
+ goto try_parent;
+ break;
+ }
+ default:
goto nomatch;
- }
- /* move behind our sequence of parent match keys */
- cur = next;
- continue;
- }
- case TK_M_TEST:
- {
- char filename[UTIL_PATH_SIZE];
- struct stat statbuf;
- int match;
-
- udev_event_apply_format(event, &rules->buf[cur->key.value_off], filename, sizeof(filename));
- if (util_resolve_subsys_kernel(event->udev, filename, filename, sizeof(filename), 0) != 0) {
- if (filename[0] != '/') {
- char tmp[UTIL_PATH_SIZE];
-
- util_strscpy(tmp, sizeof(tmp), filename);
- util_strscpyl(filename, sizeof(filename),
- udev_device_get_syspath(event->dev), "/", tmp, NULL);
}
+ dbg(event->udev, "parent key matched\n");
}
- attr_subst_subdir(filename, sizeof(filename));
-
- match = (stat(filename, &statbuf) == 0);
- dbg(event->udev, "'%s' %s", filename, match ? "exists\n" : "does not exist\n");
- if (match && cur->key.mode > 0) {
- match = ((statbuf.st_mode & cur->key.mode) > 0);
- dbg(event->udev, "'%s' has mode=%#o and %s %#o\n", filename, statbuf.st_mode,
- match ? "matches" : "does not match", cur->key.mode);
- }
- if (match && cur->key.op == OP_NOMATCH)
- goto nomatch;
- if (!match && cur->key.op == OP_MATCH)
- goto nomatch;
+ dbg(event->udev, "all parent keys matched\n");
break;
+
+ try_parent:
+ event->dev_parent = udev_device_get_parent(event->dev_parent);
+ if (event->dev_parent == NULL)
+ goto nomatch;
}
- case TK_M_PROGRAM:
- {
- char program[UTIL_PATH_SIZE];
- char **envp;
- char result[UTIL_PATH_SIZE];
-
- free(event->program_result);
- event->program_result = NULL;
- udev_event_apply_format(event, &rules->buf[cur->key.value_off], program, sizeof(program));
- envp = udev_device_get_properties_envp(event->dev);
- info(event->udev, "PROGRAM '%s' %s:%u\n",
- program,
- &rules->buf[rule->rule.filename_off],
- rule->rule.filename_line);
- if (util_run_program(event->udev, program, envp, result, sizeof(result), NULL, NULL, false) != 0) {
- if (cur->key.op != OP_NOMATCH)
- goto nomatch;
- } else {
- int count;
+ /* move behind our sequence of parent match keys */
+ cur = next;
+ continue;
+ }
+ case TK_M_TEST: {
+ char filename[UTIL_PATH_SIZE];
+ struct stat statbuf;
+ int match;
- util_remove_trailing_chars(result, '\n');
- if (esc == ESCAPE_UNSET || esc == ESCAPE_REPLACE) {
- count = udev_util_replace_chars(result, UDEV_ALLOWED_CHARS_INPUT);
- if (count > 0)
- info(event->udev, "%i character(s) replaced\n" , count);
- }
- event->program_result = strdup(result);
- dbg(event->udev, "storing result '%s'\n", event->program_result);
- if (cur->key.op == OP_NOMATCH)
- goto nomatch;
+ udev_event_apply_format(event, &rules->buf[cur->key.value_off], filename, sizeof(filename));
+ if (util_resolve_subsys_kernel(event->udev, filename, filename, sizeof(filename), 0) != 0) {
+ if (filename[0] != '/') {
+ char tmp[UTIL_PATH_SIZE];
+
+ util_strscpy(tmp, sizeof(tmp), filename);
+ util_strscpyl(filename, sizeof(filename),
+ udev_device_get_syspath(event->dev), "/", tmp, NULL);
}
- break;
}
- case TK_M_IMPORT_FILE:
- {
- char import[UTIL_PATH_SIZE];
+ attr_subst_subdir(filename, sizeof(filename));
- udev_event_apply_format(event, &rules->buf[cur->key.value_off], import, sizeof(import));
- if (import_file_into_properties(event->dev, import) != 0)
- if (cur->key.op != OP_NOMATCH)
- goto nomatch;
- break;
+ match = (stat(filename, &statbuf) == 0);
+ dbg(event->udev, "'%s' %s", filename, match ? "exists\n" : "does not exist\n");
+ if (match && cur->key.mode > 0) {
+ match = ((statbuf.st_mode & cur->key.mode) > 0);
+ dbg(event->udev, "'%s' has mode=%#o and %s %#o\n", filename, statbuf.st_mode,
+ match ? "matches" : "does not match", cur->key.mode);
}
- case TK_M_IMPORT_PROG:
- {
- char import[UTIL_PATH_SIZE];
+ if (match && cur->key.op == OP_NOMATCH)
+ goto nomatch;
+ if (!match && cur->key.op == OP_MATCH)
+ goto nomatch;
+ break;
+ }
+ case TK_M_EVENT_TIMEOUT:
+ info(event->udev, "OPTIONS event_timeout=%u\n", cur->key.event_timeout);
+ event->timeout_usec = cur->key.event_timeout * 1000 * 1000;
+ break;
+ case TK_M_PROGRAM: {
+ char program[UTIL_PATH_SIZE];
+ char **envp;
+ char result[UTIL_PATH_SIZE];
+
+ free(event->program_result);
+ event->program_result = NULL;
+ udev_event_apply_format(event, &rules->buf[cur->key.value_off], program, sizeof(program));
+ envp = udev_device_get_properties_envp(event->dev);
+ info(event->udev, "PROGRAM '%s' %s:%u\n",
+ program,
+ &rules->buf[rule->rule.filename_off],
+ rule->rule.filename_line);
+
+ if (udev_event_spawn(event, program, envp, sigmask, result, sizeof(result)) < 0) {
+ if (cur->key.op != OP_NOMATCH)
+ goto nomatch;
+ } else {
+ int count;
- udev_event_apply_format(event, &rules->buf[cur->key.value_off], import, sizeof(import));
- info(event->udev, "IMPORT '%s' %s:%u\n",
- import,
+ util_remove_trailing_chars(result, '\n');
+ if (esc == ESCAPE_UNSET || esc == ESCAPE_REPLACE) {
+ count = util_replace_chars(result, UDEV_ALLOWED_CHARS_INPUT);
+ if (count > 0)
+ info(event->udev, "%i character(s) replaced\n" , count);
+ }
+ event->program_result = strdup(result);
+ dbg(event->udev, "storing result '%s'\n", event->program_result);
+ if (cur->key.op == OP_NOMATCH)
+ goto nomatch;
+ }
+ break;
+ }
+ case TK_M_IMPORT_FILE: {
+ char import[UTIL_PATH_SIZE];
+
+ udev_event_apply_format(event, &rules->buf[cur->key.value_off], import, sizeof(import));
+ if (import_file_into_properties(event->dev, import) != 0)
+ if (cur->key.op != OP_NOMATCH)
+ goto nomatch;
+ break;
+ }
+ case TK_M_IMPORT_PROG: {
+ char import[UTIL_PATH_SIZE];
+
+ udev_event_apply_format(event, &rules->buf[cur->key.value_off], import, sizeof(import));
+ info(event->udev, "IMPORT '%s' %s:%u\n",
+ import,
+ &rules->buf[rule->rule.filename_off],
+ rule->rule.filename_line);
+
+ if (import_program_into_properties(event, import, sigmask) != 0)
+ if (cur->key.op != OP_NOMATCH)
+ goto nomatch;
+ break;
+ }
+ case TK_M_IMPORT_BUILTIN: {
+ /* check if we ran already */
+ if (event->builtin_run & (1 << cur->key.builtin_cmd)) {
+ info(event->udev, "IMPORT builtin skip '%s' %s:%u\n",
+ udev_builtin_name(cur->key.builtin_cmd),
&rules->buf[rule->rule.filename_off],
rule->rule.filename_line);
- if (import_program_into_properties(event->dev, import) != 0)
+ /* return the result from earlier run */
+ if (event->builtin_ret & (1 << cur->key.builtin_cmd))
if (cur->key.op != OP_NOMATCH)
goto nomatch;
break;
}
- case TK_M_IMPORT_DB:
- {
- const char *key = &rules->buf[cur->key.value_off];
- const char *value;
+ /* mark as ran */
+ event->builtin_run |= (1 << cur->key.builtin_cmd);
+ info(event->udev, "IMPORT builtin '%s' %s:%u\n",
+ udev_builtin_name(cur->key.builtin_cmd),
+ &rules->buf[rule->rule.filename_off],
+ rule->rule.filename_line);
+ if (udev_builtin_run(event->dev, cur->key.builtin_cmd, false) != 0) {
+ /* remember failure */
+ info(rules->udev, "IMPORT builtin '%s' returned non-zero\n",
+ udev_builtin_name(cur->key.builtin_cmd));
+ event->builtin_ret |= (1 << cur->key.builtin_cmd);
+ if (cur->key.op != OP_NOMATCH)
+ goto nomatch;
+ }
+ break;
+ }
+ case TK_M_IMPORT_DB: {
+ const char *key = &rules->buf[cur->key.value_off];
+ const char *value;
- value = udev_device_get_property_value(event->dev_db, key);
- if (value != NULL) {
- struct udev_list_entry *entry;
+ value = udev_device_get_property_value(event->dev_db, key);
+ if (value != NULL) {
+ struct udev_list_entry *entry;
- entry = udev_device_add_property(event->dev, key, value);
- udev_list_entry_set_flags(entry, 1);
- } else {
- if (cur->key.op != OP_NOMATCH)
- goto nomatch;
- }
- break;
+ entry = udev_device_add_property(event->dev, key, value);
+ udev_list_entry_set_num(entry, true);
+ } else {
+ if (cur->key.op != OP_NOMATCH)
+ goto nomatch;
}
- case TK_M_IMPORT_CMDLINE:
- {
- FILE *f;
- bool imported = false;
-
- f = fopen("/proc/cmdline", "r");
- if (f != NULL) {
- char cmdline[4096];
-
- if (fgets(cmdline, sizeof(cmdline), f) != NULL) {
- const char *key = &rules->buf[cur->key.value_off];
- char *pos;
-
- pos = strstr(cmdline, key);
- if (pos != NULL) {
- struct udev_list_entry *entry;
-
- pos += strlen(key);
- if (pos[0] == '\0' || isspace(pos[0])) {
- /* we import simple flags as 'FLAG=1' */
- entry = udev_device_add_property(event->dev, key, "1");
- udev_list_entry_set_flags(entry, 1);
- imported = true;
- } else if (pos[0] == '=') {
- const char *value;
-
+ break;
+ }
+ case TK_M_IMPORT_CMDLINE: {
+ FILE *f;
+ bool imported = false;
+
+ f = fopen("/proc/cmdline", "r");
+ if (f != NULL) {
+ char cmdline[4096];
+
+ if (fgets(cmdline, sizeof(cmdline), f) != NULL) {
+ const char *key = &rules->buf[cur->key.value_off];
+ char *pos;
+
+ pos = strstr(cmdline, key);
+ if (pos != NULL) {
+ struct udev_list_entry *entry;
+
+ pos += strlen(key);
+ if (pos[0] == '\0' || isspace(pos[0])) {
+ /* we import simple flags as 'FLAG=1' */
+ entry = udev_device_add_property(event->dev, key, "1");
+ udev_list_entry_set_num(entry, true);
+ imported = true;
+ } else if (pos[0] == '=') {
+ const char *value;
+
+ pos++;
+ value = pos;
+ while (pos[0] != '\0' && !isspace(pos[0]))
pos++;
- value = pos;
- while (pos[0] != '\0' && !isspace(pos[0]))
- pos++;
- pos[0] = '\0';
- entry = udev_device_add_property(event->dev, key, value);
- udev_list_entry_set_flags(entry, 1);
- imported = true;
- }
+ pos[0] = '\0';
+ entry = udev_device_add_property(event->dev, key, value);
+ udev_list_entry_set_num(entry, true);
+ imported = true;
}
}
- fclose(f);
}
- if (!imported && cur->key.op != OP_NOMATCH)
- goto nomatch;
- break;
+ fclose(f);
}
- case TK_M_IMPORT_PARENT:
- {
- char import[UTIL_PATH_SIZE];
+ if (!imported && cur->key.op != OP_NOMATCH)
+ goto nomatch;
+ break;
+ }
+ case TK_M_IMPORT_PARENT: {
+ char import[UTIL_PATH_SIZE];
- udev_event_apply_format(event, &rules->buf[cur->key.value_off], import, sizeof(import));
- if (import_parent_into_properties(event->dev, import) != 0)
- if (cur->key.op != OP_NOMATCH)
- goto nomatch;
- break;
- }
+ udev_event_apply_format(event, &rules->buf[cur->key.value_off], import, sizeof(import));
+ if (import_parent_into_properties(event->dev, import) != 0)
+ if (cur->key.op != OP_NOMATCH)
+ goto nomatch;
+ break;
+ }
case TK_M_RESULT:
if (match_key(rules, cur, event->program_result) != 0)
goto nomatch;
case TK_A_STRING_ESCAPE_REPLACE:
esc = ESCAPE_REPLACE;
break;
+ case TK_A_DB_PERSIST:
+ udev_device_set_db_persist(event->dev);
+ break;
case TK_A_INOTIFY_WATCH:
if (event->inotify_watch_final)
break;
case TK_A_DEVLINK_PRIO:
udev_device_set_devlink_priority(event->dev, cur->key.devlink_prio);
break;
- case TK_A_OWNER:
- {
- char owner[UTIL_NAME_SIZE];
-
- if (event->owner_final)
- break;
- if (cur->key.op == OP_ASSIGN_FINAL)
- event->owner_final = true;
- udev_event_apply_format(event, &rules->buf[cur->key.value_off], owner, sizeof(owner));
- event->uid = util_lookup_user(event->udev, owner);
- info(event->udev, "OWNER %u %s:%u\n",
- event->uid,
- &rules->buf[rule->rule.filename_off],
- rule->rule.filename_line);
- break;
- }
- case TK_A_GROUP:
- {
- char group[UTIL_NAME_SIZE];
+ case TK_A_OWNER: {
+ char owner[UTIL_NAME_SIZE];
- if (event->group_final)
- break;
- if (cur->key.op == OP_ASSIGN_FINAL)
- event->group_final = true;
- udev_event_apply_format(event, &rules->buf[cur->key.value_off], group, sizeof(group));
- event->gid = util_lookup_group(event->udev, group);
- info(event->udev, "GROUP %u %s:%u\n",
- event->gid,
- &rules->buf[rule->rule.filename_off],
- rule->rule.filename_line);
+ if (event->owner_final)
break;
- }
- case TK_A_SMACK:
- {
- const char *smack = &rules->buf[cur->key.value_off];
- char smack_str[UTIL_PATH_SIZE];
+ if (cur->key.op == OP_ASSIGN_FINAL)
+ event->owner_final = true;
+ udev_event_apply_format(event, &rules->buf[cur->key.value_off], owner, sizeof(owner));
+ event->uid = util_lookup_user(event->udev, owner);
+ info(event->udev, "OWNER %u %s:%u\n",
+ event->uid,
+ &rules->buf[rule->rule.filename_off],
+ rule->rule.filename_line);
+ break;
+ }
+ case TK_A_GROUP: {
+ char group[UTIL_NAME_SIZE];
- if (event->smack_final)
+ if (event->group_final)
break;
if (cur->key.op == OP_ASSIGN_FINAL)
- event->smack_final = true;
-
- udev_event_apply_format(event, smack, smack_str, sizeof(smack_str));
- free(event->smack);
- event->smack = strdup(smack_str);
-
- info(event->udev, "SMACK '%s' %s:%u\n",
- event->smack,
+ event->group_final = true;
+ udev_event_apply_format(event, &rules->buf[cur->key.value_off], group, sizeof(group));
+ event->gid = util_lookup_group(event->udev, group);
+ info(event->udev, "GROUP %u %s:%u\n",
+ event->gid,
&rules->buf[rule->rule.filename_off],
rule->rule.filename_line);
break;
}
- case TK_A_MODE:
- {
- char mode[UTIL_NAME_SIZE];
- char *endptr;
+ case TK_A_MODE: {
+ char mode_str[UTIL_NAME_SIZE];
+ mode_t mode;
+ char *endptr;
- if (event->mode_final)
- break;
- if (cur->key.op == OP_ASSIGN_FINAL)
- event->mode_final = true;
- udev_event_apply_format(event, &rules->buf[cur->key.value_off], mode, sizeof(mode));
- event->mode = strtol(mode, &endptr, 8);
- if (endptr[0] != '\0') {
- err(event->udev, "invalide mode '%s' set default mode 0600\n", mode);
- event->mode = 0600;
- }
- info(event->udev, "MODE %#o %s:%u\n",
- event->mode,
- &rules->buf[rule->rule.filename_off],
- rule->rule.filename_line);
+ if (event->mode_final)
+ break;
+ udev_event_apply_format(event, &rules->buf[cur->key.value_off], mode_str, sizeof(mode_str));
+ mode = strtol(mode_str, &endptr, 8);
+ if (endptr[0] != '\0') {
+ err(event->udev, "ignoring invalid mode '%s'\n", mode_str);
break;
}
+ if (cur->key.op == OP_ASSIGN_FINAL)
+ event->mode_final = true;
+ event->mode_set = true;
+ event->mode = mode;
+ info(event->udev, "MODE %#o %s:%u\n",
+ event->mode,
+ &rules->buf[rule->rule.filename_off],
+ rule->rule.filename_line);
+ break;
+ }
case TK_A_OWNER_ID:
if (event->owner_final)
break;
break;
if (cur->key.op == OP_ASSIGN_FINAL)
event->mode_final = true;
+ event->mode_set = true;
event->mode = cur->key.mode;
info(event->udev, "MODE %#o %s:%u\n",
event->mode,
rule->rule.filename_line);
break;
case TK_A_STATIC_NODE:
+ event->static_node = true;
break;
- case TK_A_ENV:
- {
- const char *name = &rules->buf[cur->key.attr_off];
- char *value = &rules->buf[cur->key.value_off];
-
- if (value[0] != '\0') {
- char temp_value[UTIL_NAME_SIZE];
- struct udev_list_entry *entry;
-
- udev_event_apply_format(event, value, temp_value, sizeof(temp_value));
- entry = udev_device_add_property(event->dev, name, temp_value);
- /* store in db, skip private keys */
- if (name[0] != '.')
- udev_list_entry_set_flags(entry, 1);
- } else {
- udev_device_add_property(event->dev, name, NULL);
- }
- break;
+ case TK_A_ENV: {
+ const char *name = &rules->buf[cur->key.attr_off];
+ char *value = &rules->buf[cur->key.value_off];
+
+ if (value[0] != '\0') {
+ char temp_value[UTIL_NAME_SIZE];
+ struct udev_list_entry *entry;
+
+ udev_event_apply_format(event, value, temp_value, sizeof(temp_value));
+ entry = udev_device_add_property(event->dev, name, temp_value);
+ /* store in db, skip private keys */
+ if (name[0] != '.')
+ udev_list_entry_set_num(entry, true);
+ } else {
+ udev_device_add_property(event->dev, name, NULL);
}
- case TK_A_TAG:
+ break;
+ }
+ case TK_A_TAG: {
+ char tag[UTIL_PATH_SIZE];
+ const char *p;
+
+ udev_event_apply_format(event, &rules->buf[cur->key.value_off], tag, sizeof(tag));
if (cur->key.op == OP_ASSIGN || cur->key.op == OP_ASSIGN_FINAL)
udev_device_cleanup_tags_list(event->dev);
- udev_device_add_tag(event->dev, &rules->buf[cur->key.value_off]);
+ for (p = tag; *p != '\0'; p++) {
+ if ((*p >= 'a' && *p <= 'z') ||
+ (*p >= 'A' && *p <= 'Z') ||
+ (*p >= '0' && *p <= '9') ||
+ *p == '-' || *p == '_')
+ continue;
+ err(event->udev, "ignoring invalid tag name '%s'\n", tag);
+ break;
+ }
+ udev_device_add_tag(event->dev, tag);
break;
- case TK_A_NAME:
- {
- const char *name = &rules->buf[cur->key.value_off];
- char name_str[UTIL_PATH_SIZE];
- int count;
+ }
+ case TK_A_NAME: {
+ const char *name = &rules->buf[cur->key.value_off];
+ char name_str[UTIL_PATH_SIZE];
+ int count;
- if (event->name_final)
- break;
- if (cur->key.op == OP_ASSIGN_FINAL)
- event->name_final = true;
- udev_event_apply_format(event, name, name_str, sizeof(name_str));
- if (esc == ESCAPE_UNSET || esc == ESCAPE_REPLACE) {
- count = udev_util_replace_chars(name_str, "/");
- if (count > 0)
- info(event->udev, "%i character(s) replaced\n", count);
- }
- free(event->name);
- event->name = strdup(name_str);
- info(event->udev, "NAME '%s' %s:%u\n",
- event->name,
- &rules->buf[rule->rule.filename_off],
- rule->rule.filename_line);
+ if (event->name_final)
break;
- }
- case TK_A_DEVLINK:
- {
- char temp[UTIL_PATH_SIZE];
- char filename[UTIL_PATH_SIZE];
- char *pos, *next;
- int count = 0;
-
- if (event->devlink_final)
- break;
- if (major(udev_device_get_devnum(event->dev)) == 0)
- break;
- if (cur->key.op == OP_ASSIGN_FINAL)
- event->devlink_final = true;
- if (cur->key.op == OP_ASSIGN || cur->key.op == OP_ASSIGN_FINAL)
- udev_device_cleanup_devlinks_list(event->dev);
-
- /* allow multiple symlinks separated by spaces */
- udev_event_apply_format(event, &rules->buf[cur->key.value_off], temp, sizeof(temp));
- if (esc == ESCAPE_UNSET)
- count = udev_util_replace_chars(temp, "/ ");
- else if (esc == ESCAPE_REPLACE)
- count = udev_util_replace_chars(temp, "/");
+ if (cur->key.op == OP_ASSIGN_FINAL)
+ event->name_final = true;
+ udev_event_apply_format(event, name, name_str, sizeof(name_str));
+ if (esc == ESCAPE_UNSET || esc == ESCAPE_REPLACE) {
+ count = util_replace_chars(name_str, "/");
if (count > 0)
- info(event->udev, "%i character(s) replaced\n" , count);
- dbg(event->udev, "rule applied, added symlink(s) '%s'\n", temp);
- pos = temp;
- while (isspace(pos[0]))
- pos++;
- next = strchr(pos, ' ');
- while (next != NULL) {
- next[0] = '\0';
- info(event->udev, "LINK '%s' %s:%u\n", pos,
- &rules->buf[rule->rule.filename_off], rule->rule.filename_line);
- util_strscpyl(filename, sizeof(filename), udev_get_dev_path(event->udev), "/", pos, NULL);
- udev_device_add_devlink(event->dev, filename, cur->key.devlink_unique);
- while (isspace(next[1]))
- next++;
- pos = &next[1];
- next = strchr(pos, ' ');
- }
- if (pos[0] != '\0') {
- info(event->udev, "LINK '%s' %s:%u\n", pos,
- &rules->buf[rule->rule.filename_off], rule->rule.filename_line);
- util_strscpyl(filename, sizeof(filename), udev_get_dev_path(event->udev), "/", pos, NULL);
- udev_device_add_devlink(event->dev, filename, cur->key.devlink_unique);
- }
+ info(event->udev, "%i character(s) replaced\n", count);
}
+ free(event->name);
+ event->name = strdup(name_str);
+ info(event->udev, "NAME '%s' %s:%u\n",
+ event->name,
+ &rules->buf[rule->rule.filename_off],
+ rule->rule.filename_line);
break;
- case TK_A_EVENT_TIMEOUT:
- udev_device_set_event_timeout(event->dev, cur->key.event_timeout);
- break;
- case TK_A_ATTR:
- {
- const char *key_name = &rules->buf[cur->key.attr_off];
- char attr[UTIL_PATH_SIZE];
- char value[UTIL_NAME_SIZE];
- FILE *f;
-
- if (util_resolve_subsys_kernel(event->udev, key_name, attr, sizeof(attr), 0) != 0)
- util_strscpyl(attr, sizeof(attr), udev_device_get_syspath(event->dev), "/", key_name, NULL);
- attr_subst_subdir(attr, sizeof(attr));
-
- udev_event_apply_format(event, &rules->buf[cur->key.value_off], value, sizeof(value));
- info(event->udev, "ATTR '%s' writing '%s' %s:%u\n", attr, value,
- &rules->buf[rule->rule.filename_off],
- rule->rule.filename_line);
- f = fopen(attr, "w");
- if (f != NULL) {
- if (fprintf(f, "%s", value) <= 0)
- err(event->udev, "error writing ATTR{%s}: %m\n", attr);
- fclose(f);
- } else {
- err(event->udev, "error opening ATTR{%s} for writing: %m\n", attr);
- }
+ }
+ case TK_A_DEVLINK: {
+ char temp[UTIL_PATH_SIZE];
+ char filename[UTIL_PATH_SIZE];
+ char *pos, *next;
+ int count = 0;
+
+ if (event->devlink_final)
break;
- }
- case TK_A_RUN:
- {
- struct udev_list_entry *list_entry;
-
- if (cur->key.op == OP_ASSIGN || cur->key.op == OP_ASSIGN_FINAL)
- udev_list_cleanup_entries(event->udev, &event->run_list);
- info(event->udev, "RUN '%s' %s:%u\n",
- &rules->buf[cur->key.value_off],
- &rules->buf[rule->rule.filename_off],
- rule->rule.filename_line);
- list_entry = udev_list_entry_add(event->udev, &event->run_list,
- &rules->buf[cur->key.value_off], NULL, 1, 0);
- if (cur->key.fail_on_error)
- udev_list_entry_set_flags(list_entry, 1);
+ if (major(udev_device_get_devnum(event->dev)) == 0)
break;
+ if (cur->key.op == OP_ASSIGN_FINAL)
+ event->devlink_final = true;
+ if (cur->key.op == OP_ASSIGN || cur->key.op == OP_ASSIGN_FINAL)
+ udev_device_cleanup_devlinks_list(event->dev);
+
+ /* allow multiple symlinks separated by spaces */
+ udev_event_apply_format(event, &rules->buf[cur->key.value_off], temp, sizeof(temp));
+ if (esc == ESCAPE_UNSET)
+ count = util_replace_chars(temp, "/ ");
+ else if (esc == ESCAPE_REPLACE)
+ count = util_replace_chars(temp, "/");
+ if (count > 0)
+ info(event->udev, "%i character(s) replaced\n" , count);
+ dbg(event->udev, "rule applied, added symlink(s) '%s'\n", temp);
+ pos = temp;
+ while (isspace(pos[0]))
+ pos++;
+ next = strchr(pos, ' ');
+ while (next != NULL) {
+ next[0] = '\0';
+ info(event->udev, "LINK '%s' %s:%u\n", pos,
+ &rules->buf[rule->rule.filename_off], rule->rule.filename_line);
+ util_strscpyl(filename, sizeof(filename), udev_get_dev_path(event->udev), "/", pos, NULL);
+ udev_device_add_devlink(event->dev, filename, cur->key.devlink_unique);
+ while (isspace(next[1]))
+ next++;
+ pos = &next[1];
+ next = strchr(pos, ' ');
+ }
+ if (pos[0] != '\0') {
+ info(event->udev, "LINK '%s' %s:%u\n", pos,
+ &rules->buf[rule->rule.filename_off], rule->rule.filename_line);
+ util_strscpyl(filename, sizeof(filename), udev_get_dev_path(event->udev), "/", pos, NULL);
+ udev_device_add_devlink(event->dev, filename, cur->key.devlink_unique);
+ }
+ break;
+ }
+ case TK_A_ATTR: {
+ const char *key_name = &rules->buf[cur->key.attr_off];
+ char attr[UTIL_PATH_SIZE];
+ char value[UTIL_NAME_SIZE];
+ FILE *f;
+
+ if (util_resolve_subsys_kernel(event->udev, key_name, attr, sizeof(attr), 0) != 0)
+ util_strscpyl(attr, sizeof(attr), udev_device_get_syspath(event->dev), "/", key_name, NULL);
+ attr_subst_subdir(attr, sizeof(attr));
+
+ udev_event_apply_format(event, &rules->buf[cur->key.value_off], value, sizeof(value));
+ info(event->udev, "ATTR '%s' writing '%s' %s:%u\n", attr, value,
+ &rules->buf[rule->rule.filename_off],
+ rule->rule.filename_line);
+ f = fopen(attr, "w");
+ if (f != NULL) {
+ if (fprintf(f, "%s", value) <= 0)
+ err(event->udev, "error writing ATTR{%s}: %m\n", attr);
+ fclose(f);
+ } else {
+ err(event->udev, "error opening ATTR{%s} for writing: %m\n", attr);
}
+ break;
+ }
+ case TK_A_RUN: {
+ if (cur->key.op == OP_ASSIGN || cur->key.op == OP_ASSIGN_FINAL)
+ udev_list_cleanup(&event->run_list);
+ info(event->udev, "RUN '%s' %s:%u\n",
+ &rules->buf[cur->key.value_off],
+ &rules->buf[rule->rule.filename_off],
+ rule->rule.filename_line);
+ udev_list_entry_add(&event->run_list, &rules->buf[cur->key.value_off], NULL);
+ break;
+ }
case TK_A_GOTO:
if (cur->key.rule_goto == 0)
break;
case TK_A_STATIC_NODE: {
char filename[UTIL_PATH_SIZE];
struct stat stats;
+
/* we assure, that the permissions tokens are sorted before the static token */
if (mode == 0 && uid == 0 && gid == 0)
goto next;
goto next;
if (!S_ISBLK(stats.st_mode) && !S_ISCHR(stats.st_mode))
goto next;
- if (mode != 0 && mode != (stats.st_mode & 0777)) {
+ if (mode == 0) {
+ if (gid > 0)
+ mode = 0660;
+ else
+ mode = 0600;
+ }
+ /* set sticky bit, so we do not remove the node on module unload */
+ mode |= 01000;
+ if (mode != (stats.st_mode & 01777)) {
chmod(filename, mode);
info(rules->udev, "chmod '%s' %#o\n", filename, mode);
}
+
if ((uid != 0 && uid != stats.st_uid) || (gid != 0 && gid != stats.st_gid)) {
chown(filename, uid, gid);
info(rules->udev, "chown '%s' %u %u\n", filename, uid, gid);
}
+
utimensat(AT_FDCWD, filename, NULL, 0);
break;
}
if (inotify_fd < 0)
return;
- util_strscpyl(oldname, sizeof(oldname), udev_get_dev_path(udev), "/.udev/watch.old", NULL);
- util_strscpyl(filename, sizeof(filename), udev_get_dev_path(udev), "/.udev/watch", NULL);
+ util_strscpyl(oldname, sizeof(oldname), udev_get_run_path(udev), "/watch.old", NULL);
+ util_strscpyl(filename, sizeof(filename), udev_get_run_path(udev), "/watch", NULL);
if (rename(filename, oldname) == 0) {
DIR *dir;
struct dirent *ent;
return;
}
- snprintf(filename, sizeof(filename), "%s/.udev/watch/%d", udev_get_dev_path(udev), wd);
+ snprintf(filename, sizeof(filename), "%s/watch/%d", udev_get_run_path(udev), wd);
util_create_path(udev, filename);
unlink(filename);
symlink(udev_device_get_id_filename(dev), filename);
info(udev, "removing watch on '%s'\n", udev_device_get_devnode(dev));
inotify_rm_watch(inotify_fd, wd);
- snprintf(filename, sizeof(filename), "%s/.udev/watch/%d", udev_get_dev_path(udev), wd);
+ snprintf(filename, sizeof(filename), "%s/watch/%d", udev_get_run_path(udev), wd);
unlink(filename);
udev_device_set_watch_handle(dev, -1);
if (inotify_fd < 0 || wd < 0)
return NULL;
- snprintf(filename, sizeof(filename), "%s/.udev/watch/%d", udev_get_dev_path(udev), wd);
+ snprintf(filename, sizeof(filename), "%s/watch/%d", udev_get_run_path(udev), wd);
s = majmin;
l = util_strpcpy(&s, sizeof(majmin), udev_get_sys_path(udev));
len = readlink(filename, s, l);
'\" t
.\" Title: udev
.\" Author: [see the "Author" section]
-.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
-.\" Date: 02/10/2011
+.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
+.\" Date: 10/19/2011
.\" Manual: udev
.\" Source: udev
.\" Language: English
.\"
-.TH "UDEV" "7" "02/10/2011" "udev" "udev"
+.TH "UDEV" "7" "10/19/2011" "udev" "udev"
+.\" -----------------------------------------------------------------
+.\" * Define some portability stuff
+.\" -----------------------------------------------------------------
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.\" http://bugs.debian.org/507673
+.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
/dev
directory, or renames network interfaces\&. The kernel usually just assigns unpredictable device names based on the order of discovery\&. Meaningful symlinks or network device names provide a way to reliably identify devices based on their properties or current configuration\&.
.PP
-The udev daemon
-\fBudevd\fR(8)
-receives device uevents directly from the kernel whenever a device is added or removed from the system, or it changes its state\&. When udev receives a device event, it matches its configured set of rules against various device attributes to identify the device\&. Rules that match, may provide additional device information to be stored in the udev database, or information to be used to create meaningful symlink names\&.
+The udev daemon,
+\fBudevd\fR(8), receives device uevents directly from the kernel whenever a device is added or removed from the system, or it changes its state\&. When udev receives a device event, it matches its configured set of rules against various device attributes to identify the device\&. Rules that match may provide additional device information to be stored in the udev database or to be used to create meaningful symlink names\&.
.PP
-All device information udev processes, is stored in the udev database and sent out to possible event subscribers\&. Access to all stored data and the event sources are provided by the library libudev\&.
+All device information udev processes is stored in the udev database and sent out to possible event subscribers\&. Access to all stored data and the event sources is provided by the library libudev\&.
.SH "CONFIGURATION"
.PP
udev configuration files are placed in
/etc/udev/
and
-/lib/udev/\&. All empty lines, or lines beginning with \'#\' will be ignored\&.
+/lib/udev/\&. All empty lines or lines beginning with \*(Aq#\*(Aq are ignored\&.
.SS "Configuration file"
.PP
udev expects its main configuration file at
/lib/udev/rules\&.d/, the custom rules directory
/etc/udev/rules\&.d/
and the temporary rules directory
-/dev/\&.udev/rules\&.d/\&. All rule files are sorted and processed in lexical order, regardless in which of these directories they live\&. Files in
+/run/udev/rules\&.d/\&. All rule files are collectively sorted and processed in lexical order, regardless of the directories in which they live\&. However, files in
/etc/udev/rules\&.d/
-have precedence over files with the same name in
-/lib/udev/rules\&.d/\&. This can be used to ignore a default rules file if needed\&.
+take precedence over files with the same name in
+/lib/udev/rules\&.d/; this can be used to ignore a default rules file if needed\&.
.PP
-Rule files must end in
-\&.rules, other extensions are ignored\&.
+Rule files must have the extension
+\&.rules; other extensions are ignored\&.
.PP
-Every line in the rules file contains at least one key value pair\&. There are two kind of keys, match and assignment keys\&. If all match keys are matching against its value, the rule gets applied and the assign keys get the specified value assigned\&.
+Every line in the rules file contains at least one key\-value pair\&. There are two kind of keys: match and assignment\&. If all match keys are matching against its value, the rule gets applied and the assignment keys get the specified value assigned\&.
.PP
A matching rule may rename a network interface, add symlinks pointing to the device node, or run a specified program as part of the event handling\&.
.PP
-A rule consists of a list of one or more key value pairs separated by a comma\&. Each key has a distinct operation, depending on the used operator\&. Valid operators are:
+A rule consists of a comma\-separated list of one or more key\-value pairs\&. Each key has a distinct operation, depending on the used operator\&. Valid operators are:
.PP
\fB==\fR
.RS 4
.PP
\fB=\fR
.RS 4
-Assign a value to a key\&. Keys that represent a list, are reset and only this single value is assigned\&.
+Assign a value to a key\&. Keys that represent a list are reset and only this single value is assigned\&.
.RE
.PP
\fB+=\fR
.PP
\fB:=\fR
.RS 4
-Assign a value to a key finally; disallow any later changes, which may be used to prevent changes by any later rules\&.
+Assign a value to a key finally; disallow any later changes\&.
.RE
.PP
The following key names can be used to match against device properties\&. Some of the keys also match against properties of the parent devices in sysfs, not only the device that has generated the event\&. If multiple keys that match a parent device are specified in a single rule, all these keys must match at one and the same parent device\&.
.PP
\fBDRIVER\fR
.RS 4
-Match the driver name of the event device\&. Only set for devices which are bound to a driver at the time the event is generated\&.
+Match the driver name of the event device\&. Only set this key for devices which are bound to a driver at the time the event is generated\&.
.RE
.PP
\fBATTR{\fR\fB\fIfilename\fR\fR\fB}\fR
.RS 4
-Match sysfs attribute values of the event device\&. Trailing whitespace in the attribute values is ignored, if the specified match value does not contain trailing whitespace itself\&.
+Match sysfs attribute values of the event device\&. Trailing whitespace in the attribute values is ignored unless the specified match value itself contains trailing whitespace\&.
.RE
.PP
\fBKERNELS\fR
.RS 4
Search the devpath upwards for a device with matching sysfs attribute values\&. If multiple
\fBATTRS\fR
-matches are specified, all of them must match on the same device\&. Trailing whitespace in the attribute values is ignored, if the specified match value does not contain trailing whitespace itself\&.
+matches are specified, all of them must match on the same device\&. Trailing whitespace in the attribute values is ignored unless the specified match value itself contains trailing whitespace\&.
+.RE
+.PP
+\fBTAGS\fR
+.RS 4
+Search the devpath upwards for a device with matching tag\&.
.RE
.PP
\fBENV{\fR\fB\fIkey\fR\fR\fB}\fR
.PP
\fBPROGRAM\fR
.RS 4
-Execute a program\&. The key is true, if the program returns successfully\&. The device properties are made available to the executed program in the environment\&. The program\'s output printed to stdout, is available in the RESULT key\&.
+Execute a program to determine whether there is a match; the key is true if the program returns successfully\&. The device properties are made available to the executed program in the environment\&. The program\*(Aqs stdout is available in the RESULT key\&.
.RE
.PP
\fBRESULT\fR
Match the returned string of the last PROGRAM call\&. This key can be used in the same or in any later rule after a PROGRAM call\&.
.RE
.PP
-Most of the fields support a shell style pattern matching\&. The following pattern characters are supported:
+Most of the fields support shell\-style pattern matching\&. The following pattern characters are supported:
.PP
\fB*\fR
.RS 4
-Matches zero, or any number of characters\&.
+Matches zero or more characters\&.
.RE
.PP
\fB?\fR
.PP
\fB[]\fR
.RS 4
-Matches any single character specified within the brackets\&. For example, the pattern string \'tty[SR]\' would match either \'ttyS\' or \'ttyR\'\&. Ranges are also supported within this match with the \'\-\' character\&. For example, to match on the range of all digits, the pattern [0\-9] would be used\&. If the first character following the \'[\' is a \'!\', any characters not enclosed are matched\&.
+Matches any single character specified within the brackets\&. For example, the pattern string \*(Aqtty[SR]\*(Aq would match either \*(AqttyS\*(Aq or \*(AqttyR\*(Aq\&. Ranges are also supported via the \*(Aq\-\*(Aq character\&. For example, to match on the range of all digits, the pattern [0\-9] could be used\&. If the first character following the \*(Aq[\*(Aq is a \*(Aq!\*(Aq, any characters not enclosed are matched\&.
.RE
.PP
The following keys can get values assigned:
.PP
\fBNAME\fR
.RS 4
-The name, a network interface should be renamed to\&. Or as a temporary workaround, the name a device node should be named\&. Usually the kernel provides the defined node name, or even creates and removes the node before udev even receives any event\&. Changing the node name from the kernel\'s default creates inconsistencies and is not supported\&. If the kernel and NAME specify different names, an error will be logged\&. Udev is only expected to handle device node permissions and to create additional symlinks, not to change kernel\-provided device node names\&. Instead of renaming a device node, SYMLINK should be used\&. Symlink names must never conflict with device node names, it will result in unpredictable behavior\&.
+What a network interface should be named\&.
+.sp
+Also, as a temporary workaround, this is what a device node should be named; usually the kernel provides the defined node name or creates and removes the node before udev even receives any event\&. Changing the node name from the kernel\*(Aqs default creates inconsistencies and is not supported\&. If the kernel and NAME specify different names, an error is logged\&. udev is only expected to handle device node permissions and to create additional symlinks, not to change kernel\-provided device node names\&. Instead of renaming a device node, SYMLINK should be used\&. However, symlink names must never conflict with device node names, as that would result in unpredictable behavior\&.
.RE
.PP
\fBSYMLINK\fR
.RS 4
-The name of a symlink targeting the node\&. Every matching rule will add this value to the list of symlinks to be created\&. Multiple symlinks may be specified by separating the names by the space character\&. In case multiple devices claim the same name, the link will always point to the device with the highest link_priority\&. If the current device goes away, the links will be re\-evaluated and the device with the next highest link_priority will own the link\&. If no link_priority is specified, the order of the devices, and which one of them will own the link, is undefined\&. Claiming the same name for a symlink, which is or might be used for a device node, may result in unexpected behavior and is not supported\&.
+The name of a symlink targeting the node\&. Every matching rule adds this value to the list of symlinks to be created\&. Multiple symlinks may be specified by separating the names by the space character\&. In case multiple devices claim the same name, the link always points to the device with the highest link_priority\&. If the current device goes away, the links are re\-evaluated and the device with the next highest link_priority becomes the owner of the link\&. If no link_priority is specified, the order of the devices (and which one of them owns the link) is undefined\&. Also, symlink names must never conflict with the kernel\*(Aqs default device node names, as that would result in unpredictable behavior\&.
.RE
.PP
\fBOWNER, GROUP, MODE\fR
.PP
\fBENV{\fR\fB\fIkey\fR\fR\fB}\fR
.RS 4
-Set a device property value\&. Property names with a leading \'\&.\' are not stored in the database or exported to external tool or events\&.
+Set a device property value\&. Property names with a leading \*(Aq\&.\*(Aq are neither stored in the database nor exported to events or external tools (run by, say, the PROGRAM match key)\&.
.RE
.PP
\fBTAG\fR
.RS 4
-Attach a tag to a device\&. This is used to filter events for users of libudev\'s monitor functionality, or to enumerate a group of tagged devices\&. The implementation can only work efficiently if only a few tags are attached to a device\&. It is only meant to be used in contexts with specific device filter requirements, and not as a general\-purpose flag\&. Excessive use might result in inefficient event handling\&.
+Attach a tag to a device\&. This is used to filter events for users of libudev\*(Aqs monitor functionality, or to enumerate a group of tagged devices\&. The implementation can only work efficiently if only a few tags are attached to a device\&. It is only meant to be used in contexts with specific device filter requirements, and not as a general\-purpose flag\&. Excessive use might result in inefficient event handling\&.
.RE
.PP
\fBRUN\fR
.RS 4
-Add a program to the list of programs to be executed for a specific device\&. This can only be used for very short running tasks\&. Running an event process for a long period of time may block all further events for this or a dependent device\&. Long running tasks need to be immediately detached from the event process itself\&. If the option
-\fBRUN{\fR\fB\fIfail_event_on_error\fR\fR\fB}\fR
-is specified, and the executed program returns non\-zero, the event will be marked as failed for a possible later handling\&.
+Add a program to the list of programs to be executed for a specific device\&. This can only be used for very short running tasks\&. Running an event process for a long period of time may block all further events for this or a dependent device\&. Long running tasks need to be immediately detached from the event process itself\&.
.sp
-If no absolute path is given, the program is expected to live in
-/lib/udev, otherwise the absolute path must be specified\&. Program name and arguments are separated by spaces\&. Single quotes can be used to specify arguments with spaces\&.
+If no absolute path is given, the program is expected to live in the directory provided at compile\-time to configure via \-\-libexecdir (this is usually
+/lib/udev), otherwise the absolute path must be specified\&. The program name and following arguments are separated by spaces\&. Single quotes can be used to specify arguments with spaces\&.
.RE
.PP
\fBLABEL\fR
.RS 4
-Named label where a GOTO can jump to\&.
+A named label to which a GOTO may jump\&.
.RE
.PP
\fBGOTO\fR
.RS 4
-Jumps to the next LABEL with a matching name
+Jumps to the next LABEL with a matching name\&.
.RE
.PP
\fBIMPORT{\fR\fB\fItype\fR\fR\fB}\fR
.PP
\fBfile\fR
.RS 4
-Import a text file specified as the assigned value, which must be in environment key format\&.
+Import a text file specified as the assigned value, the content of which must be in environment key format\&.
.RE
.PP
\fBdb\fR
.PP
\fBcmdline\fR
.RS 4
-Import a single property from the kernel commandline\&. For simple flags the value of the property will be set to \'1\'\&.
+Import a single property from the kernel command line\&. For simple flags the value of the property is set to \*(Aq1\*(Aq\&.
.RE
.PP
\fBparent\fR
\fBIMPORT{parent}\fR
is used as a filter of key names to import (with the same shell\-style pattern matching used for comparisons)\&.
.RE
-.sp
-If no option is given, udev will choose between
-\fBprogram\fR
-and
-\fBfile\fR
-based on the executable bit of the file permissions\&.
.RE
.PP
\fBWAIT_FOR\fR
.RS 4
-Wait for a file to become available or until a 10 seconds timeout expires\&. The path is relative to the sysfs device, i\&. e\&. if no path is specified this waits for an attribute to appear\&.
+Wait for a file to become available or until a timeout of 10 seconds expires\&. The path is relative to the sysfs device; if no path is specified, this waits for an attribute to appear\&.
.RE
.PP
\fBOPTIONS\fR
.PP
\fBevent_timeout=\fR
.RS 4
-Number of seconds an event will wait for operations to finish, before it will terminate itself\&.
+Number of seconds an event waits for operations to finish before giving up and terminating itself\&.
.RE
.PP
\fBstring_escape=\fR\fB\fInone|replace\fR\fR
.PP
\fBstatic_node=\fR
.RS 4
-Apply the permissions specified in this rule to a static device node with the specified name\&. Static device nodes might be provided by kernel modules, or copied from
-/lib/udev/devices\&. These nodes might not have a corresponding kernel device at the time udevd is started, and allow to trigger automatic kernel module on\-demand loading\&.
+Apply the permissions specified in this rule to the static device node with the specified name\&. Static device nodes might be provided by kernel modules or copied from
+/lib/udev/devices\&. These nodes might not have a corresponding kernel device at the time udevd is started; they can trigger automatic kernel module loading\&.
.RE
.PP
\fBwatch\fR
.RS 4
-Watch the device node with inotify, when closed after being opened for writing, a change uevent will be synthesised\&.
+Watch the device node with inotify; when the node is closed after being opened for writing, a change uevent is synthesized\&.
.RE
.PP
\fBnowatch\fR
\fBMODE\fR
and
\fBRUN\fR
-fields support simple printf\-like string substitutions\&. The
+fields support simple string substitutions\&. The
\fBRUN\fR
-format chars gets applied after all rules have been processed, right before the program is executed\&. It allows the use of device properties set by earlier matching rules\&. For all other fields, substitutions are applied while the individual rule is being processed\&. The available substitutions are:
+substitutions are performed after all rules have been processed, right before the program is executed, allowing for the use of device properties set by earlier matching rules\&. For all other fields, substitutions are performed while the individual rule is being processed\&. The available substitutions are:
.PP
\fB$kernel\fR, \fB%k\fR
.RS 4
.PP
\fB$number\fR, \fB%n\fR
.RS 4
-The kernel number for this device\&. For example, \'sda3\' has kernel number of \'3\'
+The kernel number for this device\&. For example, \*(Aqsda3\*(Aq has kernel number of \*(Aq3\*(Aq
.RE
.PP
\fB$devpath\fR, \fB%p\fR
.PP
\fB$attr{\fR\fB\fIfile\fR\fR\fB}\fR, \fB%s{\fR\fB\fIfile\fR\fR\fB}\fR
.RS 4
-The value of a sysfs attribute found at the device, where all keys of the rule have matched\&. If the matching device does not have such an attribute, and a previous KERNELS, SUBSYSTEMS, DRIVERS, or ATTRS test selected a parent device, use the attribute from that parent device\&. If the attribute is a symlink, the last element of the symlink target is returned as the value\&.
+The value of a sysfs attribute found at the device where all keys of the rule have matched\&. If the matching device does not have such an attribute, and a previous KERNELS, SUBSYSTEMS, DRIVERS, or ATTRS test selected a parent device, then the attribute from that parent device is used\&.
+.sp
+If the attribute is a symlink, the last element of the symlink target is returned as the value\&.
.RE
.PP
\fB$env{\fR\fB\fIkey\fR\fR\fB}\fR, \fB%E{\fR\fB\fIkey\fR\fR\fB}\fR
.PP
\fB$result\fR, \fB%c\fR
.RS 4
-The string returned by the external program requested with PROGRAM\&. A single part of the string, separated by a space character may be selected by specifying the part number as an attribute:
-\fB%c{N}\fR\&. If the number is followed by the \'+\' char this part plus all remaining parts of the result string are substituted:
+The string returned by the external program requested with PROGRAM\&. A single part of the string, separated by a space character, may be selected by specifying the part number as an attribute:
+\fB%c{N}\fR\&. If the number is followed by the \*(Aq+\*(Aq character, this part plus all remaining parts of the result string are substituted:
\fB%c{N+}\fR
.RE
.PP
.PP
\fB$links\fR
.RS 4
-The current list of symlinks, separated by a space character\&. The value is only set if an earlier rule assigned a value, or during a remove events\&.
+A space\-separated list of the current symlinks\&. The value is only set during a remove event or if an earlier rule assigned a value\&.
.RE
.PP
\fB$root\fR, \fB%r\fR
.PP
\fB$tempnode\fR, \fB%N\fR
.RS 4
-The name of a created temporary device node to provide access to the device from a external program before the real node is created\&.
+The name of a temporary device node created to provide access to the device from a external program before the real node is created\&.
.RE
.PP
\fB%%\fR
.RS 4
-The \'%\' character itself\&.
+The \*(Aq%\*(Aq character itself\&.
.RE
.PP
\fB$$\fR
.RS 4
-The \'$\' character itself\&.
+The \*(Aq$\*(Aq character itself\&.
.RE
.SH "AUTHOR"
.PP
#include "libudev.h"
#include "libudev-private.h"
-#define DEFAULT_FAKE_PARTITIONS_COUNT 15
-#define UDEV_EVENT_TIMEOUT 180
-
-#define UDEV_CTRL_SOCK_PATH "@/org/kernel/udev/udevd"
-
struct udev_event {
struct udev *udev;
struct udev_device *dev;
mode_t mode;
uid_t uid;
gid_t gid;
- char *smack;
- struct udev_list_node run_list;
+ struct udev_list run_list;
int exec_delay;
+ unsigned long long birth_usec;
+ unsigned long long timeout_usec;
+ int fd_signal;
+ unsigned int builtin_run;
+ unsigned int builtin_ret;
+ bool sigterm;
bool inotify_watch;
bool inotify_watch_final;
bool group_final;
bool owner_final;
- bool smack_final;
+ bool mode_set;
bool mode_final;
+ bool static_node;
bool name_final;
bool devlink_final;
bool run_final;
struct udev_rules;
struct udev_rules *udev_rules_new(struct udev *udev, int resolve_names);
void udev_rules_unref(struct udev_rules *rules);
-int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event);
+int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event, const sigset_t *sigmask);
void udev_rules_apply_static_dev_perms(struct udev_rules *rules);
/* udev-event.c */
struct udev_event *udev_event_new(struct udev_device *dev);
void udev_event_unref(struct udev_event *event);
-int udev_event_execute_rules(struct udev_event *event, struct udev_rules *rules);
-int udev_event_execute_run(struct udev_event *event, const sigset_t *sigset);
size_t udev_event_apply_format(struct udev_event *event, const char *src, char *dest, size_t size);
int udev_event_apply_subsys_kernel(struct udev_event *event, const char *string,
char *result, size_t maxsize, int read_value);
+int udev_event_spawn(struct udev_event *event,
+ const char *cmd, char **envp, const sigset_t *sigmask,
+ char *result, size_t ressize);
+int udev_event_execute_rules(struct udev_event *event, struct udev_rules *rules, const sigset_t *sigset);
+int udev_event_execute_run(struct udev_event *event, const sigset_t *sigset);
/* udev-watch.c */
int udev_watch_init(struct udev *udev);
struct udev_device *udev_watch_lookup(struct udev *udev, int wd);
/* udev-node.c */
-int udev_node_mknod(struct udev_device *dev, const char *file, mode_t mode, uid_t uid, gid_t gid, const char *smack);
-int udev_node_add(struct udev_device *dev, mode_t mode, uid_t uid, gid_t gid, const char *smack);
+int udev_node_mknod(struct udev_device *dev, const char *file, mode_t mode, uid_t uid, gid_t gid);
+int udev_node_add(struct udev_device *dev, mode_t mode, uid_t uid, gid_t gid);
int udev_node_remove(struct udev_device *dev);
void udev_node_update_old_links(struct udev_device *dev, struct udev_device *dev_old);
+/* udev-ctrl.c */
+struct udev_ctrl;
+struct udev_ctrl *udev_ctrl_new(struct udev *udev);
+struct udev_ctrl *udev_ctrl_new_from_fd(struct udev *udev, int fd);
+int udev_ctrl_enable_receiving(struct udev_ctrl *uctrl);
+struct udev_ctrl *udev_ctrl_ref(struct udev_ctrl *uctrl);
+struct udev_ctrl *udev_ctrl_unref(struct udev_ctrl *uctrl);
+int udev_ctrl_cleanup(struct udev_ctrl *uctrl);
+struct udev *udev_ctrl_get_udev(struct udev_ctrl *uctrl);
+int udev_ctrl_get_fd(struct udev_ctrl *uctrl);
+int udev_ctrl_send_set_log_level(struct udev_ctrl *uctrl, int priority, int timeout);
+int udev_ctrl_send_stop_exec_queue(struct udev_ctrl *uctrl, int timeout);
+int udev_ctrl_send_start_exec_queue(struct udev_ctrl *uctrl, int timeout);
+int udev_ctrl_send_reload_rules(struct udev_ctrl *uctrl, int timeout);
+int udev_ctrl_send_ping(struct udev_ctrl *uctrl, int timeout);
+int udev_ctrl_send_exit(struct udev_ctrl *uctrl, int timeout);
+int udev_ctrl_send_set_env(struct udev_ctrl *uctrl, const char *key, int timeout);
+int udev_ctrl_send_set_children_max(struct udev_ctrl *uctrl, int count, int timeout);
+struct udev_ctrl_connection;
+struct udev_ctrl_connection *udev_ctrl_get_connection(struct udev_ctrl *uctrl);
+struct udev_ctrl_connection *udev_ctrl_connection_ref(struct udev_ctrl_connection *conn);
+struct udev_ctrl_connection *udev_ctrl_connection_unref(struct udev_ctrl_connection *conn);
+struct udev_ctrl_msg;
+struct udev_ctrl_msg *udev_ctrl_receive_msg(struct udev_ctrl_connection *conn);
+struct udev_ctrl_msg *udev_ctrl_msg_ref(struct udev_ctrl_msg *ctrl_msg);
+struct udev_ctrl_msg *udev_ctrl_msg_unref(struct udev_ctrl_msg *ctrl_msg);
+int udev_ctrl_get_set_log_level(struct udev_ctrl_msg *ctrl_msg);
+int udev_ctrl_get_stop_exec_queue(struct udev_ctrl_msg *ctrl_msg);
+int udev_ctrl_get_start_exec_queue(struct udev_ctrl_msg *ctrl_msg);
+int udev_ctrl_get_reload_rules(struct udev_ctrl_msg *ctrl_msg);
+int udev_ctrl_get_ping(struct udev_ctrl_msg *ctrl_msg);
+int udev_ctrl_get_exit(struct udev_ctrl_msg *ctrl_msg);
+const char *udev_ctrl_get_set_env(struct udev_ctrl_msg *ctrl_msg);
+int udev_ctrl_get_set_children_max(struct udev_ctrl_msg *ctrl_msg);
+
/* udevadm commands */
-int udevadm_monitor(struct udev *udev, int argc, char *argv[]);
-int udevadm_info(struct udev *udev, int argc, char *argv[]);
-int udevadm_control(struct udev *udev, int argc, char *argv[]);
-int udevadm_trigger(struct udev *udev, int argc, char *argv[]);
-int udevadm_settle(struct udev *udev, int argc, char *argv[]);
-int udevadm_test(struct udev *udev, int argc, char *argv[]);
+struct udevadm_cmd {
+ const char *name;
+ int (*cmd)(struct udev *udev, int argc, char *argv[]);
+ const char *help;
+ int debug;
+};
+extern const struct udevadm_cmd udevadm_monitor;
+extern const struct udevadm_cmd udevadm_info;
+extern const struct udevadm_cmd udevadm_control;
+extern const struct udevadm_cmd udevadm_trigger;
+extern const struct udevadm_cmd udevadm_settle;
+extern const struct udevadm_cmd udevadm_test;
+extern const struct udevadm_cmd udevadm_test_builtin;
+
+/* built-in commands */
+enum udev_builtin_cmd {
+ UDEV_BUILTIN_PATH_ID,
+ UDEV_BUILTIN_USB_ID,
+ UDEV_BUILTIN_INPUT_ID,
+ UDEV_BUILTIN_MODALIAS_MATCH,
+ UDEV_BUILTIN_MAX
+};
+struct udev_builtin {
+ const char *name;
+ int (*cmd)(struct udev_device *dev, bool test);
+ const char *help;
+};
+extern const struct udev_builtin udev_builtin_path_id;
+extern const struct udev_builtin udev_builtin_usb_id;
+extern const struct udev_builtin udev_builtin_input_id;
+enum udev_builtin_cmd udev_builtin_lookup(const char *name);
+const char *udev_builtin_name(enum udev_builtin_cmd cmd);
+int udev_builtin_run(struct udev_device *dev, enum udev_builtin_cmd cmd, bool test);
+int udev_builtin_list(struct udev *udev);
+int udev_builtin_add_property(struct udev_device *dev, bool test, const char *key, const char *val, ...);
#endif
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>udev</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"/></head><body><div class="refentry" title="udev"><a id="udev"/><div class="titlepage"/><div class="refnamediv"><h2>Name</h2><p>udev — Linux dynamic device management</p></div><div class="refsect1" title="Description"><a id="id278021"/><h2>Description</h2><p>udev supplies the system software with device events, manages permissions
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>udev</title><meta name="generator" content="DocBook XSL Stylesheets V1.76.1"/></head><body><div class="refentry" title="udev"><a id="udev"/><div class="titlepage"/><div class="refnamediv"><h2>Name</h2><p>udev — Linux dynamic device management</p></div><div class="refsect1" title="Description"><a id="id400346"/><h2>Description</h2><p>udev supplies the system software with device events, manages permissions
of device nodes and may create additional symlinks in the <code class="filename">/dev</code>
directory, or renames network interfaces. The kernel usually just assigns unpredictable
device names based on the order of discovery. Meaningful symlinks or network device
names provide a way to reliably identify devices based on their properties or
- current configuration.</p><p>The udev daemon <span class="citerefentry"><span class="refentrytitle">udevd</span>(8)</span> receives device uevents directly from
+ current configuration.</p><p>The udev daemon, <span class="citerefentry"><span class="refentrytitle">udevd</span>(8)</span>, receives device uevents directly from
the kernel whenever a device is added or removed from the system, or it changes its
state. When udev receives a device event, it matches its configured set of rules
- against various device attributes to identify the device. Rules that match, may
- provide additional device information to be stored in the udev database, or information
- to be used to create meaningful symlink names.</p><p>All device information udev processes, is stored in the udev database and
+ against various device attributes to identify the device. Rules that match may
+ provide additional device information to be stored in the udev database or
+ to be used to create meaningful symlink names.</p><p>All device information udev processes is stored in the udev database and
sent out to possible event subscribers. Access to all stored data and the event
- sources are provided by the library libudev.</p></div><div class="refsect1" title="Configuration"><a id="id310199"/><h2>Configuration</h2><p>udev configuration files are placed in <code class="filename">/etc/udev/</code>
- and <code class="filename">/lib/udev/</code>. All empty lines, or lines beginning with
- '#' will be ignored.</p><div class="refsect2" title="Configuration file"><a id="id310220"/><h3>Configuration file</h3><p>udev expects its main configuration file at <code class="filename">/etc/udev/udev.conf</code>.
+ sources is provided by the library libudev.</p></div><div class="refsect1" title="Configuration"><a id="id432135"/><h2>Configuration</h2><p>udev configuration files are placed in <code class="filename">/etc/udev/</code>
+ and <code class="filename">/lib/udev/</code>. All empty lines or lines beginning with
+ '#' are ignored.</p><div class="refsect2" title="Configuration file"><a id="id432154"/><h3>Configuration file</h3><p>udev expects its main configuration file at <code class="filename">/etc/udev/udev.conf</code>.
It consists of a set of variables allowing the user to override default udev values.
The following variables can be set:</p><div class="variablelist"><dl><dt><span class="term"><code class="option">udev_root</code></span></dt><dd><p>Specifies where to place the device nodes in the filesystem.
The default value is <code class="filename">/dev</code>.</p></dd><dt><span class="term"><code class="option">udev_log</code></span></dt><dd><p>The logging priority. Valid values are the numerical syslog priorities
or their textual representations: <code class="option">err</code>, <code class="option">info</code>
- and <code class="option">debug</code>.</p></dd></dl></div></div><div class="refsect2" title="Rules files"><a id="id310294"/><h3>Rules files</h3><p>The udev rules are read from the files located in the
+ and <code class="option">debug</code>.</p></dd></dl></div></div><div class="refsect2" title="Rules files"><a id="id432222"/><h3>Rules files</h3><p>The udev rules are read from the files located in the
default rules directory <code class="filename">/lib/udev/rules.d/</code>,
the custom rules directory <code class="filename">/etc/udev/rules.d/</code>
- and the temporary rules directory <code class="filename">/dev/.udev/rules.d/</code>.
- All rule files are sorted and processed in lexical order, regardless
- in which of these directories they live. Files in
- <code class="filename">/etc/udev/rules.d/</code> have precedence over files with
- the same name in <code class="filename">/lib/udev/rules.d/</code>. This can be
- used to ignore a default rules file if needed.</p><p>Rule files must end in <code class="filename">.rules</code>, other extensions
- are ignored.</p><p>Every line in the rules file contains at least one key value pair.
- There are two kind of keys, match and assignment keys.
+ and the temporary rules directory <code class="filename">/run/udev/rules.d/</code>.
+ All rule files are collectively sorted and processed in lexical order,
+ regardless of the directories in which they live. However, files in
+ <code class="filename">/etc/udev/rules.d/</code> take precedence over files with
+ the same name in <code class="filename">/lib/udev/rules.d/</code>; this can be
+ used to ignore a default rules file if needed.</p><p>Rule files must have the extension <code class="filename">.rules</code>; other
+ extensions are ignored.</p><p>Every line in the rules file contains at least one key-value pair.
+ There are two kind of keys: match and assignment.
If all match keys are matching against its value, the rule gets applied and the
- assign keys get the specified value assigned.</p><p>A matching rule may rename a network interface, add symlinks
+ assignment keys get the specified value assigned.</p><p>A matching rule may rename a network interface, add symlinks
pointing to the device node, or run a specified program as part of
- the event handling.</p><p>A rule consists of a list of one or more key value pairs separated by
- a comma. Each key has a distinct operation, depending on the used operator. Valid
- operators are:</p><div class="variablelist"><dl><dt><span class="term"><code class="option">==</code></span></dt><dd><p>Compare for equality.</p></dd><dt><span class="term"><code class="option">!=</code></span></dt><dd><p>Compare for inequality.</p></dd><dt><span class="term"><code class="option">=</code></span></dt><dd><p>Assign a value to a key. Keys that represent a list, are reset
- and only this single value is assigned.</p></dd><dt><span class="term"><code class="option">+=</code></span></dt><dd><p>Add the value to a key that holds a list of entries.</p></dd><dt><span class="term"><code class="option">:=</code></span></dt><dd><p>Assign a value to a key finally; disallow any later changes,
- which may be used to prevent changes by any later rules.</p></dd></dl></div><p>The following key names can be used to match against device properties.
+ the event handling.</p><p>A rule consists of a comma-separated list of one or more key-value pairs.
+ Each key has a distinct operation, depending on the used operator. Valid
+ operators are:</p><div class="variablelist"><dl><dt><span class="term"><code class="option">==</code></span></dt><dd><p>Compare for equality.</p></dd><dt><span class="term"><code class="option">!=</code></span></dt><dd><p>Compare for inequality.</p></dd><dt><span class="term"><code class="option">=</code></span></dt><dd><p>Assign a value to a key. Keys that represent a list are reset
+ and only this single value is assigned.</p></dd><dt><span class="term"><code class="option">+=</code></span></dt><dd><p>Add the value to a key that holds a list of entries.</p></dd><dt><span class="term"><code class="option">:=</code></span></dt><dd><p>Assign a value to a key finally; disallow any later changes.</p></dd></dl></div><p>The following key names can be used to match against device properties.
Some of the keys also match against properties of the parent devices in sysfs,
not only the device that has generated the event. If multiple keys that match
a parent device are specified in a single rule, all these keys must match at
rules.</p></dd><dt><span class="term"><code class="option">SYMLINK</code></span></dt><dd><p>Match the name of a symlink targeting the node. It can
be used once a SYMLINK key has been set in one of the preceding
rules. There may be multiple symlinks; only one needs to match.
- </p></dd><dt><span class="term"><code class="option">SUBSYSTEM</code></span></dt><dd><p>Match the subsystem of the event device.</p></dd><dt><span class="term"><code class="option">DRIVER</code></span></dt><dd><p>Match the driver name of the event device. Only set for devices
+ </p></dd><dt><span class="term"><code class="option">SUBSYSTEM</code></span></dt><dd><p>Match the subsystem of the event device.</p></dd><dt><span class="term"><code class="option">DRIVER</code></span></dt><dd><p>Match the driver name of the event device. Only set this key for devices
which are bound to a driver at the time the event is generated.</p></dd><dt><span class="term"><code class="option">ATTR{<em class="replaceable"><code>filename</code></em>}</code></span></dt><dd><p>Match sysfs attribute values of the event device. Trailing
- whitespace in the attribute values is ignored, if the specified match
- value does not contain trailing whitespace itself.
+ whitespace in the attribute values is ignored unless the specified match
+ value itself contains trailing whitespace.
</p></dd><dt><span class="term"><code class="option">KERNELS</code></span></dt><dd><p>Search the devpath upwards for a matching device name.</p></dd><dt><span class="term"><code class="option">SUBSYSTEMS</code></span></dt><dd><p>Search the devpath upwards for a matching device subsystem name.</p></dd><dt><span class="term"><code class="option">DRIVERS</code></span></dt><dd><p>Search the devpath upwards for a matching device driver name.</p></dd><dt><span class="term"><code class="option">ATTRS{<em class="replaceable"><code>filename</code></em>}</code></span></dt><dd><p>Search the devpath upwards for a device with matching sysfs attribute values.
If multiple <code class="option">ATTRS</code> matches are specified, all of them
- must match on the same device. Trailing whitespace in the attribute values is ignored,
- if the specified match value does not contain trailing whitespace itself.</p></dd><dt><span class="term"><code class="option">ENV{<em class="replaceable"><code>key</code></em>}</code></span></dt><dd><p>Match against a device property value.</p></dd><dt><span class="term"><code class="option">TAG</code></span></dt><dd><p>Match against a device tag.</p></dd><dt><span class="term"><code class="option">TEST{<em class="replaceable"><code>octal mode mask</code></em>}</code></span></dt><dd><p>Test the existence of a file. An octal mode mask can be specified
- if needed.</p></dd><dt><span class="term"><code class="option">PROGRAM</code></span></dt><dd><p>Execute a program. The key is true, if the program returns
+ must match on the same device. Trailing whitespace in the attribute values is ignored
+ unless the specified match value itself contains trailing whitespace.</p></dd><dt><span class="term"><code class="option">TAGS</code></span></dt><dd><p>Search the devpath upwards for a device with matching tag.</p></dd><dt><span class="term"><code class="option">ENV{<em class="replaceable"><code>key</code></em>}</code></span></dt><dd><p>Match against a device property value.</p></dd><dt><span class="term"><code class="option">TAG</code></span></dt><dd><p>Match against a device tag.</p></dd><dt><span class="term"><code class="option">TEST{<em class="replaceable"><code>octal mode mask</code></em>}</code></span></dt><dd><p>Test the existence of a file. An octal mode mask can be specified
+ if needed.</p></dd><dt><span class="term"><code class="option">PROGRAM</code></span></dt><dd><p>Execute a program to determine whether there
+ is a match; the key is true if the program returns
successfully. The device properties are made available to the
- executed program in the environment. The program's output printed to
- stdout, is available in the RESULT key.</p></dd><dt><span class="term"><code class="option">RESULT</code></span></dt><dd><p>Match the returned string of the last PROGRAM call. This key can
- be used in the same or in any later rule after a PROGRAM call.</p></dd></dl></div><p>Most of the fields support a shell style pattern matching. The following
- pattern characters are supported:</p><div class="variablelist"><dl><dt><span class="term"><code class="option">*</code></span></dt><dd><p>Matches zero, or any number of characters.</p></dd><dt><span class="term"><code class="option">?</code></span></dt><dd><p>Matches any single character.</p></dd><dt><span class="term"><code class="option">[]</code></span></dt><dd><p>Matches any single character specified within the brackets. For
+ executed program in the environment. The program's stdout
+ is available in the RESULT key.</p></dd><dt><span class="term"><code class="option">RESULT</code></span></dt><dd><p>Match the returned string of the last PROGRAM call. This key can
+ be used in the same or in any later rule after a PROGRAM call.</p></dd></dl></div><p>Most of the fields support shell-style pattern matching. The following
+ pattern characters are supported:</p><div class="variablelist"><dl><dt><span class="term"><code class="option">*</code></span></dt><dd><p>Matches zero or more characters.</p></dd><dt><span class="term"><code class="option">?</code></span></dt><dd><p>Matches any single character.</p></dd><dt><span class="term"><code class="option">[]</code></span></dt><dd><p>Matches any single character specified within the brackets. For
example, the pattern string 'tty[SR]' would match either 'ttyS' or 'ttyR'.
- Ranges are also supported within this match with the '-' character.
- For example, to match on the range of all digits, the pattern [0-9] would
+ Ranges are also supported via the '-' character.
+ For example, to match on the range of all digits, the pattern [0-9] could
be used. If the first character following the '[' is a '!', any characters
- not enclosed are matched.</p></dd></dl></div><p>The following keys can get values assigned:</p><div class="variablelist"><dl><dt><span class="term"><code class="option">NAME</code></span></dt><dd><p>The name, a network interface should be renamed to. Or as
- a temporary workaround, the name a device node should be named.
- Usually the kernel provides the defined node name, or even creates
+ not enclosed are matched.</p></dd></dl></div><p>The following keys can get values assigned:</p><div class="variablelist"><dl><dt><span class="term"><code class="option">NAME</code></span></dt><dd><p>What a network interface should be named.</p><p>Also, as a temporary workaround, this is what a device node
+ should be named; usually the kernel provides the defined node name or creates
and removes the node before udev even receives any event. Changing
the node name from the kernel's default creates inconsistencies
and is not supported. If the kernel and NAME specify different names,
- an error will be logged. Udev is only expected to handle device node
+ an error is logged. udev is only expected to handle device node
permissions and to create additional symlinks, not to change
kernel-provided device node names. Instead of renaming a device node,
- SYMLINK should be used. Symlink names must never conflict with
- device node names, it will result in unpredictable behavior.</p></dd><dt><span class="term"><code class="option">SYMLINK</code></span></dt><dd><p>The name of a symlink targeting the node. Every matching rule will add
+ SYMLINK should be used. However, symlink names must never conflict with
+ device node names, as that would result in unpredictable behavior.</p></dd><dt><span class="term"><code class="option">SYMLINK</code></span></dt><dd><p>The name of a symlink targeting the node. Every matching rule adds
this value to the list of symlinks to be created. Multiple symlinks may be
specified by separating the names by the space character. In case multiple
- devices claim the same name, the link will always point to the device with
- the highest link_priority. If the current device goes away, the links will
- be re-evaluated and the device with the next highest link_priority will own
- the link. If no link_priority is specified, the order of the devices, and
- which one of them will own the link, is undefined. Claiming the same name for
- a symlink, which is or might be used for a device node, may result in
- unexpected behavior and is not supported.
+ devices claim the same name, the link always points to the device with
+ the highest link_priority. If the current device goes away, the links are
+ re-evaluated and the device with the next highest link_priority becomes the owner of
+ the link. If no link_priority is specified, the order of the devices (and
+ which one of them owns the link) is undefined. Also, symlink names must
+ never conflict with the kernel's default device node names, as that would
+ result in unpredictable behavior.
</p></dd><dt><span class="term"><code class="option">OWNER, GROUP, MODE</code></span></dt><dd><p>The permissions for the device node. Every specified value overwrites
the compiled-in default value.</p></dd><dt><span class="term"><code class="option">ATTR{<em class="replaceable"><code>key</code></em>}</code></span></dt><dd><p>The value that should be written to a sysfs attribute of the
event device.</p></dd><dt><span class="term"><code class="option">ENV{<em class="replaceable"><code>key</code></em>}</code></span></dt><dd><p>Set a device property value. Property names with a leading '.'
- are not stored in the database or exported to external tool or events.</p></dd><dt><span class="term"><code class="option">TAG</code></span></dt><dd><p>Attach a tag to a device. This is used to filter events for users
+ are neither stored in the database nor exported to events or
+ external tools (run by, say, the PROGRAM match key).</p></dd><dt><span class="term"><code class="option">TAG</code></span></dt><dd><p>Attach a tag to a device. This is used to filter events for users
of libudev's monitor functionality, or to enumerate a group of tagged
devices. The implementation can only work efficiently if only a few
tags are attached to a device. It is only meant to be used in
device. This can only be used for very short running tasks. Running an
event process for a long period of time may block all further events for
this or a dependent device. Long running tasks need to be immediately
- detached from the event process itself. If the option
- <code class="option">RUN{<em class="replaceable"><code>fail_event_on_error</code></em>}</code> is
- specified, and the executed program returns non-zero, the event will be
- marked as failed for a possible later handling.</p><p>If no absolute path is given, the program is expected to live in
- <code class="filename">/lib/udev</code>, otherwise the absolute path must be
- specified. Program name and arguments are separated by spaces. Single quotes
- can be used to specify arguments with spaces.</p></dd><dt><span class="term"><code class="option">LABEL</code></span></dt><dd><p>Named label where a GOTO can jump to.</p></dd><dt><span class="term"><code class="option">GOTO</code></span></dt><dd><p>Jumps to the next LABEL with a matching name</p></dd><dt><span class="term"><code class="option">IMPORT{<em class="replaceable"><code>type</code></em>}</code></span></dt><dd><p>Import a set of variables as device properties,
+ detached from the event process itself.</p><p>If no absolute path is given, the program is expected to live in
+ the directory provided at compile-time to configure via --libexecdir
+ (this is usually <code class="filename">/lib/udev</code>), otherwise the absolute
+ path must be specified. The program name and following arguments are
+ separated by spaces. Single quotes can be used to specify arguments with
+ spaces.</p></dd><dt><span class="term"><code class="option">LABEL</code></span></dt><dd><p>A named label to which a GOTO may jump.</p></dd><dt><span class="term"><code class="option">GOTO</code></span></dt><dd><p>Jumps to the next LABEL with a matching name.</p></dd><dt><span class="term"><code class="option">IMPORT{<em class="replaceable"><code>type</code></em>}</code></span></dt><dd><p>Import a set of variables as device properties,
depending on <em class="replaceable"><code>type</code></em>:</p><div class="variablelist"><dl><dt><span class="term"><code class="option">program</code></span></dt><dd><p>Execute an external program specified as the assigned value and
import its output, which must be in environment key
format. Path specification, command/argument separation,
- and quoting work like in <code class="option">RUN</code>.</p></dd><dt><span class="term"><code class="option">file</code></span></dt><dd><p>Import a text file specified as the assigned value, which must be in
- environment key format.</p></dd><dt><span class="term"><code class="option">db</code></span></dt><dd><p>Import a single property specified as the assigned value from the
+ and quoting work like in <code class="option">RUN</code>.</p></dd><dt><span class="term"><code class="option">file</code></span></dt><dd><p>Import a text file specified as the assigned value, the content
+ of which must be in environment key format.</p></dd><dt><span class="term"><code class="option">db</code></span></dt><dd><p>Import a single property specified as the assigned value from the
current device database. This works only if the database is already populated
- by an earlier event.</p></dd><dt><span class="term"><code class="option">cmdline</code></span></dt><dd><p>Import a single property from the kernel commandline. For simple flags
- the value of the property will be set to '1'.</p></dd><dt><span class="term"><code class="option">parent</code></span></dt><dd><p>Import the stored keys from the parent device by reading
+ by an earlier event.</p></dd><dt><span class="term"><code class="option">cmdline</code></span></dt><dd><p>Import a single property from the kernel command line. For simple flags
+ the value of the property is set to '1'.</p></dd><dt><span class="term"><code class="option">parent</code></span></dt><dd><p>Import the stored keys from the parent device by reading
the database entry of the parent device. The value assigned to
<code class="option">IMPORT{parent}</code> is used as a filter of key names
to import (with the same shell-style pattern matching used for
- comparisons).</p></dd></dl></div><p>If no option is given, udev will choose between <code class="option">program</code>
- and <code class="option">file</code> based on the executable bit of the file
- permissions.</p></dd><dt><span class="term"><code class="option">WAIT_FOR</code></span></dt><dd><p>Wait for a file to become available or until a 10
- seconds timeout expires. The path is relative to the sysfs device,
- i. e. if no path is specified this waits for an attribute to appear.</p></dd><dt><span class="term"><code class="option">OPTIONS</code></span></dt><dd><p>Rule and device options:</p><div class="variablelist"><dl><dt><span class="term"><code class="option">link_priority=<em class="replaceable"><code>value</code></em></code></span></dt><dd><p>Specify the priority of the created symlinks. Devices with higher
- priorities overwrite existing symlinks of other devices. The default is 0.</p></dd><dt><span class="term"><code class="option">event_timeout=</code></span></dt><dd><p>Number of seconds an event will wait for operations to finish, before it
- will terminate itself.</p></dd><dt><span class="term"><code class="option">string_escape=<em class="replaceable"><code>none|replace</code></em></code></span></dt><dd><p>Usually control and other possibly unsafe characters are replaced
+ comparisons).</p></dd></dl></div></dd><dt><span class="term"><code class="option">WAIT_FOR</code></span></dt><dd><p>Wait for a file to become available or until a timeout of
+ 10 seconds expires. The path is relative to the sysfs device;
+ if no path is specified, this waits for an attribute to appear.</p></dd><dt><span class="term"><code class="option">OPTIONS</code></span></dt><dd><p>Rule and device options:</p><div class="variablelist"><dl><dt><span class="term"><code class="option">link_priority=<em class="replaceable"><code>value</code></em></code></span></dt><dd><p>Specify the priority of the created symlinks. Devices with higher
+ priorities overwrite existing symlinks of other devices. The default is 0.</p></dd><dt><span class="term"><code class="option">event_timeout=</code></span></dt><dd><p>Number of seconds an event waits for operations to finish before
+ giving up and terminating itself.</p></dd><dt><span class="term"><code class="option">string_escape=<em class="replaceable"><code>none|replace</code></em></code></span></dt><dd><p>Usually control and other possibly unsafe characters are replaced
in strings used for device naming. The mode of replacement can be specified
- with this option.</p></dd><dt><span class="term"><code class="option">static_node=</code></span></dt><dd><p>Apply the permissions specified in this rule to a static device node with
- the specified name. Static device nodes might be provided by kernel modules,
+ with this option.</p></dd><dt><span class="term"><code class="option">static_node=</code></span></dt><dd><p>Apply the permissions specified in this rule to the static device node with
+ the specified name. Static device nodes might be provided by kernel modules
or copied from <code class="filename">/lib/udev/devices</code>. These nodes might not have
- a corresponding kernel device at the time udevd is started, and allow to trigger
- automatic kernel module on-demand loading.</p></dd><dt><span class="term"><code class="option">watch</code></span></dt><dd><p>Watch the device node with inotify, when closed after being opened for
- writing, a change uevent will be synthesised.</p></dd><dt><span class="term"><code class="option">nowatch</code></span></dt><dd><p>Disable the watching of a device node with inotify.</p></dd></dl></div></dd></dl></div><p>The <code class="option">NAME</code>, <code class="option">SYMLINK</code>, <code class="option">PROGRAM</code>,
+ a corresponding kernel device at the time udevd is started; they can trigger
+ automatic kernel module loading.</p></dd><dt><span class="term"><code class="option">watch</code></span></dt><dd><p>Watch the device node with inotify; when the node is closed after being opened for
+ writing, a change uevent is synthesized.</p></dd><dt><span class="term"><code class="option">nowatch</code></span></dt><dd><p>Disable the watching of a device node with inotify.</p></dd></dl></div></dd></dl></div><p>The <code class="option">NAME</code>, <code class="option">SYMLINK</code>, <code class="option">PROGRAM</code>,
<code class="option">OWNER</code>, <code class="option">GROUP</code>, <code class="option">MODE</code> and <code class="option">RUN</code>
- fields support simple printf-like string substitutions. The <code class="option">RUN</code>
- format chars gets applied after all rules have been processed, right before the program
- is executed. It allows the use of device properties set by earlier matching
- rules. For all other fields, substitutions are applied while the individual rule is
+ fields support simple string substitutions. The <code class="option">RUN</code>
+ substitutions are performed after all rules have been processed, right before the program
+ is executed, allowing for the use of device properties set by earlier matching
+ rules. For all other fields, substitutions are performed while the individual rule is
being processed. The available substitutions are:</p><div class="variablelist"><dl><dt><span class="term"><code class="option">$kernel</code>, <code class="option">%k</code></span></dt><dd><p>The kernel name for this device.</p></dd><dt><span class="term"><code class="option">$number</code>, <code class="option">%n</code></span></dt><dd><p>The kernel number for this device. For example, 'sda3' has
kernel number of '3'</p></dd><dt><span class="term"><code class="option">$devpath</code>, <code class="option">%p</code></span></dt><dd><p>The devpath of the device.</p></dd><dt><span class="term"><code class="option">$id</code>, <code class="option">%b</code></span></dt><dd><p>The name of the device matched while searching the devpath upwards for
<code class="option">SUBSYSTEMS</code>, <code class="option">KERNELS</code>, <code class="option">DRIVERS</code> and <code class="option">ATTRS</code>.
</p></dd><dt><span class="term"><code class="option">$driver</code></span></dt><dd><p>The driver name of the device matched while searching the devpath upwards for
<code class="option">SUBSYSTEMS</code>, <code class="option">KERNELS</code>, <code class="option">DRIVERS</code> and <code class="option">ATTRS</code>.
- </p></dd><dt><span class="term"><code class="option">$attr{<em class="replaceable"><code>file</code></em>}</code>, <code class="option">%s{<em class="replaceable"><code>file</code></em>}</code></span></dt><dd><p>The value of a sysfs attribute found at the device, where
+ </p></dd><dt><span class="term"><code class="option">$attr{<em class="replaceable"><code>file</code></em>}</code>, <code class="option">%s{<em class="replaceable"><code>file</code></em>}</code></span></dt><dd><p>The value of a sysfs attribute found at the device where
all keys of the rule have matched. If the matching device does not have
such an attribute, and a previous KERNELS, SUBSYSTEMS, DRIVERS, or
- ATTRS test selected a parent device, use the attribute from that
- parent device.
- If the attribute is a symlink, the last element of the symlink target is
+ ATTRS test selected a parent device, then the attribute from that
+ parent device is used.</p><p>If the attribute is a symlink, the last element of the symlink target is
returned as the value.</p></dd><dt><span class="term"><code class="option">$env{<em class="replaceable"><code>key</code></em>}</code>, <code class="option">%E{<em class="replaceable"><code>key</code></em>}</code></span></dt><dd><p>A device property value.</p></dd><dt><span class="term"><code class="option">$major</code>, <code class="option">%M</code></span></dt><dd><p>The kernel major number for the device.</p></dd><dt><span class="term"><code class="option">$minor</code>, <code class="option">%m</code></span></dt><dd><p>The kernel minor number for the device.</p></dd><dt><span class="term"><code class="option">$result</code>, <code class="option">%c</code></span></dt><dd><p>The string returned by the external program requested with PROGRAM.
- A single part of the string, separated by a space character may be selected
+ A single part of the string, separated by a space character, may be selected
by specifying the part number as an attribute: <code class="option">%c{N}</code>.
- If the number is followed by the '+' char this part plus all remaining parts
+ If the number is followed by the '+' character, this part plus all remaining parts
of the result string are substituted: <code class="option">%c{N+}</code></p></dd><dt><span class="term"><code class="option">$parent</code>, <code class="option">%P</code></span></dt><dd><p>The node name of the parent device.</p></dd><dt><span class="term"><code class="option">$name</code></span></dt><dd><p>The current name of the device node. If not changed by a rule, it is the
- name of the kernel device.</p></dd><dt><span class="term"><code class="option">$links</code></span></dt><dd><p>The current list of symlinks, separated by a space character. The value is
- only set if an earlier rule assigned a value, or during a remove events.</p></dd><dt><span class="term"><code class="option">$root</code>, <code class="option">%r</code></span></dt><dd><p>The udev_root value.</p></dd><dt><span class="term"><code class="option">$sys</code>, <code class="option">%S</code></span></dt><dd><p>The sysfs mount point.</p></dd><dt><span class="term"><code class="option">$tempnode</code>, <code class="option">%N</code></span></dt><dd><p>The name of a created temporary device node to provide access to
- the device from a external program before the real node is created.</p></dd><dt><span class="term"><code class="option">%%</code></span></dt><dd><p>The '%' character itself.</p></dd><dt><span class="term"><code class="option">$$</code></span></dt><dd><p>The '$' character itself.</p></dd></dl></div></div></div><div class="refsect1" title="Author"><a id="id320469"/><h2>Author</h2><p>Written by Greg Kroah-Hartman <code class="email"><<a class="email" href="mailto:greg@kroah.com">greg@kroah.com</a>></code> and
+ name of the kernel device.</p></dd><dt><span class="term"><code class="option">$links</code></span></dt><dd><p>A space-separated list of the current symlinks. The value is
+ only set during a remove event or if an earlier rule assigned a value.</p></dd><dt><span class="term"><code class="option">$root</code>, <code class="option">%r</code></span></dt><dd><p>The udev_root value.</p></dd><dt><span class="term"><code class="option">$sys</code>, <code class="option">%S</code></span></dt><dd><p>The sysfs mount point.</p></dd><dt><span class="term"><code class="option">$tempnode</code>, <code class="option">%N</code></span></dt><dd><p>The name of a temporary device node created to provide access to
+ the device from a external program before the real node is created.</p></dd><dt><span class="term"><code class="option">%%</code></span></dt><dd><p>The '%' character itself.</p></dd><dt><span class="term"><code class="option">$$</code></span></dt><dd><p>The '$' character itself.</p></dd></dl></div></div></div><div class="refsect1" title="Author"><a id="id442008"/><h2>Author</h2><p>Written by Greg Kroah-Hartman <code class="email"><<a class="email" href="mailto:greg@kroah.com">greg@kroah.com</a>></code> and
Kay Sievers <code class="email"><<a class="email" href="mailto:kay.sievers@vrfy.org">kay.sievers@vrfy.org</a>></code>. With much help from
- Dan Stekloff and many others.</p></div><div class="refsect1" title="See Also"><a id="id320486"/><h2>See Also</h2><p><span class="citerefentry"><span class="refentrytitle">udevd</span>(8)</span>,
+ Dan Stekloff and many others.</p></div><div class="refsect1" title="See Also"><a id="id442023"/><h2>See Also</h2><p><span class="citerefentry"><span class="refentrytitle">udevd</span>(8)</span>,
<span class="citerefentry"><span class="refentrytitle">udevadm</span>(8)</span></p></div></div></body></html>
names provide a way to reliably identify devices based on their properties or
current configuration.</para>
- <para>The udev daemon <citerefentry><refentrytitle>udevd</refentrytitle>
- <manvolnum>8</manvolnum></citerefentry> receives device uevents directly from
+ <para>The udev daemon, <citerefentry><refentrytitle>udevd</refentrytitle>
+ <manvolnum>8</manvolnum></citerefentry>, receives device uevents directly from
the kernel whenever a device is added or removed from the system, or it changes its
state. When udev receives a device event, it matches its configured set of rules
- against various device attributes to identify the device. Rules that match, may
- provide additional device information to be stored in the udev database, or information
+ against various device attributes to identify the device. Rules that match may
+ provide additional device information to be stored in the udev database or
to be used to create meaningful symlink names.</para>
- <para>All device information udev processes, is stored in the udev database and
+ <para>All device information udev processes is stored in the udev database and
sent out to possible event subscribers. Access to all stored data and the event
- sources are provided by the library libudev.</para>
+ sources is provided by the library libudev.</para>
</refsect1>
<refsect1><title>Configuration</title>
<para>udev configuration files are placed in <filename>/etc/udev/</filename>
- and <filename>/lib/udev/</filename>. All empty lines, or lines beginning with
- '#' will be ignored.</para>
+ and <filename>/lib/udev/</filename>. All empty lines or lines beginning with
+ '#' are ignored.</para>
<refsect2><title>Configuration file</title>
<para>udev expects its main configuration file at <filename>/etc/udev/udev.conf</filename>.
<para>The udev rules are read from the files located in the
default rules directory <filename>/lib/udev/rules.d/</filename>,
the custom rules directory <filename>/etc/udev/rules.d/</filename>
- and the temporary rules directory <filename>/dev/.udev/rules.d/</filename>.
- All rule files are sorted and processed in lexical order, regardless
- in which of these directories they live. Files in
- <filename>/etc/udev/rules.d/</filename> have precedence over files with
- the same name in <filename>/lib/udev/rules.d/</filename>. This can be
+ and the temporary rules directory <filename>/run/udev/rules.d/</filename>.
+ All rule files are collectively sorted and processed in lexical order,
+ regardless of the directories in which they live. However, files in
+ <filename>/etc/udev/rules.d/</filename> take precedence over files with
+ the same name in <filename>/lib/udev/rules.d/</filename>; this can be
used to ignore a default rules file if needed.</para>
- <para>Rule files must end in <filename>.rules</filename>, other extensions
- are ignored.</para>
+ <para>Rule files must have the extension <filename>.rules</filename>; other
+ extensions are ignored.</para>
- <para>Every line in the rules file contains at least one key value pair.
- There are two kind of keys, match and assignment keys.
+ <para>Every line in the rules file contains at least one key-value pair.
+ There are two kind of keys: match and assignment.
If all match keys are matching against its value, the rule gets applied and the
- assign keys get the specified value assigned.</para>
+ assignment keys get the specified value assigned.</para>
<para>A matching rule may rename a network interface, add symlinks
pointing to the device node, or run a specified program as part of
the event handling.</para>
- <para>A rule consists of a list of one or more key value pairs separated by
- a comma. Each key has a distinct operation, depending on the used operator. Valid
+ <para>A rule consists of a comma-separated list of one or more key-value pairs.
+ Each key has a distinct operation, depending on the used operator. Valid
operators are:</para>
<variablelist>
<varlistentry>
<varlistentry>
<term><option>=</option></term>
<listitem>
- <para>Assign a value to a key. Keys that represent a list, are reset
+ <para>Assign a value to a key. Keys that represent a list are reset
and only this single value is assigned.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>:=</option></term>
<listitem>
- <para>Assign a value to a key finally; disallow any later changes,
- which may be used to prevent changes by any later rules.</para>
+ <para>Assign a value to a key finally; disallow any later changes.</para>
</listitem>
</varlistentry>
</variablelist>
<varlistentry>
<term><option>DRIVER</option></term>
<listitem>
- <para>Match the driver name of the event device. Only set for devices
+ <para>Match the driver name of the event device. Only set this key for devices
which are bound to a driver at the time the event is generated.</para>
</listitem>
</varlistentry>
<term><option>ATTR{<replaceable>filename</replaceable>}</option></term>
<listitem>
<para>Match sysfs attribute values of the event device. Trailing
- whitespace in the attribute values is ignored, if the specified match
- value does not contain trailing whitespace itself.
+ whitespace in the attribute values is ignored unless the specified match
+ value itself contains trailing whitespace.
</para>
</listitem>
</varlistentry>
<listitem>
<para>Search the devpath upwards for a device with matching sysfs attribute values.
If multiple <option>ATTRS</option> matches are specified, all of them
- must match on the same device. Trailing whitespace in the attribute values is ignored,
- if the specified match value does not contain trailing whitespace itself.</para>
+ must match on the same device. Trailing whitespace in the attribute values is ignored
+ unless the specified match value itself contains trailing whitespace.</para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>TAGS</option></term>
+ <listitem>
+ <para>Search the devpath upwards for a device with matching tag.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>PROGRAM</option></term>
<listitem>
- <para>Execute a program. The key is true, if the program returns
+ <para>Execute a program to determine whether there
+ is a match; the key is true if the program returns
successfully. The device properties are made available to the
- executed program in the environment. The program's output printed to
- stdout, is available in the RESULT key.</para>
+ executed program in the environment. The program's stdout
+ is available in the RESULT key.</para>
</listitem>
</varlistentry>
</varlistentry>
</variablelist>
- <para>Most of the fields support a shell style pattern matching. The following
+ <para>Most of the fields support shell-style pattern matching. The following
pattern characters are supported:</para>
<variablelist>
<varlistentry>
<term><option>*</option></term>
<listitem>
- <para>Matches zero, or any number of characters.</para>
+ <para>Matches zero or more characters.</para>
</listitem>
</varlistentry>
<varlistentry>
<listitem>
<para>Matches any single character specified within the brackets. For
example, the pattern string 'tty[SR]' would match either 'ttyS' or 'ttyR'.
- Ranges are also supported within this match with the '-' character.
- For example, to match on the range of all digits, the pattern [0-9] would
+ Ranges are also supported via the '-' character.
+ For example, to match on the range of all digits, the pattern [0-9] could
be used. If the first character following the '[' is a '!', any characters
not enclosed are matched.</para>
</listitem>
<varlistentry>
<term><option>NAME</option></term>
<listitem>
- <para>The name, a network interface should be renamed to. Or as
- a temporary workaround, the name a device node should be named.
- Usually the kernel provides the defined node name, or even creates
+ <para>What a network interface should be named.</para>
+ <para>Also, as a temporary workaround, this is what a device node
+ should be named; usually the kernel provides the defined node name or creates
and removes the node before udev even receives any event. Changing
the node name from the kernel's default creates inconsistencies
and is not supported. If the kernel and NAME specify different names,
- an error will be logged. Udev is only expected to handle device node
+ an error is logged. udev is only expected to handle device node
permissions and to create additional symlinks, not to change
kernel-provided device node names. Instead of renaming a device node,
- SYMLINK should be used. Symlink names must never conflict with
- device node names, it will result in unpredictable behavior.</para>
+ SYMLINK should be used. However, symlink names must never conflict with
+ device node names, as that would result in unpredictable behavior.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>SYMLINK</option></term>
<listitem>
- <para>The name of a symlink targeting the node. Every matching rule will add
+ <para>The name of a symlink targeting the node. Every matching rule adds
this value to the list of symlinks to be created. Multiple symlinks may be
specified by separating the names by the space character. In case multiple
- devices claim the same name, the link will always point to the device with
- the highest link_priority. If the current device goes away, the links will
- be re-evaluated and the device with the next highest link_priority will own
- the link. If no link_priority is specified, the order of the devices, and
- which one of them will own the link, is undefined. Claiming the same name for
- a symlink, which is or might be used for a device node, may result in
- unexpected behavior and is not supported.
+ devices claim the same name, the link always points to the device with
+ the highest link_priority. If the current device goes away, the links are
+ re-evaluated and the device with the next highest link_priority becomes the owner of
+ the link. If no link_priority is specified, the order of the devices (and
+ which one of them owns the link) is undefined. Also, symlink names must
+ never conflict with the kernel's default device node names, as that would
+ result in unpredictable behavior.
</para>
</listitem>
</varlistentry>
<term><option>ENV{<replaceable>key</replaceable>}</option></term>
<listitem>
<para>Set a device property value. Property names with a leading '.'
- are not stored in the database or exported to external tool or events.</para>
+ are neither stored in the database nor exported to events or
+ external tools (run by, say, the PROGRAM match key).</para>
</listitem>
</varlistentry>
device. This can only be used for very short running tasks. Running an
event process for a long period of time may block all further events for
this or a dependent device. Long running tasks need to be immediately
- detached from the event process itself. If the option
- <option>RUN{<replaceable>fail_event_on_error</replaceable>}</option> is
- specified, and the executed program returns non-zero, the event will be
- marked as failed for a possible later handling.</para>
+ detached from the event process itself.</para>
<para>If no absolute path is given, the program is expected to live in
- <filename>/lib/udev</filename>, otherwise the absolute path must be
- specified. Program name and arguments are separated by spaces. Single quotes
- can be used to specify arguments with spaces.</para>
+ the directory provided at compile-time to configure via --libexecdir
+ (this is usually <filename>/lib/udev</filename>), otherwise the absolute
+ path must be specified. The program name and following arguments are
+ separated by spaces. Single quotes can be used to specify arguments with
+ spaces.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>LABEL</option></term>
<listitem>
- <para>Named label where a GOTO can jump to.</para>
+ <para>A named label to which a GOTO may jump.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>GOTO</option></term>
<listitem>
- <para>Jumps to the next LABEL with a matching name</para>
+ <para>Jumps to the next LABEL with a matching name.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>file</option></term>
<listitem>
- <para>Import a text file specified as the assigned value, which must be in
- environment key format.</para>
+ <para>Import a text file specified as the assigned value, the content
+ of which must be in environment key format.</para>
</listitem>
</varlistentry>
<varlistentry>
<varlistentry>
<term><option>cmdline</option></term>
<listitem>
- <para>Import a single property from the kernel commandline. For simple flags
- the value of the property will be set to '1'.</para>
+ <para>Import a single property from the kernel command line. For simple flags
+ the value of the property is set to '1'.</para>
</listitem>
</varlistentry>
<varlistentry>
</listitem>
</varlistentry>
</variablelist>
- <para>If no option is given, udev will choose between <option>program</option>
- and <option>file</option> based on the executable bit of the file
- permissions.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>WAIT_FOR</option></term>
<listitem>
- <para>Wait for a file to become available or until a 10
- seconds timeout expires. The path is relative to the sysfs device,
- i. e. if no path is specified this waits for an attribute to appear.</para>
+ <para>Wait for a file to become available or until a timeout of
+ 10 seconds expires. The path is relative to the sysfs device;
+ if no path is specified, this waits for an attribute to appear.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>event_timeout=</option></term>
<listitem>
- <para>Number of seconds an event will wait for operations to finish, before it
- will terminate itself.</para>
+ <para>Number of seconds an event waits for operations to finish before
+ giving up and terminating itself.</para>
</listitem>
</varlistentry>
<varlistentry>
<varlistentry>
<term><option>static_node=</option></term>
<listitem>
- <para>Apply the permissions specified in this rule to a static device node with
- the specified name. Static device nodes might be provided by kernel modules,
+ <para>Apply the permissions specified in this rule to the static device node with
+ the specified name. Static device nodes might be provided by kernel modules
or copied from <filename>/lib/udev/devices</filename>. These nodes might not have
- a corresponding kernel device at the time udevd is started, and allow to trigger
- automatic kernel module on-demand loading.</para>
+ a corresponding kernel device at the time udevd is started; they can trigger
+ automatic kernel module loading.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>watch</option></term>
<listitem>
- <para>Watch the device node with inotify, when closed after being opened for
- writing, a change uevent will be synthesised.</para>
+ <para>Watch the device node with inotify; when the node is closed after being opened for
+ writing, a change uevent is synthesized.</para>
</listitem>
</varlistentry>
<varlistentry>
<para>The <option>NAME</option>, <option>SYMLINK</option>, <option>PROGRAM</option>,
<option>OWNER</option>, <option>GROUP</option>, <option>MODE</option> and <option>RUN</option>
- fields support simple printf-like string substitutions. The <option>RUN</option>
- format chars gets applied after all rules have been processed, right before the program
- is executed. It allows the use of device properties set by earlier matching
- rules. For all other fields, substitutions are applied while the individual rule is
+ fields support simple string substitutions. The <option>RUN</option>
+ substitutions are performed after all rules have been processed, right before the program
+ is executed, allowing for the use of device properties set by earlier matching
+ rules. For all other fields, substitutions are performed while the individual rule is
being processed. The available substitutions are:</para>
<variablelist>
<varlistentry>
<varlistentry>
<term><option>$attr{<replaceable>file</replaceable>}</option>, <option>%s{<replaceable>file</replaceable>}</option></term>
<listitem>
- <para>The value of a sysfs attribute found at the device, where
+ <para>The value of a sysfs attribute found at the device where
all keys of the rule have matched. If the matching device does not have
such an attribute, and a previous KERNELS, SUBSYSTEMS, DRIVERS, or
- ATTRS test selected a parent device, use the attribute from that
- parent device.
- If the attribute is a symlink, the last element of the symlink target is
+ ATTRS test selected a parent device, then the attribute from that
+ parent device is used.</para>
+ <para>If the attribute is a symlink, the last element of the symlink target is
returned as the value.</para>
</listitem>
</varlistentry>
<term><option>$result</option>, <option>%c</option></term>
<listitem>
<para>The string returned by the external program requested with PROGRAM.
- A single part of the string, separated by a space character may be selected
+ A single part of the string, separated by a space character, may be selected
by specifying the part number as an attribute: <option>%c{N}</option>.
- If the number is followed by the '+' char this part plus all remaining parts
+ If the number is followed by the '+' character, this part plus all remaining parts
of the result string are substituted: <option>%c{N+}</option></para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>$links</option></term>
<listitem>
- <para>The current list of symlinks, separated by a space character. The value is
- only set if an earlier rule assigned a value, or during a remove events.</para>
+ <para>A space-separated list of the current symlinks. The value is
+ only set during a remove event or if an earlier rule assigned a value.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>$tempnode</option>, <option>%N</option></term>
<listitem>
- <para>The name of a created temporary device node to provide access to
+ <para>The name of a temporary device node created to provide access to
the device from a external program before the real node is created.</para>
</listitem>
</varlistentry>
static void print_help(void)
{
printf("Usage: udevadm control COMMAND\n"
+ " --exit instruct the daemon to cleanup and exit\n"
" --log-priority=<level> set the udev log level for the daemon\n"
" --stop-exec-queue keep udevd from executing events, queue only\n"
" --start-exec-queue execute events, flush queue\n"
" --reload-rules reloads the rules files\n"
" --property=<KEY>=<value> set a global property for all events\n"
" --children-max=<N> maximum number of children\n"
+ " --timeout=<seconds> maximum time to block for a reply\n"
" --help print this help text\n\n");
}
-int udevadm_control(struct udev *udev, int argc, char *argv[])
+static int adm_control(struct udev *udev, int argc, char *argv[])
{
struct udev_ctrl *uctrl = NULL;
+ int timeout = 60;
int rc = 1;
- /* compat values with '_' will be removed in a future release */
static const struct option options[] = {
+ { "exit", no_argument, NULL, 'e' },
{ "log-priority", required_argument, NULL, 'l' },
{ "stop-exec-queue", no_argument, NULL, 's' },
{ "start-exec-queue", no_argument, NULL, 'S' },
{ "property", required_argument, NULL, 'p' },
{ "env", required_argument, NULL, 'p' },
{ "children-max", required_argument, NULL, 'm' },
+ { "timeout", required_argument, NULL, 't' },
{ "help", no_argument, NULL, 'h' },
{}
};
return 1;
}
- uctrl = udev_ctrl_new_from_socket(udev, UDEV_CTRL_SOCK_PATH);
+ uctrl = udev_ctrl_new(udev);
if (uctrl == NULL)
return 2;
for (;;) {
int option;
- int i;
- char *endp;
- option = getopt_long(argc, argv, "l:sSRp:m:h", options, NULL);
+ option = getopt_long(argc, argv, "el:sSRp:m:h", options, NULL);
if (option == -1)
break;
switch (option) {
- case 'l':
+ case 'e':
+ if (udev_ctrl_send_exit(uctrl, timeout) < 0)
+ rc = 2;
+ else
+ rc = 0;
+ break;
+ case 'l': {
+ int i;
+
i = util_log_priority(optarg);
if (i < 0) {
fprintf(stderr, "invalid number '%s'\n", optarg);
- goto exit;
+ goto out;
}
- if (udev_ctrl_send_set_log_level(uctrl, util_log_priority(optarg)) < 0)
+ if (udev_ctrl_send_set_log_level(uctrl, util_log_priority(optarg), timeout) < 0)
rc = 2;
else
rc = 0;
break;
+ }
case 's':
- if (udev_ctrl_send_stop_exec_queue(uctrl) < 0)
+ if (udev_ctrl_send_stop_exec_queue(uctrl, timeout) < 0)
rc = 2;
else
rc = 0;
break;
case 'S':
- if (udev_ctrl_send_start_exec_queue(uctrl) < 0)
+ if (udev_ctrl_send_start_exec_queue(uctrl, timeout) < 0)
rc = 2;
else
rc = 0;
break;
case 'R':
- if (udev_ctrl_send_reload_rules(uctrl) < 0)
+ if (udev_ctrl_send_reload_rules(uctrl, timeout) < 0)
rc = 2;
else
rc = 0;
case 'p':
if (strchr(optarg, '=') == NULL) {
fprintf(stderr, "expect <KEY>=<value> instead of '%s'\n", optarg);
- goto exit;
+ goto out;
}
- if (udev_ctrl_send_set_env(uctrl, optarg) < 0)
+ if (udev_ctrl_send_set_env(uctrl, optarg, timeout) < 0)
rc = 2;
else
rc = 0;
break;
- case 'm':
+ case 'm': {
+ char *endp;
+ int i;
+
i = strtoul(optarg, &endp, 0);
if (endp[0] != '\0' || i < 1) {
fprintf(stderr, "invalid number '%s'\n", optarg);
- goto exit;
+ goto out;
}
- if (udev_ctrl_send_set_children_max(uctrl, i) < 0)
+ if (udev_ctrl_send_set_children_max(uctrl, i, timeout) < 0)
rc = 2;
else
rc = 0;
break;
+ }
+ case 't': {
+ int seconds;
+
+ seconds = atoi(optarg);
+ if (seconds >= 0)
+ timeout = seconds;
+ else
+ fprintf(stderr, "invalid timeout value\n");
+ break;
+ }
case 'h':
print_help();
rc = 0;
}
}
- if (rc == 1)
- err(udev, "unrecognized command\n");
-exit:
+ if (argv[optind] != NULL)
+ fprintf(stderr, "unknown option\n");
+ else if (optind == 1)
+ fprintf(stderr, "missing option\n");
+out:
udev_ctrl_unref(uctrl);
return rc;
}
+
+const struct udevadm_cmd udevadm_control = {
+ .name = "control",
+ .cmd = adm_control,
+ .help = "control the udev daemon",
+};
#include "udev.h"
-static void print_all_attributes(struct udev_device *device, const char *key)
+static bool skip_attribute(const char *name)
{
- struct udev *udev = udev_device_get_udev(device);
- DIR *dir;
- struct dirent *dent;
+ static const char const *skip[] = {
+ "uevent",
+ "dev",
+ "modalias",
+ "resource",
+ "driver",
+ "subsystem",
+ "module",
+ };
+ unsigned int i;
- dir = opendir(udev_device_get_syspath(device));
- if (dir != NULL) {
- for (dent = readdir(dir); dent != NULL; dent = readdir(dir)) {
- struct stat statbuf;
- const char *value;
- size_t len;
-
- if (dent->d_name[0] == '.')
- continue;
-
- if (strcmp(dent->d_name, "uevent") == 0)
- continue;
- if (strcmp(dent->d_name, "dev") == 0)
- continue;
-
- if (fstatat(dirfd(dir), dent->d_name, &statbuf, AT_SYMLINK_NOFOLLOW) != 0)
- continue;
- if (S_ISLNK(statbuf.st_mode))
- continue;
-
- value = udev_device_get_sysattr_value(device, dent->d_name);
- if (value == NULL)
- continue;
- dbg(udev, "attr '%s'='%s'\n", dent->d_name, value);
-
- /* skip nonprintable attributes */
- len = strlen(value);
- while (len > 0 && isprint(value[len-1]))
- len--;
- if (len > 0) {
- dbg(udev, "attribute value of '%s' non-printable, skip\n", dent->d_name);
- continue;
- }
+ for (i = 0; i < ARRAY_SIZE(skip); i++)
+ if (strcmp(name, skip[i]) == 0)
+ return true;
+ return false;
+}
- printf(" %s{%s}==\"%s\"\n", key, dent->d_name, value);
+static void print_all_attributes(struct udev_device *device, const char *key)
+{
+ struct udev *udev = udev_device_get_udev(device);
+ struct udev_list_entry *sysattr;
+
+ udev_list_entry_foreach(sysattr, udev_device_get_sysattr_list_entry(device)) {
+ const char *name;
+ const char *value;
+ size_t len;
+
+ name = udev_list_entry_get_name(sysattr);
+ if (skip_attribute(name))
+ continue;
+
+ value = udev_device_get_sysattr_value(device, name);
+ if (value == NULL)
+ continue;
+ dbg(udev, "attr '%s'='%s'\n", name, value);
+
+ /* skip any values that look like a path */
+ if (value[0] == '/')
+ continue;
+
+ /* skip nonprintable attributes */
+ len = strlen(value);
+ while (len > 0 && isprint(value[len-1]))
+ len--;
+ if (len > 0) {
+ dbg(udev, "attribute value of '%s' non-printable, skip\n", name);
+ continue;
}
- closedir(dir);
+
+ printf(" %s{%s}==\"%s\"\n", key, name, value);
}
printf("\n");
}
return 0;
}
-static int convert_db(struct udev *udev)
+static void cleanup_dir(DIR *dir, mode_t mask, int depth)
{
- struct udev_enumerate *udev_enumerate;
- struct udev_list_entry *list_entry;
-
- udev_enumerate = udev_enumerate_new(udev);
- if (udev_enumerate == NULL)
- return -1;
- udev_enumerate_scan_devices(udev_enumerate);
- udev_list_entry_foreach(list_entry, udev_enumerate_get_list_entry(udev_enumerate)) {
- struct udev_device *device;
+ struct dirent *dent;
- device = udev_device_new_from_syspath(udev, udev_list_entry_get_name(list_entry));
- if (device != NULL) {
- const char *id;
- struct stat stats;
- char to[UTIL_PATH_SIZE];
- char devpath[UTIL_PATH_SIZE];
- char from[UTIL_PATH_SIZE];
-
- id = udev_device_get_id_filename(device);
- if (id == NULL) {
- udev_device_unref(device);
- continue;
- }
- util_strscpyl(to, sizeof(to), udev_get_dev_path(udev), "/.udev/db/", id, NULL);
-
- /* find old database with $subsys:$sysname */
- util_strscpyl(from, sizeof(from), udev_get_dev_path(udev),
- "/.udev/db/", udev_device_get_subsystem(device), ":",
- udev_device_get_sysname(device), NULL);
- if (lstat(from, &stats) == 0) {
- if (lstat(to, &stats) == 0)
- unlink(from);
- else
- rename(from, to);
+ if (depth <= 0)
+ return;
+
+ for (dent = readdir(dir); dent != NULL; dent = readdir(dir)) {
+ struct stat stats;
+
+ if (dent->d_name[0] == '.')
+ continue;
+ if (fstatat(dirfd(dir), dent->d_name, &stats, AT_SYMLINK_NOFOLLOW) != 0)
+ continue;
+ if ((stats.st_mode & mask) != 0)
+ continue;
+ if (S_ISDIR(stats.st_mode)) {
+ DIR *dir2;
+
+ dir2 = fdopendir(openat(dirfd(dir), dent->d_name, O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC));
+ if (dir2 != NULL) {
+ cleanup_dir(dir2, mask, depth-1);
+ closedir(dir2);
}
+ unlinkat(dirfd(dir), dent->d_name, AT_REMOVEDIR);
+ } else {
+ unlinkat(dirfd(dir), dent->d_name, 0);
+ }
+ }
+}
- /* find old database with the encoded devpath */
- util_path_encode(udev_device_get_devpath(device), devpath, sizeof(devpath));
- util_strscpyl(from, sizeof(from), udev_get_dev_path(udev),
- "/.udev/db/", devpath, NULL);
- if (lstat(from, &stats) == 0) {
- if (lstat(to, &stats) == 0)
- unlink(from);
- else
- rename(from, to);
- }
+static void cleanup_db(struct udev *udev)
+{
+ char filename[UTIL_PATH_SIZE];
+ DIR *dir;
- /* read the old database, and write out a new one */
- udev_device_read_db(device);
- udev_device_update_db(device);
+ util_strscpyl(filename, sizeof(filename), udev_get_run_path(udev), "/queue.bin", NULL);
+ unlink(filename);
- udev_device_unref(device);
- }
+ util_strscpyl(filename, sizeof(filename), udev_get_run_path(udev), "/data", NULL);
+ dir = opendir(filename);
+ if (dir != NULL) {
+ cleanup_dir(dir, S_ISVTX, 1);
+ closedir(dir);
+ }
+
+ util_strscpyl(filename, sizeof(filename), udev_get_run_path(udev), "/links", NULL);
+ dir = opendir(filename);
+ if (dir != NULL) {
+ cleanup_dir(dir, 0, 2);
+ closedir(dir);
+ }
+
+ util_strscpyl(filename, sizeof(filename), udev_get_run_path(udev), "/tags", NULL);
+ dir = opendir(filename);
+ if (dir != NULL) {
+ cleanup_dir(dir, 0, 2);
+ closedir(dir);
+ }
+
+ util_strscpyl(filename, sizeof(filename), udev_get_run_path(udev), "/watch", NULL);
+ dir = opendir(filename);
+ if (dir != NULL) {
+ cleanup_dir(dir, 0, 1);
+ closedir(dir);
+ }
+
+ util_strscpyl(filename, sizeof(filename), udev_get_run_path(udev), "/firmware-missing", NULL);
+ dir = opendir(filename);
+ if (dir != NULL) {
+ cleanup_dir(dir, 0, 1);
+ closedir(dir);
}
- udev_enumerate_unref(udev_enumerate);
- return 0;
}
-int udevadm_info(struct udev *udev, int argc, char *argv[])
+static int uinfo(struct udev *udev, int argc, char *argv[])
{
struct udev_device *device = NULL;
bool root = 0;
{ "path", required_argument, NULL, 'p' },
{ "query", required_argument, NULL, 'q' },
{ "attribute-walk", no_argument, NULL, 'a' },
+ { "cleanup-db", no_argument, NULL, 'c' },
{ "export-db", no_argument, NULL, 'e' },
- { "convert-db", no_argument, NULL, 'C' },
{ "root", no_argument, NULL, 'r' },
+ { "run", no_argument, NULL, 'R' },
{ "device-id-of-file", required_argument, NULL, 'd' },
{ "export", no_argument, NULL, 'x' },
{ "export-prefix", required_argument, NULL, 'P' },
int option;
struct stat statbuf;
- option = getopt_long(argc, argv, "aed:n:p:q:rxP:Vh", options, NULL);
+ option = getopt_long(argc, argv, "aced:n:p:q:rxP:RVh", options, NULL);
if (option == -1)
break;
action = ACTION_ROOT;
root = true;
break;
+ case 'R':
+ printf("%s\n", udev_get_run_path(udev));
+ goto exit;
case 'd':
action = ACTION_DEVICE_ID_FILE;
util_strscpy(name, sizeof(name), optarg);
case 'e':
export_devices(udev);
goto exit;
- case 'C':
- convert_db(udev);
+ case 'c':
+ cleanup_db(udev);
goto exit;
case 'x':
export = true;
" --export export key/value pairs\n"
" --export-prefix export the key name with a prefix\n"
" --export-db export the content of the udev database\n"
- " --convert-db convert older version of database without a reboot\n"
+ " --cleanup-db cleanup the udev database\n"
" --help\n\n");
goto exit;
default:
+ rc = 1;
goto exit;
}
}
udev_device_unref(device);
return rc;
}
+
+const struct udevadm_cmd udevadm_info = {
+ .name = "info",
+ .cmd = uinfo,
+ .help = "query sysfs or the udev database",
+};
#include <errno.h>
#include <signal.h>
#include <getopt.h>
+#include <time.h>
#include <sys/time.h>
#include <sys/socket.h>
#include <sys/un.h>
-#include <sys/select.h>
+#include <sys/epoll.h>
#include <linux/types.h>
#include <linux/netlink.h>
#include "udev.h"
-static int udev_exit;
+static bool udev_exit;
static void sig_handler(int signum)
{
if (signum == SIGINT || signum == SIGTERM)
- udev_exit = 1;
+ udev_exit = true;
}
static void print_device(struct udev_device *device, const char *source, int prop)
{
- struct timeval tv;
- struct timezone tz;
+ struct timespec ts;
- gettimeofday(&tv, &tz);
+ clock_gettime(CLOCK_MONOTONIC, &ts);
printf("%-6s[%llu.%06u] %-8s %s (%s)\n",
source,
- (unsigned long long) tv.tv_sec, (unsigned int) tv.tv_usec,
+ (unsigned long long) ts.tv_sec, (unsigned int) ts.tv_nsec/1000,
udev_device_get_action(device),
udev_device_get_devpath(device),
udev_device_get_subsystem(device));
}
}
-int udevadm_monitor(struct udev *udev, int argc, char *argv[])
+static int adm_monitor(struct udev *udev, int argc, char *argv[])
{
struct sigaction act;
sigset_t mask;
int option;
- int prop = 0;
- int print_kernel = 0;
- int print_udev = 0;
- struct udev_list_node subsystem_match_list;
- struct udev_list_node tag_match_list;
+ bool prop = false;
+ bool print_kernel = false;
+ bool print_udev = false;
+ struct udev_list subsystem_match_list;
+ struct udev_list tag_match_list;
struct udev_monitor *udev_monitor = NULL;
struct udev_monitor *kernel_monitor = NULL;
- fd_set readfds;
+ int fd_ep = -1;
+ int fd_kernel = -1, fd_udev = -1;
+ struct epoll_event ep_kernel, ep_udev;
int rc = 0;
static const struct option options[] = {
{}
};
- udev_list_init(&subsystem_match_list);
- udev_list_init(&tag_match_list);
+ udev_list_init(udev, &subsystem_match_list, true);
+ udev_list_init(udev, &tag_match_list, true);
+
for (;;) {
option = getopt_long(argc, argv, "pekus:t:h", options, NULL);
if (option == -1)
switch (option) {
case 'p':
case 'e':
- prop = 1;
+ prop = true;
break;
case 'k':
- print_kernel = 1;
+ print_kernel = true;
break;
case 'u':
- print_udev = 1;
+ print_udev = true;
break;
case 's':
{
devtype[0] = '\0';
devtype++;
}
- udev_list_entry_add(udev, &subsystem_match_list, subsys, devtype, 0, 0);
+ udev_list_entry_add(&subsystem_match_list, subsys, devtype);
break;
}
case 't':
- udev_list_entry_add(udev, &tag_match_list, optarg, NULL, 0, 0);
+ udev_list_entry_add(&tag_match_list, optarg, NULL);
break;
case 'h':
printf("Usage: udevadm monitor [--property] [--kernel] [--udev] [--help]\n"
" --subsystem-match=<subsystem[/devtype]> filter events by subsystem\n"
" --tag-match=<tag> filter events by tag\n"
" --help\n\n");
+ goto out;
default:
+ rc = 1;
goto out;
}
}
if (!print_kernel && !print_udev) {
- print_kernel = 1;
- print_udev =1;
+ print_kernel = true;
+ print_udev = true;
}
/* set signal handlers */
sigaddset(&mask, SIGTERM);
sigprocmask(SIG_UNBLOCK, &mask, NULL);
+ fd_ep = epoll_create1(EPOLL_CLOEXEC);
+ if (fd_ep < 0) {
+ err(udev, "error creating epoll fd: %m\n");
+ goto out;
+ }
+
printf("monitor will print the received events for:\n");
if (print_udev) {
struct udev_list_entry *entry;
goto out;
}
udev_monitor_set_receive_buffer_size(udev_monitor, 128*1024*1024);
+ fd_udev = udev_monitor_get_fd(udev_monitor);
udev_list_entry_foreach(entry, udev_list_get_entry(&subsystem_match_list)) {
const char *subsys = udev_list_entry_get_name(entry);
rc = 2;
goto out;
}
+
+ memset(&ep_udev, 0, sizeof(struct epoll_event));
+ ep_udev.events = EPOLLIN;
+ ep_udev.data.fd = fd_udev;
+ if (epoll_ctl(fd_ep, EPOLL_CTL_ADD, fd_udev, &ep_udev) < 0) {
+ err(udev, "fail to add fd to epoll: %m\n");
+ goto out;
+ }
+
printf("UDEV - the event which udev sends out after rule processing\n");
}
+
if (print_kernel) {
struct udev_list_entry *entry;
goto out;
}
udev_monitor_set_receive_buffer_size(kernel_monitor, 128*1024*1024);
+ fd_kernel = udev_monitor_get_fd(kernel_monitor);
udev_list_entry_foreach(entry, udev_list_get_entry(&subsystem_match_list)) {
const char *subsys = udev_list_entry_get_name(entry);
rc = 4;
goto out;
}
+
+ memset(&ep_kernel, 0, sizeof(struct epoll_event));
+ ep_kernel.events = EPOLLIN;
+ ep_kernel.data.fd = fd_kernel;
+ if (epoll_ctl(fd_ep, EPOLL_CTL_ADD, fd_kernel, &ep_kernel) < 0) {
+ err(udev, "fail to add fd to epoll: %m\n");
+ goto out;
+ }
+
printf("KERNEL - the kernel uevent\n");
}
printf("\n");
while (!udev_exit) {
int fdcount;
+ struct epoll_event ev[4];
+ int i;
- FD_ZERO(&readfds);
- if (kernel_monitor != NULL)
- FD_SET(udev_monitor_get_fd(kernel_monitor), &readfds);
- if (udev_monitor != NULL)
- FD_SET(udev_monitor_get_fd(udev_monitor), &readfds);
-
- fdcount = select(MAX(udev_monitor_get_fd(kernel_monitor), udev_monitor_get_fd(udev_monitor))+1,
- &readfds, NULL, NULL, NULL);
+ fdcount = epoll_wait(fd_ep, ev, ARRAY_SIZE(ev), -1);
if (fdcount < 0) {
if (errno != EINTR)
fprintf(stderr, "error receiving uevent message: %m\n");
continue;
}
- if ((kernel_monitor != NULL) && FD_ISSET(udev_monitor_get_fd(kernel_monitor), &readfds)) {
- struct udev_device *device;
-
- device = udev_monitor_receive_device(kernel_monitor);
- if (device == NULL)
- continue;
- print_device(device, "KERNEL", prop);
- udev_device_unref(device);
- }
-
- if ((udev_monitor != NULL) && FD_ISSET(udev_monitor_get_fd(udev_monitor), &readfds)) {
- struct udev_device *device;
-
- device = udev_monitor_receive_device(udev_monitor);
- if (device == NULL)
- continue;
- print_device(device, "UDEV", prop);
- udev_device_unref(device);
+ for (i = 0; i < fdcount; i++) {
+ if (ev[i].data.fd == fd_kernel && ev[i].events & EPOLLIN) {
+ struct udev_device *device;
+
+ device = udev_monitor_receive_device(kernel_monitor);
+ if (device == NULL)
+ continue;
+ print_device(device, "KERNEL", prop);
+ udev_device_unref(device);
+ } else if (ev[i].data.fd == fd_udev && ev[i].events & EPOLLIN) {
+ struct udev_device *device;
+
+ device = udev_monitor_receive_device(udev_monitor);
+ if (device == NULL)
+ continue;
+ print_device(device, "UDEV", prop);
+ udev_device_unref(device);
+ }
}
}
-
out:
+ if (fd_ep >= 0)
+ close(fd_ep);
udev_monitor_unref(udev_monitor);
udev_monitor_unref(kernel_monitor);
- udev_list_cleanup_entries(udev, &subsystem_match_list);
- udev_list_cleanup_entries(udev, &tag_match_list);
+ udev_list_cleanup(&subsystem_match_list);
+ udev_list_cleanup(&tag_match_list);
return rc;
}
+
+const struct udevadm_cmd udevadm_monitor = {
+ .name = "monitor",
+ .cmd = adm_monitor,
+ .help = "listen to kernel and udev events",
+};
#include <getopt.h>
#include <signal.h>
#include <time.h>
+#include <sys/inotify.h>
+#include <sys/poll.h>
#include <sys/stat.h>
#include <sys/types.h>
#include "udev.h"
-#define DEFAULT_TIMEOUT 180
-#define LOOP_PER_SECOND 20
-
-static volatile sig_atomic_t is_timeout;
-
-static void sig_handler(int signum)
-{
- switch (signum) {
- case SIGALRM:
- is_timeout = 1;
- case SIGUSR1:
- ;
- }
-}
-
-int udevadm_settle(struct udev *udev, int argc, char *argv[])
+static int adm_settle(struct udev *udev, int argc, char *argv[])
{
static const struct option options[] = {
{ "seq-start", required_argument, NULL, 's' },
{ "help", no_argument, NULL, 'h' },
{}
};
+ unsigned long long start_usec = now_usec();
unsigned long long start = 0;
unsigned long long end = 0;
int quiet = 0;
const char *exists = NULL;
- int timeout = DEFAULT_TIMEOUT;
- struct sigaction act;
- sigset_t mask;
+ unsigned int timeout = 120;
+ struct pollfd pfd[1];
struct udev_queue *udev_queue = NULL;
- int rc = 1;
+ int rc = EXIT_FAILURE;
dbg(udev, "version %s\n", VERSION);
- /* set signal handlers */
- memset(&act, 0x00, sizeof(act));
- act.sa_handler = sig_handler;
- sigemptyset (&act.sa_mask);
- act.sa_flags = 0;
- sigaction(SIGALRM, &act, NULL);
- sigaction(SIGUSR1, &act, NULL);
- sigemptyset(&mask);
- sigaddset(&mask, SIGUSR1);
- sigaddset(&mask, SIGALRM);
- sigprocmask(SIG_UNBLOCK, &mask, NULL);
-
for (;;) {
int option;
int seconds;
" --exit-if-exists=<file> stop waiting if file exists\n"
" --quiet do not print list after timeout\n"
" --help\n\n");
- exit(0);
+ exit(EXIT_SUCCESS);
+ default:
+ exit(EXIT_FAILURE);
}
}
- if (timeout > 0)
- alarm(timeout);
- else
- is_timeout = 1;
-
udev_queue = udev_queue_new(udev);
if (udev_queue == NULL)
exit(2);
if (getuid() == 0) {
struct udev_ctrl *uctrl;
- uctrl = udev_ctrl_new_from_socket(udev, UDEV_CTRL_SOCK_PATH);
+ uctrl = udev_ctrl_new(udev);
if (uctrl != NULL) {
- sigset_t oldmask;
-
- sigemptyset(&mask);
- sigaddset(&mask, SIGUSR1);
- sigaddset(&mask, SIGALRM);
- sigprocmask(SIG_BLOCK, &mask, &oldmask);
- if (udev_ctrl_send_settle(uctrl) > 0)
- sigsuspend(&oldmask);
- sigprocmask(SIG_SETMASK, &oldmask, NULL);
+ if (udev_ctrl_send_ping(uctrl, timeout) < 0) {
+ info(udev, "no connection to daemon\n");
+ udev_ctrl_unref(uctrl);
+ rc = EXIT_SUCCESS;
+ goto out;
+ }
udev_ctrl_unref(uctrl);
}
}
+ pfd[0].events = POLLIN;
+ pfd[0].fd = inotify_init1(IN_CLOEXEC);
+ if (pfd[0].fd < 0) {
+ err(udev, "inotify_init failed: %m\n");
+ } else {
+ if (inotify_add_watch(pfd[0].fd, udev_get_run_path(udev), IN_MOVED_TO) < 0) {
+ err(udev, "watching '%s' failed\n", udev_get_run_path(udev));
+ close(pfd[0].fd);
+ pfd[0].fd = -1;
+ }
+ }
+
for (;;) {
struct stat statbuf;
- const struct timespec duration = { 0 , 1000 * 1000 * 1000 / LOOP_PER_SECOND };
if (exists != NULL && stat(exists, &statbuf) == 0) {
- rc = 0;
+ rc = EXIT_SUCCESS;
break;
}
if (start > 0) {
/* if asked for, wait for a specific sequence of events */
if (udev_queue_get_seqnum_sequence_is_finished(udev_queue, start, end) == 1) {
- rc = 0;
+ rc = EXIT_SUCCESS;
break;
}
} else {
/* exit if queue is empty */
if (udev_queue_get_queue_is_empty(udev_queue)) {
- rc = 0;
+ rc = EXIT_SUCCESS;
break;
}
}
- if (is_timeout)
- break;
+ if (pfd[0].fd >= 0) {
+ int delay;
- nanosleep(&duration, NULL);
- }
+ if (exists != NULL || start > 0)
+ delay = 100;
+ else
+ delay = 1000;
+ /* wake up after delay, or immediately after the queue is rebuilt */
+ if (poll(pfd, 1, delay) > 0 && pfd[0].revents & POLLIN) {
+ char buf[sizeof(struct inotify_event) + PATH_MAX];
- /* if we reached the timeout, print the list of remaining events */
- if (is_timeout) {
- struct udev_list_entry *list_entry;
-
- if (!quiet && udev_queue_get_queued_list_entry(udev_queue) != NULL) {
- info(udev, "timeout waiting for udev queue\n");
- printf("\nudevadm settle - timeout of %i seconds reached, the event queue contains:\n", timeout);
- udev_list_entry_foreach(list_entry, udev_queue_get_queued_list_entry(udev_queue))
- printf(" %s (%s)\n",
- udev_list_entry_get_name(list_entry),
- udev_list_entry_get_value(list_entry));
+ read(pfd[0].fd, buf, sizeof(buf));
+ }
+ } else {
+ sleep(1);
}
- }
+ if (timeout > 0) {
+ unsigned long long age_usec;
+
+ age_usec = now_usec() - start_usec;
+ if (age_usec / (1000 * 1000) >= timeout) {
+ struct udev_list_entry *list_entry;
+
+ if (!quiet && udev_queue_get_queued_list_entry(udev_queue) != NULL) {
+ info(udev, "timeout waiting for udev queue\n");
+ printf("\nudevadm settle - timeout of %i seconds reached, the event queue contains:\n", timeout);
+ udev_list_entry_foreach(list_entry, udev_queue_get_queued_list_entry(udev_queue))
+ printf(" %s (%s)\n",
+ udev_list_entry_get_name(list_entry),
+ udev_list_entry_get_value(list_entry));
+ }
+
+ break;
+ }
+ }
+ }
+out:
+ if (pfd[0].fd >= 0)
+ close(pfd[0].fd);
udev_queue_unref(udev_queue);
return rc;
}
+
+const struct udevadm_cmd udevadm_settle = {
+ .name = "settle",
+ .cmd = adm_settle,
+ .help = "wait for the event queue to finish",
+};
--- /dev/null
+/*
+ * Copyright (C) 2011 Kay Sievers <kay.sievers@vrfy.org>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <stdlib.h>
+#include <stddef.h>
+#include <string.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <errno.h>
+#include <dirent.h>
+#include <fcntl.h>
+#include <syslog.h>
+#include <getopt.h>
+#include <signal.h>
+#include <time.h>
+#include <sys/inotify.h>
+#include <sys/poll.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+
+#include "udev.h"
+
+static void help(struct udev *udev)
+{
+ fprintf(stderr, "\n");
+ fprintf(stderr, "Usage: udevadm builtin [--help] <command> <syspath>\n");
+ udev_builtin_list(udev);
+ fprintf(stderr, "\n");
+}
+
+static int adm_builtin(struct udev *udev, int argc, char *argv[])
+{
+ static const struct option options[] = {
+ { "help", no_argument, NULL, 'h' },
+ {}
+ };
+ char *command = NULL;
+ char *syspath = NULL;
+ char filename[UTIL_PATH_SIZE];
+ struct udev_device *dev = NULL;
+ enum udev_builtin_cmd cmd;
+ int rc = EXIT_SUCCESS;
+
+ dbg(udev, "version %s\n", VERSION);
+
+ for (;;) {
+ int option;
+
+ option = getopt_long(argc, argv, "h", options, NULL);
+ if (option == -1)
+ break;
+
+ switch (option) {
+ case 'h':
+ help(udev);
+ goto out;
+ }
+ }
+ command = argv[optind++];
+ if (command == NULL) {
+ fprintf(stderr, "command missing\n");
+ help(udev);
+ rc = 2;
+ goto out;
+ }
+
+ syspath = argv[optind++];
+ if (syspath == NULL) {
+ fprintf(stderr, "syspath missing\n\n");
+ rc = 3;
+ goto out;
+ }
+
+ /* add /sys if needed */
+ if (strncmp(syspath, udev_get_sys_path(udev), strlen(udev_get_sys_path(udev))) != 0)
+ util_strscpyl(filename, sizeof(filename), udev_get_sys_path(udev), syspath, NULL);
+ else
+ util_strscpy(filename, sizeof(filename), syspath);
+ util_remove_trailing_chars(filename, '/');
+
+ dev = udev_device_new_from_syspath(udev, filename);
+ if (dev == NULL) {
+ fprintf(stderr, "unable to open device '%s'\n\n", filename);
+ rc = 4;
+ goto out;
+ }
+
+ cmd = udev_builtin_lookup(command);
+ if (cmd >= UDEV_BUILTIN_MAX) {
+ fprintf(stderr, "unknown command '%s'\n", command);
+ help(udev);
+ rc = 5;
+ goto out;
+ }
+
+ if (udev_builtin_run(dev, cmd, true) < 0) {
+ fprintf(stderr, "error executing '%s'\n\n", command);
+ rc = 6;
+ }
+out:
+ udev_device_unref(dev);
+ return rc;
+}
+
+const struct udevadm_cmd udevadm_test_builtin = {
+ .name = "test-builtin",
+ .cmd = adm_builtin,
+ .help = "test a built-in command",
+};
#include <signal.h>
#include <syslog.h>
#include <getopt.h>
+#include <sys/signalfd.h>
#include "udev.h"
-int udevadm_test(struct udev *udev, int argc, char *argv[])
+static int adm_test(struct udev *udev, int argc, char *argv[])
{
+ int resolve_names = 1;
char filename[UTIL_PATH_SIZE];
const char *action = "add";
const char *syspath = NULL;
- struct udev_event *event;
- struct udev_device *dev;
+ struct udev_event *event = NULL;
+ struct udev_device *dev = NULL;
struct udev_rules *rules = NULL;
struct udev_list_entry *entry;
+ sigset_t mask, sigmask_orig;
int err;
int rc = 0;
static const struct option options[] = {
{ "action", required_argument, NULL, 'a' },
+ { "resolve-names", required_argument, NULL, 'N' },
{ "help", no_argument, NULL, 'h' },
{}
};
for (;;) {
int option;
- option = getopt_long(argc, argv, "a:s:fh", options, NULL);
+ option = getopt_long(argc, argv, "a:s:N:fh", options, NULL);
if (option == -1)
break;
case 'a':
action = optarg;
break;
+ case 'N':
+ if (strcmp (optarg, "early") == 0) {
+ resolve_names = 1;
+ } else if (strcmp (optarg, "late") == 0) {
+ resolve_names = 0;
+ } else if (strcmp (optarg, "never") == 0) {
+ resolve_names = -1;
+ } else {
+ fprintf(stderr, "resolve-names must be early, late or never\n");
+ err(udev, "resolve-names must be early, late or never\n");
+ exit(EXIT_FAILURE);
+ }
+ break;
case 'h':
printf("Usage: udevadm test OPTIONS <syspath>\n"
" --action=<string> set action string\n"
" --help\n\n");
- exit(0);
+ exit(EXIT_SUCCESS);
default:
- exit(1);
+ exit(EXIT_FAILURE);
}
}
syspath = argv[optind];
if (syspath == NULL) {
fprintf(stderr, "syspath parameter missing\n");
- rc = 1;
- goto exit;
+ rc = 2;
+ goto out;
}
printf("This program is for debugging only, it does not run any program,\n"
"some values may be different, or not available at a simulation run.\n"
"\n");
- rules = udev_rules_new(udev, 1);
+ sigprocmask(SIG_SETMASK, NULL, &sigmask_orig);
+
+ rules = udev_rules_new(udev, resolve_names);
if (rules == NULL) {
fprintf(stderr, "error reading rules\n");
- rc = 1;
- goto exit;
+ rc = 3;
+ goto out;
}
/* add /sys if needed */
dev = udev_device_new_from_syspath(udev, filename);
if (dev == NULL) {
fprintf(stderr, "unable to open device '%s'\n", filename);
- rc = 2;
- goto exit;
+ rc = 4;
+ goto out;
}
/* skip reading of db, but read kernel parameters */
udev_device_set_action(dev, action);
event = udev_event_new(dev);
- err = udev_event_execute_rules(event, rules);
- if (udev_device_get_event_timeout(dev) >= 0)
- info(udev, "custom event timeout: %i\n", udev_device_get_event_timeout(dev));
+ sigfillset(&mask);
+ sigprocmask(SIG_SETMASK, &mask, &sigmask_orig);
+ event->fd_signal = signalfd(-1, &mask, SFD_NONBLOCK|SFD_CLOEXEC);
+ if (event->fd_signal < 0) {
+ fprintf(stderr, "error creating signalfd\n");
+ rc = 5;
+ goto out;
+ }
+
+ err = udev_event_execute_rules(event, rules, &sigmask_orig);
udev_list_entry_foreach(entry, udev_device_get_properties_list_entry(dev))
- info(udev, "%s=%s\n", udev_list_entry_get_name(entry), udev_list_entry_get_value(entry));
+ printf("%s=%s\n", udev_list_entry_get_name(entry), udev_list_entry_get_value(entry));
- if (err == 0)
+ if (err == 0) {
udev_list_entry_foreach(entry, udev_list_get_entry(&event->run_list)) {
char program[UTIL_PATH_SIZE];
udev_event_apply_format(event, udev_list_entry_get_name(entry), program, sizeof(program));
- info(udev, "run: '%s'\n", program);
+ printf("run: '%s'\n", program);
}
+ }
+out:
+ if (event != NULL && event->fd_signal >= 0)
+ close(event->fd_signal);
udev_event_unref(event);
udev_device_unref(dev);
-exit:
udev_rules_unref(rules);
return rc;
}
+
+const struct udevadm_cmd udevadm_test = {
+ .name = "test",
+ .cmd = adm_test,
+ .help = "test an event run",
+ .debug = true,
+};
}
}
-static int scan_failed(struct udev_enumerate *udev_enumerate)
-{
- struct udev *udev = udev_enumerate_get_udev(udev_enumerate);
- struct udev_queue *udev_queue;
- struct udev_list_entry *list_entry;
-
- udev_queue = udev_queue_new(udev);
- if (udev_queue == NULL)
- return -1;
- udev_list_entry_foreach(list_entry, udev_queue_get_failed_list_entry(udev_queue))
- udev_enumerate_add_syspath(udev_enumerate, udev_list_entry_get_name(list_entry));
- return 0;
-}
-
static const char *keyval(const char *str, const char **val, char *buf, size_t size)
{
char *pos;
return buf;
}
-int udevadm_trigger(struct udev *udev, int argc, char *argv[])
+static int adm_trigger(struct udev *udev, int argc, char *argv[])
{
static const struct option options[] = {
{ "verbose", no_argument, NULL, 'v' },
{ "property-match", required_argument, NULL, 'p' },
{ "tag-match", required_argument, NULL, 'g' },
{ "sysname-match", required_argument, NULL, 'y' },
+ { "parent-match", required_argument, NULL, 'b' },
{ "help", no_argument, NULL, 'h' },
{}
};
enum {
TYPE_DEVICES,
TYPE_SUBSYSTEMS,
- TYPE_FAILED,
} device_type = TYPE_DEVICES;
const char *action = "change";
struct udev_enumerate *udev_enumerate;
const char *val;
char buf[UTIL_PATH_SIZE];
- option = getopt_long(argc, argv, "vng:o:t:hc:p:s:S:a:A:y:", options, NULL);
+ option = getopt_long(argc, argv, "vng:o:t:hc:p:s:S:a:A:y:b:", options, NULL);
if (option == -1)
break;
device_type = TYPE_DEVICES;
} else if (strcmp(optarg, "subsystems") == 0) {
device_type = TYPE_SUBSYSTEMS;
- } else if (strcmp(optarg, "failed") == 0) {
- device_type = TYPE_FAILED;
} else {
err(udev, "unknown type --type=%s\n", optarg);
rc = 2;
case 'y':
udev_enumerate_add_match_sysname(udev_enumerate, optarg);
break;
+ case 'b': {
+ char path[UTIL_PATH_SIZE];
+ struct udev_device *dev;
+
+ /* add sys dir if needed */
+ if (strncmp(optarg, udev_get_sys_path(udev), strlen(udev_get_sys_path(udev))) != 0)
+ util_strscpyl(path, sizeof(path), udev_get_sys_path(udev), optarg, NULL);
+ else
+ util_strscpy(path, sizeof(path), optarg);
+ util_remove_trailing_chars(path, '/');
+ dev = udev_device_new_from_syspath(udev, path);
+ if (dev == NULL) {
+ err(udev, "unable to open the device '%s'\n", optarg);
+ rc = 2;
+ goto exit;
+ }
+ udev_enumerate_add_match_parent(udev_enumerate, dev);
+ /* drop reference immediately, enumerate pins the device as long as needed */
+ udev_device_unref(dev);
+ break;
+ }
case 'h':
printf("Usage: udevadm trigger OPTIONS\n"
" --verbose print the list of devices while running\n"
" --type= type of events to trigger\n"
" devices sys devices (default)\n"
" subsystems sys subsystems and drivers\n"
- " failed trigger only the events which have been\n"
- " marked as failed during a previous run\n"
" --action=<action> event action value, default is \"change\"\n"
" --subsystem-match=<subsystem> trigger devices from a matching subsystem\n"
" --subsystem-nomatch=<subsystem> exclude devices from a matching subsystem\n"
" --property-match=<key>=<value> trigger devices with a matching property\n"
" --tag-match=<key>=<value> trigger devices with a matching property\n"
" --sysname-match=<name> trigger devices with a matching name\n"
+ " --parent-match=<name> trigger devices with that parent device\n"
" --help\n\n");
goto exit;
default:
+ rc = 1;
goto exit;
}
}
switch (device_type) {
- case TYPE_FAILED:
- scan_failed(udev_enumerate);
- exec_list(udev_enumerate, action);
- goto exit;
case TYPE_SUBSYSTEMS:
udev_enumerate_scan_subsystems(udev_enumerate);
exec_list(udev_enumerate, action);
udev_enumerate_unref(udev_enumerate);
return rc;
}
+
+const struct udevadm_cmd udevadm_trigger = {
+ .name = "trigger",
+ .cmd = adm_trigger,
+ .help = "request events from the kernel",
+};
'\" t
.\" Title: udevadm
.\" Author: [see the "Author" section]
-.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
-.\" Date: 02/10/2011
+.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
+.\" Date: 10/19/2011
.\" Manual: udevadm
.\" Source: udev
.\" Language: English
.\"
-.TH "UDEVADM" "8" "02/10/2011" "udev" "udevadm"
+.TH "UDEVADM" "8" "10/19/2011" "udev" "udevadm"
+.\" -----------------------------------------------------------------
+.\" * Define some portability stuff
+.\" -----------------------------------------------------------------
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.\" http://bugs.debian.org/507673
+.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
\fBudevadm monitor \fR\fB[options]\fR
.HP \w'\fBudevadm\ test\ \fR\fB[options]\fR\fB\ \fR\fB\fIdevpath\fR\fR\ 'u
\fBudevadm test \fR\fB[options]\fR\fB \fR\fB\fIdevpath\fR\fR
+.HP \w'\fBudevadm\ test\-builtin\ \fR\fB[options]\fR\fB\ \fR\fB\fIcommand\fR\fR\fB\ \fR\fB\fIdevpath\fR\fR\ 'u
+\fBudevadm test\-builtin \fR\fB[options]\fR\fB \fR\fB\fIcommand\fR\fR\fB \fR\fB\fIdevpath\fR\fR
.SH "DESCRIPTION"
.PP
udevadm expects a command and command specific options\&. It controls the runtime behavior of udev, requests kernel events, manages the event queue, and provides simple debugging mechanisms\&.
query, the query returns the absolute path including the root directory\&.
.RE
.PP
+\fB\-\-run\fR
+.RS 4
+The udev runtime directory:
+/run/udev\&.
+.RE
+.PP
\fB\-\-attribute\-walk\fR
.RS 4
Print all sysfs properties of the specified device that can be used in udev rules to match the specified device\&. It prints all devices along the chain, up to the root of sysfs that can be used in udev rules\&.
Export the content of the udev database\&.
.RE
.PP
-\fB\-\-convert\-db\fR
+\fB\-\-cleanup\-db\fR
.RS 4
-Convert the database of an earlier udev version to the current format\&. This is only useful on udev version upgrades, where the content of the old database might be needed for the running system, and it is not sufficient for it, to be re\-created with the next bootup\&.
+Cleanup the udev database\&.
.RE
.PP
\fB\-\-version\fR
.RS 4
Trigger a specific type of devices\&. Valid types are:
\fBdevices\fR,
-\fBsubsystems\fR,
-\fBfailed\fR\&. The default value is
+\fBsubsystems\fR\&. The default value is
\fBdevices\fR\&.
.RE
.PP
.RS 4
Trigger events for devices with a matching sys device name\&. This option can be specified multiple times and supports shell style pattern matching\&.
.RE
+.PP
+\fB\-\-parent\-match=\fR\fB\fIsyspath\fR\fR
+.RS 4
+Trigger events for all children of a given device\&.
+.RE
.SS "udevadm settle [options]"
.PP
Watches the udev event queue, and exits if all current events are handled\&.
.PP
\fB\-\-timeout=\fR\fB\fIseconds\fR\fR
.RS 4
-Maximum number of seconds to wait for the event queue to become empty\&. The default value is 180 seconds\&. A value of 0 will check if the queue is empty and always return immediately\&.
+Maximum number of seconds to wait for the event queue to become empty\&. The default value is 120 seconds\&. A value of 0 will check if the queue is empty and always return immediately\&.
.RE
.PP
\fB\-\-seq\-start=\fR\fB\fIseqnum\fR\fR
.PP
Modify the internal state of the running udev daemon\&.
.PP
+\fB\-\-exit\fR
+.RS 4
+Signal and wait for udevd to exit\&.
+.RE
+.PP
\fB\-\-log\-priority=\fR\fB\fIvalue\fR\fR
.RS 4
Set the internal log level of udevd\&. Valid values are the numerical syslog priorities or their textual representations:
Set the maximum number of events, udevd will handle at the same time\&.
.RE
.PP
+\fB\-\-timeout=\fR\fIseconds\fR
+.RS 4
+The maximum number seonds to wait for a reply from udevd\&.
+.RE
+.PP
\fB\-\-help\fR
.RS 4
Print help text\&.
.RS 4
Print help text\&.
.RE
+.SS "udevadm test\-builtin [options] \fIcommand\fR \fIdevpath\fR"
+.PP
+Run a built\-in command for the given device, and print debug output\&.
+.PP
+\fB\-\-help\fR
+.RS 4
+Print help text\&.
+.RE
.SH "AUTHOR"
.PP
Written by Kay Sievers
#include "udev.h"
-static int debug;
+static bool debug;
static void log_fn(struct udev *udev, int priority,
const char *file, int line, const char *fn,
}
}
-struct command {
- const char *name;
- int (*cmd)(struct udev *udev, int argc, char *argv[]);
- const char *help;
- int debug;
-};
-
-static const struct command cmds[];
-
-static int version(struct udev *udev, int argc, char *argv[])
+static int adm_version(struct udev *udev, int argc, char *argv[])
{
printf("%s\n", VERSION);
return 0;
}
+static const struct udevadm_cmd udevadm_version = {
+ .name = "version",
+ .cmd = adm_version,
+};
+
+static int adm_help(struct udev *udev, int argc, char *argv[]);
+static const struct udevadm_cmd udevadm_help = {
+ .name = "help",
+ .cmd = adm_help,
+};
-static int help(struct udev *udev, int argc, char *argv[])
+static const struct udevadm_cmd *udevadm_cmds[] = {
+ &udevadm_info,
+ &udevadm_trigger,
+ &udevadm_settle,
+ &udevadm_control,
+ &udevadm_monitor,
+ &udevadm_test,
+ &udevadm_test_builtin,
+ &udevadm_version,
+ &udevadm_help,
+};
+
+static int adm_help(struct udev *udev, int argc, char *argv[])
{
- const struct command *cmd;
+ unsigned int i;
- printf("Usage: udevadm [--help] [--version] [--debug] COMMAND [COMMAND OPTIONS]\n");
- for (cmd = cmds; cmd->name != NULL; cmd++)
- if (cmd->help != NULL)
- printf(" %-12s %s\n", cmd->name, cmd->help);
- printf("\n");
+ fprintf(stderr, "Usage: udevadm [--help] [--version] [--debug] COMMAND [COMMAND OPTIONS]\n");
+ for (i = 0; i < ARRAY_SIZE(udevadm_cmds); i++)
+ if (udevadm_cmds[i]->help != NULL)
+ printf(" %-12s %s\n", udevadm_cmds[i]->name, udevadm_cmds[i]->help);
+ fprintf(stderr, "\n");
return 0;
}
-static const struct command cmds[] = {
- {
- .name = "info",
- .cmd = udevadm_info,
- .help = "query sysfs or the udev database",
- },
- {
- .name = "trigger",
- .cmd = udevadm_trigger,
- .help = "request events from the kernel",
- },
- {
- .name = "settle",
- .cmd = udevadm_settle,
- .help = "wait for the event queue to finish",
- },
- {
- .name = "control",
- .cmd = udevadm_control,
- .help = "control the udev daemon",
- },
- {
- .name = "monitor",
- .cmd = udevadm_monitor,
- .help = "listen to kernel and udev events",
- },
- {
- .name = "test",
- .cmd = udevadm_test,
- .help = "simulation run",
- .debug = 1,
- },
- {
- .name = "version",
- .cmd = version,
- },
- {
- .name = "help",
- .cmd = help,
- },
- {}
-};
-
-static int run_command(struct udev *udev, const struct command *cmd, int argc, char *argv[])
+static int run_command(struct udev *udev, const struct udevadm_cmd *cmd, int argc, char *argv[])
{
if (cmd->debug) {
- debug = 1;
+ debug = true;
if (udev_get_log_priority(udev) < LOG_INFO)
udev_set_log_priority(udev, LOG_INFO);
}
{}
};
const char *command;
- int i;
+ unsigned int i;
int rc = 1;
udev = udev_new();
switch (option) {
case 'd':
- debug = 1;
+ debug = true;
if (udev_get_log_priority(udev) < LOG_INFO)
udev_set_log_priority(udev, LOG_INFO);
break;
case 'h':
- rc = help(udev, argc, argv);
+ rc = adm_help(udev, argc, argv);
goto out;
case 'V':
- rc = version(udev, argc, argv);
+ rc = adm_version(udev, argc, argv);
goto out;
default:
goto out;
}
command = argv[optind];
+ info(udev, "runtime dir '%s'\n", udev_get_run_path(udev));
+
if (command != NULL)
- for (i = 0; cmds[i].cmd != NULL; i++) {
- if (strcmp(cmds[i].name, command) == 0) {
+ for (i = 0; i < ARRAY_SIZE(udevadm_cmds); i++) {
+ if (strcmp(udevadm_cmds[i]->name, command) == 0) {
argc -= optind;
argv += optind;
optind = 0;
- rc = run_command(udev, &cmds[i], argc, argv);
+ rc = run_command(udev, udevadm_cmds[i], argc, argv);
goto out;
}
}
fprintf(stderr, "missing or unknown command\n\n");
- help(udev, argc, argv);
+ adm_help(udev, argc, argv);
rc = 2;
out:
udev_selinux_exit(udev);
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>udevadm</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"/></head><body><div class="refentry" title="udevadm"><a id="udevadm"/><div class="titlepage"/><div class="refnamediv"><h2>Name</h2><p>udevadm — udev management tool</p></div><div class="refsynopsisdiv" title="Synopsis"><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="command">udevadm</code> [<code class="option">--debug</code>] [<code class="option">--version</code>] [<code class="option">--help</code>]</p></div><div class="cmdsynopsis"><p><code class="command">udevadm info <em class="replaceable"><code>options</code></em></code> </p></div><div class="cmdsynopsis"><p><code class="command">udevadm trigger [<span class="optional">options</span>]</code> </p></div><div class="cmdsynopsis"><p><code class="command">udevadm settle [<span class="optional">options</span>]</code> </p></div><div class="cmdsynopsis"><p><code class="command">udevadm control <em class="replaceable"><code>command</code></em></code> </p></div><div class="cmdsynopsis"><p><code class="command">udevadm monitor [<span class="optional">options</span>]</code> </p></div><div class="cmdsynopsis"><p><code class="command">udevadm test [<span class="optional">options</span>] <em class="replaceable"><code>devpath</code></em></code> </p></div></div><div class="refsect1" title="Description"><a id="id310298"/><h2>Description</h2><p>udevadm expects a command and command specific options. It
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>udevadm</title><meta name="generator" content="DocBook XSL Stylesheets V1.76.1"/></head><body><div class="refentry" title="udevadm"><a id="udevadm"/><div class="titlepage"/><div class="refnamediv"><h2>Name</h2><p>udevadm — udev management tool</p></div><div class="refsynopsisdiv" title="Synopsis"><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="command">udevadm</code> [<code class="option">--debug</code>] [<code class="option">--version</code>] [<code class="option">--help</code>]</p></div><div class="cmdsynopsis"><p><code class="command">udevadm info <em class="replaceable"><code>options</code></em></code> </p></div><div class="cmdsynopsis"><p><code class="command">udevadm trigger [<span class="optional">options</span>]</code> </p></div><div class="cmdsynopsis"><p><code class="command">udevadm settle [<span class="optional">options</span>]</code> </p></div><div class="cmdsynopsis"><p><code class="command">udevadm control <em class="replaceable"><code>command</code></em></code> </p></div><div class="cmdsynopsis"><p><code class="command">udevadm monitor [<span class="optional">options</span>]</code> </p></div><div class="cmdsynopsis"><p><code class="command">udevadm test [<span class="optional">options</span>] <em class="replaceable"><code>devpath</code></em></code> </p></div><div class="cmdsynopsis"><p><code class="command">udevadm test-builtin [<span class="optional">options</span>] <em class="replaceable"><code>command</code></em> <em class="replaceable"><code>devpath</code></em></code> </p></div></div><div class="refsect1" title="Description"><a id="id577108"/><h2>Description</h2><p>udevadm expects a command and command specific options. It
controls the runtime behavior of udev, requests kernel events,
- manages the event queue, and provides simple debugging mechanisms.</p></div><div class="refsect1" title="OPTIONS"><a id="id276431"/><h2>OPTIONS</h2><div class="variablelist"><dl><dt><span class="term"><code class="option">--debug</code></span></dt><dd><p>Print debug messages to stderr.</p></dd><dt><span class="term"><code class="option">--version</code></span></dt><dd><p>Print version number.</p></dd><dt><span class="term"><code class="option">--help</code></span></dt><dd><p>Print help text.</p></dd></dl></div><div class="refsect2" title="udevadm info options"><a id="id276488"/><h3>udevadm info <em class="replaceable"><code>options</code></em></h3><p>Queries the udev database for device information
+ manages the event queue, and provides simple debugging mechanisms.</p></div><div class="refsect1" title="OPTIONS"><a id="id544480"/><h2>OPTIONS</h2><div class="variablelist"><dl><dt><span class="term"><code class="option">--debug</code></span></dt><dd><p>Print debug messages to stderr.</p></dd><dt><span class="term"><code class="option">--version</code></span></dt><dd><p>Print version number.</p></dd><dt><span class="term"><code class="option">--help</code></span></dt><dd><p>Print help text.</p></dd></dl></div><div class="refsect2" title="udevadm info options"><a id="id544532"/><h3>udevadm info <em class="replaceable"><code>options</code></em></h3><p>Queries the udev database for device information
stored in the udev database. It can also query the properties
of a device from its sysfs representation to help creating udev
rules that match this device.</p><div class="variablelist"><dl><dt><span class="term"><code class="option">--query=<em class="replaceable"><code>type</code></em></code></span></dt><dd><p>Query the database for specified type of device data. It needs the
<span class="command"><strong>name</strong></span>, <span class="command"><strong>symlink</strong></span>, <span class="command"><strong>path</strong></span>,
<span class="command"><strong>property</strong></span>, <span class="command"><strong>all</strong></span>.</p></dd><dt><span class="term"><code class="option">--path=<em class="replaceable"><code>devpath</code></em></code></span></dt><dd><p>The devpath of the device to query.</p></dd><dt><span class="term"><code class="option">--name=<em class="replaceable"><code>file</code></em></code></span></dt><dd><p>The name of the device node or a symlink to query</p></dd><dt><span class="term"><code class="option">--root</code></span></dt><dd><p>The udev root directory: <code class="filename">/dev</code>. If used in conjunction
with a <span class="command"><strong>name</strong></span> or <span class="command"><strong>symlink</strong></span> query, the
- query returns the absolute path including the root directory.</p></dd><dt><span class="term"><code class="option">--attribute-walk</code></span></dt><dd><p>Print all sysfs properties of the specified device that can be used
+ query returns the absolute path including the root directory.</p></dd><dt><span class="term"><code class="option">--run</code></span></dt><dd><p>The udev runtime directory: <code class="filename">/run/udev</code>.</p></dd><dt><span class="term"><code class="option">--attribute-walk</code></span></dt><dd><p>Print all sysfs properties of the specified device that can be used
in udev rules to match the specified device. It prints all devices
along the chain, up to the root of sysfs that can be used in udev rules.</p></dd><dt><span class="term"><code class="option">--export</code></span></dt><dd><p>Print output as key/value pairs. Values are enclosed in single quotes.</p></dd><dt><span class="term"><code class="option">--export-prefix=<em class="replaceable"><code>name</code></em></code></span></dt><dd><p>Add a prefix to the key name of exported values.</p></dd><dt><span class="term"><code class="option">--device-id-of-file=<em class="replaceable"><code>file</code></em></code></span></dt><dd><p>Print major/minor numbers of the underlying device, where the file
- lives on.</p></dd><dt><span class="term"><code class="option">--export-db</code></span></dt><dd><p>Export the content of the udev database.</p></dd><dt><span class="term"><code class="option">--convert-db</code></span></dt><dd><p>Convert the database of an earlier udev version to the current format. This
- is only useful on udev version upgrades, where the content of the old database might
- be needed for the running system, and it is not sufficient for it, to be re-created
- with the next bootup.</p></dd><dt><span class="term"><code class="option">--version</code></span></dt><dd><p>Print version.</p></dd><dt><span class="term"><code class="option">--help</code></span></dt><dd><p>Print help text.</p></dd></dl></div></div><div class="refsect2" title="udevadm trigger [options]"><a id="id319399"/><h3>udevadm trigger [<span class="optional">options</span>]</h3><p>Request device events from the kernel. Primarily used to replay events at system coldplug time.</p><div class="variablelist"><dl><dt><span class="term"><code class="option">--verbose</code></span></dt><dd><p>Print the list of devices which will be triggered.</p></dd><dt><span class="term"><code class="option">--dry-run</code></span></dt><dd><p>Do not actually trigger the event.</p></dd><dt><span class="term"><code class="option">--type=<em class="replaceable"><code>type</code></em></code></span></dt><dd><p>Trigger a specific type of devices. Valid types are:
- <span class="command"><strong>devices</strong></span>, <span class="command"><strong>subsystems</strong></span>, <span class="command"><strong>failed</strong></span>.
+ lives on.</p></dd><dt><span class="term"><code class="option">--export-db</code></span></dt><dd><p>Export the content of the udev database.</p></dd><dt><span class="term"><code class="option">--cleanup-db</code></span></dt><dd><p>Cleanup the udev database.</p></dd><dt><span class="term"><code class="option">--version</code></span></dt><dd><p>Print version.</p></dd><dt><span class="term"><code class="option">--help</code></span></dt><dd><p>Print help text.</p></dd></dl></div></div><div class="refsect2" title="udevadm trigger [options]"><a id="id544876"/><h3>udevadm trigger [<span class="optional">options</span>]</h3><p>Request device events from the kernel. Primarily used to replay events at system coldplug time.</p><div class="variablelist"><dl><dt><span class="term"><code class="option">--verbose</code></span></dt><dd><p>Print the list of devices which will be triggered.</p></dd><dt><span class="term"><code class="option">--dry-run</code></span></dt><dd><p>Do not actually trigger the event.</p></dd><dt><span class="term"><code class="option">--type=<em class="replaceable"><code>type</code></em></code></span></dt><dd><p>Trigger a specific type of devices. Valid types are:
+ <span class="command"><strong>devices</strong></span>, <span class="command"><strong>subsystems</strong></span>.
The default value is <span class="command"><strong>devices</strong></span>.</p></dd><dt><span class="term"><code class="option">--action=<em class="replaceable"><code>action</code></em></code></span></dt><dd><p>Type of event to be triggered. The default value is <span class="command"><strong>change</strong></span>.</p></dd><dt><span class="term"><code class="option">--subsystem-match=<em class="replaceable"><code>subsystem</code></em></code></span></dt><dd><p>Trigger events for devices which belong to a matching subsystem. This option
can be specified multiple times and supports shell style pattern matching.</p></dd><dt><span class="term"><code class="option">--subsystem-nomatch=<em class="replaceable"><code>subsystem</code></em></code></span></dt><dd><p>Do not trigger events for devices which belong to a matching subsystem. This option
can be specified multiple times and supports shell style pattern matching.</p></dd><dt><span class="term"><code class="option">--attr-match=<em class="replaceable"><code>attribute</code></em>=<em class="replaceable"><code>value</code></em></code></span></dt><dd><p>Trigger events for devices with a matching sysfs attribute. If a value is specified
of the sysfs attribute is checked. This option can be specified multiple times.</p></dd><dt><span class="term"><code class="option">--property-match=<em class="replaceable"><code>property</code></em>=<em class="replaceable"><code>value</code></em></code></span></dt><dd><p>Trigger events for devices with a matching property value. This option can be
specified multiple times and supports shell style pattern matching.</p></dd><dt><span class="term"><code class="option">--tag-match=<em class="replaceable"><code>property</code></em></code></span></dt><dd><p>Trigger events for devices with a matching tag. This option can be
specified multiple times.</p></dd><dt><span class="term"><code class="option">--sysname-match=<em class="replaceable"><code>name</code></em></code></span></dt><dd><p>Trigger events for devices with a matching sys device name. This option can be
- specified multiple times and supports shell style pattern matching.</p></dd></dl></div></div><div class="refsect2" title="udevadm settle [options]"><a id="id319655"/><h3>udevadm settle [<span class="optional">options</span>]</h3><p>Watches the udev event queue, and exits if all current events are handled.</p><div class="variablelist"><dl><dt><span class="term"><code class="option">--timeout=<em class="replaceable"><code>seconds</code></em></code></span></dt><dd><p>Maximum number of seconds to wait for the event queue to become empty.
- The default value is 180 seconds. A value of 0 will check if the queue is empty
- and always return immediately.</p></dd><dt><span class="term"><code class="option">--seq-start=<em class="replaceable"><code>seqnum</code></em></code></span></dt><dd><p>Wait only for events after the given sequence number.</p></dd><dt><span class="term"><code class="option">--seq-end=<em class="replaceable"><code>seqnum</code></em></code></span></dt><dd><p>Wait only for events before the given sequence number.</p></dd><dt><span class="term"><code class="option">--exit-if-exists=<em class="replaceable"><code>file</code></em></code></span></dt><dd><p>Stop waiting if file exists.</p></dd><dt><span class="term"><code class="option">--quiet</code></span></dt><dd><p>Do not print any output, like the remaining queue entries when reaching the timeout.</p></dd><dt><span class="term"><code class="option">--help</code></span></dt><dd><p>Print help text.</p></dd></dl></div></div><div class="refsect2" title="udevadm control command"><a id="id319776"/><h3>udevadm control <em class="replaceable"><code>command</code></em></h3><p>Modify the internal state of the running udev daemon.</p><div class="variablelist"><dl><dt><span class="term"><code class="option">--log-priority=<em class="replaceable"><code>value</code></em></code></span></dt><dd><p>Set the internal log level of udevd. Valid values are the numerical
+ specified multiple times and supports shell style pattern matching.</p></dd><dt><span class="term"><code class="option">--parent-match=<em class="replaceable"><code>syspath</code></em></code></span></dt><dd><p>Trigger events for all children of a given device.</p></dd></dl></div></div><div class="refsect2" title="udevadm settle [options]"><a id="id586179"/><h3>udevadm settle [<span class="optional">options</span>]</h3><p>Watches the udev event queue, and exits if all current events are handled.</p><div class="variablelist"><dl><dt><span class="term"><code class="option">--timeout=<em class="replaceable"><code>seconds</code></em></code></span></dt><dd><p>Maximum number of seconds to wait for the event queue to become empty.
+ The default value is 120 seconds. A value of 0 will check if the queue is empty
+ and always return immediately.</p></dd><dt><span class="term"><code class="option">--seq-start=<em class="replaceable"><code>seqnum</code></em></code></span></dt><dd><p>Wait only for events after the given sequence number.</p></dd><dt><span class="term"><code class="option">--seq-end=<em class="replaceable"><code>seqnum</code></em></code></span></dt><dd><p>Wait only for events before the given sequence number.</p></dd><dt><span class="term"><code class="option">--exit-if-exists=<em class="replaceable"><code>file</code></em></code></span></dt><dd><p>Stop waiting if file exists.</p></dd><dt><span class="term"><code class="option">--quiet</code></span></dt><dd><p>Do not print any output, like the remaining queue entries when reaching the timeout.</p></dd><dt><span class="term"><code class="option">--help</code></span></dt><dd><p>Print help text.</p></dd></dl></div></div><div class="refsect2" title="udevadm control command"><a id="id586287"/><h3>udevadm control <em class="replaceable"><code>command</code></em></h3><p>Modify the internal state of the running udev daemon.</p><div class="variablelist"><dl><dt><span class="term"><code class="option">--exit</code></span></dt><dd><p>Signal and wait for udevd to exit.</p></dd><dt><span class="term"><code class="option">--log-priority=<em class="replaceable"><code>value</code></em></code></span></dt><dd><p>Set the internal log level of udevd. Valid values are the numerical
syslog priorities or their textual representations: <code class="option">err</code>,
<code class="option">info</code> and <code class="option">debug</code>.</p></dd><dt><span class="term"><code class="option">--stop-exec-queue</code></span></dt><dd><p>Signal udevd to stop executing new events. Incoming events
will be queued.</p></dd><dt><span class="term"><code class="option">--start-exec-queue</code></span></dt><dd><p>Signal udevd to enable the execution of events.</p></dd><dt><span class="term"><code class="option">--reload-rules</code></span></dt><dd><p>Signal udevd to reload the rules files.
The udev daemon detects changes automatically, this option is
usually not needed. Reloading rules does not apply any changes
to already existing devices.</p></dd><dt><span class="term"><code class="option">--property=<em class="replaceable"><code>KEY</code></em>=<em class="replaceable"><code>value</code></em></code></span></dt><dd><p>Set a global property for all events.</p></dd><dt><span class="term"><code class="option">--children-max=</code><em class="replaceable"><code>value</code></em></span></dt><dd><p>Set the maximum number of events, udevd will handle at the
- same time.</p></dd><dt><span class="term"><code class="option">--help</code></span></dt><dd><p>Print help text.</p></dd></dl></div></div><div class="refsect2" title="udevadm monitor [options]"><a id="id319926"/><h3>udevadm monitor [<span class="optional">options</span>]</h3><p>Listens to the kernel uevents and events sent out by a udev rule
+ same time.</p></dd><dt><span class="term"><code class="option">--timeout=</code><em class="replaceable"><code>seconds</code></em></span></dt><dd><p>The maximum number seonds to wait for a reply from udevd.</p></dd><dt><span class="term"><code class="option">--help</code></span></dt><dd><p>Print help text.</p></dd></dl></div></div><div class="refsect2" title="udevadm monitor [options]"><a id="id586452"/><h3>udevadm monitor [<span class="optional">options</span>]</h3><p>Listens to the kernel uevents and events sent out by a udev rule
and prints the devpath of the event to the console. It can be used to analyze the
event timing, by comparing the timestamps of the kernel uevent and the udev event.
- </p><div class="variablelist"><dl><dt><span class="term"><code class="option">--kernel</code></span></dt><dd><p>Print the kernel uevents.</p></dd><dt><span class="term"><code class="option">--udev</code></span></dt><dd><p>Print the udev event after the rule processing.</p></dd><dt><span class="term"><code class="option">--property</code></span></dt><dd><p>Also print the properties of the event.</p></dd><dt><span class="term"><code class="option">--subsystem-match=<em class="replaceable"><code>string[/string]</code></em></code></span></dt><dd><p>Filter events by subsystem[/devtype]. Only udev events with a matching subsystem value will pass.</p></dd><dt><span class="term"><code class="option">--tag-match=<em class="replaceable"><code>string</code></em></code></span></dt><dd><p>Filter events by property. Only udev events with a given tag attached will pass.</p></dd><dt><span class="term"><code class="option">--help</code></span></dt><dd><p>Print help text.</p></dd></dl></div></div><div class="refsect2" title="udevadm test [options] devpath"><a id="id320042"/><h3>udevadm test [<span class="optional">options</span>] <em class="replaceable"><code>devpath</code></em></h3><p>Simulate a udev event run for the given device, and print debug output.</p><div class="variablelist"><dl><dt><span class="term"><code class="option">--action=<em class="replaceable"><code>string</code></em></code></span></dt><dd><p>The action string.</p></dd><dt><span class="term"><code class="option">--subsystem=<em class="replaceable"><code>string</code></em></code></span></dt><dd><p>The subsystem string.</p></dd><dt><span class="term"><code class="option">--help</code></span></dt><dd><p>Print help text.</p></dd></dl></div></div></div><div class="refsect1" title="Author"><a id="id320114"/><h2>Author</h2><p>Written by Kay Sievers <code class="email"><<a class="email" href="mailto:kay.sievers@vrfy.org">kay.sievers@vrfy.org</a>></code>.</p></div><div class="refsect1" title="See Also"><a id="id320127"/><h2>See Also</h2><p><span class="citerefentry"><span class="refentrytitle">udev</span>(7)</span>
+ </p><div class="variablelist"><dl><dt><span class="term"><code class="option">--kernel</code></span></dt><dd><p>Print the kernel uevents.</p></dd><dt><span class="term"><code class="option">--udev</code></span></dt><dd><p>Print the udev event after the rule processing.</p></dd><dt><span class="term"><code class="option">--property</code></span></dt><dd><p>Also print the properties of the event.</p></dd><dt><span class="term"><code class="option">--subsystem-match=<em class="replaceable"><code>string[/string]</code></em></code></span></dt><dd><p>Filter events by subsystem[/devtype]. Only udev events with a matching subsystem value will pass.</p></dd><dt><span class="term"><code class="option">--tag-match=<em class="replaceable"><code>string</code></em></code></span></dt><dd><p>Filter events by property. Only udev events with a given tag attached will pass.</p></dd><dt><span class="term"><code class="option">--help</code></span></dt><dd><p>Print help text.</p></dd></dl></div></div><div class="refsect2" title="udevadm test [options] devpath"><a id="id586557"/><h3>udevadm test [<span class="optional">options</span>] <em class="replaceable"><code>devpath</code></em></h3><p>Simulate a udev event run for the given device, and print debug output.</p><div class="variablelist"><dl><dt><span class="term"><code class="option">--action=<em class="replaceable"><code>string</code></em></code></span></dt><dd><p>The action string.</p></dd><dt><span class="term"><code class="option">--subsystem=<em class="replaceable"><code>string</code></em></code></span></dt><dd><p>The subsystem string.</p></dd><dt><span class="term"><code class="option">--help</code></span></dt><dd><p>Print help text.</p></dd></dl></div></div><div class="refsect2" title="udevadm test-builtin [options] command devpath"><a id="id586620"/><h3>udevadm test-builtin [<span class="optional">options</span>] <em class="replaceable"><code>command</code></em> <em class="replaceable"><code>devpath</code></em></h3><p>Run a built-in command for the given device, and print debug output.</p><div class="variablelist"><dl><dt><span class="term"><code class="option">--help</code></span></dt><dd><p>Print help text.</p></dd></dl></div></div></div><div class="refsect1" title="Author"><a id="id586656"/><h2>Author</h2><p>Written by Kay Sievers <code class="email"><<a class="email" href="mailto:kay.sievers@vrfy.org">kay.sievers@vrfy.org</a>></code>.</p></div><div class="refsect1" title="See Also"><a id="id586667"/><h2>See Also</h2><p><span class="citerefentry"><span class="refentrytitle">udev</span>(7)</span>
<span class="citerefentry"><span class="refentrytitle">udevd</span>(8)</span></p></div></div></body></html>
<cmdsynopsis>
<command>udevadm test <optional>options</optional> <replaceable>devpath</replaceable></command>
</cmdsynopsis>
+ <cmdsynopsis>
+ <command>udevadm test-builtin <optional>options</optional> <replaceable>command</replaceable> <replaceable>devpath</replaceable></command>
+ </cmdsynopsis>
</refsynopsisdiv>
<refsect1><title>Description</title>
</listitem>
</varlistentry>
<varlistentry>
+ <term><option>--run</option></term>
+ <listitem>
+ <para>The udev runtime directory: <filename>/run/udev</filename>.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
<term><option>--attribute-walk</option></term>
<listitem>
<para>Print all sysfs properties of the specified device that can be used
</listitem>
</varlistentry>
<varlistentry>
- <term><option>--convert-db</option></term>
+ <term><option>--cleanup-db</option></term>
<listitem>
- <para>Convert the database of an earlier udev version to the current format. This
- is only useful on udev version upgrades, where the content of the old database might
- be needed for the running system, and it is not sufficient for it, to be re-created
- with the next bootup.</para>
+ <para>Cleanup the udev database.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--type=<replaceable>type</replaceable></option></term>
<listitem>
<para>Trigger a specific type of devices. Valid types are:
- <command>devices</command>, <command>subsystems</command>, <command>failed</command>.
+ <command>devices</command>, <command>subsystems</command>.
The default value is <command>devices</command>.</para>
</listitem>
</varlistentry>
specified multiple times and supports shell style pattern matching.</para>
</listitem>
</varlistentry>
+ <varlistentry>
+ <term><option>--parent-match=<replaceable>syspath</replaceable></option></term>
+ <listitem>
+ <para>Trigger events for all children of a given device.</para>
+ </listitem>
+ </varlistentry>
</variablelist>
</refsect2>
<term><option>--timeout=<replaceable>seconds</replaceable></option></term>
<listitem>
<para>Maximum number of seconds to wait for the event queue to become empty.
- The default value is 180 seconds. A value of 0 will check if the queue is empty
+ The default value is 120 seconds. A value of 0 will check if the queue is empty
and always return immediately.</para>
</listitem>
</varlistentry>
<para>Modify the internal state of the running udev daemon.</para>
<variablelist>
<varlistentry>
+ <term><option>--exit</option></term>
+ <listitem>
+ <para>Signal and wait for udevd to exit.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
<term><option>--log-priority=<replaceable>value</replaceable></option></term>
<listitem>
<para>Set the internal log level of udevd. Valid values are the numerical
</listitem>
</varlistentry>
<varlistentry>
+ <term><option>--timeout=</option><replaceable>seconds</replaceable></term>
+ <listitem>
+ <para>The maximum number seonds to wait for a reply from udevd.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
<term><option>--help</option></term>
<listitem>
<para>Print help text.</para>
</varlistentry>
</variablelist>
</refsect2>
+
+ <refsect2><title>udevadm test-builtin <optional>options</optional> <replaceable>command</replaceable> <replaceable>devpath</replaceable></title>
+ <para>Run a built-in command for the given device, and print debug output.</para>
+ <variablelist>
+ <varlistentry>
+ <term><option>--help</option></term>
+ <listitem>
+ <para>Print help text.</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect2>
</refsect1>
<refsect1><title>Author</title>
'\" t
.\" Title: udevd
.\" Author: [see the "Author" section]
-.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
-.\" Date: 02/10/2011
+.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
+.\" Date: 10/19/2011
.\" Manual: udevd
.\" Source: udev
.\" Language: English
.\"
-.TH "UDEVD" "8" "02/10/2011" "udev" "udevd"
+.TH "UDEVD" "8" "10/19/2011" "udev" "udevd"
+.\" -----------------------------------------------------------------
+.\" * Define some portability stuff
+.\" -----------------------------------------------------------------
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.\" http://bugs.debian.org/507673
+.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
/*
- * Copyright (C) 2004-2009 Kay Sievers <kay.sievers@vrfy.org>
+ * Copyright (C) 2004-2011 Kay Sievers <kay.sievers@vrfy.org>
* Copyright (C) 2004 Chris Friesen <chris_friesen@sympatico.ca>
* Copyright (C) 2009 Canonical Ltd.
* Copyright (C) 2009 Scott James Remnant <scott@netsplit.com>
#include <sys/socket.h>
#include <sys/un.h>
#include <sys/signalfd.h>
-#include <sys/select.h>
+#include <sys/epoll.h>
#include <sys/poll.h>
#include <sys/wait.h>
#include <sys/stat.h>
#include "udev.h"
#include "sd-daemon.h"
-#define UDEVD_PRIORITY -4
-#define UDEV_PRIORITY -2
-
static bool debug;
static void log_fn(struct udev *udev, int priority,
{
if (debug) {
char buf[1024];
- struct timeval tv;
- struct timezone tz;
+ struct timespec ts;
vsnprintf(buf, sizeof(buf), format, args);
- gettimeofday(&tv, &tz);
- fprintf(stderr, "%llu.%06u [%u] %s: %s",
- (unsigned long long) tv.tv_sec, (unsigned int) tv.tv_usec,
+ clock_gettime(CLOCK_MONOTONIC, &ts);
+ fprintf(stderr, "[%llu.%06u] [%u] %s: %s",
+ (unsigned long long) ts.tv_sec, (unsigned int) ts.tv_nsec/1000,
(int) getpid(), fn, buf);
} else {
vsyslog(priority, format, args);
static struct udev_queue_export *udev_queue_export;
static struct udev_ctrl *udev_ctrl;
static struct udev_monitor *monitor;
-static int worker_watch[2];
-static pid_t settle_pid;
+static int worker_watch[2] = { -1, -1 };
+static int fd_signal = -1;
+static int fd_ep = -1;
+static int fd_inotify = -1;
static bool stop_exec_queue;
static bool reload_config;
static int children;
static int children_max;
static int exec_delay;
-static sigset_t orig_sigmask;
-static struct udev_list_node event_list;
-static struct udev_list_node worker_list;
+static sigset_t sigmask_orig;
+static UDEV_LIST(event_list);
+static UDEV_LIST(worker_list);
static bool udev_exit;
-static volatile sig_atomic_t worker_exit;
-
-enum poll_fd {
- FD_CONTROL,
- FD_NETLINK,
- FD_INOTIFY,
- FD_SIGNAL,
- FD_WORKER,
-};
-
-static struct pollfd pfd[] = {
- [FD_NETLINK] = { .events = POLLIN },
- [FD_WORKER] = { .events = POLLIN },
- [FD_SIGNAL] = { .events = POLLIN },
- [FD_INOTIFY] = { .events = POLLIN },
- [FD_CONTROL] = { .events = POLLIN },
-};
enum event_state {
EVENT_UNDEF,
return (struct event *)event;
}
+static void event_queue_cleanup(struct udev *udev, enum event_state type);
+
enum worker_state {
WORKER_UNDEF,
WORKER_RUNNING,
return (struct worker *)worker;
}
-static void event_queue_delete(struct event *event)
+static void event_queue_delete(struct event *event, bool export)
{
udev_list_node_remove(&event->node);
- /* mark as failed, if "add" event returns non-zero */
- if (event->exitcode != 0 && strcmp(udev_device_get_action(event->dev), "remove") != 0)
- udev_queue_export_device_failed(udev_queue_export, event->dev);
- else
+ if (export) {
udev_queue_export_device_finished(udev_queue_export, event->dev);
-
- info(event->udev, "seq %llu done with %i\n", udev_device_get_seqnum(event->dev), event->exitcode);
+ info(event->udev, "seq %llu done with %i\n", udev_device_get_seqnum(event->dev), event->exitcode);
+ }
udev_device_unref(event->dev);
free(event);
}
-static void event_sig_handler(int signum)
-{
- switch (signum) {
- case SIGALRM:
- _exit(1);
- break;
- case SIGTERM:
- worker_exit = true;
- break;
- }
-}
-
static struct worker *worker_ref(struct worker *worker)
{
worker->refcount++;
return worker;
}
+static void worker_cleanup(struct worker *worker)
+{
+ udev_list_node_remove(&worker->node);
+ udev_monitor_unref(worker->monitor);
+ children--;
+ free(worker);
+}
+
static void worker_unref(struct worker *worker)
{
worker->refcount--;
if (worker->refcount > 0)
return;
-
- udev_list_node_remove(&worker->node);
- udev_monitor_unref(worker->monitor);
- children--;
info(worker->udev, "worker [%u] cleaned up\n", worker->pid);
- free(worker);
+ worker_cleanup(worker);
+}
+
+static void worker_list_cleanup(struct udev *udev)
+{
+ struct udev_list_node *loop, *tmp;
+
+ udev_list_node_foreach_safe(loop, tmp, &worker_list) {
+ struct worker *worker = node_to_worker(loop);
+
+ worker_cleanup(worker);
+ }
}
static void worker_new(struct event *event)
{
+ struct udev *udev = event->udev;
struct worker *worker;
struct udev_monitor *worker_monitor;
pid_t pid;
- struct sigaction act;
/* listen for new events */
- worker_monitor = udev_monitor_new_from_netlink(event->udev, NULL);
+ worker_monitor = udev_monitor_new_from_netlink(udev, NULL);
if (worker_monitor == NULL)
return;
/* allow the main daemon netlink address to send devices to the worker */
}
/* worker + event reference */
worker->refcount = 2;
- worker->udev = event->udev;
+ worker->udev = udev;
pid = fork();
switch (pid) {
case 0: {
- sigset_t sigmask;
- struct udev_device *dev;
- struct pollfd pmon = {
- .fd = udev_monitor_get_fd(worker_monitor),
- .events = POLLIN,
- };
+ struct udev_device *dev = NULL;
+ int fd_monitor;
+ struct epoll_event ep_signal, ep_monitor;
+ sigset_t mask;
+ int rc = EXIT_SUCCESS;
+ /* move initial device from queue */
+ dev = event->dev;
+ event->dev = NULL;
+
+ free(worker);
+ worker_list_cleanup(udev);
+ event_queue_cleanup(udev, EVENT_UNDEF);
udev_queue_export_unref(udev_queue_export);
udev_monitor_unref(monitor);
udev_ctrl_unref(udev_ctrl);
- close(pfd[FD_SIGNAL].fd);
+ close(fd_signal);
+ close(fd_ep);
close(worker_watch[READ_END]);
- udev_log_close();
- udev_log_init("udevd-work");
- setpriority(PRIO_PROCESS, 0, UDEV_PRIORITY);
-
- /* set signal handlers */
- memset(&act, 0x00, sizeof(act));
- act.sa_handler = event_sig_handler;
- sigemptyset (&act.sa_mask);
- act.sa_flags = 0;
- sigaction(SIGTERM, &act, NULL);
- sigaction(SIGALRM, &act, NULL);
-
- /* unblock SIGALRM */
- sigfillset(&sigmask);
- sigdelset(&sigmask, SIGALRM);
- sigprocmask(SIG_SETMASK, &sigmask, NULL);
- /* SIGTERM is unblocked in ppoll() */
- sigdelset(&sigmask, SIGTERM);
+
+ sigfillset(&mask);
+ fd_signal = signalfd(-1, &mask, SFD_NONBLOCK|SFD_CLOEXEC);
+ if (fd_signal < 0) {
+ err(udev, "error creating signalfd %m\n");
+ rc = 2;
+ goto out;
+ }
+
+ fd_ep = epoll_create1(EPOLL_CLOEXEC);
+ if (fd_ep < 0) {
+ err(udev, "error creating epoll fd: %m\n");
+ rc = 3;
+ goto out;
+ }
+
+ memset(&ep_signal, 0, sizeof(struct epoll_event));
+ ep_signal.events = EPOLLIN;
+ ep_signal.data.fd = fd_signal;
+
+ fd_monitor = udev_monitor_get_fd(worker_monitor);
+ memset(&ep_monitor, 0, sizeof(struct epoll_event));
+ ep_monitor.events = EPOLLIN;
+ ep_monitor.data.fd = fd_monitor;
+
+ if (epoll_ctl(fd_ep, EPOLL_CTL_ADD, fd_signal, &ep_signal) < 0 ||
+ epoll_ctl(fd_ep, EPOLL_CTL_ADD, fd_monitor, &ep_monitor) < 0) {
+ err(udev, "fail to add fds to epoll: %m\n");
+ rc = 4;
+ goto out;
+ }
/* request TERM signal if parent exits */
prctl(PR_SET_PDEATHSIG, SIGTERM);
- /* initial device */
- dev = event->dev;
-
- do {
+ for (;;) {
struct udev_event *udev_event;
- struct worker_message msg = {};
+ struct worker_message msg;
int err;
- int failed = 0;
- info(event->udev, "seq %llu running\n", udev_device_get_seqnum(dev));
+ info(udev, "seq %llu running\n", udev_device_get_seqnum(dev));
udev_event = udev_event_new(dev);
- if (udev_event == NULL)
- _exit(3);
+ if (udev_event == NULL) {
+ rc = 5;
+ goto out;
+ }
- /* set timeout to prevent hanging processes */
- alarm(UDEV_EVENT_TIMEOUT);
+ /* needed for SIGCHLD/SIGTERM in spawn() */
+ udev_event->fd_signal = fd_signal;
if (exec_delay > 0)
udev_event->exec_delay = exec_delay;
/* apply rules, create node, symlinks */
- err = udev_event_execute_rules(udev_event, rules);
-
- /* rules may change/disable the timeout */
- if (udev_device_get_event_timeout(dev) >= 0)
- alarm(udev_device_get_event_timeout(dev));
+ err = udev_event_execute_rules(udev_event, rules, &sigmask_orig);
if (err == 0)
- failed = udev_event_execute_run(udev_event, &orig_sigmask);
-
- alarm(0);
+ udev_event_execute_run(udev_event, &sigmask_orig);
/* apply/restore inotify watch */
if (err == 0 && udev_event->inotify_watch) {
- udev_watch_begin(udev_event->udev, dev);
+ udev_watch_begin(udev, dev);
udev_device_update_db(dev);
}
udev_monitor_send_device(worker_monitor, NULL, dev);
/* send udevd the result of the event execution */
+ memset(&msg, 0, sizeof(struct worker_message));
if (err != 0)
msg.exitcode = err;
- else if (failed != 0)
- msg.exitcode = failed;
msg.pid = getpid();
send(worker_watch[WRITE_END], &msg, sizeof(struct worker_message), 0);
- info(event->udev, "seq %llu processed with %i\n", udev_device_get_seqnum(dev), err);
- udev_event_unref(udev_event);
+ info(udev, "seq %llu processed with %i\n", udev_device_get_seqnum(dev), err);
+
udev_device_unref(dev);
dev = NULL;
- /* wait for more device messages or signal from udevd */
- while (!worker_exit) {
- int fdcount;
+ if (udev_event->sigterm) {
+ udev_event_unref(udev_event);
+ goto out;
+ }
- fdcount = ppoll(&pmon, 1, NULL, &sigmask);
- if (fdcount < 0)
- continue;
+ udev_event_unref(udev_event);
- if (pmon.revents & POLLIN) {
- dev = udev_monitor_receive_device(worker_monitor);
- if (dev != NULL)
+ /* wait for more device messages from main udevd, or term signal */
+ while (dev == NULL) {
+ struct epoll_event ev[4];
+ int fdcount;
+ int i;
+
+ fdcount = epoll_wait(fd_ep, ev, ARRAY_SIZE(ev), -1);
+ if (fdcount < 0) {
+ if (errno == EINTR)
+ continue;
+ err = -errno;
+ err(udev, "failed to poll: %m\n");
+ goto out;
+ }
+
+ for (i = 0; i < fdcount; i++) {
+ if (ev[i].data.fd == fd_monitor && ev[i].events & EPOLLIN) {
+ dev = udev_monitor_receive_device(worker_monitor);
break;
+ } else if (ev[i].data.fd == fd_signal && ev[i].events & EPOLLIN) {
+ struct signalfd_siginfo fdsi;
+ ssize_t size;
+
+ size = read(fd_signal, &fdsi, sizeof(struct signalfd_siginfo));
+ if (size != sizeof(struct signalfd_siginfo))
+ continue;
+ switch (fdsi.ssi_signo) {
+ case SIGTERM:
+ goto out;
+ }
+ }
}
}
- } while (dev != NULL);
-
+ }
+out:
+ udev_device_unref(dev);
+ if (fd_signal >= 0)
+ close(fd_signal);
+ if (fd_ep >= 0)
+ close(fd_ep);
+ close(fd_inotify);
+ close(worker_watch[WRITE_END]);
+ udev_rules_unref(rules);
udev_monitor_unref(worker_monitor);
+ udev_unref(udev);
udev_log_close();
- exit(0);
+ exit(rc);
}
case -1:
udev_monitor_unref(worker_monitor);
event->state = EVENT_QUEUED;
free(worker);
- err(event->udev, "fork of child failed: %m\n");
+ err(udev, "fork of child failed: %m\n");
break;
default:
/* close monitor, but keep address around */
event->state = EVENT_RUNNING;
udev_list_node_append(&worker->node, &worker_list);
children++;
- info(event->udev, "seq %llu forked new worker [%u]\n", udev_device_get_seqnum(event->dev), pid);
+ info(udev, "seq %llu forked new worker [%u]\n", udev_device_get_seqnum(event->dev), pid);
break;
}
}
return false;
}
-static void events_start(struct udev *udev)
+static void event_queue_start(struct udev *udev)
{
struct udev_list_node *loop;
}
}
-static void worker_returned(void)
+static void event_queue_cleanup(struct udev *udev, enum event_state match_type)
+{
+ struct udev_list_node *loop, *tmp;
+
+ udev_list_node_foreach_safe(loop, tmp, &event_list) {
+ struct event *event = node_to_event(loop);
+
+ if (match_type != EVENT_UNDEF && match_type != event->state)
+ continue;
+
+ event_queue_delete(event, false);
+ }
+}
+
+static void worker_returned(int fd_worker)
{
for (;;) {
struct worker_message msg;
ssize_t size;
struct udev_list_node *loop;
- size = recv(pfd[FD_WORKER].fd, &msg, sizeof(struct worker_message), MSG_DONTWAIT);
+ size = recv(fd_worker, &msg, sizeof(struct worker_message), MSG_DONTWAIT);
if (size != sizeof(struct worker_message))
break;
/* worker returned */
worker->event->exitcode = msg.exitcode;
- event_queue_delete(worker->event);
+ event_queue_delete(worker->event, true);
worker->event = NULL;
if (worker->state != WORKER_KILLED)
worker->state = WORKER_IDLE;
}
/* receive the udevd message from userspace */
-static void handle_ctrl_msg(struct udev_ctrl *uctrl)
+static struct udev_ctrl_connection *handle_ctrl_msg(struct udev_ctrl *uctrl)
{
struct udev *udev = udev_ctrl_get_udev(uctrl);
- struct udev_ctrl_msg *ctrl_msg;
+ struct udev_ctrl_connection *ctrl_conn;
+ struct udev_ctrl_msg *ctrl_msg = NULL;
const char *str;
int i;
- ctrl_msg = udev_ctrl_receive_msg(uctrl);
+ ctrl_conn = udev_ctrl_get_connection(uctrl);
+ if (ctrl_conn == NULL)
+ goto out;
+
+ ctrl_msg = udev_ctrl_receive_msg(ctrl_conn);
if (ctrl_msg == NULL)
- return;
+ goto out;
i = udev_ctrl_get_set_log_level(ctrl_msg);
if (i >= 0) {
children_max = i;
}
- settle_pid = udev_ctrl_get_settle(ctrl_msg);
- if (settle_pid > 0) {
- info(udev, "udevd message (SETTLE) received\n");
- kill(settle_pid, SIGUSR1);
- settle_pid = 0;
+ if (udev_ctrl_get_ping(ctrl_msg) > 0)
+ info(udev, "udevd message (SYNC) received\n");
+
+ if (udev_ctrl_get_exit(ctrl_msg) > 0) {
+ info(udev, "udevd message (EXIT) received\n");
+ udev_exit = true;
+ /* keep reference to block the client until we exit */
+ udev_ctrl_connection_ref(ctrl_conn);
}
+out:
udev_ctrl_msg_unref(ctrl_msg);
+ return udev_ctrl_connection_unref(ctrl_conn);
}
/* read inotify messages */
char *buf;
struct inotify_event *ev;
- if ((ioctl(pfd[FD_INOTIFY].fd, FIONREAD, &nbytes) < 0) || (nbytes <= 0))
+ if ((ioctl(fd_inotify, FIONREAD, &nbytes) < 0) || (nbytes <= 0))
return 0;
buf = malloc(nbytes);
return -1;
}
- nbytes = read(pfd[FD_INOTIFY].fd, buf, nbytes);
+ nbytes = read(fd_inotify, buf, nbytes);
for (pos = 0; pos < nbytes; pos += sizeof(struct inotify_event) + ev->len) {
struct udev_device *dev;
info(udev, "device %s closed, synthesising 'change'\n", udev_device_get_devnode(dev));
util_strscpyl(filename, sizeof(filename), udev_device_get_syspath(dev), "/uevent", NULL);
fd = open(filename, O_WRONLY);
- if (fd < 0 || write(fd, "change", 6) < 0)
- info(udev, "error writing uevent: %m\n");
- close(fd);
+ if (fd >= 0) {
+ if (write(fd, "change", 6) < 0)
+ info(udev, "error writing uevent: %m\n");
+ close(fd);
+ }
}
if (ev->mask & IN_IGNORED)
udev_watch_end(udev, dev);
if (worker->pid != pid)
continue;
-
info(udev, "worker [%u] exit\n", pid);
+
+ if (WIFEXITED(status)) {
+ if (WEXITSTATUS(status) != 0)
+ err(udev, "worker [%u] exit with return code %i\n", pid, WEXITSTATUS(status));
+ } else if (WIFSIGNALED(status)) {
+ err(udev, "worker [%u] terminated by signal %i (%s)\n",
+ pid, WTERMSIG(status), strsignal(WTERMSIG(status)));
+ } else if (WIFSTOPPED(status)) {
+ err(udev, "worker [%u] stopped\n", pid);
+ } else if (WIFCONTINUED(status)) {
+ err(udev, "worker [%u] continued\n", pid);
+ } else {
+ err(udev, "worker [%u] exit with status 0x%04x\n", pid, status);
+ }
+
if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) {
- err(udev, "worker [%u] unexpectedly returned with status 0x%04x\n", pid, status);
if (worker->event != NULL) {
- err(udev, "worker [%u] failed while handling '%s'\n", pid, worker->event->devpath);
+ err(udev, "worker [%u] failed while handling '%s'\n",
+ pid, worker->event->devpath);
worker->event->exitcode = -32;
- event_queue_delete(worker->event);
- /* drop reference from running event */
+ event_queue_delete(worker->event, true);
+ /* drop reference taken for state 'running' */
worker_unref(worker);
}
}
if (sscanf(devno, "%c%u:%u", &type, &maj, &min) != 3)
continue;
+ /* set sticky bit, so we do not remove the node on module unload */
if (type == 'c')
- mode = 0600 | S_IFCHR;
+ mode = 01600|S_IFCHR;
else if (type == 'b')
- mode = 0600 | S_IFBLK;
+ mode = 01600|S_IFBLK;
else
continue;
util_strscpyl(filename, sizeof(filename), udev_get_dev_path(udev), "/", devname, NULL);
- util_create_path(udev, filename);
+ util_create_path_selinux(udev, filename);
udev_selinux_setfscreatecon(udev, filename, mode);
info(udev, "mknod '%s' %c%u:%u\n", filename, type, maj, min);
if (mknod(filename, mode, makedev(maj, min)) < 0 && errno == EEXIST)
fclose(f);
}
-static int copy_dir(struct udev *udev, DIR *dir_from, DIR *dir_to, int maxdepth)
+static int copy_dev_dir(struct udev *udev, DIR *dir_from, DIR *dir_to, int maxdepth)
{
struct dirent *dent;
continue;
}
- copy_dir(udev, dir2_from, dir2_to, maxdepth-1);
+ copy_dev_dir(udev, dir2_from, dir2_to, maxdepth-1);
closedir(dir2_to);
closedir(dir2_from);
dir_from = opendir(LIBEXECDIR "/devices");
if (dir_from == NULL)
return;
- copy_dir(udev, dir_from, dir, 8);
+ copy_dev_dir(udev, dir_from, dir, 8);
closedir(dir_from);
}
return memsize;
}
+static int convert_db(struct udev *udev)
+{
+ char filename[UTIL_PATH_SIZE];
+ FILE *f;
+ struct udev_enumerate *udev_enumerate;
+ struct udev_list_entry *list_entry;
+
+ /* current database */
+ util_strscpyl(filename, sizeof(filename), udev_get_run_path(udev), "/data", NULL);
+ if (access(filename, F_OK) >= 0)
+ return 0;
+
+ /* make sure we do not get here again */
+ util_create_path(udev, filename);
+ mkdir(filename, 0755);
+
+ /* old database */
+ util_strscpyl(filename, sizeof(filename), udev_get_dev_path(udev), "/.udev/db", NULL);
+ if (access(filename, F_OK) < 0)
+ return 0;
+
+ f = fopen("/dev/kmsg", "w");
+ if (f != NULL) {
+ fprintf(f, "<30>udevd[%u]: converting old udev database\n", getpid());
+ fclose(f);
+ }
+
+ udev_enumerate = udev_enumerate_new(udev);
+ if (udev_enumerate == NULL)
+ return -1;
+ udev_enumerate_scan_devices(udev_enumerate);
+ udev_list_entry_foreach(list_entry, udev_enumerate_get_list_entry(udev_enumerate)) {
+ struct udev_device *device;
+
+ device = udev_device_new_from_syspath(udev, udev_list_entry_get_name(list_entry));
+ if (device == NULL)
+ continue;
+
+ /* try to find the old database for devices without a current one */
+ if (udev_device_read_db(device, NULL) < 0) {
+ bool have_db;
+ const char *id;
+ struct stat stats;
+ char devpath[UTIL_PATH_SIZE];
+ char from[UTIL_PATH_SIZE];
+
+ have_db = false;
+
+ /* find database in old location */
+ id = udev_device_get_id_filename(device);
+ util_strscpyl(from, sizeof(from), udev_get_dev_path(udev), "/.udev/db/", id, NULL);
+ if (lstat(from, &stats) == 0) {
+ if (!have_db) {
+ udev_device_read_db(device, from);
+ have_db = true;
+ }
+ unlink(from);
+ }
+
+ /* find old database with $subsys:$sysname name */
+ util_strscpyl(from, sizeof(from), udev_get_dev_path(udev),
+ "/.udev/db/", udev_device_get_subsystem(device), ":",
+ udev_device_get_sysname(device), NULL);
+ if (lstat(from, &stats) == 0) {
+ if (!have_db) {
+ udev_device_read_db(device, from);
+ have_db = true;
+ }
+ unlink(from);
+ }
+
+ /* find old database with the encoded devpath name */
+ util_path_encode(udev_device_get_devpath(device), devpath, sizeof(devpath));
+ util_strscpyl(from, sizeof(from), udev_get_dev_path(udev), "/.udev/db/", devpath, NULL);
+ if (lstat(from, &stats) == 0) {
+ if (!have_db) {
+ udev_device_read_db(device, from);
+ have_db = true;
+ }
+ unlink(from);
+ }
+
+ /* write out new database */
+ if (have_db)
+ udev_device_update_db(device);
+ }
+ udev_device_unref(device);
+ }
+ udev_enumerate_unref(udev_enumerate);
+ return 0;
+}
+
+static int systemd_fds(struct udev *udev, int *rctrl, int *rnetlink)
+{
+ int ctrl = -1, netlink = -1;
+ int fd, n;
+
+ n = sd_listen_fds(true);
+ if (n <= 0)
+ return -1;
+
+ for (fd = SD_LISTEN_FDS_START; fd < n + SD_LISTEN_FDS_START; fd++) {
+ if (sd_is_socket(fd, AF_LOCAL, SOCK_SEQPACKET, -1)) {
+ if (ctrl >= 0)
+ return -1;
+ ctrl = fd;
+ continue;
+ }
+
+ if (sd_is_socket(fd, AF_NETLINK, SOCK_RAW, -1)) {
+ if (netlink >= 0)
+ return -1;
+ netlink = fd;
+ continue;
+ }
+
+ return -1;
+ }
+
+ if (ctrl < 0 || netlink < 0)
+ return -1;
+
+ info(udev, "ctrl=%i netlink=%i\n", ctrl, netlink);
+ *rctrl = ctrl;
+ *rnetlink = netlink;
+ return 0;
+}
+
int main(int argc, char *argv[])
{
struct udev *udev;
- int fd;
FILE *f;
sigset_t mask;
int daemonize = false;
{ "version", no_argument, NULL, 'V' },
{}
};
+ int fd_ctrl = -1;
+ int fd_netlink = -1;
+ int fd_worker = -1;
+ struct epoll_event ep_ctrl, ep_inotify, ep_signal, ep_netlink, ep_worker;
+ struct udev_ctrl_connection *ctrl_conn = NULL;
int rc = 1;
udev = udev_new();
info(udev, "version %s\n", VERSION);
udev_selinux_init(udev);
+ /* make sure, that our runtime dir exists and is writable */
+ if (utimensat(AT_FDCWD, udev_get_run_config_path(udev), NULL, 0) < 0) {
+ /* try to create our own subdirectory, do not create parent directories */
+ mkdir(udev_get_run_config_path(udev), 0755);
+
+ if (utimensat(AT_FDCWD, udev_get_run_config_path(udev), NULL, 0) >= 0) {
+ /* directory seems writable now */
+ udev_set_run_path(udev, udev_get_run_config_path(udev));
+ } else {
+ /* fall back to /dev/.udev */
+ char filename[UTIL_PATH_SIZE];
+
+ util_strscpyl(filename, sizeof(filename), udev_get_dev_path(udev), "/.udev", NULL);
+ if (udev_set_run_path(udev, filename) == NULL)
+ goto exit;
+ mkdir(udev_get_run_path(udev), 0755);
+ err(udev, "error: runtime directory '%s' not writable, for now falling back to '%s'",
+ udev_get_run_config_path(udev), udev_get_run_path(udev));
+ }
+ }
+ /* relabel runtime dir only if it resides below /dev */
+ if (strncmp(udev_get_run_path(udev), udev_get_dev_path(udev), strlen(udev_get_dev_path(udev))) == 0)
+ udev_selinux_lsetfilecon(udev, udev_get_run_path(udev), 0755);
+ info(udev, "runtime dir '%s'\n", udev_get_run_path(udev));
+
for (;;) {
int option;
- option = getopt_long(argc, argv, "c:deDthV", options, NULL);
+ option = getopt_long(argc, argv, "c:deDtN:hV", options, NULL);
if (option == -1)
break;
static_dev_create_from_modules(udev);
/* before opening new files, make sure std{in,out,err} fds are in a sane state */
- fd = open("/dev/null", O_RDWR);
- if (fd < 0) {
- fprintf(stderr, "cannot open /dev/null\n");
- err(udev, "cannot open /dev/null\n");
+ if (daemonize) {
+ int fd;
+
+ fd = open("/dev/null", O_RDWR);
+ if (fd >= 0) {
+ if (write(STDOUT_FILENO, 0, 0) < 0)
+ dup2(fd, STDOUT_FILENO);
+ if (write(STDERR_FILENO, 0, 0) < 0)
+ dup2(fd, STDERR_FILENO);
+ if (fd > STDERR_FILENO)
+ close(fd);
+ } else {
+ fprintf(stderr, "cannot open /dev/null\n");
+ err(udev, "cannot open /dev/null\n");
+ }
}
- if (write(STDOUT_FILENO, 0, 0) < 0)
- dup2(fd, STDOUT_FILENO);
- if (write(STDERR_FILENO, 0, 0) < 0)
- dup2(fd, STDERR_FILENO);
-
- udev_ctrl = udev_ctrl_new_from_socket(udev, UDEV_CTRL_SOCK_PATH);
- if (udev_ctrl == NULL) {
- fprintf(stderr, "error initializing control socket");
- err(udev, "error initializing udevd socket");
- rc = 1;
+
+ if (systemd_fds(udev, &fd_ctrl, &fd_netlink) >= 0) {
+ /* get control and netlink socket from from systemd */
+ udev_ctrl = udev_ctrl_new_from_fd(udev, fd_ctrl);
+ if (udev_ctrl == NULL) {
+ err(udev, "error taking over udev control socket");
+ rc = 1;
+ goto exit;
+ }
+
+ monitor = udev_monitor_new_from_netlink_fd(udev, "kernel", fd_netlink);
+ if (monitor == NULL) {
+ err(udev, "error taking over netlink socket\n");
+ rc = 3;
+ goto exit;
+ }
+ } else {
+ /* open control and netlink socket */
+ udev_ctrl = udev_ctrl_new(udev);
+ if (udev_ctrl == NULL) {
+ fprintf(stderr, "error initializing udev control socket");
+ err(udev, "error initializing udev control socket");
+ rc = 1;
+ goto exit;
+ }
+ fd_ctrl = udev_ctrl_get_fd(udev_ctrl);
+
+ monitor = udev_monitor_new_from_netlink(udev, "kernel");
+ if (monitor == NULL) {
+ fprintf(stderr, "error initializing netlink socket\n");
+ err(udev, "error initializing netlink socket\n");
+ rc = 3;
+ goto exit;
+ }
+ fd_netlink = udev_monitor_get_fd(monitor);
+ }
+
+ if (udev_monitor_enable_receiving(monitor) < 0) {
+ fprintf(stderr, "error binding netlink socket\n");
+ err(udev, "error binding netlink socket\n");
+ rc = 3;
goto exit;
}
+
if (udev_ctrl_enable_receiving(udev_ctrl) < 0) {
- fprintf(stderr, "error binding control socket, seems udevd is already running\n");
- err(udev, "error binding control socket, seems udevd is already running\n");
+ fprintf(stderr, "error binding udev control socket\n");
+ err(udev, "error binding udev control socket\n");
rc = 1;
goto exit;
}
- pfd[FD_CONTROL].fd = udev_ctrl_get_fd(udev_ctrl);
- monitor = udev_monitor_new_from_netlink(udev, "kernel");
- if (monitor == NULL || udev_monitor_enable_receiving(monitor) < 0) {
- fprintf(stderr, "error initializing netlink socket\n");
- err(udev, "error initializing netlink socket\n");
- rc = 3;
+ udev_monitor_set_receive_buffer_size(monitor, 128*1024*1024);
+
+ /* create queue file before signalling 'ready', to make sure we block 'settle' */
+ udev_queue_export = udev_queue_export_new(udev);
+ if (udev_queue_export == NULL) {
+ err(udev, "error creating queue file\n");
goto exit;
}
- udev_monitor_set_receive_buffer_size(monitor, 128*1024*1024);
- pfd[FD_NETLINK].fd = udev_monitor_get_fd(monitor);
- pfd[FD_INOTIFY].fd = udev_watch_init(udev);
- if (pfd[FD_INOTIFY].fd < 0) {
+ if (daemonize) {
+ pid_t pid;
+ int fd;
+
+ pid = fork();
+ switch (pid) {
+ case 0:
+ break;
+ case -1:
+ err(udev, "fork of daemon failed: %m\n");
+ rc = 4;
+ goto exit;
+ default:
+ rc = EXIT_SUCCESS;
+ goto exit_daemonize;
+ }
+
+ setsid();
+
+ fd = open("/proc/self/oom_score_adj", O_RDWR);
+ if (fd < 0) {
+ /* Fallback to old interface */
+ fd = open("/proc/self/oom_adj", O_RDWR);
+ if (fd < 0) {
+ err(udev, "error disabling OOM: %m\n");
+ } else {
+ /* OOM_DISABLE == -17 */
+ write(fd, "-17", 3);
+ close(fd);
+ }
+ } else {
+ write(fd, "-1000", 5);
+ close(fd);
+ }
+ } else {
+ sd_notify(1, "READY=1");
+ }
+
+ f = fopen("/dev/kmsg", "w");
+ if (f != NULL) {
+ fprintf(f, "<30>udevd[%u]: starting version " VERSION "\n", getpid());
+ fclose(f);
+ }
+
+ if (!debug) {
+ int fd;
+
+ fd = open("/dev/null", O_RDWR);
+ if (fd >= 0) {
+ dup2(fd, STDIN_FILENO);
+ dup2(fd, STDOUT_FILENO);
+ dup2(fd, STDERR_FILENO);
+ close(fd);
+ }
+ }
+
+ fd_inotify = udev_watch_init(udev);
+ if (fd_inotify < 0) {
fprintf(stderr, "error initializing inotify\n");
err(udev, "error initializing inotify\n");
rc = 4;
}
if (udev_get_rules_path(udev) != NULL) {
- inotify_add_watch(pfd[FD_INOTIFY].fd, udev_get_rules_path(udev),
+ inotify_add_watch(fd_inotify, udev_get_rules_path(udev),
IN_DELETE | IN_MOVE | IN_CLOSE_WRITE);
} else {
char filename[UTIL_PATH_SIZE];
struct stat statbuf;
- inotify_add_watch(pfd[FD_INOTIFY].fd, LIBEXECDIR "/rules.d",
+ inotify_add_watch(fd_inotify, LIBEXECDIR "/rules.d",
IN_DELETE | IN_MOVE | IN_CLOSE_WRITE);
- inotify_add_watch(pfd[FD_INOTIFY].fd, SYSCONFDIR "/udev/rules.d",
+ inotify_add_watch(fd_inotify, SYSCONFDIR "/udev/rules.d",
IN_DELETE | IN_MOVE | IN_CLOSE_WRITE);
/* watch dynamic rules directory */
- util_strscpyl(filename, sizeof(filename), udev_get_dev_path(udev), "/.udev/rules.d", NULL);
+ util_strscpyl(filename, sizeof(filename), udev_get_run_path(udev), "/rules.d", NULL);
if (stat(filename, &statbuf) != 0) {
util_create_path(udev, filename);
- udev_selinux_setfscreatecon(udev, filename, S_IFDIR|0755);
mkdir(filename, 0755);
- udev_selinux_resetfscreatecon(udev);
}
- inotify_add_watch(pfd[FD_INOTIFY].fd, filename,
+ inotify_add_watch(fd_inotify, filename,
IN_DELETE | IN_MOVE | IN_CLOSE_WRITE);
}
udev_watch_restore(udev);
/* block and listen to all signals on signalfd */
sigfillset(&mask);
- sigprocmask(SIG_SETMASK, &mask, &orig_sigmask);
- pfd[FD_SIGNAL].fd = signalfd(-1, &mask, 0);
- if (pfd[FD_SIGNAL].fd < 0) {
- fprintf(stderr, "error getting signalfd\n");
- err(udev, "error getting signalfd\n");
+ sigprocmask(SIG_SETMASK, &mask, &sigmask_orig);
+ fd_signal = signalfd(-1, &mask, SFD_NONBLOCK|SFD_CLOEXEC);
+ if (fd_signal < 0) {
+ fprintf(stderr, "error creating signalfd\n");
+ err(udev, "error creating signalfd\n");
rc = 5;
goto exit;
}
/* unnamed socket from workers to the main daemon */
if (socketpair(AF_LOCAL, SOCK_DGRAM|SOCK_CLOEXEC, 0, worker_watch) < 0) {
- fprintf(stderr, "error getting socketpair\n");
- err(udev, "error getting socketpair\n");
+ fprintf(stderr, "error creating socketpair\n");
+ err(udev, "error creating socketpair\n");
rc = 6;
goto exit;
}
- pfd[FD_WORKER].fd = worker_watch[READ_END];
+ fd_worker = worker_watch[READ_END];
rules = udev_rules_new(udev, resolve_names);
if (rules == NULL) {
goto exit;
}
- udev_queue_export = udev_queue_export_new(udev);
- if (udev_queue_export == NULL) {
- err(udev, "error creating queue file\n");
- goto exit;
- }
+ memset(&ep_ctrl, 0, sizeof(struct epoll_event));
+ ep_ctrl.events = EPOLLIN;
+ ep_ctrl.data.fd = fd_ctrl;
- if (!debug) {
- dup2(fd, STDIN_FILENO);
- dup2(fd, STDOUT_FILENO);
- dup2(fd, STDERR_FILENO);
- }
- if (fd > STDERR_FILENO)
- close(fd);
-
- if (daemonize) {
- pid_t pid;
+ memset(&ep_inotify, 0, sizeof(struct epoll_event));
+ ep_inotify.events = EPOLLIN;
+ ep_inotify.data.fd = fd_inotify;
- pid = fork();
- switch (pid) {
- case 0:
- break;
- case -1:
- err(udev, "fork of daemon failed: %m\n");
- rc = 4;
- goto exit;
- default:
- rc = 0;
- goto exit;
- }
- } else {
- sd_notify(1, "READY=1");
- }
+ memset(&ep_signal, 0, sizeof(struct epoll_event));
+ ep_signal.events = EPOLLIN;
+ ep_signal.data.fd = fd_signal;
- /* set scheduling priority for the main daemon process */
- setpriority(PRIO_PROCESS, 0, UDEVD_PRIORITY);
+ memset(&ep_netlink, 0, sizeof(struct epoll_event));
+ ep_netlink.events = EPOLLIN;
+ ep_netlink.data.fd = fd_netlink;
- setsid();
+ memset(&ep_worker, 0, sizeof(struct epoll_event));
+ ep_worker.events = EPOLLIN;
+ ep_worker.data.fd = fd_worker;
- f = fopen("/dev/kmsg", "w");
- if (f != NULL) {
- fprintf(f, "<6>udev[%u]: starting version " VERSION "\n", getpid());
- fclose(f);
+ fd_ep = epoll_create1(EPOLL_CLOEXEC);
+ if (fd_ep < 0) {
+ err(udev, "error creating epoll fd: %m\n");
+ goto exit;
}
-
- fd = open("/proc/self/oom_score_adj", O_RDWR);
- if (fd < 0) {
- /* Fallback to old interface */
- fd = open("/proc/self/oom_adj", O_RDWR);
- if (fd < 0) {
- err(udev, "error disabling OOM: %m\n");
- } else {
- /* OOM_DISABLE == -17 */
- write(fd, "-17", 3);
- close(fd);
- }
- } else {
- write(fd, "-1000", 5);
- close(fd);
+ if (epoll_ctl(fd_ep, EPOLL_CTL_ADD, fd_ctrl, &ep_ctrl) < 0 ||
+ epoll_ctl(fd_ep, EPOLL_CTL_ADD, fd_inotify, &ep_inotify) < 0 ||
+ epoll_ctl(fd_ep, EPOLL_CTL_ADD, fd_signal, &ep_signal) < 0 ||
+ epoll_ctl(fd_ep, EPOLL_CTL_ADD, fd_netlink, &ep_netlink) < 0 ||
+ epoll_ctl(fd_ep, EPOLL_CTL_ADD, fd_worker, &ep_worker) < 0) {
+ err(udev, "fail to add fds to epoll: %m\n");
+ goto exit;
}
+ /* if needed, convert old database from earlier udev version */
+ convert_db(udev);
+
if (children_max <= 0) {
int memsize = mem_size_mb();
udev_rules_apply_static_dev_perms(rules);
- udev_list_init(&event_list);
- udev_list_init(&worker_list);
+ udev_list_node_init(&event_list);
+ udev_list_node_init(&worker_list);
- while (!udev_exit) {
+ for (;;) {
+ struct epoll_event ev[8];
int fdcount;
int timeout;
+ bool is_worker, is_signal, is_inotify, is_netlink, is_ctrl;
+ int i;
+
+ if (udev_exit) {
+ /* close sources of new events and discard buffered events */
+ if (fd_ctrl >= 0) {
+ epoll_ctl(fd_ep, EPOLL_CTL_DEL, fd_ctrl, NULL);
+ fd_ctrl = -1;
+ }
+ if (monitor != NULL) {
+ epoll_ctl(fd_ep, EPOLL_CTL_DEL, fd_netlink, NULL);
+ udev_monitor_unref(monitor);
+ monitor = NULL;
+ }
+ if (fd_inotify >= 0) {
+ epoll_ctl(fd_ep, EPOLL_CTL_DEL, fd_inotify, NULL);
+ close(fd_inotify);
+ fd_inotify = -1;
+ }
+
+ /* discard queued events and kill workers */
+ event_queue_cleanup(udev, EVENT_QUEUED);
+ worker_kill(udev, 0);
+
+ /* exit after all has cleaned up */
+ if (udev_list_node_is_empty(&event_list) && udev_list_node_is_empty(&worker_list))
+ break;
- /* set timeout to kill idle workers */
- if (udev_list_is_empty(&event_list) && children > 2)
+ /* timeout at exit for workers to finish */
+ timeout = 60 * 1000;
+ } else if (udev_list_node_is_empty(&event_list) && children > 2) {
+ /* set timeout to kill idle workers */
timeout = 3 * 1000;
- else
+ } else {
timeout = -1;
- /* wait for events */
- fdcount = poll(pfd, ARRAY_SIZE(pfd), timeout);
+ }
+ fdcount = epoll_wait(fd_ep, ev, ARRAY_SIZE(ev), timeout);
if (fdcount < 0)
continue;
- /* timeout - kill idle workers */
- if (fdcount == 0)
+ if (fdcount == 0) {
+ if (udev_exit) {
+ info(udev, "timeout, giving up waiting for workers to finish\n");
+ break;
+ }
+
+ /* timeout - kill idle workers */
worker_kill(udev, 2);
+ }
+
+ is_worker = is_signal = is_inotify = is_netlink = is_ctrl = false;
+ for (i = 0; i < fdcount; i++) {
+ if (ev[i].data.fd == fd_worker && ev[i].events & EPOLLIN)
+ is_worker = true;
+ else if (ev[i].data.fd == fd_netlink && ev[i].events & EPOLLIN)
+ is_netlink = true;
+ else if (ev[i].data.fd == fd_signal && ev[i].events & EPOLLIN)
+ is_signal = true;
+ else if (ev[i].data.fd == fd_inotify && ev[i].events & EPOLLIN)
+ is_inotify = true;
+ else if (ev[i].data.fd == fd_ctrl && ev[i].events & EPOLLIN)
+ is_ctrl = true;
+ }
/* event has finished */
- if (pfd[FD_WORKER].revents & POLLIN)
- worker_returned();
+ if (is_worker)
+ worker_returned(fd_worker);
- /* get kernel uevent */
- if (pfd[FD_NETLINK].revents & POLLIN) {
+ if (is_netlink) {
struct udev_device *dev;
dev = udev_monitor_receive_device(monitor);
- if (dev != NULL)
+ if (dev != NULL) {
+ udev_device_set_usec_initialized(dev, now_usec());
if (event_queue_insert(dev) < 0)
udev_device_unref(dev);
+ }
}
/* start new events */
- if (!udev_list_is_empty(&event_list) && !stop_exec_queue)
- events_start(udev);
+ if (!udev_list_node_is_empty(&event_list) && !udev_exit && !stop_exec_queue)
+ event_queue_start(udev);
- /* get signal */
- if (pfd[FD_SIGNAL].revents & POLLIN) {
+ if (is_signal) {
struct signalfd_siginfo fdsi;
ssize_t size;
- size = read(pfd[FD_SIGNAL].fd, &fdsi, sizeof(struct signalfd_siginfo));
+ size = read(fd_signal, &fdsi, sizeof(struct signalfd_siginfo));
if (size == sizeof(struct signalfd_siginfo))
handle_signal(udev, fdsi.ssi_signo);
}
+ /* we are shutting down, the events below are not handled anymore */
+ if (udev_exit)
+ continue;
+
/* device node and rules directory inotify watch */
- if (pfd[FD_INOTIFY].revents & POLLIN)
+ if (is_inotify)
handle_inotify(udev);
/*
- * get control message
- *
* This needs to be after the inotify handling, to make sure,
- * that the settle signal is send back after the possibly generated
+ * that the ping is send back after the possibly generated
* "change" events by the inotify device node watch.
+ *
+ * A single time we may receive a client connection which we need to
+ * keep open to block the client. It will be closed right before we
+ * exit.
*/
- if (pfd[FD_CONTROL].revents & POLLIN)
- handle_ctrl_msg(udev_ctrl);
+ if (is_ctrl)
+ ctrl_conn = handle_ctrl_msg(udev_ctrl);
/* rules changed, set by inotify or a HUP signal */
if (reload_config) {
}
}
- udev_queue_export_cleanup(udev_queue_export);
- rc = 0;
+ rc = EXIT_SUCCESS;
exit:
- udev_queue_export_unref(udev_queue_export);
+ udev_queue_export_cleanup(udev_queue_export);
+ udev_ctrl_cleanup(udev_ctrl);
+exit_daemonize:
+ if (fd_ep >= 0)
+ close(fd_ep);
+ worker_list_cleanup(udev);
+ event_queue_cleanup(udev, EVENT_UNDEF);
udev_rules_unref(rules);
- udev_ctrl_unref(udev_ctrl);
- if (pfd[FD_SIGNAL].fd >= 0)
- close(pfd[FD_SIGNAL].fd);
+ if (fd_signal >= 0)
+ close(fd_signal);
if (worker_watch[READ_END] >= 0)
close(worker_watch[READ_END]);
if (worker_watch[WRITE_END] >= 0)
close(worker_watch[WRITE_END]);
udev_monitor_unref(monitor);
+ udev_queue_export_unref(udev_queue_export);
+ udev_ctrl_connection_unref(ctrl_conn);
+ udev_ctrl_unref(udev_ctrl);
udev_selinux_exit(udev);
udev_unref(udev);
udev_log_close();
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>udevd</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"/></head><body><div class="refentry" title="udevd"><a id="udevd"/><div class="titlepage"/><div class="refnamediv"><h2>Name</h2><p>udevd — event managing daemon</p></div><div class="refsynopsisdiv" title="Synopsis"><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="command">udevd</code> [<code class="option">--daemon</code>] [<code class="option">--debug</code>] [<code class="option">--children-max=</code>] [<code class="option">--exec-delay=</code>] [<code class="option">--resolve-names=early|late|never</code>] [<code class="option">--version</code>] [<code class="option">--help</code>]</p></div></div><div class="refsect1" title="Description"><a id="id310245"/><h2>Description</h2><p>udevd listens to kernel uevents. For every event, udevd executes matching
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>udevd</title><meta name="generator" content="DocBook XSL Stylesheets V1.76.1"/></head><body><div class="refentry" title="udevd"><a id="udevd"/><div class="titlepage"/><div class="refnamediv"><h2>Name</h2><p>udevd — event managing daemon</p></div><div class="refsynopsisdiv" title="Synopsis"><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="command">udevd</code> [<code class="option">--daemon</code>] [<code class="option">--debug</code>] [<code class="option">--children-max=</code>] [<code class="option">--exec-delay=</code>] [<code class="option">--resolve-names=early|late|never</code>] [<code class="option">--version</code>] [<code class="option">--help</code>]</p></div></div><div class="refsect1" title="Description"><a id="id434225"/><h2>Description</h2><p>udevd listens to kernel uevents. For every event, udevd executes matching
instructions specified in udev rules. See <span class="citerefentry"><span class="refentrytitle">udev</span>(7)</span>.</p><p>On startup the content of the directory <code class="filename">/lib/udev/devices</code>
is copied to <code class="filename">/dev</code>. If kernel modules specify static device
nodes, these nodes are created even without a corresponding kernel device, to
allow on-demand loading of kernel modules. Matching permissions specified in udev
rules are applied to these static device nodes.</p><p>The behavior of the running daemon can be changed with
- <span class="command"><strong>udevadm control</strong></span>.</p></div><div class="refsect1" title="Options"><a id="id310294"/><h2>Options</h2><div class="variablelist"><dl><dt><span class="term"><code class="option">--daemon</code></span></dt><dd><p>Detach and run in the background.</p></dd><dt><span class="term"><code class="option">--debug</code></span></dt><dd><p>Print debug messages to stderr.</p></dd><dt><span class="term"><code class="option">--children-max=</code></span></dt><dd><p>Limit the number of parallel executed events.</p></dd><dt><span class="term"><code class="option">--exec-delay=</code></span></dt><dd><p>Number of seconds to delay the execution of RUN instructions.
+ <span class="command"><strong>udevadm control</strong></span>.</p></div><div class="refsect1" title="Options"><a id="id434270"/><h2>Options</h2><div class="variablelist"><dl><dt><span class="term"><code class="option">--daemon</code></span></dt><dd><p>Detach and run in the background.</p></dd><dt><span class="term"><code class="option">--debug</code></span></dt><dd><p>Print debug messages to stderr.</p></dd><dt><span class="term"><code class="option">--children-max=</code></span></dt><dd><p>Limit the number of parallel executed events.</p></dd><dt><span class="term"><code class="option">--exec-delay=</code></span></dt><dd><p>Number of seconds to delay the execution of RUN instructions.
This might be useful when debugging system crashes during coldplug
cause by loading non-working kernel modules.</p></dd><dt><span class="term"><code class="option">--resolve-names=</code></span></dt><dd><p>Specify when udevd should resolve names of users and groups.
When set to <code class="option">early</code> (the default) names will be
resolved when the rules are parsed. When set to
<code class="option">late</code> names will be resolved for every event.
When set to <code class="option">never</code> names will never be resolved
- and all devices will be owned by root.</p></dd><dt><span class="term"><code class="option">--version</code></span></dt><dd><p>Print version number.</p></dd><dt><span class="term"><code class="option">--help</code></span></dt><dd><p>Print help text.</p></dd></dl></div></div><div class="refsect1" title="Environment"><a id="id276550"/><h2>Environment</h2><div class="variablelist"><dl><dt><span class="term"><code class="varname">UDEV_LOG=</code></span></dt><dd><p>Set the logging priority.</p></dd></dl></div></div><div class="refsect1" title="Kernel command line"><a id="id276577"/><h2>Kernel command line</h2><div class="variablelist"><dl><dt><span class="term"><code class="varname">udev.log-priority=</code></span></dt><dd><p>Set the logging priority.</p></dd><dt><span class="term"><code class="varname">udev.children-max=</code></span></dt><dd><p>Limit the number of parallel executed events.</p></dd><dt><span class="term"><code class="varname">udev.exec-delay=</code></span></dt><dd><p>Number of seconds to delay the execution of RUN instructions.
+ and all devices will be owned by root.</p></dd><dt><span class="term"><code class="option">--version</code></span></dt><dd><p>Print version number.</p></dd><dt><span class="term"><code class="option">--help</code></span></dt><dd><p>Print help text.</p></dd></dl></div></div><div class="refsect1" title="Environment"><a id="id401755"/><h2>Environment</h2><div class="variablelist"><dl><dt><span class="term"><code class="varname">UDEV_LOG=</code></span></dt><dd><p>Set the logging priority.</p></dd></dl></div></div><div class="refsect1" title="Kernel command line"><a id="id401778"/><h2>Kernel command line</h2><div class="variablelist"><dl><dt><span class="term"><code class="varname">udev.log-priority=</code></span></dt><dd><p>Set the logging priority.</p></dd><dt><span class="term"><code class="varname">udev.children-max=</code></span></dt><dd><p>Limit the number of parallel executed events.</p></dd><dt><span class="term"><code class="varname">udev.exec-delay=</code></span></dt><dd><p>Number of seconds to delay the execution of RUN instructions.
This might be useful when debugging system crashes during coldplug
- cause by loading non-working kernel modules.</p></dd></dl></div></div><div class="refsect1" title="Author"><a id="id276637"/><h2>Author</h2><p>Written by Kay Sievers <code class="email"><<a class="email" href="mailto:kay.sievers@vrfy.org">kay.sievers@vrfy.org</a>></code>.</p></div><div class="refsect1" title="See Also"><a id="id276651"/><h2>See Also</h2><p><span class="citerefentry"><span class="refentrytitle">udev</span>(7)</span>, <span class="citerefentry"><span class="refentrytitle">udevadm</span>(8)</span></p></div></div></body></html>
+ cause by loading non-working kernel modules.</p></dd></dl></div></div><div class="refsect1" title="Author"><a id="id401898"/><h2>Author</h2><p>Written by Kay Sievers <code class="email"><<a class="email" href="mailto:kay.sievers@vrfy.org">kay.sievers@vrfy.org</a>></code>.</p></div><div class="refsect1" title="See Also"><a id="id401910"/><h2>See Also</h2><p><span class="citerefentry"><span class="refentrytitle">udev</span>(7)</span>, <span class="citerefentry"><span class="refentrytitle">udevadm</span>(8)</span></p></div></div></body></html>