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

📄 aclocal.m4

📁 在非GUI环境下
💻 M4
📖 第 1 页 / 共 5 页
字号:
dnldnl Bash specific testsdnldnl Some derived from PDKSH 5.1.3 autoconf testsdnlAC_DEFUN(BASH_C_LONG_LONG,[AC_CACHE_CHECK(for long long, ac_cv_c_long_long,[if test "$GCC" = yes; then  ac_cv_c_long_long=yeselseAC_TRY_RUN([intmain(){long long foo = 0;exit(sizeof(long long) < sizeof(long));}], ac_cv_c_long_long=yes, ac_cv_c_long_long=no)fi])if test $ac_cv_c_long_long = yes; then  AC_DEFINE(HAVE_LONG_LONG, 1, [Define if the `long long' type works.])fi])dnldnl This is very similar to AC_C_LONG_DOUBLE, with the fix for IRIXdnl (< changed to <=) added.dnlAC_DEFUN(BASH_C_LONG_DOUBLE,[AC_CACHE_CHECK(for long double, ac_cv_c_long_double,[if test "$GCC" = yes; then  ac_cv_c_long_double=yeselseAC_TRY_RUN([intmain(){  /* The Stardent Vistra knows sizeof(long double), but does not     support it. */  long double foo = 0.0;  /* On Ultrix 4.3 cc, long double is 4 and double is 8.  */  /* On IRIX 5.3, the compiler converts long double to double with a warning,     but compiles this successfully. */  exit(sizeof(long double) <= sizeof(double));}], ac_cv_c_long_double=yes, ac_cv_c_long_double=no)fi])if test $ac_cv_c_long_double = yes; then  AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define if the `long double' type works.])fi])dnldnl Check for <inttypes.h>.  This is separated out so that it can bednl AC_REQUIREd.dnldnl BASH_HEADER_INTTYPESAC_DEFUN(BASH_HEADER_INTTYPES,[ AC_CHECK_HEADERS(inttypes.h)])dnldnl check for typedef'd symbols in header files, but allow the caller todnl specify the include files to be checked in addition to the defaultdnl dnl BASH_CHECK_TYPE(TYPE, HEADERS, DEFAULT[, VALUE-IF-FOUND])AC_DEFUN(BASH_CHECK_TYPE,[AC_REQUIRE([AC_HEADER_STDC])dnlAC_REQUIRE([BASH_HEADER_INTTYPES])AC_MSG_CHECKING(for $1)AC_CACHE_VAL(bash_cv_type_$1,[AC_EGREP_CPP($1, [#include <sys/types.h>#if STDC_HEADERS#include <stdlib.h>#include <stddef.h>#endif#if HAVE_INTTYPES_H#include <inttypes.h>#endif$2], bash_cv_type_$1=yes, bash_cv_type_$1=no)])AC_MSG_RESULT($bash_cv_type_$1)ifelse($#, 4, [if test $bash_cv_type_$1 = yes; then	AC_DEFINE($4)	fi])if test $bash_cv_type_$1 = no; then  AC_DEFINE_UNQUOTED($1, $3)fi])dnldnl BASH_CHECK_DECL(FUNC)dnldnl Check for a declaration of FUNC in stdlib.h and inttypes.h likednl AC_CHECK_DECLdnlAC_DEFUN(BASH_CHECK_DECL,[AC_REQUIRE([AC_HEADER_STDC])AC_REQUIRE([BASH_HEADER_INTTYPES])AC_CACHE_CHECK([for declaration of $1], bash_cv_decl_$1,[AC_TRY_LINK([#if STDC_HEADERS#  include <stdlib.h>#endif#if HAVE_INTTYPES_H#  include <inttypes.h>#endif],[return !$1;],bash_cv_decl_$1=yes, bash_cv_decl_$1=no)])bash_tr_func=HAVE_DECL_`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`if test $bash_cv_decl_$1 = yes; then  AC_DEFINE_UNQUOTED($bash_tr_func, 1)else  AC_DEFINE_UNQUOTED($bash_tr_func, 0)fi])AC_DEFUN(BASH_DECL_PRINTF,[AC_MSG_CHECKING(for declaration of printf in <stdio.h>)AC_CACHE_VAL(bash_cv_printf_declared,[AC_TRY_RUN([#include <stdio.h>#ifdef __STDC__typedef int (*_bashfunc)(const char *, ...);#elsetypedef int (*_bashfunc)();#endifmain(){_bashfunc pf;pf = (_bashfunc) printf;exit(pf == 0);}], bash_cv_printf_declared=yes, bash_cv_printf_declared=no,   [AC_MSG_WARN(cannot check printf declaration if cross compiling -- defaulting to yes)    bash_cv_printf_declared=yes])])AC_MSG_RESULT($bash_cv_printf_declared)if test $bash_cv_printf_declared = yes; thenAC_DEFINE(PRINTF_DECLARED)fi])AC_DEFUN(BASH_DECL_SBRK,[AC_MSG_CHECKING(for declaration of sbrk in <unistd.h>)AC_CACHE_VAL(bash_cv_sbrk_declared,[AC_EGREP_HEADER(sbrk, unistd.h, bash_cv_sbrk_declared=yes, bash_cv_sbrk_declared=no)])AC_MSG_RESULT($bash_cv_sbrk_declared)if test $bash_cv_sbrk_declared = yes; thenAC_DEFINE(SBRK_DECLARED)fi])dnldnl Check for sys_siglist[] or _sys_siglist[]dnlAC_DEFUN(BASH_DECL_UNDER_SYS_SIGLIST,[AC_MSG_CHECKING([for _sys_siglist in signal.h or unistd.h])AC_CACHE_VAL(bash_cv_decl_under_sys_siglist,[AC_TRY_COMPILE([#include <sys/types.h>#include <signal.h>#ifdef HAVE_UNISTD_H#include <unistd.h>#endif], [ char *msg = _sys_siglist[2]; ],  bash_cv_decl_under_sys_siglist=yes, bash_cv_decl_under_sys_siglist=no,  [AC_MSG_WARN(cannot check for _sys_siglist[] if cross compiling -- defaulting to no)])])dnlAC_MSG_RESULT($bash_cv_decl_under_sys_siglist)if test $bash_cv_decl_under_sys_siglist = yes; thenAC_DEFINE(UNDER_SYS_SIGLIST_DECLARED)fi])AC_DEFUN(BASH_UNDER_SYS_SIGLIST,[AC_REQUIRE([BASH_DECL_UNDER_SYS_SIGLIST])AC_MSG_CHECKING([for _sys_siglist in system C library])AC_CACHE_VAL(bash_cv_under_sys_siglist,[AC_TRY_RUN([#include <sys/types.h>#include <signal.h>#ifdef HAVE_UNISTD_H#include <unistd.h>#endif#ifndef UNDER_SYS_SIGLIST_DECLAREDextern char *_sys_siglist[];#endifmain(){char *msg = (char *)_sys_siglist[2];exit(msg == 0);}],	bash_cv_under_sys_siglist=yes, bash_cv_under_sys_siglist=no,	[AC_MSG_WARN(cannot check for _sys_siglist[] if cross compiling -- defaulting to no)	 bash_cv_under_sys_siglist=no])])AC_MSG_RESULT($bash_cv_under_sys_siglist)if test $bash_cv_under_sys_siglist = yes; thenAC_DEFINE(HAVE_UNDER_SYS_SIGLIST)fi])AC_DEFUN(BASH_SYS_SIGLIST,[AC_REQUIRE([AC_DECL_SYS_SIGLIST])AC_MSG_CHECKING([for sys_siglist in system C library])AC_CACHE_VAL(bash_cv_sys_siglist,[AC_TRY_RUN([#include <sys/types.h>#include <signal.h>#ifdef HAVE_UNISTD_H#include <unistd.h>#endif#ifndef SYS_SIGLIST_DECLAREDextern char *sys_siglist[];#endifmain(){char *msg = sys_siglist[2];exit(msg == 0);}],	bash_cv_sys_siglist=yes, bash_cv_sys_siglist=no,	[AC_MSG_WARN(cannot check for sys_siglist if cross compiling -- defaulting to no)	 bash_cv_sys_siglist=no])])AC_MSG_RESULT($bash_cv_sys_siglist)if test $bash_cv_sys_siglist = yes; thenAC_DEFINE(HAVE_SYS_SIGLIST)fi])dnl Check for the various permutations of sys_siglist and make sure wednl compile in siglist.o if they're not definedAC_DEFUN(BASH_CHECK_SYS_SIGLIST, [AC_REQUIRE([BASH_SYS_SIGLIST])AC_REQUIRE([BASH_DECL_UNDER_SYS_SIGLIST])AC_REQUIRE([BASH_FUNC_STRSIGNAL])if test "$bash_cv_sys_siglist" = no && test "$bash_cv_under_sys_siglist" = no && test "$bash_cv_have_strsignal" = no; then  SIGLIST_O=siglist.oelse  SIGLIST_O=fiAC_SUBST([SIGLIST_O])])dnl Check for sys_errlist[] and sys_nerr, check for declarationAC_DEFUN(BASH_SYS_ERRLIST,[AC_MSG_CHECKING([for sys_errlist and sys_nerr])AC_CACHE_VAL(bash_cv_sys_errlist,[AC_TRY_LINK([#include <errno.h>],[extern char *sys_errlist[]; extern int sys_nerr; char *msg = sys_errlist[sys_nerr - 1];],    bash_cv_sys_errlist=yes, bash_cv_sys_errlist=no)])dnlAC_MSG_RESULT($bash_cv_sys_errlist)if test $bash_cv_sys_errlist = yes; thenAC_DEFINE(HAVE_SYS_ERRLIST)fi])dnldnl Check if dup2() does not clear the close on exec flagdnlAC_DEFUN(BASH_FUNC_DUP2_CLOEXEC_CHECK,[AC_MSG_CHECKING(if dup2 fails to clear the close-on-exec flag)AC_CACHE_VAL(bash_cv_dup2_broken,[AC_TRY_RUN([#include <sys/types.h>#include <fcntl.h>main(){  int fd1, fd2, fl;  fd1 = open("/dev/null", 2);  if (fcntl(fd1, 2, 1) < 0)    exit(1);  fd2 = dup2(fd1, 1);  if (fd2 < 0)    exit(2);  fl = fcntl(fd2, 1, 0);  /* fl will be 1 if dup2 did not reset the close-on-exec flag. */  exit(fl != 1);}], bash_cv_dup2_broken=yes, bash_cv_dup2_broken=no,    [AC_MSG_WARN(cannot check dup2 if cross compiling -- defaulting to no)     bash_cv_dup2_broken=no])])AC_MSG_RESULT($bash_cv_dup2_broken)if test $bash_cv_dup2_broken = yes; thenAC_DEFINE(DUP2_BROKEN)fi])AC_DEFUN(BASH_FUNC_STRSIGNAL,[AC_MSG_CHECKING([for the existence of strsignal])AC_CACHE_VAL(bash_cv_have_strsignal,[AC_TRY_LINK([#include <sys/types.h>#include <signal.h>],[char *s = (char *)strsignal(2);], bash_cv_have_strsignal=yes, bash_cv_have_strsignal=no)])AC_MSG_RESULT($bash_cv_have_strsignal)if test $bash_cv_have_strsignal = yes; thenAC_DEFINE(HAVE_STRSIGNAL)fi])dnl Check to see if opendir will open non-directories (not a nice thing)AC_DEFUN(BASH_FUNC_OPENDIR_CHECK,[AC_REQUIRE([AC_HEADER_DIRENT])dnlAC_MSG_CHECKING(if opendir() opens non-directories)AC_CACHE_VAL(bash_cv_opendir_not_robust,[AC_TRY_RUN([#include <stdio.h>#include <sys/types.h>#include <fcntl.h>#ifdef HAVE_UNISTD_H# include <unistd.h>#endif /* HAVE_UNISTD_H */#if defined(HAVE_DIRENT_H)# include <dirent.h>#else# define dirent direct# ifdef HAVE_SYS_NDIR_H#  include <sys/ndir.h># endif /* SYSNDIR */# ifdef HAVE_SYS_DIR_H#  include <sys/dir.h># endif /* SYSDIR */# ifdef HAVE_NDIR_H#  include <ndir.h># endif#endif /* HAVE_DIRENT_H */main(){DIR *dir;int fd, err;err = mkdir("/tmp/bash-aclocal", 0700);if (err < 0) {  perror("mkdir");  exit(1);}unlink("/tmp/bash-aclocal/not_a_directory");fd = open("/tmp/bash-aclocal/not_a_directory", O_WRONLY|O_CREAT|O_EXCL, 0666);write(fd, "\n", 1);close(fd);dir = opendir("/tmp/bash-aclocal/not_a_directory");unlink("/tmp/bash-aclocal/not_a_directory");rmdir("/tmp/bash-aclocal");exit (dir == 0);}], bash_cv_opendir_not_robust=yes,bash_cv_opendir_not_robust=no,    [AC_MSG_WARN(cannot check opendir if cross compiling -- defaulting to no)     bash_cv_opendir_not_robust=no])])AC_MSG_RESULT($bash_cv_opendir_not_robust)if test $bash_cv_opendir_not_robust = yes; thenAC_DEFINE(OPENDIR_NOT_ROBUST)fi])dnlAC_DEFUN(BASH_TYPE_SIGHANDLER,[AC_MSG_CHECKING([whether signal handlers are of type void])AC_CACHE_VAL(bash_cv_void_sighandler,[AC_TRY_COMPILE([#include <sys/types.h>#include <signal.h>#ifdef signal#undef signal#endif#ifdef __cplusplusextern "C"#endifvoid (*signal ()) ();],[int i;], bash_cv_void_sighandler=yes, bash_cv_void_sighandler=no)])dnlAC_MSG_RESULT($bash_cv_void_sighandler)if test $bash_cv_void_sighandler = yes; thenAC_DEFINE(VOID_SIGHANDLER)fi])dnldnl A signed 16-bit integer quantitydnlAC_DEFUN(BASH_TYPE_BITS16_T,[if test "$ac_cv_sizeof_short" = 2; then  AC_CHECK_TYPE(bits16_t, short)elif test "$ac_cv_sizeof_char" = 2; then  AC_CHECK_TYPE(bits16_t, char)else  AC_CHECK_TYPE(bits16_t, short)fi])dnldnl An unsigned 16-bit integer quantitydnlAC_DEFUN(BASH_TYPE_U_BITS16_T,[if test "$ac_cv_sizeof_short" = 2; then  AC_CHECK_TYPE(u_bits16_t, unsigned short)elif test "$ac_cv_sizeof_char" = 2; then  AC_CHECK_TYPE(u_bits16_t, unsigned char)else  AC_CHECK_TYPE(u_bits16_t, unsigned short)fi])dnldnl A signed 32-bit integer quantitydnlAC_DEFUN(BASH_TYPE_BITS32_T,[if test "$ac_cv_sizeof_int" = 4; then  AC_CHECK_TYPE(bits32_t, int)elif test "$ac_cv_sizeof_long" = 4; then  AC_CHECK_TYPE(bits32_t, long)else  AC_CHECK_TYPE(bits32_t, int)fi])dnldnl An unsigned 32-bit integer quantitydnlAC_DEFUN(BASH_TYPE_U_BITS32_T,[if test "$ac_cv_sizeof_int" = 4; then  AC_CHECK_TYPE(u_bits32_t, unsigned int)elif test "$ac_cv_sizeof_long" = 4; then  AC_CHECK_TYPE(u_bits32_t, unsigned long)else  AC_CHECK_TYPE(u_bits32_t, unsigned int)fi])AC_DEFUN(BASH_TYPE_PTRDIFF_T,[if test "$ac_cv_sizeof_int" = "$ac_cv_sizeof_char_p"; then  AC_CHECK_TYPE(ptrdiff_t, int)elif test "$ac_cv_sizeof_long" = "$ac_cv_sizeof_char_p"; then  AC_CHECK_TYPE(ptrdiff_t, long)elif test "$ac_cv_type_long_long" = yes && test "$ac_cv_sizeof_long_long" = "$ac_cv_sizeof_char_p"; then  AC_CHECK_TYPE(ptrdiff_t, [long long])else  AC_CHECK_TYPE(ptrdiff_t, int)fi])dnldnl A signed 64-bit quantitydnlAC_DEFUN(BASH_TYPE_BITS64_T,[if test "$ac_cv_sizeof_char_p" = 8; then  AC_CHECK_TYPE(bits64_t, char *)elif test "$ac_cv_sizeof_double" = 8; then  AC_CHECK_TYPE(bits64_t, double)elif test -n "$ac_cv_type_long_long" && test "$ac_cv_sizeof_long_long" = 8; then  AC_CHECK_TYPE(bits64_t, [long long])elif test "$ac_cv_sizeof_long" = 8; then  AC_CHECK_TYPE(bits64_t, long)

⌨️ 快捷键说明

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