gnupg/m4 (ChangeLog Makefile.am libusb.m4)

cvs user dshaw cvs at cvs.gnupg.org
Mon Jan 3 16:10:40 CET 2005


    Date: Monday, January 3, 2005 @ 16:16:57
  Author: dshaw
    Path: /cvs/gnupg/gnupg/m4

   Added: libusb.m4
Modified: ChangeLog Makefile.am

* Makefile.am, libusb.m4: New libusb check macro.


-------------+
 ChangeLog   |    4 ++++
 Makefile.am |    2 +-
 libusb.m4   |   50 ++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 55 insertions(+), 1 deletion(-)


Index: gnupg/m4/ChangeLog
diff -u gnupg/m4/ChangeLog:1.9 gnupg/m4/ChangeLog:1.10
--- gnupg/m4/ChangeLog:1.9	Fri Dec 24 20:41:06 2004
+++ gnupg/m4/ChangeLog	Mon Jan  3 16:16:57 2005
@@ -1,3 +1,7 @@
+2005-01-03  David Shaw  <dshaw at jabberwocky.com>
+
+	* Makefile.am, libusb.m4: New libusb check macro.
+
 2004-12-24  David Shaw  <dshaw at jabberwocky.com>
 
 	* libcurl.m4: Rewrite this to use the new --protocols flag I gave
Index: gnupg/m4/Makefile.am
diff -u gnupg/m4/Makefile.am:1.4 gnupg/m4/Makefile.am:1.5
--- gnupg/m4/Makefile.am:1.4	Fri Dec 24 20:41:06 2004
+++ gnupg/m4/Makefile.am	Mon Jan  3 16:16:57 2005
@@ -1 +1 @@
-EXTRA_DIST = intmax.m4 longdouble.m4 longlong.m4 printf-posix.m4 signed.m4 size_max.m4 wchar_t.m4 wint_t.m4 xsize.m4  codeset.m4 gettext.m4 glibc21.m4 iconv.m4 intdiv0.m4 inttypes.m4 inttypes_h.m4 inttypes-pri.m4 isc-posix.m4 lcmessage.m4 lib-ld.m4 lib-link.m4 lib-prefix.m4 nls.m4 po.m4 progtest.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4 readline.m4 libcurl.m4
+EXTRA_DIST = intmax.m4 longdouble.m4 longlong.m4 printf-posix.m4 signed.m4 size_max.m4 wchar_t.m4 wint_t.m4 xsize.m4  codeset.m4 gettext.m4 glibc21.m4 iconv.m4 intdiv0.m4 inttypes.m4 inttypes_h.m4 inttypes-pri.m4 isc-posix.m4 lcmessage.m4 lib-ld.m4 lib-link.m4 lib-prefix.m4 nls.m4 po.m4 progtest.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4 readline.m4 libcurl.m4 libusb.m4
Index: gnupg/m4/libusb.m4
diff -u /dev/null gnupg/m4/libusb.m4:1.1
--- /dev/null	Mon Jan  3 16:16:57 2005
+++ gnupg/m4/libusb.m4	Mon Jan  3 16:16:57 2005
@@ -0,0 +1,50 @@
+dnl Check for libusb
+dnl Copyright (C) 2004 Free Software Foundation, Inc.
+dnl
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License.  As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+dnl
+dnl Defines HAVE_LIBUSB to 1 if a working libusb setup is found, and sets
+dnl @LIBUSB@ to the necessary libraries.  HAVE_USB_GET_BUSSES is set if
+dnl usb_get_busses() exists.
+
+AC_DEFUN([GNUPG_CHECK_LIBUSB],
+[
+  AC_ARG_WITH(libusb,
+     AC_HELP_STRING([--with-libusb=DIR],
+	[look for the libusb library in DIR]),
+     [_do_libusb=$withval],[_do_libusb=yes])
+
+  if test "$_do_libusb" != "no" ; then
+     if test -d "$withval" ; then
+        CPPFLAGS="${CPPFLAGS} -I$withval/include"
+        LDFLAGS="${LDFLAGS} -L$withval/lib"
+     fi
+
+     _libusb_save_libs=$LIBS
+     LIBS="$LIBS -lusb"
+
+     AC_MSG_CHECKING([whether libusb is present and sane])
+
+     AC_LINK_IFELSE(AC_LANG_PROGRAM([#include <usb.h>],[
+usb_bulk_write(NULL,0,NULL,0,0);
+]),_found_libusb=yes,_found_libusb=no)
+
+     AC_MSG_RESULT([$_found_libusb])
+
+     if test $_found_libusb = yes ; then
+        AC_DEFINE(HAVE_LIBUSB,1,
+	   [Define to 1 if you have a fully functional libusb library.])
+        AC_SUBST(LIBUSB,"-lusb")
+        AC_CHECK_FUNCS(usb_get_busses)
+     fi
+
+     LIBS=$_libusb_save_libs
+
+     unset _libusb_save_libs
+     unset _found_libusb
+  fi
+])dnl




More information about the Gnupg-commits mailing list