📄 aclocal.m4
字号:
bash_cv_job_control_missing=missing])])AC_MSG_RESULT($bash_cv_job_control_missing)if test $bash_cv_job_control_missing = missing; thenAC_DEFINE(JOB_CONTROL_MISSING)fi])dnl check whether named pipes are presentdnl this requires a previous check for mkfifo, but that is awkward to specifyAC_DEFUN(BASH_SYS_NAMED_PIPES,[AC_MSG_CHECKING(for presence of named pipes)AC_CACHE_VAL(bash_cv_sys_named_pipes,[AC_TRY_RUN([#include <sys/types.h>#include <sys/stat.h>#ifdef HAVE_UNISTD_H#include <unistd.h>#endif/* Add more tests in here as appropriate. */main(){int fd, err;#if defined (HAVE_MKFIFO)exit (0);#endif#if !defined (S_IFIFO) && (defined (_POSIX_VERSION) && !defined (S_ISFIFO))exit (1);#endif#if defined (NeXT)exit (1);#endiferr = mkdir("/tmp/bash-aclocal", 0700);if (err < 0) { perror ("mkdir"); exit(1);}fd = mknod ("/tmp/bash-aclocal/sh-np-autoconf", 0666 | S_IFIFO, 0);if (fd == -1) { rmdir ("/tmp/bash-aclocal"); exit (1);}close(fd);unlink ("/tmp/bash-aclocal/sh-np-autoconf");rmdir ("/tmp/bash-aclocal");exit(0);}], bash_cv_sys_named_pipes=present, bash_cv_sys_named_pipes=missing, [AC_MSG_WARN(cannot check for named pipes if cross-compiling -- defaulting to missing) bash_cv_sys_named_pipes=missing])])AC_MSG_RESULT($bash_cv_sys_named_pipes)if test $bash_cv_sys_named_pipes = missing; thenAC_DEFINE(NAMED_PIPES_MISSING)fi])AC_DEFUN(BASH_SYS_DEFAULT_MAIL_DIR,[AC_MSG_CHECKING(for default mail directory)AC_CACHE_VAL(bash_cv_mail_dir,[if test -d /var/mail; then bash_cv_mail_dir=/var/mail elif test -d /var/spool/mail; then bash_cv_mail_dir=/var/spool/mail elif test -d /usr/mail; then bash_cv_mail_dir=/usr/mail elif test -d /usr/spool/mail; then bash_cv_mail_dir=/usr/spool/mail else bash_cv_mail_dir=unknown fi])AC_MSG_RESULT($bash_cv_mail_dir)AC_DEFINE_UNQUOTED(DEFAULT_MAIL_DIRECTORY, "$bash_cv_mail_dir")])AC_DEFUN(BASH_HAVE_TIOCGWINSZ,[AC_MSG_CHECKING(for TIOCGWINSZ in sys/ioctl.h)AC_CACHE_VAL(bash_cv_tiocgwinsz_in_ioctl,[AC_TRY_COMPILE([#include <sys/types.h>#include <sys/ioctl.h>], [int x = TIOCGWINSZ;], bash_cv_tiocgwinsz_in_ioctl=yes,bash_cv_tiocgwinsz_in_ioctl=no)])AC_MSG_RESULT($bash_cv_tiocgwinsz_in_ioctl)if test $bash_cv_tiocgwinsz_in_ioctl = yes; then AC_DEFINE(GWINSZ_IN_SYS_IOCTL)fi])AC_DEFUN(BASH_HAVE_TIOCSTAT,[AC_MSG_CHECKING(for TIOCSTAT in sys/ioctl.h)AC_CACHE_VAL(bash_cv_tiocstat_in_ioctl,[AC_TRY_COMPILE([#include <sys/types.h>#include <sys/ioctl.h>], [int x = TIOCSTAT;], bash_cv_tiocstat_in_ioctl=yes,bash_cv_tiocstat_in_ioctl=no)])AC_MSG_RESULT($bash_cv_tiocstat_in_ioctl)if test $bash_cv_tiocstat_in_ioctl = yes; then AC_DEFINE(TIOCSTAT_IN_SYS_IOCTL)fi])AC_DEFUN(BASH_HAVE_FIONREAD,[AC_MSG_CHECKING(for FIONREAD in sys/ioctl.h)AC_CACHE_VAL(bash_cv_fionread_in_ioctl,[AC_TRY_COMPILE([#include <sys/types.h>#include <sys/ioctl.h>], [int x = FIONREAD;], bash_cv_fionread_in_ioctl=yes,bash_cv_fionread_in_ioctl=no)])AC_MSG_RESULT($bash_cv_fionread_in_ioctl)if test $bash_cv_fionread_in_ioctl = yes; then AC_DEFINE(FIONREAD_IN_SYS_IOCTL)fi])dnldnl See if speed_t is declared in <sys/types.h>. Some versions of linuxdnl require a definition of speed_t each time <termcap.h> is included,dnl but you can only get speed_t if you include <termios.h> (on somednl versions) or <sys/types.h> (on others).dnlAC_DEFUN(BASH_CHECK_SPEED_T,[AC_MSG_CHECKING(for speed_t in sys/types.h)AC_CACHE_VAL(bash_cv_speed_t_in_sys_types,[AC_TRY_COMPILE([#include <sys/types.h>], [speed_t x;], bash_cv_speed_t_in_sys_types=yes,bash_cv_speed_t_in_sys_types=no)])AC_MSG_RESULT($bash_cv_speed_t_in_sys_types)if test $bash_cv_speed_t_in_sys_types = yes; then AC_DEFINE(SPEED_T_IN_SYS_TYPES)fi])AC_DEFUN(BASH_CHECK_GETPW_FUNCS,[AC_MSG_CHECKING(whether getpw functions are declared in pwd.h)AC_CACHE_VAL(bash_cv_getpw_declared,[AC_EGREP_CPP(getpwuid,[#include <sys/types.h>#ifdef HAVE_UNISTD_H# include <unistd.h>#endif#include <pwd.h>],bash_cv_getpw_declared=yes,bash_cv_getpw_declared=no)])AC_MSG_RESULT($bash_cv_getpw_declared)if test $bash_cv_getpw_declared = yes; thenAC_DEFINE(HAVE_GETPW_DECLS)fi])AC_DEFUN(BASH_CHECK_DEV_FD,[AC_MSG_CHECKING(whether /dev/fd is available)AC_CACHE_VAL(bash_cv_dev_fd,[if test -d /dev/fd && test -r /dev/fd/0 < /dev/null; then bash_cv_dev_fd=standard elif test -d /proc/self/fd && test -r /proc/self/fd/0 < /dev/null; then bash_cv_dev_fd=whacky else bash_cv_dev_fd=absent fi])AC_MSG_RESULT($bash_cv_dev_fd)if test $bash_cv_dev_fd = "standard"; then AC_DEFINE(HAVE_DEV_FD) AC_DEFINE(DEV_FD_PREFIX, "/dev/fd/")elif test $bash_cv_dev_fd = "whacky"; then AC_DEFINE(HAVE_DEV_FD) AC_DEFINE(DEV_FD_PREFIX, "/proc/self/fd/")fi])AC_DEFUN(BASH_CHECK_DEV_STDIN,[AC_MSG_CHECKING(whether /dev/stdin stdout stderr are available)AC_CACHE_VAL(bash_cv_dev_stdin,[if test -d /dev/fd && test -r /dev/stdin < /dev/null; then bash_cv_dev_stdin=present elif test -d /proc/self/fd && test -r /dev/stdin < /dev/null; then bash_cv_dev_stdin=present else bash_cv_dev_stdin=absent fi])AC_MSG_RESULT($bash_cv_dev_stdin)if test $bash_cv_dev_stdin = "present"; then AC_DEFINE(HAVE_DEV_STDIN)fi])dnldnl Check if HPUX needs _KERNEL defined for RLIMIT_* definitionsdnlAC_DEFUN(BASH_CHECK_KERNEL_RLIMIT,[AC_MSG_CHECKING([whether $host_os needs _KERNEL for RLIMIT defines])AC_CACHE_VAL(bash_cv_kernel_rlimit,[AC_TRY_COMPILE([#include <sys/types.h>#include <sys/resource.h>],[ int f; f = RLIMIT_DATA;], bash_cv_kernel_rlimit=no,[AC_TRY_COMPILE([#include <sys/types.h>#define _KERNEL#include <sys/resource.h>#undef _KERNEL],[ int f; f = RLIMIT_DATA;], bash_cv_kernel_rlimit=yes, bash_cv_kernel_rlimit=no)])])AC_MSG_RESULT($bash_cv_kernel_rlimit)if test $bash_cv_kernel_rlimit = yes; thenAC_DEFINE(RLIMIT_NEEDS_KERNEL)fi])dnldnl Check for 64-bit off_t -- used for malloc alignmentdnldnl C does not allow duplicate case labels, so the compile will fail ifdnl sizeof(off_t) is > 4.dnlAC_DEFUN(BASH_CHECK_OFF_T_64,[AC_CACHE_CHECK(for 64-bit off_t, bash_cv_off_t_64,AC_TRY_COMPILE([#ifdef HAVE_UNISTD_H#include <unistd.h>#endif#include <sys/types.h>],[switch (0) case 0: case (sizeof (off_t) <= 4):;], bash_cv_off_t_64=no, bash_cv_off_t_64=yes))if test $bash_cv_off_t_64 = yes; then AC_DEFINE(HAVE_OFF_T_64)fi])AC_DEFUN(BASH_CHECK_RTSIGS,[AC_MSG_CHECKING(for unusable real-time signals due to large values)AC_CACHE_VAL(bash_cv_unusable_rtsigs,[AC_TRY_RUN([#include <sys/types.h>#include <signal.h>#ifndef NSIG# define NSIG 64#endifmain (){ int n_sigs = 2 * NSIG;#ifdef SIGRTMIN int rtmin = SIGRTMIN;#else int rtmin = 0;#endif exit(rtmin < n_sigs);}], bash_cv_unusable_rtsigs=yes, bash_cv_unusable_rtsigs=no, [AC_MSG_WARN(cannot check real-time signals if cross compiling -- defaulting to yes) bash_cv_unusable_rtsigs=yes])])AC_MSG_RESULT($bash_cv_unusable_rtsigs)if test $bash_cv_unusable_rtsigs = yes; thenAC_DEFINE(UNUSABLE_RT_SIGNALS)fi])dnldnl check for availability of multibyte characters and functionsdnlAC_DEFUN(BASH_CHECK_MULTIBYTE,[AC_CHECK_HEADERS(wctype.h)AC_CHECK_HEADERS(wchar.h)AC_CHECK_HEADERS(langinfo.h)AC_CHECK_FUNC(mbsrtowcs, AC_DEFINE(HAVE_MBSRTOWCS))AC_CHECK_FUNC(mbrtowc, AC_DEFINE(HAVE_MBRTOWC))AC_CHECK_FUNC(mbrlen, AC_DEFINE(HAVE_MBRLEN))AC_CHECK_FUNC(wctomb, AC_DEFINE(HAVE_WCTOMB))AC_CHECK_FUNC(wcwidth, AC_DEFINE(HAVE_WCWIDTH))AC_CHECK_FUNC(wcsdup, AC_DEFINE(HAVE_WCSDUP))AC_CACHE_CHECK([for mbstate_t], bash_cv_have_mbstate_t,[AC_TRY_COMPILE([#include <wchar.h>], [ mbstate_t ps; mbstate_t *psp; psp = (mbstate_t *)0;], bash_cv_have_mbstate_t=yes, bash_cv_have_mbstate_t=no)])if test $bash_cv_have_mbstate_t = yes; then AC_DEFINE(HAVE_MBSTATE_T)fiAC_CACHE_CHECK([for nl_langinfo and CODESET], bash_cv_langinfo_codeset,[AC_TRY_LINK([#include <langinfo.h>],[char* cs = nl_langinfo(CODESET);],bash_cv_langinfo_codeset=yes, bash_cv_langinfo_codeset=no)])if test $bash_cv_langinfo_codeset = yes; then AC_DEFINE(HAVE_LANGINFO_CODESET)fi])dnl need: prefix exec_prefix libdir includedir CC TERMCAP_LIBdnl require:dnl AC_PROG_CCdnl BASH_CHECK_LIB_TERMCAPAC_DEFUN(RL_LIB_READLINE_VERSION,[AC_REQUIRE([BASH_CHECK_LIB_TERMCAP])AC_MSG_CHECKING([version of installed readline library])# What a pain in the ass this is.# save cpp and ld options_save_CFLAGS="$CFLAGS"_save_LDFLAGS="$LDFLAGS"_save_LIBS="$LIBS"# Don't set ac_cv_rl_prefix if the caller has already assigned a value. This# allows the caller to do something like $_rl_prefix=$withval if the user# specifies --with-installed-readline=PREFIX as an argument to configureif test -z "$ac_cv_rl_prefix"; thentest "x$prefix" = xNONE && ac_cv_rl_prefix=$ac_default_prefix || ac_cv_rl_prefix=${prefix}fieval ac_cv_rl_includedir=${ac_cv_rl_prefix}/includeeval ac_cv_rl_libdir=${ac_cv_rl_prefix}/libLIBS="$LIBS -lreadline ${TERMCAP_LIB}"CFLAGS="$CFLAGS -I${ac_cv_rl_includedir}"LDFLAGS="$LDFLAGS -L${ac_cv_rl_libdir}"AC_CACHE_VAL(ac_cv_rl_version,[AC_TRY_RUN([#include <stdio.h>#include <readline/readline.h>main(){ FILE *fp; fp = fopen("conftest.rlv", "w"); if (fp == 0) exit(1); fprintf(fp, "%s\n", rl_library_version ? rl_library_version : "0.0"); fclose(fp); exit(0);}],ac_cv_rl_version=`cat conftest.rlv`,ac_cv_rl_version='0.0',ac_cv_rl_version='4.2')])CFLAGS="$_save_CFLAGS"LDFLAGS="$_save_LDFLAGS"LIBS="$_save_LIBS"RL_MAJOR=0RL_MINOR=0# (case "$ac_cv_rl_version" in2*|3*|4*|5*|6*|7*|8*|9*) RL_MAJOR=`echo $ac_cv_rl_version | sed 's:\..*$::'` RL_MINOR=`echo $ac_cv_rl_version | sed -e 's:^.*\.::' -e 's:[[a-zA-Z]]*$::'` ;;esac# (((case $RL_MAJOR in[[0-9][0-9]]) _RL_MAJOR=$RL_MAJOR ;;[[0-9]]) _RL_MAJOR=0$RL_MAJOR ;;*) _RL_MAJOR=00 ;;esac# (((case $RL_MINOR in[[0-9][0-9]]) _RL_MINOR=$RL_MINOR ;;[[0-9]]) _RL_MINOR=0$RL_MINOR ;;*) _RL_MINOR=00 ;;esacRL_VERSION="0x${_RL_MAJOR}${_RL_MINOR}"# Readline versions greater than 4.2 have these defines in readline.hif test $ac_cv_rl_version = '0.0' ; then AC_MSG_WARN([Could not test version of installed readline library.])elif test $RL_MAJOR -gt 4 || { test $RL_MAJOR = 4 && test $RL_MINOR -gt 2 ; } ; then # set these for use by the caller RL_PREFIX=$ac_cv_rl_prefix RL_LIBDIR=$ac_cv_rl_libdir RL_INCLUDEDIR=$ac_cv_rl_includedir AC_MSG_RESULT($ac_cv_rl_version)elseAC_DEFINE_UNQUOTED(RL_READLINE_VERSION, $RL_VERSION, [encoded version of the installed readline library])AC_DEFINE_UNQUOTED(RL_VERSION_MAJOR, $RL_MAJOR, [major version of installed readline library])AC_DEFINE_UNQUOTED(RL_VERSION_MINOR, $RL_MINOR, [minor version of installed readline library])AC_SUBST(RL_VERSION)AC_SUBST(RL_MAJOR)AC_SUBST(RL_MINOR)# set these for use by the callerRL_PREFIX=$ac_cv_rl_prefixRL_LIBDIR=$ac_cv_rl_libdirRL_INCLUDEDIR=$ac_cv_rl_includedirAC_MSG_RESULT($ac_cv_rl_version)fi])AC_DEFUN(BASH_FUNC_CTYPE_NONASCII,[AC_MSG_CHECKING(whether the ctype macros accept non-ascii characters)AC_CACHE_VAL(bash_cv_func_ctype_nonascii,[AC_TRY_RUN([#ifdef HAVE_LOCALE_H#include <locale.h>#endif#include <stdio.h>#include <ctype.h>main(c, v)int c;char *v[];{ char *deflocale; unsigned char x; int r1, r2;#ifdef HAVE_SETLOCALE /* We take a shot here. If that locale is not known, try the system default. We try this one because '\342' (226) is known to be a printable character in that locale. */ deflocale = setlocale(LC_ALL, "en_US.ISO8859-1"); if (deflocale == 0) deflocale = setlocale(LC_ALL, "");#endif x = '\342'; r1 = isprint(x); x -= 128; r2 = isprint(x); exit (r1 == 0 || r2 == 0);}], bash_cv_func_ctype_nonascii=yes, bash_cv_func_ctype_nonascii=no, [AC_MSG_WARN(cannot check ctype macros if cross compiling -- defaulting to no) bash_cv_func_ctype_nonascii=no])])AC_MSG_RESULT($bash_cv_func_ctype_nonascii)if test $bash_cv_func_ctype_nonascii = yes; thenAC_DEFINE(CTYPE_NON_ASCII)fi
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -