📄 aclocal.m4
字号:
else AC_CHECK_TYPE(bits64_t, double)fi])AC_DEFUN(BASH_TYPE_LONG_LONG,[AC_CACHE_CHECK([for long long], bash_cv_type_long_long,[AC_TRY_LINK([long long ll = 1; int i = 63;],[long long llm = (long long) -1;return ll << i | ll >> i | llm / ll | llm % ll;], bash_cv_type_long_long='long long', bash_cv_type_long_long='long')])if test "$bash_cv_type_long_long" = 'long long'; then AC_DEFINE(HAVE_LONG_LONG, 1)fi])AC_DEFUN(BASH_TYPE_UNSIGNED_LONG_LONG,[AC_CACHE_CHECK([for unsigned long long], bash_cv_type_unsigned_long_long,[AC_TRY_LINK([unsigned long long ull = 1; int i = 63;],[unsigned long long ullmax = (unsigned long long) -1;return ull << i | ull >> i | ullmax / ull | ullmax % ull;], bash_cv_type_unsigned_long_long='unsigned long long', bash_cv_type_unsigned_long_long='unsigned long')])if test "$bash_cv_type_unsigned_long_long" = 'unsigned long long'; then AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1)fi])dnldnl Type of struct rlimit fields: some systems (OSF/1, NetBSD, RISC/os 5.0)dnl have a rlim_t, others (4.4BSD based systems) use quad_t, others usednl long and still others use int (HP-UX 9.01, SunOS 4.1.3). To simplifydnl matters, this just checks for rlim_t, quad_t, or long.dnlAC_DEFUN(BASH_TYPE_RLIMIT,[AC_MSG_CHECKING(for size and type of struct rlimit fields)AC_CACHE_VAL(bash_cv_type_rlimit,[AC_TRY_COMPILE([#include <sys/types.h>#include <sys/resource.h>],[rlim_t xxx;], bash_cv_type_rlimit=rlim_t,[AC_TRY_RUN([#include <sys/types.h>#include <sys/time.h>#include <sys/resource.h>main(){#ifdef HAVE_QUAD_T struct rlimit rl; if (sizeof(rl.rlim_cur) == sizeof(quad_t)) exit(0);#endif exit(1);}], bash_cv_type_rlimit=quad_t, bash_cv_type_rlimit=long, [AC_MSG_WARN(cannot check quad_t if cross compiling -- defaulting to long) bash_cv_type_rlimit=long])])])AC_MSG_RESULT($bash_cv_type_rlimit)if test $bash_cv_type_rlimit = quad_t; thenAC_DEFINE(RLIMTYPE, quad_t)elif test $bash_cv_type_rlimit = rlim_t; thenAC_DEFINE(RLIMTYPE, rlim_t)fi])AC_DEFUN(BASH_FUNC_LSTAT,[dnl Cannot use AC_CHECK_FUNCS(lstat) because Linux defines lstat() as andnl inline function in <sys/stat.h>.AC_CACHE_CHECK([for lstat], bash_cv_func_lstat,[AC_TRY_LINK([#include <sys/types.h>#include <sys/stat.h>],[ lstat(".",(struct stat *)0); ],bash_cv_func_lstat=yes, bash_cv_func_lstat=no)])if test $bash_cv_func_lstat = yes; then AC_DEFINE(HAVE_LSTAT)fi])AC_DEFUN(BASH_FUNC_INET_ATON,[AC_CACHE_CHECK([for inet_aton], bash_cv_func_inet_aton,[AC_TRY_LINK([#include <sys/types.h>#include <netinet/in.h>#include <arpa/inet.h>struct in_addr ap;], [ inet_aton("127.0.0.1", &ap); ],bash_cv_func_inet_aton=yes, bash_cv_func_inet_aton=no)])if test $bash_cv_func_inet_aton = yes; then AC_DEFINE(HAVE_INET_ATON)else AC_LIBOBJ(inet_aton)fi])AC_DEFUN(BASH_FUNC_GETENV,[AC_MSG_CHECKING(to see if getenv can be redefined)AC_CACHE_VAL(bash_cv_getenv_redef,[AC_TRY_RUN([#ifdef HAVE_UNISTD_H# include <unistd.h>#endif#ifndef __STDC__# ifndef const# define const# endif#endifchar *getenv (name)#if defined (__linux__) || defined (__bsdi__) || defined (convex) const char *name;#else char const *name;#endif /* !__linux__ && !__bsdi__ && !convex */{return "42";}main(){char *s;/* The next allows this program to run, but does not allow bash to link when it redefines getenv. I'm not really interested in figuring out why not. */#if defined (NeXT)exit(1);#endifs = getenv("ABCDE");exit(s == 0); /* force optimizer to leave getenv in */}], bash_cv_getenv_redef=yes, bash_cv_getenv_redef=no, [AC_MSG_WARN(cannot check getenv redefinition if cross compiling -- defaulting to yes) bash_cv_getenv_redef=yes])])AC_MSG_RESULT($bash_cv_getenv_redef)if test $bash_cv_getenv_redef = yes; thenAC_DEFINE(CAN_REDEFINE_GETENV)fi])# We should check for putenv before calling thisAC_DEFUN(BASH_FUNC_STD_PUTENV,[AC_REQUIRE([AC_HEADER_STDC])AC_REQUIRE([AC_C_PROTOTYPES])AC_CACHE_CHECK([for standard-conformant putenv declaration], bash_cv_std_putenv,[AC_TRY_LINK([#if STDC_HEADERS#include <stdlib.h>#include <stddef.h>#endif#ifndef __STDC__# ifndef const# define const# endif#endif#ifdef PROTOTYPESextern int putenv (char *);#elseextern int putenv ();#endif],[return (putenv == 0);],bash_cv_std_putenv=yes, bash_cv_std_putenv=no)])if test $bash_cv_std_putenv = yes; thenAC_DEFINE(HAVE_STD_PUTENV)fi])# We should check for unsetenv before calling thisAC_DEFUN(BASH_FUNC_STD_UNSETENV,[AC_REQUIRE([AC_HEADER_STDC])AC_REQUIRE([AC_C_PROTOTYPES])AC_CACHE_CHECK([for standard-conformant unsetenv declaration], bash_cv_std_unsetenv,[AC_TRY_LINK([#if STDC_HEADERS#include <stdlib.h>#include <stddef.h>#endif#ifndef __STDC__# ifndef const# define const# endif#endif#ifdef PROTOTYPESextern int unsetenv (const char *);#elseextern int unsetenv ();#endif],[return (unsetenv == 0);],bash_cv_std_unsetenv=yes, bash_cv_std_unsetenv=no)])if test $bash_cv_std_unsetenv = yes; thenAC_DEFINE(HAVE_STD_UNSETENV)fi])AC_DEFUN(BASH_FUNC_ULIMIT_MAXFDS,[AC_MSG_CHECKING(whether ulimit can substitute for getdtablesize)AC_CACHE_VAL(bash_cv_ulimit_maxfds,[AC_TRY_RUN([main(){long maxfds = ulimit(4, 0L);exit (maxfds == -1L);}], bash_cv_ulimit_maxfds=yes, bash_cv_ulimit_maxfds=no, [AC_MSG_WARN(cannot check ulimit if cross compiling -- defaulting to no) bash_cv_ulimit_maxfds=no])])AC_MSG_RESULT($bash_cv_ulimit_maxfds)if test $bash_cv_ulimit_maxfds = yes; thenAC_DEFINE(ULIMIT_MAXFDS)fi])AC_DEFUN(BASH_FUNC_GETCWD,[AC_MSG_CHECKING([if getcwd() will dynamically allocate memory])AC_CACHE_VAL(bash_cv_getcwd_malloc,[AC_TRY_RUN([#include <stdio.h>#ifdef HAVE_UNISTD_H#include <unistd.h>#endifmain(){ char *xpwd; xpwd = getcwd(0, 0); exit (xpwd == 0);}], bash_cv_getcwd_malloc=yes, bash_cv_getcwd_malloc=no, [AC_MSG_WARN(cannot check whether getcwd allocates memory when cross-compiling -- defaulting to no) bash_cv_getcwd_malloc=no])])AC_MSG_RESULT($bash_cv_getcwd_malloc)if test $bash_cv_getcwd_malloc = no; thenAC_DEFINE(GETCWD_BROKEN)AC_LIBOBJ(getcwd)fi])dnldnl This needs BASH_CHECK_SOCKLIB, but since that's not called on everydnl system, we can't use AC_PREREQdnlAC_DEFUN(BASH_FUNC_GETHOSTBYNAME,[if test "X$bash_cv_have_gethostbyname" = "X"; then_bash_needmsg=yeselseAC_MSG_CHECKING(for gethostbyname in socket library)_bash_needmsg=fiAC_CACHE_VAL(bash_cv_have_gethostbyname,[AC_TRY_LINK([#include <netdb.h>],[ struct hostent *hp; hp = gethostbyname("localhost");], bash_cv_have_gethostbyname=yes, bash_cv_have_gethostbyname=no)])if test "X$_bash_needmsg" = Xyes; then AC_MSG_CHECKING(for gethostbyname in socket library)fiAC_MSG_RESULT($bash_cv_have_gethostbyname)if test "$bash_cv_have_gethostbyname" = yes; thenAC_DEFINE(HAVE_GETHOSTBYNAME)fi])AC_DEFUN(BASH_FUNC_FNMATCH_EXTMATCH,[AC_MSG_CHECKING(if fnmatch does extended pattern matching with FNM_EXTMATCH)AC_CACHE_VAL(bash_cv_fnm_extmatch,[AC_TRY_RUN([#include <fnmatch.h>main(){#ifdef FNM_EXTMATCH exit (0);#else exit (1);#endif}], bash_cv_fnm_extmatch=yes, bash_cv_fnm_extmatch=no, [AC_MSG_WARN(cannot check FNM_EXTMATCH if cross compiling -- defaulting to no) bash_cv_fnm_extmatch=no])])AC_MSG_RESULT($bash_cv_fnm_extmatch)if test $bash_cv_fnm_extmatch = yes; thenAC_DEFINE(HAVE_LIBC_FNM_EXTMATCH)fi])AC_DEFUN(BASH_FUNC_POSIX_SETJMP,[AC_REQUIRE([BASH_SYS_SIGNAL_VINTAGE])AC_MSG_CHECKING(for presence of POSIX-style sigsetjmp/siglongjmp)AC_CACHE_VAL(bash_cv_func_sigsetjmp,[AC_TRY_RUN([#ifdef HAVE_UNISTD_H#include <unistd.h>#endif#include <sys/types.h>#include <signal.h>#include <setjmp.h>main(){#if !defined (_POSIX_VERSION) || !defined (HAVE_POSIX_SIGNALS)exit (1);#elseint code;sigset_t set, oset;sigjmp_buf xx;/* get the mask */sigemptyset(&set);sigemptyset(&oset);sigprocmask(SIG_BLOCK, (sigset_t *)NULL, &set);sigprocmask(SIG_BLOCK, (sigset_t *)NULL, &oset);/* save it */code = sigsetjmp(xx, 1);if (code) exit(0); /* could get sigmask and compare to oset here. *//* change it */sigaddset(&set, SIGINT);sigprocmask(SIG_BLOCK, &set, (sigset_t *)NULL);/* and siglongjmp */siglongjmp(xx, 10);exit(1);#endif}], bash_cv_func_sigsetjmp=present, bash_cv_func_sigsetjmp=missing, [AC_MSG_WARN(cannot check for sigsetjmp/siglongjmp if cross-compiling -- defaulting to missing) bash_cv_func_sigsetjmp=missing])])AC_MSG_RESULT($bash_cv_func_sigsetjmp)if test $bash_cv_func_sigsetjmp = present; thenAC_DEFINE(HAVE_POSIX_SIGSETJMP)fi])AC_DEFUN(BASH_FUNC_STRCOLL,[AC_MSG_CHECKING(whether or not strcoll and strcmp differ)AC_CACHE_VAL(bash_cv_func_strcoll_broken,[AC_TRY_RUN([#include <stdio.h>#if defined (HAVE_LOCALE_H)#include <locale.h>#endifmain(c, v)int c;char *v[];{ int r1, r2; char *deflocale, *defcoll;#ifdef HAVE_SETLOCALE deflocale = setlocale(LC_ALL, ""); defcoll = setlocale(LC_COLLATE, "");#endif#ifdef HAVE_STRCOLL /* These two values are taken from tests/glob-test. */ r1 = strcoll("abd", "aXd");#else r1 = 0;#endif r2 = strcmp("abd", "aXd"); /* These two should both be greater than 0. It is permissible for a system to return different values, as long as the sign is the same. */ /* Exit with 1 (failure) if these two values are both > 0, since this tests whether strcoll(3) is broken with respect to strcmp(3) in the default locale. */ exit (r1 > 0 && r2 > 0);}], bash_cv_func_strcoll_broken=yes, bash_cv_func_strcoll_broken=no, [AC_MSG_WARN(cannot check strcoll if cross compiling -- defaulting to no) bash_cv_func_strcoll_broken=no])])AC_MSG_RESULT($bash_cv_func_strcoll_broken)if test $bash_cv_func_strcoll_broken = yes; thenAC_DEFINE(STRCOLL_BROKEN)fi])AC_DEFUN(BASH_FUNC_PRINTF_A_FORMAT,[AC_MSG_CHECKING([for printf floating point output in hex notation])AC_CACHE_VAL(bash_cv_printf_a_format,[AC_TRY_RUN([#include <stdio.h>#include <string.h>intmain(){ double y = 0.0; char abuf[1024]; sprintf(abuf, "%A", y); exit(strchr(abuf, 'P') == (char *)0);}], bash_cv_printf_a_format=yes, bash_cv_printf_a_format=no, [AC_MSG_WARN(cannot check printf if cross compiling -- defaulting to no) bash_cv_printf_a_format=no])])AC_MSG_RESULT($bash_cv_printf_a_format)if test $bash_cv_printf_a_format = yes; thenAC_DEFINE(HAVE_PRINTF_A_FORMAT)fi])AC_DEFUN(BASH_STRUCT_TERMIOS_LDISC,[AC_CHECK_MEMBER(struct termios.c_line, AC_DEFINE(TERMIOS_LDISC), ,[#include <sys/types.h>#include <termios.h>])])AC_DEFUN(BASH_STRUCT_TERMIO_LDISC,[AC_CHECK_MEMBER(struct termio.c_line, AC_DEFINE(TERMIO_LDISC), ,[#include <sys/types.h>#include <termio.h>])])dnldnl Like AC_STRUCT_ST_BLOCKS, but doesn't muck with LIBOBJSdnldnl sets bash_cv_struct_stat_st_blocksdnldnl unused for now; we'll see how AC_CHECK_MEMBERS worksdnlAC_DEFUN(BASH_STRUCT_ST_BLOCKS,[AC_MSG_CHECKING([for struct stat.st_blocks])AC_CACHE_VAL(bash_cv_struct_stat_st_blocks,[AC_TRY_COMPILE([#include <sys/types.h>#include <sys/stat.h>],[main(){static struct stat a;if (a.st_blocks) return 0;return 0;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -