-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
default.configure
executable file
·81 lines (81 loc) · 1.74 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
76
77
78
79
80
81
#!/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
extra=""
;;
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
extra=""
;;
Darwin)
prefix=/opt/local
mandir=/opt/local/share/man
libdir=/opt/local/lib
pkgconfigdir=$libdir/pkgconfig
extra="--enable-passwd-hash=md5"
;;
*)
prefix=/usr
mandir=/usr/man
libdir=/usr/lib
pkgconfigdir=$libdir/pkgconfig
extra=""
;;
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 \
--sysconfdir=/etc/indimail $extra \
--enable-passwd-hash=sha256