Skip to content

Commit

Permalink
Merge pull request #9 from barak/master
Browse files Browse the repository at this point in the history
autotools, icon, desktop, warnings
  • Loading branch information
gregkh committed Nov 28, 2016
2 parents 32fd8bb + 5873767 commit 657b71b
Show file tree
Hide file tree
Showing 24 changed files with 256 additions and 513 deletions.
31 changes: 16 additions & 15 deletions .gitignore
@@ -1,19 +1,20 @@
*.o
*.swp
*.gz
acconfig.h
aclocal.m4
autom4te.cache/
*.o
.deps/
config.h
config.log
config.status
stamp-h1
configure
depcomp
install-sh
/aclocal.m4
/autom4te.cache/
/compile
/config.h
/config.h.in
/config.log
/config.status
/configure
/depcomp
/hicolor/
/install-sh
/missing
/stamp-h1
/usbview
/usbview_icon.xpm
Makefile
Makefile.in
missing
mkinstalldirs
usbview
44 changes: 34 additions & 10 deletions ChangeLog
@@ -1,3 +1,27 @@
version 2.0+
- usbview.desktop: Add desktop file.
- usbview_icon.svg: Convert xpm bitmap icon into a scalable svg icon.
- configure.in configure.ac: Rename former to latter.
- autgen.sh, config.h.in: Remove in favour of "autoreconf --install".
- configure.ac, Makefile.am:
- Autotools tweaks and normalization.
- Don't include CPPFLAGS in AM_CPPFLAGS.
- Remove references to unset GLIB_CFLAGS and GLIB_LIBS in Makefile.am
- Reorder clauses to usual order.
- Remove obsolete comments.
- Add m4 quoting to configure.ac per autoconf documentation.
- VERSION belongs in config.h from configure.ac, not Makefile.am.
- Use AX_CFLAGS_WARN_ALL instead of custom code.
- Address "autoupdate" and "autoreconf --warn=all" output.
- Support (conditional) installation of icons, including bitmap
icons at various resolutions, and desktop file.
- remove NEWS, now unnecessary due to automake foreign option.
- Makefile.am, interface.c: Generate icon compiled into executable from scalable icon.
- .gitignore: Updates.
- ChangeLog: trim whitespace
- squelch compiler warning: examine fgets return value
- squelch compiler warning: do not use gtk stock items

version 2.0
- use debugfs (Hans de Goede)
- convert to use gtk 3.0 (Hans de Goede)
Expand All @@ -22,7 +46,7 @@ version 1.0
<berberic@fmi.uni-passau.de> to the about screen
- cleaned up the spec file to hopefully build a bit better on
different versions of different distros.

version 0.9.0
- added Trond Eivind Glomsr�d's patch to always try to populate the
device tree when the program is started.
Expand All @@ -31,12 +55,12 @@ version 0.9.0
reduced the tarball size by about 1/2!
- usbview now updates the device list when devices are plugged in or
removed from the bus automatically (needs 2.4.0-test8 or later to
work properly due to a patch I made for drivers/usb/inode.c to
work properly due to a patch I made for drivers/usb/inode.c to
enable this to work.)
- Made any device that does not have a driver associated with it, show
up in red in the device listing. This should help users with the
problem that "My device shows up properly in usbview, but it isn't
working," that a lot of people seem to have (it isn't obvious, I
working," that a lot of people seem to have (it isn't obvious, I
know...)
- Added small, drab looking "About" dialog box, to make it easier to
determine which version this is.
Expand Down Expand Up @@ -66,8 +90,8 @@ version 0.8.0
that could be done.

version 0.7.0
- the logic for determining the name of the device changed to
properly display the name of a keyboard or mouse when the
- the logic for determining the name of the device changed to
properly display the name of a keyboard or mouse when the
HID driver is used. This is needed for kernel versions 2.3.36
and up.

Expand All @@ -79,7 +103,7 @@ version 0.6.0
of the string descriptors.

version 0.5.0
- updated the parser to handle the fact that the interface now
- updated the parser to handle the fact that the interface now
dictates what driver is loaded.
- Tested on kernel version 2.3.29

Expand All @@ -89,8 +113,8 @@ version 0.4.0
bar.

version 0.3.0
- changed the parsing to make it easier to handle any future changes
in the way the format of /proc/bus/usb/devices
- changed the parsing to make it easier to handle any future changes
in the way the format of /proc/bus/usb/devices

version 0.2.0:
- Configuration, interface, and endpoint data is now displayed
Expand All @@ -100,6 +124,6 @@ version 0.2.0:

Initial version 0.1.0:
- devices are read from /proc/bus/usb/devices and put into a tree view
- very basic information is displayed about each device when it is
- very basic information is displayed about each device when it is
selected

83 changes: 69 additions & 14 deletions Makefile.am
@@ -1,11 +1,7 @@
## Process this file with automake to produce Makefile.in

INCLUDES = \
$(GTK_CFLAGS) \
$(GLIB_CFLAGS) \
@CPPFLAGS@

VERSION = 2.0
AM_CPPFLAGS = $(GTK_CFLAGS)
usbview_LDADD = $(GTK_LIBS)

bin_PROGRAMS = usbview

Expand All @@ -18,13 +14,72 @@ usbview_SOURCES = \
usbtree.c usbtree.h \
usbparse.c usbparse.h \
configure-dialog.c \
usbview_logo.xpm \
usbview_logo.xcf \
usb_icon.xpm \
usbview.spec
usbview_logo.xpm

interface.o: $(icon_bitmaps_xpm)

EXTRA_DIST = $(man_MANS) usbview_icon.svg usbview.desktop usbview.spec usbview_logo.xcf

desktopdir = $(datadir)/applications
if DESKTOP
desktop_DATA = usbview.desktop
endif

icondir = $(datadir)/icons

icon_bitmaps_png = \
hicolor/16x16/apps/usbview.png \
hicolor/22x22/apps/usbview.png \
hicolor/32x32/apps/usbview.png \
hicolor/48x48/apps/usbview.png \
hicolor/64x64/apps/usbview.png \
hicolor/256x256/apps/usbview.png

icon_bitmaps_xpm = hicolor/64x64/apps/usbview_icon.xpm

if ICONS
nobase_icon_DATA = $(icon_scalable) $(icon_bitmaps_png)
endif

$(icon_bitmaps_png): usbview_icon.svg
mkdir -p $$(dirname $@)
if USE_INKSCAPE
$(INKSCAPE) --export-png=$@ --export-width=$$(basename $$(dirname $$(dirname $@))) $<
else
if USE_CONVERT
$(CONVERT) -geometry $$(basename $$(dirname $$(dirname $@))) $< $@
else
echo "error: unable to generate $@ from $<"
exit 1
endif
endif

$(icon_bitmaps_xpm): usbview_icon.svg
mkdir -p $$(dirname $@)
if HAVE_CONVERT
$(CONVERT) -geometry $$(basename $$(dirname $$(dirname $@))) $< $@
else
echo "error: unable to generate $@ from $<"
exit 1
endif

icon_scalable = hicolor/scalable/apps/usbview.svg

$(icon_scalable): usbview_icon.svg
mkdir -p $$(dirname $@)
cp $< $@

usbview_LDADD = \
$(GTK_LIBS) \
$(GLIB_LIBS)
CLEANFILES = $(icon_scalable) $(icon_bitmaps_png) $(icon_bitmaps_xpm)

EXTRA_DIST = $(man_MANS)
# gtk_update_icon_cache = gtk-update-icon-cache -f -t $(datadir)/icons/hicolor; gtk-update-icon-cache -f -t $(datadir)/icons/HighContrast
#
# install-data-hook: update-icon-cache
# uninstall-hook: update-icon-cache
# update-icon-cache:
# @-if test -z "$(DESTDIR)"; then \
# echo "Updating Gtk icon cache."; \
# $(gtk_update_icon_cache); \
# else \
# echo "*** Icon cache not updated. After (un)install, run this:"; \
# echo "*** $(gtk_update_icon_cache)"; \
# fi
1 change: 0 additions & 1 deletion NEWS

This file was deleted.

4 changes: 0 additions & 4 deletions autogen.sh

This file was deleted.

28 changes: 0 additions & 28 deletions config.h.in

This file was deleted.

8 changes: 4 additions & 4 deletions configure-dialog.c
Expand Up @@ -35,8 +35,8 @@ static void fileSelectButtonClick (GtkWidget *widget, gpointer data)
"locate usbdevfs devices file",
GTK_WINDOW (windowMain),
GTK_FILE_CHOOSER_ACTION_OPEN,
GTK_STOCK_OK, GTK_RESPONSE_ACCEPT,
GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT,
"_OK", GTK_RESPONSE_ACCEPT,
"_Cancel", GTK_RESPONSE_REJECT,
NULL);

if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT)
Expand All @@ -63,8 +63,8 @@ void configure_dialog (void)
"USB View Configuration",
GTK_WINDOW (windowMain),
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_STOCK_OK, GTK_RESPONSE_ACCEPT,
GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT,
"_OK", GTK_RESPONSE_ACCEPT,
"_Cancel", GTK_RESPONSE_REJECT,
NULL);

content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
Expand Down
73 changes: 73 additions & 0 deletions configure.ac
@@ -0,0 +1,73 @@
dnl Process this file with autoconf to produce a configure script.

# Prologue.

AC_PREREQ([2.69])
AC_INIT([USBView],[2.0],[Greg Kroah-Hartman <greg@kroah.com>],[usbview],[http://www.kroah.com/linux-usb/])
AC_CONFIG_SRCDIR([usbtree.c])
AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE([foreign subdir-objects -Wall])

# Process options.

AC_MSG_CHECKING([whether to try to install icons])
AC_ARG_ENABLE(icons,
[AS_HELP_STRING([--enable-icons],[try to install icons (default=yes)])],
[icons=$enableval],
[icons=yes])
AC_MSG_RESULT([$icons])

AC_MSG_CHECKING([whether to try to install desktop file])
AC_ARG_ENABLE(desktop,
[AS_HELP_STRING([--enable-desktop],[try to install desktop file (default=yes)])],
[desktop=$enableval],
[desktop=yes])
AC_MSG_RESULT([$desktop])

# Checks for programs.

AC_PROG_CC
AC_CHECK_PROG([have_inkscape],[inkscape],[yes],[no])
AC_CHECK_PROG([have_convert],[convert],[yes],[no])

# Set automake conditionals.

AC_SUBST(INKSCAPE,[inkscape])
AC_SUBST(CONVERT,[convert])
AM_CONDITIONAL(USE_INKSCAPE,[test "$have_inkscape" = "yes"])
AM_CONDITIONAL(USE_CONVERT, [test "$have_inkscape" = "no" && test "$have_convert" = "yes"])
AM_CONDITIONAL(HAVE_INKSCAPE,[test "$have_inkscape" = "yes"])
AM_CONDITIONAL(HAVE_CONVERT, [test "$have_convert" = "yes"])

AS_IF([test "$have_inkscape" = "no" && test "$have_convert" = "no"],
[AC_MSG_WARN([no bitmap conversion utility, disabling icon installation])
icons=no])

AM_CONDITIONAL(DESKTOP,[test x${desktop} = xyes])
AM_CONDITIONAL(ICONS,[test x${icons} = xyes])

# Checks for libraries.

AC_SEARCH_LIBS([strerror],[cposix])
PKG_CHECK_MODULES([GTK], [gtk+-3.0 >= 3.0])
AC_SUBST([GTK_FLAGS])
AC_SUBST([GTK_LIBS])

# Checks for header files.

AC_CHECK_HEADERS([ctype.h errno.h stdio.h],,
AC_MSG_ERROR(required system header file unavailable))

# Checks for typedefs, structures, and compiler characteristics.

AX_CFLAGS_WARN_ALL

# Checks for library functions.

AC_CHECK_FUNCS([memset strstr strtol],,
AC_MSG_ERROR(required library function unavailable))

# Epilogue.

AC_CONFIG_FILES([Makefile])
AC_OUTPUT
32 changes: 0 additions & 32 deletions configure.in

This file was deleted.

0 comments on commit 657b71b

Please sign in to comment.