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

📄 aclocal.m4

📁 Linux下的中文输入法
💻 M4
📖 第 1 页 / 共 3 页
字号:
        esac        ;;    *86-*-gnu0* )        #   GNU/Hurd is similar to linux 2.0 in that it has        #   non-functional stubs for sigstack and sigaltstack.        ac_cv_check_sjlj=sjljlx        ;;    *-*-isc* )        ac_cv_check_sjlj=sjljisc        ;;    *-*-interix )        #   Interix is a POSIX sub-system on Windows-NT which        #   can use the Interactive UNIX dispatching code.        ac_cv_check_sjlj=sjljisc        ;;    *-*-cygwin* )        ac_cv_check_sjlj=sjljw32        ;;esac])dnl$3="$ac_cv_check_sjlj"if test ".$ac_cv_check_sjlj" != .none; then    AC_MSG_RESULT([yes: $ac_cv_check_sjlj])    ifelse([$1], , :, [$1])else    AC_MSG_RESULT([no])    ifelse([$2], , :, [$2])fi])dnldnl ##dnl ##  Check for number of signals (NSIG)dnl ##dnl ##  configure.ac:dnl ##    AC_CHECK_NSIG(<define>)dnl ##  acconfig.h:dnl ##    #undef <define>dnl ##  source.c:dnl ##    #include "config.h"dnl ##    ...<define>...AC_DEFUN(AC_CHECK_NSIG,[dnlAC_MSG_CHECKING(for number of signals)cross_compiling=noAC_TRY_RUN(changequote(<<, >>)dnl<<#include <stdio.h>#include <sys/types.h>#include <signal.h>int main(int argc, char *argv[]){    FILE *fp;    int nsig;#if defined(NSIG)    nsig = NSIG;#elif defined(_NSIG)    nsig = _NSIG;#else    nsig = (sizeof(sigset_t)*8);    if (nsig < 32)        nsig = 32;#endif    if ((fp = fopen("conftestval", "w")) == NULL)        exit(1);    fprintf(fp, "%d\n", nsig);    fclose(fp);    exit(0);}>>changequote([, ])dnl,nsig=`cat conftestval`,nsig=32,nsig=32)AC_MSG_RESULT([$nsig])AC_DEFINE_UNQUOTED($1, $nsig, [define for number of signals])])dnl ##dnl ##  Check for FD_SETSIZEdnl ##dnl ##  configure.in:dnl ##    AC_CHECK_FDSETSIZE(<varname>)AC_DEFUN(AC_CHECK_FDSETSIZE,[dnldnl #   1. determine default valueAC_MSG_CHECKING(for default value of FD_SETSIZE)cross_compiling=noAC_TRY_RUN(changequote(<<, >>)dnl<<#include <stdio.h>#include <sys/types.h>#include <unistd.h>int main(int argc, char *argv[]){    FILE *fp;    int ac_fdsetsize;#if defined(FD_SETSIZE)    ac_fdsetsize = FD_SETSIZE;#else    ac_fdsetsize = (sizeof(fd_set)*8);#endif    if ((fp = fopen("conftestval", "w")) == NULL)        exit(1);    fprintf(fp, "%d\n", ac_fdsetsize);    fclose(fp);    exit(0);}>>changequote([, ])dnl,ac_fdsetsize=`cat conftestval`,ac_fdsetsize=1024,ac_fdsetsize=1024)AC_MSG_RESULT([$ac_fdsetsize])$1="$ac_fdsetsize"AC_SUBST($1)dnl #   2. allow user to force a particular valueAC_ARG_WITH(fdsetsize,dnl[  --with-fdsetsize=NUM    set FD_SETSIZE while building GNU Pth],[case $withval in    [[1-9]][[0-9]]|[[1-9]][[0-9]][[0-9]]|[[1-9]][[0-9]][[0-9]][[0-9]]) $1=$withval ;;    * ) AC_ERROR([invalid FD_SETSIZE specified -- allowed: 10-9999]) ;;esacdnl # we cannot use the usualdnl # AC_DEFINE_UNQUOTED(FD_SETSIZE, $$1, [Define to the maximum size of fd_set])dnl # here, because FD_SETSIZE has to be defined already before any otherdnl # system headers are included. Hence we have to use CPPFLAGS.CPPFLAGS="$CPPFLAGS -DFD_SETSIZE=$$1"AC_MSG_CHECKING([for overridden FD_SETSIZE value])AC_MSG_RESULT([$$1])])])dnl ##dnl ##  Check for an external/extension library.dnl ##  - is aware of <libname>-config style scriptsdnl ##  - searches under standard paths include, lib, etc.dnl ##  - searches under subareas like .libs, etc.dnl ##dnl ##  configure.ac:dnl ##      AC_CHECK_EXTLIB(<realname>, <libname>, <func>, <header>,dnl ##                      [<success-action> [, <fail-action>]])dnl ##  Makefile.in:dnl ##      CFLAGS  = @CFLAGS@dnl ##      LDFLAGS = @LDFLAGS@dnl ##      LIBS    = @LIBS@dnl ##  shell:dnl ##      $ ./configure --with-<libname>[=DIR]dnl ##AC_DEFUN(AC_CHECK_EXTLIB,[dnlAC_ARG_WITH($2, [dnl[  --with-]m4_substr([$2[[=DIR]]                     ], 0, 19)[build with external $1 library (default=no)]], [dnl    if test ".$with_$2" = .yes; then        #   via config script in PATH        $2_version=`($2-config --version) 2>/dev/null`        if test ".$$2_version" != .; then            CPPFLAGS="$CPPFLAGS `$2-config --cflags`"            CFLAGS="$CFLAGS `$2-config --cflags`"            LDFLAGS="$LDFLAGS `$2-config --ldflags`"        fi    else        if test -d "$with_$2"; then            found=0            #   via config script            for dir in $with_$2/bin $with_$2; do                if test -f "$dir/$2-config" && test ! -f "$dir/$2-config.in"; then                    $2_version=`($dir/$2-config --version) 2>/dev/null`                    if test ".$$2_version" != .; then                        CPPFLAGS="$CPPFLAGS `$dir/$2-config --cflags`"                        CFLAGS="$CFLAGS `$dir/$2-config --cflags`"                        LDFLAGS="$LDFLAGS `$dir/$2-config --ldflags`"                        found=1                        break                    fi                fi            done            #   in standard sub-areas            if test ".$found" = .0; then                for dir in $with_$2/include/$2 $with_$2/include $with_$2; do                    if test -f "$dir/$4"; then                        CPPFLAGS="$CPPFLAGS -I$dir"                        CFLAGS="$CFLAGS -I$dir"                        found=1                        break                    fi                done                for dir in $with_$2/lib/$2 $with_$2/lib $with_$2; do                    if test -f "$dir/lib$2.la" && test -d "$dir/.libs"; then                        LDFLAGS="$LDFLAGS -L$dir -L$dir/.libs"                        found=1                        break                    elif test -f "$dir/lib$2.a" || test -f "$dir/lib$2.so"; then                        LDFLAGS="$LDFLAGS -L$dir"                        found=1                        break                    fi                done            fi            #   in any sub-area            if test ".$found" = .0; thenchangequote(, )dnl                for file in x `find $with_$2 -name "$4" -type f -print`; do                    test .$file = .x && continue                    dir=`echo $file | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'`                    CPPFLAGS="$CPPFLAGS -I$dir"                    CFLAGS="$CFLAGS -I$dir"                done                for file in x `find $with_$2 -name "lib$2.[aso]" -type f -print`; do                    test .$file = .x && continue                    dir=`echo $file | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'`                    LDFLAGS="$LDFLAGS -L$dir"                donechangequote([, ])dnl            fi        fi    fi    AC_HAVE_HEADERS($4)    AC_CHECK_LIB($2, $3)    with_$2=yes    ac_var="ac_cv_header_`echo $4 | sed 'y%./+-%__p_%'`"    eval "ac_val=\$$ac_var"    if test ".$ac_val" != .yes; then        with_$2=no    fi    if test ".$ac_cv_lib_$2_$3" != .yes; then        with_$2=no    fi    if test ".$with_$2" = .no; then        AC_ERROR([Unable to find $1 library])    fi    ], [dnlif test ".$with_$2" = .; then    with_$2=nofi    ])dnlAC_MSG_CHECKING(whether to build against external $1 library)if test ".$with_$2" = .yes; then    ifelse([$5], , :, [$5])else    ifelse([$6], , :, [$6])fiAC_MSG_RESULT([$with_$2])])dnldnl ##dnl ##  Check whether SVR4/SUSv2 makecontext(2), swapcontext(2) anddnl ##  friends can be used for user-space context switchingdnl ##dnl ##  configure.ac:dnl ##     AC_CHECK_MCSC(<success-action>, <failure-action>)dnl ##AC_DEFUN(AC_CHECK_MCSC, [AC_MSG_CHECKING(for usable SVR4/SUSv2 makecontext(2)/swapcontext(2))AC_CACHE_VAL(ac_cv_check_mcsc, [AC_TRY_RUN([#include <stdio.h>#include <stdlib.h>#include <ucontext.h>ucontext_t uc_child;ucontext_t uc_main;void child(void *arg){    if (arg != (void *)12345)        exit(1);    if (swapcontext(&uc_child, &uc_main) != 0)        exit(1);}int main(int argc, char *argv[]){    FILE *fp;    void *stack;    /* the default is that it fails */    if ((fp = fopen("conftestval", "w")) == NULL)        exit(1);    fprintf(fp, "no\n");    fclose(fp);    /* configure a child user-space context */    if ((stack = malloc(64*1024)) == NULL)        exit(1);    if (getcontext(&uc_child) != 0)        exit(1);    uc_child.uc_link = NULL;    uc_child.uc_stack.ss_sp = (char *)stack+(32*1024);    uc_child.uc_stack.ss_size = 32*1024;    uc_child.uc_stack.ss_flags = 0;    makecontext(&uc_child, child, 2, (void *)12345);    /* switch into the user context */    if (swapcontext(&uc_main, &uc_child) != 0)        exit(1);    /* Fine, child came home */    if ((fp = fopen("conftestval", "w")) == NULL)        exit(1);    fprintf(fp, "yes\n");    fclose(fp);    /* die successfully */    exit(0);}],ac_cv_check_mcsc=`cat conftestval`,ac_cv_check_mcsc=no,ac_cv_check_mcsc=no)dnl])dnlAC_MSG_RESULT([$ac_cv_check_mcsc])if test ".$ac_cv_check_mcsc" = .yes; then    ifelse([$1], , :, [$1])else    ifelse([$2], , :, [$2])fi])dnldnl ##dnl ##  Check how stacks have to be setup for the functionsdnl ##  sigstack(2), sigaltstack(2) and makecontext(2).dnl ##dnl ##  configure.ac:dnl ##    AC_CHECK_STACKSETUP(sigstack|sigaltstack|makecontext, <macro-addr>, <macro-size>)dnl ##  acconfig.h:dnl ##    #undef HAVE_{SIGSTACK|SIGALTSTACK|MAKECONTEXT}dnl ##    #undef HAVE_STACK_Tdnl ##  header.h.in:dnl ##    @<macro-addr>@dnl ##    @<macro-size>@dnl ##  source.c:dnl ##    #include "header.h"dnl ##    xxx.sp_ss   = <macro-addr>(skaddr, sksize);dnl ##    xxx.sp_size = <macro-size>(skaddr, sksize);dnl ##AC_DEFUN(AC_CHECK_STACKSETUP,[dnldnl #   check for consistent usageifelse($1,[sigstack],,[ifelse($1,[sigaltstack],,[ifelse($1,[makecontext],,[errprint(__file__:__line__: [AC_CHECK_STACKSETUP: only sigstack, sigaltstack and makecontext supported])])])])dnl #   we require the C compiler and the standard headersAC_REQUIRE([AC_HEADER_STDC])dnldnl #   we at least require the function to checkAC_CHECK_FUNCS($1)dnl #   sigaltstack on some platforms uses stack_t instead of struct sigaltstackifelse($1, sigaltstack, [    AC_ONCE(stacksetup_stack_t, [        AC_CHECK_TYPEDEF(stack_t, signal.h)    ])])dnl #   display processing headerAC_MSG_CHECKING(for stack setup via $1)dnl #   but cache the whole resultsAC_CACHE_VAL(ac_cv_stacksetup_$1,[if test ".$ac_cv_func_$1" = .no; then    dnl #   no need to check anything when function is already missing    ac_cv_stacksetup_$1="N.A.:/*N.A.*/,/*N.A.*/"else    dnl #   setup compile environment    OCFLAGS="$CFLAGS"    CFLAGS="$CFLAGS -DTEST_$1"    cross_compiling=no    dnl #   compile and run the test program    AC_TRY_RUN([#include <stdio.h>#include <stdlib.h>#include <string.h>#if defined(TEST_sigstack) || defined(TEST_sigaltstack)#include <sys/types.h>#include <signal.h>#include <unistd.h>#endif#if defined(TEST_makecontext)#include <ucontext.h>#endifunion alltypes {    long   l;    double d;    void  *vp;    void (*fp)(void);    char  *cp;};static volatile char *handler_addr = (char *)0xDEAD;#if defined(TEST_sigstack) || defined(TEST_sigaltstack)static volatile int handler_done = 0;void handler(int sig){    char garbage[1024];    int i;    auto int dummy;    for (i = 0; i < 1024; i++)        garbage[i] = 'X';    handler_addr = (char *)&dummy;    handler_done = 1;    return;}#endif#if defined(TEST_makecontext)static ucontext_t uc_handler;static ucontext_t uc_main;void handler(void){    char garbage[1024];    int i;    auto int dummy;    for (i = 0; i < 1024; i++)        garbage[i] = 'X';    handler_addr = (char *)&dummy;    swapcontext(&uc_handler, &uc_main);    return;}#endifint main(int argc, char *argv[]){    FILE *f;    char *skaddr;    char *skbuf;    int sksize;    char result[1024];    int i;    sksize = 32768;    skbuf = (char *)malloc(sksize*2+2*sizeof(union alltypes));    if (skbuf == NULL)        exit(1);    for (i = 0; i < sksize*2+2*sizeof(union alltypes); i++)        skbuf[i] = 'A';    skaddr = skbuf+sizeof(union alltypes);#if defined(TEST_sigstack) || defined(TEST_sigaltstack)    {        struct sigaction sa;#if defined(TEST_sigstack)        struct sigstack ss;#elif defined(TEST_sigaltstack) && defined(HAVE_STACK_T)        stack_t ss;#else        struct sigaltstack ss;#endif#if defined(TEST_sigstack)        ss.ss_sp      = (void *)(skaddr + sksize);        ss.ss_onstack = 0;        if (sigstack(&ss, NULL) < 0)            exit(1);#elif defined(TEST_sigaltstack)        ss.ss_sp    = (void *)(skaddr + sksize);        ss.ss_size  = sksize;        ss.ss_flags = 0;        if (sigaltstack(&ss, NULL) < 0)            exit(1);#endif        memset((void *)&sa, 0, sizeof(struct sigaction));        sa.sa_handler = handler;        sa.sa_flags = SA_ONSTACK;        sigemptyset(&sa.sa_mask);        sigaction(SIGUSR1, &sa, NULL);        kill(getpid(), SIGUSR1);        while (!handler_done)            /*nop*/;    }#endif#if defined(TEST_makecontext)    {        if (getcontext(&uc_handler) != 0)            exit(1);        uc_handler.uc_link = NULL;        uc_handler.uc_stack.ss_sp    = (void *)(skaddr + sksize);        uc_handler.uc_stack.ss_size  = sksize;        uc_handler.uc_stack.ss_flags = 0;        makecontext(&uc_handler, handler, 1);        swapcontext(&uc_main, &uc_handler);    }#endif    if (handler_addr == (char *)0xDEAD)        exit(1);    if (handler_addr < skaddr+sksize) {        /* stack was placed into lower area */        if (*(skaddr+sksize) != 'A')             sprintf(result, "(skaddr)+(sksize)-%d,(sksize)-%d",                     sizeof(union alltypes), sizeof(union alltypes));        else             strcpy(result, "(skaddr)+(sksize),(sksize)");    }    else {        /* stack was placed into higher area */        if (*(skaddr+sksize*2) != 'A')            sprintf(result, "(skaddr),(sksize)-%d", sizeof(union alltypes));        else            strcpy(result, "(skaddr),(sksize)");    }    if ((f = fopen("conftestval", "w")) == NULL)        exit(1);    fprintf(f, "%s\n", result);    fclose(f);    exit(0);}],[dnl #   test successully passedac_cv_stacksetup_$1=`cat conftestval`ac_cv_stacksetup_$1="ok:$ac_cv_stacksetup_$1"],[dnl #   test failedac_cv_stacksetup_$1='guessed:(skaddr),(sksize)'],[dnl #   cross-platform => failedac_cv_stacksetup_$1='guessed:(skaddr),(sksize)'])dnl #   restore original compile environmentCFLAGS="$OCFLAGS"])dnlfidnl #   extract result ingredients of single cached result valuetype=`echo $ac_cv_stacksetup_$1 | sed -e 's;:.*$;;'`addr=`echo $ac_cv_stacksetup_$1 | sed -e 's;^.*:;;' -e 's;,.*$;;'`size=`echo $ac_cv_stacksetup_$1 | sed -e 's;^.*:;;' -e 's;^.*,;;'`dnl #   export result ingredients$2="#define $2(skaddr,sksize) ($addr)"$3="#define $3(skaddr,sksize) ($size)"AC_SUBST($2)dnlAC_SUBST($3)dnldnl #   display result indicatorAC_MSG_RESULT([$type])dnl #   display results in detailAC_MSG_VERBOSE([$]$2)AC_MSG_VERBOSE([$]$3)])

⌨️ 快捷键说明

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