home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Geek Gadgets 1
/
ADE-1.bin
/
ade-dist
/
inetutils-1.2-src.tgz
/
tar.out
/
fsf
/
inetutils
/
configure.in
< prev
next >
Wrap
Text File
|
1996-09-28
|
13KB
|
337 lines
# Configuration for inetutils
#
# Copyright (C) 1995, 1996 Free Software Foundation, Inc.
#
# Written by Miles Bader <miles@gnu.ai.mit.edu>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
AC_INIT(inetd/inetd.c)
# Get macros that we use
builtin(include, iumacros.m4)
# Generate <config.h>; note that we use a `header' subdirectory, which
# contains all include files distributed with inetutils, and an `include'
# directory, which holds those actually needed for compilation
AC_CONFIG_HEADER(include/config.h:headers/config.h.in)
# config.h turns this on, so make sure it's on for our tests too
CPPFLAGS=-D_BSD_SOURCE
# The list of subdirs that may be built, split into subsets (which the user
# may select for compilation at config or make time); the composite list of
# everything to build by default is defined at the end of this file.
# (These don't contain talk or talkd, which is added later if necessary)
COMMON='libtelnet libinetutils'
SERVERS='inetd ftpd telnetd rshd rlogind uucpd rexecd syslogd tftpd'
CLIENTS='telnet ftp rsh rcp rlogin tftp syslog'
AC_SUBST(COMMON)
AC_SUBST(SERVERS)
AC_SUBST(CLIENTS)
# All subdirectories, whether built or not
SUBDIRS="headers $SERVERS $CLIENTS $COMMON"
AC_SUBST(SUBDIRS)
# Optional things we put into libinetutils (we use the name `LIBOBJS' because
# that's what AC_REPLACE_FUNCS uses).
LIBOBJS=''
AC_SUBST(LIBOBJS)
# Include files that we link into our own include directory from headers.
# Initialize it with the things we always want to use.
INCLUDES="version.h crypt.h arpa/telnet.h arpa/ftp.h arpa/tftp.h"
# Files that we link from somewhere other than headers to includes . The
# number of entries in LINK_SRCS should match that in LINK_DSTS.
LINK_SRCS=''
LINK_DSTS=''
# By default we compile both servers and clients, but see what the user wants
AC_ARG_ENABLE(servers, [ --disable-servers don't compile servers],
, enable_servers=yes)
AC_ARG_ENABLE(clients, [ --disable-clients don't compile clients],
, enable_clients=yes)
# By default, talk is only compiled if we can find libcurses
AC_ARG_ENABLE(talk, [ --disable-talk don't compile talk or talkd],
, enable_talk=maybe)
# Encryption and authentication is turned off by default
AC_ARG_ENABLE(encryption, [ --enable-encryption enable encryption],
, enable_encryption=no)
AC_ARG_ENABLE(authentication,
[ --enable-authentication enable connection authentication],
, enable_authentication=no)
AC_PROG_MAKE_SET
AC_PROG_CC
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_YACC
AC_CHECK_TOOL(AR, ar)
AC_CHECK_TOOL(RANLIB, ranlib, :)
AC_PATH_PROG(RM, rm, rm)
AC_CHECK_HEADERS(malloc.h errno.h string.h stdarg.h termio.h termios.h \
stdlib.h sys/tty.h sys/utsname.h glob.h \
sys/msgbuf.h krb.h des.h netinet/in_systm.h \
netinet/ip.h netinet/ip_icmp.h netinet/ip_var.h vis.h \
sys/ioctl_compat.h sys/cdefs.h utmp.h utmpx.h)
AC_CHECK_FUNCS(cgetent uname setutent_r fpathconf tcgetattr sigvec sigaction \
flock ftruncate wait3)
# Functions that we will define (in libinetutils) if necessary.
AC_REPLACE_FUNCS(daemon strdup)
# Use (posix) `setpgid' if it's around, otherwise assume a BSD setpgrp
AC_CHECK_FUNC(setpgid, , AC_DEFINE(setpgid, setpgrp))
# EWOULDBLOCK is more or less the BSD version of posix EAGAIN.
IU_CHECK_MACRO(EWOULDBLOCK, [#include <errno.h>], ,
:, AC_DEFINE(EWOULDBLOCK, EAGAIN))
IU_CHECK_DECL(errno, [#include <errno.h>])
# __P is the standard name for the ansi-or-not-ansi arg-decl macro.
# We define our own version in <config.h> if the system doesn't supply one.
IU_CHECK_MACRO(__P,
[ #ifdef HAVE_SYS_CDEFS_H
#include <sys/cdefs.h>
#endif ])
# libutil is a 4.4BSD library that defines several functions handy for
# inetutil daemons, doing such things as utmp frobbing, and pty setup.
AC_CHECK_LIB(util, logout, LIBUTIL=-lutil)
AC_SUBST(LIBUTIL)
# Look for the functions typically defined by libutil (which of course may
# not actually be in libutil), and and use our own versions if necesary.
_SAVE_LIBS="$LIBS"
LIBS="$LIBUTIL $LIBS"
AC_REPLACE_FUNCS(login logout logwtmp openpty forkpty)
LIBS="$_SAVE_LIBS"
# See if `weak refs' are possible; these make it possible (with shared
# libraries) to check for the existance of a standard function at run-time
# instead of compile time, which is very handy for distributing binary
# version programs that automatically adapt -- in inetutils case, to whether
# or not crypt is available.
IU_CHECK_WEAK_REFS
# See if there's a separate libcrypt (many systems put crypt there)
AC_CHECK_LIB(crypt, crypt, LIBCRYPT=-lcrypt)
AC_SUBST(LIBCRYPT)
# Look for the crypt function itself (in libcrypt if possible)
_SAVE_LIBS="$LIBS"
LIBS="$LIBCRYPT $LIBS"
AC_CHECK_FUNCS(crypt)
LIBS="$_SAVE_LIBS"
# ... and see if it's declared anywhere
IU_CHECK_DECL(crypt, [#include <unistd.h>])
# Look for the posix SEEK_ macros (for lseek), and if not found, try the
# similar berkeley L_ macros; if neither can be found, use the classic unix
# values.
IU_CHECK_MACRO(SEEK_ macros,
[#include <unistd.h>], SEEK_SET SEEK_CUR SEEK_END,
:,
IU_CHECK_MACRO(L_ seek macros,
[#include <unistd.h>], L_SET L_INCR L_XTND,
AC_DEFINE(SEEK_SET, L_SET)
AC_DEFINE(SEEK_CUR, L_INCR)
AC_DEFINE(SEEK_END, L_XTND),
AC_DEFINE(SEEK_SET, 0)
AC_DEFINE(SEEK_CUR, 1)
AC_DEFINE(SEEK_END, 2)))
# See where to find fd_set (bit-vectors for select) manipulation macros.
IU_CHECK_MACRO(fd_set macros, [#include <sys/types.h>],
FD_ZERO FD_CLR FD_SET FD_ISSET)
if test "$inetutils_cv_fd_set_macros" = no; then
IU_CHECK_MACRO(fd_set macros in <sys/time.h>, [#include <sys/time.h>],
FD_ZERO FD_CLR FD_SET FD_ISSET)
fi
# See if stat includes sub-second time information (the st_?timespec form is
# from bsd, and the st_?time_usec form is used by the hurd; the latter will
# eventually be replaced by the former).
IU_CHECK_STRUCT_FIELD(stat, st_mtimespec,
[ #include <sys/types.h>
#include <sys/stat.h> ],
:,
IU_CHECK_STRUCT_FIELD(stat, st_mtime_usec,
[ #include <sys/types.h>
#include <sys/stat.h>]))
# See if a termcap library is available (under one of several names)
IU_LIB_TERMCAP
# If not, add a bogus version of tgetent to libinetutils, as that's the only
# function actually used (to check terminal type validity), modulo any
# dependencies from curses.
if test -z "$LIBTERMCAP"; then
# Some packages include termcap just ;
# for those cases, we really don't need termcap.
LIBOBJS="$LIBOBJS stub_tgetent.o"
fi
# Only talk uses curses, so only check for it if we want that
if test "$enable_talk" != no; then
IU_LIB_CURSES
fi
if test "$enable_talk" = yes -a "$ac_cv_lib_curses_initscr" != yes; then
AC_MSG_WARN(curses is not available, so not building talk)
fi
enable_talk="$ac_cv_lib_curses_initscr"
if test "$enable_talk" = yes; then
SERVERS="$SERVERS talkd"
CLIENTS="$CLIENTS talk"
# We may need our own definition for struct osockaddr (equivalent to the
# old 4.3BSD struct sockaddr, and used in grotty bsd talk protocol)
IU_CHECK_TYPE(struct osockaddr,
[ #include <sys/types.h>
#include <sys/socket.h> ],
:, AC_DEFINE(HAVE_OSOCKADDR_H) INCLUDES="$INCLUDES osockaddr.h")
fi
# SUBDIRS gets talk subdirs regardless of whether we're building them
SUBDIRS="$SUBDIRS talkd talk"
# Look for a system `glob' function, and use our own if we can't find one (or
# if the system one is missing features we need).
sys_glob=no
if test "$ac_cv_header_glob_h" = yes; then
AC_CHECK_LIB(glob, glob, LIBGLOB=-lglob)
_SAVE_LIBS="$LIBS"
LIBS="$LIBGLOB $LIBS"
AC_CHECK_FUNC(glob,
IU_CHECK_MACRO(system glob is ok,
[#include <glob.h>], GLOB_BRACE GLOB_TILDE,
sys_glob=yes))
LIBS="$_SAVE_LIBS"
fi
if test "$sys_glob" != yes; then
AC_CONFIG_SUBDIRS(glob)
LINK_SRCS="$LINK_SRCS glob/glob.h"
LINK_DSTS="$LINK_DSTS include/glob.h"
LIBGLOB="-L../glob -lglob"
fi
AC_SUBST(LIBGLOB)
if test "$enable_encryption" = yes -o "$enable_authentication" = yes; then
# Look for Kerberos and DES libraries
AC_CHECK_LIB(krb, krb_mk_req, LIBAUTH=-lkrb)
AC_CHECK_LIB(des, des_key_sched, LIBAUTH="$LIBAUTH -ldes")
fi
AC_SUBST(LIBAUTH)
# define CPP macros that enable auth/encrypt code
test "$enable_authentication" = yes && AC_DEFINE(AUTHENTICATION)
test "$enable_encryption" = yes && AC_DEFINE(ENCRYPTION)
test "$enable_authentication" = yes -a "$ac_cv_lib_krb_krb_mk_req" = yes \
&& AC_DEFINE(KRB4)
test "$enable_encryption" = yes -a "$ac_cv_lib_des_des_key_sched" = yes \
&& AC_DEFINE(DES_ENCRYPTION)
# We use our own version of getopt (including our own header file) if the
# system one doesn't have getopt_long.
AC_CHECK_FUNC(getopt_long, ,
INCLUDES="$INCLUDES getopt.h"
LIBOBJS="$LIBOBJS getopt.o getopt1.o")
# Supply versions of the BSD error reporting functions if the system doesn't
AC_CHECK_FUNC(verrx, ,
INCLUDES="$INCLUDES err.h"
LIBOBJS="$LIBOBJS err.o")
IU_CHECK_TYPE(struct lastlog, [#include <utmp.h>])
IU_CHECK_STRUCT_FIELD(utmp, ut_type, [#include <utmp.h>])
IU_CHECK_STRUCT_FIELD(utmp, ut_host, [#include <utmp.h>])
IU_CHECK_STRUCT_FIELD(utmp, ut_tv, [#include <utmp.h>])
# See if the system has strerror, and replace it if not
AC_CHECK_FUNC(strerror, , LIBOBJS="$LIBOBJS strerror.o")
if test "$ac_cv_func_strerror" = no; then
# No strerror, so see if the SYS_ERRLIST variable can be used by ours
AC_CHECK_FUNC(sys_errlist)
if test "$ac_cv_func_sys_errlist" = yes; then
IU_CHECK_DECL(sys_errlist, [
#include <stdio.h>
#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif])
fi
fi
# See if the system has hstrerror, and replace it if not
AC_CHECK_FUNC(hstrerror, , LIBOBJS="$LIBOBJS hstrerror.o")
if test "$ac_cv_func_hstrerror" = yes; then
IU_CHECK_DECL(hstrerror, [#include <netdb.h>])
else
# No hstrerror, so see if the H_ERRLIST variable can be used by ours
AC_CHECK_FUNC(h_errlist)
if test "$ac_cv_func_h_errlist" = yes; then
IU_CHECK_DECL(h_errlist, [#include <netdb.h>])
fi
fi
if test "$ac_cv_func_hstrerror" = yes -o "$ac_cv_func_h_errlist" = yes; then
# If there's a system hstrerror, or we can reasonably replace it, say so.
# We still provide some definition, regardless, but this allows people to use
# a reasonable alternative if the situation allows, rather than using a
# degenerate version that only says `Host lookup error N'.
AC_DEFINE(HAVE_HSTRERROR)
fi
# Checks return type of signal handlers
AC_TYPE_SIGNAL
# sig_t is the type of a signal handler (4.4BSD)
IU_CHECK_TYPE(sig_t,
[ #include <sys/types.h>
#include <sys/signal.h> ])
# See if the __PROGNAME variable is defined, otherwise use our own.
AC_CHECK_FUNC(__progname,
AC_DEFINE(HAVE___PROGNAME),
LIBOBJS="$LIBOBJS __progname.o")
# See if snprintf exists, otherwise just use a bogus version
AC_CHECK_FUNC(snprintf,
AC_DEFINE(HAVE_SNPRINTF),
LIBOBJS="$LIBOBJS snprintf.o")
# SERVERS_OR_CLIENTS is the default set of things to build, and holds the
# union of SERVERS and CLIENTS (we set it way down here to allow talk subdirs
# to have been added to those variables by other code).
SERVERS_OR_CLIENTS=''
if test "$enable_servers" = yes; then
SERVERS_OR_CLIENTS="$SERVERS"
fi
if test "$enable_clients" = yes; then
SERVERS_OR_CLIENTS="$SERVERS_OR_CLIENTS $CLIENTS"
fi
AC_SUBST(SERVERS_OR_CLIENTS)
# Configure paths used by inetutils programs. See the file `paths' for
# details.
PATHDEFS_MAKE=pathdefs.make
PATHS_DEFS=paths.defs
IU_CONFIG_PATHS($srcdir/paths, PATHDEFS_MAKE, PATHS_DEFS)
# Supply optional header files by linking a copy into the object include dir
LINK_SRCS="$LINK_SRCS `for I in $INCLUDES; do echo $ac_n ' 'headers/$I$ac_c; done`"
LINK_DSTS="$LINK_DSTS `for I in $INCLUDES; do echo $ac_n ' 'include/$I$ac_c; done`"
AC_LINK_FILES($LINK_SRCS, $LINK_DSTS)
SUBDIR_MAKEFILES="`for D in $SUBDIRS; do echo $ac_n ' '$D/Makefile$ac_c; done`"
AC_OUTPUT(Makefile config.make include/confpaths.h:headers/confpaths.h.in \
$SUBDIR_MAKEFILES)