Skip to content

Commit

Permalink
Merge pull request #8 from Flameeyes/master
Browse files Browse the repository at this point in the history
Allow disabling usb.ids (and script) install.
  • Loading branch information
gregkh committed Apr 10, 2012
2 parents a492ca4 + 2c594ff commit d8c5ecf
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
17 changes: 12 additions & 5 deletions Makefile.am
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@ SUBDIRS = \
AM_LDFLAGS = \ AM_LDFLAGS = \
-Wl,--as-needed -Wl,--as-needed


data_DATA = \ data_DATA =
usb.ids


bin_PROGRAMS = \ bin_PROGRAMS = \
lsusb lsusb


sbin_SCRIPTS = \ sbin_SCRIPTS =
update-usbids.sh


bin_SCRIPTS = \ bin_SCRIPTS = \
usb-devices \ usb-devices \
Expand All @@ -33,7 +31,6 @@ lsusb_LDADD = \
$(LIBUSB_LIBS) $(LIBUSB_LIBS)


if HAVE_ZLIB if HAVE_ZLIB
data_DATA += usb.ids.gz
lsusb_CPPFLAGS += -DHAVE_LIBZ lsusb_CPPFLAGS += -DHAVE_LIBZ
lsusb_LDADD += -lz lsusb_LDADD += -lz
endif endif
Expand All @@ -51,12 +48,22 @@ EXTRA_DIST = \
lsusb.py \ lsusb.py \
usbutils.pc.in usbutils.pc.in


if INSTALL_USBIDS
data_DATA += usb.ids

if HAVE_ZLIB
data_DATA += usb.ids.gz
endif

sbin_SCRIPTS += update-usbids.sh

usb.ids.gz: $(srcdir)/usb.ids usb.ids.gz: $(srcdir)/usb.ids
gzip -c -9 $< > $@ gzip -c -9 $< > $@


update-usbids.sh: $(srcdir)/update-usbids.sh.in update-usbids.sh: $(srcdir)/update-usbids.sh.in
sed 's|@usbids@|$(datadir)/usb.ids|g' $< >$@ sed 's|@usbids@|$(datadir)/usb.ids|g' $< >$@
chmod 755 $@ chmod 755 $@
endif


lsusb.8: $(srcdir)/lsusb.8.in lsusb.8: $(srcdir)/lsusb.8.in
sed 's|VERSION|$(VERSION)|g;s|@usbids@|$(datadir)/usb.ids|g' $< >$@ sed 's|VERSION|$(VERSION)|g;s|@usbids@|$(datadir)/usb.ids|g' $< >$@
Expand Down
4 changes: 4 additions & 0 deletions configure.ac
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ AS_IF([test "x$enable_zlib" != "xno"],
[AC_CHECK_LIB(z, inflateEnd, HAVE_ZLIB=yes)]) [AC_CHECK_LIB(z, inflateEnd, HAVE_ZLIB=yes)])
AM_CONDITIONAL(HAVE_ZLIB, [test "$HAVE_ZLIB" = "yes"]) AM_CONDITIONAL(HAVE_ZLIB, [test "$HAVE_ZLIB" = "yes"])


AC_ARG_ENABLE(usbids,
AS_HELP_STRING(--disable-usbids, [disable installing usb.ids @<:@default=install@:>@]))
AM_CONDITIONAL([INSTALL_USBIDS], [test "x$enable_usbids" != "xno"])

PKG_CHECK_MODULES(LIBUSB, libusb-1.0 >= 1.0.0) PKG_CHECK_MODULES(LIBUSB, libusb-1.0 >= 1.0.0)


AC_CONFIG_HEADERS([config.h]) AC_CONFIG_HEADERS([config.h])
Expand Down

0 comments on commit d8c5ecf

Please sign in to comment.