📄 configure.in
字号:
AC_PREREQ(2.59)dnl Process this file with autoconf to produce a configure script.dnldnl aclocal_cache.m4, included by sowing/confdb/aclocal.m4, fixes dnl bugs in autoconf caching.dnldnl The file name here refers to a file in the source being configuredAC_INIT(mpiexec.c)dnl The MPICH2 top-level configure adds a bunch of flags to thednl user-defined CFLAGS by processing different configure command-linednl arguments (--enable-g, --enable-default-optimization). These updateddnl flags are passed down as a separate flag. Here, we don't care aboutdnl the user-defined flags, but rather this updated flags, so we justdnl overwrite CFLAGS with them.PAC_SUBCONFIG_INIT()dnl Definitions will be placed in this file rather than in the DEFS variableAC_CONFIG_HEADER(forkerconf.h)AH_TOP([/* -*- Mode: C; c-basic-offset:4 ; -*- *//* * (C) 2001 by Argonne National Laboratory. * See COPYRIGHT in top-level directory. */#ifndef FORKERCONF_H_INCLUDED#define FORKERCONF_H_INCLUDED])AH_BOTTOM([#endif])dnldnl Set the directory that contains support scripts such as install-sh anddnl config.guessAC_CONFIG_AUX_DIR(../../../confdb)dnlecho "RUNNING CONFIGURE FOR THE GFORKER PM"dnldnl Use AC_ARG_ENABLE to look for --enable-feature and AC_ARG_WITH to look fordnl --with-capabilitydnldnl Enable better caching controlPAC_ARG_CACHINGdnlAC_ARG_ENABLE(echo, [--enable-echo - Turn on strong echoing. The default is enable=no.] ,set -x)AC_ARG_ENABLE(allowport,[--enable-allowport - Turn on use of a port for communicating with the processes started by mpiexec],,enable_allowport=yes)AC_ARG_ENABLE(onsig,[--enable-onsig - Control the handling of processes that signal (e.g., SEGV) using ptrace. Disabled by default],,enable_onsig=no)AC_ARG_ENABLE(newsession,[--enable-newsession - Create a new process group session if standard in is not connected to a terminal],,enable_newsession=yes)dnl With optionsdnldnl First check that we have a clean build if we are doing a VPATH buildPAC_VPATH_CHECK()dnldnl Process any enable or with valuesdnldnl This test is complicated by the fact that top_srcdir is not set untildnl the very end of configure. Instead, we get it ourselvesif test -z "$top_srcdir" ; then use_top_srcdir=$srcdir else use_top_srcdir=$top_srcdirfiPAC_LOAD_BASE_CACHEdnl The recommended order for items in a configure.in file isdnl check for programsdnl check for librariesdnl check for header filesdnl check for typedefsdnl check for structuresdnl check for compiler characteristicsdnl check for library functionsdnl check for system servicesdnl Here are some sample testsdnldnl Determine the executable and object file extensions. Thesednl are needed for some operations under cygwinAC_EXEEXTAC_OBJEXTdnl Find a C compiler (choose gcc first)AC_PROG_CCdnl Set CFLAGS for enable strict if necessaryPAC_CC_STRICTAC_PROG_INSTALLPAC_PROG_CHECK_INSTALL_WORKSPAC_PROG_MKDIR_PPAC_PROG_MAKEdnl AC_CHECK_PROGS(AR,ar)dnl AC_PROG_RANLIB# Turn off creating shared libraries for any utility routines. If we *are*# building shared libaries, make sure that we create a static executable# (to avoid problems with other libraries that -lmpich may need for routines# that we're not using in mpiexec).case "$ENABLE_SHLIB" in none) ;; gcc-osx) # We need to panic; -static won't work on OS/X. ;; gcc) # Gahh. Gcc even complains about this now. #LDFLAGS="$LDFLAGS -static" ;; solaris) # Gahh. We'd like to use -Bstatic, but on some of our Solaris systems, # that gives you things like "-lc: not found" (!!!!) #LDFLAGS="$LDFLAGS -Bstatic" # Instead, we link directly with the .a file in ../../../lib (see # the definition in the Makefile.sm). This works for other # systems as well. ;; libtool) ;; *) ;;esacENABLE_SHLIB=noneAC_SUBST(ENABLE_SHLIB)dnldnl check for compiler characteristicsAC_C_CONSTPAC_C_VOLATILEPAC_C_RESTRICTAC_C_INLINEPAC_C_GNU_ATTRIBUTEdnldnl check for library functionsdnl AC_CHECK_FUNCS(strtol time gettimeofday)AC_CHECK_FUNCS(snprintf)if test "$ac_cv_func_snprintf" = "yes" ; then PAC_FUNC_NEEDS_DECL([#include <stdio.h>],snprintf)fiAC_CHECK_FUNCS(strdup)if test "$ac_cv_func_strdup" = "yes" ; then # Do we need to declare strdup? PAC_FUNC_NEEDS_DECL([#include <string.h>],strdup)fiif test "$enable_onsig" = "yes" ; then AC_CHECK_FUNCS(ptrace) # It isn't enough to find ptrace. We also need the ptrace # parameters, which some systems, such as IRIX, do not define. if test "$ac_cv_func_ptrace" = yes ; then AC_CACHE_CHECK([for ptrace named parameters],pac_cv_has_ptrace_parms,[ AC_TRY_COMPILE([#include <sys/types.h>#include <sys/ptrace.h>],[int i = PTRACE_CONT;],pac_cv_has_ptrace_parms=yes,pac_cv_has_ptrace_parms=no)]) if test "$pac_cv_has_ptrace_parms" = "yes" ; then AC_DEFINE(HAVE_PTRACE_CONT,,[Define if ptrace parameters available]) fi fifi# Check for the functions needed to create a new session.# Cygwin has setsid but not getsidAC_CHECK_FUNCS(setsid isatty getsid)if test "$enable_newsession" = "yes" ; then AC_DEFINE(USE_NEW_SESSION,1,[Define if mpiexec should create a new process group session])fidnldnl Check for special compile characteristicsdnldnl Is there libnsl needed for gethostbyname?dnl AC_SEARCH_LIBS(gethostbyname,nsl)AC_SEARCH_LIBS(socketpair,socket)dnldnl Look for Standard headersAC_HEADER_STDCdnl Check for a specific headerAC_CHECK_HEADERS(sys/types.h signal.h sys/ptrace.h)dnldnl Check for functions. This invokes another test if the function is dnl found. The braces around the second test are essential. dnl AC_CHECK_FUNC(setpgrp,[AC_FUNC_SETPGRP])AC_CHECK_FUNCS(strsignal)dnl dnl Check for signal handlersAC_CHECK_FUNCS(sigaction signal sigset)sigaction_ok=noif test "$ac_cv_func_sigaction" = "yes" ; then AC_CACHE_CHECK([for struct sigaction],pac_cv_struct_sigaction,[ AC_TRY_COMPILE([#include <signal.h>],[struct sigaction act; sigaddset( &act.sa_mask, SIGINT );], pac_cv_struct_sigaction="yes",pac_cv_struct_sigaction="no")]) if test "$pac_cv_struct_sigaction" = "no" ; then AC_CACHE_CHECK([for struct sigaction with _POSIX_SOURCE], pac_cv_struct_sigaction_needs_posix,[ AC_TRY_COMPILE([#define _POSIX_SOURCE#include <signal.h>],[struct sigaction act; sigaddset( &act.sa_mask, SIGINT );], pac_cv_struct_sigaction_needs_posix="yes", pac_cv_struct_sigaction_needs_posix="no")]) if test "$pac_cv_struct_sigaction_needs_posix" = "yes" ; then sigaction_ok=yes fi else sigaction_ok=yes fifidnl# Decide on the signal handler to useif test "$ac_cv_func_sigaction" = "yes" -a "$sigaction_ok" = "yes" ; then if test "$pac_struct_sigaction_needs_posix" = yes ; then AC_DEFINE(NEEDS_POSIX_FOR_SIGACTION,1,[Define if _POSIX_SOURCE needed to get sigaction]) fi AC_DEFINE(USE_SIGACTION,1,[Define if sigaction should be used to set signals])elif test "$ac_cv_func_signal" = "yes" ; then AC_DEFINE(USE_SIGNAL,1,[Define if signal should be used to set signals])fidnlif test "$enable_allowport" = "yes" ; then AC_DEFINE(MPIEXEC_ALLOW_PORT,1,[Define if a port may be used to communicate with the processes])fidnl Setup other replaceable valuesMPILIBNAME=${MPILIBNAME:-"mpich"}dnldnldnl Configure the pm utilities for mpiexec2 (which will eventually replacednl mpiexec)PAC_SUBDIR_CACHEdnldnl You can't configure a directory that isn't a strict subdirectorydnl reliably. For example, configure will set the cache file incorrectlydnl unless you set it explicitlydnl if test "$cache_file" != "/dev/null" ; thendnl # convert the cachefile to an absolute pathdnl cachedir=`echo $cache_file | sed -e 's%/[^/]*$%%'`dnl fname=`basename $cache_file`dnl if test -d $cachedir ; thendnl cachedir=`(cd $cachedir && pwd)`dnl elsednl cachedir=`pwd`dnl fidnl if test -f "$cachedir/$fname" ; then dnl cache_file=$cachedir/$fnamednl fidnl fidnl See setup_pm. The pm/util directory must also be configuredAC_CONFIG_SUBDIRS(../util)AC_CHECK_HEADERS(string.h sys/time.h unistd.h stdlib.h sys/socket.h wait.h errno.h)if test -z "$master_top_srcdir" ; then master_top_srcdir='${srcdir}/../../..'fiAC_SUBST(MPILIBNAME)AC_SUBST(CC)AC_SUBST(CFLAGS)AC_SUBST(CC_SHL)AC_SUBST(C_LINK_SHL)AC_SUBST(master_top_srcdir)dnldnl Dependency handlingAC_SUBST(MAKE_DEPEND_C)dnldnl EtagsAC_SUBST(ETAGS)AC_SUBST(ETAGSADD)export ETAGSexport ETAGSADDdnldnl Other autoconf variables that may be imported from the calling environmentAC_SUBST(DOCTEXT)PAC_UPDATE_BASE_CACHEdnl Place holder macro for finalizationPAC_SUBCONFIG_FINALIZE()dnl Generate the Makefiles from Makefile.inAC_OUTPUT(Makefile)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -