| 1 | AC_PREREQ(2.62) |
|---|
| 2 | # |
|---|
| 3 | # (C) 2008 by Argonne National Laboratory. |
|---|
| 4 | # See COPYRIGHT in top-level directory. |
|---|
| 5 | # |
|---|
| 6 | |
|---|
| 7 | AC_INIT([Hydra], [0.1]) |
|---|
| 8 | AC_CONFIG_AUX_DIR(mpl/confdb) |
|---|
| 9 | AM_INIT_AUTOMAKE([-Wall -Werror foreign 1.11]) |
|---|
| 10 | |
|---|
| 11 | dnl When built as a subconfigure, pull in FLAGS from above |
|---|
| 12 | PAC_SUBCONFIG_INIT() |
|---|
| 13 | |
|---|
| 14 | AC_CONFIG_HEADER(include/hydra_config.h) |
|---|
| 15 | |
|---|
| 16 | # Check for special types |
|---|
| 17 | AC_TYPE_SIZE_T |
|---|
| 18 | |
|---|
| 19 | dnl Bug in autoconf adds -O2 and -g by default. Make sure we only get |
|---|
| 20 | dnl the flags we want. |
|---|
| 21 | save_cflags=$CFLAGS |
|---|
| 22 | AC_PROG_CC |
|---|
| 23 | CFLAGS=$save_cflags |
|---|
| 24 | |
|---|
| 25 | AM_PROG_MKDIR_P |
|---|
| 26 | AC_PROG_RANLIB |
|---|
| 27 | PAC_ARG_CACHING |
|---|
| 28 | PAC_ARG_STRICT |
|---|
| 29 | PAC_C_GNU_ATTRIBUTE |
|---|
| 30 | PAC_CC_FUNCTION_NAME_SYMBOL |
|---|
| 31 | |
|---|
| 32 | dnl Check if the necessary headers are available |
|---|
| 33 | AC_CHECK_HEADERS(unistd.h stdlib.h string.h strings.h stdarg.h sys/types.h sys/socket.h \ |
|---|
| 34 | sched.h pthread.h sys/stat.h) |
|---|
| 35 | |
|---|
| 36 | dnl Check if the pthread library is present. Apparently, just checking |
|---|
| 37 | dnl for pthread.h is not sufficient. |
|---|
| 38 | AC_CHECK_LIB(pthread,pthread_create,pthread_lib_exists=yes,pthread_lib_exists=no) |
|---|
| 39 | |
|---|
| 40 | dnl Check if the upper-level enabled threads support |
|---|
| 41 | if test "$MPICH2_THREAD_PACKAGE" != "none" -a "$pthread_lib_exists" = "yes" ; then |
|---|
| 42 | AC_DEFINE(HAVE_THREAD_SUPPORT,1,[Define thread support]) |
|---|
| 43 | LDFLAGS="$LDFLAGS -lpthread" |
|---|
| 44 | fi |
|---|
| 45 | |
|---|
| 46 | dnl Check for necessary functions |
|---|
| 47 | AC_CHECK_FUNCS(gettimeofday time strdup sigaction signal usleep alloca unsetenv \ |
|---|
| 48 | strerror strsignal putenv) |
|---|
| 49 | |
|---|
| 50 | # putenv() sets environment variable |
|---|
| 51 | AC_HAVE_FUNCS(putenv) |
|---|
| 52 | if test "$ac_cv_func_putenv" = "yes" ; then |
|---|
| 53 | PAC_FUNC_NEEDS_DECL([#include <stdlib.h>],putenv) |
|---|
| 54 | fi |
|---|
| 55 | |
|---|
| 56 | dnl Check what we need to do about the environ extern |
|---|
| 57 | AC_CACHE_CHECK([for environ in unistd.h],pac_cv_environ_in_unistd, |
|---|
| 58 | [AC_TRY_COMPILE([#include <unistd.h>],[char **x = environ;], |
|---|
| 59 | pac_cv_environ_in_unistd=yes,pac_cv_environ_in_unistd=no)]) |
|---|
| 60 | if test "$pac_cv_environ_in_unistd" = "yes" ; then |
|---|
| 61 | # We have environ defined in unistd.h; we are done |
|---|
| 62 | AC_DEFINE(HAVE_EXTERN_ENVIRON,1,[Define if environ extern is available]) |
|---|
| 63 | else |
|---|
| 64 | # See if we can declare it |
|---|
| 65 | AC_CACHE_CHECK([for manually declared extern environ], pac_cv_manual_extern_environ, |
|---|
| 66 | [AC_TRY_LINK([#include <unistd.h>],[extern char ** environ; char **x = environ;], |
|---|
| 67 | pac_cv_manual_extern_environ=yes,pac_cv_manual_extern_environ=no)]) |
|---|
| 68 | if test "$pac_cv_manual_extern_environ" = "yes" ; then |
|---|
| 69 | # We can manually declare the extern |
|---|
| 70 | AC_DEFINE(MANUAL_EXTERN_ENVIRON,1,[Define if environ decl needed]) |
|---|
| 71 | AC_DEFINE(HAVE_EXTERN_ENVIRON,1,[Define if environ extern is available]) |
|---|
| 72 | fi |
|---|
| 73 | fi |
|---|
| 74 | |
|---|
| 75 | dnl Check what boot-strap server we should use |
|---|
| 76 | AC_ARG_WITH(hydra-bss, [ --with-hydra-bss Boot-strap Server], |
|---|
| 77 | [ hydra_bss=$withval ], |
|---|
| 78 | [ hydra_bss="ssh,rsh,fork,slurm" ]) |
|---|
| 79 | AC_MSG_CHECKING(boot-strap server) |
|---|
| 80 | AC_MSG_RESULT($hydra_bss) |
|---|
| 81 | hydra_bss_names="`echo $hydra_bss | sed -e 's/:/ /g' -e 's/,/ /g'`" |
|---|
| 82 | AC_DEFINE_UNQUOTED(HYDRA_BSS_NAMES,"$hydra_bss_names",[Definition of enabled bootstrap servers]) |
|---|
| 83 | AM_SUBST_NOTMAKE(hydra_bss_names) |
|---|
| 84 | AC_SUBST(hydra_bss_names) |
|---|
| 85 | |
|---|
| 86 | hydra_bss_ssh=false |
|---|
| 87 | hydra_bss_rsh=false |
|---|
| 88 | hydra_bss_fork=false |
|---|
| 89 | hydra_bss_slurm=false |
|---|
| 90 | for hydra_bss_name in ${hydra_bss_names}; do |
|---|
| 91 | if test -z "${hydra_default_bss}" ; then |
|---|
| 92 | hydra_default_bss=$hydra_bss_name |
|---|
| 93 | fi |
|---|
| 94 | hydra_bss_makefiles="$hydra_bss_makefiles bootstrap/${hydra_bss_name}/Makefile" |
|---|
| 95 | hydra_bss_init_decl="${hydra_bss_init_decl} |
|---|
| 96 | HYD_Status HYD_BSCI_${hydra_bss_name}_init(void);" |
|---|
| 97 | hydra_bss_name_array="${hydra_bss_name_array} \"${hydra_bss_name}\", " |
|---|
| 98 | hydra_bss_init_array="${hydra_bss_init_array} HYD_BSCI_${hydra_bss_name}_init, " |
|---|
| 99 | |
|---|
| 100 | case "$hydra_bss_name" in |
|---|
| 101 | ssh) |
|---|
| 102 | hydra_bss_ssh=true |
|---|
| 103 | ;; |
|---|
| 104 | rsh) |
|---|
| 105 | hydra_bss_rsh=true |
|---|
| 106 | ;; |
|---|
| 107 | fork) |
|---|
| 108 | hydra_bss_fork=true |
|---|
| 109 | ;; |
|---|
| 110 | slurm) |
|---|
| 111 | hydra_bss_slurm=true |
|---|
| 112 | ;; |
|---|
| 113 | *) |
|---|
| 114 | ;; |
|---|
| 115 | esac |
|---|
| 116 | |
|---|
| 117 | done |
|---|
| 118 | hydra_bss_name_array="${hydra_bss_name_array} NULL" |
|---|
| 119 | hydra_bss_init_array="${hydra_bss_init_array} NULL" |
|---|
| 120 | AC_DEFINE_UNQUOTED(HYDRA_DEFAULT_BSS,"$hydra_default_bss",[Default bootstrap server]) |
|---|
| 121 | AM_SUBST_NOTMAKE(hydra_bss_init_decl) |
|---|
| 122 | AM_SUBST_NOTMAKE(hydra_bss_name_array) |
|---|
| 123 | AM_SUBST_NOTMAKE(hydra_bss_init_array) |
|---|
| 124 | AC_SUBST(hydra_bss_init_decl) |
|---|
| 125 | AC_SUBST(hydra_bss_name_array) |
|---|
| 126 | AC_SUBST(hydra_bss_init_array) |
|---|
| 127 | AM_CONDITIONAL([hydra_bss_ssh], [$hydra_bss_ssh]) |
|---|
| 128 | AM_CONDITIONAL([hydra_bss_rsh], [$hydra_bss_rsh]) |
|---|
| 129 | AM_CONDITIONAL([hydra_bss_fork], [$hydra_bss_fork]) |
|---|
| 130 | AM_CONDITIONAL([hydra_bss_slurm], [$hydra_bss_slurm]) |
|---|
| 131 | |
|---|
| 132 | |
|---|
| 133 | dnl Check what communication sub-system we should use |
|---|
| 134 | AC_ARG_WITH(hydra-css, [ --with-hydra-css Communication Sub-system], |
|---|
| 135 | [ hydra_css=$withval ], |
|---|
| 136 | [ hydra_css="none" ]) |
|---|
| 137 | AC_MSG_CHECKING(communication subsystem) |
|---|
| 138 | AC_MSG_RESULT($hydra_css) |
|---|
| 139 | hydra_css_names="`echo $hydra_css | sed -e 's/:/ /g' -e 's/,/ /g'`" |
|---|
| 140 | AC_DEFINE_UNQUOTED(HYDRA_CSS_NAMES,"$hydra_css_names",[Definition of enabled communication systems]) |
|---|
| 141 | AM_SUBST_NOTMAKE(hydra_css_names) |
|---|
| 142 | AC_SUBST(hydra_css_names) |
|---|
| 143 | |
|---|
| 144 | hydra_css_none=false |
|---|
| 145 | for hydra_css_name in ${hydra_css_names}; do |
|---|
| 146 | if test -z "${hydra_default_css}" ; then |
|---|
| 147 | hydra_default_css=$hydra_css_name |
|---|
| 148 | fi |
|---|
| 149 | hydra_css_makefiles="$hydra_css_makefiles css/${hydra_css_name}/Makefile" |
|---|
| 150 | hydra_css_init_decl="${hydra_css_init_decl} |
|---|
| 151 | HYD_Status HYD_CSSI_${hydra_css_name}_init(void);" |
|---|
| 152 | hydra_css_name_array="${hydra_css_name_array} \"${hydra_css_name}\", " |
|---|
| 153 | hydra_css_init_array="${hydra_css_init_array} HYD_CSSI_${hydra_css_name}_init, " |
|---|
| 154 | |
|---|
| 155 | case "$hydra_css_name" in |
|---|
| 156 | dummy) |
|---|
| 157 | hydra_css_none=true |
|---|
| 158 | ;; |
|---|
| 159 | *) |
|---|
| 160 | ;; |
|---|
| 161 | esac |
|---|
| 162 | |
|---|
| 163 | done |
|---|
| 164 | hydra_css_name_array="${hydra_css_name_array} NULL" |
|---|
| 165 | hydra_css_init_array="${hydra_css_init_array} NULL" |
|---|
| 166 | AC_DEFINE_UNQUOTED(HYDRA_DEFAULT_CSS,"$hydra_default_css",[Default communication sub-system]) |
|---|
| 167 | AM_SUBST_NOTMAKE(hydra_css_init_decl) |
|---|
| 168 | AM_SUBST_NOTMAKE(hydra_css_name_array) |
|---|
| 169 | AM_SUBST_NOTMAKE(hydra_css_init_array) |
|---|
| 170 | AC_SUBST(hydra_css_init_decl) |
|---|
| 171 | AC_SUBST(hydra_css_name_array) |
|---|
| 172 | AC_SUBST(hydra_css_init_array) |
|---|
| 173 | AM_CONDITIONAL([hydra_css_none], [$hydra_css_none]) |
|---|
| 174 | |
|---|
| 175 | |
|---|
| 176 | dnl Check what resource management kernel we should use |
|---|
| 177 | AC_ARG_WITH(hydra-rmk, [ --with-hydra-rmk Resource Management Kernel], |
|---|
| 178 | [ hydra_rmk=$withval ], |
|---|
| 179 | [ hydra_rmk="dummy" ]) |
|---|
| 180 | AC_MSG_CHECKING(resource management kernel) |
|---|
| 181 | AC_MSG_RESULT($hydra_rmk) |
|---|
| 182 | hydra_rmk_names="`echo $hydra_rmk | sed -e 's/:/ /g' -e 's/,/ /g'`" |
|---|
| 183 | AC_DEFINE_UNQUOTED(HYDRA_RMK_NAMES,"$hydra_rmk_names",[Enabled resource management kernels]) |
|---|
| 184 | AM_SUBST_NOTMAKE(hydra_rmk_names) |
|---|
| 185 | AC_SUBST(hydra_rmk_names) |
|---|
| 186 | |
|---|
| 187 | hydra_rmk_dummy=false |
|---|
| 188 | for hydra_rmk_name in ${hydra_rmk_names}; do |
|---|
| 189 | if test -z "${hydra_default_rmk}" ; then |
|---|
| 190 | hydra_default_rmk=$hydra_rmk_name |
|---|
| 191 | fi |
|---|
| 192 | hydra_rmk_makefiles="$hydra_rmk_makefiles rmk/${hydra_rmk_name}/Makefile" |
|---|
| 193 | hydra_rmk_init_decl="${hydra_rmk_init_decl} |
|---|
| 194 | HYD_Status HYD_RMKI_${hydra_rmk_name}_init(void);" |
|---|
| 195 | hydra_rmk_name_array="${hydra_rmk_name_array} \"${hydra_rmk_name}\", " |
|---|
| 196 | hydra_rmk_init_array="${hydra_rmk_init_array} HYD_RMKI_${hydra_rmk_name}_init, " |
|---|
| 197 | |
|---|
| 198 | case "$hydra_rmk_name" in |
|---|
| 199 | dummy) |
|---|
| 200 | hydra_rmk_dummy=true |
|---|
| 201 | ;; |
|---|
| 202 | *) |
|---|
| 203 | ;; |
|---|
| 204 | esac |
|---|
| 205 | |
|---|
| 206 | done |
|---|
| 207 | hydra_rmk_name_array="${hydra_rmk_name_array} NULL" |
|---|
| 208 | hydra_rmk_init_array="${hydra_rmk_init_array} NULL" |
|---|
| 209 | AC_DEFINE_UNQUOTED(HYDRA_DEFAULT_RMK,"$hydra_default_rmk",[Default resource management kernel]) |
|---|
| 210 | AM_SUBST_NOTMAKE(hydra_rmk_init_decl) |
|---|
| 211 | AM_SUBST_NOTMAKE(hydra_rmk_name_array) |
|---|
| 212 | AM_SUBST_NOTMAKE(hydra_rmk_init_array) |
|---|
| 213 | AC_SUBST(hydra_rmk_init_decl) |
|---|
| 214 | AC_SUBST(hydra_rmk_name_array) |
|---|
| 215 | AC_SUBST(hydra_rmk_init_array) |
|---|
| 216 | AM_CONDITIONAL([hydra_rmk_dummy], [$hydra_rmk_dummy]) |
|---|
| 217 | |
|---|
| 218 | |
|---|
| 219 | dnl Check what process manager we should use |
|---|
| 220 | AC_ARG_WITH(hydra-pm, [ --with-hydra-pm Process Manager], |
|---|
| 221 | [ hydra_pm=$withval ], |
|---|
| 222 | [ hydra_pm=pmiserv ]) |
|---|
| 223 | AC_MSG_CHECKING(process manager) |
|---|
| 224 | AC_MSG_RESULT($hydra_pm) |
|---|
| 225 | AC_SUBST(hydra_pm) |
|---|
| 226 | AM_CONDITIONAL([hydra_pm_pmiserv], [test $hydra_pm = "pmiserv"]) |
|---|
| 227 | |
|---|
| 228 | |
|---|
| 229 | dnl Check what UI we should use |
|---|
| 230 | AC_ARG_WITH(hydra-ui, [ --with-hydra-ui User Interface], |
|---|
| 231 | [ hydra_ui=$withval ], |
|---|
| 232 | [ hydra_ui=mpiexec ]) |
|---|
| 233 | AC_MSG_CHECKING(user interface) |
|---|
| 234 | AC_MSG_RESULT($hydra_ui) |
|---|
| 235 | AC_SUBST(hydra_ui) |
|---|
| 236 | AM_CONDITIONAL([hydra_ui_mpiexec], [test $hydra_ui = "mpiexec"]) |
|---|
| 237 | |
|---|
| 238 | dnl Check what communication sub-system we should use |
|---|
| 239 | AC_ARG_WITH(hydra-css, [ --with-hydra-css Communication Sub-system], |
|---|
| 240 | [ hydra_css=$withval ], |
|---|
| 241 | [ hydra_css= ]) |
|---|
| 242 | AC_MSG_CHECKING(communication subsystem) |
|---|
| 243 | if test "x$hydra_css" != "x" ; then |
|---|
| 244 | AC_MSG_RESULT($hydra_css) |
|---|
| 245 | else |
|---|
| 246 | AC_MSG_RESULT(none) |
|---|
| 247 | fi |
|---|
| 248 | AC_SUBST(hydra_css) |
|---|
| 249 | |
|---|
| 250 | dnl Debugging support |
|---|
| 251 | AC_ARG_ENABLE(g, [ --enable-g Enable Debugging], |
|---|
| 252 | [ DEBUG=$enableval ], |
|---|
| 253 | [ DEBUG=no ]) |
|---|
| 254 | AC_MSG_CHECKING(debugging support) |
|---|
| 255 | AC_MSG_RESULT($DEBUG) |
|---|
| 256 | if test "$DEBUG" = "yes"; then |
|---|
| 257 | EXTRA_CFLAGS="$EXTRA_CFLAGS -g" |
|---|
| 258 | AC_DEFINE(ENABLE_DEBUG,1,[Define if debugging support is enabled]) |
|---|
| 259 | fi |
|---|
| 260 | AC_SUBST(EXTRA_CFLAGS) |
|---|
| 261 | |
|---|
| 262 | dnl Warning messages |
|---|
| 263 | AC_ARG_ENABLE(warnings, [ --enable-warnings Enable warnings], |
|---|
| 264 | [ WARNINGS=$enableval ], |
|---|
| 265 | [ WARNINGS=no ]) |
|---|
| 266 | AC_MSG_CHECKING(warnings) |
|---|
| 267 | AC_MSG_RESULT($WARNINGS) |
|---|
| 268 | if test "$WARNINGS" = "yes"; then |
|---|
| 269 | AC_DEFINE(ENABLE_WARNINGS,1,[Define if warnings are enabled]) |
|---|
| 270 | fi |
|---|
| 271 | |
|---|
| 272 | dnl Process Binding |
|---|
| 273 | AC_ARG_ENABLE(hydra-procbind, [ --enable-hydra-procbind Process Binding], |
|---|
| 274 | [ procbind=$enableval ], |
|---|
| 275 | [ procbind=no ]) |
|---|
| 276 | AC_MSG_CHECKING(process binding) |
|---|
| 277 | |
|---|
| 278 | if test "$procbind" = "auto" ; then |
|---|
| 279 | old_CFLAGS=$CFLAGS |
|---|
| 280 | CFLAGS="$CFLAGS -I${srcdir}/utils/plpa" |
|---|
| 281 | AC_TRY_COMPILE([#include <plpa_internal.h>],[PLPA_NAME(api_type_t) p; PLPA_NAME(api_probe) (&p);],plpa_works=yes,plpa_works=no) |
|---|
| 282 | CFLAGS=$old_CFLAGS |
|---|
| 283 | if test "$plpa_works" = "yes" ; then |
|---|
| 284 | procbind=yes |
|---|
| 285 | else |
|---|
| 286 | procbind=no |
|---|
| 287 | fi |
|---|
| 288 | fi |
|---|
| 289 | |
|---|
| 290 | AC_MSG_RESULT($procbind) |
|---|
| 291 | if test "$procbind" = "yes"; then |
|---|
| 292 | AC_DEFINE(HAVE_PROC_BINDING,1,[Define if process binding is enabled]) |
|---|
| 293 | opt_utils_makefiles="${opt_utils_makefiles} utils/plpa/Makefile utils/bind/Makefile" |
|---|
| 294 | opt_utils="${opt_utils} plpa bind" |
|---|
| 295 | fi |
|---|
| 296 | AM_CONDITIONAL([hydra_procbind], [test "${procbind}" = "yes"]) |
|---|
| 297 | AC_SUBST(opt_utils) |
|---|
| 298 | |
|---|
| 299 | dnl Check if __VA_ARGS__ is defined by the compiler |
|---|
| 300 | AC_MSG_CHECKING([whether the compiler allows __VA_ARGS__]) |
|---|
| 301 | rm -f conftest.c |
|---|
| 302 | cat > conftest.c <<EOF |
|---|
| 303 | #include <stdio.h> |
|---|
| 304 | #define my_print(...) printf(__VA_ARGS__) |
|---|
| 305 | int main() |
|---|
| 306 | { |
|---|
| 307 | my_print("woohoo!"); |
|---|
| 308 | return 0; |
|---|
| 309 | } |
|---|
| 310 | EOF |
|---|
| 311 | pac_tmp_compile='$CC $CFLAGS conftest.c -o conftest' |
|---|
| 312 | if AC_TRY_EVAL(pac_tmp_compile) && test -s conftest ; then |
|---|
| 313 | AC_DEFINE(COMPILER_ACCEPTS_VA_ARGS,1,[Define if compiler supports __VA_ARGS__]) |
|---|
| 314 | fi |
|---|
| 315 | rm -f conftest* |
|---|
| 316 | |
|---|
| 317 | dnl Check for functions. This invokes another test if the function is |
|---|
| 318 | dnl found. The braces around the second test are essential. |
|---|
| 319 | dnl AC_CHECK_FUNC(setpgrp,[AC_FUNC_SETPGRP]) |
|---|
| 320 | AC_CHECK_FUNCS(strsignal) |
|---|
| 321 | if test "$ac_cv_func_strsignal" = "yes" ; then |
|---|
| 322 | PAC_FUNC_NEEDS_DECL([#include <string.h>],strsignal) |
|---|
| 323 | fi |
|---|
| 324 | |
|---|
| 325 | dnl Check for signal handlers |
|---|
| 326 | AC_CHECK_FUNCS(sigaction signal sigset) |
|---|
| 327 | sigaction_ok=no |
|---|
| 328 | if test "$ac_cv_func_sigaction" = "yes" ; then |
|---|
| 329 | # Make sure that the fields that we need in sigaction are defined |
|---|
| 330 | AC_CACHE_CHECK([for struct sigaction and sa_handler], |
|---|
| 331 | pac_cv_struct_sigaction_with_sa_handler,[ |
|---|
| 332 | AC_TRY_COMPILE([#include <signal.h>],[ |
|---|
| 333 | struct sigaction act; sigaddset( &act.sa_mask, SIGINT ); |
|---|
| 334 | act.sa_handler = SIG_IGN;], |
|---|
| 335 | pac_cv_struct_sigaction_with_sa_handler=yes, |
|---|
| 336 | pac_cv_struct_sigaction_with_sa_handler=no)]) |
|---|
| 337 | if test "$pac_cv_struct_sigaction_with_sa_handler" = "no" ; then |
|---|
| 338 | AC_CACHE_CHECK([for struct sigaction and sa_handler with _POSIX_SOURCE], |
|---|
| 339 | pac_cv_struct_sigaction_with_sa_handler_needs_posix,[ |
|---|
| 340 | AC_TRY_COMPILE([#define _POSIX_SOURCE |
|---|
| 341 | #include <signal.h>],[ |
|---|
| 342 | struct sigaction act; sigaddset( &act.sa_mask, SIGINT ); |
|---|
| 343 | act.sa_handler = SIG_IGN;], |
|---|
| 344 | pac_cv_struct_sigaction_with_sa_handler_needs_posix=yes, |
|---|
| 345 | pac_cv_struct_sigaction_with_sa_handler_needs_posix=no)]) |
|---|
| 346 | if test "$pac_cv_struct_sigaction_with_sa_handler_needs_posix" = "yes" ; then |
|---|
| 347 | sigaction_ok=yes |
|---|
| 348 | fi |
|---|
| 349 | else |
|---|
| 350 | sigaction_ok=yes |
|---|
| 351 | fi |
|---|
| 352 | fi |
|---|
| 353 | |
|---|
| 354 | # Decide on the signal handler to use |
|---|
| 355 | if test "$ac_cv_func_sigaction" = "yes" -a "$sigaction_ok" = "yes" ; then |
|---|
| 356 | if test "$pac_cv_struct_sigaction_with_sa_handler_needs_posix" = yes ; then |
|---|
| 357 | AC_DEFINE(NEEDS_POSIX_FOR_SIGACTION,1,[Define if _POSIX_SOURCE needed to get sigaction]) |
|---|
| 358 | fi |
|---|
| 359 | AC_DEFINE(USE_SIGACTION,,[Define if sigaction should be used to set signals]) |
|---|
| 360 | elif test "$ac_cv_func_signal" = "yes" ; then |
|---|
| 361 | AC_DEFINE(USE_SIGNAL,,[Define if signal should be used to set signals]) |
|---|
| 362 | fi |
|---|
| 363 | |
|---|
| 364 | # gethostname() returns host name |
|---|
| 365 | AC_CHECK_FUNCS(gethostname) |
|---|
| 366 | if test "$ac_cv_func_gethostname" = "yes" ; then |
|---|
| 367 | # Do we need to declare gethostname? |
|---|
| 368 | PAC_FUNC_NEEDS_DECL([#include <unistd.h>],gethostname) |
|---|
| 369 | fi |
|---|
| 370 | |
|---|
| 371 | dnl Substitute common variables. Some versions of autoconf have |
|---|
| 372 | dnl trouble with this. |
|---|
| 373 | AC_SUBST(CC) |
|---|
| 374 | AC_SUBST(CFLAGS) |
|---|
| 375 | AC_SUBST(LDFLAGS) |
|---|
| 376 | AC_SUBST(CC_SHL) |
|---|
| 377 | AC_SUBST(C_LINK_SHL) |
|---|
| 378 | |
|---|
| 379 | ENABLE_SHLIB=none |
|---|
| 380 | AC_SUBST(ENABLE_SHLIB) |
|---|
| 381 | AC_SUBST(RANLIB) |
|---|
| 382 | AC_SUBST(MAKE_DEPEND_C) |
|---|
| 383 | |
|---|
| 384 | AC_PROG_INSTALL |
|---|
| 385 | |
|---|
| 386 | AC_CONFIG_SUBDIRS(mpl) |
|---|
| 387 | |
|---|
| 388 | dnl Place holder macro for finalization |
|---|
| 389 | PAC_SUBCONFIG_FINALIZE() |
|---|
| 390 | |
|---|
| 391 | dnl Final output |
|---|
| 392 | AC_OUTPUT(Makefile |
|---|
| 393 | bootstrap/src/bsci_init.c |
|---|
| 394 | bootstrap/include/bsci.h |
|---|
| 395 | rmk/src/rmki_init.c |
|---|
| 396 | rmk/include/rmki.h |
|---|
| 397 | css/src/cssi_init.c |
|---|
| 398 | css/include/cssi.h |
|---|
| 399 | ) |
|---|