diff --git a/libx52/Makefile b/libx52/Makefile deleted file mode 100644 index d0de21f..0000000 --- a/libx52/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -SRCS := $(wildcard *.c) -HEADERS := $(wildcard *.h) - -test_x52: ${SRCS} ${HEADERS} - gcc -I /usr/include/libusb-1.0/ ${SRCS} -lusb-1.0 -o $@ - -.PHONY: clean -clean: - rm -f test_x52 *.o diff --git a/libx52/Makefile.am b/libx52/Makefile.am new file mode 100644 index 0000000..f268924 --- /dev/null +++ b/libx52/Makefile.am @@ -0,0 +1,2 @@ +SUBDIRS = src + diff --git a/libx52/autogen.sh b/libx52/autogen.sh new file mode 100755 index 0000000..c5a7472 --- /dev/null +++ b/libx52/autogen.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +autoreconf --install diff --git a/libx52/configure.ac b/libx52/configure.ac new file mode 100644 index 0000000..9d21474 --- /dev/null +++ b/libx52/configure.ac @@ -0,0 +1,25 @@ +AC_INIT([libx52], [1.0], [nirenjan@gmail.com]) +AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects]) +AC_PROG_CC +AM_PROG_AR +LT_INIT + +# Check for libusb-1.0 +AC_SEARCH_LIBS([libusb_init], [libusb-1.0], [have_libusb=yes]) + +if test "x${have_libusb}" = xyes; then + AC_CHECK_HEADERS([libusb-1.0/libusb.h], [], [have_libusb=no]) +fi + +if test "x${have_libusb}" = xno; then + AC_MSG_ERROR([ + ------------------------------------------------------- + The library libusb-1.0 and header file libusb.h + are required to build libx52. Stopping... + Check 'config.log' for more information. + ------------------------------------------------------- + ]) +fi + +AC_CONFIG_FILES([Makefile src/Makefile]) +AC_OUTPUT diff --git a/libx52/src/Makefile.am b/libx52/src/Makefile.am new file mode 100644 index 0000000..48233b8 --- /dev/null +++ b/libx52/src/Makefile.am @@ -0,0 +1,6 @@ +lib_LTLIBRARIES = libx52.la +libx52_la_SOURCES = x52_common.h x52_commands.h libx52.h \ + x52_control.c x52_core.c \ + x52_date_time.c x52_mfd_led.c + +pkginclude_HEADERS = libx52.h diff --git a/libx52/libx52.h b/libx52/src/libx52.h similarity index 100% rename from libx52/libx52.h rename to libx52/src/libx52.h diff --git a/libx52/x52_commands.h b/libx52/src/x52_commands.h similarity index 100% rename from libx52/x52_commands.h rename to libx52/src/x52_commands.h diff --git a/libx52/x52_common.h b/libx52/src/x52_common.h similarity index 98% rename from libx52/x52_common.h rename to libx52/src/x52_common.h index 0ec5d18..99bf924 100644 --- a/libx52/x52_common.h +++ b/libx52/src/x52_common.h @@ -14,7 +14,7 @@ #include #include -#include +#include #include "libx52.h" /* diff --git a/libx52/x52_control.c b/libx52/src/x52_control.c similarity index 99% rename from libx52/x52_control.c rename to libx52/src/x52_control.c index 3f6304a..9105909 100644 --- a/libx52/x52_control.c +++ b/libx52/src/x52_control.c @@ -15,8 +15,6 @@ #include #include -#include - #include "libx52.h" #include "x52_commands.h" #include "x52_common.h" diff --git a/libx52/x52_core.c b/libx52/src/x52_core.c similarity index 99% rename from libx52/x52_core.c rename to libx52/src/x52_core.c index 9828955..0be544f 100644 --- a/libx52/x52_core.c +++ b/libx52/src/x52_core.c @@ -15,8 +15,6 @@ #include #include -#include - #include "libx52.h" #include "x52_commands.h" #include "x52_common.h" diff --git a/libx52/x52_date_time.c b/libx52/src/x52_date_time.c similarity index 99% rename from libx52/x52_date_time.c rename to libx52/src/x52_date_time.c index 6de9817..a34107d 100644 --- a/libx52/x52_date_time.c +++ b/libx52/src/x52_date_time.c @@ -15,8 +15,6 @@ #include #include -#include - #include "libx52.h" #include "x52_commands.h" #include "x52_common.h" diff --git a/libx52/x52_mfd_led.c b/libx52/src/x52_mfd_led.c similarity index 100% rename from libx52/x52_mfd_led.c rename to libx52/src/x52_mfd_led.c