-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfigure
executable file
·193 lines (178 loc) · 4.74 KB
/
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
#!/bin/sh
if [ "$1" = "-h" ]; then
echo Options:
echo " --prefix=path prefix path to install amap and its datafiles to"
echo " --help this here"
exit 0
fi
if [ "$1" = "--help" ]; then
echo Options:
echo " --prefix=path path to install amap and its datafiles to"
echo " --help this here"
exit 0
fi
cd pcre-3.9 || exit 1
./configure || exit 1
cd ..
echo
echo
echo "Starting amap auto configuration ..."
rm -f Makefile.in
PREFIX=""
SSL_PATH=""
SSL_IPATH=""
CRYPTO_PATH=""
NSL_PATH=""
SOCKET_PATH=""
MANDIR=""
LIBDIRS=`cat /etc/ld.so.conf 2> /dev/null`
PREFIX=`echo "$1"|grep prefix=|sed 's/.*prefix=//i'`
echo
echo "Checking for openssl ..."
for i in $LIBDIRS /lib /usr/lib /usr/local/lib /opt/local/lib \
/*ssl /usr/*ssl /opt/*ssl /usr/local/*ssl /opt/local/*ssl \
/*ssl/lib /usr/*ssl/lib /opt/*ssl/lib /usr/local/*ssl/lib /opt/local/*ssl/lib .
do
if [ "X" = "X$SSL_PATH" ]; then
if [ -f "$i/libssl.so" -o -f "$i/libssl.dylib" ]; then
echo $i | grep -qi mozilla || SSL_PATH="$i"
fi
fi
if [ "X" = "X$SSL_PATH" ]; then
TMP_LIB=`/bin/ls $i/libssl.* 2> /dev/null | grep libssl.`
if [ -n "$TMP_LIB" ]; then
echo $i | grep -qi mozilla || SSL_PATH="$i"
fi
fi
if [ "X" = "X$CRYPTO_PATH" ]; then
if [ -f "$i/libcrypto.so" -o -f "$i/libcrypto.dylib" ]; then
echo $i | grep -qi mozilla || CRYPTO_PATH="$i"
fi
fi
if [ "X" = "X$CRYPTO_PATH" ]; then
TMP_LIB=`/bin/ls $i/libcrypto.* 2> /dev/null | grep libcrypto.`
if [ -n "$TMP_LIB" ]; then
echo $i | grep -qi mozilla || CRYPTO_PATH="$i"
fi
fi
done
for i in /usr/local/include /*ssl/include /usr/include \
/opt/*ssl/include /usr/*ssl/include /usr/local/*ssl/include .
do
if [ "X" = "X$SSL_IPATH" ]; then
if [ -f "$i/openssl/ssl.h" ]; then
echo $i | grep -qi mozilla || SSL_IPATH="$i"
fi
fi
done
if [ "X" = "X$SSL_PATH" ]; then
SSL_IPATH=""
CRYPTO_PATH=""
fi
if [ "X" = "X$SSL_IPATH" ]; then
SSL_PATH=""
CRYPTO_PATH=""
fi
if [ -n "$SSL_PATH" ]; then
echo " ... found"
fi
if [ "X" = "X$SSL_PATH" ]; then
echo " ... NOT found, SSL support disabled"
fi
if [ "$SSL_IPATH" = "/usr/include" ]; then
SSL_IPATH=""
fi
SYS=`uname -s`
if [ "$SYS" = "SunOS" ]; then
echo "Checking for Solaris libraries ..."
for i in /lib /usr/lib /usr/local/lib $LIBDIRS
do
if [ "X" = "X$NSL_PATH" ]; then
if [ -f "$i/libnsl.so" ]; then
NSL_PATH="$i"
fi
fi
if [ "X" = "X$SOCKET_PATH" ]; then
if [ -f "$i/libsocket.so" ]; then
SOCKET_PATH="$i"
fi
fi
if [ "X" = "X$RESOLV_PATH" ]; then
if [ -f "$i/libresolv.so" ]; then
RESOLV_PATH="$i"
fi
fi
done
if [ "X" = "X$NSL_PATH" ]; then
echo "NSL library not found, which is needed on Solaris."
fi
if [ "X" = "X$SOCKET_PATH" ]; then
echo "Socket library not found, which is needed on Solaris."
fi
if [ "X" = "X$RESOLV_PATH" ]; then
echo "Resolv library not found, which is needed on Solaris."
fi
fi
echo
XDEFINES=""
XLIBS=""
XLIBPATHS=""
XIPATHS=""
if [ -n "$SSL_PATH" ]; then
XDEFINES="$XDEFINES -DOPENSSL"
fi
for i in $SSL_PATH $CRYPTO_PATH $NSL_PATH $SOCKET_PATH $RESOLV_PATH; do
XLIBPATHS="$XLIBPATHS -L$i"
done
if [ -n "$SSL_IPATH" ]; then
XIPATHS="-I$SSL_IPATH"
fi
if [ -n "$SSL_PATH" ]; then
XLIBS="$XLIBS -lssl"
fi
if [ -n "$CRYPTO_PATH" ]; then
XLIBS="$XLIBS -lcrypto"
fi
if [ -n "$NSL_PATH" ]; then
XLIBS="$XLIBS -lnsl"
fi
if [ -n "$SOCKET_PATH" ]; then
XLIBS="$XLIBS -lsocket"
fi
if [ -n "$RESOLV_PATH" ]; then
XLIBS="$XLIBS -lresolv"
fi
for i in /usr/man /usr/share/man /usr/local/man /usr/local/share/man ; do
if [ -d $i ]; then
MANDIR=$i
fi
done
if [ "X" = "X$MANDIR" ]; then
MANDIR="/usr/local/man"
fi
echo "Manual page will be install to: $MANDIR"
echo
if [ -d /usr/kerberos/include ]; then
XIPATHS="$XIPATHS -I/usr/kerberos/include"
fi
if [ -n "$PREFIX" ]; then
XDEFINES="$XDEFINES -DAMAP_PREFIX='\"$PREFIX\"'"
else
PREFIX="/usr/local"
fi
echo "Amap will be installed into .../bin and .../etc of: $PREFIX"
echo " (change this by running ./configure --prefix=path)"
echo
echo "Writing Makefile.in ..."
echo "XDEFINES=$XDEFINES" >> Makefile.in
echo "XLIBS=$XLIBS" >> Makefile.in
echo "XLIBPATHS=$XLIBPATHS" >> Makefile.in
echo "XIPATHS=$XIPATHS" >> Makefile.in
echo "MANDIR=$MANDIR/man1/" >> Makefile.in
echo "PREFIX=$PREFIX" >> Makefile.in
echo >> Makefile.in
echo "Generating Makefile ..."
cat Makefile.in > Makefile
cat Makefile.am >> Makefile
echo
echo "now type \"make\""