[Raw Msg Headers][Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: zmailer and GNU autoconfig



> [ On Wed, July 10, 1996 at 15:04:49 (+0300), Matti Aarnio wrote: ]
> > Subject: zmailer and GNU autoconfig
> >
> > Well, I am doing it, but got stymied for a moment with
> > the socket handling at various platforms.
> > 
> > Does anybody have any good pointers at how to figure out
> > 	- existence of  socket()  (at libc.a, or alternate libs)
> > 	- existence of TCP/IP things
> > 	- existence of inetd in the system
> 
> Use the GNU Autoconf package.  [0.25 ;-)]

	Well, I hacked together something, and have so far tried it
	at  DEC OSF/1 and Sun Solaris (BSD world, and utmost weirdo..)
	(All kinds of kludges souped up from autoconf-2.10 manual.)
	This kind of definition:


AC_CHECK_HEADERS(netdb.h sys/socket.h syslog.h)
AC_CHECK_FUNCS(socket gethostbyname select syslog)
dnl These tests are for Sun Solaris 2.. All the BSD things are moved
dnl to -lsocket  and  -lnsl  (NIS+ at the latter one..)
AC_SUBST(LIBSOCKET)dnl
AC_SUBST(LIBRESOLV)dnl
AC_CHECK_LIB(socket, socket, AC_DEFINE(HAVE_SOCKET) LIBSOCKET="-lsocket")
AC_CHECK_LIB(nsl, gethostbyname, AC_DEFINE(HAVE_GETHOSTBYNAME) LIBSOCKET="$LIBSOCKET -lnsl")
AC_CHECK_LIB(resolv, res_send, AC_DEFINE(HAVE_RESOLVER) LIBRESOLV=-lresolv,,$LIBSOCKET)
AC_CHECK_LIB(resolv, gethostbyname, AC_DEFINE(HAVE_GETHOSTBYNAME) LIBRESOLV=-lresolv,,$LIBSOCKET)

	Sometimes the  gethostbyname()  is at the libc, sometimes (like
	at Solaris) elsewere needing other libs, sometimes it is at
	the resolver library.. ... and sometimes the -lresolv version is
	preferred over the what ever is at libc ...  (That isn't handled
	properly now, I think.)

	Whatever, I try to get this beast to go in smoothly into DEC OSF/1,
	Sun Solaris, and Linux, then I give it to you folks ;-)

> -- 
> 							Greg A. Woods
> 
> +1 416 443-1734			VE3TCP			robohack!woods
> Planix, Inc. <woods@planix.com>; Secrets of the Weird <woods@weird.com>

	/Matti Aarnio <mea@nic.funet.fi>