ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/ermyth/configure.ac
Revision: 1.8
Committed: Tue Aug 28 17:08:06 2007 UTC (16 years, 8 months ago) by pippijn
Branch: MAIN
Changes since 1.7: +35 -45 lines
Log Message:
- changed name
- updated the example config to the new system
- added more documentation
- enhanced documentation generators
- added a link to the pdf to the website
- added an RSS feed generator
- transitioned hooks to c++ callbacks
- did various merges with upstream along the way
- added const where appropriate
- removed the old block allocator
- fixed most memory leaks
- transitioned some dictionaries to std::map
- transitioned some lists to std::vector
- made some free functions members where appropriate
- renamed string to dynstr and added a static string ststr
- use NOW instead of time (NULL) if possible
- completely reworked database backends, crypto handlers and protocol handlers
  to use an object factory
- removed the old module system. ermyth does not do any dynamic loading anymore
- fixed most of the build system
- reworked how protocol commands work

File Contents

# Content
1 dnl Copyright © 2007 Pippijn van Steenhoven / The Ermyth Team
2 dnl Copyright © 2005 Atheme Development Group
3 dnl Rights to this code are documented in doc/pod/license.pod.
4 dnl
5 dnl $Id: configure.ac,v 1.7 2007-07-25 01:05:17 pippijn Exp $
6
7 dnl Process this file with autoconf to produce a configure script.
8
9 AC_PREREQ(2.59)
10 AC_INIT([ermyth], [2.3], [ermyth@one09.net])
11 AC_CONFIG_HEADER(include/sysconf.h)
12 AC_CONFIG_AUX_DIR(autoconf)
13
14 AC_COPYRIGHT([$Id: configure.ac,v 1.7 2007-07-25 01:05:17 pippijn Exp $])
15
16 AC_PREFIX_DEFAULT(~/PACKAGE)
17
18 dnl Automake compatibility.
19 AC_SUBST([PACKAGE], [AC_PACKAGE_TARNAME])
20 AC_SUBST([VERSION], [AC_PACKAGE_VERSION])
21
22 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
23 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])
24
25 dnl
26 dnl Look for programs
27 dnl
28
29 AC_PATH_PROG(RM, rm)
30 AC_PATH_PROG(MV, mv)
31 AC_PATH_PROG(CP, cp)
32 AC_PATH_PROG(LN, ln)
33 AC_PATH_PROG(TAR, tar)
34 AC_PATH_PROG(AR, ar)
35 AC_PATH_PROG(RANLIB, ranlib)
36
37 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
38
39 AC_MSG_CHECKING(glib >= 2.10)
40 if $PKG_CONFIG glib-2.0 --atleast-version 2.10; then
41 CXXFLAGS="$CXXFLAGS `$PKG_CONFIG glib-2.0 --cflags`"
42 LIBS="$LIBS `$PKG_CONFIG glib-2.0 --libs`"
43 AC_MSG_RESULT(ok)
44 else
45 AC_MSG_ERROR(no)
46 fi
47
48 AC_PATH_PROG(PERL, perl5.8)
49 if test -z "$PERL"; then
50 AC_PATH_PROG(PERL, perl5)
51 if test -z "$PERL"; then
52 AC_PATH_PROG(PERL, perl)
53 if test -z "$PERL"; then
54 AC_MSG_ERROR([perl 5.8 or higher must be in your PATH, check the README])
55 fi
56 fi
57 fi
58
59 dnl
60 dnl Source generation
61 dnl
62
63 dnl CALLBACKS=`$PERL $srcdir/include/common/gencallbacks.pl 7`
64 dnl AC_SUBST(CALLBACKS)
65
66 dnl
67 dnl GNU gettext
68 dnl
69
70 AM_GNU_GETTEXT([external])
71 AM_GNU_GETTEXT_VERSION([0.16.1])
72
73 if test "$prefix" = "NONE"; then
74 prefix="${ac_default_prefix}"
75 fi
76
77 LOCALEDIR='${datadir}/locale'
78 AC_SUBST(LOCALEDIR)
79
80 dnl
81 dnl Language specific checks
82 dnl
83
84 AC_LANG(C++)
85 AC_PROG_CXX
86 AC_PROG_INSTALL
87 AC_EXEEXT
88 AC_PROG_MAKE_SET
89
90 MKDEP="$CXX -MM"
91
92 AC_SUBST(MKDEP)
93
94 AC_CHECK_SIZEOF(void *,4)
95 AC_CHECK_SIZEOF(char, 4)
96 AC_CHECK_SIZEOF(int, 4)
97 AC_CHECK_SIZEOF(short, 2)
98 AC_CHECK_SIZEOF(float, 4)
99 AC_CHECK_SIZEOF(double, 8)
100 AC_CHECK_SIZEOF(long double, 0)
101 AC_CHECK_SIZEOF(long, 4)
102 AC_CHECK_SIZEOF(long long, 0)
103 AC_CHECK_SIZEOF(time_t, 4)
104 AC_CHECK_SIZEOF(size_t, 4)
105
106 dnl
107 dnl Checks for header files.
108 dnl
109
110 AC_CHECK_HEADERS(getopt.h link.h valgrind/memcheck.h)
111 AC_CHECK_HEADER(tr1/unordered_map, [], [AC_MSG_ERROR([Your compiler must support the Library Technical Report 1 extensions.])])
112
113 AC_DEFINE(_REENTRANT, [1], [Define this])
114
115 #--------------------------------------------------
116 # AC_ARG_WITH(boost,
117 # AC_HELP_STRING([--with-boost=DIR],[location of boost distribution]),
118 # [
119 # CPPFLAGS="$CPPFLAGS -I${withval}"
120 # ],
121 # [
122 # BOOSTDIR="`pwd`/../boost_1_34_0"
123 # if test -d "${BOOSTDIR}"; then
124 # CPPFLAGS="$CPPFLAGS -I${BOOSTDIR}"
125 # else
126 # BOOSTDIR="`pwd`/../boost_1_33_1"
127 # if test -d "${BOOSTDIR}"; then
128 # CPPFLAGS="$CPPFLAGS -I${BOOSTDIR}"
129 # else
130 # BOOSTDIR="`pwd`/../boost_1_33_0"
131 # if test -d "${BOOSTDIR}"; then
132 # CPPFLAGS="$CPPFLAGS -I${BOOSTDIR}"
133 # fi
134 # fi
135 # fi
136 # ])
137 #
138 # AC_CHECK_HEADER([boost/noncopyable.hpp],,
139 # [
140 # echo "Can't find boost headers. Please check the location of the boost"
141 # echo "distribution and rerun configure using the --with-boost=DIR option."
142 # exit 1
143 # ],[])
144 #
145 # AC_CHECK_HEADER([boost/date_time/posix_time/posix_time_types.hpp],,
146 # [
147 # echo "Can't find boost date-time headers. Please check the location of the boost"
148 # echo "distribution and rerun configure using the --with-boost=DIR option."
149 # exit 1
150 # ],[])
151 #
152 # AC_CHECK_HEADER([boost/regex.hpp],,
153 # [
154 # echo "Can't find boost regular expressions headers. Please check the location of the boost"
155 # echo "distribution and rerun configure using the --with-boost=DIR option."
156 # exit 1
157 # ],[])
158 #
159 # AC_CHECK_HEADER([boost/thread.hpp],,
160 # [
161 # echo "Can't find boost threads headers. Please check the location of the boost"
162 # echo "distribution and rerun configure using the --with-boost=DIR option."
163 # exit 1
164 # ],[])
165 #
166 #
167 #--------------------------------------------------
168 echo
169 echo "Library functions"
170 echo
171 #--------------------------------------------------
172 #
173 # AC_CHECK_LIB(boost_thread, _init,,
174 # AC_MSG_ERROR([$PACKAGE requires boost threads to be installed to work.
175 # Download Boost at http://www.boost.org/
176 # ]))
177 # LIBS="$LIBS -lboost_thread"
178 #
179 # AC_CHECK_LIB(boost_regex, _init,,
180 # AC_MSG_ERROR([$PACKAGE requires boost regex to be installed to work.
181 # Download Boost at http://www.boost.org/
182 # ]))
183 # LIBS="$LIBS -lboost_regex"
184 #
185 # AC_CHECK_LIB(boost_date_time, _init,,
186 # AC_MSG_ERROR([$PACKAGE requires boost date and time to be installed to work.
187 # Download Boost at http://www.boost.org/
188 # ]))
189 # LIBS="$LIBS -lboost_date_time"
190 #--------------------------------------------------
191
192
193 dnl Checks for library functions.
194 AC_TYPE_SIGNAL
195 AC_CHECK_FUNCS([strlcpy strlcat gettimeofday umask mmap arc4random getrlimit fork getpid execve strcasestr])
196 AC_CHECK_FUNC(gethostbyname,, AC_CHECK_LIB(nsl, gethostbyname))
197 AC_CHECK_FUNC(select, SOCKET_ENGINE="select",)
198 AC_CHECK_FUNC(poll, SOCKET_ENGINE="poll",)
199
200 POSIX_CRYPTC=""
201 AC_CHECK_LIB(crypt, crypt, [
202 POSIX_CRYPTC="posix.C"
203 LIBS="$LIBS -lcrypt"
204 ])
205
206 AC_MSG_CHECKING(for libresolv)
207 AC_TRY_LINK([
208 #include <netinet/in.h>
209 #include <arpa/nameser.h>
210 #include <resolv.h>
211 ],[
212 res_init ();
213 ],[resolv_link=yes],[resolv_link=no])
214 if test x$resolv_link = xyes; then
215 AC_MSG_RESULT(ok)
216 AC_DEFINE(HAVE_LIBRESOLV, 1, Define if you have libresolv)
217 LIBS="$LIBS -lresolv"
218 else
219 AC_MSG_RESULT([no, unable to link])
220 fi
221
222 AC_MSG_CHECKING(for $PERL suitability)
223 if $PERL -MExtUtils::Embed -e "use v5.8" >/dev/null 2>&1; then
224 save_CXXFLAGS="$CXXFLAGS"
225 save_LIBS="$LIBS"
226 xPERLFLAGS="`$PERL -MExtUtils::Embed -e ccopts`"
227 CXXFLAGS="$CXXFLAGS $xPERLFLAGS"
228 LIBS="$LIBS `$PERL -MExtUtils::Embed -e ldopts`"
229 AC_TRY_LINK([
230 #include <EXTERN.h>
231 #include <perl.h>
232 #include <XSUB.h>
233 ],[
234 PerlInterpreter *perl = perl_alloc ();
235 ],[perl_link=yes],[perl_link=no])
236 CXXFLAGS="$save_CXXFLAGS"
237 LIBS="$save_LIBS"
238
239 if test x$perl_link = xyes; then
240 AC_MSG_RESULT(ok)
241 AC_DEFINE(ENABLE_PERL, 1, Define if you can embed a perl interpreter)
242 PERLFLAGS="$xPERLFLAGS"
243 PERLLIB="`$PERL -MExtUtils::Embed -e ldopts`"
244 PERLPRIVLIBEXP="`$PERL -MConfig -e 'print $Config{privlibexp}'`"
245 CPPFLAGS="$CPPFLAGS $PERLFLAGS"
246 HAVE_PERL="yes"
247 else
248 AC_MSG_RESULT([no, unable to link])
249 HAVE_PERL="no"
250 fi
251 else
252 AC_MSG_RESULT([no working perl found, or perl not version >= 5.8])
253 HAVE_PERL="no"
254 fi
255
256 AC_SUBST(PERLLIB)
257 AC_SUBST(PERLFLAGS)
258 AC_SUBST(PERLPRIVLIBEXP)
259 AC_SUBST(PERL)
260 AC_SUBST(HAVE_PERL)
261 AC_SUBST(SOCKET_ENGINE)
262 AC_SUBST(POSIX_CRYPTC)
263
264 echo
265 echo "Tweaks"
266 echo
267
268 DOCDIR='${prefix}/doc'
269 MODDIR='${exec_prefix}'
270 SHAREDIR='${prefix}'
271 LOGDIR='${prefix}/var'
272 DATADIR='${prefix}/etc'
273 RUNDIR='${prefix}/var'
274
275 dnl
276 dnl Verbose makefiles
277 dnl
278
279 SILENT="yes"
280 AC_MSG_CHECKING(if you want verbose makefiles)
281 AC_ARG_ENABLE(verbose-make,
282 AC_HELP_STRING([--enable-verbose-make],[ Use verbose makefiles.]), [SILENT="$enableval"])
283 AC_MSG_RESULT($enableval)
284
285 if test "$SILENT" = no; then
286 SILENT=""
287 else
288 SILENT="-s"
289 fi
290
291 AC_SUBST(SILENT)
292
293
294 dnl
295 dnl Absolute paths
296 dnl
297
298 abspaths="no"
299 AC_MSG_CHECKING(if you want to use absolute paths when building)
300 AC_ARG_ENABLE(absolute-paths,
301 AC_HELP_STRING([--enable-absolute-paths],[ Use absolute paths when building.]), [abspaths="$enableval"])
302 AC_MSG_RESULT($abspaths)
303
304 ABSPATHS="#"
305 if test "$abspaths" = yes; then
306 ABSPATHS=""
307 case "$srcdir" in
308 /*)
309 ;;
310 *)
311 srcdir="`cd \"$srcdir\";pwd`"
312 ;;
313 esac
314 fi
315 SRCDIR="$srcdir"
316
317 AC_SUBST(ABSPATHS)
318 AC_SUBST(SRCDIR)
319
320 dnl
321 dnl Filesystem Hierarchy Standard
322 dnl
323
324 FHSPATHS="no"
325 AC_MSG_CHECKING(if you want FHS-like pathnames)
326 AC_ARG_ENABLE(fhs-paths,
327 AC_HELP_STRING([--enable-fhs-paths],[ Use more FHS-like pathnames (for packagers).]),
328 [
329 case "$enableval" in
330 yes)
331 FHSPATHS="yes"
332 DOCDIR='${datadir}/doc/$PACKAGE'
333 MODDIR='${libdir}/$PACKAGE'
334 SHAREDIR='${datadir}/$PACKAGE'
335 LOGDIR='${localstatedir}/log/$PACKAGE'
336 DATADIR='${localstatedir}/lib/$PACKAGE'
337 RUNDIR='${localstatedir}/run/$PACKAGE'
338 ;;
339 no)
340 FHSPATHS="no"
341 ;;
342 esac
343 ])
344 AC_MSG_RESULT($FHSPATHS)
345 AC_SUBST(DOCDIR)
346 AC_SUBST(MODDIR)
347 AC_SUBST(SHAREDIR)
348 AC_SUBST(DATADIR)
349 AC_SUBST(LOGDIR)
350 AC_SUBST(RUNDIR)
351
352 dnl
353 dnl Large network support
354 dnl
355
356 LARGENET="no"
357 AC_MSG_CHECKING(if you want large network support)
358 AC_ARG_ENABLE(large-net,
359 AC_HELP_STRING([--enable-large-net],[ Enable large network support.]),
360 [
361 case "$enableval" in
362 yes)
363 LARGENET="yes"
364 AC_DEFINE([LARGE_NETWORK], 1, [Uncomment to enable large network support.])
365 ;;
366 no)
367 LARGENET="no"
368 ;;
369 esac
370 ])
371 AC_MSG_RESULT($LARGENET)
372
373 dnl
374 dnl Slab/Block allocator
375 dnl
376
377 balloc="no"
378 AC_MSG_CHECKING(if you want to use the block allocator)
379 AC_ARG_ENABLE(balloc,
380 AC_HELP_STRING([--disable-balloc],[Disable the block allocator.]), [balloc=$enableval], [balloc=yes])
381
382 if test "$balloc" = no; then
383 AC_DEFINE([NOBALLOC], 1, [Define to 1 if you wish to disable the block allocator.])
384 fi
385 AC_MSG_RESULT($balloc)
386
387 dnl
388 dnl Platform specific stuff
389 dnl
390
391 WINDOWS=no
392 case $host in
393 *-*-linux*)
394 CXXFLAGS="$CXXFLAGS -pthread"
395 LDFLAGS="$LDFLAGS -pthread"
396 ;;
397 *-*-solaris*)
398 if test "$GXX" = yes; then
399 CXXFLAGS="$CXXFLAGS"
400 else
401 # We'll assume Sun's CC.
402 CXXFLAGS="$CXXFLAGS -mt"
403 fi
404 LIBS="$LIBS -lsocket -lnsl -lpthread"
405 ;;
406 *-*-mingw32*)
407 CXXFLAGS="$CXXFLAGS -mthreads"
408 LDFLAGS="$LDFLAGS -mthreads"
409 LIBS="$LIBS -lws2_32 -lmswsock"
410 WINDOWS=yes
411 ;;
412 *-pc-cygwin*)
413 CXXFLAGS="$CXXFLAGS -D__USE_W32_SOCKETS -D_WIN32_WINNT=0x0500"
414 LIBS="$LIBS -lws2_32 -lmswsock"
415 WINDOWS=yes
416 ;;
417 *-apple-darwin*)
418 CXXFLAGS="$CXXFLAGS"
419 LDFLAGS="$LDFLAGS"
420 ;;
421 *-*-freebsd*)
422 CXXFLAGS="$CXXFLAGS -pthread"
423 LDFLAGS="$LDFLAGS -pthread"
424 ;;
425 esac
426
427 if test "$GXX" = yes; then
428 CXXFLAGS="$CXXFLAGS -ftemplate-depth-256"
429 fi
430
431 echo
432 echo "OpenSSL-based SASL support"
433 echo
434
435 AC_ARG_ENABLE(ssl,
436 AC_HELP_STRING([--disable-ssl], [don't use OpenSSL to provide more SASL mechanisms]),
437 ,
438 enable_ssl=yes
439 )
440
441 SSL=no
442 if test "$enable_ssl" = "yes"; then
443 AC_CHECK_LIB(ssl, SSL_read, [
444 AC_CHECK_HEADERS(openssl/ssl.h openssl/err.h, [
445 SSL_LIBS="-lssl -lcrypto"
446 AC_SUBST(SSL_LIBS)
447 SSL=yes
448 ])
449 ], , -lcrypto)
450 if test "$SSL" = "yes"; then
451 AC_DEFINE(HAVE_OPENSSL,, Define to 1 if openssl is available)
452 LIBS="$LIBS $SSL_LIBS"
453 fi
454 fi
455
456 AC_ARG_WITH(openssl,
457 AC_HELP_STRING([--with-openssl=DIR],[location of openssl]),
458 [
459 CPPFLAGS="$CPPFLAGS -I${withval}"
460 ],[])
461
462 AC_CHECK_HEADER([openssl/ssl.h],,
463 [
464 OPENSSL_FOUND=no
465 ],[])
466
467 AM_CONDITIONAL(HAVE_OPENSSL,test x$OPENSSL_FOUND != xno)
468
469 echo
470 echo "Module support"
471 echo
472
473 dynamic_loading="yes"
474
475 if test "$dynamic_loading" = yes; then
476 # The GNU linker requires the -export-dynamic option to make
477 # all symbols visible in the dynamic symbol table.
478 hold_ldflags=$LDFLAGS
479 AC_MSG_CHECKING(for the ld -export-dynamic flag)
480 LDFLAGS="${LDFLAGS} -Wl,-export-dynamic"
481 AC_LINK_IFELSE(AC_LANG_PROGRAM([],[int i;]), found=yes, found=no)
482 LDFLAGS=$hold_ldflags
483
484 if expr "`uname -s`" : ^IRIX >/dev/null 2>&1; then
485 found="no, IRIX ld uses -B,dynamic"
486 LDFLAGS="${LDFLAGS} -Wl,-B,dynamic"
487 fi
488
489 AC_MSG_RESULT($found)
490
491 if test "$found" = yes; then
492 LDFLAGS="${LDFLAGS} -Wl,-export-dynamic"
493 fi
494
495 if test "$ac_cv_c_compiler_gnu" = yes; then
496 AC_MSG_CHECKING(if $CXX is Apple GCC)
497 if expr "`$CXX -v 2>&1 | tail -n 1`" : ".*Apple" >/dev/null; then
498 AppleGCC=yes
499 else
500 AppleGCC=no
501 fi
502
503 AC_MSG_RESULT($AppleGCC)
504 fi
505
506 AC_MSG_CHECKING(for compiler option to produce PIC)
507
508 PICFLAGS="-fPIC -DPIC -shared" # XXX: default?
509 if test "$SGS" = "yes"; then
510 AC_MSG_RESULT([SVR4 SGS interfaces: -KPIC -DPIC -G])
511 PICFLAGS="-KPIC -DPIC -G"
512 fi
513
514 if test "$AppleGCC" = "yes"; then
515 AC_MSG_RESULT([Darwin Mach-O bundles: -fno-common -bundle -flat_namespace -undefined suppress])
516 PICFLAGS="-fno-common -bundle -flat_namespace -undefined suppress"
517 fi
518
519 if test "$HPUX" = "yes" -a "$CXX" != g++; then
520 AC_MSG_RESULT(HP-UX cc: +z -r -q -n)
521 PICFLAGS="+z -r -q -n -c"
522 AC_MSG_CHECKING([if +ESfic is required on this platform])
523
524 if expr "`$CXX +ESfic 2>&1`" : ".*neither supported.*" >/dev/null; then
525 AC_MSG_RESULT(no)
526 else
527 AC_MSG_RESULT(yes)
528 PICFLAGS="$PICFLAGS +ESfic"
529 fi
530
531 LDFLAGS="${LDFLAGS} -Wl,-E"
532 fi
533
534 if test "$Tru" = yes -a "$CXX" != g++; then
535 AC_MSG_RESULT([Tru64: -shared -expect_unresolved '*'])
536 PICFLAGS="-shared -expect_unresolved '*' "
537 LDFLAGS="-call_shared"
538 fi
539
540 if test "$CXX" = icc -a "$ICC" = yes; then
541 AC_MSG_RESULT(intel: -fPIC -DPIC -shared)
542 PICFLAGS="-fPIC -DPIC -shared"
543 fi
544
545 if test -z "$PICFLAGS"; then
546 if test "$ac_cv_c_compiler_gnu" = "yes"; then
547 AC_MSG_RESULT(g++: -fPIC -DPIC -shared)
548 PICFLAGS="-fPIC -DPIC -shared"
549 else
550 AC_MSG_RESULT(no)
551 AC_ERROR([your compiler is unable to compile $PACKAGE's modules.])
552 fi
553 fi
554 fi
555
556 AC_SUBST(PICFLAGS)
557
558 AC_ARG_ENABLE(warnings,
559 AC_HELP_STRING([--enable-warnings],[ Enable compiler warnings]),
560 [
561
562 echo " "
563 echo "Compiler warnings"
564 echo " "
565
566 dnl See what warnings we can get away with
567 ERMYTH_C_GCC_TRY_FLAGS([-Wall], ermyth_cv_c_gcc_w_all)
568 ERMYTH_C_GCC_TRY_FLAGS([-Wpointer-arith], ermyth_cv_c_gcc_w_pointer_arith)
569 ERMYTH_C_GCC_TRY_FLAGS([-Wimplicit], ermyth_cv_c_gcc_w_implicit)
570 ERMYTH_C_GCC_TRY_FLAGS([-Wcast-align], ermyth_cv_c_gcc_w_cast_align)
571 ERMYTH_C_GCC_TRY_FLAGS([-Wcast-qual], ermyth_cv_c_gcc_w_cast_qual)
572 ERMYTH_C_GCC_TRY_FLAGS([-Wextra], ermyth_cv_c_gcc_w_extra)
573 ERMYTH_C_GCC_TRY_FLAGS([-W -Wno-unused-parameter], ermyth_cv_c_gcc_w)
574 ERMYTH_C_GCC_TRY_FLAGS([-Wshadow], ermyth_cv_c_gcc_w_shadow)
575 ERMYTH_C_GCC_TRY_FLAGS([-Wmissing-noreturn], ermyth_cv_c_gcc_w_missing_noreturn)
576 ERMYTH_C_GCC_TRY_FLAGS([-Wundef], ermyth_cv_c_gcc_w_undef)
577 ERMYTH_C_GCC_TRY_FLAGS([-Wpacked], ermyth_cv_c_gcc_w_packed)
578 ERMYTH_C_GCC_TRY_FLAGS([-Wunused-function -Wunused-label -Wunused-value -Wunused-variable], ermyth_cv_c_gcc_w_unused)
579 ERMYTH_C_GCC_TRY_FLAGS([-Wredundant-decls], ermyth_cv_c_gcc_w_redundant_decls)
580 ERMYTH_C_GCC_TRY_FLAGS([-Wfloat-equal], ermyth_cv_c_gcc_w_float_equal)
581 ERMYTH_C_GCC_TRY_FLAGS([-Wformat=2], ermyth_cv_c_gcc_w_format)
582 ERMYTH_C_GCC_TRY_FLAGS([-Wdisabled-optimization], ermyth_cv_c_gcc_w_format)
583 ERMYTH_C_GCC_TRY_FLAGS([-pedantic], ermyth_cv_c_gcc_pedantic)
584 ERMYTH_C_GCC_TRY_FLAGS([-std=c++98], ermyth_cv_c_gcc_cpp98)
585
586 dnl Too unreliable to be useful at this time.
587 dnl ERMYTH_C_GCC_TRY_FLAGS([-Wunreachable-code], ermyth_cv_c_gcc_w_unreachable_code)
588
589 dnl Maintainer flags.
590 ERMYTH_C_GCC_TRY_FLAGS([-Wconversion], ermyth_cv_c_gcc_w_conversion)
591 ERMYTH_C_GCC_TRY_FLAGS([-Wwrite-strings], ermyth_cv_c_gcc_w_strings)
592 dnl ERMYTH_C_GCC_TRY_FLAGS([-Werror], ermyth_cv_c_gcc_w_error)
593 ])
594
595 AC_ARG_ENABLE(propolice,
596 AC_HELP_STRING([--disable-propolice],[ Disable propolice protections
597 (for debugging.)]),
598 [
599
600 echo
601 echo "Disabling propolice."
602 echo
603
604 ERMYTH_C_GCC_TRY_FLAGS([-fno-stack-protector-all], ermyth_nspa)
605 ERMYTH_C_GCC_TRY_FLAGS([-fno-pie], ermyth_npie)
606 ERMYTH_C_GCC_TRY_FLAGS([-nonow], ermyth_nonow)
607 ERMYTH_C_GCC_TRY_FLAGS([-norelro], ermyth_no_relro)
608 ])
609
610 AC_ARG_ENABLE(profile,
611 AC_HELP_STRING([--enable-profile],[ Enable profiling extensions]),
612 [
613
614 echo
615 echo "Enabling profiling."
616 echo
617
618 ERMYTH_C_GCC_TRY_FLAGS([-pg], ermyth_pg)
619 ac_save_LDFLAGS="${LDFLAGS} -pg"
620 LDFLAGS=${ac_save_LDFLAGS}
621 ])
622
623 ac_save_CXXFLAGS="${CXXFLAGS} ${orig_CXXFLAGS} ${CWARNS} -DPREFIX=\\\"\${prefix}\\\" -DLOCALEDIR=\\\"\${LOCALEDIR}\\\" -DMODDIR=\\\"\${MODDIR}\\\" -DSHAREDIR=\\\"${SHAREDIR}\\\" -DSYSCONFDIR=\\\"${sysconfdir}\\\" -DLOGDIR=\\\"${LOGDIR}\\\" -DRUNDIR=\\\"${RUNDIR}\\\" -DDATADIR=\\\"${DATADIR}\\\""
624 CXXFLAGS=${ac_save_CXXFLAGS}
625
626
627 AC_ARG_ENABLE(gcov,
628 AC_HELP_STRING([--enable-gcov],[Enable coverage analysis]),
629 [
630
631 echo
632 echo "Enabling coverage analysis."
633 echo
634
635 ERMYTH_C_GCC_TRY_FLAGS([-fprofile-arcs], ermyth_profile_arcs)
636 ac_save_CXXFLAGS="${CXXFLAGS} -fprofile-arcs"
637 CXXFLAGS=${ac_save_CXXFLAGS}
638
639 dnl ERMYTH_C_GCC_TRY_FLAGS([-fbranch-probabilities], ermyth_branch_probabilities)
640 dnl ac_save_CXXFLAGS="${CXXFLAGS} -fbranch-probabilities"
641 dnl CXXFLAGS=${ac_save_CXXFLAGS}
642
643 ERMYTH_C_GCC_TRY_FLAGS([-ftest-coverage], ermyth_test_coverage)
644 ac_save_CXXFLAGS="${CXXFLAGS} -ftest-coverage"
645 CXXFLAGS=${ac_save_CXXFLAGS}
646
647 ac_save_LDFLAGS="${LDFLAGS} -lgcov"
648 LDFLAGS=${ac_save_LDFLAGS}
649 ])
650
651 dnl
652 dnl RPATH
653 dnl
654
655 enablerpath="yes"
656 AC_ARG_ENABLE(rpath,
657 AC_HELP_STRING([--disable-rpath],[Disable use of -Wl,-rpath= during linking.]),
658 [enablerpath="$enableval"], [enablerpath="yes"])
659 RPATH=""
660 if test "x$enablerpath" = "xyes"; then
661 RPATH="-Wl,-rpath,${libdir}"
662 fi
663
664 AC_SUBST(RPATH)
665
666 echo
667 echo "Makefile generation"
668 echo
669
670 dnl include/common/callback.h
671 AC_OUTPUT([
672 Makefile
673 doc/Makefile
674 modules/Makefile
675 modules/Makefile.common
676 modules/Makefile.defs
677 modules/backend/Makefile
678 modules/chanserv/Makefile
679 modules/contrib/Makefile
680 modules/crypto/Makefile
681 modules/gameserv/Makefile
682 modules/global/Makefile
683 modules/memoserv/Makefile
684 modules/misc/Makefile
685 modules/nickserv/Makefile
686 modules/operserv/Makefile
687 modules/protocol/Makefile
688 modules/rpc/Makefile
689 modules/saslserv/Makefile
690 po/Makefile.in
691 src/Makefile
692 test/Makefile
693 ])
694
695 d=`eval echo ${MODDIR}`
696 d=`eval echo $d`
697 echo "
698 Configuration:
699 lib$PACKAGE version : ${PACKAGE_VERSION}
700 Installation prefix : ${prefix}
701 Module root directory : `eval echo $d`
702 Config directory : ${sysconfdir}
703 Logfile directory : ${LOGDIR}
704 Data directory : ${DATADIR}
705 PID directory : ${RUNDIR}
706 Large network support : ${LARGENET}
707 OpenSSL SASL support : ${SSL}
708 Socket Engine : ${SOCKET_ENGINE}
709 Block Allocator : ${balloc}
710 CXXFLAGS : ${CXXFLAGS}
711
712 Type make to build $PACKAGE, and make install to install it."
713