📄 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(smpdconf.h)AH_TOP([/* -*- Mode: C; c-basic-offset:4 ; -*- *//* * (C) 2001 by Argonne National Laboratory. * See COPYRIGHT in top-level directory. */#ifndef SMPDCONF_H_INCLUDED#define SMPDCONF_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 SMPD 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)dnl First check that we have a clean build if we are doing a VPATH buildPAC_VPATH_CHECK()dnldnl Process any enable or with valuesdnl 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_srcdirfidnl 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 Find a C compiler (choose gcc first)AC_PROG_CCAC_PROG_INSTALLPAC_PROG_CHECK_INSTALL_WORKSPAC_PROG_MKDIR_PPAC_PROG_MAKEdnldnl check for compiler characteristicsAC_C_CONSTPAC_C_VOLATILEPAC_C_RESTRICTAC_C_INLINEdnldnl Look for Standard headersAC_HEADER_STDCdnldnl Setup other replaceable valuesMPILIBNAME=${MPILIBNAME:-"mpich"}AC_SUBST(MPILIBNAME)AC_CHECK_HEADERS( sys/types.h sys/wait.h signal.h unistd.h stdlib.h errno.h stdarg.h pthread.h sys/socket.h sys/stat.h ctype.h )AC_CHECK_HEADERS( math.h stdio.h termios.h string.h sys/stat.h malloc.h uuid/uuid.h )AC_CHECK_HEADERS( stddef.h md5.h openssl/md5.h )AC_CHECK_FUNCS( sigaction usleep CFUUIDCreate uuid_generate setenv md5_calc )AC_SEARCH_LIBS( uuid_generate, uuid )AC_MSG_CHECKING([for poll stdin capability])AC_TRY_RUN([#include <stdio.h>#include <stdlib.h>#include <poll.h>#include <unistd.h>#include <fcntl.h>int main(int argc, char *argv[]){ int fd; struct pollfd a[1]; int result; int flags; fd = fileno(stdin); flags = fcntl(fd, F_GETFL, 0); if (flags == -1) { return -1; } flags = fcntl(fd, F_SETFL, flags | O_NONBLOCK); if (flags == -1) { return -1; } a[0].fd = fd; a[0].events = POLLIN; a[0].revents = 0; result = poll(a, 1, 1); if (result == 1) { if (a[0].revents & POLLNVAL) { return 0; } } return -1;}], AC_MSG_RESULT(no) AC_DEFINE(USE_PTHREAD_STDIN_REDIRECTION,1,[define if the file descriptor for stdin cannot be passed to poll]), AC_MSG_RESULT(yes), AC_MSG_RESULT(not checking when cross compiling))AC_SEARCH_LIBS( MD5, ssl crypto )# Make configure check for MD5 so that the variable will be setAC_CHECK_FUNCS(MD5)#AC_SEARCH_LIBS( md5_calc, md5 )AC_MSG_CHECKING([for md5_calc function])AC_TRY_COMPILE([#ifdef HAVE_STDDEF_H #include <stddef.h>#endif#include <md5.h>],[unsigned char hash[16];unsigned char c='a';md5_calc(hash,&c,1);],ac_cv_have_md5_calc=yes,ac_cv_have_md5_calc=no)if test "$ac_cv_have_md5_calc" = yes ; then AC_DEFINE(HAVE_MD5_CALC,1,[Define if you have the md5_calc function.]) AC_MSG_RESULT(yes)else AC_MSG_RESULT(no)fi# md5 appears to be required for SMPD. Test that we have either mp5_calc# or MP5 (may be part of openssl/md5.h)if test "$ac_cv_have_md5_calc" != yes -a \ \( "$ac_cv_header_openssl_md5_h" != yes -o "$ac_cv_func_MD5" != yes \) ; then AC_MSG_ERROR([SMPD requires MD5 support, and configure could not find either md5_calc in md5.h or MD5 in openssl/md5.h])fidnl Note that # does not comment out lines that are passed to autoconf,dnl and thus # MUST NEVER be used to comment out AC_xxx commandsdnl AC_SEARCH_LIBS( MD5, crypto, SMPD_LIBS="$SMPD_LIBS -lcrypto" )# Add the MPICH2 include flags to CPPFLAGS. See the discussion above about# which include flags should start in MPICH2_INCLUDE_FLAGS and which in # CPPFLAGS# SMPD needs a definition for MPID_IOV and the sock utilities, so# it needs the MPICH2 include pathsCPPFLAGS="$CPPFLAGS $MPICH2_INCLUDE_FLAGS"SMPD_LIBS="$SMPD_LIBS $LIBS"AC_SUBST(SMPD_LIBS)AC_SUBST(AR)AC_SUBST(RANLIB)AC_SUBST(MPILIBNAME)AC_SUBST(CC)AC_SUBST(CPPFLAGS)AC_SUBST(CFLAGS)AC_SUBST(CC_SHL)AC_SUBST(C_LINK_SHL)AC_SUBST(ENABLE_SHLIB)AC_SUBST(master_top_srcdir)dnldnl Dependency handlingAC_SUBST(MAKE_DEPEND_C)dnldnl Get any LIBS required by the sock implementationdnl. ../../mpid/common/sock/localdefs. ../../pmi/smpd/localdefsdnl Place holder macro for finalizationPAC_SUBCONFIG_FINALIZE()dnl Generate the Makefiles from Makefile.inAC_OUTPUT(Makefile localdefs)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -