File: FTCBFS-Fix-pkg-config.patch

package info (click to toggle)
cassbeam 1.1-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 916 kB
  • sloc: ansic: 8,483; python: 231; sh: 171; makefile: 48
file content (58 lines) | stat: -rw-r--r-- 1,523 bytes parent folder | download | duplicates (2)
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
58
From: Helmut Grohne <helmut@subdivi.de>
Date: Sat, 6 Apr 2019 06:52:40 +0200
Subject: FTCBFS: Fix pkg-config

cassbeam fails to cross build from source, because its configure.in hard
codes the build architecture pkg-config. Things get much easier, once
you use pkg-config's autotools support macro. The attached patch
demonstrates that and makes cassbeam cross buildable. Please consider
applying it.

Helmut

Closes: #926496
---
 configure.in | 22 ++++------------------
 1 file changed, 4 insertions(+), 18 deletions(-)

diff --git a/configure.in b/configure.in
index b3cd6ee..6632347 100644
--- a/configure.in
+++ b/configure.in
@@ -11,32 +11,18 @@ dnl Checks for programs.
 AC_PROG_CC
 AC_PROG_INSTALL
 
-AC_CHECK_PROG(GLIB_CONFIG, pkg-config, ok, NONE)
-
-if test "x$GLIB_CONFIG" != xNONE
-then
-	AC_MSG_CHECKING("for GLIB version")
-	glib_version=`pkg-config --version glib-2.0`
-	glib_flags=`pkg-config --cflags glib-2.0`
-	glib_libs=`pkg-config --libs glib-2.0`
-else
-	AC_MSG_ERROR("Could not find glib-config in PATH")
-fi
-
-AC_MSG_RESULT("$glib_version")
-
-dnl ADD CODE to check for version number
-
+dnl TODO: add the right version to check for
+PKG_CHECK_MODULES(GLIB,[glib-2.0 >= 0],,)
 
 dnl get rid of any duplicates in CFLAGS or LIBS
-for flag in ${glib_flags}
+for flag in $GLIB_CFLAGS
 do
 	if  echo "${CFLAGS}" | grep -v -- "$flag" > /dev/null
 	then
 		CFLAGS="${CFLAGS} $flag"
 	fi
 done
-for lib in ${glib_libs}
+for lib in $GLIB_LIBS
 do
 	if echo "${LIBS}" | grep -v -- "$lib" > /dev/null
 	then