-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.in
754 lines (654 loc) · 23 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
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
dnl Magick IRC Services
dnl
dnl (c) 1997-2003 Preston Elder <[email protected]>
dnl (c) 1998-2003 William King <[email protected]>
dnl
dnl The above copywright may not be removed under any circumstances,
dnl however it may be added to if any modifications are made to this
dnl file. All modified code must be clearly documented and labelled.
dnl
dnl This code is released under the Artistic License v2.0 or better.
dnl The full text of this license should be contained in a file called
dnl COPYING distributed with this code. If this file does not exist,
dnl it may be viewed here: http://www.magick.tm/m2/license.html
dnl
dnl =======================================================================
dnl $Id$
dnl =======================================================================
dnl
dnl For official changes (by the Magick Development Team),please
dnl check the ChangeLog* files that come with this distribution.
dnl
dnl Third Party Changes (please include e-mail address):
dnl
dnl N/A
dnl
dnl =======================================================================
dnl Standard stuff
dnl ==============
AC_INIT(acconfig.h)
AM_INIT_AUTOMAKE(Magick,2.0)
AM_CONFIG_HEADER(include/config.h)
AC_PROG_CC
AC_PROG_CXX
AC_PROG_RANLIB
AM_PROG_GCJ
AC_REQUIRE_CPP
AC_HEADER_TIME
AC_HEADER_STDC
AC_HEADER_STAT
AC_LANG_CPLUSPLUS
AC_CANONICAL_HOST
dnl Test for java.
AC_CHECK_PROG(JAVAC, javac, javac)
AC_CHECK_PROG(JAR, jar, jar)
if test -n "$JAVAC"; then
echo $ECHO_N$ac_n "checking whether Java compiler is sufficient"" ... $ECHO_C$ac_c"
cat >jtest.java <<EOT
import javax.swing.JFormattedTextField;
class jtest extends JFormattedTextField
{
}
EOT
javac jtest.java >/dev/null 2>&1
if test -f jtest.class; then
echo "${ECHO_T}${ac_t}yes"
else
echo "${ECHO_T}${ac_t}no"
JAVAC=""
fi
rm -f jtest.*
fi
dnl Required stuff
dnl ==============
dnl Here is some flags that may need to be changed.
dnl some of these are compiler specific flags, which means
dnl we will probably have to put in some pre-configure script
dnl (ie. build.sh or something) to normalize things ...
dnl Stuff for a later date. Right now, we'll keep it here.
dnl NOTE: CFLAGS = C only, CXXFLAGS = C++ only, CPPFLAGS = both
dnl NOTE: JFLAGS = Java only
dnl Optimisation and Debugging flags
dnl -g3 Increased output to gdb (for macros, etc)
dnl -pg Profiling output for gprof
dnl -dm Output memory stats when compile is done
CPPOPT=""
COPT=""
CXXOPT=""
JOPT="-O -g"
dnl What warnings we will give off
dnl -Wall == -Wno-import -Wchar-subscripts -Wcomment -Wformat
dnl -Wimplicit-int -Wimplicit-function-declaration
dnl -Wimplicit -Wmain -Wmissing-braces -Wmultichar
dnl -Wparentheses -Wsequence-point -Wreturn-type
dnl -Wswitch -Wtrigraphs -Wunused -Wuninitialized
dnl -Wreorder -Wunknown-pragmas
dnl REMOVED: -Wshadow -Wcast-qual -Wconversion -Wcast-align
dnl -Wold-style-cast -Wundef -Wredundant-decls
dnl -Winline -Wtemplate-debugging -Wpacked
dnl -Wtraditional -Wstrict-prototypes
dnl -Wformat-security -Wundef
dnl POSSIBLES: -Wunreachable-code -Wdisabled-optimization
CPPWARN="-W -Wall -Wimport \
-Wpointer-arith -Wsign-compare -Wwrite-strings"
CWARN="-Wbad-function-cast -Wmissing-declarations -Wnested-externs"
CXXWARN="-Woverloaded-virtual -Wsynth -Wno-deprecated"
JWARN=""
CPPFLAGS="$CPPFLAGS $CPPOPT $CPPWARN -I\$(top_srcdir)/include"
CFLAGS="$CPPFLAGS $CFLAGS $COPT $CWARN"
CXXFLAGS="$CPPFLAGS $CXXFLAGS $CXXOPT $CXXWARN"
JFLAGS="$JFLAGS $JOPT $JWARN"
dnl Just incase ace is there, which it often is ...
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib"
dnl ====================================================
dnl First we check if we were GIVEN the location of ACE.
dnl If we were (ie. acelib) we need to add -L<directory>
dnl and -l<file> to the LIBS paramater.
AC_ARG_WITH(acelib, [ --with-acelib=file Location of ACE library file],
[if test -f ${withval}; then
libdir="`dirname ${withval}`"
libfile="`echo \`basename ${withval}\` | \
sed -e s,\^lib,, -e s,\.a$,, -e s,\.so$,, \
-e s,\.sl$,, -e s,\.lib$,, -e s,\.dll$,,`"
if test ! "x$libdir" = "x$libfile"; then
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${libdir}"
export LD_LIBRARY_PATH
LIBS="$LIBS -L${libdir}"
fi
if test ! "x$libfile" = "x"; then
LIBS="$LIBS -l$libfile"
fi
libace=1
echo "checking for $libfile ... (specified) yes"
fi])
dnl Same deal with includes, and adding a -I to the
dnl C/CPP flags
AC_ARG_WITH(aceinc, [ --with-aceinc=dir Location of ACE include files],
[if test -f ${withval}/ace/OS.h; then
CPPFLAGS="$CPPFLAGS -I${withval}"
libacehead=1
echo "checking for ace/OS.h ... (specified) yes"
fi])
dnl ====================================================
dnl First we check to see if we're going to use BSD
dnl threads, because if we are, we need an special
dnl paramater in $LIBS.
AC_ARG_ENABLE(bsdthread, [ --enable-bsdthread Use BSD-style (libc_r) pthreads],
[LIBS="$LIBS -pthread"
libthread=1])
dnl Second we check if we were GIVEN the location of any.
dnl threads implementation.
dnl If we were (ie. threadlib) we need to add -L<directory>
dnl and -l<file> to the LIBS paramater.
AC_ARG_WITH(threadlib, [ --with-threadlib=file Location of threads library file],
[if test -f ${withval}; then
libdir="`dirname ${withval}`"
libfile="`echo \`basename ${withval}\` | \
sed -e s,\^lib,, -e s,\.a$,, -e s,\.so$,, \
-e s,\.sl$,, -e s,\.lib$,, -e s,\.dll$,,`"
if test ! "x$libdir" = "x$libfile"; then
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${libdir}"
export LD_LIBRARY_PATH
LIBS="$LIBS -L${libdir}"
fi
if test ! "x$libfile" = "x"; then
LIBS="$LIBS -l$libfile"
fi
libthread=1
echo "checking for $libfile ... (specified) yes"
fi])
dnl Same deal with includes, and adding a -I to the
dnl C/CPP flags
AC_ARG_WITH(threadinc, [ --with-threadinc=dir Location of threads include files],
[CPPFLAGS="$CPPFLAGS -I${withval}"
libthreadhead=1])
dnl ====================================================
dnl First we check if we were GIVEN the location of ZLIB.
dnl If we were (ie. zlib) we need to add -L<directory>
dnl and -l<file> to the LIBS paramater.
AC_ARG_WITH(zlib, [ --with-zlib=file Location of compression library file],
[if test -f ${withval}; then
libdir="`dirname ${withval}`"
libfile="`echo \`basename ${withval}\` | \
sed -e s,\^lib,, -e s,\.a$,, -e s,\.so$,, \
-e s,\.sl$,, -e s,\.lib$,, -e s,\.dll$,,`"
if test ! "x$libdir" = "x$libfile"; then
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${libdir}"
export LD_LIBRARY_PATH
LIBS="$LIBS -L${libdir}"
fi
if test ! "x$libfile" = "x"; then
LIBS="$LIBS -l$libfile"
fi
libz=1
echo "checking for $libfile ... (specified) yes"
fi])
dnl Same deal with includes, and adding a -I to the
dnl C/CPP flags
AC_ARG_WITH(zinc, [ --with-zinc=dir Location of compression include files],
[if test -f ${withval}/zlib.h; then
CPPFLAGS="$CPPFLAGS -I${withval}"
libzhead=1
ehco "checking for zlib.h ... (specified) yes"
fi])
dnl ====================================================
dnl First we check if we were GIVEN the location of CRYPT.
dnl If we were (ie. crtpt) we need to add -L<directory>
dnl and -l<file> to the LIBS paramater.
AC_ARG_WITH(zlib, [ --with-cryptlib=file Location of crypt library file],
[if test -f ${withval}; then
libdir="`dirname ${withval}`"
libfile="`echo \`basename ${withval}\` | \
sed -e s,\^lib,, -e s,\.a$,, -e s,\.so$,, \
-e s,\.sl$,, -e s,\.lib$,, -e s,\.dll$,,`"
if test ! "x$libdir" = "x$libfile"; then
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${libdir}"
export LD_LIBRARY_PATH
LIBS="$LIBS -L${libdir}"
fi
if test ! "x$libfile" = "x"; then
LIBS="$LIBS -l$libfile"
fi
libcrypt=1
echo "checking for $libfile ... (specified) yes"
fi])
dnl ====================================================
AC_ARG_WITH(locknode, [ --with-locknode=node Nodename to lock binary for],
[BUILD_NODE=${withval}])
AC_ARG_WITH(locktype, [ --with-locktype=type System OS/CPU Type to lock binary for],
[BUILD_TYPE=${withval}])
AC_ARG_WITH(lockrel, [ --with-lockrel=rel OS Release number to lock binary for],
[BUILD_REL=${withval}])
AC_ARG_WITH(libdir, [ --with-libdir=dir Add in search path for libraries],
[LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${withval}"
export LD_LIBRARY_PATH
LIBS="$LIBS -L${withval}"])
AC_ARG_WITH(lib, [ --with-lib=dir Add in library],
[LIBS="$LIBS -l${withval}"])
AC_ARG_WITH(include, [ --with-include=dir Add in search path for includes],
[CPPFLAGS="$CPPFLAGS -I${withval}"])
dnl ====================================================
dnl OK, ACE wasnt specified. See if we can find
dnl it in the LD_LIBRARY_PATH, if not, error out.
if test 0$libace -eq 0; then
AC_CHECK_LIB(ACE, _make_ACE_Naming_Context,
[LIBS="$LIBS -lACE"
libace=1])
fi
if test 0$libace -eq 0; then
echo "
ACE (Adaptive Communications Environment) is an essential
part of Magick II, and is therefore required to compile
and run it. ACE could not be found on your system. If you
have compiled it, please specify the library location with
the option --with-acelib=<lib>. You may also have to specify
where the includes are aswell, which you may do with the
--with-aceinc=<dir> paramater (this should point to your
ACE_wrappers directory, NOT ACE_wrappers/ace).
You may obtain ACE from http://www.cs.wustl.edu/~schmidt/ACE.html"
exit 1
fi
dnl ====================================================
dnl OK, a threads lib wasnt specified. See if we can
dnl find one in the LD_LIBRARY_PATH, if not, error out.
if test 0$libthread -eq 0; then
AC_CHECK_LIB(pthread, pthread_create,
[LIBS="$LIBS -lpthread"
libthread=1])
if test 0$libthread -eq 0; then
AC_CHECK_LIB(pth, pthread_create,
[LIBS="$LIBS -lpth"
libthread=1])
if test 0$libthread -eq 0; then
AC_CHECK_LIB(thread, thread_create,
[LIBS="$LIBS -lthread"
libthread=1])
fi
fi
fi
if test 0$libthread -eq 0; then
echo "
Magick II requires a threads library to exist (and work)
before it will run. You do not have any threads
implementation on your system. If you have, but it just
could not be found, please specify the library location
with the option --with-threadlib=<dir>. You may also
have to specify specify where the includes are aswell,
which you may do with the --with-threadinc=<dir> paramater.
NOTE: BSD threads are internal to libc, and so must pass
the '-pthread' argument to gcc. To specify BSD
threads, use --enable-bsdthread
You may obtain GNU pth from http://www.gnu.org/software/pth"
exit 1
fi
dnl ====================================================
dnl OK, ZLIB wasnt specified. See if we can find
dnl it in the LD_LIBRARY_PATH, if not, error out.
if test 0$libz -eq 0; then
AC_CHECK_LIB(z, inflate,
[LIBS="$LIBS -lz"
libz=1])
if test 0$libz -eq 0; then
AC_CHECK_LIB(gz, inflate,
[LIBS="$LIBS -lgz"
libz=1])
fi
fi
if test 0$libz -eq 0; then
echo "
The Z compression library (zlib) is required to compile and
run Magick II. zlib could not be found on your system. If
you have compiled it, please specify the library location with
the option --with-zlib=<dir>. You may also need to specify
where the includes are aswell, you may do this with the
--with-zinc=<dir> paramater.
You may obtain zlib from
ftp://ftp.freesoftware.com/pub/infozip/zlib/index.html"
exit 1
fi
dnl ====================================================
AC_CHECK_HEADER(kenny, , [echo "Oh my god! you killed kenny!"])
dnl ====================================================
AC_ARG_ENABLE(static, [ --enable-static Create statically linked binaries
--disable-static Create dynamically linked binaries (default)],
[case "${enableval}" in
yes) static=true;;
no) static=false;;
*) AC_MSG_ERROR(bad value ${enableval} for STATIC option);;
esac], [static=false])
if test "$static" = "true" ; then
LDFLAGS="$LDFLAGS -static"
fi
AC_ARG_ENABLE(quick, [ --enable-quick Do not increment build number
--disable-quick Increment build number (default)],
[case "${enableval}" in
yes) quick=true;;
no) quick=false;;
*) AC_MSG_ERROR(bad value ${enableval} for QUICK option);;
esac], [quick=false])
AM_CONDITIONAL(INCREMENT, test x$quick = xfalse)
AC_ARG_ENABLE(test, [ --enable-test Enable test mode (no IRC connectivity)
--disable-test Disable test mode (default)],
[case "${enableval}" in
yes) testmode=true;;
no) testmode=false;;
*) AC_MSG_ERROR(bad value ${enableval} for QUICK option);;
esac], [testmode=false])
if test "$testmode" = "true"; then
AC_DEFINE(TEST_MODE)
fi
AC_ARG_ENABLE(crypt, [ --enable-crypt Add encryption to Magick (default)
--disable-crypt Remove encryption from Magick],
[case "${enableval}" in
yes) crypt=true;;
no) crypt=false;;
*) AC_MSG_ERROR(bad value ${enableval} for CRYPT option);;
esac], [crypt=true])
if test "$crypt" = "true"; then
AC_DEFINE(HASCRYPT)
fi
AC_ARG_ENABLE(jp2-crypt, [ --enable-jp2-crypt Use the JP2 (XOR) for passwords
--disable-jp2-crypt Do not use JP2 (XOR) for passwords (default)],
[case "${enableval}" in
yes) jp2crypt=true;;
no) jp2crypt=false;;
*) AC_MSG_ERROR(bad value ${enableval} for JP2-CRYPT option);;
esac], [jp2crypt=false])
if test "$jp2crypt" = "true"; then
if test "$descrypt" = "true" -o "$md5crypt" = "true"; then
echo "JP2, DES and MD5 password enctyption schemes are mutually exclusive."
exit 1
fi
AC_DEFINE(JP2CRYPT)
fi
AC_ARG_ENABLE(des-crypt, [ --enable-des-crypt Use the DES form of the crypt() system call
--disable-des-crypt Do not use the crypt() system call (default)],
[case "${enableval}" in
yes) descrypt=true;;
no) descrypt=false;;
*) AC_MSG_ERROR(bad value ${enableval} for DES-CRYPT option);;
esac], [descrypt=false])
if test "$descrypt" = "true"; then
if test "$jp2crypt" = "true" -o "$md5crypt" = "true"; then
echo "JP2, DES and MD5 password enctyption schemes are mutually exclusive."
exit 1
fi
AC_DEFINE(DESCRYPT)
fi
AC_ARG_ENABLE(md5-crypt, [ --enable-md5-crypt Use the MD5 form of the crypt() system call
--disable-md5-crypt Do not use the crypt() system call (default)],
[case "${enableval}" in
yes) md5crypt=true;;
no) md5crypt=false;;
*) AC_MSG_ERROR(bad value ${enableval} for DES-CRYPT option);;
esac], [md5crypt=false])
if test "$md5crypt" = "true"; then
if test "$jp2crypt" = "true" -o "$descrypt" = "true"; then
echo "JP2, DES and MD5 password enctyption schemes are mutually exclusive."
exit 1
fi
AC_DEFINE(MD5CRYPT)
fi
AC_ARG_ENABLE(trace, [ --enable-trace Enable TRACE code (code bloat)
--disable-trace Disable TRACE code (default)],
[case "${enableval}" in
yes) trace=true;;
no) trace=false;;
*) AC_MSG_ERROR(bad value ${enableval} for TRACE option);;
esac], [trace=false])
if test "$trace" = "true"; then
AC_DEFINE(MAGICK_TRACE_WORKS)
fi
AC_ARG_ENABLE(convert, [ --enable-convert Enable DB CONVERSION code
--disable-convert Disable DB CONVERSION code (default)],
[case "${enableval}" in
yes) convert=true;;
no) convert=false;;
*) AC_MSG_ERROR(bad value ${enableval} for CONVERT option);;
esac], [convert=false])
if test "$convert" = "true"; then
AC_DEFINE(CONVERT)
fi
AM_CONDITIONAL(CONVERT, test x$convert = xtrue)
AC_ARG_ENABLE(getpass, [ --enable-getpass Enable GETPASS
--disable-getpass Disable GETPASS (default)],
[case "${enableval}" in
yes) getpass=true;;
no) getpass=false;;
*) AC_MSG_ERROR(bad value ${enableval} for GETPASS option);;
esac], [getpass=false])
if test "$getpass" = "true"; then
if test "$jp2crypt" = "true" -o "$descrypt" = "true" -o "$md5crypt" = "true"; then
echo "JP2, DES and MD5 password enctyption schemes do not make sense with GETPASS."
exit 1
fi
AC_DEFINE(GETPASS)
fi
AC_ARG_ENABLE(locks, [ --enable-locks Enable thread locking (default)
--disable-locks Disable thread locking (dangerous!)],
[case "${enableval}" in
yes) locks=true;;
no) locks=false;;
*) AC_MSG_ERROR(bad value ${enableval} for LOCKS option);;
esac], [locks=true])
if test "$locks" = "true"; then
AC_DEFINE(MAGICK_LOCKS_WORK)
fi
AC_ARG_ENABLE(hostlock, [ --enable-hostlock Enable binary locking to a host (default)
--disable-hostlock Disable binary locking to a host],
[case "${enableval}" in
yes) hostlock=true;;
no) hostlock=false;;
*) AC_MSG_ERROR(bad value ${enableval} for HOSTLOCK option);;
esac], [hostlock=true])
echo $ECHO_N$ac_n "configuring system lock paramaters"" ... $ECHO_C$ac_c"
if test "$hostlock" = "true"; then
if test -z "$BUILD_NODE" -o -z "$BUILD_TYPE" -o -z "$BUILD_REL"; then
if test -f ace_uname.cpp; then
$CXX $LIBS $CPPFLAGS -o ace_uname ace_uname.cpp >/dev/null 2>&1
if test -x ace_uname; then
if test -z "$BUILD_NODE"; then
BUILD_NODE="`./ace_uname nodename`"
fi
if test -z "$BUILD_TYPE"; then
BUILD_TYPE="`./ace_uname sysname`/`./ace_uname machine`"
fi
if test -z "$BUILD_REL"; then
BUILD_REL="`./ace_uname release`"
fi
rm -f ace_uname
fi
fi
fi
if test -n "$BUILD_NODE" -a -n "$BUILD_TYPE" -a -n "$BUILD_REL"; then
echo "${ECHO_T}${ac_t}done"
AM_CONDITIONAL(STAMPED, test 1)
CPPFLAGS="$CPPFLAGS -DBUILD_NODE=\"\\\"$BUILD_NODE\\\"\" \
-DBUILD_TYPE=\"\\\"$BUILD_TYPE\\\"\" \
-DBUILD_REL=\"\\\"$BUILD_REL\\\"\""
else
echo "${ECHO_T}${ac_t}not done"
AM_CONDITIONAL(STAMPED, test 0)
unset BUILD_NODE BUILD_TYPE BUILD_REL
fi
else
echo "${ECHO_T}${ac_t}not done"
AM_CONDITIONAL(STAMPED, test 0)
unset BUILD_NODE BUILD_TYPE BUILD_REL
fi
AC_ARG_ENABLE(mpatrol, [ --enable-mpatrol Enable mpatrol (memory debug)
--disable-mpatrol Disable mpatrol (default)],
[case "${enableval}" in
yes) mpatrol=true;;
no) mpatrol=false;;
*) AC_MSG_ERROR(bad value ${enableval} for MPATROL option);;
esac], [mpatrol=false])
if test "$mpatrol" = "true"; then
AC_DEFINE(MAGICK_USE_MPATROL)
LIBS="$LIBS -lmpatrolmt -lbfd -liberty"
fi
AC_ARG_ENABLE(efence, [ --enable-efence Enable Electric Fence (memory debug)
--disable-efence Disable Electric Fence (default)],
[case "${enableval}" in
yes) efence=true;;
no) efence=false;;
*) AC_MSG_ERROR(bad value ${enableval} for EFENCE option);;
esac], [efence=false])
if test "$efence" = "true"; then
AC_DEFINE(MAGICK_USE_EFENCE)
LIBS="$LIBS -lefence"
fi
if true; then
AC_DEFINE(HAVE_RETURN_VOID)
AC_DEFINE(HAVE_MEM_FUN_CONST)
else
AC_DEFINE(HAVE_MEM_FUN1)
fi
dnl ====================================================
dnl OK, CRYPTLIB wasnt specified. See if we can find
dnl it in the LD_LIBRARY_PATH, if not, error out.
if test "$descrypt" = true -o "$md5crypt" = true; then
if test 0$libcrypt -eq 0; then
AC_CHECK_LIB(c, crypt,
[libcrypt=1])
if test 0$libcrypt -eq 0; then
AC_CHECK_LIB(crypt, crypt,
[LIBS="$LIBS -lcrypt"
libcrypt=1])
fi
fi
if test 0$libcrypt -eq 0; then
echo "
No library could be found containing the crypt() system
call, however you have specified you wish to use it for
encryption of passwords in Magick (via. the
--enable-des-crypt or --enable-md5-crypt options). If
you do indeed have a library containing the crypt() system
call, please specify the library location with the option
--with-zlib=<dir>."
exit 1
fi
AC_CHECK_HEADERS(crypt.h)
fi
dnl ====================================================
if test 0$libacehead -eq 0; then
O_CPPFLAGS="${CPPFLAGS}"
CPPFLAGS="${CPPFLAGS} ${CXXFLAGS}"
AC_CHECK_HEADER(ace/OS.h, [libacehead=1])
CPPFLAGS="${O_CPPFLAGS}"
fi
if test 0$libacehead -eq 0; then
echo "
The ACE library has been found, however you must specify
the location of its header files with the --with-aceinc
paramater (this should point to your ACE_wrappers directory,
NOT ACE_wrappers/ace)."
exit 1
fi
if test 0$libthreadhead -eq 0; then
AC_CHECK_HEADER(pthread.h, [libthreadhead=1])
if test 0$libthreadhead -eq 0; then
AC_CHECK_HEADER(pthreads.h, [libthreadhead=1])
if test 0$libthreadhead -eq 0; then
AC_CHECK_HEADER(thread.h, [libthreadhead=1])
fi
fi
fi
if test 0$libacehead -eq 0; then
echo "
A threads library has been found, however you must specify
the location of its header files with the --with-threadinc
paramater."
exit 1
fi
if test 0$libzhead -eq 0; then
AC_CHECK_HEADER(zlib.h, [libzhead=1])
fi
if test 0$libacehead -eq 0; then
echo "
The Z library has been found, however you must specify the
location of its header files with the --with-zinc paramater."
exit 1
fi
dnl Find out which to use for C headers ...
AC_CHECK_HEADERS(mpatrol.h)
AC_CHECK_HEADERS(termio.h)
AC_CHECK_HEADERS(stl_config.h)
AC_CHECK_HEADERS(bits/stl_config.h)
dnl Find out which to use for C++ headers ...
AC_CHECK_HEADERS(exception)
AC_CHECK_HEADERS(list)
AC_CHECK_HEADERS(ext/hash_map)
AC_CHECK_HEADERS(ext/hash_map.h)
AC_CHECK_HEADERS(hash_map)
AC_CHECK_HEADERS(hash_map.h)
AC_CHECK_HEADERS(map)
AC_CHECK_HEADERS(queue)
AC_CHECK_HEADERS(stack)
AC_CHECK_HEADERS(set)
AC_CHECK_HEADERS(algorithm)
AC_CHECK_HEADERS(numeric)
AC_CHECK_HEADERS(string)
AC_CHECK_HEADERS(utility)
AC_CHECK_HEADERS(vector)
dnl Find out which functions we must provide ...
AC_CHECK_FUNCS(itoa)
AC_CHECK_FUNCS(ltoa)
AC_CHECK_FUNCS(ftoa)
AC_CHECK_FUNCS(dtoa)
AC_CHECK_FUNCS(ultoa)
AC_CHECK_FUNCS(uitoa)
AC_CHECK_FUNCS(snprintf)
AC_CHECK_FUNCS(vsnprintf)
AC_CHECK_FUNCS(_snprintf)
AC_CHECK_FUNCS(_vsnprintf)
dnl Find out which types we must provide ...
dnl AC_CHECK_TYPES(bool)
echo $ECHO_N$ac_n "checking for bool"" ... $ECHO_C$ac_c"
cat >.conftest.cpp <<EOT
int main()
{
bool test = false;
test = true;
return 0;
}
EOT
$CXX -o .conftest .conftest.cpp >/dev/null 2>&1
if test -f .conftest; then
AC_DEFINE(HAVE_BOOL)
echo "${ECHO_T}${ac_t}yes"
else
echo "${ECHO_T}${ac_t}no"
fi
rm -f .conftest*
dnl ====================================================
dnl Work out how big our maximum key size is, and create the stamp tokens
cat >.max_keylen.c <<EOF
#include <stdio.h>
#include "include/crypt/blowfish.h"
#define BUF_SZ ((BF_ROUNDS+2)*4)
int main() {
char *p, *out = (char *) malloc(BUF_SZ + 1);
if (out == NULL)
return 0;
p = out + BUF_SZ;
*p = 0;
memset(out, '.', BUF_SZ);
sprintf(out, "| Magick II Key Stamp X");
p = out + strlen(out);
*p = ' ';
p = out + strlen(out) - 2;
*p = ' ';
p++;
*p = '|';
printf("%s", out);
free(out);
return strlen(out); }
EOF
$CC -I. -o .max_keylen .max_keylen.c 2>/dev/null
str="`echo \`./.max_keylen\` | sed -e s/X/1/`"
AC_DEFINE_UNQUOTED(CRYPTO_KEY1, "$str")
str="`echo \`./.max_keylen\` | sed -e s/X/2/`"
AC_DEFINE_UNQUOTED(CRYPTO_KEY2, "$str")
rm -f .max_keylen*
AC_OUTPUT(Makefile src/Makefile gui/Makefile docs/Makefile docs/en/Makefile ircd/Makefile src/crypt/Makefile src/xml/Makefile src/convert/Makefile include/Makefile include/crypt/Makefile include/xml/Makefile include/convert/Makefile docs/man/Makefile lang/Makefile)