1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273
|
#
# $Id$
#
# Copyright (C) 2000-2002 Regents of the University of California
# See ./DISCLAIMER
#
# This file is to be processed with autoconf to generate a configure script.
AC_INIT([pdsh],
m4_esyscmd([dpkg-parsechangelog -SVersion | sed 's/-[^-]*$//']))
AC_CONFIG_SRCDIR([pdsh])
AC_CONFIG_AUX_DIR([config])
AC_CONFIG_MACRO_DIR([config])
AC_CONFIG_SRCDIR([src/pdsh/dsh.h])
AC_CANONICAL_TARGET
AC_GPL_LICENSED
# hack to fix dejagnu.am brokenness before automake 1.6
if test x$host_alias = x ; then
host_alias=$host_cpu
fi
#
# Automake support
#
AM_INIT_AUTOMAKE([no-define])
AM_SILENT_RULES([yes])
AC_CONFIG_HEADERS([config.h])
AM_MAINTAINER_MODE
AX_CODE_COVERAGE
#
# Checks for programs.
#
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_DEBUG
LT_INIT
AM_CONDITIONAL(WITH_GNU_LD, test "$with_gnu_ld" = "yes")
#
# Do we want static modules?
#
AC_ARG_ENABLE([static-modules],
AS_HELP_STRING([--enable-static-modules],[Build static modules]),
ac_static_modules=yes)
AM_CONDITIONAL(WITH_STATIC_MODULES, test "$ac_static_modules" = "yes")
if test "$ac_static_modules" = "yes" ; then
AC_DEFINE_UNQUOTED(STATIC_MODULES, [1], [Use Static Modules])
AC_STATIC_MODULES_INIT
else
case "$host" in
*-*-aix*)
LDFLAGS="$LDFLAGS -Wl,-brtl -Wl,-bexpall"
AIX_PDSH_LDFLAGS="-Wl,-bgcbypass:1000" # hack to ensure no gc in libcommon
AC_DEFINE(_AIX, 1, [Define if on AIX])
;;
*-*-solaris*)
AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, [POSIX pthread semantics on Solaris])
;;
*-*-hpux*)
LDFLAGS="$LDFLAGS -Wl,-E"
;;
esac
fi
AC_SUBST(AIX_PDSH_LDFLAGS)
# Checks for libraries.
AC_CHECK_LIB([socket], [socket], LIBS="-lsocket -lnsl $LIBS",, [-lsocket -lnsl])
# Check for how to compile pthread programs:
ACX_PTHREAD
if test x"$acx_pthread_ok" = "xno"; then
AC_MSG_ERROR([Could not figure out how to compile with pthreads.])
fi
AC_DEFINE(WITH_PTHREADS, 1, [Define if you have pthreads])
# PTHREAD_CFLAGS needs to be appended to both LDFLAGS and CPPFLAGS or some
# checks for headers may fail later on (e.g. on OSF systems where -pthread
# is required in order to include pthread.h)
LDFLAGS="$LDFLAGS $PTHREAD_CFLAGS"
CPPFLAGS="$CPPFLAGS $PTHREAD_CFLAGS"
LIBS="$PTHREAD_LIBS $LIBS"
# Checks for header files.
AC_CHECK_HEADERS([fcntl.h strings.h sys/file.h unistd.h features.h \
pthread.h poll.h sys/poll.h sys/sysmacros.h, sys/uio.h])
# Checks for typedefs, structures, and compiler characteristics.
TYPE_SOCKLEN_T
AC_SYS_LARGEFILE
AC_MSGHDR_ACCRIGHTS
# Checks for library functions.
dnl AC_FUNC_MALLOC
AC_FUNC_STRERROR_R
AC_CHECK_FUNCS([strerror pthread_sigmask sigthreadmask rresvport rresvport_af atoi])
#
# Check for poll vs. select()
#
AC_POLLSELECT
#
# Test for default pdsh fanout and connect timeout
#
AC_FANOUT
AC_CONNECT_TIMEOUT
#
# Test for inclusion of standard "rsh" module
#
AC_RSH
AM_CONDITIONAL(WITH_RSH, [test "$ac_with_rsh" = "yes"])
#
# Test for inclusion of standard "xcpu" module
#
AC_XCPU
AM_CONDITIONAL(WITH_XCPU, [test "$ac_with_xcpu" = "yes"])
#
# Test for ssh
#
AC_SSH
AM_CONDITIONAL(WITH_SSH, test "$ac_have_ssh" = "yes")
#
# Test for exec
#
AC_EXEC
AM_CONDITIONAL(WITH_EXEC, test "$ac_have_exec" = "yes")
#
# Test for kerberos
#
AC_KRB4
AM_CONDITIONAL(WITH_KRB4, test "$ac_have_krb4" = "yes")
#
# Test for whether to build "machines" module.
#
AC_MACHINES
AM_CONDITIONAL(WITH_MACHINES, [test "$ac_have_machines" = "yes"])
#
# Check for genders
#
AC_GENDERS
AM_CONDITIONAL(WITH_LIBGENDERS, [test "$ac_have_libgenders" = "yes"])
#
# Check for nodeupdown
#
AC_NODEUPDOWN
AM_CONDITIONAL(WITH_NODEUPDOWN, [test "$ac_have_libnodeupdown" = "yes"])
#
# Check for libmunge and mrsh
#
AC_MRSH
AM_CONDITIONAL(WITH_LIBMUNGE, [test "$ac_have_libmunge" = "yes"])
AM_CONDITIONAL(WITH_MRSH, [test "$ac_have_mrsh" = "yes"])
#
# Determine whether to build SLURM module (support running under SLURM jobid
#
AC_SLURM
AM_CONDITIONAL([WITH_SLURM], [test "$ac_have_slurm" = "yes"])
#
# Determine whether to to build Torque mudule (support running under Torque jobid)
#
AC_TORQUE
AM_CONDITIONAL([WITH_TORQUE], [test "$ac_have_torque" = "yes"])
#
# Determine whether to build dshgroup module
# (support dsh-style /etc/dsh/group/%s ~/.dsh/group/%s files)
#
AC_DSHGROUP
AM_CONDITIONAL([WITH_DSHGROUP], [test "$ac_with_dshgroup" = "yes"])
AC_NETGROUP
AM_CONDITIONAL([WITH_NETGROUP], [test "$ac_with_netgroup" = "yes"])
dnl
dnl check for whether to include readline support
dnl
AC_READLINE
AM_CONDITIONAL([WITH_READLINE], [test "$ac_with_readline" = "yes"])
dnl
dnl check for inclusion of Dmalloc.
dnl Note: this macro defines WITH_DMALLOC for us.
dnl
AC_DMALLOC
#
# Check for alternate rcmd rank list:
#
AC_RCMD_RANK_LIST
if test "$ac_static_modules" = "yes" ; then
AC_STATIC_MODULES_EXIT
fi
#
# Build PDSH_VERSION string
#
test "$ac_static_modules" = "yes" && EXTRA_VERS="+static-modules"
test "$ac_with_readline" = "yes" && EXTRA_VERS="${EXTRA_VERS}+readline"
test "$ac_debug" = "yes" && EXTRA_VERS="${EXTRA_VERS}+debug"
test "$ac_with_dmalloc" = "yes" && EXTRA_VERS="${EXTRA_VERS}+dmalloc"
if test -n "$EXTRA_VERS" ; then
PDSH_VERSION_FULL="$PACKAGE_NAME-$PACKAGE_VERSION ($EXTRA_VERS)"
else
PDSH_VERSION_FULL="$PACKAGE_NAME-$PACKAGE_VERSION"
fi
AC_SUBST(PDSH_VERSION)
AC_SUBST(PDSH_VERSION_FULL)
AC_DEFINE(WITH_LSD_FATAL_ERROR_FUNC, 1, [Have definition of lsd_fatal_error])
AC_DEFINE(WITH_LSD_NOMEM_FUNC, 1, [Have definition of lsd_nomem_error])
AH_BOTTOM(
[#ifdef WITH_DMALLOC
# include <stdlib.h>
# include <dmalloc.h>
#endif /* WITH_DMALLOC */]
)
# Should probably be defining tests for these - cheat for now
AH_BOTTOM(
[#ifdef _AIX
# define HAVE_MTSAFE_GETHOSTBYNAME 1
# define HAVE_MAGIC_RSHELL_CLEANUP 1
# define WANT_RECKLESS_HOSTRANGE_EXPANSION 1
#else
# define HAVE_MTSAFE_GETHOSTBYNAME 0
# define HAVE_MAGIC_RSHELL_CLEANUP 0
# define WANT_RECKLESS_HOSTRANGE_EXPANSION 0
#endif /* _AIX */]
)
AC_CONFIG_FILES([
Makefile
config/Makefile
src/Makefile
src/common/Makefile
src/pdsh/Makefile
src/modules/Makefile
doc/Makefile
scripts/Makefile
tests/Makefile
tests/test-modules/Makefile
doc/pdcp.1
doc/pdsh.1
]
)
AC_OUTPUT
|