On Fri, 2003-09-26 at 13:28, Akim Demaille wrote:
>
> > Hello,
>
> > I have been trying to compile the mpich 1.2.5 sources.
> > In the sources for ch_p4 device ie, in mpich/mpid/ch_p4/p4 when I try
> > doing a autoconf to recreate the configuration file I get the following
> > error :
>
> > configure.in:280: error: m4_defn: undefined macro: _m4_divert_diversion
> > autoconf/programs.m4:451: AC_PROG_RANLIB is expanded from...
> > configure.in:280: the top level
>
>
> > I am using GNU autoconf 2.53
>
> > I tried calling autoupdate and stuffs thats already on the mailing
> > lists. Wanted to know where is _m4_divert_diversion defined ?
>
> You are probably trying to use an important macro before running
> AC_INIT. Can we see the configure.in file? And also, please upgrade
> your Autoconf.
Thanks for the response. I have attached the configure.in file that
comes with the mpich package for the ch_p4 device.
The file does not seem to have an AC_INIT macro call.
So I even tried it inserting the following lines in the file :
AC_PREREQ(2.53)
AC_INIT([GNU Autoconf],[2.53],[EMAIL PROTECTED])
It dint help though ..!
I have the following package versions:
autoconf - 2.53
autoheader-2.53
autom4te-2.53
automake-1.6 ( I do have automake-1.5, automake-1.4 )
All these were installed with a default red hat 8.0 Linux installation.
Thanks for any help, Its really been a work stopper for me.
Would be great if it works :)
Thanks again..!
Roopa
dnl This is an autoconf script.
dnl To rebuild the `configure' script from this, execute the command
dnl autoconf
dnl in the directory containing this script. You must have autoconf
dnl version 1.4 or later.
dnl
dnl The following text appears in the resulting `configure' script,
dnl explaining how to rebuild it.
[#!/bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated automatically using autoconf.
# Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
# 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.
#
CONFIGURE_ARGS="$*"
if test -n "$CONFIGURE_ARGS" ; then
echo "Configuring with args $CONFIGURE_ARGS"
fi
print_error() {
echo "*# $*" 2>&1 ;
}
progname="`echo $0 | sed 's:^\./\./:\./:'`"
usage_msg="
Usage: ${progname} -p4arch=ARCH_TYPE [-alog={on,off}] [-dprintfl={on,off}]
[-p4device=device]
[-p4comm=shared] [-listener_pathname="\<pathname\>"]
[-rsh=command] [-rshnol] [-cflags=flags]
[-dlast] [-listenersig=name]
[--enable-nonblockread]
[--enable-threaded-listener]
[--enable-lazy-gethostbyname ]
[--enable-nonblocking-listener]
[--enable-yield=method]
[--disable-each of the options starting with enable]
"
RSHCOMMAND=
MDEP_LIBS=
MDEP_CFLAGS=
MDEP_FFLAGS=
MDEP_LFLAGS=
OPTFLAGS="-g"
USERCC=0
CC=${CC:-cc}
USERF77=0
FC=${FC:-f77}
threaded_listener=0
userSet_threaded_listener=0
enable_lazy_gethostbyname="no"
enable_nonblocking_listener="yes"
enable_yield=yes
listener_sig=""
cross_compiling=0
# use modern socket code (EOF on socket can be distinquished from no-data)
# unless the test below fails. This can be turned off with
# --disable-nonblockread
use_nonblock_read=1
#
for arg
do
# Code from autoconf 2 to get any option after an =
case "$arg" in
-*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
*) ac_optarg= ;;
esac
case $arg in
-srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*)
srcdir=`echo $arg | sed 's/[-a-z_]*=//'` ;;
-exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* | --exec-pref=*
| --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* | --exec=* | --exe=* | --ex=* |
--e=*)
exec_prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
-libbuild_dir=*) libbuild_dir=`echo A$arg | sed 's/A[-a-z_]*=//'` ;;
-p4arch=*)
p4arch=`echo $arg|sed 's/-p4arch=//'`
eval "p4arch_`echo $p4arch`=1"
echo Setting p4arch to $p4arch
;;
-p4device=*)
p4device=`echo $arg|sed 's/-p4device=//'`
eval "p4device_`echo $p4device`=1"
echo Setting p4device to $p4device
;;
-p4echo=*)
p4echo=`echo $arg|sed 's/-p4echo=//'`
echo $p4echo
;;
-p4make=*)
p4make=`echo $arg|sed 's/-p4make=//'`
echo Setting p4make to $p4make
;;
-alog=*)
p4alog=`echo $arg|sed 's/-alog=//'`
echo Setting p4alog to $p4alog
;;
-p4comm=*)
p4comm=`echo $arg|sed 's/-p4comm=//'`
eval "p4comm_`echo $p4comm`=1"
echo Setting p4comm to $p4comm
;;
-dprintfl=*)
p4dprintfl=`echo $arg|sed 's/-dprintfl=//'`
echo Setting p4dprintfl to $p4dprintfl
;;
-dlast)
MDEP_CFLAGS="$MDEP_CFLAGS -DUSE_HOLD_LAST_DEBUG -DUSE_PRINT_LAST_ON_SIGINT
-DUSE_PRINT_LAST_ON_ERROR"
;;
-rsh=*)
RSHCOMMAND=`echo A$arg|sed 's/A-rsh=//'`
echo Setting RSHCOMMAND to $RSHCOMMAND
;;
-rshnol)
RSHNOL=1
;;
-cflags=*)
USER_CFLAGS="`echo A$arg|sed 's/A-*cflags=//'`"
;;
-listener_pathname=*)
p4listener_pathname=`echo $arg|sed 's/-listener_pathname=//'`
echo Setting p4listener_pathname to $p4listener_pathname
;;
-listenersig=*)
listener_sig=`echo A$arg|sed -e 's/A-listenersig=//g'`
;;
-threaded_list*|-enable-threaded_list*|--enable-threaded-list*)
threaded_listener=1
userSet_threaded_listener=1
;;
-nothreaded_list*|-disable-threaded_list*|--disable-threaded-list*)
threaded_listener=0
userSet_threaded_listener=1
;;
-echo)
set -x
;;
-u | -usage)
(echo "${usage_msg}") >& 2
exit 1
;;
-opt=* | --opt=*)
package="`echo $arg|sed 's/-*opt=//'`"
OPTFLAGS=$package
;;
-cc=* | --cc=*)
CC=`echo $arg|sed 's/-*cc=//'`
USERCC=1
;;
-socksize=*|--socksize=*)
SOCKSIZE="`echo $arg|sed 's/-*socksize=//'`"
;;
-*enable-nonblockread)
use_nonblock_read=1
;;
-*disable-nonblockread)
use_nonblock_read=0
;;
-enable-g | --enable-g | --enable-g=* | -enable-g=* )
OPTFLAGS="$OPTFLAGS -g"
;;
-disable-g | --disable-g )
;;
-enable-lazy-gethostbyname | --enable-lazy-gethostbyname )
# If enabled, gethostbyname is called only when needed for
# a connection, rather than for all processes
enable_lazy_gethostbyname="yes"
;;
-disable-lazy-gethostbyname | --disable-lazy-gethostbyname )
enable_lazy_gethostbyname="no"
;;
-enable-nonblocking-listener | --enable-nonblocking-listener )
enable_nonblocking_listener=yes
;;
-disable-nonblocking-listener | --disable-nonblocking-listener )
enable_nonblocking_listener=no
;;
-enable-yield|--enable-yield)
if test -z "$ac_optarg" ; then ac_optarg=yes ; fi
enable_yield=$ac_optarg
;;
-disable-yield|--disable-yield)
enable_yield=no
;;
-*enable-*)
# ignore unrecognized options
:
;;
-*disable-*)
# ignore unrecognized options
:
;;
*)
# Allow null args
if test -n "$arg" ; then
echo "Invalid p4 configure option $arg"
(echo "${usage_msg}") >& 2
exit 1;
fi
;;
esac
done
if test -z "$p4arch" ; then
echo "You must set a P4 architecture with -p4arch=name"
exit 1
fi
P4ARCH="unknown"
MAKE=make
CLINKER=$CC
FLINKER=$FC
AR="ar lruv"
RM=/bin/rm
P4_OBJ="\$(P4_COMM_OBJ) \$(P4_SOCK_OBJ) \$(P4_SHMEM_OBJ)"
#
# date might include various quotes. Just to be safe, remove anything
# other than letters, numbers, space, and colon.
P4_CONFIGURED_TIME="`date | sed -e 's/[^a-zA-Z0-9: ]//g'`"
DEFINE_ALOG="#undef ALOG_TRACE"
DEFINE_SYSV_IPC="#undef SYSV_IPC"
DEFINE_VENDOR_IPC="#undef VENDOR_IPC"
DEFINE_P4_DPRINTFL="#define P4_DPRINTFL"
LISTENER_PATHNAME=""
]
# It is important to remove the p4_config.h file if we are performing
# a VPATH build (the include target is a link)
rm -f config.log p4_config.h include/p4_config.h
AC_PREPARE()
# Check for valid options
if test "$p4device" = "ch_p4mpd" -a "$p4comm" = "shared" ; then
AC_MSG_ERROR([P4mpd does not support comm=shared])
fi
# Standard directories
if test -z "$top_srcdir" -o "$top_srcdir" = "." ; then
top_srcdir="$srcdir"
fi
# Remove the config file from the srcdir if this is a VPATH build.
# (the include target is a link)
rm -f "$top_srcdir/p4_config.h" "$top_srcdir/include/p4_config.h"
AC_SUBST(top_srcdir)
if test -z "$exec_prefix" ; then
exec_prefix="${top_srcdir}"
fi
AC_SUBST(exec_prefix)
if test -z "$libdir" ; then libdir="$exec_prefix/lib" ; fi
AC_SUBST(libdir)
# libbuild_dir is used to build the libraries in before they are installed.
if test -z "$libbuild_dir" ; then
libbuild_dir=`pwd`/lib
fi
if test ! -d $libbuild_dir ; then
if mkdir $libbuild_dir ; then
:
else
print_error "Could not create directory $libbuild_dir"
exit 1
fi
fi
AC_SUBST(libbuild_dir)
AC_PROG_RANLIB()
# check for valid architecture
# Check for an EXACT match, since that's what the defines require
egrep "^ $p4arch\$" $srcdir/MACHINES > /dev/null 2>&1
if test $? != 0 ; then
echo Invalid arch $p4arch
exit 1
fi
# Now substitute the variables
if test -n "$p4make"; then
MAKE=$p4make
fi
#
if test -z "$VPATH" ; then
PAC_MAKE_VPATH
fi
# Set the device (might be either ch_p4 or ch_p4mpd, for example)
if test -n "$p4device"; then
P4DEVICE=$p4device
fi
if test "$P4DEVICE" = "ch_p4mpd" ; then
AC_DEFINE(P4_WITH_MPD,,[Define for building p4 with the MPD device])
P4_OBJ="\$(P4_COMM_OBJ) \$(P4_SOCK_OBJ) \$(P4_SHMEM_OBJ) \$(P4_MPD_OBJ)"
fi
if test -n "$p4arch_SUN"; then
P4ARCH=SUN
if test -n "$p4comm_shared"; then
DEFINE_SYSV_IPC="#define SYSV_IPC"
fi
fi
# 486 running FreeBSD
if test -n "$p4arch_FREEBSD"; then
P4ARCH=FREEBSD
if test -n "$p4comm_shared"; then
DEFINE_SYSV_IPC="#define SYSV_IPC"
fi
fi
# 486 running NetBSD
if test -n "$p4arch_NETBSD"; then
P4ARCH=NETBSD
if test -n "$p4comm_shared"; then
DEFINE_SYSV_IPC="#define SYSV_IPC"
fi
fi
# x86 running Linux
if test -n "$p4arch_LINUX"; then
P4ARCH=LINUX
if test -n "$p4comm_shared"; then
DEFINE_SYSV_IPC="#define SYSV_IPC"
fi
fi
# Alpha running Linux
if test -n "$p4arch_LINUX_ALPHA"; then
P4ARCH=LINUX
if test -n "$p4comm_shared"; then
DEFINE_SYSV_IPC="#define SYSV_IPC"
fi
fi
# KSR
if test -n "$p4arch_KSR"; then
P4ARCH=KSR
RANLIB=true
AC_HAVE_LIBRARY(rpc)
fi
# Sun running Solaris
if test -n "$p4arch_SUN_SOLARIS"; then
# We've had so many problems with the threaded listener that we are
# leaving the default as off.
#if test $userSet_threaded_listener = 0 -a -z "$p4comm_shared" ; then
# threaded_listener=1
#fi
P4ARCH=SUN_SOLARIS
AR="ar ruv"
RANLIB=true
# We might want to choose pthreads instead because of the listener....
if test -n "$p4comm_shared"; then
DEFINE_VENDOR_IPC="#define VENDOR_IPC"
AC_HAVE_LIBRARY(thread)
fi
AC_HAVE_LIBRARY(socket)
AC_HAVE_LIBRARY(nsl)
AC_MSG_CHECKING(for how many arguments gettimeofday takes)
AC_TEST_PROGRAM([#include <sys/time.h>
main() {struct timeval tp;
gettimeofday(&tp);return 0;}],
MDEP_CFLAGS="$MDEP_CFLAGS -DUSE_WIERDGETTIMEOFDAY"
AC_MSG_RESULT(one!),AC_MSG_RESULT(two - whew))
dnl PAC_IS_GETTIMEOFDAY_OK(,MDEP_CFLAGS="$MDEP_CFLAGS -DUSE_WIERDGETTIMEOFDAY")
dnl #MDEP_LIBS = /usr/ucblib/libucb.a -lsocket -lnsl # for fortran
fi
# Intel x86 running Solaris
if test -n "$p4arch_I86_SOLARIS"; then
P4ARCH=I86_SOLARIS
AR="ar ruv"
RANLIB=true
if test -n "$p4comm_shared"; then
DEFINE_VENDOR_IPC="#define VENDOR_IPC"
AC_HAVE_LIBRARY(thread)
fi
AC_HAVE_LIBRARY(socket)
AC_HAVE_LIBRARY(nsl)
AC_MSG_CHECKING(for how many arguments gettimeofday takes)
AC_TEST_PROGRAM([#include <sys/time.h>
main() {struct timeval tp;
gettimeofday(&tp);return 0;}],
MDEP_CFLAGS="$MDEP_CFLAGS -DUSE_WIERDGETTIMEOFDAY"
AC_MSG_RESULT(one!),AC_MSG_RESULT(two - whew))
dnl #MDEP_LIBS = /usr/ucblib/libucb.a -lsocket -lnsl # for fortran
fi
# HP workstation
if test -n "$p4arch_HP"; then
P4ARCH=HP
RANLIB=true
# See if we need V3 for sighold
AC_FUNC_CHECK(sighold,sighold_in_libc=yes,sighold_in_libc=no)
if test $sighold_in_libc = "no" ; then
# See if it is in V3
save_LIBS="$LIBS"
LIBS="$LIBS -lV3"
AC_FUNC_CHECK(sighold,sighold_in_libV3=yes,sighold_in_libV3=no)
if test $sighold_in_libV3 = yes ; then
# Call have_library just to force configure to add it to the
# right places
AC_HAVE_LIBRARY(V3)
else
AC_MSG_ERROR([HP currently requires the System V Release 3 libraries
(libV3.a)])
fi
fi
# nsl is required in HPUX 11 for the xdr routines
AC_HAVE_LIBRARY(nsl)
AC_HAVE_LIBRARY(U77)
# -lV3 is for sighold, etc.
MDEP_FFLAGS="+U77 +T"
if test -n "$p4comm_shared"; then
DEFINE_SYSV_IPC="#define SYSV_IPC"
fi
fi
# DEC Alpha workstation
# Possibly also Compaq OSF1 alpha
if test -n "$p4arch_ALPHA"; then
P4ARCH=ALPHA
if test -n "$p4comm_shared"; then
DEFINE_SYSV_IPC="#define SYSV_IPC"
fi
fi
# CRAY
if test -n "$p4arch_CRAY"; then
P4ARCH=CRAY
AR='ar ruv'
if test $USERCC = 0 ; then CC=cc ; fi
if test $USERF77 = 0 ; then FC=cf77 ; fi
CLINKER=$CC
FLINKER=$FC
RANLIB=true
fi
# PARAGONIP (Paragon w. Sockets)
# We use ALPHA for P4ARCH because the alpha and paragon both use OSF/1
if test -n "$p4arch_PARAGONIP"; then
P4ARCH=ALPHA
AC_HAVE_LIBRARY(rpc)
AR='ar860 r'
if test $USERCC = 0 ; then CC=icc ; fi
if test $USERF77 = 0 ; then FC=if77 ; fi
CLINKER=$CC
FLINKER=$FC
RANLIB=true
fi
# NeXT workstation
if test -n "$p4arch_NEXT"; then
P4ARCH=NEXT
MDEP_CFLAGS="" # Black hardware, with NeXTstep
#MDEP_CFLAGS="-arch i386" # for 486's running NeXTstep
#MDEP_CFLAGS="-arch m68k -arch i386" # fat binaries, for both
fi
# DEC 5000 workstation
if test -n "$p4arch_DEC5000"; then
P4ARCH=DEC5000
if test -n "$p4comm_shared"; then
DEFINE_SYSV_IPC="#define SYSV_IPC"
fi
fi
# RS6000 workstation
if test -n "$p4arch_RS6000"; then
# if test $userSet_threaded_listener = 0 -a -z "$p4comm_shared" ; then
# threaded_listener=1
# fi
P4ARCH=RS6000
FC=xlf
FLINKER=xlf
RANLIB=true
AC_HAVE_LIBRARY(bsd)
MDEP_CFLAGS=-D_ALL_SOURCE
if test -n "$p4comm_shared"; then
DEFINE_SYSV_IPC="#define SYSV_IPC"
fi
fi
# SP using TCP
if test -n "$p4arch_SP1"; then
P4ARCH=SP1
FC=xlf
FLINKER=xlf
RANLIB=true
AC_HAVE_LIBRARY(bsd)
if test -n "$p4comm_shared"; then
DEFINE_SYSV_IPC="#define SYSV_IPC"
fi
fi
# SP with MPL
if test -n "$p4arch_SP1_EUI"; then
P4ARCH=SP1_EUI
if test $USERCC = 0 ; then CC=mpcc ; fi
if test $USERF77 = 0 ; then FC=mpxlf ; fi
FLINKER=$FC
CLINKER=$CC
RANLIB=true
AC_HAVE_LIBRARY(bsd)
MDEP_CFLAGS = -I/usr/lpp/poe/include
fi
# SP with EUIH (obsolete)
if test -n "$p4arch_SP1_EUI"; then
P4ARCH=SP1_EUIH
if test $USERCC = 0 ; then CC=cc ; fi
if test $USERF77 = 0 ; then FC=xlf ; fi
FLINKER="xlf -bimport:/usr/lpp/euih/eui/eui.exp"
CLINKER="xlc -bimport:/usr/lpp/euih/eui/eui.exp -e main"
RANLIB=true
AC_HAVE_LIBRARY(bsd)
MDEP_CFLAGS=-D_ALL_SOURCE
fi
# SGI workstations
if test -n "$p4arch_SGI"; then
P4ARCH=SGI
RANLIB=true
# Look for getpwnam. If not found, try to find it in -lsun
AC_FUNC_CHECK(getpwnam,has_getpwnam=1,has_getpwnam=0)
if test $has_getpwnam = 0 ; then
AC_HAVE_LIBRARY(sun)
fi
dnl MDEP_CFLAGS=-cckr
if test -n "$p4comm_shared"; then
DEFINE_VENDOR_IPC="#define VENDOR_IPC"
fi
fi
# temporary until complete SGI fixup: accept SGI5 as valid arch
# SGI workstations with IRIX 5
if test -n "$p4arch_SGI5"; then
P4ARCH=SGI
RANLIB=true
AC_FUNC_CHECK(getpwnam,has_getpwnam=1,has_getpwnam=0)
if test $has_getpwnam = 0 ; then
AC_HAVE_LIBRARY(sun)
fi
dnl MDEP_CFLAGS=-cckr
if test -n "$p4comm_shared"; then
DEFINE_VENDOR_IPC="#define VENDOR_IPC"
fi
fi
#
# Force 32-bit objects
if test -n "$p4arch_SGI32"; then
P4ARCH=SGI
RANLIB=true
AC_FUNC_CHECK(getpwnam,has_getpwnam=1,has_getpwnam=0)
if test $has_getpwnam = 0 ; then
AC_HAVE_LIBRARY(sun)
fi
# This choice of flags is for the SGI compilers. If the user chose
# gcc, they won't work.
PAC_CHECK_COMPILER_OPTION(-32,MDEP_CFLAGS="-32";MDEP_LFLAGS="-32")
PAC_CHECK_COMPILER_OPTION([-woff 1552,1174],
[MDEP_CFLAGS="$MDEP_CFLAGS -woff 1552,1174"])
MDEP_FFLAGS="-32" # -woff 1552,1174"
if test -n "$p4comm_shared"; then
DEFINE_VENDOR_IPC="#define VENDOR_IPC"
fi
fi
#
# Force 32-bit objects (other way)
if test -n "$p4arch_SGIN32"; then
P4ARCH=SGI
RANLIB=true
AC_FUNC_CHECK(getpwnam,has_getpwnam=1,has_getpwnam=0)
if test $has_getpwnam = 0 ; then
AC_HAVE_LIBRARY(sun)
fi
# This choice of flags is for the SGI compilers. If the user chose
# gcc, they won't work.
PAC_CHECK_COMPILER_OPTION(-n32,MDEP_CFLAGS="-n32";MDEP_LFLAGS="-n32")
PAC_CHECK_COMPILER_OPTION([-woff 1552,1174],
[MDEP_CFLAGS="$MDEP_CFLAGS -woff 1552,1174"])
MDEP_FFLAGS="-n32" # -woff 1552,1174"
if test -n "$p4comm_shared"; then
DEFINE_VENDOR_IPC="#define VENDOR_IPC"
fi
fi
# SGI workstations, IRIX 6
if test -n "$p4arch_SGI6"; then
P4ARCH=SGI
RANLIB=true
AC_FUNC_CHECK(getpwnam,has_getpwnam=1,has_getpwnam=0)
if test $has_getpwnam = 0 ; then
AC_HAVE_LIBRARY(sun)
fi
dnl MDEP_CFLAGS="-cckr -woff 1552,1174"
dnl MDEP_FFLAGS="-cckr -woff 1552,1174"
PAC_CHECK_COMPILER_OPTION([-woff 1552,1174],
[MDEP_CFLAGS="$MDEP_CFLAGS -woff 1552,1174"])
MDEP_FFLAGS="" # "-woff 1552,1174"
AC_HAVE_FUNCS(setsid)
AC_HAVE_FUNCS(isatty)
dnl A C_DEFINE(SET_NEW_PGRP)
if test -n "$p4comm_shared"; then
DEFINE_VENDOR_IPC="#define VENDOR_IPC"
fi
fi
# SGI multiprocessors, like Onyx
if test -n "$p4arch_SGI_MP"; then
P4ARCH=SGI_MP
RANLIB=true
AC_FUNC_CHECK(getpwnam,has_getpwnam=1,has_getpwnam=0)
if test $has_getpwnam = 0 ; then
AC_HAVE_LIBRARY(sun)
fi
AC_HAVE_FUNCS(setsid)
AC_HAVE_FUNCS(isatty)
dnl MDEP_CFLAGS=-cckr
if test -n "$p4comm_shared"; then
DEFINE_VENDOR_IPC="#define VENDOR_IPC"
fi
fi
# SGI Challenge Series
if test -n "$p4arch_SGI_CH"; then
P4ARCH=SGI_CH
RANLIB=true
AC_HAVE_FUNCS(setsid)
AC_HAVE_FUNCS(isatty)
dnl MDEP_CFLAGS="-cckr -64 -mips3 -woff 1552,1174" # -non_shared
dnl MDEP_FFLAGS="-cckr -64 -mips3 -woff 1552,1174" # -non_shared
PAC_CHECK_COMPILER_OPTION(-64,MDEP_CFLAGS="-64";MDEP_LFLAGS="-64")
PAC_CHECK_COMPILER_OPTION(-mips3,MDEP_CFLAGS="$MDEP_CFLAGS -mips3")
PAC_CHECK_COMPILER_OPTION([-woff 1552,1174],
[MDEP_CFLAGS="$MDEP_CFLAGS -woff 1552,1174"])
dnl MDEP_CFLAGS="-64 -mips3 -woff 1552,1174" # -non_shared
MDEP_FFLAGS="-64 -mips3" # -woff 1552,1174" # -non_shared
if test -n "$p4comm_shared"; then
DEFINE_VENDOR_IPC="#define VENDOR_IPC"
fi
fi
# SGI Challenge Series
if test -n "$p4arch_SGI_CH32"; then
P4ARCH=SGI_CH
RANLIB=true
AC_HAVE_FUNCS(setsid)
AC_HAVE_FUNCS(isatty)
PAC_CHECK_COMPILER_OPTION(-n32,MDEP_CFLAGS="-n32";MDEP_LFLAGS="-n32")
PAC_CHECK_COMPILER_OPTION([-woff 1552,1174],
[MDEP_CFLAGS="$MDEP_CFLAGS -woff 1552,1174]")
MDEP_FFLAGS="-n32" # -woff 1552,1174"
if test -n "$p4comm_shared"; then
DEFINE_VENDOR_IPC="#define VENDOR_IPC"
fi
fi
# SGI Power Challenge Series
if test -n "$p4arch_SGI_CH64"; then
P4ARCH=SGI_CH64
RANLIB=true
dnl MDEP_CFLAGS="-cckr -64 -mips4 -woff 1552,1174"# -non_shared
dnl MDEP_FFLAGS="-cckr -64 -mips4 -woff 1552,1174"# -non_shared
PAC_CHECK_COMPILER_OPTION(-64,MDEP_CFLAGS="-64";MDEP_LFLAGS="-64")
PAC_CHECK_COMPILER_OPTION(-mips4,MDEP_CFLAGS="$MDEP_CFLAGS -mips4")
PAC_CHECK_COMPILER_OPTION([-woff 1552,1174],
[MDEP_CFLAGS="$MDEP_CFLAGS -woff 1552,1174]")
MDEP_FFLAGS="-64 -mips4" # -woff 1552,1174"
AC_HAVE_FUNCS(setsid)
AC_HAVE_FUNCS(isatty)
if test -n "$p4comm_shared"; then
DEFINE_VENDOR_IPC="#define VENDOR_IPC"
fi
fi
# UXPM (MPIS chip)
if test -n "$p4arch_UXPM"; then
# Make it think that it is an IRIX v5 SGI
P4ARCH=SGI
RANLIB=true
LIBS="$LIBS -lsocket -lnsl"
MDEP_CFLAGS="-DNEEDS_NETINET"
fi
# UXPV (Fujitsu VX,VPP300,VPP700)
if test -n "$p4arch_UXPV"; then
# Make it think that it is an IRIX v5 SGI
P4ARCH=SGI
RANLIB=true
LIBS="$LIBS -lsocket -lnsl"
MDEP_CFLAGS="-DNEEDS_NETINET"
fi
# Symmetry with Dynix
if test -n "$p4arch_SYMMETRY"; then
P4ARCH=SYMMETRY
FILE_LINK=ln
FC=fortran
CLINKER="cc -Z1000000"
FLINKER="fortran -Z1000000"
LIBS="$LIBS -lpps -lseq"
MDEP_CFLAGS=
MDEP_FFLAGS=
fi
# Symmetry with PTX
if test -n "$p4arch_SYMMETRY_PTX"; then
P4ARCH=SYMMETRY_PTX
FILE_LINK=ln
FC=fortran
FLINKER=fortran
RANLIB=true
LIBS="$LIBS -lpps -lseq -lrpc -lsocket -linet -lnsl"
MDEP_CFLAGS="-Wc,-seq"
fi
#
# dump copy of MDEP_CFLAGS into file for other system to pick up
/bin/rm -f mpdepcflags
echo $MDEP_CFLAGS > mdepcflags
# evaluate variables for p4_config.h
if test "$p4alog" = "on"; then
DEFINE_ALOG="#define ALOG_TRACE"
fi
if test "$p4dprintfl" = "off"; then
DEFINE_P4_DPRINTFL="#undef P4_DPRINTFL"
fi
if test -n "$p4listener_pathname"; then
LISTENER_PATHNAME="$p4listener_pathname"
fi
#
# Check for cross-compilation.
AC_CROSS_CHECK()
#
# We must check for the threaded listener early because it selects
# POSIX source, which can change the results of the tests for headers and
# features.
#
if test $threaded_listener = 1 ; then
# Try to find a thread package
has_pthread=0
PAC_CHECK_HEADER(pthread.h,[AC_DEFINE(HAVE_PTHREAD_H)
has_pthread=1])
if test $has_pthread = 1 ; then
has_pthread=0
AC_HAVE_LIBRARY(pthread,has_pthread=1)
if test $has_pthread = 1 ; then
# Could also check for pthread_create
AC_DEFINE(THREAD_LISTENER)
AC_DEFINE(USE_PTHREADS)
# We need this to ensure that things like errno are thread safe.
AC_DEFINE(_POSIX_C_SOURCE,199506L)
AC_DEFINE(_POSIX_SOURCE)
# In order to use XDR, we may also need to define __EXTENSIONS__
# or other awful things.
# __EXTENSIONS__ is needed for Solaris
AC_DEFINE(__EXTENSIONS__)
if test -n "$p4arch_LINUX"; then
# terrible hack for now: enable other features that we
# expect on a LINUX platform
AC_DEFINE(_SVID_SOURCE)
AC_DEFINE(_BSD_SOURCE)
fi
LIBS="$LIBS -lpthread"
echo "Using threaded listener"
fi
fi
fi
#
# Look for netinet/in.h and sys/socketvar.h
has_rpc_rpc=0
PAC_CHECK_HEADERS(rpc/rpc.h,has_rpc_rpc=1)
has_netinet_in=0
PAC_CHECK_HEADERS(netinet/in.h,has_netinet_in=1)
PAC_CHECK_HEADERS(arpa/inet.h)
PAC_CHECK_HEADERS(sys/socketvar.h)
PAC_CHECK_HEADERS(stdlib.h)
PAC_CHECK_HEADERS(unistd.h)
PAC_CHECK_HEADERS(string.h)
PAC_CHECK_HEADERS(strings.h)
PAC_CHECK_HEADERS(termio.h termios.h)
PAC_CHECK_HEADERS(sys/types.h sys/wait.h)
#
# In some cases, we need both string.h and strings.h . Some systems
# apparently complain, so we try to include them both
AC_MSG_CHECKING(that string.h and strings.h can be included)
AC_TEST_PROGRAM([#include <strings.h>
#include <string.h>
main() {return 0;}],
AC_MSG_RESULT(yes)
AC_DEFINE(BOTH_STRING_INCS),AC_MSG_RESULT(no))
#
if test "$has_rpc_rpc" = 1 ; then
# does it really?
# (gcc on Solaris 5.6 sometimes fails, particularly when OS was upgraded
# from 5.5 to 5.6 but gcc was not reinstalled).
AC_COMPILE_CHECK([correct headers with rpc/rpc.h],[
#include <sys/types.h>
#include <rpc/rpc.h>]
,return 0;,,cc_broken=1)
if test "$cc_broken" = 1; then
echo "Your C compiler $CC fails to compile the program"
echo "#include <sys/types.h>"
echo "#include <rpc/rpc.h>"
echo "If you are using gcc, make sure that the system include"
echo "files and the gcc include files are consistent. If "
echo "you have upgraded the OS, you may need to reinstall gcc"
exit 1
fi
fi
if test "$has_netinet_in" = 1 ; then
# does it really?
# (gcc on Solaris 5.6 sometimes fails, particularly when OS was upgraded
# from 5.5 to 5.6 but gcc was not reinstalled).
AC_COMPILE_CHECK([correct headers with netinet/in.h],[
#include <sys/types.h>
#include <netinet/in.h>]
,return 0;,,cc_broken=1)
if test "$cc_broken" = 1; then
echo "Your C compiler $CC fails to compile the program"
echo "#include <sys/types.h>"
echo "#include <netinet/in.h>"
echo "If you are using gcc, make sure that the system include"
echo "files and the gcc include files are consistent. If "
echo "you have upgraded the OS, you may need to reinstall gcc"
exit 1
fi
fi
#
# It isn't enough to check for stdarg. Even gcc doesn't get it right;
# on some systems, the gcc version of stdio.h loads stdarg.h WITH THE WRONG
# OPTIONS (causing it to choose the OLD STYLE va_start etc).
#
PAC_STDARG(AC_DEFINE(USE_STDARG),AC_DEFINE(USE_OLDSTYLE_STDARG))
#
# We need to check that these functions are also available to
# the other compilers (C++ and Fortran). For Solaris /usr/ucb/cc, these
# are found but not for the stock C++ and Fortran compilers.
#
# Another grungy problem. Even though some systems support sighold,
# the library might have various problems. Sigaction should be used instead
# if it is present.
AC_HAVE_FUNCS(sigprocmask sigemptyset sigaddset)
AC_HAVE_FUNCS(sighold)
AC_HAVE_FUNCS(sigsetmask)
AC_HAVE_FUNCS(sigblock)
# Look for sigaction routine (instead of signal)
AC_HAVE_FUNCS(sigaction)
AC_COMPILE_CHECK(for struct sigaction,[#include <signal.h>],[
struct sigaction act; sigaddset( &act.sa_mask, SIGINT );return
0;],sigaction_ok="yes",sigaction_ok="no")
# XOPEN mandates that union semun NOT be defined(!)
# The return 0 works around a but in ac compile check (the test is in a
# function with no return value)
AC_COMPILE_CHECK(for union semun,[#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/sem.h>],[
union semun arg;arg.val=0;return 0;],,AC_DEFINE(SEMUN_UNDEFINED))
# strerror is prefered over extern char *sys_errlist[];
#
# See if we can use an int in semctl or if we need the union
AC_COMPILE_CHECK([whether semctl needs union semun],[#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/sem.h>],[
int arg = 0; semctl( 1, 1, SETVAL, arg );return 0;],AC_DEFINE(SEMCTL_ARG_UNION))
#
AC_HAVE_FUNCS(strerror)
#
# Check to see if we need to define sys_errlist. We do this by defining it
# badly, and then checking for an error.
AC_COMPILE_CHECK([whether sys_errlist needs do be defined],
[#include <string.h>]
,[extern short sys_errlist;],,AC_DEFINE(NEEDS_SYS_ERRLIST))
#
AC_HAVE_LIBRARY(crypt,CRYPT_LIBS=-lcrypt)
# Look for vprintf
AC_HAVE_FUNCS(vprintf)
PAC_CHECK_HEADERS(sys/uio.h)
AC_HAVE_FUNCS(writev)
#
# Yield handling
use_select_yield=no
have_sched_yield=no
use_yield=no
# Test for sched_yield here since we need the answer in two places
# Solaris hides sched_yield in the rt library
PAC_CHECK_HEADERS(sched.h)
AC_CHECK_FUNC(sched_yield,have_sched_yield=yes)
if test "$have_sched_yield" = "no" ; then
# try with -lrt (Solaris)
save_LIBS="$LIBS"
LIBS="$LIBS -lrt"
AC_CHECK_FUNC(sched_yield,have_sched_yield=yes)
if test "$have_sched_yield" = "no" ; then
LIBS="$save_LIBS"
fi
fi
case $enable_yield in
no)
# Do nothing
;;
yes|sched_yield)
if test "$have_sched_yield" = "yes" ; then
AC_DEFINE(USE_SCHED_YIELD,,[define to use POSIX sched_yield])
use_yield=yes
else
# Hook to allow us to make this the alternate default
use_select_yield=no
fi
;;
sginap)
AC_CHECK_FUNC(sginap,
AC_DEFINE(USE_SGINAP_YIELD,,[define to use sginap to yield]))
;;
yield)
# AIX 4.2 has yield
AC_CHECK_FUNC(yield,
AC_DEFINE(USE_YIELD_YIELD,,[define to use yield to yield]))
;;
select)
# Assume that we can always use select
use_select_yield=yes
use_yield=yes
;;
dynamic)
if test "$have_sched_yield" = "yes" ; then
AC_DEFINE(USE_DYNAMIC_YIELD,,[define to dynamically select yield])
use_yield=yes
fi
;;
*)
AC_MSG_WARN([Unrecognized yield method $enable_yield])
;;
esac
if test "$use_select_yield" = "yes" ; then
AC_DEFINE(USE_SELECT_YIELD,,[define to use select to yield])
fi
if test "$use_yield" = "yes" ; then
AC_DEFINE(USE_YIELD,,[define to yield in the communication calls])
fi
dnl #
dnl # Check that nonblocking read works:
dnl # Early SYSV (R2) had a design problem with nonblocking sockets:
dnl # there was no way to distinquish between EOF and no data on socket.
dnl # This code tests for this case; if an EOF on the socket gives the
dnl # correct value (-1), we note this. If it fails, there is code in
dnl # p4 to work around this design bug, but it can introduce performance
dnl # penalties.
dnl if test -s $top_srcdir/readblock.c -a $use_nonblock_read = 1 ; then
dnl AC_MSG_CHECKING([that read O_NDELAY works])
dnl readworks=0
dnl AC_TEST_PROGRAM([`cat $top_srcdir/readblock.c`],readworks=1)
dnl if test $readworks = 1 ; then
dnl AC_MSG_RESULT(yes)
dnl AC_DEFINE(NONBLOCKING_READ_WORKS)
dnl else
dnl AC_MSG_RESULT(no)
dnl fi
dnl fi
#
# Test for sgttyb and the ability to set noecho on terminals
PAC_COMPILE_CHECK_FUNC(echo off supported with sgttyb,[
#include <stdio.h>
#ifdef FREEBSD
#include <sys/ioctl_compat.h>
#else
#include <sys/ioctl.h>
#endif
static struct sgttyb orig_tty;
int main() { struct sgttyb tty_new;
ioctl(0, TIOCGETP, &orig_tty);
tty_new = orig_tty;
tty_new.sg_flags &= ~(ECHO);
ioctl(0, TIOCSETP, &tty_new);
return 0;}],,AC_DEFINE(NO_ECHO))
if test -n "$RSHCOMMAND" ; then
AC_DEFINE(HAS_RSHCOMMAND)
# Check for arguments (actually the blanks separating them) in the command
tst=`echo "$RSHCOMMAND" | sed -e 's/ /-/g'`
if test "$tst" != "$RSHCOMMAND" ; then
AC_DEFINE(RSH_NEEDS_OPTS)
fi
fi
if test -n "$RSHNOL" ; then
AC_DEFINE(RSH_HAS_NO_L)
fi
#
#
# The following are necessary for AIX in particular because in 64 bit mode,
# some of the socket functions use size_t (unsigned long, 64 bits) instead of
# int (signed int, 32 bits) as a return value. Getting the wrong type
# causes all sorts of chaos. Unfortunately, there isn't any consensus on what
# the arguments *should* be.
found_sockopt_type=0
AC_COMPILE_CHECK([if getsockopt wants socklen_t],[#include <sys/types.h>
#include <sys/socket.h>],[socklen_t dummy; int rc, skt=0; void *ssz=0;
rc = getsockopt(skt,SOL_SOCKET,SO_SNDBUF,ssz,&dummy);return 0;],found_sockopt_type=1)
if test $found_sockopt_type = 1 ; then
MDEP_CFLAGS="$MDEP_CFLAGS -DUSE_SOCKLEN_T"
fi
if test $found_sockopt_type = 0 ; then
# This case is harder. size_t is a valid type, but it may not be the
# one that getsockopt etc wants.
AC_MSG_CHECKING([if getsockopt wants size_t])
PAC_TRY_COMPILE_CLEAN([#include <sys/types.h>
#include <sys/socket.h>],[int try(void){size_t dummy; int rc, skt=0; void *ssz=0;
rc = getsockopt(skt,SOL_SOCKET,SO_SNDBUF,ssz,&dummy);
return rc;}],found_sockopt_type)
case $found_sockopt_type in
0) AC_MSG_RESULT(yes)
MDEP_CFLAGS="$MDEP_CFLAGS -DUSE_SIZE_T_FOR_SOCKLEN_T"
;;
1) AC_MSG_RESULT([no (warnings from compiler)])
;;
2) AC_MSG_RESULT(no)
;;
esac
fi
if test "$enable_lazy_gethostbyname" = "yes" ; then
AC_DEFINE(LAZY_GETHOSTBYNAME)
fi
if test "$enable_nonblocking_listener" = "yes" ; then
AC_DEFINE(USE_NONBLOCKING_LISTENER_SOCKETS)
fi
#
# Check whether u_int should be used for xdr_array
use_u_int=0
AC_MSG_CHECKING([if xdr_array wants u_int])
# Initialize the variables to suppress warnings about usage.
PAC_TRY_COMPILE_CLEAN([#include <rpc/xdr.h>
],[int try(void){
u_int l=0, ms=0, el=0; xdrproc_t elproc=(xdrproc_t)xdr_int; XDR *xdrs=0; int rc; char
**arrp=0;
rc = xdr_array(xdrs,arrp,&l,ms,el,elproc);
return rc;}],use_u_int)
case $use_u_int in
0) AC_MSG_RESULT(yes)
MDEP_CFLAGS="$MDEP_CFLAGS -DUSE_U_INT_FOR_XDR"
;;
1) AC_MSG_RESULT([no (compiler warnings)])
;;
2) AC_MSG_RESULT(no)
;;
esac
if test "$use_u_int" != "0" ; then
# Check whether unsigned int should be used for xdr_array
use_unsigned_int=0
AC_MSG_CHECKING([if xdr_array wants unsigned int])
PAC_TRY_COMPILE_CLEAN([#include <rpc/xdr.h>
],[int try(void){
unsigned int l=0, ms=0, el=0; xdrproc_t elproc=(xdrproc_t)xdr_int; XDR *xdrs=0; int
rc; char **arrp=0;
rc = xdr_array(xdrs,arrp,&l,ms,el,elproc);
return rc;}],use_unsigned_int)
case $use_unsigned_int in
0) AC_MSG_RESULT(yes)
MDEP_CFLAGS="$MDEP_CFLAGS -DUSE_UNSIGNED_INT_FOR_XDR"
;;
1) AC_MSG_RESULT([no (compiler warnings)])
;;
2) AC_MSG_RESULT(no)
;;
esac
fi
#
#
#
# Some systems don't include support for xdr. Check for it.
# Also, some versions of FreeBSD don't inlude xdr_float (later ones apparently
# do). Check for that as well.
AC_HAVE_FUNCS(xdrmem_create xdr_float)
AC_COMPILE_CHECK("XDR includes and functions",[#include <rpc/rpc.h>],[
int a=1;
],HAS_XDR=1,HAS_XDR=0)
if test "$HAS_XDR" = 1 ; then
AC_DEFINE(HAS_XDR)
else
print_error "XDR not available on this system"
fi
#
# If Scyld/bproc selected, (-p4comm=bproc), see if we can define it
if test -n "$p4comm_bproc" ; then
PAC_CHECK_HEADERS(sys/bproc.h)
AC_HAVE_LIBRARY(bproc)
AC_FUNC_CHECK(bproc_numnodes,AC_DEFINE(SCYLD_BEOWULF))
AC_DEFINE(P4_DO_NOT_USE_SERVER,,Define if server should never be used)
fi
#
# We do NOT add the CFLAGS and DEFS to the MDEP_CFLAGS because they are
# used ONLY in building the p4 package itself. However, we add USER_CFLAGS
# which were specified on the configure
#
CFLAGS="$USER_CFLAGS $CFLAGS $DEFS"
#MDEP_CFLAGS="$USER_CFLAGS $MDEP_CFLAGS"
#
# Set the sock_buff_size variable through the "optflags" variable
if test -n "$SOCKSIZE" ; then
OPTFLAGS="$OPTFLAGS -DSET_SOCK_BUFF_SIZE -DSOCK_BUFF_SIZE=$SOCKSIZE"
fi
if test -n "$listener_sig" ; then
LISTENER_ATTN_SIGNAL="$listener_sig"
AC_DEFINE_UNQUOTED(LISTENER_ATTN_SIGNAL,$listener_sig)
fi
dnl # Check for byte ordering
dnl PAC_WORDS_BIGENDIAN
if test "$cross_compiling" != 1 ; then
dnl Set WORDS_BIGENDIAN if MSB is first. We use this to
dnl differentiate between ia32 and non-ia32 platforms that are
dnl running portable operating systems such as Linux, Solaris, or
dnl FreeBSD. This is needed because the old P4 code associates
dnl the OS type with the architecture type
AC_WORDS_BIGENDIAN
fi
#
# Variables used by Makefile.in's:
MDEP_LIBS="$LIBS"
AC_SUBST(P4ARCH)dnl
AC_SUBST(P4DEVICE)dnl
AC_SUBST(MAKE)dnl
AC_SUBST(CC)dnl
AC_SUBST(DEFS)dnl
AC_SUBST(CFLAGS)dnl
AC_SUBST(FC)dnl
AC_SUBST(CLINKER)dnl
AC_SUBST(FLINKER)dnl
AC_SUBST(AR)dnl
AC_SUBST(RANLIB)dnl
AC_SUBST(RM)dnl
AC_SUBST(P4_OBJ)dnl
AC_SUBST(MDEP_LIBS)dnl
AC_SUBST(CRYPT_LIBS)dnl
AC_SUBST(MDEP_CFLAGS)dnl
AC_SUBST(MDEP_FFLAGS)dnl
AC_SUBST(MDEP_LFLAGS)dnl
AC_SUBST(OPTFLAGS)dnl
AC_SUBST(P4_CONFIGURED_TIME)dnl
AC_SUBST(DEFINE_ALOG)dnl
AC_SUBST(DEFINE_SYSV_IPC)dnl
AC_SUBST(DEFINE_VENDOR_IPC)dnl
AC_SUBST(DEFINE_P4_DPRINTFL)dnl
AC_SUBST(LISTENER_PATHNAME)dnl
AC_SUBST(RSHCOMMAND)dnl
AC_OUTPUT(Makefile lib/Makefile alog/Makefile usc/Makefile \
usc/usctest/Makefile messages/Makefile include/Makefile \
lib_f/Makefile contrib/Makefile contrib_f/Makefile bin/Makefile \
doc/Makefile messages_f/Makefile misc/Makefile monitors/Makefile \
servers/Makefile)
#
# ch_p4mpd device uses only the files Makefile lib/Makefile alog/Makefile
# usc/Makefile usc/usctest/Makefile include/Makefile lib_f/Makefile
# bin/Makefile servers/Makefile)
dnl
dnl This code removes that stupid first line placed by ac_output
dnl p4_config.h needs to be in the top-level directory so that VPATH will
dnl work correctly
PAC_OUTPUT_EXEC(p4_config.h)