[svn] GnuPG - r3923 - trunk/m4
svn author dshaw
cvs at cvs.gnupg.org
Sun Nov 6 05:25:53 CET 2005
Author: dshaw
Date: 2005-11-06 05:25:52 +0100 (Sun, 06 Nov 2005)
New Revision: 3923
Modified:
trunk/m4/ChangeLog
trunk/m4/libusb.m4
Log:
* libusb.m4: Check for libusb-config and if we find it, use --libs and
--cflags. This is needed for OS X since libusb brings in dependencies
to various Apple libraries.
Modified: trunk/m4/ChangeLog
===================================================================
--- trunk/m4/ChangeLog 2005-11-03 04:46:20 UTC (rev 3922)
+++ trunk/m4/ChangeLog 2005-11-06 04:25:52 UTC (rev 3923)
@@ -1,3 +1,9 @@
+2005-11-05 David Shaw <dshaw at jabberwocky.com>
+
+ * libusb.m4: Check for libusb-config and if we find it, use --libs
+ and --cflags. This is needed for OS X since libusb brings in
+ dependencies to various Apple libraries.
+
2005-10-21 David Shaw <dshaw at jabberwocky.com>
* readline.m4: Check for rl_completion_func_t and
Modified: trunk/m4/libusb.m4
===================================================================
--- trunk/m4/libusb.m4 2005-11-03 04:46:20 UTC (rev 3922)
+++ trunk/m4/libusb.m4 2005-11-06 04:25:52 UTC (rev 3923)
@@ -1,5 +1,5 @@
dnl Check for libusb
-dnl Copyright (C) 2004 Free Software Foundation, Inc.
+dnl Copyright (C) 2004, 2005 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
@@ -22,11 +22,25 @@
if test -d "$withval" ; then
CPPFLAGS="${CPPFLAGS} -I$withval/include"
LDFLAGS="${LDFLAGS} -L$withval/lib"
+ AC_PATH_PROG([_usb_config],["$_do_libusb/bin/libusb-config"])
+ else
+ AC_PATH_PROG([_usb_config],[libusb-config])
fi
_libusb_save_libs=$LIBS
- LIBS="$LIBS -lusb"
+ _libusb_save_cflags=$CFLAGS
+ if test x$_usb_config != "x" ; then
+ _libusb_try_libs=`$LIBS $_usb_config --libs`
+ _libusb_try_cflags=`$LIBS $_usb_config --cflags`
+ else
+ _libusb_try_libs="-lusb"
+ _libusb_try_cflags=""
+ fi
+
+ LIBS="$LIBS $_libusb_try_libs"
+ CFLAGS="$CFLAGS $_libusb_try_cflags"
+
AC_MSG_CHECKING([whether libusb is present and sane])
AC_LINK_IFELSE(AC_LANG_PROGRAM([#include <usb.h>],[
@@ -38,13 +52,18 @@
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_SUBST(LIBUSB_CPPFLAGS,$_libusb_try_cflags)
+ AC_SUBST(LIBUSB,$_libusb_try_libs)
AC_CHECK_FUNCS(usb_get_busses)
fi
LIBS=$_libusb_save_libs
+ CFLAGS=$_libusb_save_cflags
unset _libusb_save_libs
+ unset _libusb_save_cflags
+ unset _libusb_try_libs
+ unset _libusb_try_cflags
unset _found_libusb
fi
])dnl
More information about the Gnupg-commits
mailing list