view configure.in @ 45:32ba1198c6fa noffle

[svn] * Makefile.in, configure, configure.in, docs/Makefile.in, src/Makefile.in: Added checks for the mail and sort programs. ./configure will abort if they're not found. * README: Removed the paragraph about news client software, as it's the same as the one in docs/NOTES. * TODO: Removed 'expiring by groups' and 'move some text from noffle.1 to noffle.conf.5'. * docs/NOTES: Changed the text about -DDEBUG to explain one should use './configure --enable-debug'. * docs/noffle.1, docs/noffle.conf.5: Minor fixes. Added myself and Jim Hague to the AUTHORS section :-) * src/client.h, src/common.h, src/configfile.h, src/content.c, src/content.h, src/control.c, src/control.h, src/database.h, src/dynamicstring.c, src/dynamicstring.h, src/fetch.h, src/fetchlist.h, src/group.h, src/itemlist.c, src/itemlist.h, src/lock.h, src/log.c, src/log.h, src/noffle.c, src/online.h, src/outgoing.h, src/over.c, src/over.h, src/post.h, src/protocol.h, src/pseudo.h, src/request.h, src/server.h, src/util.c, src/util.h: Added the <config.h> include. * src/content.c: Added missing include "content.h". Added a missing 'void' in the declaration of clearCont(). * src/fetchlist.c: Casted fetchlist.size to (size_t) in a call to qsort(), as qsort() expects a size_t. This removes a warning. * src/noffle.c: Made doRequested() static. Added missing void to enableCorefiles(). * src/log.c, src/protocol.c, src/online.c, src/pseudo.c: Added missing includes. * src/pseudo.c: Made genOv() and genPseudo() static. * src/server.c: Added missing void to postArts(). Made touchArticle() static. * src/util.c: Casted arguments of malloc() and memcpy() to size_t. * src/dynamicstring.c, src/itemlist.c, src/over.c, src/request.c, src/util.c: Removed casting of the result of malloc(). This is not necessary and can hide a missing include of <stdlib.h>.
author uh1763
date Sat, 06 May 2000 00:49:38 +0100
parents 2842f50feb55
children 48b7f28c3189
line wrap: on
line source

dnl ---------------------------------------------------------------------------
dnl Process this file with autoconf to produce a configure script.
dnl ---------------------------------------------------------------------------

AC_INIT(src/noffle.c)

AC_PREREQ(2.13)

PACKAGE=noffle
VERSION=1.0pre6

AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE($PACKAGE,$VERSION)

dnl AM_MAINTAINER_MODE

AC_DEFINE(_GNU_SOURCE)

AC_LANG_C


dnl ---------------------------------------------------------------------------
dnl Checks for programs.
dnl ---------------------------------------------------------------------------

AC_PROG_CC
AC_PROG_GCC_TRADITIONAL
AC_PROG_INSTALL
AC_PROG_MAKE_SET

AC_CHECK_PROG(MAILPROG, mail, mail)
if test "x$MAILPROG" != "xmail"; then
 AC_MSG_ERROR(mail program not found.)
fi

AC_CHECK_PROG(SORTPROG, sort, sort)
if test "x$SORTPROG" != "xsort"; then
 AC_MSG_ERROR(sort program not found.)
fi


dnl ---------------------------------------------------------------------------
dnl System checks.
dnl ---------------------------------------------------------------------------

AC_AIX
AC_ISC_POSIX
AC_MINIX


dnl ---------------------------------------------------------------------------
dnl Checks for libraries.
dnl ---------------------------------------------------------------------------

# Whenever both -lsocket and -lnsl are needed, it seems to be always the
# case that gethostbyname requires -lnsl.  So, check -lnsl first, for it
# to be in LIBS before the setsockopt checks are performed.  *However*,
# on SINIX-N 5.43, this is false, and gethostent seems to be a better
# candidate. So, let's use it below instead of gethostbyname, and see.

# [ This is ripped from GNU tar. ]

AC_CHECK_FUNC(gethostent)
if test $ac_cv_func_gethostent = no; then
  AC_CHECK_LIB(nsl, gethostent)
fi
AC_CHECK_FUNC(setsockopt)
if test $ac_cv_func_setsockopt = no; then
  AC_CHECK_LIB(socket, setsockopt)
fi


AC_CHECK_LIB(gdbm, gdbm_open)


dnl ---------------------------------------------------------------------------
dnl Checks for header files.
dnl ---------------------------------------------------------------------------

AC_HEADER_STDC
AC_HEADER_DIRENT
AC_CHECK_HEADERS(gdbm.h syslog.h sys/resource.h sys/utsname.h)
AC_CHECK_HEADERS(fnmatch.h errno.h getopt.h time.h sys/time.h signal.h)
AC_CHECK_HEADERS(netdb.h sys/socket.h fcntl.h limits.h unistd.h)


dnl ---------------------------------------------------------------------------
dnl Checks for typedefs, structures, and compiler characteristics.
dnl ---------------------------------------------------------------------------

AC_C_CONST
AC_TYPE_SIZE_T
AC_HEADER_TIME
AC_STRUCT_TM

AC_CACHE_CHECK(socklen_t, noffle_cv_type_socklen_t,
AC_TRY_COMPILE([
#include <sys/types.h>
#include <sys/socket.h>
], [ socklen_t s; ],
noffle_cv_type_socklen_t=yes, noffle_cv_type_socklen_t=no)
)

if test "x$noffle_cv_type_socklen_t" = "xno"
then
 AC_DEFINE_UNQUOTED(socklen_t, unsigned int)
fi


dnl ---------------------------------------------------------------------------
dnl Checks for library functions.
dnl ---------------------------------------------------------------------------

AC_TYPE_SIGNAL
AC_FUNC_STRFTIME
AC_FUNC_FNMATCH
AC_CHECK_FUNCS(fdopen vsnprintf snprintf __vsnprintf __snprintf)
AC_CHECK_FUNCS(gethostname mkdir mktime select socket strerror strstr uname)


dnl ---------------------------------------------------------------------------
dnl Checks for system services.
dnl ---------------------------------------------------------------------------


dnl ---------------------------------------------------------------------------
dnl Handle user-specified configure options
dnl ---------------------------------------------------------------------------

AC_ARG_ENABLE(debug, [
NOFFLE options:
  --enable-debug          turn on debugging (default=yes)], ,
enable_debug=yes)

if test "x$enable_debug" = "xyes"
then
 CFLAGS="$CFLAGS \
-Wall -O2 -g -pedantic -ansi -W -Wtraditional -Wshadow -Wpointer-arith \
-Wcast-qual -Wcast-align -Wwrite-strings -Wconversion \
-Waggregate-return -Wstrict-prototypes -Wmissing-prototypes \
-Wmissing-declarations -Wnested-externs -Winline \
-D__USE_BSD -D__USE_XOPEN_EXTENDED -D__USE_POSIX -DDEBUG" 
fi


# [ This is adapted from mutt. ]
AC_ARG_WITH(docdir,
[  --with-docdir=PATH      specify where to put the documentation
], [noffle_cv_docdir=$withval],
[ AC_CACHE_CHECK(where to put the documentation, noffle_cv_docdir,
  [if test x$prefix = xNONE; then
    noffle_cv_prefix=$ac_default_prefix
   else
    noffle_cv_prefix=$prefix
   fi
   noffle_cv_docdir=$noffle_cv_prefix/doc/noffle
  ])
])


dnl ---------------------------------------------------------------------------
dnl Unquoted defines and substituted variables.
dnl ---------------------------------------------------------------------------

CONFIGFILE="/etc/noffle.conf"
AC_DEFINE_UNQUOTED(CONFIGFILE,"$CONFIGFILE")
AC_SUBST(CONFIGFILE)

dnl NOFFLE_EXPAND_DIR(VARNAME, DIR)
dnl expands occurrences of ${prefix} and ${exec_prefix} in the given DIR,
dnl and assigns the resulting string to VARNAME
dnl example: NOFFLE_EXPAND_DIR(LOCALEDIR, "$datadir/locale")
dnl eg, then: AC_DEFINE_UNQUOTED(LOCALEDIR, "$LOCALEDIR")
dnl by Alexandre Oliva
dnl from http://www.cygnus.com/ml/automake/1998-Aug/0040.html
AC_DEFUN(NOFFLE_EXPAND_DIR, [
 $1=$2
 $1=`(
  test "x$prefix" = xNONE && prefix="$ac_default_prefix"
  test "x$exec_prefix" = xNONE && exec_prefix="${prefix}"
  eval echo \""[$]$1"\"
 )`
])

SPOOLDIR="/var/spool/$PACKAGE"
AC_DEFINE_UNQUOTED(SPOOLDIR, "$SPOOLDIR")
AC_SUBST(SPOOLDIR)

DOCDIR=$noffle_cv_docdir
AC_SUBST(DOCDIR)


dnl ---------------------------------------------------------------------------
dnl Output files.
dnl ---------------------------------------------------------------------------

AC_OUTPUT(Makefile src/Makefile docs/Makefile)