summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormananth <mananth>2003-12-17 11:34:17 +0000
committermananth <mananth>2003-12-17 11:34:17 +0000
commitac7317daab22e6a959b0f7f0f38853738cb3cef6 (patch)
tree16166c2715244d914b77cca320452a6e8dca0475
parent48401dcfccc68c651732c9a2d3691b56cdcbec3c (diff)
downloadsysfsutils-ac7317daab22e6a959b0f7f0f38853738cb3cef6.tar.gz
Updated for 0.4.0 release, added man-pages, etc.
-rw-r--r--CREDITS2
-rw-r--r--ChangeLog13
-rw-r--r--Makefile.am3
-rw-r--r--Makefile.in66
-rw-r--r--TODO5
-rw-r--r--aclocal.m478
-rw-r--r--cmd/lsbus.c11
-rw-r--r--cmd/names.c17
-rw-r--r--cmd/systool.c12
-rw-r--r--config.h.in9
-rwxr-xr-xconfigure143
-rw-r--r--configure.ac8
-rw-r--r--include/libsysfs.h1
-rw-r--r--lib/Makefile.am1
-rw-r--r--lib/Makefile.in2
-rw-r--r--lib/sysfs_device.c61
-rw-r--r--lib/sysfs_dir.c11
-rw-r--r--lib/sysfs_driver.c27
-rw-r--r--lib/sysfs_utils.c26
-rw-r--r--lsbus.158
-rw-r--r--systool.165
-rw-r--r--test/Makefile.am3
-rw-r--r--test/Makefile.in23
23 files changed, 432 insertions, 213 deletions
diff --git a/CREDITS b/CREDITS
index ba2438c..678e0f5 100644
--- a/CREDITS
+++ b/CREDITS
@@ -14,3 +14,5 @@ have made contributions:
o Martin Mares <mj@ucw.cz>
- Author of pciutils. Reused the pci name decoding
from Martin's library.
+ o Martin Pitt <mpitt@debian.org>
+ - Supplied initial makefiles for lsbus and systool
diff --git a/ChangeLog b/ChangeLog
index 3f3d53a..345e4af 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,17 @@
+12/16/2003 - Daniel Stekloff <dsteklof@us.ibm.com>
+ * Added sysfs_get_device_parent() function
+
+12/15/2003 - Martin Pitt <mpitt@debian.org>
+ * Added initial version of manpages for lsbus and systool
+
+12/15/2003 - Ananth Mavinakayanahalli <ananth@in.ibm.com>
+ * Updated autotools for 0.4.0 - shared library will now
+ have version-info
+ * Fixed miscllaneous issues with library files
+ * Fixed names.c, systool.c and lsbus.c to free all allocated
+ memory
+
12/12/2003 - Ananth Mavinakayanahalli <ananth@in.ibm.com>
* Miscllaneous changes - added new function definitions,
general code cleanup
diff --git a/Makefile.am b/Makefile.am
index b48ca6d..f2d46fa 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,4 +1,5 @@
-EXTRA_DIST = docs include
+man_MANS = lsbus.1 systool.1
+EXTRA_DIST = docs include $(man_MANS)
SUBDIRS = lib cmd test
include_HEADERS = include/libsysfs.h include/dlist.h
diff --git a/Makefile.in b/Makefile.in
index 174f75c..7853834 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -83,7 +83,8 @@ VERSION = @VERSION@
am__include = @am__include@
am__quote = @am__quote@
install_sh = @install_sh@
-EXTRA_DIST = docs include
+man_MANS = lsbus.1 systool.1
+EXTRA_DIST = docs include $(man_MANS)
SUBDIRS = lib cmd test
include_HEADERS = include/libsysfs.h include/dlist.h
subdir = .
@@ -92,6 +93,9 @@ mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = config.h
CONFIG_CLEAN_FILES =
DIST_SOURCES =
+
+NROFF = nroff
+MANS = $(man_MANS)
HEADERS = $(include_HEADERS)
@@ -151,6 +155,49 @@ clean-libtool:
distclean-libtool:
-rm -f libtool
uninstall-info-am:
+
+man1dir = $(mandir)/man1
+install-man1: $(man1_MANS) $(man_MANS)
+ @$(NORMAL_INSTALL)
+ $(mkinstalldirs) $(DESTDIR)$(man1dir)
+ @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
+ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
+ for i in $$l2; do \
+ case "$$i" in \
+ *.1*) list="$$list $$i" ;; \
+ esac; \
+ done; \
+ for i in $$list; do \
+ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
+ else file=$$i; fi; \
+ ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+ case "$$ext" in \
+ 1*) ;; \
+ *) ext='1' ;; \
+ esac; \
+ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+ inst=`echo $$inst | sed -e 's/^.*\///'`; \
+ inst=`echo $$inst | sed '$(transform)'`.$$ext; \
+ echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \
+ $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \
+ done
+uninstall-man1:
+ @$(NORMAL_UNINSTALL)
+ @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
+ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
+ for i in $$l2; do \
+ case "$$i" in \
+ *.1*) list="$$list $$i" ;; \
+ esac; \
+ done; \
+ for i in $$list; do \
+ ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+ inst=`echo $$inst | sed -e 's/^.*\///'`; \
+ inst=`echo $$inst | sed '$(transform)'`.$$ext; \
+ echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \
+ rm -f $(DESTDIR)$(man1dir)/$$inst; \
+ done
includeHEADERS_INSTALL = $(INSTALL_HEADER)
install-includeHEADERS: $(include_HEADERS)
@$(NORMAL_INSTALL)
@@ -372,10 +419,10 @@ distcleancheck: distclean
exit 1; } >&2
check-am: all-am
check: check-recursive
-all-am: Makefile $(HEADERS) config.h
+all-am: Makefile $(MANS) $(HEADERS) config.h
installdirs: installdirs-recursive
installdirs-am:
- $(mkinstalldirs) $(DESTDIR)$(includedir)
+ $(mkinstalldirs) $(DESTDIR)$(man1dir) $(DESTDIR)$(includedir)
install: install-recursive
install-exec: install-exec-recursive
@@ -418,13 +465,13 @@ info: info-recursive
info-am:
-install-data-am: install-includeHEADERS
+install-data-am: install-includeHEADERS install-man
install-exec-am:
install-info: install-info-recursive
-install-man:
+install-man: install-man1
installcheck-am:
@@ -437,10 +484,12 @@ mostlyclean: mostlyclean-recursive
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-uninstall-am: uninstall-includeHEADERS uninstall-info-am
+uninstall-am: uninstall-includeHEADERS uninstall-info-am uninstall-man
uninstall-info: uninstall-info-recursive
+uninstall-man: uninstall-man1
+
.PHONY: $(RECURSIVE_TARGETS) GTAGS all all-am check check-am clean \
clean-generic clean-libtool clean-recursive dist dist-all \
dist-gzip distcheck distclean distclean-generic distclean-hdr \
@@ -449,14 +498,15 @@ uninstall-info: uninstall-info-recursive
info-recursive install install-am install-data install-data-am \
install-data-recursive install-exec install-exec-am \
install-exec-recursive install-includeHEADERS install-info \
- install-info-am install-info-recursive install-man \
+ install-info-am install-info-recursive install-man install-man1 \
install-recursive install-strip installcheck installcheck-am \
installdirs installdirs-am installdirs-recursive \
maintainer-clean maintainer-clean-generic \
maintainer-clean-recursive mostlyclean mostlyclean-generic \
mostlyclean-libtool mostlyclean-recursive tags tags-recursive \
uninstall uninstall-am uninstall-includeHEADERS \
- uninstall-info-am uninstall-info-recursive uninstall-recursive
+ uninstall-info-am uninstall-info-recursive uninstall-man \
+ uninstall-man1 uninstall-recursive
dist-hook:
diff --git a/TODO b/TODO
index 8c9d495..e352500 100644
--- a/TODO
+++ b/TODO
@@ -2,7 +2,6 @@ Library:
--------
- Rework debugging error messages and look into better logging on error.
- Need to properly set errno.
-- Code optimization: open()/read()/close() only when required.
Commands:
---------
@@ -10,10 +9,6 @@ Commands:
- Need to clean up error messages.
- Clean up how attribute values are printed.
-Docs:
------
-- Create man pages for commands and for library.
-
Test:
-----
- Design and implement test suites for the library.
diff --git a/aclocal.m4 b/aclocal.m4
index bf9ed34..b73a11f 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -756,84 +756,6 @@ AC_CONFIG_COMMANDS_PRE(
Usually this means the macro was only invoked conditionally.])
fi])])
-# Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*-
-
-# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
-
-# 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, 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., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-AC_PREREQ([2.52])
-
-# serial 6
-
-# When config.status generates a header, we must update the stamp-h file.
-# This file resides in the same directory as the config header
-# that is generated. We must strip everything past the first ":",
-# and everything past the last "/".
-
-# _AM_DIRNAME(PATH)
-# -----------------
-# Like AS_DIRNAME, only do it during macro expansion
-AC_DEFUN([_AM_DIRNAME],
- [m4_if(regexp([$1], [^.*[^/]//*[^/][^/]*/*$]), -1,
- m4_if(regexp([$1], [^//\([^/]\|$\)]), -1,
- m4_if(regexp([$1], [^/.*]), -1,
- [.],
- patsubst([$1], [^\(/\).*], [\1])),
- patsubst([$1], [^\(//\)\([^/].*\|$\)], [\1])),
- patsubst([$1], [^\(.*[^/]\)//*[^/][^/]*/*$], [\1]))[]dnl
-])# _AM_DIRNAME
-
-
-# The stamp files are numbered to have different names.
-# We could number them on a directory basis, but that's additional
-# complications, let's have a unique counter.
-m4_define([_AM_STAMP_Count], [0])
-
-
-# _AM_STAMP(HEADER)
-# -----------------
-# The name of the stamp file for HEADER.
-AC_DEFUN([_AM_STAMP],
-[m4_define([_AM_STAMP_Count], m4_incr(_AM_STAMP_Count))dnl
-AS_ESCAPE(_AM_DIRNAME(patsubst([$1],
- [:.*])))/stamp-h[]_AM_STAMP_Count])
-
-
-# _AM_CONFIG_HEADER(HEADER[:SOURCES], COMMANDS, INIT-COMMANDS)
-# ------------------------------------------------------------
-# We used to try to get a real timestamp in stamp-h. But the fear is that
-# that will cause unnecessary cvs conflicts.
-AC_DEFUN([_AM_CONFIG_HEADER],
-[# Add the stamp file to the list of files AC keeps track of,
-# along with our hook.
-AC_CONFIG_HEADERS([$1],
- [# update the timestamp
-echo 'timestamp for $1' >"_AM_STAMP([$1])"
-$2],
- [$3])
-])# _AM_CONFIG_HEADER
-
-
-# AM_CONFIG_HEADER(HEADER[:SOURCES]..., COMMANDS, INIT-COMMANDS)
-# --------------------------------------------------------------
-AC_DEFUN([AM_CONFIG_HEADER],
-[AC_FOREACH([_AM_File], [$1], [_AM_CONFIG_HEADER(_AM_File, [$2], [$3])])
-])# AM_CONFIG_HEADER
-
# libtool.m4 - Configure libtool for the host system. -*-Shell-script-*-
# serial 46 AC_PROG_LIBTOOL
diff --git a/cmd/lsbus.c b/cmd/lsbus.c
index a3d4eef..2cbe334 100644
--- a/cmd/lsbus.c
+++ b/cmd/lsbus.c
@@ -446,7 +446,8 @@ int main(int argc, char *argv[])
show_options |= SHOW_DEVICES;
if (bus_to_print != NULL) {
- if (!(strcmp(bus_to_print, "pci"))) {
+ if ((!(strcmp(bus_to_print, "pci"))) &&
+ (show_options & SHOW_DEVICES)) {
pacc = (struct pci_access *)calloc(1, sizeof(struct pci_access));
pacc->pci_id_file_name = pci_id_file;
pacc->numeric_ids = 0;
@@ -455,8 +456,12 @@ int main(int argc, char *argv[])
} else
retval = print_sysfs_buses();
- if (bus_to_print != NULL)
- if (!(strcmp(bus_to_print, "pci")))
+ if (bus_to_print != NULL) {
+ if ((!(strcmp(bus_to_print, "pci"))) &&
+ (show_options & SHOW_DEVICES)) {
pci_free_name_list(pacc);
+ free (pacc);
+ }
+ }
exit(retval);
}
diff --git a/cmd/names.c b/cmd/names.c
index fafa866..5c28a02 100644
--- a/cmd/names.c
+++ b/cmd/names.c
@@ -1,5 +1,5 @@
/*
- * $Id: names.c,v 1.1.2.4 2003/10/15 12:45:44 mananth Exp $
+ * $Id: names.c,v 1.1.2.4.2.1 2003/12/17 11:34:18 mananth Exp $
*
* The PCI Library -- ID to Name Translation
*
@@ -220,8 +220,23 @@ load_name_list(struct pci_access *a)
void
pci_free_name_list(struct pci_access *a)
{
+ int i = 0;
+ struct nl_entry *n = NULL, *temp = NULL;
+
free(a->nl_list);
a->nl_list = NULL;
+ if (a->nl_hash != NULL) {
+ for (i = 0; i < HASH_SIZE; i++) {
+ if (a->nl_hash[i] != NULL) {
+ n = a->nl_hash[i];
+ do {
+ temp = n->next;
+ free (n);
+ n = temp;
+ } while (temp != NULL);
+ }
+ }
+ }
free(a->nl_hash);
a->nl_hash = NULL;
}
diff --git a/cmd/systool.c b/cmd/systool.c
index 0b7a792..54b9c95 100644
--- a/cmd/systool.c
+++ b/cmd/systool.c
@@ -668,7 +668,8 @@ int main(int argc, char *argv[])
show_options |= SHOW_DEVICES;
if (show_bus != NULL) {
- if (!(strcmp(show_bus, "pci"))) {
+ if ((!(strcmp(show_bus, "pci"))) &&
+ (show_options & SHOW_DEVICES)) {
pacc = (struct pci_access *)
calloc(1, sizeof(struct pci_access));
pacc->pci_id_file_name = pci_id_file;
@@ -684,8 +685,13 @@ int main(int argc, char *argv[])
if (show_bus == NULL && show_class == NULL && show_root == NULL)
retval = show_default_info();
- if (show_bus != NULL)
- if (!(strcmp(show_bus, "pci")))
+ if (show_bus != NULL) {
+ if ((!(strcmp(show_bus, "pci"))) &&
+ (show_options & SHOW_DEVICES)) {
pci_free_name_list(pacc);
+ free (pacc);
+ pacc = NULL;
+ }
+ }
exit(retval);
}
diff --git a/config.h.in b/config.h.in
index 66306e3..401597e 100644
--- a/config.h.in
+++ b/config.h.in
@@ -16,9 +16,6 @@
/* Define to 1 if you have the `getmntent' function. */
#undef HAVE_GETMNTENT
-/* Define to 1 if you have the `getpagesize' function. */
-#undef HAVE_GETPAGESIZE
-
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
@@ -60,6 +57,9 @@
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
+/* Define to 1 if you have the `strchr' function. */
+#undef HAVE_STRCHR
+
/* Define to 1 if you have the `strerror' function. */
#undef HAVE_STRERROR
@@ -72,6 +72,9 @@
/* Define to 1 if you have the `strrchr' function. */
#undef HAVE_STRRCHR
+/* Define to 1 if you have the `strstr' function. */
+#undef HAVE_STRSTR
+
/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
*/
#undef HAVE_SYS_DIR_H
diff --git a/configure b/configure
index f14f4be..aa1d052 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.53 for sysfsutils 0.3.0.
+# Generated by GNU Autoconf 2.53 for sysfsutils 0.4.0.
#
# Report bugs to <linux-diag-devel@lists.sourceforge.net>.
#
@@ -415,8 +415,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package.
PACKAGE_NAME='sysfsutils'
PACKAGE_TARNAME='sysfsutils'
-PACKAGE_VERSION='0.3.0'
-PACKAGE_STRING='sysfsutils 0.3.0'
+PACKAGE_VERSION='0.4.0'
+PACKAGE_STRING='sysfsutils 0.4.0'
PACKAGE_BUGREPORT='linux-diag-devel@lists.sourceforge.net'
ac_unique_file="config.h.in"
@@ -921,7 +921,7 @@ if test "$ac_init_help" = "long"; then
# 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 sysfsutils 0.3.0 to adapt to many kinds of systems.
+\`configure' configures sysfsutils 0.4.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -987,7 +987,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of sysfsutils 0.3.0:";;
+ short | recursive ) echo "Configuration of sysfsutils 0.4.0:";;
esac
cat <<\_ACEOF
@@ -1082,7 +1082,7 @@ fi
test -n "$ac_init_help" && exit 0
if $ac_init_version; then
cat <<\_ACEOF
-sysfsutils configure 0.3.0
+sysfsutils configure 0.4.0
generated by GNU Autoconf 2.53
Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
@@ -1097,7 +1097,7 @@ cat >&5 <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by sysfsutils $as_me 0.3.0, which was
+It was created by sysfsutils $as_me 0.4.0, which was
generated by GNU Autoconf 2.53. Invocation command line was
$ $0 $@
@@ -1629,7 +1629,7 @@ fi
# Define the identity of the package.
PACKAGE=sysfsutils
- VERSION=0.3.0
+ VERSION=0.4.0
cat >>confdefs.h <<_ACEOF
@@ -1756,12 +1756,8 @@ INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
-# Add the stamp file to the list of files AC keeps track of,
-# along with our hook.
ac_config_headers="$ac_config_headers config.h"
-
-
# Check whether --enable-shared or --disable-shared was given.
if test "${enable_shared+set}" = set; then
enableval="$enable_shared"
@@ -4171,7 +4167,7 @@ test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
case $host in
*-*-irix6*)
# Find out which ABI we are using.
- echo '#line 4174 "configure"' > conftest.$ac_ext
+ echo '#line 4170 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
@@ -4707,7 +4703,7 @@ chmod -w .
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -o out/conftest2.$ac_objext"
compiler_c_o=no
-if { (eval echo configure:4710: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then
+if { (eval echo configure:4706: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && 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
if test -s out/conftest.err; then
@@ -6500,7 +6496,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 6503 "configure"
+#line 6499 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -6598,7 +6594,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 6601 "configure"
+#line 6597 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -8042,46 +8038,46 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-for ac_prog in gawk mawk nawk awk
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_AWK+set}" = set; then
+echo "$as_me:$LINENO: checking whether ln -s works" >&5
+echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
+LN_S=$as_ln_s
+if test "$LN_S" = "ln -s"; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+ echo "$as_me:$LINENO: result: no, using $LN_S" >&5
+echo "${ECHO_T}no, using $LN_S" >&6
+fi
+
+echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
+set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
+if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- if test -n "$AWK"; then
- ac_cv_prog_AWK="$AWK" # Let the user override the test.
+ cat >conftest.make <<\_ACEOF
+all:
+ @echo 'ac_maketemp="${MAKE}"'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
+if test -n "$ac_maketemp"; then
+ eval ac_cv_prog_make_${ac_make}_set=yes
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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_AWK="$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
+ eval ac_cv_prog_make_${ac_make}_set=no
fi
+rm -f conftest.make
fi
-AWK=$ac_cv_prog_AWK
-if test -n "$AWK"; then
- echo "$as_me:$LINENO: result: $AWK" >&5
-echo "${ECHO_T}$AWK" >&6
+if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+ SET_MAKE=
else
echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
+ SET_MAKE="MAKE=${MAKE-make}"
fi
- test -n "$AWK" && break
-done
-
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
set dummy ${ac_tool_prefix}ranlib; ac_word=$2
@@ -8162,9 +8158,49 @@ else
RANLIB="$ac_cv_prog_RANLIB"
fi
+for ac_prog in gawk mawk nawk awk
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_AWK+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$AWK"; then
+ ac_cv_prog_AWK="$AWK" # 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_AWK="$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+ echo "$as_me:$LINENO: result: $AWK" >&5
+echo "${ECHO_T}$AWK" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$AWK" && break
+done
+
# Checks for libraries.
-# FIXME: Replace `main' with a function in `-lsysfs':
+# FIXME: Replace `main' with a function in `-le':
echo "$as_me:$LINENO: checking for sysfs_read_directory in -lsysfs" >&5
echo $ECHO_N "checking for sysfs_read_directory in -lsysfs... $ECHO_C" >&6
@@ -9466,7 +9502,8 @@ fi
-for ac_func in bzero getmntent getpagesize isascii memset strerror strrchr
+
+for ac_func in bzero getmntent isascii memset strchr strerror strrchr strstr
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -9876,7 +9913,7 @@ _ASBOX
} >&5
cat >&5 <<_CSEOF
-This file was extended by sysfsutils $as_me 0.3.0, which was
+This file was extended by sysfsutils $as_me 0.4.0, which was
generated by GNU Autoconf 2.53. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -9938,7 +9975,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-sysfsutils config.status 0.3.0
+sysfsutils config.status 0.4.0
configured by $0, generated by GNU Autoconf 2.53,
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
@@ -10581,12 +10618,6 @@ done; }
cat $tmp/config.h
rm -f $tmp/config.h
fi
- # Run the commands associated with the file.
- case $ac_file in
- config.h ) # update the timestamp
-echo 'timestamp for config.h' >"./stamp-h1"
- ;;
- esac
done
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF
diff --git a/configure.ac b/configure.ac
index 3179c3e..da58a30 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,5 +1,5 @@
# Process this file with autoconf to produce a configure script.
-AC_INIT(sysfsutils, 0.3.0, linux-diag-devel@lists.sourceforge.net)
+AC_INIT(sysfsutils, 0.4.0, linux-diag-devel@lists.sourceforge.net)
AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR([config.h.in])
AM_CONFIG_HEADER([config.h])
@@ -8,8 +8,10 @@ AC_PROG_LIBTOOL
# Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
-AC_PROG_AWK
+AC_PROG_LN_S
+AC_PROG_MAKE_SET
AC_PROG_RANLIB
+AC_PROG_AWK
# Checks for libraries.
# FIXME: Replace `main' with a function in `-lsysfs':
@@ -29,7 +31,7 @@ AC_TYPE_SIZE_T
AC_FUNC_LSTAT
AC_FUNC_MALLOC
AC_FUNC_STAT
-AC_CHECK_FUNCS([bzero getmntent getpagesize isascii memset strerror strrchr])
+AC_CHECK_FUNCS([bzero getmntent isascii memset strchr strerror strrchr strstr])
AC_CONFIG_FILES([Makefile
cmd/Makefile
diff --git a/include/libsysfs.h b/include/libsysfs.h
index 877e0f2..7e7eea5 100644
--- a/include/libsysfs.h
+++ b/include/libsysfs.h
@@ -204,6 +204,7 @@ extern struct dlist *sysfs_get_root_devices(struct sysfs_root_device *root);
extern void sysfs_close_device(struct sysfs_device *dev);
extern struct sysfs_device *sysfs_open_device
(const unsigned char *bus_id, const unsigned char *bus);
+extern struct sysfs_device *sysfs_get_device_parent(struct sysfs_device *dev);
extern struct sysfs_device *sysfs_open_device_path(const unsigned char *path);
extern struct sysfs_attribute *sysfs_get_device_attr
(struct sysfs_device *dev, const unsigned char *name);
diff --git a/lib/Makefile.am b/lib/Makefile.am
index baaa784..4527f0a 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -2,4 +2,5 @@ lib_LTLIBRARIES = libsysfs.la
libsysfs_la_SOURCES = sysfs_utils.c sysfs_dir.c sysfs_bus.c sysfs_class.c \
sysfs_device.c sysfs_driver.c sysfs.h dlist.c
INCLUDES = -I../include
+libsysfs_la_LDFLAGS = -version-info 0:4:0
diff --git a/lib/Makefile.in b/lib/Makefile.in
index 9490316..f218756 100644
--- a/lib/Makefile.in
+++ b/lib/Makefile.in
@@ -88,13 +88,13 @@ libsysfs_la_SOURCES = sysfs_utils.c sysfs_dir.c sysfs_bus.c sysfs_class.c \
sysfs_device.c sysfs_driver.c sysfs.h dlist.c
INCLUDES = -I../include
+libsysfs_la_LDFLAGS = -version-info 0:4:0
subdir = lib
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
LTLIBRARIES = $(lib_LTLIBRARIES)
-libsysfs_la_LDFLAGS =
libsysfs_la_LIBADD =
am_libsysfs_la_OBJECTS = sysfs_utils.lo sysfs_dir.lo sysfs_bus.lo \
sysfs_class.lo sysfs_device.lo sysfs_driver.lo dlist.lo
diff --git a/lib/sysfs_device.c b/lib/sysfs_device.c
index 1dea8ce..9a7a75f 100644
--- a/lib/sysfs_device.c
+++ b/lib/sysfs_device.c
@@ -127,6 +127,8 @@ static void sysfs_close_dev_tree(void *dev)
void sysfs_close_device(struct sysfs_device *dev)
{
if (dev != NULL) {
+ if (dev->parent != NULL)
+ sysfs_close_device(dev->parent);
if (dev->directory != NULL)
sysfs_close_directory(dev->directory);
if (dev->children != NULL && dev->children->count == 0)
@@ -164,7 +166,7 @@ static struct sysfs_directory *open_device_dir(const unsigned char *path)
dprintf ("Device %s not supported on this system\n", path);
return NULL;
}
- if ((sysfs_read_directory(rdir)) != 0) {
+ if ((sysfs_read_dir_subdirs(rdir)) != 0) {
dprintf ("Error reading device at dir %s\n", path);
sysfs_close_directory(rdir);
return NULL;
@@ -255,7 +257,7 @@ static struct sysfs_device *sysfs_open_device_tree(const unsigned char *path)
if (rootdev->children == NULL)
rootdev->children = dlist_new_with_delete
(sizeof(struct sysfs_device),
- sysfs_del_device);
+ sysfs_close_dev_tree);
dlist_unshift(rootdev->children, new);
}
}
@@ -355,6 +357,7 @@ struct sysfs_root_device *sysfs_open_root_device(const unsigned char *name)
dprintf("calloc failure\n");
return NULL;
}
+ strcpy(root->name, name);
strcpy(root->path, rootpath);
return root;
}
@@ -499,6 +502,60 @@ struct sysfs_device *sysfs_open_device(const unsigned char *bus_id,
return device;
}
+/**
+ * sysfs_get_device_parent: opens up given device's parent and returns a
+ * reference to its sysfs_device
+ * @dev: sysfs_device whose parent is requested
+ * Returns sysfs_device of the parent on success and NULL on failure
+ */
+struct sysfs_device *sysfs_get_device_parent(struct sysfs_device *dev)
+{
+ unsigned char ppath[SYSFS_PATH_MAX], *tmp = NULL;
+
+ if (dev == NULL) {
+ errno = EINVAL;
+ return NULL;
+ }
+
+ if (dev->parent != NULL)
+ return (dev->parent);
+
+ memset(ppath, 0, SYSFS_PATH_MAX);
+ strcpy(ppath, dev->path);
+ tmp = strrchr(ppath, '/');
+ if (tmp == NULL) {
+ dprintf("Invalid path to device %s\n", ppath);
+ return NULL;
+ }
+ if (*(tmp +1) == '\0') {
+ *tmp = '\0';
+ tmp = strrchr(tmp, '/');
+ if (tmp == NULL) {
+ dprintf("Invalid path to device %s\n", ppath);
+ return NULL;
+ }
+ }
+ *tmp = '\0';
+
+ /*
+ * All "devices" have the "detach_state" attribute - validate here
+ */
+ strcat(ppath, "/detach_state");
+ if ((sysfs_path_is_file(ppath)) != 0) {
+ dprintf("Device at %s does not have a parent\n", dev->path);
+ return NULL;
+ }
+ tmp = strrchr(ppath, '/');
+ *tmp = '\0';
+ dev->parent = sysfs_open_device_path(ppath);
+ if (dev->parent == NULL) {
+ dprintf("Error opening device %s's parent at %s\n",
+ dev->bus_id, ppath);
+ return NULL;
+ }
+ return (dev->parent);
+}
+
/*
* sysfs_open_device_attr: open the given device's attribute
* @bus: Bus on which to look
diff --git a/lib/sysfs_dir.c b/lib/sysfs_dir.c
index 3de63c7..83b318d 100644
--- a/lib/sysfs_dir.c
+++ b/lib/sysfs_dir.c
@@ -1,5 +1,5 @@
/*
- * syfs_dir.c
+ * sysfs_dir.c
*
* Directory utility functions for libsysfs
*
@@ -260,7 +260,7 @@ int sysfs_read_attribute(struct sysfs_attribute *sysattr)
{
unsigned char *fbuf = NULL;
unsigned char *vbuf = NULL;
- size_t length = 0;
+ ssize_t length = 0;
long pgsize = 0;
int fd;
@@ -442,7 +442,7 @@ int sysfs_read_all_subdirs(struct sysfs_directory *sysdir)
if (sysdir->subdirs != NULL) {
dlist_for_each_data(sysdir->subdirs, cursub,
struct sysfs_directory) {
- if ((sysfs_read_directory(cursub)) != 0)
+ if ((sysfs_read_dir_subdirs(cursub)) != 0)
dprintf ("Error reading subdirectory %s\n",
cursub->name);
}
@@ -835,8 +835,9 @@ struct sysfs_attribute *sysfs_get_directory_attribute
strcat(new_path, attrname);
if ((sysfs_path_is_file(new_path)) == 0) {
if ((add_attribute(dir, new_path)) == 0) {
- attr = (struct sysfs_attribute *)dlist_find_custom
- (dir->attributes, attrname, dir_attribute_name_equal);
+ attr = (struct sysfs_attribute *)
+ dlist_find_custom(dir->attributes,
+ attrname, dir_attribute_name_equal);
}
return attr;
}
diff --git a/lib/sysfs_driver.c b/lib/sysfs_driver.c
index 3ec8089..1fd560e 100644
--- a/lib/sysfs_driver.c
+++ b/lib/sysfs_driver.c
@@ -66,29 +66,6 @@ static int open_driver_dir(struct sysfs_driver *driver)
}
/**
- * read_driver_dir: Read driver directory's subdirs and links
- * @driver: Driver to read
- * Returns 0 on success and 1 on failure
- */
-static int read_driver_dir(struct sysfs_driver *driver)
-{
- if (driver == NULL) {
- errno = EINVAL;
- return 1;
- }
- if (driver->directory == NULL) {
- if ((open_driver_dir(driver)) == 1)
- return 1;
- }
- if ((sysfs_read_directory(driver->directory)) != 0) {
- dprintf("Error reading driver directory at %s\n",
- driver->path);
- return 1;
- }
- return 0;
-}
-
-/**
* alloc_driver: allocates and initializes driver
* returns struct sysfs_driver with success and NULL with error.
*/
@@ -209,7 +186,7 @@ struct dlist *sysfs_get_driver_links(struct sysfs_driver *driver)
if (driver->directory == NULL) {
if ((open_driver_dir(driver)) == 1)
return NULL;
- if ((read_driver_dir(driver)) != 0)
+ if ((sysfs_read_dir_links(driver->directory)) != 0)
return NULL;
}
return(driver->directory->links);
@@ -236,7 +213,7 @@ struct dlist *sysfs_get_driver_devices(struct sysfs_driver *driver)
if (driver->directory == NULL) {
if ((open_driver_dir(driver)) == 1)
return NULL;
- if ((read_driver_dir(driver)) != 0)
+ if ((sysfs_read_dir_links(driver->directory)) != 0)
return NULL;
}
if (driver->directory->links != NULL) {
diff --git a/lib/sysfs_utils.c b/lib/sysfs_utils.c
index dd424f1..5f2c9e3 100644
--- a/lib/sysfs_utils.c
+++ b/lib/sysfs_utils.c
@@ -1,5 +1,5 @@
/*
- * syfs_utils.c
+ * sysfs_utils.c
*
* System utility functions for libsysfs
*
@@ -110,20 +110,24 @@ int sysfs_get_name_from_path(const unsigned char *path, unsigned char *name,
}
memset(tmp, 0, SYSFS_PATH_MAX);
strcpy(tmp, path);
- n = &tmp[strlen(tmp)-1];
- if (strncmp(n, "/", 1) == 0)
- *n = '\0';
n = strrchr(tmp, '/');
if (n == NULL) {
errno = EINVAL;
return -1;
}
+ if (*(n+1) == '\0') {
+ *n = '\0';
+ n = strrchr(tmp, '/');
+ if (n == NULL) {
+ errno = EINVAL;
+ return -1;
+ }
+ }
n++;
strncpy(name, n, len);
-
return 0;
}
-
+
/**
* sysfs_get_link: returns link source
* @path: symbolic link's path
@@ -226,7 +230,7 @@ struct dlist *sysfs_open_subsystem_list(unsigned char *name)
return NULL;
}
- if ((sysfs_read_directory(dir)) != 0) {
+ if ((sysfs_read_dir_subdirs(dir)) != 0) {
dprintf("Error reading sysfs_directory at %s\n", sysfs_path);
sysfs_close_directory(dir);
return NULL;
@@ -259,11 +263,7 @@ struct dlist *sysfs_open_subsystem_list(unsigned char *name)
if (c == NULL)
goto out;
strcpy(c, SYSFS_BLOCK_NAME);
- if ((lstat(sysfs_path, &astats)) != 0) {
- dprintf("stat() failed\n");
- goto out;
- }
- if (S_ISDIR(astats.st_mode)) {
+ if ((sysfs_path_is_dir(sysfs_path)) == 0) {
subsys_name = (char *)calloc(1, SYSFS_NAME_LEN);
strcpy(subsys_name, SYSFS_BLOCK_NAME);
dlist_unshift(list, subsys_name);
@@ -306,7 +306,7 @@ struct dlist *sysfs_open_bus_devices_list(unsigned char *name)
return NULL;
}
- if ((sysfs_read_directory(dir)) != 0) {
+ if ((sysfs_read_dir_links(dir)) != 0) {
dprintf("Error reading sysfs_directory at %s\n", sysfs_path);
sysfs_close_directory(dir);
return NULL;
diff --git a/lsbus.1 b/lsbus.1
new file mode 100644
index 0000000..ca02c06
--- /dev/null
+++ b/lsbus.1
@@ -0,0 +1,58 @@
+.TH LSBUS 1 "October 12, 2003" "Martin Pitt"
+.SH NAME
+lsbus \- query system bus information
+
+.SH SYNOPSIS
+.B lsbus
+[
+.I options
+.I bus
+[
+.I device
+] ]
+
+.SH DESCRIPTION
+When
+.B lsbus
+is called without arguments, it shows the available bus types (usb,
+pci, etc.).
+.P
+When \fIbus\fR is supplied, then a tree of all devices (without
+further arguments) or a specific device (when \fIdevice\fR is
+given) on this bus is displayed.
+
+.SH OPTIONS
+.TP
+.B \-a
+Show attributes
+.TP
+.B \-d
+Show only devices
+.TP
+.B \-v
+Show all attributes with values
+.TP
+.B \-A \fIattribute
+Show attribute value
+.TP
+.B \-D
+Show only drivers
+.TP
+.B \-h
+Show usage
+
+.SH SEE ALSO
+.B systool
+(1)
+.P
+The web page of
+.B libsysfs
+at http://linux\-diag.sourceforge.net/Sysfsutils.html
+
+.SH AUTHOR
+.B lsbus
+was written by Ananth Mavinakayanahalli <ananth@in.ibm.com> and
+Daniel Stekloff <dsteklof@us.ibm.com>.
+.P
+This man page was contributed by Martin Pitt <mpitt@debian.org> for
+the Debian GNU/Linux system (but may be used by others).
diff --git a/systool.1 b/systool.1
new file mode 100644
index 0000000..1e1065a
--- /dev/null
+++ b/systool.1
@@ -0,0 +1,65 @@
+.TH SYSTOOL 1 "October 12, 2003" "Martin Pitt"
+.SH NAME
+systool \- view system device information by bus, class, and topology
+
+.SH SYNOPSIS
+.B systool
+[\fIoptions \fR[\fIdevice\fR]]
+
+.SH DESCRIPTION
+Calling
+.B systool
+without parameters will present all available bus types, device
+classes, and root devices.
+.P
+When
+.I device
+is supplied, the information reqested by
+.I options
+is shown only for the specified device, otherwise all present devices
+are displayed.
+
+.SH OPTIONS
+.TP
+.B \-a
+Show attributes
+.TP
+.B \-b \fIbus
+Show a specific bus
+.TP
+.B \-c \fIclass
+Show a specific class
+.TP
+.B \-d
+Show only devices
+.TP
+.B \-h
+Show usage
+.TP
+.B \-r \fIroot_device
+Show a specific root device tree
+.TP
+.B \-v
+Show all attributes with values
+.TP
+.B \-A \fI attribute
+Show attribute value
+.TP
+.B \-D
+Show only drivers
+
+.SH SEE ALSO
+.B lsbus
+(1)
+.P
+The web page of
+.B libsysfs
+at http://linux\-diag.sourceforge.net/Sysfsutils.html
+
+.SH AUTHOR
+.B systool
+was written by Ananth Mavinakayanahalli <ananth@in.ibm.com> and
+Daniel Stekloff <dsteklof@us.ibm.com>.
+.P
+This man page was contributed by Martin Pitt <mpitt@debian.org> for
+the Debian GNU/Linux system (but may be used by others).
diff --git a/test/Makefile.am b/test/Makefile.am
index e2deb5b..0cc3ca1 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -1,10 +1,11 @@
bin_PROGRAMS = dlist_test get_class_dev get_device get_driver \
- get_bus_devices_list write_attr
+ get_bus_devices_list write_attr get_classdev_parent
dlist_test_SOURCES = dlist_test.c
get_class_dev_SOURCES = get_class_dev.c
get_device_SOURCES = get_device.c
get_driver_SOURCES = get_driver.c
get_bus_devices_list_SOURCES = get_bus_devices_list.c
write_attr_SOURCES = write_attr.c
+get_classdev_parent_SOURCES = get_classdev_parent.c
INCLUDES = -I../include
LDADD = ../lib/libsysfs.la
diff --git a/test/Makefile.in b/test/Makefile.in
index ceeccaa..8d1b7c4 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -84,7 +84,7 @@ am__include = @am__include@
am__quote = @am__quote@
install_sh = @install_sh@
bin_PROGRAMS = dlist_test get_class_dev get_device get_driver \
- get_bus_devices_list write_attr
+ get_bus_devices_list write_attr get_classdev_parent
dlist_test_SOURCES = dlist_test.c
get_class_dev_SOURCES = get_class_dev.c
@@ -92,6 +92,7 @@ get_device_SOURCES = get_device.c
get_driver_SOURCES = get_driver.c
get_bus_devices_list_SOURCES = get_bus_devices_list.c
write_attr_SOURCES = write_attr.c
+get_classdev_parent_SOURCES = get_classdev_parent.c
INCLUDES = -I../include
LDADD = ../lib/libsysfs.la
subdir = test
@@ -100,7 +101,8 @@ CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
bin_PROGRAMS = dlist_test$(EXEEXT) get_class_dev$(EXEEXT) \
get_device$(EXEEXT) get_driver$(EXEEXT) \
- get_bus_devices_list$(EXEEXT) write_attr$(EXEEXT)
+ get_bus_devices_list$(EXEEXT) write_attr$(EXEEXT) \
+ get_classdev_parent$(EXEEXT)
PROGRAMS = $(bin_PROGRAMS)
am_dlist_test_OBJECTS = dlist_test.$(OBJEXT)
@@ -118,6 +120,11 @@ get_class_dev_OBJECTS = $(am_get_class_dev_OBJECTS)
get_class_dev_LDADD = $(LDADD)
get_class_dev_DEPENDENCIES = ../lib/libsysfs.la
get_class_dev_LDFLAGS =
+am_get_classdev_parent_OBJECTS = get_classdev_parent.$(OBJEXT)
+get_classdev_parent_OBJECTS = $(am_get_classdev_parent_OBJECTS)
+get_classdev_parent_LDADD = $(LDADD)
+get_classdev_parent_DEPENDENCIES = ../lib/libsysfs.la
+get_classdev_parent_LDFLAGS =
am_get_device_OBJECTS = get_device.$(OBJEXT)
get_device_OBJECTS = $(am_get_device_OBJECTS)
get_device_LDADD = $(LDADD)
@@ -144,6 +151,7 @@ am__depfiles_maybe = depfiles
@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/dlist_test.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/get_bus_devices_list.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/get_class_dev.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/get_classdev_parent.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/get_device.Po ./$(DEPDIR)/get_driver.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/write_attr.Po
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
@@ -155,10 +163,11 @@ LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
CFLAGS = @CFLAGS@
DIST_SOURCES = $(dlist_test_SOURCES) $(get_bus_devices_list_SOURCES) \
- $(get_class_dev_SOURCES) $(get_device_SOURCES) \
- $(get_driver_SOURCES) $(write_attr_SOURCES)
+ $(get_class_dev_SOURCES) $(get_classdev_parent_SOURCES) \
+ $(get_device_SOURCES) $(get_driver_SOURCES) \
+ $(write_attr_SOURCES)
DIST_COMMON = Makefile.am Makefile.in
-SOURCES = $(dlist_test_SOURCES) $(get_bus_devices_list_SOURCES) $(get_class_dev_SOURCES) $(get_device_SOURCES) $(get_driver_SOURCES) $(write_attr_SOURCES)
+SOURCES = $(dlist_test_SOURCES) $(get_bus_devices_list_SOURCES) $(get_class_dev_SOURCES) $(get_classdev_parent_SOURCES) $(get_device_SOURCES) $(get_driver_SOURCES) $(write_attr_SOURCES)
all: all-am
@@ -207,6 +216,9 @@ get_bus_devices_list$(EXEEXT): $(get_bus_devices_list_OBJECTS) $(get_bus_devices
get_class_dev$(EXEEXT): $(get_class_dev_OBJECTS) $(get_class_dev_DEPENDENCIES)
@rm -f get_class_dev$(EXEEXT)
$(LINK) $(get_class_dev_LDFLAGS) $(get_class_dev_OBJECTS) $(get_class_dev_LDADD) $(LIBS)
+get_classdev_parent$(EXEEXT): $(get_classdev_parent_OBJECTS) $(get_classdev_parent_DEPENDENCIES)
+ @rm -f get_classdev_parent$(EXEEXT)
+ $(LINK) $(get_classdev_parent_LDFLAGS) $(get_classdev_parent_OBJECTS) $(get_classdev_parent_LDADD) $(LIBS)
get_device$(EXEEXT): $(get_device_OBJECTS) $(get_device_DEPENDENCIES)
@rm -f get_device$(EXEEXT)
$(LINK) $(get_device_LDFLAGS) $(get_device_OBJECTS) $(get_device_LDADD) $(LIBS)
@@ -226,6 +238,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dlist_test.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_bus_devices_list.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_class_dev.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_classdev_parent.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_device.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_driver.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/write_attr.Po@am__quote@