summaryrefslogtreecommitdiffstats
path: root/patches/owfs-2.8p6/owfs-2.7p7-pkgconfigize-fuse.diff
blob: 8c3334695f54abecd18dffdb8c1fc138e92acf61 (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
51
52
53
54
55
56
57
From: Robert Schwebel <r.schwebel@pengutronix.de>
Subject: determine fuse with pkg-config

Add pkg-config support to find fuse libs.

Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>

---
 configure.ac |   28 +++++++++++++---------------
 1 file changed, 13 insertions(+), 15 deletions(-)

Index: owfs-2.7p26/configure.ac
===================================================================
--- owfs-2.7p26.orig/configure.ac
+++ owfs-2.7p26/configure.ac
@@ -940,18 +940,16 @@ AC_SUBST(LD_EXTRALIBS)
 AC_SUBST(OSLIBS)
 AC_MSG_WARN([LD_EXTRALIBS=${LD_EXTRALIBS} OSLIBS=${OSLIBS}])
 
-AC_ARG_WITH(fuseinclude,
-            [  --with-fuseinclude=DIR  FUSE-include from @<:@/usr/local/include@:>@],
-            [fuse_include_path=$withval],
-            [fuse_include_path='/usr/local/include'])
-AC_SUBST(fuse_include_path)
-
-AC_ARG_WITH(fuselib,
-            [  --with-fuselib=DIR      FUSE-lib from @<:@/usr/local/lib@:>@],
-            [fuse_lib_path=$withval],
-            [fuse_lib_path='/usr/local/lib'])
-AC_SUBST(fuse_lib_path)
-
+# check for fuse
+REQUIRES_FUSE="fuse >= 2.2.0"
+AC_SUBST(REQUIRES_FUSE)
+PKG_CHECK_MODULES([fuse],
+	[${REQUIRES_FUSE}],
+	[],
+	[AC_MSG_RESULT([*** ${REQUIRES_FUSE} not found by pkg-config on your system])]
+)
+AC_SUBST(fuse_CFLAGS)
+AC_SUBST(fuse_LIBS)
 
 #Check owfs
 AC_MSG_CHECKING([if owfs is enabled])
@@ -978,9 +976,9 @@ if test "${ENABLE_OWFS}" != "false" ; th
 	save_CPPFLAGS="$CPPFLAGS"
 	save_LDFLAGS="$LDFLAGS"
 	FUSE_FLAGS="-DFUSE_USE_VERSION=26"
-	FUSE_INCLUDES="-I${fuse_include_path}"
-	FUSE_LIBS="-L${fuse_lib_path}"
-	LD_EXTRALIBS="$save_LD_EXTRALIBS -Wl,--rpath -Wl,${fuse_lib_path}"
+	FUSE_INCLUDES="${fuse_CFLAGS}"
+	FUSE_LIBS="${fuse_LIBS}"
+	LD_EXTRALIBS="$save_LD_EXTRALIBS ${fuse_LIBS}"
 	CPPFLAGS="$save_CPPFLAGS -D_FILE_OFFSET_BITS=64 $FUSE_FLAGS $FUSE_INCLUDES"
 	LDFLAGS="$save_LDFLAGS $FUSE_LIBS"