summaryrefslogtreecommitdiff
path: root/media-libs/libifp/files/libifp-1.0.0.2-configure.patch
blob: 76961f4a76f33496a06af850001c7cd99b7cb3eb (plain)
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
Fix implicit declaration to autoconf.
Introduce dependency on pkgconf to deal with hardcoded paths in CFLAGS
https://bugs.gentoo.org/899824
--- a/configure.in
+++ b/configure.ac
@@ -1,9 +1,9 @@
-AC_INIT(configure.in)
+AC_INIT
+AC_CONFIG_SRCDIR([configure.ac])
 
 #The automake documentation says this is a no-no, but I don't understand
 #what the alternative is.
 #Commented out until I can find out what the portable alternative is.
-CFLAGS="-g -O2 -Wall -W -Wno-unused-parameter"
 ##CFLAGS="-g -O2 -Wall -W"
 
 AM_INIT_AUTOMAKE(libifp, 1.0.0.2)
@@ -12,6 +12,7 @@
 AC_PROG_LIBTOOL
 AC_C_BIGENDIAN
 AC_SUBST(LIBTOOL_DEPS)
+PKG_PROG_PKG_CONFIG
 
 dnl AC_DEFINE(IFP_AUTOCONF)
 
@@ -22,10 +23,14 @@
 AC_MSG_CHECKING([libusb])
 AC_ARG_WITH(libusb,
 	AC_HELP_STRING([--with-libusb=PATH],[libusb path (default /usr)]),
-	ac_libusb=$enableval, ac_libusb=no)
+	ac_libusb=$withval, ac_libusb=no)
 if test "x${ac_libusb}" != "xno" ; then
 		case ${with_libusb} in
 			"" | "yes" | "YES")
+				PKG_CHECK_MODULES([LIBUSB],[libusb],,[AC_MSG_ERROR([Cannot detect libusb])])
+				CFLAGS+=" $LIBUSB_CFLAGS"
+				CPPFLAGS+=" $LIBUSB_CFLAGS"
+				LDFLAGS+=" $LIBUSB_LDFLAGS"
 				;;
 			"no" | "NO")
 				use_libusb=false
@@ -93,7 +98,7 @@
 AC_MSG_CHECKING([kernel source code])
 AC_ARG_WITH(kmodule,
     AC_HELP_STRING([--with-kmodule=to/kernel/src], [build as linux kernel module [[default=no]]]),
-    ac_kmodule=$enableval, ac_kmodule=no)
+    ac_kmodule=$withval, ac_kmodule=no)
 if test "x$ac_kmodule" != "xno" ; then
 	#echo "enableval is $enableval, with_kmodule is $with_kmodule"
 	if test "x$with_kmodule" = "xyes" ; then