⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 aclocal_cc.m4

📁 MPICH是MPI的重要研究,提供了一系列的接口函数,为并行计算的实现提供了编程环境.
💻 M4
📖 第 1 页 / 共 3 页
字号:
dnl Synopsis:dnl PAC_FUNC_CRYPTdnldnl Output Effects:dnl dnl In Solaris, the crypt function is not defined in unistd unless dnl _XOPEN_SOURCE is defines and _XOPEN_VERSION is 4 or greater.dnl We test by looking for a missing crypt by defining our owndnl incompatible one and trying to compile it.dnl Defines NEED_CRYPT_PROTOTYPE if no prototype is found.dnlD*/AC_DEFUN(PAC_FUNC_CRYPT,[AC_CACHE_CHECK([if crypt defined in unistd.h],pac_cv_func_crypt_defined,[AC_TRY_COMPILE([#include <unistd.h>double crypt(double a){return a;}],[return 0];,pac_cv_func_crypt_defined="no",pac_cv_func_crypt_defined="yes")])if test "$pac_cv_func_crypt_defined" = "no" ; then    # check to see if defining _XOPEN_SOURCE helps    AC_CACHE_CHECK([if crypt defined in unistd with _XOPEN_SOURCE],pac_cv_func_crypt_xopen,[    AC_TRY_COMPILE([#define _XOPEN_SOURCE    #include <unistd.h>double crypt(double a){return a;}],[return 0];,pac_cv_func_crypt_xopen="no",pac_cv_func_crypt_xopen="yes")])fiif test "$pac_cv_func_crypt_xopen" = "yes" ; then    AC_DEFINE(_XOPEN_SOURCE,,[if xopen needed for crypt])elif test "$pac_cv_func_crypt_defined" = "no" ; then    AC_DEFINE(NEED_CRYPT_PROTOTYPE,,[if a prototype for crypt is needed])fi])dnldnl/*Ddnl PAC_ARG_STRICT - Add --enable-strict to configure.  dnldnl Synopsis:dnl PAC_ARG_STRICTdnl dnl Output effects:dnl Adds '--enable-strict' to the command line.  If this is enabled, thendnl if no compiler has been set, set 'CC' to 'gcc'.dnl If the compiler is 'gcc', 'COPTIONS' is set to includednl.vbdnl	-O -Wall -Wstrict-prototypes -Wmissing-prototypes -DGCC_WALLdnl.vednldnl If the value 'all' is given to '--enable-strict', additional warningdnl options are included.  These arednl.vbdnl -Wunused -Wshadow -Wmissing-declarations -Wno-long-long -Wpointer-arithdnl.vednl dnl This only works where 'gcc' is available.dnl In addition, it exports the variable 'enable_strict_done'. Thisdnl ensures that subsidiary 'configure's do not add the above flags todnl 'COPTIONS' once the top level 'configure' sees '--enable-strict'.  To ensurednl this, 'COPTIONS' is also exported.dnldnl Not yet available: options when using other compilers.  However, dnl here are some possible choicesdnl Solaris ccdnl  -fd -v -XcdnldnlD*/AC_DEFUN(PAC_ARG_STRICT,[AC_ARG_ENABLE(strict,[--enable-strict  - Turn on strict compilation testing when using gcc])export enable_strict_doneexport COPTIONSif test "$enable_strict_done" != "yes" ; then    if test "$enable_strict" = "yes" ; then        enable_strict_done="yes"        if test -z "CC" ; then            AC_CHECK_PROGS(CC,gcc)            if test "$CC" = "gcc" ; then                 COPTIONS="${COPTIONS} -Wall -O -Wstrict-prototypes -Wmissing-prototypes -DGCC_WALL"    	    fi        fi    elif test "$enable_strict" = "all" ; then        enable_strict_done="yes"        if test -z "CC" ; then            AC_CHECK_PROGS(CC,gcc)            if test "$CC" = "gcc" ; then                 COPTIONS="${COPTIONS} -Wall -O -Wstrict-prototypes -Wmissing-prototypes -DGCC_WALL -Wunused -Wshadow -Wmissing-declarations -Wno-long-long"    	    fi        fi    fifi])dnl/*Ddnl PAC_ARG_CC_G - Add debugging flags for the C compilerdnldnl Synopsis:dnl PAC_ARG_CC_Gdnldnl Output Effect:dnl Adds '-g' to 'COPTIONS' and exports 'COPTIONS'.  Sets and exports the dnl variable 'enable_g_simple' so that subsidiary 'configure's will notdnl add another '-g'.dnldnl Notes:dnl '--enable-g' should be used for all internal debugging modes if possible.dnl Use the 'enable_val' that 'enable_g' is set to to pass particular values,dnl and ignore any values that are not recognized (some other 'configure' dnl may have used them.  Of course, if you need extra values, you mustdnl add code to extract values from 'enable_g'.dnldnl For example, to look for a particular keyword, you could usednl.vbdnl SaveIFS="$IFS"dnl IFS=","dnl for key in $enable_g ; dodnl     case $key in dnl         mem) # add code for memory debugging dnl         ;;dnl         *)   # ignore all other valuesdnl         ;;dnl     esacdnl donednl IFS="$SaveIFS"dnl.vednldnlD*/AC_DEFUN(PAC_ARG_CC_G,[AC_ARG_ENABLE(g,[--enable-g  - Turn on debugging of the package (typically adds -g to COPTIONS)])export COPTIONSexport enable_g_simpleif test -n "$enable_g" -a "$enable_g" != "no" -a \   "$enable_g_simple" != "done" ; then    enable_g_simple="done"    if test "$enable_g" = "g" -o "$enable_g" = "yes" ; then        COPTIONS="$COPTIONS -g"    fifi])dnldnl Simple version for both optionsdnlAC_DEFUN(PAC_ARG_CC_COMMON,[PAC_ARG_CC_GPAC_ARG_STRICT])dnldnl Eventually, this can be used instead of the funky Fortran stuff to dnl access the command line from a C routine.dnl #dnl # Under IRIX (some version) __Argc and __Argv gave the argc,argv valuesdnl #Under linux, __libc_argv and __libc_argcdnl AC_MSG_CHECKING([for alternative argc,argv names])dnl AC_TRY_LINK([dnl extern int __Argc; extern char **__Argv;],[return __Argc;],dnl alt_argv="__Argv")dnl if test -z "$alt_argv" ; thendnl    AC_TRY_LINK([dnl extern int __libc_argc; extern char **__libc_argv;],[return __lib_argc;],dnl alt_argv="__lib_argv")dnl fidnl if test -z "$alt_argv" ; thendnl   AC_MSG_RESULT(none found)) dnl else dnl   AC_MSG_RESULT($alt_argv) dnl fidnl dnldnl Check whether we need -fno-common to correctly compile the source code.dnl This is necessary if global variables are defined without values indnl gcc.  Here is the testdnl conftest1.c:dnl extern int a; int a;dnl conftest2.c:dnl extern int a; int main(int argc; char *argv[] ){ return a; }dnl Make a library out of conftest1.c and try to link with it.dnl If that fails, recompile it with -fno-common and see if that works.dnl If so, add -fno-common to CFLAGSdnl An alternative is to use, on some systems, ranlib -c to force dnl the system to find common symbols.dnldnl NOT TESTEDAC_DEFUN(PAC_PROG_C_BROKEN_COMMON,[AC_MSG_CHECKING([whether global variables handled properly])AC_MSG_REQUIRE([AC_PROG_RANLIB])ac_cv_prog_cc_globals_work=noecho 'extern int a; int a;' > conftest1.cecho 'extern int a; int main( ){ return a; }' > conftest2.cif ${CC-cc} $CFLAGS -c conftest1.c >conftest.out 2>&1 ; then    if ${AR-ar} cr libconftest.a conftest1.o >/dev/null 2>&1 ; then        if ${RANLIB-:} libconftest.a >/dev/null 2>&1 ; then            if ${CC-cc} $CFLAGS -o conftest conftest2.c $LDFLAGS libconftest.a >>conftest.out 2>&1 ; then		# Success!  C works		ac_cv_prog_cc_globals_work=yes	    else	        # Failure!  Do we need -fno-common?	        ${CC-cc} $CFLAGS -fno-common -c conftest1.c >> conftest.out 2>&1		rm -f libconftest.a		${AR-ar} cr libconftest.a conftest1.o	        ${RANLIB-:} libconftest.a	        if ${CC-cc} $CFLAGS -o conftest conftest2.c $LDFLAGS libconftest.a >> conftest.out 2>&1 ; then		    ac_cv_prog_cc_globals_work="needs -fno-common"		    CFLAGS="$CFLAGS -fno-common"		fi	    fi        fi    fifirm -f conftest* libconftest*AC_MSG_RESULT($ac_cv_prog_cc_globals_work)])dnldnldnl Return the structure alignment in pac_cv_c_struct_aligndnl Possible values includednl	packeddnl	largestdnl	twodnl	fourdnl	eightdnldnl In addition, a "Could not determine alignment" and a dnl "Multiple cases:" return is possible.  AC_DEFUN(PAC_C_STRUCT_ALIGNMENT,[AC_CACHE_CHECK([for C struct alignment],pac_cv_c_struct_align,[AC_TRY_RUN([#include <stdio.h>#define DBG(a,b,c)int main( int argc, char *argv[] ){    FILE *cf;    int is_packed  = 1;    int is_two     = 1;    int is_four    = 1;    int is_eight   = 1;    int is_largest = 1;    struct { char a; int b; } char_int;    struct { char a; short b; } char_short;    struct { char a; long b; } char_long;    struct { char a; float b; } char_float;    struct { char a; double b; } char_double;    struct { char a; int b; char c; } char_int_char;    struct { char a; short b; char c; } char_short_char;#ifdef HAVE_LONG_DOUBLE    struct { char a; long double b; } char_long_double;#endif    int size, extent;    size = sizeof(char) + sizeof(int);    extent = sizeof(char_int);    if (size != extent) is_packed = 0;    if ( (extent % sizeof(int)) != 0) is_largest = 0;    if ( (extent % 2) != 0) is_two = 0;    if ( (extent % 4) != 0) is_four = 0;    if (sizeof(int) == 8 && (extent % 8) != 0) is_eight = 0;    DBG("char_int",size,extent);    size = sizeof(char) + sizeof(short);    extent = sizeof(char_short);    if (size != extent) is_packed = 0;    if ( (extent % sizeof(short)) != 0) is_largest = 0;    if ( (extent % 2) != 0) is_two = 0;    if (sizeof(short) == 4 && (extent % 4) != 0) is_four = 0;    if (sizeof(short) == 8 && (extent % 8) != 0) is_eight = 0;    DBG("char_short",size,extent);    size = sizeof(char) + sizeof(long);    extent = sizeof(char_long);    if (size != extent) is_packed = 0;    if ( (extent % sizeof(long)) != 0) is_largest = 0;    if ( (extent % 2) != 0) is_two = 0;    if ( (extent % 4) != 0) is_four = 0;    if (sizeof(long) == 8 && (extent % 8) != 0) is_eight = 0;    DBG("char_long",size,extent);    size = sizeof(char) + sizeof(float);    extent = sizeof(char_float);    if (size != extent) is_packed = 0;    if ( (extent % sizeof(float)) != 0) is_largest = 0;    if ( (extent % 2) != 0) is_two = 0;    if ( (extent % 4) != 0) is_four = 0;    if (sizeof(float) == 8 && (extent % 8) != 0) is_eight = 0;    DBG("char_float",size,extent);    size = sizeof(char) + sizeof(double);    extent = sizeof(char_double);    if (size != extent) is_packed = 0;    if ( (extent % sizeof(double)) != 0) is_largest = 0;    if ( (extent % 2) != 0) is_two = 0;    if ( (extent % 4) != 0) is_four = 0;    if (sizeof(double) == 8 && (extent % 8) != 0) is_eight = 0;    DBG("char_double",size,extent);#ifdef HAVE_LONG_DOUBLE    size = sizeof(char) + sizeof(long double);    extent = sizeof(char_long_double);    if (size != extent) is_packed = 0;    if ( (extent % sizeof(long double)) != 0) is_largest = 0;    if ( (extent % 2) != 0) is_two = 0;    if ( (extent % 4) != 0) is_four = 0;    if (sizeof(long double) >= 8 && (extent % 8) != 0) is_eight = 0;    DBG("char_long-double",size,extent);#endif    /* char int char helps separate largest from 4/8 aligned */    size = sizeof(char) + sizeof(int) + sizeof(char);    extent = sizeof(char_int_char);    if (size != extent) is_packed = 0;    if ( (extent % sizeof(int)) != 0) is_largest = 0;    if ( (extent % 2) != 0) is_two = 0;    if ( (extent % 4) != 0) is_four = 0;    if (sizeof(int) == 8 && (extent % 8) != 0) is_eight = 0;    DBG("char_int_char",size,extent);    /* char short char helps separate largest from 4/8 aligned */    size = sizeof(char) + sizeof(short) + sizeof(char);    extent = sizeof(char_short_char);    if (size != extent) is_packed = 0;    if ( (extent % sizeof(short)) != 0) is_largest = 0;    if ( (extent % 2) != 0) is_two = 0;    if (sizeof(short) == 4 && (extent % 4) != 0) is_four = 0;    if (sizeof(short) == 8 && (extent % 8) != 0) is_eight = 0;    DBG("char_short_char",size,extent);    /* If aligned mod 8, it will be aligned mod 4 */    if (is_eight) { is_four = 0; is_two = 0; }    if (is_four) is_two = 0;    /* largest superceeds eight */    if (is_largest) is_eight = 0;    /* Tabulate the results */    cf = fopen( "ctest.out", "w" );    if (is_packed + is_largest + is_two + is_four + is_eight == 0) {	fprintf( cf, "Could not determine alignment\n" );    }    else {	if (is_packed + is_largest + is_two + is_four + is_eight != 1) {	    fprintf( cf, "Multiple cases:\n" );	}	if (is_packed) fprintf( cf, "packed\n" );	if (is_largest) fprintf( cf, "largest\n" );	if (is_two) fprintf( cf, "two\n" );	if (is_four) fprintf( cf, "four\n" );	if (is_eight) fprintf( cf, "eight\n" );    }    fclose( cf );    return 0;}],pac_cv_c_struct_align=`cat ctest.out`,pac_cv_c_struct_align="unknown",pac_cv_c_struct_align="unknown")rm -f ctest.out])])dnldnldnl/*Ddnl PAC_FUNC_NEEDS_DECL - Set NEEDS_<funcname>_DECL if a declaration is neededdnldnl Synopsis:dnl PAC_FUNC_NEEDS_DECL(headerfiles,funcname)dnldnl Output Effect:dnl Sets 'NEEDS_<funcname>_DECL' if 'funcname' is not declared by the dnl headerfiles.dnl D*/AC_DEFUN(PAC_FUNC_NEEDS_DECL,[AC_CACHE_CHECK([whether $2 needs a declaration],pac_cv_func_decl_$2,[AC_TRY_COMPILE([$1],[int a=$2(27,1.0,"foo");],pac_cv_func_decl_$2=yes,pac_cv_func_decl_$2=no)])if test "$pac_cv_func_decl_$2" = "yes" ; thenchangequote(, )dnl  ac_tr_func=NEEDS_`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`_DECLchangequote([, ])dnl    AC_DEFINE_UNQUOTED($ac_tr_func,,[Define if $2 needs a declaration])fi])dnldnldnl /*Ddnl PAC_CHECK_SIZEOF_DERIVED - Get the size of a user-defined type,dnl such as a structdnldnl PAC_CHECK_SIZEOF_DERIVED(shortname,definition,defaultsize)dnl Like AC_CHECK_SIZEOF, but handles arbitrary types.dnl Unlike AC_CHECK_SIZEOF, does not define SIZEOF_xxx (becausednl autoheader can't handle this case)dnl D*/AC_DEFUN(PAC_CHECK_SIZEOF_DERIVED,[changequote(<<,>>)dnldefine(<<AC_TYPE_NAME>>,translit(sizeof_$1,[a-z *], [A-Z_P]))dnldefine(<<AC_CV_NAME>>,translit(pac_cv_sizeof_$1,[ *], [_p]))dnlchangequote([,])dnlAC_MSG_CHECKING(size of $1)AC_CACHE_VAL(AC_CV_NAME,[AC_TRY_RUN([#include <stdio.h>main(){  $2 a;  FILE *f=fopen("conftestval", "w");  if (!f) exit(1);  fprintf(f, "%d\n", sizeof(a));  exit(0);}],AC_CV_NAME=`cat conftestval`,AC_CV_NAME=0,ifelse([$3],,,AC_CV_NAME=$3))])AC_MSG_RESULT($AC_CV_NAME)dnl AC_DEFINE_UNQUOTED(AC_TYPE_NAME,$AC_CV_NAME)undefine([AC_TYPE_NAME])undefine([AC_CV_NAME])])

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -