📄 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()AC_ARG_ENABLE(sock-debug,[--enable-sock-debug - Turn on tests of the socket data structures],,enable_sock_debug=no)dnldnl Definitions will be placed in this file rather than in the DEFS variablednlAC_CONFIG_HEADER(mpidu_socki_conf.h)AH_TOP([/* -*- Mode: C; c-basic-offset:4 ; -*- *//* * (C) 2001 by Argonne National Laboratory. * See COPYRIGHT in top-level directory. */#ifndef MPIDU_SOCKI_CONF_H_INCLUDED#define MPIDU_SOCKI_CONF_H_INCLUDED])AH_BOTTOM([#endif])echo "RUNNING CONFIGURE FOR THE POLL IMPLEMENTATION OF SOCK"AC_ARG_ENABLE(echo, [--enable-echo - turn on echoing from within configure script], set -x)dnldnl First check that we have a clean build if we are doing a VPATH buildPAC_VPATH_CHECK()PAC_LOAD_BASE_CACHEif test "$enable_sock_debug" = yes ; then AC_DEFINE(USE_SOCK_VERIFY,1,[Define it the socket verify macros should be enabled])fiPAC_PROG_MAKEAC_C_INLINEdnldnl _XOPEN_SOURCE_EXTENDED=1 is required for Solaris to build properly */dnl (TEMPORARY - Setting the Unix source type must happen before dnl any tests are performed to ensure that all configure tests use thednl same environment. In particular, under AIX, this causes dnl struct timespec to *not* be defined, dnl CFLAGS="$CFLAGS -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"AC_CHECK_FUNC(poll,pac_cv_have_func_poll=yes,pac_cv_have_func_poll=no)if test "$pac_cv_have_func_poll" != yes ; then if test -f /sw/include/sys/poll.h ; then dnl This is for Mac OSX (Darwin) which doesn't have a poll function is the standard libraries. Instead we use a dnl contributedlibrary found off in la la land (/sw). CFLAGS="$CFLAGS -I/sw/include" TCP_LIBS="$TCP_LIBS -L/sw/lib -lpoll" else AC_MSG_ERROR([This device requires the poll function]) fifiAC_CHECK_HEADERS( \ assert.h \ errno.h \ fcntl.h \ limits.h \ netdb.h \ netinet/in.h \ netinet/tcp.h \ poll.h \ stdlib.h \ sys/param.h \ sys/poll.h \ sys/types.h \ sys/uio.h \ unistd.h)AC_MSG_CHECKING([if struct poll is defined]);AC_TRY_COMPILE([#if defined(HAVE_POLL_H)#include <poll.h>#endif#if defined(HAVE_SYS_POLL_H)#include <sys/poll.h>#endif],[struct pollfd pollfd;pollfd.fd = -1;],[AC_MSG_RESULT([yes])],[AC_MSG_RESULT([no])AC_MSG_ERROR([This device requires the poll function])])AC_MSG_CHECKING([if a simple program using poll() can be compiled]);AC_TRY_COMPILE([#if defined(HAVE_POLL_H)#include <poll.h>#endif#if defined(HAVE_SYS_POLL_H)#include <sys/poll.h>#endif],[struct pollfd pollfds[2];int n_fds;pollfds[0].fd = -1;pollfds[1].fd = -1;n_fds = poll(pollfds, 2, -1);],[AC_MSG_RESULT([yes])],[AC_MSG_RESULT([no])AC_MSG_ERROR([This device requires the poll function])])dnldnl needed on AIXdnlAC_MSG_CHECKING([whether bit fields work in ip.h]);AC_TRY_COMPILE([#include <netinet/tcp.h>],[int i;],[AC_MSG_RESULT([yes])bit_fields=yes],[AC_MSG_RESULT([no])bit_fields=no])if test "$bit_fields" = "no" ; then AC_MSG_RESULT([Adding -D_NO_BITFIELDS to CFLAGS]) CFLAGS="$CFLAGS -D_NO_BITFIELDS"fiAC_CHECK_FUNCS(gethostname)if test "$ac_cv_func_gethostname" = "yes" ; then # Do we need to declare gethostname? PAC_FUNC_NEEDS_DECL([#include <unistd.h>],gethostname)fisaveLIBS="$LIBS"LIBS=""AC_SEARCH_LIBS(socket,socket,,,$saveLIBS)AC_SEARCH_LIBS(gethostbyname,nsl,,,$saveLIBS)TCP_LIBS="$TCP_LIBS $LIBS"LIBS="$saveLIBS $LIBS"## Check first for sys/socket.h . We check not only for existence but whether# it can be compiled (!), as we have seen some problems with this.AC_TRY_COMPILE([#include <sys/types.h>#include <sys/socket.h>],[int a;],ac_cv_header_sys_socket_h=yes,ac_cv_header_sys_socket_h=no)if test "$ac_cv_header_sys_socket_h" = yes ; then AC_DEFINE(HAVE_SYS_SOCKET_H,1,[Define if you have the <sys/socket.h> header file.])fi# Check for socklen_t . If undefined, define it as int# (note the conditional inclusion of sys/socket.h)AC_CACHE_CHECK([whether socklen_t is defined (in sys/socket.h if present)],pac_cv_have_socklen_t,[AC_TRY_COMPILE([#include <sys/types.h>#ifdef HAVE_SYS_SOCKET_H#include <sys/socket.h>#endif]typedef struct { double a; int b; } socklen_t;,[socklen_t a;a.a=1.0;],pac_cv_have_socklen_t=no,pac_cv_have_socklen_t=yes)])if test "$pac_cv_have_socklen_t" = no ; then AC_DEFINE(socklen_t,int,[Define if socklen_t is not defined])fiAC_SUBST(TCP_LIBS)AC_SUBST(AR)AC_SUBST(RANLIB)AC_SUBST(MPILIBNAME)AC_SUBST(CC)AC_SUBST(CFLAGS)AC_SUBST(CPPFLAGS)PAC_CC_SUBDIR_SHLIBSif test -z "$ENABLE_SHLIB" -o "$ENABLE_SHLIB" = "no" ; then ENABLE_SHLIB=nonefiAC_SUBST(master_top_srcdir)AC_SUBST(master_top_builddir)dnldnl Dependency handlingAC_SUBST(MAKE_DEPEND_C)dnldnl EtagsAC_CHECK_PROGS(ETAGS,etags,true)AC_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"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 .deps/alldeps ; then echo "Updating dependency directories .deps" grep MAKE_DEPEND_C Makefile >/dev/null 2>&1 && \ ( test -d .deps || mkdir .deps) && touch .deps/alldepsfi; fi])AC_OUTPUT(Makefile localdefs)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -