-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure
executable file
·36 lines (29 loc) · 915 Bytes
/
configure
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
#!/bin/sh
## Kindly supplied by Dirk Eddelbuettel
## check for pkg-config
pkg-config --version >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo "*** pkg-config is not installed."
echo "*** We need pkg-config to proceed. Exiting."
exit 1
fi
## check for gmp
pkg-config --exists gmp
if [ $? -ne 0 ]; then
echo "*** pkg-config is installed but 'pkg-config --exists gmp' did not return 0."
echo "*** We need gmp to proceed. Exiting."
exit 2
fi
## check for mpfr
pkg-config --exists mpfr
if [ $? -ne 0 ]; then
echo "*** pkg-config is installed but 'pkg-config --exists mpfr' did not return 0."
echo "*** We need mpfr to proceed. Exiting."
exit 3
fi
## get compiler flags and libs
pkgcflags=`pkg-config --cflags gmp mpfr`
pkglibs=`pkg-config --libs gmp mpfr`
## substitute them in
sed -e "s|@PKG_CXXFLAGS@|$pkgcflags|" -e "s|@PKG_LIBS@|$pkglibs|" src/Makevars.in > src/Makevars
exit 0