1 configure.ac: explicitly add pthread cflags/libs in the libusb test
3 If libusb-config does not exist, LIBUSB_CFLAGS and PTHREAD_CFLAGS will be
4 empty, and the test for libusb will be performed without additional flags.
5 However, when libusb needs threads, some extra flags are needed (depending
6 on the platform), like -pthreads, -lpthread, etc. Without these flags, the
7 test for libusb_init() will fail to link correctly, and pcsc-lite will fail
10 Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
12 Upstream-status: will be submitted
16 diff --git a/configure.ac b/configure.ac
19 @@ -254,8 +254,8 @@ if test "x$use_libusb" != xno ; then
20 saved_CPPFLAGS="$CPPFLAGS"
23 - CPPFLAGS="$CPPFLAGS $LIBUSB_CFLAGS"
24 - LIBS="$LDFLAGS $LIBUSB_LIBS"
25 + CPPFLAGS="$CPPFLAGS $LIBUSB_CFLAGS $PTHREAD_CFLAGS"
26 + LIBS="$LDFLAGS $LIBUSB_LIBS $PTHREAD_LIBS"
28 AC_CHECK_HEADERS(libusb.h, [],
29 [ AC_MSG_ERROR([libusb.h not found, use ./configure LIBUSB_CFLAGS=...]) ])