File: make.sh.in

package info (click to toggle)
librsb 1.3.0.2%2Bdfsg-7
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 32,792 kB
  • sloc: ansic: 274,405; f90: 108,468; cpp: 16,934; sh: 6,761; makefile: 1,679; objc: 692; awk: 22; sed: 1
file content (104 lines) | stat: -rw-r--r-- 2,960 bytes parent folder | download | duplicates (3)
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#!/bin/bash
# Example script to build the librsb example programs.
# Uses librsb-config in the $PATH for build flags.
# Environment-provided $LIBRSB_CONFIG override that.
set -e
set -x

srcdir=${srcdir:-`pwd`}
builddir=${builddir:-`pwd`}
prefix="@prefix@"
exec_prefix="@exec_prefix@"
bindir="@bindir@"
if test -z "${LIBRSB_CONFIG}"; then
	export PATH="${bindir}:$PATH"
fi
LIBRSB_CONFIG=${LIBRSB_CONFIG:-librsb-config}
PKG_CONFIG=pkg-config
WANT_PKGCONFIG="@WANT_PKGCONFIG@"
WANT_CLEANUP=${WANT_CLEANUP:-false}

if test x"@WANT_CPP_EXAMPLES@" == x"yes" ; then
CXX="`${LIBRSB_CONFIG} --cxx`"
if test x"@rsblib@" != x"" -a x"${CXX}" != x"" ; then
for s in ${srcdir}/*.cpp
do
	p=${builddir}/`basename ${s/.cpp/}`
	rm -f $p
	CXXFLAGS=`${LIBRSB_CONFIG} --cxxflags --I_opts`
	LDFLAGS=`${LIBRSB_CONFIG} --ldflags --extra_libs`
	LINK=`${LIBRSB_CONFIG} --link`
	o="${p}.o"
	ccmd="$CXX $CXXFLAGS -c $s -o $o"
	lcmd="$LINK $o $LDFLAGS -o $p"
	echo "$ccmd && $lcmd"
	( $ccmd && $lcmd )
	${WANT_CLEANUP} && rm -f "$p"
	# one may use a single command, but that's error-prone (may miss libraries):
	#cmd="$CXX $CXXFLAGS $s $LDFLAGS -o $p"
	#echo $cmd
	#$cmd
done
fi
fi

if test x"@HAVE_C_EXAMPLES@" == x"yes" ; then
for s in ${srcdir}/*.c
do
	p=`basename ${s/.c/}`
	if test $p == hello-spblas -a x"@HAVE_SPARSE_BLAS_INTERFACE@" != x"yes" ; then continue; fi
	if test $p ==    io-spblas -a x"@HAVE_SPARSE_BLAS_INTERFACE@" != x"yes" ; then continue; fi
	rm -f $p 
	CFLAGS=`${LIBRSB_CONFIG} --I_opts --cppflags`
       	LDFLAGS=`${LIBRSB_CONFIG} --ldflags --extra_libs`
	CC=`${LIBRSB_CONFIG} --cc`
	LINK=`${LIBRSB_CONFIG} --link`
	o="${p}.o"
	ccmd="$CC $CFLAGS -c $s -o $o"
	lcmd="$LINK $o $LDFLAGS -o $p"
	echo "$ccmd && $lcmd"
	( $ccmd && $lcmd )
	${WANT_CLEANUP} && rm -f "$p"
	# one may use a single command, but that's error-prone (may miss libraries):
	#cmd="$CC $CFLAGS $s $LDFLAGS -o $p"
	#echo $cmd
	#$cmd
	if test x"${WANT_PKGCONFIG}" != x"no" ; then
		CFLAGS=`${PKG_CONFIG} --cflags librsb`
		LIBS=`${PKG_CONFIG} --libs --static librsb`
		ccmd="$CC $CFLAGS -c $s -o $o"
		lcmd="$LINK $o $LIBS -o $p"
		${WANT_CLEANUP} && rm -f "$p"
		echo "$ccmd && $lcmd"
		( $ccmd && $lcmd )
	fi
done
fi

if test x"@WANT_BLAS_SPARSE_MOD_INSTALL@" == x"yes" ; then
if test x"@HAVE_FORTRAN_EXAMPLES@" = x"yes" ; then
FP=${srcdir}/fortran_rsb_fi.F90
if test x"@HAVE_SPARSE_BLAS_INTERFACE@" = x"yes" ; then
	FP+=\ ${srcdir}/fortran.F90
fi
# activated if you have built the Fortran modules and installed them in the right path.
for s in $FP
do
	p=`basename ${s/.F90/}`
	rm -f $p 
	FCFLAGS=`${LIBRSB_CONFIG} --I_opts --fcflags`
       	LDFLAGS=`${LIBRSB_CONFIG} --ldflags --extra_libs`
	FC=`${LIBRSB_CONFIG} --fc`
	LINK=`${LIBRSB_CONFIG} --link`
	o="${p}.o"
	FCLIBS=`${LIBRSB_CONFIG} --fclibs`
	ccmd="$FC $FCFLAGS -c $s -o $o"
	lcmd="$LINK $o $LDFLAGS $FCLIBS -o $p"
	echo "$ccmd && $lcmd"
	( $ccmd && $lcmd )
	${WANT_CLEANUP} && rm -f "$p"
done
fi
fi

echo " [*] done building examples!"