forked from mbert/mulberry-main
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.in
416 lines (363 loc) · 11.1 KB
/
configure.in
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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
dnl Process this file with autoconf to produce a configure script.
AC_INIT(Libraries/CICalendar/Source/CICalendarDurationValue.cpp)
# ---------------------------------------------------------------------------
# Checks for compilers and tools
# ---------------------------------------------------------------------------
AC_PROG_CXX
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_LN_S
AC_CHECK_PROG(AR, ar, ar)
if test -z "$AR"; then
AC_MSG_ERROR("ar not found. Make sure it is in the PATH and rerun configure.")
fi
AC_SUBST(AR)
AC_CHECK_PROG(STRIP, strip, strip)
AC_SUBST(STRIP)
AC_LANG(C++)
dnl Checks for header files.
AC_HEADER_STDC
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
# ---------------------------------------------------------------------------
# Checks for platform and compiler features
# ---------------------------------------------------------------------------
AC_CANONICAL_HOST
case "$host_os" in
*irix*)
CXX="$CXX -LANG:std"
if test -z "$PRELINK"; then
PRELINK="/usr/lib/DCC/edg_prelink"
fi
if test -z "$CXXWARN"; then
CXXWARN=""
fi
JX_TARGET=""
;;
gnu*|linux*)
case $host_cpu in
ppc)
JX_TARGET="linuxppc2000"
;;
i*86|i*86pc)
JX_TARGET="linux_intel"
;;
esac
;;
bsd4.4*|netbsd*|freebsd*)
JX_TARGET="freebsd3_x"
;;
SunOS|Solaris|solaris*)
JX_TARGET="sunos5.8-g++"
AC_WARN(Setting JX target to $JX_TARGET - this may be wrong (check configure.in)
;;
esac
case $CC in
gcc*|g++*|c++*|*-g++)
CWARN="-Wall -Wcast-align -Wno-multichar -Wno-unused -Wno-unknown-pragmas"
CFLAGS="$CFLAGS -std=c99"
HAS_MM="yes"
;;
esac
case $CXX in
gcc*|g++*|c++*|*-g++)
CXXWARN="-Wall -Wcast-align -Wno-multichar -Wno-unused -Wno-unknown-pragmas -Wno-non-virtual-dtor -Wno-ctor-dtor-privacy"
CXXFLAGS="$CXXFLAGS"
#GVERSION=`$CXX --version | grep "^$CXX " | sed "s/.* //"`
GVERSION=`$CXX -dumpversion`
case $GVERSION in
4.3*|4.4*|4.5*|4.6*|4.7*|4.8*|4.9*|5.*)
CXXWARN="$CXXWARN -Wno-deprecated"
CXXFLAGS="$CXXFLAGS -fpermissive"
#-std=gnu++0x
#-std=c++0x
;;
esac
HAS_MM="yes"
;;
esac
CPPFLAGS=""
AC_ARG_WITH(extra-cppflags,
[ --with-extra-cppflags Specify additional flags to pass to the C preprocessor.],
CPPFLAGS="${CPPFLAGS} $withval")
if test -z "$JX_TARGET"; then
AC_ERROR(Could not determine target system for JX build for OS "$host_os" and CPU "$host_cpu". Please edit configure.in and rerun autoconf / configure)
fi
AC_SUBST(JX_TARGET)
AC_SUBST(HAS_MM)
AC_SUBST(PRELINK)
AC_SUBST(CXXWARN)
AC_SUBST(CXXLANG)
AC_SUBST(CXXFLAGS)
AC_SUBST(CPPFLAGS)
AC_SUBST(CWARN)
AC_SUBST(CLANG)
AC_SUBST(CFLAGS)
AC_SUBST(CXX)
AC_SUBST(CC)
AC_SUBST(CXXOPT)
COPT="$CXXOPT"
AC_SUBST(COPT)
# ---------------------------------------------------------------------------
# Checks for Misc. stuff
# ---------------------------------------------------------------------------
LINK_STATIC="-Wl,-Bstatic"
LINK_DYNAMIC="-Wl,-Bdynamic"
AC_ARG_ENABLE(shared,
[ --enable-shared Use shared libraries instead of static for some dependencies.],
LINK_STATIC=""
LINK_DYNAMIC="")
AC_SUBST(LINK_STATIC)
AC_SUBST(LINK_DYNAMIC)
DESTDIR=""
AC_ARG_VAR(DESTDIR, The directory in which the prefix dir is located)
MULBERRY_DIR=".mulberry"
AC_ARG_WITH(mulberry-dir,
[ --with-mulberry-dir Specify location relative to the prefix where mulberry plugins go (default: .mulberry)],
MULBERRY_DIR="$withval")
AC_SUBST(MULBERRY_DIR)
HELP_DIR=".mulberry"
AC_ARG_WITH(help-dir,
[ --with-help-dir Specify location relative to the prefix where mulberry documentation files go (default: .mulberry)],
HELP_DIR="$withval")
AC_SUBST(HELP_DIR)
PROGRAM_DIR=""
AC_ARG_WITH(program-dir,
[ --with-program-dir Specify location relative to the prefix where the mulberry program goes (default: '')],
PROGRAM_DIR="$withval")
AC_SUBST(PROGRAM_DIR)
# ---------------------------------------------------------------------------
# Checks for libs which we will need (fail if not found)
# ---------------------------------------------------------------------------
AC_CHECK_HEADER([esd.h],
,
AC_MSG_ERROR(esd.h not found - mulberry requires esd.)
)
CPPFLAGS_ORG="$CPPFLAGS"
CPPFLAGS="$CXXFLAGS $CPPFLAGS"
AC_CHECK_HEADER([cstdint],
HAS_CSTDINT=1,
HAS_CSTDINT=0
)
if test ${HAS_CSTDINT} = 0; then
AC_CHECK_HEADER([boost/cstdint.hpp],
CPPFLAGS="$CPPFLAGS_ORG"
CPPFLAGS="$CPPFLAGS -I`pwd`/Wrapper_Includes/cstdint",
CPPFLAGS="$CPPFLAGS_ORG"
AC_MSG_ERROR(neither cstdint nor boost/cstdint.hpp found - one from them is required for compiling mulberry.)
)
else
CPPFLAGS="$CPPFLAGS_ORG"
fi
# Checks for LDAP
AC_ARG_WITH(ldap-include,
[ --with-ldap-include Specify location of LDAP headers],
LDAPINC="$withval")
if test -n "$LDAPINC"; then
case $LDAPINC in
-I*)
;;
/*)
LDAPINC=-I$LDAPINC
;;
*)
LDAPINC=-I`pwd`/$LDAPINC
;;
esac
fi
AC_SUBST(LDAPINC)
LDAPLIB="-lldap -llber"
AC_ARG_WITH(ldap-libs,
[ --with-ldap-libs Specify link args for LDAP],
LDAPLIB="$withval")
AC_SUBST(LDAPLIB)
CPPFLAGS_ORG="$CPPFLAGS"
CPPFLAGS="$LDAPINC $CPPFLAGS"
KERBEROS=""
AC_CHECK_HEADER([ldap_cdefs.h],
COMMUNICATOR_ADBK_IO="CommunicatorAdbkIO"
NETSCAPE_ADBK_IO="NetscapeAdbkIO",
AC_MSG_ERROR(ldap_cdefs.h not found - mulberry and CommunicatorAdbkIO and NetscapeAdbkIO plugins require LDAP.)
)
CPPFLAGS="$CPPFLAGS_ORG"
AC_SUBST(COMMUNICATOR_ADBK_IO)
AC_SUBST(NETSCAPE_ADBK_IO)
# Checks for SSL
AC_ARG_WITH(openssl-include,
[ --with-openssl-include Specify location of openssl headers],
SSLINC="$withval")
if test -n "$SSLINC"; then
case $SSLINC in
-I*)
;;
/*)
SSLINC=-I$SSLINC
;;
*)
SSLINC=-I`pwd`/$SSLINC
;;
esac
fi
AC_SUBST(SSLINC)
CPPFLAGS_ORG="$CPPFLAGS"
CPPFLAGS="$SSLINC $CPPFLAGS"
KERBEROS=""
AC_CHECK_HEADER([openssl/ssl.h],
SSL="SSL"
SMIME="SMIME",
AC_MSG_ERROR(openssl/ssl.h not found - mulberry and SMIME and SSL plugins require OpenSSL.)
)
CPPFLAGS="$CPPFLAGS_ORG"
AC_SUBST(SMIME)
AC_SUBST(SSL)
SSLLIB="-lssl -lcrypto"
AC_ARG_WITH(openssl-libs,
[ --with-openssl-libs Specify link args for openssl],
SSLLIB="$withval")
AC_SUBST(SSLLIB)
# ---------------------------------------------------------------------------
# Checks for libs which may or may not be there
# ---------------------------------------------------------------------------
LDFLAGS=""
AC_CHECK_LIB(rt, main, LDFLAGS="$LDFLAGS -lrt")
AC_CHECK_LIB(gen, main, LDFLAGS="$LDFLAGS -lgen")
AC_CHECK_LIB(fontconfig, main, LDFLAGS="$LDFLAGS -lfontconfig")
case $host_os in
*solaris*)
LDFLAGS="$LDFLAGS -nodefaultlibs -lc -lm -lgcc"
SO_LDFLAGS="-nodefaultlibs -lc -lm -lgcc -socket -lresolv"
PROC_NAME="`uname -p`"
;;
*)
SO_LDFLAGS="-lresolv"
PROC_NAME="`uname -m`"
;;
esac
OS_NAME="$host_os"
REL_NAME="`uname -r`"
AC_SUBST(OS_NAME)
AC_SUBST(REL_NAME)
AC_SUBST(PROC_NAME)
AC_CHECK_LIB(resolv, main, LDFLAGS="$LDFLAGS -lresolv")
AC_SUBST(LDFLAGS)
AC_SUBST(SO_LDFLAGS)
# ---------------------------------------------------------------------------
# Checks for KRB4
# ---------------------------------------------------------------------------
AC_ARG_WITH(krb4-include,
[ --with-krb4-include Specify location of kerberos4 headers],
KRB4INC="$withval")
if test -n "$KRB4INC"; then
case $KRB4INC in
-I*)
;;
/*)
KRB4INC=-I$KRB4INC
;;
*)
KRB4INC=-I`pwd`/$KRB4INC
;;
esac
fi
CPPFLAGS_ORG="$CPPFLAGS"
CPPFLAGS="$KRB4INC $CPPFLAGS"
KERBEROS=""
AC_CHECK_HEADER([krb.h],
KERBEROS="Kerberos",
AC_MSG_WARN(krb.h not found - disabling Kerberos (IV) plugin.)
)
CPPFLAGS="$CPPFLAGS_ORG"
KRB4LIB="-lkrb4 -ldes425"
AC_ARG_WITH(krb4-libs,
[ --with-krb4-libs Specify link args for kerberos4],
KRB4LIB="$withval")
AC_SUBST(KRB4INC)
AC_SUBST(KRB4LIB)
AC_SUBST(KERBEROS)
# ---------------------------------------------------------------------------
# Checks for KRB5
# ---------------------------------------------------------------------------
KRB5INC="-I/usr/include/gssapi"
AC_ARG_WITH(krb5-include,
[ --with-krb5-include Specify location of kerberos5 headers],
KRB5INC="$withval")
if test -n "$KRB5INC"; then
case $KRB5INC in
-I*)
;;
/*)
KRB5INC=-I$KRB5INC
;;
*)
KRB5INC=-I`pwd`/$KRB5INC
;;
esac
fi
CPPFLAGS_ORG="$CPPFLAGS"
CPPFLAGS="$KRB5INC $CPPFLAGS"
GSSAPI=""
AC_CHECK_HEADER([gssapi.h],
GSSAPI="GSSAPI",
AC_MSG_WARN(gssapi.h not found - disabling GSSAPI plugin.)
)
CPPFLAGS="$CPPFLAGS_ORG"
KRB5LIB="-lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err"
AC_ARG_WITH(krb5-libs,
[ --with-krb5-libs Specify link args for kerberos5],
KRB5LIB="$withval")
AC_SUBST(KRB5INC)
AC_SUBST(KRB5LIB)
AC_SUBST(GSSAPI)
# ---------------------------------------------------------------------------
# Checks for ASpell
# ---------------------------------------------------------------------------
ASPELLINC=""
AC_ARG_WITH(aspell-include,
[ --with-aspell-include Specify location of aspell headers],
ASPELLINC="$withval")
if test -n "$ASPELLINC"; then
case $ASPELLINC in
-I*)
;;
/*)
ASPELLINC=-I$ASPELLINC
;;
*)
ASPELLINC=-I`pwd`/$ASPELLINC
;;
esac
fi
CPPFLAGS_ORG="$CPPFLAGS"
CPPFLAGS="$ASPELLINC $CPPFLAGS"
ASPELL=""
AC_CHECK_HEADER([aspell.h],
ASPELL="ASpell",
AC_MSG_WARN(aspell.h not found - disabling ASpell plugin.)
)
CPPFLAGS="$CPPFLAGS_ORG"
ASPELLLIB="-dynamic -laspell"
AC_ARG_WITH(aspell-libs,
[ --with-aspell-libs Specify link args for aspell],
ASPELLLIB="$withval")
AC_SUBST(ASPELLINC)
AC_SUBST(ASPELLLIB)
AC_SUBST(ASPELL)
# not used right now, see Libraries/XMLLib/Makefile.in
#AC_ARG_WITH(libxml-include,
# [ --with-libxml-include Specify location of libxml headers],
# XMLINC="$withval")
#CPPFLAGS="$CPPFLAGS -I$XMLINC"
#
#AC_CHECK_HEADER(libxml/parser.h,,
# AC_MSG_ERROR("libxml/parser.h not found."))
# ---------------------------------------------------------------------------
# Almost there...
# ---------------------------------------------------------------------------
test "$prefix" = "NONE" -o "$prefix" = "" && prefix='~'
echo ""
echo "Mulberry binary goes to $DESTDIR$prefix/$PROGRAM_DIR"
echo "Mulberry resources and plugins go to $DESTDIR$prefix/$MULBERRY_DIR"
echo "Mulberry help files go to $DESTDIR$prefix/$HELP_DIR"
echo ""
AC_OUTPUT(Makefile Libraries/Makefile Build/Makefile Sources_Common/Makefile Libraries/CICalendar/Makefile Libraries/vCard/Makefile Libraries/XMLLib/Makefile Linux/Makefile Plug-ins/Makefile Plug-ins/PluginLibrary/Makefile Plug-ins/CRAM-MD5/Makefile Plug-ins/DIGEST-MD5/Makefile Plug-ins/GSSAPI/Makefile Plug-ins/Kerberos/Makefile Plug-ins/CommunicatorAdbkIO/Makefile Plug-ins/Eudora4AdbkIO/Makefile Plug-ins/EudoraAdbkIO/Makefile Plug-ins/NetscapeAdbkIO/Makefile Plug-ins/PineAdbkIO/Makefile Plug-ins/QuickmailAdbkIO/Makefile Plug-ins/vCardAdbkIO/Makefile Plug-ins/ISpell/Makefile Plug-ins/ASpell/Makefile Plug-ins/GPG/Makefile Plug-ins/SMIME/Makefile Plug-ins/SSL/Makefile)