File: cross.patch

package info (click to toggle)
crac 2.5.2%2Bdfsg-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,012 kB
  • sloc: cpp: 41,838; sh: 391; makefile: 373
file content (68 lines) | stat: -rw-r--r-- 2,465 bytes parent folder | download | duplicates (4)
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
59
60
61
62
63
64
65
66
67
68
Author: Helmut Grohne <helmut@subdivi.de>
Last-Update: Thu, 25 Jul 2019 21:31:15 +0200
Bug-Debian: https://bugs.debian.org/933024
Description: crac fails to cross build from source, because it uses the build
 architecture pkg-config in its Makefile.am files. Doing so is an
 anti-pattern. You should never call pkg-config from a Makefile.am.
 Instead such checks should be performed at configure time. The attached
 patch implements that and makes crac cross buildable. Please consider
 applying it.

--- a/configure.ac
+++ b/configure.ac
@@ -282,6 +282,7 @@ AC_ARG_WITH([libProgressBar-prefix],
             [with_libProgressBar_prefix=""])
 
 dnl Check if we need included ProgressBar library.
+PKG_CHECK_MODULES([PROGRESSBAR],[libProgressBar])
 PB_OK=0
 AS_IF([test "x$with_included_ProgressBar" == "xcheck"],
       [AS_IF([test "x$with_libProgressBar_prefix" != "x"],
@@ -315,6 +316,7 @@ AC_CHECK_LIB([z], [gzread], ,
 AC_CHECK_LIB([hts], [hts_hopen], ,
              [AC_MSG_ERROR([htslib not found, see http://www.htslib.org/])])
 
+PKG_CHECK_MODULES([GKARRAYS],[libGkArrays])
 GK_OK=1
 AS_IF([test "x$with_included_GkArrays" != "xyes"],
       [AC_CHECK_LIB([GkArrays],
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -149,11 +149,11 @@ if INCLUDED_JELLYFISH
 endif
 
 if INCLUDED_GKARRAYS
-  AM_LDFLAGS += `pkg-config --libs libGkArrays`
-  AM_CPPFLAGS += `pkg-config --cflags libGkArrays`
+  AM_LDFLAGS += $(GKARRAYS_LIBS)
+  AM_CPPFLAGS += $(GKARRAYS_CFLAGS)
 if INCLUDED_PROGRESSBAR
-  AM_LDFLAGS += `pkg-config --libs libProgressBar`
-  AM_CPPFLAGS += `pkg-config --cflags libProgressBar`
+  AM_LDFLAGS += $(PROGRESSBAR_LIBS)
+  AM_CPPFLAGS += $(PROGRESSBAR_CFLAGS)
 endif
 endif
 
--- a/src/libReadsInfo/Makefile.am
+++ b/src/libReadsInfo/Makefile.am
@@ -124,7 +124,7 @@ libReadsInfo_a_SOURCES =
 
 libReadsInfo_a_CPPFLAGS = -I@abs_top_srcdir@ -I@abs_top_srcdir@/src -I@abs_top_srcdir@/src/libSSA 
 if INCLUDED_GKARRAYS
-  libReadsInfo_a_CPPFLAGS += `pkg-config --cflags libGkArrays`
+  libReadsInfo_a_CPPFLAGS += $(GKARRAYS_CFLAGS)
 endif
 
 
--- a/src/libSSA/Makefile.am
+++ b/src/libSSA/Makefile.am
@@ -101,7 +101,7 @@
 bin_PROGRAMS = crac-index
 crac_index_SOURCES = cracIndex.cpp cracIndex.h
 
-AM_CPPFLAGS = -I@abs_top_srcdir@ -I@abs_srcdir@/karkkainen_bwt `pkg-config --cflags libGkArrays`
+AM_CPPFLAGS = -I@abs_top_srcdir@ -I@abs_srcdir@/karkkainen_bwt $(GKARRAYS_CFLAGS)
 AM_LDFLAGS = -lm -lpthread -lSSA -L@abs_builddir@/
 LDADD = libSSA.a