forked from WiringPi/WiringPi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.configure
executable file
·75 lines (75 loc) · 1.61 KB
/
default.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
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
#!/bin/sh
if [ ! -f ./configure -o ! -f Makefile -o ! -f Makefile.in -o "$1" = "--force" ] ; then
echo "reconfiguring"
touch configure.ac
mkdir -p m4
autoreconf -fi
fi
if [ ! -f conf-release ] ; then
echo 1.1 > conf-release
fi
SYSTEM=$(uname -s)
case "$SYSTEM" in
FreeBSD)
prefix=/usr/local
mandir=/usr/local/man
libdir=/usr/local/lib
pkgconfigdir=/usr/local/libdata/pkgconfig
;;
Linux)
prefix=/usr
mandir=$prefix/share/man
arch=$(uname -m)
if [ -f /etc/debian_version ] ; then
if [ -d /usr/lib/$arch-linux-gnu ] ; then
libdir=/usr/lib/$arch-linux-gnu
else
libdir=/usr/lib
fi
pkgconfigdir=/usr/lib/pkgconfig
elif [ -f /etc/arch-release ] ; then
libdir=/usr/lib
pkgconfigdir=$libdir/pkgconfig
else
if [ -d /usr/lib64 ] ; then
libdir=/usr/lib64
elif [ -d /usr/lib ] ;then
libdir=/usr/lib
else
echo "could not find libdir " 1>&2
exit 1
fi
pkgconfigdir=$libdir/pkgconfig
fi
;;
Darwin)
prefix=/opt/local
mandir=/opt/local/share/man
libdir=/opt/local/lib
pkgconfigdir=$libdir/pkgconfig
;;
*)
prefix=/usr
mandir=/usr/man
libdir=/usr/lib
pkgconfigdir=$libdir/pkgconfig
;;
esac
if [ -f Makefile ] ; then
case "$SYSTEM" in
Darwin|FreeBSD)
if [ $(stat -f %m configure.ac) -le $(stat -f %m Makefile) ] ; then
echo "Already configured"
exit 0
fi
;;
*)
if [ $(stat --format %Y configure.ac) -le $(stat --format %Y Makefile) ] ; then
echo "Already configured"
exit 0
fi
;;
esac
fi
./configure --prefix=$prefix --mandir=$mandir \
--libdir=$libdir --with-pkgconfigdir=$pkgconfigdir