Re: [gnet-dev] autoconf 2.54?
- From: Mark Ferlatte <ferlatte cryptio net>
- To: gnet-dev gnetlibrary org
- Subject: Re: [gnet-dev] autoconf 2.54?
- Date: Sat, 8 Dec 2001 17:45:24 -0800
Attached is a patch against current CVS to convert to autoconf 2.52.
configure.in goes away, and is replaced with configure.ac.
autogen.sh is modified to look at configure.ac for options, to work
around libtool not knowing about the new version of autoconf, and to
update config.{guess|sub} from the Debian autotools-dev package if they
exist (since those versions are newer than the ones provided by libtool,
and tend to work in more places).
M
On Fri, Dec 07, 2001 at 06:12:55PM -0500, David Helder wrote (0.78):
>
> Are there any big advantages to switching to it? I guess we need to
> switch to it at some point. Hmm, I have 2.52 (called autoconf2.50).
>
> BTW, I'd like to get a new release (1.1.1) out *real soon*. This will
> include Mark's Unix sockets, Marius's (unfinished?) SOCKS, and some other
> minor additions and compile/config fixes.
>
> David
>
>
> On Fri, 7 Dec 2001, Mark Ferlatte wrote:
>
> > Is there any interest in a patch to update gnet to using the new version
> > of autoconf (2.54)? I've recently done this with a couple of my own
> > projects, and it was an overall win, but it isn't backwards compatible
> > with autoconf 2.14.
> >
> > M
> > _______________________________________________
> > gnet-dev mailing list
> > gnet-dev gnetlibrary org
> > http://www.gnetlibrary.org/mailman/listinfo/gnet-dev
> >
>
> --
> __ _ __ David Helder - dhelder umich edu
> ___/ /__ __ __(_)__/ / <http://www.eecs.umich.edu/~dhelder>
> / _ / _ `/ |/ / / _ / Jungle Monkey: <http://www.junglemonkey.net>
> |_,_/|_,_/|___/_/|_,_/ Paper CD Case: <http://www.papercdcase.com>
diff -urNb gnet/autogen.sh gnet.work/autogen.sh
--- gnet/autogen.sh Sun Apr 9 11:44:45 2000
+++ gnet.work/autogen.sh Sat Dec 8 16:42:43 2001
@@ -5,7 +5,7 @@
srcdir=`dirname $0`
test -z "$srcdir" && srcdir=.
-(test -f $srcdir/configure.in) || {
+(test -f $srcdir/configure.ac) || {
echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
echo " top-level directory"
exit 1
@@ -22,7 +22,7 @@
DIE=1
}
-(grep "^AM_PROG_LIBTOOL" $srcdir/configure.in >/dev/null) && {
+(grep "^AM_PROG_LIBTOOL" $srcdir/configure.ac >/dev/null) && {
(libtool --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "**Error**: You must have \`libtool' installed to compile GNet."
@@ -69,7 +69,7 @@
am_opt=--include-deps;;
esac
-for coin in `find $srcdir -name configure.in -print`
+for coin in `find $srcdir -name configure.ac -print`
do
dr=`dirname $coin`
if test -f $dr/NO-AUTO-GEN; then
@@ -86,13 +86,25 @@
## echo "**Warning**: No such directory \`$k'. Ignored."
fi
done
- if grep "^AM_PROG_LIBTOOL" configure.in >/dev/null; then
- echo "Running libtoolize..."
+ if grep "^AM_PROG_LIBTOOL" configure.ac >/dev/null; then
+ echo "Making compatibility symlink for libtool"
+ ln -s configure.ac configure.in
+ echo "Running libtoolize --force --copy..."
libtoolize --force --copy
+ echo "Removing compatibility symlink for libtool"
+ rm -f configure.in
fi
+ # Get new versions of config.sub & config.guess if present,
+ # otherwise we'll stick with the libtool varients
+ # Note that these are provided by the Debian autotools-dev package
+ test -r /usr/share/misc/config.sub &&
+ ln -sf /usr/share/misc/config.sub config.sub
+ test -r /usr/share/misc/config.guess &&
+ ln -sf /usr/share/misc/config.guess config.guess
+
echo "Running aclocal $aclocalinclude ..."
aclocal $aclocalinclude
- if grep "^AM_CONFIG_HEADER" configure.in >/dev/null; then
+ if grep "^AM_CONFIG_HEADER" configure.ac >/dev/null; then
echo "Running autoheader..."
autoheader
fi
diff -urNb gnet/configure.ac gnet.work/configure.ac
--- gnet/configure.ac Wed Dec 31 16:00:00 1969
+++ gnet.work/configure.ac Sat Dec 8 16:35:37 2001
@@ -0,0 +1,270 @@
+# Process this file with autoconf to produce a configure script.
+#
+# $Id: $
+
+# autoconf requirement
+AC_PREREQ([2.52])
+
+###############################
+# Init autoconf and automake
+AC_INIT([gnet], [1.1.1], [gnet gnetlibrary org])
+# CANONICAL_TARGET has to occur before INIT_AUTOMAKE, for reasons I don't
+# fully understand
+AC_CANONICAL_TARGET
+AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
+# Activate maintainer mode
+AM_MAINTAINER_MODE
+
+###############################
+# Package info
+AC_REVISION([$Revision: $])
+AC_CONFIG_SRCDIR([src/gnet.c])
+
+# On making releases:
+# GNET_MICRO_VERSION += 1;
+# GNET_INTERFACE_AGE += 1;
+# GNET_BINARY_AGE += 1;
+# if any functions have been added, set GNET_INTERFACE_AGE to 0.
+# if backwards compatibility has been broken,
+# set GNET_BINARY_AGE _and_ GNET_INTERFACE_AGE to 0.
+GNET_MAJOR_VERSION=1
+GNET_MINOR_VERSION=1
+GNET_MICRO_VERSION=1
+GNET_INTERFACE_AGE=0
+GNET_BINARY_AGE=1
+GNET_VERSION=$GNET_MAJOR_VERSION.$GNET_MINOR_VERSION.$GNET_MICRO_VERSION
+AC_SUBST(GNET_MAJOR_VERSION)
+AC_SUBST(GNET_MINOR_VERSION)
+AC_SUBST(GNET_MICRO_VERSION)
+AC_SUBST(GNET_VERSION)
+AC_SUBST(GNET_INTERFACE_AGE)
+AC_SUBST(GNET_BINARY_AGE)
+
+# libtool versioning
+LT_RELEASE=$GNET_MAJOR_VERSION.$GNET_MINOR_VERSION
+LT_CURRENT=`expr $GNET_MICRO_VERSION - $GNET_INTERFACE_AGE`
+LT_REVISION=$GNET_INTERFACE_AGE
+LT_AGE=`expr $GNET_BINARY_AGE - $GNET_INTERFACE_AGE`
+AC_SUBST(LT_RELEASE)
+AC_SUBST(LT_CURRENT)
+AC_SUBST(LT_REVISION)
+AC_SUBST(LT_AGE)
+# Define version stuff
+AC_DEFINE_UNQUOTED(GNET_MAJOR_VERSION, $GNET_MAJOR_VERSION)
+AC_DEFINE_UNQUOTED(GNET_MINOR_VERSION, $GNET_MINOR_VERSION)
+AC_DEFINE_UNQUOTED(GNET_MICRO_VERSION, $GNET_MICRO_VERSION)
+AC_DEFINE_UNQUOTED(GNET_INTERFACE_AGE, $GNET_INTERFACE_AGE)
+AC_DEFINE_UNQUOTED(GNET_BINARY_AGE, $GNET_BINARY_AGE)
+
+###############################
+# Setup debugging flags
+#
+# This isn't actually used anywhere!
+# Figure out debugging default, prior to $ac_help setup
+# if test `expr $GNET_MINOR_VERSION \% 2` = 1; then
+# debug_default=yes
+# else
+# debug_default=no
+# fi
+
+# Declare --enable-* args and collect ac_help strings
+AC_ARG_ENABLE(debug,
+ AC_HELP_STRING([--enable-debug],
+ [turn on debugging]),
+ [test "$cflags_set" = set || CFLAGS="$CFLAGS -g"
+ GNET_DEBUG_FLAGS="-DG_ENABLE_DEBUG"],
+ [GNET_DEBUG_FLAGS="-DG_DISABLE_ASSERT -DG_DISABLE_CHECKS"])
+AC_SUBST(GNET_DEBUG_FLAGS)
+
+###############################
+# Check for programs
+AC_PROG_CC
+AM_PROG_CC_STDC
+AC_PROG_INSTALL
+AC_PROG_MAKE_SET
+AC_CHECK_PROG(PKGCONFIG, [pkg-config], [yes])
+AM_PROG_LIBTOOL
+
+###############################
+# Check for libraries
+AC_CHECK_LIB([socket], [main])
+AC_CHECK_LIB([nsl], [main])
+AC_CHECK_LIB([resolv], [main])
+
+# Wacky pthread madness
+pthread_libs=""
+AC_CHECK_LIB([pthread],
+ [pthread_create],
+ [pthread_libs="-lpthread"])
+AC_CHECK_LIB([c_r],
+ [pthread_create],
+ [pthread_libs="-lc_r"])
+if test "$pthread_libs"; then
+ AC_DEFINE(HAVE_LIBPTHREAD)
+ LIBS="$pthread_libs $LIBS"
+fi
+AC_SUBST(pthread_libs)
+
+# Try to find glib
+if test "x${PKGCONFIG}" = "xyes"; then
+ # Check for 2.0, then 1.2
+ PKG_CHECK_MODULES(GLIB,
+ [glib-2.0],
+ ,
+ [PKG_CHECK_MODULES(GLIB, glib)])
+ PKG_CHECK_MODULES(GTHREAD,
+ [gthread-2.0],
+ ,
+ [PKG_CHECK_MODULES(GTHREAD, gthread)])
+fi
+# If pkg-config wasn't found, or didn't work
+if test "x${GLIB_CFLAGS}" = "x"; then
+ AM_PATH_GLIB([1.2.10],
+ ,
+ [AC_MSG_ERROR([glib could not be found])],
+ [gthread])
+fi
+# These SUBSTs are primarily for gnet-config and gnet.pc
+AC_SUBST(GLIB_CFLAGS)
+AC_SUBST(GLIB_LIBS)
+AC_SUBST(GTHREAD_CFLAGS)
+AC_SUBST(GTHREAD_LIBS)
+
+###############################
+# Check for headers
+AC_HEADER_STDC
+AC_CHECK_HEADERS([sys/sockio.h sys/param.h])
+
+###############################
+# Check for types
+
+###############################
+# Check for structures
+AC_CHECK_MEMBER([struct sockaddr.sa_len],
+ ,
+ ,
+ [#include <sys/types.h>
+ #include <sys/socket.h>])
+
+###############################
+# Compiler characteristics
+AC_C_CONST
+
+# If the compiler is gcc, turn on as many warnings as possible
+if test "x$GCC" = "xyes"; then
+ case " $CFLAGS " in
+ *[\ \ ]-Wall[\ \ ]*)
+ ;;
+ *)
+ CFLAGS="$CFLAGS -Wall -Wstrict-prototypes \
+ -Wmissing-prototypes -Wmissing-declarations"
+ ;;
+ esac
+ if test "x$enable_ansi" = "xyes"; then
+ case " $CFLAGS " in
+ *[\ \ ]-ansi[\ \ ]*)
+ ;;
+ *)
+ CFLAGS="$CFLAGS -ansi"
+ ;;
+ esac
+ case " $CFLAGS " in
+ *[\ \ ]-pedantic[\ \ ]*)
+ ;;
+ *)
+ CFLAGS="$CFLAGS -pedantic"
+ ;;
+ esac
+ fi
+fi
+# Use reentract functions, and compile expiramental stuff
+CFLAGS="$CFLAGS -D_REENTRANT -DGNET_EXPERIMENTAL"
+
+###############################
+# Check for library functions
+
+# Look for a gethostbyname_r we can use (we assume that if the use has
+# gethostbyname_r, they also have gethostbyaddr_r)
+
+# First, look for the glibc varient
+AC_MSG_CHECKING([for glibc gethostbyname_r])
+AC_TRY_LINK([#include <netdb.h>],
+ [struct hostent result_buf;
+ char buf[1024];
+ struct hostent *result;
+ int h_erropp;
+
+ gethostbyname_r("localhost",
+ &result_buf,
+ buf,
+ sizeof(buf),
+ &result,
+ &h_erropp);],
+ [AC_MSG_RESULT([yes])
+ AC_DEFINE(HAVE_GETHOSTBYNAME_R_GLIBC)
+ HAVE_GETHOSTBYNAME_R=yes],
+ [AC_MSG_RESULT([no])])
+
+# Whups, maybe we're on Solaris or Irix
+AC_MSG_CHECKING([for Solaris/Irix gethostbyname_r])
+AC_TRY_LINK([#include <netdb.h>],
+ [struct hostent result;
+ char buf[1024];
+ int h_errnop;
+
+ gethostbyname_r("localhost",
+ &result,
+ buf,
+ sizeof(buf),
+ &h_errnop);],
+ [AC_MSG_RESULT([yes])
+ AC_DEFINE(HAVE_GETHOSTBYNAME_R_SOLARIS)
+ HAVE_GETHOSTBYNAME_R=yes],
+ [AC_MSG_RESULT([no])])
+
+# Or not. Perhaps we're on HP-UX?
+AC_MSG_CHECKING([for HP-UX gethostbyname_r])
+AC_TRY_LINK([#include <netdb.h>],
+ [struct hostent result;
+ char buf[1024];
+
+ gethostbyname_r("localhost",
+ &result,
+ buf);],
+ [AC_MSG_RESULT([yes])
+ AC_DEFINE(HAVE_GETHOSTBYNAME_R_HPUX)
+ HAVE_GETHOSTBYNAME_R=yes],
+ [AC_MSG_RESULT([no])])
+
+# We're stuck without gethostbyname_r. Use Glib threads.
+if test -z "$HAVE_GETHOSTBYNAME_R" -a "$GTHREAD_CFLAGS"; then
+ AC_DEFINE(HAVE_GETHOSTBYNAME_R_GLIB_MUTEX)
+ HAVE_GETHOSTBYNAME_R=yes
+fi
+
+# Duh-oh. We don't have _any_ thread safety, so warn the builder
+if test -z "$HAVE_GETHOSTBYNAME_R"; then
+ AC_MSG_WARN([You have neither gethostbyname_r() or Glib
+threads. This means that calls to gethostbyname() (called by the Gnet
+address functions) will not be thread safe. This means that this
+build of Gnet could malfunction if used in programs that use
+threads.])
+fi
+
+###############################
+# Outputs
+AM_CONFIG_HEADER(config.h)
+AC_CONFIG_FILES([
+ gnet-config
+ Makefile
+ src/Makefile
+ examples/Makefile
+ tests/Makefile
+ doc/Makefile
+ gnetconfig.h
+ debian/rules
+ debian/control
+ gnet.spec
+ gnet.pc],
+ [chmod -f +x gnet-config debian/rules])
+AC_OUTPUT
diff -urNb gnet/configure.in gnet.work/configure.in
--- gnet/configure.in Fri Nov 30 09:53:47 2001
+++ gnet.work/configure.in Wed Dec 31 16:00:00 1969
@@ -1,338 +0,0 @@
-# Process this file with autoconf to produce a configure script.
-
-# Some of the stuff that appears here was borrowed from the gtk,
-# glib, and libxml configure.in's.
-
-# Require autoconf 2.13
-AC_PREREQ(2.13)
-
-# Initialize autoconf
-AC_INIT(src/gnet.c)
-
-
-# On making releases:
-# GNET_MICRO_VERSION += 1;
-# GNET_INTERFACE_AGE += 1;
-# GNET_BINARY_AGE += 1;
-# if any functions have been added, set GNET_INTERFACE_AGE to 0.
-# if backwards compatibility has been broken,
-# set GNET_BINARY_AGE _and_ GNET_INTERFACE_AGE to 0.
-
-AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)
-GNET_MAJOR_VERSION=1
-GNET_MINOR_VERSION=1
-GNET_MICRO_VERSION=1
-GNET_INTERFACE_AGE=0
-GNET_BINARY_AGE=1
-GNET_VERSION=$GNET_MAJOR_VERSION.$GNET_MINOR_VERSION.$GNET_MICRO_VERSION
-AC_DIVERT_POP()
-
-AC_SUBST(GNET_MAJOR_VERSION)
-AC_SUBST(GNET_MINOR_VERSION)
-AC_SUBST(GNET_MICRO_VERSION)
-AC_SUBST(GNET_VERSION)
-AC_SUBST(GNET_INTERFACE_AGE)
-AC_SUBST(GNET_BINARY_AGE)
-
-# libtool versioning
-LT_RELEASE=$GNET_MAJOR_VERSION.$GNET_MINOR_VERSION
-LT_CURRENT=`expr $GNET_MICRO_VERSION - $GNET_INTERFACE_AGE`
-LT_REVISION=$GNET_INTERFACE_AGE
-LT_AGE=`expr $GNET_BINARY_AGE - $GNET_INTERFACE_AGE`
-AC_SUBST(LT_RELEASE)
-AC_SUBST(LT_CURRENT)
-AC_SUBST(LT_REVISION)
-AC_SUBST(LT_AGE)
-
-VERSION=$GNET_VERSION
-PACKAGE=gnet
-
-# Specify a configuration file
-AM_CONFIG_HEADER(config.h)
-
-# Define version stuff
-AC_DEFINE_UNQUOTED(GNET_MAJOR_VERSION, $GNET_MAJOR_VERSION)
-AC_DEFINE_UNQUOTED(GNET_MINOR_VERSION, $GNET_MINOR_VERSION)
-AC_DEFINE_UNQUOTED(GNET_MICRO_VERSION, $GNET_MICRO_VERSION)
-AC_DEFINE_UNQUOTED(GNET_INTERFACE_AGE, $GNET_INTERFACE_AGE)
-AC_DEFINE_UNQUOTED(GNET_BINARY_AGE, $GNET_BINARY_AGE)
-
-# Initialize automake
-AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
-
-# Initialize maintainer mode
-AM_MAINTAINER_MODE
-
-
-# ****************************************
-# Set debugging flags
-
-# Figure out debugging default, prior to $ac_help setup
-AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
-if test `expr $GNET_MINOR_VERSION \% 2` = 1 ; then
- debug_default=yes
-else
- debug_default=minimum
-fi
-AC_DIVERT_POP()
-
-# Declare --enable-* args and collect ac_help strings
-AC_ARG_ENABLE(debug, [ --enable-debug=[no/minimum/yes] turn on debugging [default=$debug_default]],,enable_debug=$debug_default)
-
-# Set the debug flags
-AC_MSG_CHECKING(for --enable-debug)
-if test "x$enable_debug" = "xyes"; then
- test "$cflags_set" = set || CFLAGS="$CFLAGS -g"
- GNET_DEBUG_FLAGS="-DG_ENABLE_DEBUG"
- AC_MSG_RESULT(yes)
-else
- AC_MSG_RESULT(no)
- if test "x$enable_debug" = "xno"; then
- GNET_DEBUG_FLAGS="-DG_DISABLE_ASSERT -DG_DISABLE_CHECKS"
- fi
-fi
-
-AC_SUBST(GNET_DEBUG_FLAGS)
-
-
-
-# ****************************************
-# Check for programs
-
-AC_PROG_CC
-AM_PROG_CC_STDC
-AC_PROG_INSTALL
-
-# Use an many warnings as possible
-changequote(,)
-if test "x$GCC" = "xyes"; then
- case " $CFLAGS " in
- *[\ \ ]-Wall[\ \ ]*) ;;
- *) CFLAGS="$CFLAGS -Wall" ;;
- esac
-
- if test "x$enable_ansi" = "xyes"; then
- case " $CFLAGS " in
- *[\ \ ]-ansi[\ \ ]*) ;;
- *) CFLAGS="$CFLAGS -ansi" ;;
- esac
-
- case " $CFLAGS " in
- *[\ \ ]-pedantic[\ \ ]*) ;;
- *) CFLAGS="$CFLAGS -pedantic" ;;
- esac
- fi
-fi
-changequote([,])
-
-# Use reentrant functions
-CFLAGS="$CFLAGS -D_REENTRANT"
-
-# Checks for header files.
-AC_HEADER_STDC
-
-# Initialize libtool
-AM_PROG_LIBTOOL
-
-# Compile experimental stuff
-CFLAGS="$CFLAGS -DGNET_EXPERIMENTAL"
-
-
-
-# ****************************************
-# Check for libraries
-
-# Need GLIB
-AC_CHECK_PROG(PKGCONFIG, pkgconfig, yes)
-if test "x${PKGCONFIG}" = "xyes"; then
- # Check for 2.0 first, or 1.2 if not found
- PKG_CHECK_MODULES(GLIB, glib-2.0, ,[
- PKG_CHECK_MODULES(GLIB, glib)
- ])
- PKG_CHECK_MODULES(GTHREAD, gthread-2.0, ,[
- PKG_CHECK_MODULES(GTHREAD, gthread)
- ])
-
- # Export flags
- AC_SUBST(GLIB_CFLAGS)
- AC_SUBST(GLIB_LIBS)
- AC_SUBST(GTHREAD_CFLAGS)
- AC_SUBST(GTHREAD_LIBS)
-fi
-
-# If pkgconfig wasn't found, or didn't work
-if test "x${GLIB_CFLAGS}" = "x"; then
- # Check for 2.0 first, or 1.2 if not found
- dnl AM_PATH_GLIB_2_0([1.3.9],,
- AM_PATH_GLIB([1.2.10],,[
- AC_MSG_ERROR(glib could not be found)
- ],[gthread])
- dnl ],[gthread])
-
- # Export flags
- AC_SUBST(GLIB_CFLAGS)
- AC_SUBST(GLIB_LIBS)
- AC_SUBST(GTHREAD_CFLAGS)
- AC_SUBST(GTHREAD_LIBS)
-fi
-
-# Need network libraries
-AC_CHECK_LIB(socket, main)
-AC_CHECK_LIB(nsl, main)
-AC_CHECK_LIB(resolv, main)
-
-
-# ****************************************
-# Checks for header files.
-
-AC_HEADER_STDC
-
-AC_CHECK_HEADERS(sys/sockio.h, AC_DEFINE(HAVE_SYS_SOCKIO_H))
-AC_CHECK_HEADERS(sys/param.h, AC_DEFINE(HAVE_SYS_PARAM_H))
-
-
-# ****************************************
-# Checks for typedefs, structures, and compiler characteristics.
-
-
-# If gcc is the compiler, compile with lots of warnings
-if test "$GCC" = "yes"; then
- CFLAGS="$CFLAGS -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations "
-fi
-
-
-####################
-# Check for sockaddr.sa_len
-
-AC_MSG_CHECKING(for sockaddr.sa_len)
-AC_TRY_COMPILE([
- #include </usr/include/sys/types.h>
- #include </usr/include/sys/socket.h>
-],[
- struct sockaddr addr;
- addr.sa_len = 0;
-], [
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_SOCKADDR_SA_LEN)
-], [
- AC_MSG_RESULT(no)
-])
-
-
-# ****************************************
-# Checks for library functions.
-
-# Check for pthread.
-pthread_libs=""
-AC_CHECK_LIB(pthread, pthread_create, pthread_libs="-lpthread")
-AC_CHECK_LIB(c_r, pthread_create, pthread_libs="-lc_r")
-if test "$pthread_libs" ; then
- AC_DEFINE(HAVE_LIBPTHREAD)
- LIBS="$pthread_libs $LIBS"
-fi
-AC_SUBST(pthread_libs)
-
-# Check if we have gethostbyname_r (we assume that if the user has gethostbyname_r,
-# that they have a similar gethostbyaddr_r).
-AC_CHECK_FUNC(gethostbyname_r,
- [
-
- dnl First check for the glibc variant of gethostbyname_r
-
- AC_MSG_CHECKING(for glibc gethostbyname_r)
- AC_TRY_LINK([ #include <netdb.h>],[
- struct hostent result_buf;
- char buf[1024];
- struct hostent* result;
- int h_errnop;
-
- gethostbyname_r("localhost", &result_buf, buf, sizeof(buf),
- &result, &h_errnop);
- ], [
-
- dnl Have glibc gethostbyname_r
-
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_GETHOSTBYNAME_R_GLIBC)
- HAVE_GETHOSTBYNAME_R=yes
-
- ], [
-
- dnl If we don't have glibc gethostbyname_r, check
- dnl for Solaris/Irix gethostbyname_r
-
- AC_MSG_RESULT(no)
- AC_MSG_CHECKING(for Solaris/Irix gethostbyname_r)
- AC_TRY_LINK([ #include <netdb.h>],[
- struct hostent result;
- char buf[1024];
- int h_errnop;
-
- gethostbyname_r("localhost", &result, buf, sizeof(buf), &h_errnop);
-
- ], [
-
- dnl Have Solaris/Irix gethostbyname_r
-
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_GETHOSTBYNAME_R_SOLARIS)
- HAVE_GETHOSTBYNAME_R=yes
-
- ], [
- dnl If don't have Solaris/Irix gethostbyname_r, check
- dnl for HP-UX gethostbyname_r
-
- AC_MSG_RESULT(no)
- AC_MSG_CHECKING(for HP-UX gethostbyname_r)
- AC_TRY_LINK([ #include <netdb.h>],[
- struct hostent result;
- char buf[1024];
- gethostbyname_r("localhost", &result, buf);
- ], [
-
- dnl Have HP-UX gethostbyname_r
-
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_GETHOSTBYNAME_R_HPUX)
- HAVE_GETHOSTBYNAME_R=yes
-
- ]
- )]
- )]
-)])
-
-
-dnl If we don't have gethostbyname_r, use Glib threads
-if test -z "$HAVE_GETHOSTBYNAME_R"; then
-
- AM_PATH_GLIB(1.2.0,
- [AC_DEFINE(HAVE_GETHOSTBYNAME_R_GLIB_MUTEX)
- LIBS="$LIBS $GLIB_LIBS"
- CFLAGS="$CFLAGS $GLIB_CFLAGS"
- glib_cflags=`$GLIB_CONFIG --cflags glib gthread`
- glib_libs=`$GLIB_CONFIG --libs glib gthread`],[
- AC_MSG_WARN(You have neither Glib threads nor the function gethostbyname_r.
-This means that calls to gethostbyname (called by the GNet address functions) will
-not be thread safe so could malfunction in programs that use threads.)], [gthread])
-fi
-
-AC_SUBST(glib_cflags)
-AC_SUBST(glib_libs)
-
-
-# ########################################
-
-AC_OUTPUT([
- gnet-config
- Makefile
- src/Makefile
- examples/Makefile
- tests/Makefile
- doc/Makefile
- doc/gnet-config.1
- gnetconfig.h
- debian/rules
- debian/control
- gnet.spec
- gnet.pc ],
- [chmod -f +x gnet-config debian/rules])
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]