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