File: libusb.m4

package info (click to toggle)
libchipcard 5.0.3beta-5
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 4,384 kB
  • ctags: 1,894
  • sloc: ansic: 20,920; sh: 11,062; xml: 6,709; makefile: 596; cpp: 448
file content (62 lines) | stat: -rw-r--r-- 1,584 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# $Id$
# (c) 2002 Martin Preuss<martin@libchipcard.de>
# This function checks for libusb

AC_DEFUN([AC_LIBUSB], [
dnl searches for libusb
dnl Arguments: none
dnl Returns:   libusb_dir
dnl            libusb_libs
dnl            libusb_includes
dnl            have_libusb

AC_MSG_CHECKING(if libusb support desired)
AC_ARG_ENABLE(libusb,
  [  --enable-libusb      enable libusb support (default=yes)],
  enable_libusb="$enableval",
  enable_libusb="yes")
AC_MSG_RESULT($enable_libusb)

have_libusb="no"
libusb_dir=""
libusb_libs=""
libusb_includes=""
if test "$enable_libusb" != "no"; then
  AC_MSG_CHECKING(for libusb)
  AC_ARG_WITH(libusb-dir, [  --with-libusb-dir=DIR
                            uses libusb from given dir],
    [lcc_dir="$withval"],
    [lcc_dir="${prefix} \
	     /usr/local \
             /usr \
             /"])

  for li in $lcc_dir; do
      if test -x "$li/bin/libusb-config"; then
          libusb_dir="$li";
          break
      fi
  done
  if test -z "$libusb_dir"; then
      AC_MSG_RESULT([not found ])
  else
      AC_MSG_RESULT($libusb_dir)
      AC_MSG_CHECKING(for USB libs)
      libusb_libs="`$libusb_dir/bin/libusb-config --libs`"
      AC_MSG_RESULT($libusb_libs)
      AC_MSG_CHECKING(for USB includes)
      libusb_includes="`$libusb_dir/bin/libusb-config --cflags`"
      if test -z "$libusb_includes"; then
        AC_MSG_RESULT([<none needed>])
      else
        AC_MSG_RESULT($libusb_includes)
      fi
      have_libusb="yes"
  fi
dnl end of "if enable-libusb"
fi

AC_SUBST(libusb_dir)
AC_SUBST(libusb_libs)
AC_SUBST(libusb_includes)
])