dnl Process this file with autoconf to produce a configure script. AC_REVISION([$Id: configure.in,v 1.37 2009/07/11 11:09:54 crosser Exp $])dnl dnl $Log: configure.in,v $ dnl Revision 1.37 2009/07/11 11:09:54 crosser dnl fix segfault bug in config parser (Alexei Seleznyov ) dnl dnl Revision 1.36 2006/11/26 12:35:18 crosser dnl fix comment dnl dnl Revision 1.35 2006/11/25 23:10:17 crosser dnl cleanup from Greg Woods dnl dnl Revision 1.34 2003/08/14 12:50:34 crosser dnl Memory leak in the client code (ilya@glas.net) dnl Changes to recent autoconf/automake (woods@weird.com) dnl use pidfile() if it exists (woods@weird.com) dnl dnl Revision 1.33 2001/09/28 21:12:06 crosser dnl bug in chroot path length, make release 2.02a dnl dnl Revision 1.32 2001/09/23 12:42:10 crosser dnl cleaner security warnings dnl More preport ChangeLog dependency (I hope) dnl dnl Revision 1.31 2001/09/22 08:25:07 crosser dnl spelling dnl dnl Revision 1.30 2001/09/21 21:31:38 crosser dnl even more paranoia added dnl dnl Revision 1.29 2001/09/21 06:15:56 crosser dnl more cleanup in revoking privileges, warnings in configure, version change dnl dnl Revision 1.28 2001/09/20 06:09:36 crosser dnl clear suppliementary groups in whosond dnl dnl Revision 1.27 2001/09/20 05:56:39 crosser dnl chroot() for whosond dnl dnl Revision 1.26 2001/07/20 08:47:15 crosser dnl run cvs2cl dnl change version dnl unixd params dnl dnl Revision 1.25 2000/03/28 20:44:00 crosser dnl build Makefile.PL for the perl5 module by configure dnl dnl Revision 1.24 1999/12/28 13:25:34 crosser dnl check for setreuid; added getopt to cvs dnl dnl Revision 1.23 1999/11/26 17:18:57 crosser dnl tune for sunos4 dnl dnl Revision 1.22 1999/10/08 11:55:39 crosser dnl Change version number only: 2.00 release dnl dnl Revision 1.21 1999/10/06 11:19:52 crosser dnl Handle SIGPIPE in the server dnl Fix (kludge) for private fields in the config struct dnl Make beta3 version dnl dnl Revision 1.20 1999/10/05 22:24:16 crosser dnl fix incorrect permission chan building. dnl Publish beta 2 dnl dnl Revision 1.19 1999/10/05 05:15:46 crosser dnl Check for inet_aton and use inet_addr if absent dnl dnl Revision 1.18 1999/10/03 21:18:03 crosser dnl First (probably) working version with new run time config parser. dnl Also added listenq parameter (backlog size for listen()) and dnl renamed wtest to whoson (and with man page). Release 2.00beta1. dnl dnl Revision 1.17 1999/09/08 04:39:05 crosser dnl Changed version because had to publish a maintenance release of dnl pre-CVS source tree. dnl dnl Revision 1.16 1999/08/30 14:21:40 crosser dnl Make shared library dnl dnl Revision 1.15 1999/08/30 10:20:45 crosser dnl Fix AC_FUNC_SETPGRP dnl dnl Revision 1.14 1999/08/09 06:27:31 crosser dnl Prelimenary work to change config reader dnl dnl Revision 1.13 1999/07/30 23:25:09 crosser dnl Automakifying clenups dnl dnl Revision 1.12 1999/07/27 17:17:18 crosser dnl switch to automake dnl dnl Revision 1.11 1999/06/03 07:49:32 crosser dnl fix test program on sun dnl dnl Revision 1.10 1999/06/02 22:10:36 crosser dnl deal with UNIX_PATH_MAX in a better way dnl dnl Revision 1.9 1999/01/16 23:05:03 crosser dnl Add RFC-formatted protocol description dnl dnl Revision 1.8 1998/07/13 13:04:29 crosser dnl fix LIBS for Solaris dnl dnl Revision 1.7 1998/07/12 16:43:57 crosser dnl cleanup: I've read that f*** manual at last... dnl dnl Revision 1.6 1998/07/05 19:06:15 crosser dnl Fix installation dnl dnl Revision 1.5 1998/07/05 00:01:27 crosser dnl minor changes dnl dnl Revision 1.4 1998/07/03 09:32:48 crosser dnl autoconf for signal and detach dnl dnl Revision 1.3 1998/07/02 18:01:15 crosser dnl change error reporting to syslog dnl dnl Revision 1.2 1998/05/05 19:08:16 crosser dnl *** empty log message *** dnl dnl Revision 1.1 1998/04/29 08:50:58 crosser dnl Initial revision dnl AC_INIT(whosond.c) AM_INIT_AUTOMAKE(whoson, 2.05) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE AC_LANG_C AC_PROG_CC if test "X$ac_cv_prog_gcc" = "Xyes"; then CFLAGS="$CFLAGS -Wall" fi AC_ARG_WITH([config], AC_HELP_STRING([--with-config=PATH], [location for the config file (default /etc/whoson.conf)]), use_config=1) if test "X$with_config" != "Xno" && test "X$with_config" != "Xyes" && test "X$with_config" != "X"; then DEFAULT_CONFIG=$with_config fi : ${DEFAULT_CONFIG=/etc/whoson.conf} AC_SUBST(DEFAULT_CONFIG)dnl AC_DEFINE_UNQUOTED(DEFAULT_CONFIG,"$DEFAULT_CONFIG",[Default config file path])dnl AC_ARG_ENABLE([reentrant], AC_HELP_STRING([--enable-reentrant], [build MT-Safe API library (default=no)]), AC_DEFINE(_REENTRANT,[],[build MT-Safe API library])) AC_ARG_WITH([connectors], AC_HELP_STRING([--with-connectors=list], [list of connectors (tcp udp unix unixd)]), CONNECTORS="$withval") : ${CONNECTORS="tcp udp unix unixd"} for f in $CONNECTORS; do SERV_CONN_SRC="$SERV_CONN_SRC serv_$f.c" SERV_CONN_OBJ="$SERV_CONN_OBJ serv_$f.lo" CLNT_CONN_SRC="$CLNT_CONN_SRC clnt_$f.c" CLNT_CONN_OBJ="$CLNT_CONN_OBJ clnt_$f.lo" done AC_SUBST(CONNECTORS)dnl AC_SUBST(SERV_CONN_SRC)dnl AC_SUBST(SERV_CONN_OBJ)dnl AC_SUBST(CLNT_CONN_SRC)dnl AC_SUBST(CLNT_CONN_OBJ)dnl AC_ARG_WITH([maxaddr], AC_HELP_STRING([--with-maxaddr=NUM], [maximum length of 'addr' (default=32)]), MAXADDR="$withval") : ${MAXADDR=32} AC_SUBST(MAXADDR)dnl AC_DEFINE_UNQUOTED(MAXADDR,$MAXADDR,[maxiumum length of 'addr'])dnl AC_ARG_WITH([maxname], AC_HELP_STRING([--with-maxname=NUM], [maximum length of 'name' (default=128)]), MAXNAME="$withval") : ${MAXNAME=128} AC_SUBST(MAXNAME)dnl AC_DEFINE_UNQUOTED(MAXNAME,$MAXNAME,[maxiumum length of 'name'])dnl AC_PROG_MAKE_SET AC_SUBST(PROGS)dnl AC_PATH_PROG(ECHO, echo, echo)dnl AC_PATH_PROG(LN, ln, ln)dnl AC_PATH_PROG(MV, mv, mv)dnl AC_PATH_PROG(RM, rm, rm)dnl AC_PATH_PROG(PERL, perl, perl)dnl AC_PATH_PROG(NROFF, nroff, nroff)dnl AC_PATH_PROG(CVS2CL, cvs2cl, cvs2cl)dnl AC_SUBST(LIBPROGS)dnl AC_PROG_INSTALL AC_PATH_PROG(AR, ar, ar)dnl AC_PATH_PROG(LD, ld, ld)dnl AC_PROG_LN_S AC_PROG_LIBTOOL dnl Checks for libraries. AC_CHECK_FUNCS(gethostbyname, [], [ AC_CHECK_LIB(nsl, gethostbyname) ]) AC_CHECK_LIB(socket, socket) dnl Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS(stddef.h unistd.h sys/select.h) AC_MSG_CHECKING([whether optarg is defined in headers]) AC_CACHE_VAL(ac_cv_optarg_defined, [AC_TRY_COMPILE([ #include #ifdef STDC_HEADERS #include #endif #ifdef HAVE_UNISTD_H #include #endif ], [ char *xxx; xxx=optarg; ], ac_cv_optarg_defined=yes, ac_cv_optarg_defined=no)])dnl AC_MSG_RESULT($ac_cv_optarg_defined) if test X$ac_cv_optarg_defined = Xyes; then AC_DEFINE(OPTARG_DEFINED,[],[headers contain definition of optarg]) fi dnl Checks for typedefs, structures, and compiler characteristics. AC_TYPE_SIGNAL AC_TYPE_UID_T dnl Checks for library functions. AC_CHECK_FUNCS(socket select syslog setsid inet_aton setreuid chroot setgroups) AC_REPLACE_FUNCS(getopt) AC_FUNC_SETPGRP AC_CHECK_LIB(util, pidfile) AC_CHECK_FUNCS(pidfile) if test x$ac_cv_func_socket != xyes; then AC_MSG_ERROR([Cannot work without BSD sockets!]) fi if test x$ac_cv_func_select != xyes; then AC_MSG_ERROR([Cannot work without select() function!]) fi AC_MSG_CHECKING([for the size of sockaddr_un.sun_path]) AC_CACHE_VAL(ac_cv_unix_path_max, [AC_EGREP_HEADER(UNIX_PATH_MAX, sys/un.h, ac_cv_unix_path_max=yes, [ AC_TRY_RUN([ #if STDC_HEADERS #include #endif #include #include #include int main(argc,argv) int argc; char *argv[]; { FILE *out; struct sockaddr_un s_un; if ((out=fopen("conftestdata","w"))) { #ifdef UNIX_PATH_MAX fprintf(out,"yes\n"); #else fprintf(out,"%d\n",sizeof(s_un.sun_path)); #endif fclose(out); exit(0); } else { exit(1); } } ], [ read ac_cv_unix_path_max