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