📄 configure.in
字号:
AC_PREREQ(2.59)AC_INIT(configure.in)dnldnl Set the directory that contains support scripts such as install-sh anddnl config.guessdnlAC_CONFIG_AUX_DIR(../../../../../confdb)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()dnldnl Definitions will be placed in this file rather than in the DEFS variablednlAC_CONFIG_HEADER(include/mpidi_ch3i_shm_conf.h)AH_TOP([/* -*- Mode: C; c-basic-offset:4 ; -*- *//* * (C) 2001 by Argonne National Laboratory. * See COPYRIGHT in top-level directory. */#ifndef MPIDI_CH3I_SHM_CONF_H_INCLUDED#define MPIDI_CH3I_SHM_CONF_H_INCLUDED])AH_BOTTOM([#endif])echo "RUNNING CONFIGURE FOR THE SHARED MEMORY CHANNEL"dnldnl First check that we have a clean build if we are doing a VPATH buildPAC_VPATH_CHECK()PAC_LOAD_BASE_CACHEAC_PROG_INSTALLPAC_PROG_CHECK_INSTALL_WORKS## On Mac OS/X, install breaks libraries unless used with the -p switchPAC_PROG_INSTALL_BREAKS_LIBS# We also need mkdir -p.PAC_PROG_MKDIR_PPAC_PROG_MAKEAC_CHECK_PROGS(AR,ar)if test -z "$AR" ; then AC_MSG_ERROR([The program ar is required for building MPICH2. Make sure that your path includes ar])fi# Note that we set RANLIB to true if we don't find it (some systems neither# need it nor provide it)AC_CHECK_PROGS(RANLIB,ranlib,true)## Note: if we plan to use the sys/ipc.h header, we need to assert that# we're using sysv or xopen varities of unix# To check for this, we compile sys/ipc.h (if present) and check for# a warning about _SVID_SOURCE or _XOPEN_SOURCE. If either is found,# we set _XOPEN_SOURCE now, before we do much additional testingAC_MSG_CHECKING([whether we need to define _XOPEN_SOURCE for sys/ipc.h])pac_cv_ipc_h_needs_xopen_source=norm -f conftest*echo "#include <sys/ipc.h>" > conftest.cif $CC -c $CFLAGS $CPPFLAGS conftest.c 2>conftest.er1 1>/dev/null ; then if test -s conftest.er1 && \ grep _XOPEN_SOURCE conftest.er1 >/dev/null 2>&1 ; then if $CC -c $CFLAGS $CPPFLAGS -D_XOPEN_SOURCE=500 conftest.c \ 2>conftest.er1 1>/dev/null ; then pac_cv_ipc_h_needs_xopen_source=yes fi fifiAC_MSG_RESULT($pac_cv_ipc_h_needs_xopen_source)if test "$pac_cv_ipc_h_needs_xopen_source" = yes ; then AC_DEFINE(_XOPEN_SOURCE,500,[Define to access sys/ipc.h cleanly])firm -f conftest*dnl AC_DEFINE(USE_PROCESS_LOCKS,,[Define to use process locks])dnl AC_DEFINE(HAVE_SHARED_PROCESS_READ,,[Define to use /proc directory for shared process reads])dnl AC_DEFINE(USE_RDMA_GET,,[Define to use rdma get mechanisms])AC_CHECK_FUNCS( sysconf sysctl shmget shmat shmdt shmctl mmap )save_libs=$LIBSLIBS=AC_SEARCH_LIBS( shm_open, rt, have_shm_open=yes, have_shm_open=no)AC_SEARCH_LIBS( shm_unlink, rt, have_shm_unlink=yes, have_shm_unlink=no)if test $have_shm_open = "yes" -a $have_shm_unlink = "yes" ; then AC_MSG_CHECKING(that shm_open has been implemented) AC_TRY_RUN([#include <sys/types.h>#include <sys/mman.h>#include <fcntl.h>#include <errno.h>#include <unistd.h>int main(int argc, char ** argv){ int fd; fd = shm_open("/mpich2conf", O_RDWR | O_CREAT, 0666); if (fd == -1) { if (errno == ENOSYS) { return 1; } } else { shm_unlink("/mpich2conf"); close(fd); } return 0;}],shm_open_impl=yes,shm_open_impl=no,shm_open_impl=${CROSS_HAVE_SHM_OPEN:-no}) AC_MSG_RESULT($shm_open_impl) if test $shm_open_impl = "yes" ; then AC_DEFINE(HAVE_SHM_OPEN,,[Define if shm_open is available]) AC_DEFINE(HAVE_SHM_UNLINK,,[Define if shm_unlink is available]) else LIBS= fielse LIBS=fiSHM_LIBS=$LIBSLIBS=$save_libsAC_CHECK_HEADERS( \ assert.h \ errno.h \ fcntl.h \ stdlib.h \ sys/param.h \ sys/types.h \ unistd.h \ pthread.h \ sys/ipc.h sys/shm.h sys/param.h \ sys/socket.h netinet/in.h \ fcntl.h sys/mman.h \ sys/ptrace.h \ sys/sysctl.h \)# Check for memory atomic instructionsPAC_C_MEMATOMICAC_SUBST(device_name)AC_SUBST(channel_name)if test -z "$ENABLE_SHLIB" ; then CC_SHL="$CC" ENABLE_SHLIB=nonefiAC_SUBST(SHM_LIBS)AC_SUBST(AR)AC_SUBST(RANLIB)AC_SUBST(MPILIBNAME)AC_SUBST(CC)AC_SUBST(CFLAGS)AC_SUBST(CPPFLAGS)PAC_CC_SUBDIR_SHLIBS# We need the script that is used to create shared libraries if either# we are creating shared libraries for MPICH2 or we are creating the# dynamically loadable library for the debugger interfaceif test -z "$CREATESHLIB" ; then if test ! -d ../../../../util ; then mkdir ../../../../util fi CREATESHLIB=`cd ../../../../util && pwd` CREATESHLIB="$CREATESHLIB/createshlib"fiAC_SUBST(CREATESHLIB)if test -z "$BUILD_DLLS" ; then BUILD_DLLS=nofiAC_SUBST(BUILD_DLLS)AC_SUBST(master_top_srcdir)AC_SUBST(master_top_builddir)dnldnl Dependency handlingAC_SUBST(MAKE_DEPEND_C)dnldnl EtagsAC_SUBST(ETAGS)AC_SUBST(ETAGSADD)export ETAGSexport ETAGSADDPAC_UPDATE_BASE_CACHE# Add the MPICH2 include flags to CPPFLAGS. See the discussion above about# which include flags should start in MPICH2_INCLUDE_FLAGS and which in # CPPFLAGSCPPFLAGS="$CPPFLAGS $MPICH2_INCLUDE_FLAGS"# define the ABI version of the channel ABI that we are using.ABIVERSION=1:1AC_SUBST(ABIVERSION)dnl Place holder macro for finalizationPAC_SUBCONFIG_FINALIZE()dnl Add a step to create the dependencies directory if it is not presentAC_OUTPUT_COMMANDS([if grep 'dependencies:' Makefile >/dev/null 2>&1 ; then if test ! -s src/.deps/alldeps ; then echo "Updating dependency directories .deps" find src -type d -print | sed -e 's%\(.*\)%(cd \1 \&\& grep MAKE_DEPEND_C Makefile >/dev/null 2>\&1 \&\& ( test -d .deps || mkdir .deps) \&\& touch .deps/alldeps)%g' | shfi; fi])AC_OUTPUT(Makefile src/Makefile localdefs)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -