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