Package: ffindex / 0.9.9.9-2

cross.patch Patch series | download
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
Author: Helmut Grohne <helmutg@debian.org>
Description: enable cross building

ffindex fails to cross build from source, because it uses mpicc. mpicc
is unfixable in terms of cross building, which is why it is being moved
to pkg-config upstream. Rather than wrap your build in mpicc, you can
compute the relevant flags using pkg-config just like any other library.

--- ffindex-0.9.9.9.orig/src/Makefile
+++ ffindex-0.9.9.9/src/Makefile
@@ -7,7 +7,10 @@
 #CC=gcc
 #CC=icc
 #CC=clang
+PKG_CONFIG?=pkg-config
 CFLAGS+=-std=c99 -O2 -g -fPIC -Wall -pedantic -D_GNU_SOURCE=1 -I. $(CPPFLAGS)
+CFLAGS_MPI=$(shell $(PKG_CONFIG) --cflags mpi)
+LDFLAGS_MPI=$(shell $(PKG_CONFIG) --libs mpi)
 SOCURRENT=2
 SOREVISION=0
 SOAGE=2
@@ -61,16 +64,16 @@
 	$(CC) $(CFLAGS) -o $@  ffindex_apply.o $(LDFLAGS) -L. -lffindex
 
 ffindex_apply_mpi: ffindex_apply_mpi.o $(FFINDEX_LIBS)
-	mpicc $(CFLAGS) -DHAVE_MPI -o $@  ffindex_apply_mpi.o $(LDFLAGS) -L. -lffindex
+	$(CC) $(CFLAGS_MPI) $(LDFLAGS_MPI) $(CFLAGS) -DHAVE_MPI -o $@  ffindex_apply_mpi.o $(LDFLAGS) -L. -lffindex
 
 ffindex_apply_mpi.o: ffindex_apply_mpi.c $(FFINDEX_HEADERS)
-	mpicc $(CFLAGS) -DHAVE_MPI -c ffindex_apply_mpi.c -o $@ 
+	$(CC) $(CFLAGS_MPI) $(CFLAGS) -DHAVE_MPI -c ffindex_apply_mpi.c -o $@ 
 
 ffindex_apply_mpi_spawn: ffindex_apply_mpi_spawn.o $(FFINDEX_LIBS)
-	mpicc $(CFLAGS) -o $@  ffindex_apply_mpi_spawn.o $(LDFLAGS)
+	$(CC) $(CFLAGS_MPI) $(LDFLAGS_MPI) $(CFLAGS) -o $@  ffindex_apply_mpi_spawn.o $(LDFLAGS)
 
 ffindex_apply_mpi_spawn.o: ffindex_apply_mpi_spawn.o $(FFINDEX_HEADERS)
-	mpicc $(CFLAGS) -c ffindex_apply_mpi_spawn.c -o $@ 
+	$(CC) $(CFLAGS_MPI) $(CFLAGS) -c ffindex_apply_mpi_spawn.c -o $@ 
 
 ffindex_from_fasta: ffindex_from_fasta.o $(FFINDEX_LIBS)
 	$(CC) -o $@ ffindex_from_fasta.o $(LDFLAGS) $(STATIC)