PageRenderTime 23ms CodeModel.GetById 19ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/configure.ac

https://code.google.com/
m4 | 331 lines | 167 code | 51 blank | 113 comment | 0 complexity | e4378ab1a75f8099ff47a83b78d041f8 MD5 | raw file
  1# 
  2# $Id$
  3#
  4# Copyright (C) 2000-2002 Regents of the University of California
  5# See ./DISCLAIMER
  6#
  7# This file is to be processed with autoconf to generate a configure script.
  8
  9AC_INIT([pdsh])
 10X_AC_META
 11AC_CONFIG_AUX_DIR([config])
 12AC_CONFIG_SRCDIR([src/pdsh/dsh.h])
 13AC_CANONICAL_SYSTEM
 14AC_GPL_LICENSED
 15
 16# hack to fix dejagnu.am brokenness before automake 1.6
 17if test x$host_alias = x ; then
 18   host_alias=$host_cpu
 19fi
 20
 21#
 22#  Automake support
 23# 
 24AM_INIT_AUTOMAKE([$META_NAME], [$VERSION], [no-define])
 25AM_CONFIG_HEADER([config.h])
 26AM_MAINTAINER_MODE
 27
 28#
 29# Checks for programs.
 30#
 31AC_PROG_CC
 32AC_PROG_INSTALL
 33AC_PROG_LN_S
 34AC_PROG_MAKE_SET
 35AC_DEBUG
 36
 37#
 38# Libtool and ltld.[ch] support
 39#
 40AC_LIBTOOL_DLOPEN
 41AC_PROG_LIBTOOL
 42AC_LIB_LTDL
 43
 44AM_CONDITIONAL(WITH_GNU_LD, test "$with_gnu_ld" = "yes")
 45
 46
 47#
 48# Do we want static modules?
 49#
 50AC_ARG_ENABLE([static-modules],
 51              AC_HELP_STRING([--enable-static-modules], [Build static modules]),
 52              ac_static_modules=yes)
 53AM_CONDITIONAL(WITH_STATIC_MODULES, test "$ac_static_modules" = "yes")
 54
 55if test "$ac_static_modules" = "yes" ; then
 56   AC_DEFINE_UNQUOTED(STATIC_MODULES, [1], [Use Static Modules])
 57   AC_STATIC_MODULES_INIT
 58else
 59   case "$host" in
 60   *-*-aix*)
 61     LDFLAGS="$LDFLAGS -Wl,-brtl -Wl,-bexpall" 
 62	 AIX_PDSH_LDFLAGS="-Wl,-bgcbypass:1000" # hack to ensure no gc in libcommon
 63	 AC_DEFINE(_AIX, 1, [Define if on AIX])
 64   ;;
 65   *-*-solaris*)
 66   	 AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, [POSIX pthread semantics on Solaris])
 67   ;;
 68   *-*-hpux*)
 69     LDFLAGS="$LDFLAGS -Wl,-E"
 70   ;;
 71   esac
 72fi
 73AC_SUBST(AIX_PDSH_LDFLAGS)
 74
 75
 76# Checks for libraries.
 77AC_CHECK_LIB([socket], [socket], LIBS="-lsocket -lnsl $LIBS",, [-lsocket -lnsl])
 78
 79# Check for how to compile pthread programs:
 80ACX_PTHREAD
 81AC_DEFINE(WITH_PTHREADS, 1, [Define if you have pthreads])
 82
 83# PTHREAD_CFLAGS needs to be appended to both LDFLAGS and CPPFLAGS or some
 84# checks for headers may fail later on (e.g. on OSF systems where -pthread
 85# is required in order to include pthread.h)
 86LDFLAGS="$LDFLAGS $PTHREAD_CFLAGS"
 87CPPFLAGS="$CPPFLAGS $PTHREAD_CFLAGS"
 88LIBS="$PTHREAD_LIBS $LIBS"
 89
 90# Checks for header files.
 91AC_CHECK_HEADERS([fcntl.h strings.h sys/file.h unistd.h features.h \
 92                  pthread.h poll.h sys/poll.h sys/sysmacros.h, sys/uio.h])
 93
 94# Checks for typedefs, structures, and compiler characteristics.
 95TYPE_SOCKLEN_T
 96AC_SYS_LARGEFILE
 97AC_MSGHDR_ACCRIGHTS
 98
 99# Checks for library functions.
100dnl AC_FUNC_MALLOC
101AC_FUNC_STRERROR_R
102AC_CHECK_FUNCS([strerror pthread_sigmask sigthreadmask rresvport rresvport_af atoi])
103
104#
105# Check for poll vs. select()
106#
107AC_POLLSELECT
108
109#
110# Test for default pdsh fanout and connect timeout
111#
112AC_FANOUT
113AC_CONNECT_TIMEOUT
114
115#
116# Check for sdr
117#
118AC_SDR
119AM_CONDITIONAL(WITH_SDR, [test -n "$SDRGETOBJECTS"])
120
121#
122# Test for inclusion of standard "rsh" module
123# 
124AC_RSH
125AM_CONDITIONAL(WITH_RSH, [test "$ac_with_rsh" = "yes"]) 
126
127#
128# Test for inclusion of standard "xcpu" module
129# 
130AC_XCPU
131AM_CONDITIONAL(WITH_XCPU, [test "$ac_with_xcpu" = "yes"]) 
132
133#
134# Test for ssh
135#
136AC_SSH
137AM_CONDITIONAL(WITH_SSH, test  "$ac_have_ssh"   =  "yes")
138
139#
140# Test for exec
141#
142AC_EXEC
143AM_CONDITIONAL(WITH_EXEC, test  "$ac_have_exec"   =  "yes")
144
145
146#
147# Test for kerberos
148#
149AC_KRB4
150AM_CONDITIONAL(WITH_KRB4, test  "$ac_have_krb4" =  "yes")
151
152#
153# Check for PAM
154#
155AC_PAM
156
157#
158# Test for support of QSW Elan and Qshell support. If requested and
159#  available, build qshd and qcmd connect module.
160#
161# achu - WITH_QSW builds libqsw.  It is a separate conditional, b/c
162#        libqsw may be needed for mqshell (--with-mqshell) even if 
163#        --with-qshell is not specified
164#
165AC_QSHELL
166AM_CONDITIONAL(WITH_QSHELL, [test "$ac_have_qshell" = "yes"])
167AM_CONDITIONAL(WITH_QSW,    [test "$ac_have_qsw"    = "yes"])
168
169#
170# Test for whether to build "machines" module.
171#
172AC_MACHINES
173AM_CONDITIONAL(WITH_MACHINES, [test "$ac_have_machines" = "yes"])
174
175#
176# Check for nodeattr
177#
178AC_NODEATTR
179AM_CONDITIONAL(WITH_NODEATTR,   [test "$ac_have_nodeattr"      = "yes"])
180
181#
182# Check for genders
183#
184AC_GENDERS
185AM_CONDITIONAL(WITH_LIBGENDERS, [test "$ac_have_libgenders"    = "yes"])
186
187#
188# Check for nodeupdown
189#
190AC_NODEUPDOWN
191AM_CONDITIONAL(WITH_NODEUPDOWN, [test "$ac_have_libnodeupdown" = "yes"])
192
193#
194# Check for libmunge and mrsh
195#
196AC_MRSH
197AM_CONDITIONAL(WITH_LIBMUNGE,   [test "$ac_have_libmunge"      = "yes"])
198AM_CONDITIONAL(WITH_MRSH,       [test "$ac_have_mrsh"          = "yes"])
199
200#
201# Check if user wants to build mqshell
202# Run only after checks for --with-qshell and --with-mrsh 
203#
204AC_MQSHELL
205AM_CONDITIONAL(WITH_MQSHELL,    [test "$ac_have_mqshell"       = "yes"])
206AM_CONDITIONAL(WITH_QSW,        [test "$ac_have_qsw"           = "yes"])
207
208#
209# Determine whether to build RMS module (Support for RMS allocate)
210#
211AC_RMSQUERY
212AM_CONDITIONAL([WITH_RMS], [test "$ac_have_rmsquery" = "yes"])
213
214#
215# Determine whether to build SLURM module (support running under SLURM jobid
216#
217AC_SLURM
218AM_CONDITIONAL([WITH_SLURM], [test "$ac_have_slurm" = "yes"])
219
220#
221# Determine whether to to build Torque mudule (support running under Torque jobid)
222#
223AC_TORQUE
224AM_CONDITIONAL([WITH_TORQUE], [test "$ac_have_torque" = "yes"])
225
226#
227# Determine whether to build dshgroup module 
228# (support dsh-style /etc/dsh/group/%s ~/.dsh/group/%s files)
229#
230AC_DSHGROUP
231AM_CONDITIONAL([WITH_DSHGROUP], [test "$ac_with_dshgroup" = "yes"])
232
233AC_NETGROUP
234AM_CONDITIONAL([WITH_NETGROUP], [test "$ac_with_netgroup" = "yes"])
235
236dnl
237dnl check for whether to include readline support
238dnl
239AC_READLINE
240AM_CONDITIONAL([WITH_READLINE], [test "$ac_with_readline" = "yes"])
241
242dnl
243dnl check for inclusion of Dmalloc. 
244dnl Note: this macro defines WITH_DMALLOC for us.
245dnl 
246AC_DMALLOC
247
248#
249#  Check for alternate rcmd rank list:
250#
251AC_RCMD_RANK_LIST
252
253if test "$ac_static_modules" = "yes" ; then
254   AC_STATIC_MODULES_EXIT
255fi
256
257#
258# Build PDSH_VERSION string
259#
260if echo "$META_RELEASE" | grep '^[[0-9]][[0-9]]*$' >/dev/null 2>&1; then
261   PDSH_VERSION="$META_NAME-$META_VERSION"
262else
263   if echo "$META_RELEASE" | grep -e "pre0" -e "UNSTABLE" >/dev/null 2>&1; then
264      if test "$META_RELEASE" = "UNSTABLE"; then
265	     DATE=`date +"%Y%m%d%H%M"`
266      else
267	     DATE=`echo $META_RELEASE | cut -d. -f3`
268      fi
269      PDSH_VERSION="$META_NAME-$META_VERSION (unstable cvs build $DATE)"
270   else
271      PDSH_RELEASE="`echo $META_RELEASE | sed 's/^[[^\.]]*\.//'`"
272      PDSH_VERSION="$META_NAME-$META_VERSION-$PDSH_RELEASE"
273   fi
274fi
275test "$ac_static_modules" = "yes" && EXTRA_VERS="+static-modules"
276test "$ac_with_readline"  = "yes" && EXTRA_VERS="${EXTRA_VERS}+readline"
277test "$ac_debug"          = "yes" && EXTRA_VERS="${EXTRA_VERS}+debug"
278test "$ac_with_dmalloc"   = "yes" && EXTRA_VERS="${EXTRA_VERS}+dmalloc"
279
280if test -n "$EXTRA_VERS" ; then
281   PDSH_VERSION_FULL="$PDSH_VERSION ($EXTRA_VERS)"
282else
283   PDSH_VERSION_FULL="$PDSH_VERSION"
284fi
285
286AC_SUBST(PDSH_VERSION)
287AC_SUBST(PDSH_VERSION_FULL)
288
289
290AC_DEFINE(WITH_LSD_FATAL_ERROR_FUNC, 1, [Have definition of lsd_fatal_error])
291AC_DEFINE(WITH_LSD_NOMEM_FUNC, 1, [Have definition of lsd_nomem_error])
292
293
294AH_BOTTOM(
295[#ifdef WITH_DMALLOC
296#  include <stdlib.h>
297#  include <dmalloc.h>
298#endif /* WITH_DMALLOC */]
299)
300
301# Should probably be defining tests for these - cheat for now
302AH_BOTTOM(
303[#ifdef _AIX
304#  define HAVE_MTSAFE_GETHOSTBYNAME 1
305#  define HAVE_MAGIC_RSHELL_CLEANUP 1
306#  define WANT_RECKLESS_HOSTRANGE_EXPANSION 1
307#else
308#  define HAVE_MTSAFE_GETHOSTBYNAME 0
309#  define HAVE_MAGIC_RSHELL_CLEANUP 0
310#  define WANT_RECKLESS_HOSTRANGE_EXPANSION 0
311#endif /* _AIX */]
312)
313
314AC_CONFIG_FILES([ 
315  Makefile 
316  config/Makefile
317  src/Makefile
318  src/common/Makefile
319  src/qsnet/Makefile
320  src/pdsh/Makefile
321  src/modules/Makefile
322  doc/Makefile
323  etc/Makefile
324  scripts/Makefile
325  tests/Makefile
326  tests/test-modules/Makefile
327  doc/pdcp.1 
328  doc/pdsh.1
329 ]
330)
331AC_OUTPUT