mirror of https://github.com/nirenjan/libx52.git
Use pkg-config for libusb
parent
3845c81229
commit
86642e5b16
19
configure.ac
19
configure.ac
|
@ -5,23 +5,14 @@ AC_PROG_CC
|
|||
AM_PROG_AR
|
||||
AM_PATH_PYTHON([2.6])
|
||||
LT_INIT
|
||||
PKG_PROG_PKG_CONFIG
|
||||
|
||||
# Check for libusb-1.0
|
||||
AC_SEARCH_LIBS([libusb_init], [usb-1.0], [have_libusb=yes])
|
||||
PKG_CHECK_MODULES([LIBUSB], [libusb-1.0])
|
||||
|
||||
AS_IF([test "x${have_libusb}" = xyes], [
|
||||
AC_CHECK_HEADERS([libusb-1.0/libusb.h], [], [have_libusb=no])
|
||||
])
|
||||
|
||||
AS_IF([test "x${have_libusb}" != xyes], [
|
||||
AC_MSG_ERROR([
|
||||
-------------------------------------------------------
|
||||
The library libusb-1.0 and header file libusb.h
|
||||
are required to build x52pro-linux. Stopping...
|
||||
Check 'config.log' for more information.
|
||||
-------------------------------------------------------
|
||||
])
|
||||
])
|
||||
AC_SUBST([LIBUSB_CFLAGS])
|
||||
AC_SUBST([LIBUSB_LDFLAGS])
|
||||
AC_SUBST([LIBUSB_LIBS])
|
||||
|
||||
AC_SUBST([X52_PKG_VERSION], [0.1])
|
||||
AC_SUBST([X52_INCLUDE], ["-I \$(top_srcdir)/lib/libx52"])
|
||||
|
|
|
@ -4,15 +4,17 @@ ACLOCAL_AMFLAGS = -I m4
|
|||
check_LTLIBRARIES = libusbx52.la
|
||||
|
||||
libusbx52_la_SOURCES = usb_x52_stub.c
|
||||
libusbx52_la_CFLAGS = @LIBUSB_CFLAGS@
|
||||
libusbx52_la_LDFLAGS = -rpath /nowhere -module
|
||||
|
||||
# Utility programs for use by tests
|
||||
check_PROGRAMS = x52test_create_device_list x52test_log_actions
|
||||
|
||||
x52test_create_device_list_SOURCES = util/create_device_list.c
|
||||
x52test_create_device_list_CFLAGS = @LIBUSB_CFLAGS@
|
||||
|
||||
x52test_log_actions_SOURCES = util/log_actions.c
|
||||
x52test_log_actions_CFLAGS = @X52_INCLUDE@
|
||||
x52test_log_actions_CFLAGS = @X52_INCLUDE@ @LIBUSB_CFLAGS@
|
||||
x52test_log_actions_LDADD = libusbx52.la
|
||||
|
||||
EXTRA_DIST = README.md libusbx52.h
|
||||
|
|
|
@ -10,7 +10,8 @@
|
|||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <libusb-1.0/libusb.h>
|
||||
// #include <libusb-1.0/libusb.h>
|
||||
#include <libusb.h>
|
||||
|
||||
struct libusb_device {
|
||||
struct libusb_context *context;
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <libusb-1.0/libusb.h>
|
||||
#include <libusb.h>
|
||||
#include "libusbx52.h"
|
||||
|
||||
int libusb_init(libusb_context **ctx)
|
||||
|
|
|
@ -6,7 +6,8 @@ lib_LTLIBRARIES = libx52.la
|
|||
# This library handles the USB communication between the host and the X52
|
||||
libx52_la_SOURCES = x52_control.c x52_core.c x52_date_time.c x52_mfd_led.c \
|
||||
x52_strerror.c
|
||||
libx52_la_LDFLAGS = -version-info 3:0:1 -lusb-1.0
|
||||
libx52_la_CFLAGS = @LIBUSB_CFLAGS@
|
||||
libx52_la_LDFLAGS = -version-info 3:0:1 @LIBUSB_LIBS@
|
||||
|
||||
# Header files that need to be copied
|
||||
x52includedir = $(includedir)/x52pro
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <libusb-1.0/libusb.h>
|
||||
#include <libusb.h>
|
||||
#include "libx52.h"
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in New Issue