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
|
dnl# -*- sh -*-
AC_INIT
AC_CONFIG_SRCDIR([src/slrn.c])
JD_INIT
AC_CONFIG_AUX_DIR(autoconf)
AC_CANONICAL_HOST
AC_PROG_MAKE_SET
AC_PROG_INSTALL
JD_ANSI_CC
m4_include([./include/ax_lib_socket_nsl.m4])
AX_LIB_SOCKET_NSL
# determine X include and needed libs
dnl# AC_PATH_XTRA
#------------------------------------------------------------------------
# Useful macros
#------------------------------------------------------------------------
AC_DEFUN([CF_COMPILE_OPTION],[
optionvalue=$4
AC_ARG_ENABLE($1,[$2],[
if test "x$enableval" = "xyes" ; then
optionvalue=1
else
optionvalue=0
fi
])
AC_SUBST($3, $optionvalue)
])dnl
#---------------------------------------------------------------------------
# Configure options
#---------------------------------------------------------------------------
dnl# Unfortunately, autoconf lacks a --docdir option. This is a workaround:
AC_ARG_WITH(docdir,
[ --with-docdir=DIR Where to put the documentation],
[ if test "x$withval" = xyes || test "x$withval" = xno; then
docdir='${prefix}/share/doc/slrn'
else
docdir="$withval"
fi
], [ docdir='${prefix}/share/doc/slrn' ])
AC_SUBST(docdir)
AC_ARG_WITH(slrnlib,
[ --with-slrnlib=DIR Place for the slrn library files])
if test -z "$with_slrnlib" || test "x$with_slrnlib" = xyes || test "x$with_slrnlib" = xno; then
if test "x$prefix" = xNONE; then
slrn_lib_dir="${ac_default_prefix}/share/slrn"
else
slrn_lib_dir="${prefix}/share/slrn"
fi
else
slrn_lib_dir="$with_slrnlib"
fi
AC_SUBST(SLRN_LIB_DIR,"$slrn_lib_dir")
dnl# directory where .mo (translation) files should be placed
AC_ARG_WITH(localedir,
[ --with-localedir=DIR Where to put locale files])
if test -z "$with_localedir" || test "x$with_localedir" = xyes || test "x$with_localedir" = xno; then
if test "x$prefix" = xNONE; then
LOCALEDIR="${ac_default_prefix}/share/locale"
else
LOCALEDIR="${prefix}/share/locale"
fi
else
LOCALEDIR="$with_localedir"
fi
AC_SUBST(LOCALEDIR)
optionvalue=0
SLRNPULL_ROOT_DIR="/var/spool/news/slrnpull"
AC_ARG_WITH(slrnpull,
[ --with-slrnpull=[[DIR]] Build slrnpull and use DIR as the slrnpull root],
[if test "x$withval" != "xno" ; then
optionvalue=1
SLRNPULL="slrnpull\$(EXEEXT)"
MAN_SLRNPULL="../doc/slrnpull.1"
if test "x$withval" != "xyes" -a "x$withval" != "x"; then
SLRNPULL_ROOT_DIR="$withval"
fi
fi
])dnl
AC_SUBST(SLRN_HAS_PULL_SUPPORT, $optionvalue)
AC_SUBST(SLRNPULL)
AC_SUBST(SLRNPULL_ROOT_DIR)
AC_SUBST(MAN_SLRNPULL)
AC_ARG_WITH(server-name,
AS_HELP_STRING([--with-server-name=HOST],
[Hostname of a default NNTP server]),
[if test "x$withval" != "xno"; then
if test "x$withval" = "xyes"; then
AC_MSG_ERROR([you must pass the hostname of the server to the option --with-server-name])
fi
AC_DEFINE_UNQUOTED([NNTPSERVER_NAME], "$withval")
fi
])
AC_ARG_WITH(server-file,
AS_HELP_STRING([--with-server-file=FILE],
[File containing the hostname of an NNTP server]),
[if test "x$withval" != "xno"; then
if test "x$withval" = "xyes"; then
AC_MSG_ERROR([you must pass the name of the file to the option --with-server-file])
fi
AC_DEFINE_UNQUOTED([NNTPSERVER_FILE], "$withval")
fi
])
CF_COMPILE_OPTION(nntp,
[ --disable-nntp Disable NNTP support],
[SLRN_HAS_NNTP_SUPPORT], 1)
CF_COMPILE_OPTION(spool,
[ --enable-spool Enable support for reading directly from spool],
[SLRN_HAS_SPOOL_SUPPORT], 0)
CF_COMPILE_OPTION(inews,
[ --enable-inews Enable inews posting support],
[SLRN_HAS_INEWS_SUPPORT], 0)
if test "x$enable_inews" = xyes ; then
dnl# find inews
AC_PATH_PROG(INEWS, inews, no, $PATH:/usr/local/bin:/usr/bin)
if test "x$ac_cv_path_INEWS" != xno; then
dnl# AC_DEFINE_UNQUOTED(SLRN_INEWS_COMMAND, "$ac_cv_path_INEWS -S -h")
AC_SUBST(SLRN_INEWS_COMMAND, "$ac_cv_path_INEWS -S -h")
else
AC_MSG_ERROR([
I cannnot find an inews executable. When using --enable-inews, please make
sure inews can be found in your \$PATH.
])
fi
else
AC_SUBST(SLRN_INEWS_COMMAND, "/usr/local/bin/inews -S -h")
fi
CF_COMPILE_OPTION(force-inews,
[ --enable-force-inews Enforce the use of inews],
[SLRN_FORCE_INEWS], 0)
CF_COMPILE_OPTION(strict-from,
[ --enable-strict-from Disallow custom From headers],
[SLRN_HAS_STRICT_FROM], 0)
CF_COMPILE_OPTION(charmap,
[ --disable-charmap Disable mapping ISO-Latin to native charsets],
[SLRN_HAS_CHARACTER_MAP], 1)
CF_COMPILE_OPTION(setgid-code,
[ --enable-setgid-code Allow running slrnpull as an unpriviledged user],
[SLRNPULL_USE_SETGID_POSTS], 0)
CF_COMPILE_OPTION(spoilers,
[ --disable-spoilers Disable spoiler support],
[SLRN_HAS_SPOILERS], 1)
CF_COMPILE_OPTION(emph-text,
[ --disable-emph-text Disable emphasized text support],
[SLRN_HAS_EMPHASIZED_TEXT], 1)
CF_COMPILE_OPTION(gen-mid,
[ --disable-gen-mid Prevent slrn (and user) from generating Message-IDs],
[SLRN_HAS_GEN_MSGID], 1)
CF_COMPILE_OPTION(mid-cache,
[ --enable-mid-cache Make slrn cache Message-IDs to eliminate cross-posts
(only needed when server has no xref headers)],
[SLRN_HAS_MSGID_CACHE], 0)
CF_COMPILE_OPTION(fake-refs,
[ --disable-fake-refs Do not use In-Reply-To if References is not available],
[SLRN_HAS_FAKE_REFS], 1)
CF_COMPILE_OPTION(grouplens,
[ --enable-grouplens Enable GroupLens support],
[SLRN_HAS_GROUPLENS], 0)
jd_with_uu_library=no
JD_CHECK_FOR_LIBRARY(uu,uudeview.h)
if test $jd_with_uu_library = yes
then
LINK_LIBUU="-luu"
AC_DEFINE(HAVE_UUDEVIEW_H)
optionvalue=1
else
optionvalue=0
LINK_LIBUU=""
fi
AC_SUBST(LINK_LIBUU)
AC_SUBST(SLRN_HAS_UUDEVIEW,$optionvalue)
jd_with_canlock_library=no
JD_CHECK_FOR_LIBRARY(canlock)
if test $jd_with_canlock_library = yes
then
LINK_LIBCANLOCK="-lcanlock"
AC_DEFINE(HAVE_CANLOCK_H)
optionvalue=1
else
optionvalue=0
LINK_LIBCANLOCK=""
fi
AC_SUBST(LINK_LIBCANLOCK)
AC_SUBST(SLRN_HAS_CANLOCK,$optionvalue)
#---------------------------------------------------------------------------
# gettext
#---------------------------------------------------------------------------
m4_include([./include/gettext.m4])
m4_include([./include/iconv.m4])
m4_include([./include/nls.m4])
m4_include([./include/po.m4])
m4_include([./include/lib-ld.m4])
m4_include([./include/lib-link.m4])
m4_include([./include/lib-prefix.m4])
m4_include([./include/mkdirp.m4])
m4_include([./include/progtest.m4])
AM_ICONV
AM_GNU_GETTEXT(external)
AC_SUBST(INCICONV)dnl# AM_GNU_GETTEXT does not do this. Why???
AC_ARG_WITH(non-gnu-iconv,
[ --with-non-gnu-iconv Local iconv is not GNU compatible],
[use_non_gnu_iconv=$withval], [use_non_gnu_iconv=no])
case "x$use_non_gnu_iconv" in
x|xyes)
AC_DEFINE(NON_GNU_ICONV)dnl
;;
esac
#---------------------------------------------------------------------------
# SSL stuff
#---------------------------------------------------------------------------
AC_ARG_WITH(nss-compat,
[ --with-nss-compat Use NSS compat library instead of OpenSSL],
[use_nss_compat=$withval], [use_nss_compat=no])
AC_ARG_WITH(gnutls,
AS_HELP_STRING([--with-gnutls[=path]],
[Use GNU TLS library instead of OpenSSL]),
[use_gnutls=$withval; jd_cv_use_ssl=$withval],
[use_gnutls=no])
AC_CACHE_CHECK(if you want SSL support,jd_cv_use_ssl,
[
AC_ARG_WITH(ssl,
[ --with-ssl[[=path]] for SSL support],
[jd_cv_use_ssl=$withval], [jd_cv_use_ssl=no])
])
case "x$jd_cv_use_ssl" in
xno)
SSLINC=
SSLLIB=
;;
x|xyes)
if test "x$use_nss_compat" != xno
then
SSLINC="-I/usr/local/include/nss_compat_ossl -I/usr/local/include/nss3 -I/usr/local/include/nspr4"
SSLLIB="-L/usr/local/lib -lnss_compat_ossl"
elif test "x$use_gnutls" != xno
then
SSLINC=
SSLLIB="-lgnutls-openssl"
else
SSLINC="-I/usr/local/ssl/include"
SSLLIB="-L/usr/local/ssl/lib -lssl -lcrypto"
fi
;;
*)
if test "x$use_nss_compat" != xno; then
SSLINC="-I$jd_cv_use_ssl/include/nss_compat_ossl -I$jd_cv_use_ssl/include/nss3 -I$jd_cv_use_ssl/include/nspr4"
SSLLIB="-L$jd_cv_use_ssl/lib -lnss_compat_ossl"
elif test "x$use_gnutls" != xno
then
SSLINC="-I$jd_cv_use_ssl/include"
# SSLLIB="-L$jd_cv_use_ssl/lib -lgnutls-extra -lgnutls -ltasn1 -lgcrypt -lgnutls-openssl"
SSLLIB="-L$jd_cv_use_ssl/lib -lgnutls -lgnutls-openssl"
else
SSLINC="-I$jd_cv_use_ssl/include"
SSLLIB="-L$jd_cv_use_ssl/lib -lssl -lcrypto"
fi
esac
AC_SUBST(SSLINC)
AC_SUBST(SSLLIB)
if test "x$SSLINC$SSLLIB" != x; then
AC_DEFINE(USE_SSL)
if test "x$use_nss_compat" != xno; then
AC_DEFINE(USE_NSS_COMPAT)
fi
if test "x$use_gnutls" != xno; then
AC_DEFINE(USE_GNUTLS)
fi
fi
#---------------------------------------------------------------------------
# Check header files
#---------------------------------------------------------------------------
AC_CHECK_HEADERS( \
direct.h \
stdlib.h \
unistd.h \
memory.h \
fcntl.h \
sys/fcntl.h \
sys/dir.h \
ndir.h \
sys/ndir.h \
malloc.h \
termios.h \
sys/socket.h \
sys/time.h \
socket.h \
sys/wait.h \
netinet/in.h \
arpa/inet.h \
sys/utsname.h \
locale.h langinfo.h \
)
#AC_CHECK_LIB(socket, socket, [LIBSOCKET="-lnsl -lsocket"]) dnl for Solaris
#AC_CHECK_LIB(bsd, gethostbyname, [LIBSOCKET="-lbsd"]) dnl for LynxOS
#AC_SUBST(LIBSOCKET)
AC_HEADER_DIRENT
AC_TYPE_MODE_T
AC_TYPE_PID_T
AC_TYPE_UID_T
#dnl Eventually, this should go away. We don't need long doubles. It is
#dnl here for the snprintf code.
AC_CHECK_TYPE(long double)
AC_CHECK_SIZEOF(short, 2)
AC_CHECK_SIZEOF(int, 4)
AC_CHECK_SIZEOF(long, 4)
AC_CHECK_SIZEOF(float, 4)
AC_CHECK_SIZEOF(double, 8)
JD_CHECK_LONG_LONG
JD_LARGE_FILE_SUPPORT
AC_CHECK_FUNCS(\
memset \
memcpy \
memcmp \
memchr \
putenv \
getcwd \
getdomainname \
getaddrinfo \
getnameinfo \
gettimeofday \
sigaction \
sigemptyset \
sigprocmask \
sigaddset \
siglongjmp \
vsnprintf \
uname \
setlocale \
isalpha isspace isdigit isalnum ispunct \
atoll strtoll \
)
AC_MSG_CHECKING(for timezone in time.h)
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[long int tz; tz = timezone % 1]])],[AC_DEFINE(HAVE_TIMEZONE) AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)])
AC_MSG_CHECKING(for tm_gmtoff in struct tm)
AH_TEMPLATE([HAVE_TM_GMTOFF],
[define if you have "tm_gmtoff" in struct tm])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[struct tm t; t.tm_gmtoff = 0]])],[AC_DEFINE(HAVE_TM_GMTOFF) AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)])
dnl # AC_CACHE_CHECK(for domain in /etc/resolv.conf, slrn_cv_domain,
dnl # [if test -f /etc/resolv.conf; then
dnl # slrn_cv_domain=`(grep "^domain" /etc/resolv.conf ||
dnl # grep "^search" /etc/resolv.conf) |
dnl # awk '{ print [$]2 }' | head -1`
dnl # fi
dnl # if test -z "$slrn_cv_domain"; then
dnl # slrn_cv_domain=no
dnl # fi
dnl # ])
dnl # if test "X$slrn_cv_domain" != Xno; then
dnl # AC_DEFINE(USE_DOMAIN_NAME)
dnl # AC_DEFINE_UNQUOTED(MY_DOMAIN_NAME, "${slrn_cv_domain}")
dnl # fi
AC_DEFUN(CF_VA_COPY,
[
dnl# va_copy checks taken from glib 1.2.8
dnl#
dnl# we currently check for all three va_copy possibilities, so we get
dnl# all results in config.log for bug reports.
AC_MSG_CHECKING(for an implementation of va_copy())
AC_CACHE_VAL(slrn_cv_va_copy,[
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <stdarg.h>
#include <stdlib.h>
void f (int i, ...) {
va_list args1, args2;
va_start (args1, i);
va_copy (args2, args1);
if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
exit (1);
va_end (args1); va_end (args2);
}
int main() {
f (0, 42);
return 0;
}]])],[slrn_cv_va_copy=yes
],[slrn_cv_va_copy=no
],[])
])
AC_MSG_RESULT($slrn_cv_va_copy)
AC_MSG_CHECKING(for an implementation of __va_copy())
AC_CACHE_VAL(slrn_cv___va_copy,[
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <stdarg.h>
#include <stdlib.h>
void f (int i, ...) {
va_list args1, args2;
va_start (args1, i);
__va_copy (args2, args1);
if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
exit (1);
va_end (args1); va_end (args2);
}
int main() {
f (0, 42);
return 0;
}]])],[slrn_cv___va_copy=yes
],[slrn_cv___va_copy=no
],[])
])
AC_MSG_RESULT($slrn_cv___va_copy)
AC_MSG_CHECKING(whether va_lists can be copied by value)
AC_CACHE_VAL(slrn_cv_va_val_copy,[
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <stdarg.h>
#include <stdlib.h>
void f (int i, ...) {
va_list args1, args2;
va_start (args1, i);
args2 = args1;
if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
exit (1);
va_end (args1); va_end (args2);
}
int main() {
f (0, 42);
return 0;
}]])],[slrn_cv_va_val_copy=yes
],[slrn_cv_va_val_copy=no
],[])
])
if test "x$slrn_cv_va_copy" = "xyes"
then
AC_DEFINE(VA_COPY, va_copy)
else
if test "x$slrn_cv___va_copy" = "xyes"
then
AC_DEFINE(VA_COPY, __va_copy)
fi
fi
if test "x$slrn_cv_va_val_copy" = "xno"
then
AC_DEFINE(VA_COPY_AS_ARRAY)
fi
AC_MSG_RESULT($slrn_cv_va_val_copy)
])
CF_VA_COPY
JD_SET_OBJ_SRC_DIR
JD_TERMCAP
JD_WITH_LIBRARY(slang)
JD_GCC_WARNINGS
JD_GET_MODULES(src/modules.lis)
JD_CREATE_MODULE_ORULES
AC_CONFIG_HEADER(src/sysconf.h:src/config.hin)
AC_CONFIG_FILES(po/Makefile.in)
AC_CONFIG_FILES([src/slrnfeat.h:src/slrnfeat.hin])
AC_OUTPUT
AC_CONFIG_FILES([Makefile:autoconf/Makefile.in src/Makefile])
AC_OUTPUT
AC_CONFIG_FILES([po/Makefile])
AC_OUTPUT
JD_CREATE_ORULE(chkslang)
JD_CREATE_ORULE(sltcp)
JD_CREATE_ORULE(nntplib)
JD_CREATE_EXEC_RULE(slrnpull)
JD_APPEND_RULES(src/Makefile)
dnl #if test "$slrn_cv_domain" != no; then
dnl # echo ""
dnl # echo "Your DOMAIN appears to be: $slrn_cv_domain"
dnl # echo "If this is not correct, edit src/sysconf.h!!!"
dnl #fi
echo ""
echo "For some INSTALLATION options, edit src/Makefile."
echo "For INEWS, LOCAL SPOOL, GROUPLENS, SLANG, ... support, edit src/slrnfeat.h"
echo ""
|