summaryrefslogtreecommitdiff
path: root/package/sispmctl
diff options
context:
space:
mode:
authorRomain Naour <romain.naour@openwide.fr>2014-08-26 01:12:33 +0200
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>2014-10-05 23:35:15 +0200
commit441ff982fdc8907c7f1bd8ba24bdf50df0c53293 (patch)
treebfe37ec404915690be32d8d316b9fdac180d5b4c /package/sispmctl
parent1218ab64d09c715ce985d2c957e24ed4ad1ca5f0 (diff)
package/sispmctl: fix static linking
The static linking doesn't work with libusb-compat when using libusb-config. Also the CFLAGS initialization with libusb-config --cflags is comented out. Based on libftdi's patch, this commit adds the support for pkg-config to link sispmctl correctly. This allow to add the correct include directories to CFLAGS (Add -I$(STAGING_DIR)/usr/include and -I$(STAGING_DIR)/usr/include/libusb-1.0) and also add the required libraries during static linking (-lusb -lusb-1.0 and -pthread). Since configure.ac is modified, the configure script needs to be regenerated with autoreconf. Fixes: http://autobuild.buildroot.net/results/647/6473088e751d3ab3a5227e9d7876966934e66378/build-end.log Cc: Phil Eichinger <phil.eichinger@gmail.com> Signed-off-by: Romain Naour <romain.naour@openwide.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Tested-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'package/sispmctl')
-rw-r--r--package/sispmctl/sispmctl-01-configure-add-pkg-config-support.patch70
-rw-r--r--package/sispmctl/sispmctl.mk4
2 files changed, 73 insertions, 1 deletions
diff --git a/package/sispmctl/sispmctl-01-configure-add-pkg-config-support.patch b/package/sispmctl/sispmctl-01-configure-add-pkg-config-support.patch
new file mode 100644
index 000000000..946608064
--- /dev/null
+++ b/package/sispmctl/sispmctl-01-configure-add-pkg-config-support.patch
@@ -0,0 +1,70 @@
+From 8002a7e6fa965dfd304d098fbc64b0f1a6e3b465 Mon Sep 17 00:00:00 2001
+From: Romain Naour <romain.naour@openwide.fr>
+Date: Sun, 24 Aug 2014 22:34:29 +0200
+Subject: [PATCH 1/1] configure: add pkg-config support
+
+The static linking doesn't works with libusb-compat when using libusb-config.
+Also the CFLAGS initialization with libusb-config --cflags is comented out.
+
+Based on libftdi's patch, add the support for pkg-config to link sispmctl
+correctly.
+
+This allow to add correct include directory to CFLAGS
+(Add -I$(STAGING_DIR)/usr/include and -I$(STAGING_DIR)/usr/include/libusb-1.0)
+Also add needed libraries during static linking (-lusb -lusb-1.0 and -pthread)
+
+Signed-off-by: Romain Naour <romain.naour@openwide.fr>
+---
+ configure.in | 36 +++++++++++-------------------------
+ 1 file changed, 11 insertions(+), 25 deletions(-)
+
+diff --git a/configure.in b/configure.in
+index 08d39ea..65d0c1d 100644
+--- a/configure.in
++++ b/configure.in
+@@ -23,31 +23,17 @@ AC_SUBST(WEBDIR)
+ AC_ARG_WITH(bindaddr,[ --with-bindaddr=IP bind listening socket to IP], [BINDADDR="$withval"])
+ AC_SUBST(BINDADDR)
+
+-
+-# Checks for libraries.
+-dnl check for libusb-config
+-AC_PATH_PROG(HAVELIBUSB, libusb-config, $PATH)
+-
+-if test -e "$HAVELIBUSB"; then
+- dnl LIBUSB_CFLAGS=`$HAVELIBUSB --cflags`
+- LIBUSB_LIBS=`$HAVELIBUSB --libs`
+- CFLAGS="$CFLAGS $LIBUSB_CFLAGS"
+- LIBS="$LIBS $LIBUSB_LIBS"
+-else
+- AC_MSG_ERROR([*** libusb-config not found. You need a working libusb installation. Version >=0.1.7])
+-fi
+-
+-dnl check for version of libusb
+-AC_MSG_CHECKING([if libusb version is >= 0.1.9])
+-libusb_version_needed="1009"
+-libusb_version=`$HAVELIBUSB --version | sed -e "s/libusb //" | awk 'BEGIN { FS = "."; } { printf "%d", ($''1 * 1000 + $''2) * 1000 + $''3;}'`
+-
+-if test $libusb_version -lt $libusb_version_needed; then
+- AC_MSG_RESULT(no)
+- AC_MSG_ERROR([*** libusb is too old ($libusb_version). You need a libusb installation newer or equal to 0.1.9.])
+-else
+- AC_MSG_RESULT(yes)
+-fi
++dnl check for libusb
++PKG_CHECK_MODULES(LIBUSB, libusb >= 0.1.11)
++CFLAGS="$CFLAGS $LIBUSB_CFLAGS"
++LIBS="$LIBS $LIBUSB_LIBS"
++
++dnl Check for recent pkg-config which supports Requires.private
++case `$PKG_CONFIG --version` in
++0.?|0.1[0-7]) PKGCONFIG_REQUIRES="Requires"; ;;
++*) PKGCONFIG_REQUIRES="Requires.private"; ;;
++esac
++AC_SUBST(PKGCONFIG_REQUIRES)
+
+ # Checks for header files.
+ AC_HEADER_STDC
+--
+1.9.3
+
diff --git a/package/sispmctl/sispmctl.mk b/package/sispmctl/sispmctl.mk
index d10fe1b27..3f3635e1f 100644
--- a/package/sispmctl/sispmctl.mk
+++ b/package/sispmctl/sispmctl.mk
@@ -10,7 +10,9 @@ SISPMCTL_LICENSE = GPLv2+
SISPMCTL_LICENSE_FILES = LICENCE
SISPMCTL_DEPENDENCIES = libusb-compat
-SISPMCTL_CONF_ENV = HAVELIBUSB=$(STAGING_DIR)/usr/bin/libusb-config
SISPMCTL_CONF_OPTS = --enable-webless
+# We're patching configure.in
+SISPMCTL_AUTORECONF = YES
+
$(eval $(autotools-package))