📄 aclocal.m4
字号:
#endif])[printf("%s\n", NCURSES_VERSION);#else#ifdef __NCURSES_Hprintf("old\n");#else make an error#endif#endif ] ,[$1=$cf_header] ,[$1=no])])dnldnl ---------------------------------------------------------------------------dnl CF_NCURSES_CPPFLAGS version: 16 updated: 2002/12/29 18:30:46dnl -------------------dnl Look for the SVr4 curses clone 'ncurses' in the standard places, adjustingdnl the CPPFLAGS variable so we can include its header.dnldnl The header files may be installed as either curses.h, or ncurses.h (woulddnl be obsolete, except that some packagers prefer this name to distinguish itdnl from a "native" curses implementation). If not installed for overwrite,dnl the curses.h file would be in an ncurses subdirectory (e.g.,dnl /usr/include/ncurses), but someone may have installed overwriting thednl vendor's curses. Only very old versions (pre-1.9.2d, the first autoconf'ddnl version) of ncurses don't define either __NCURSES_H or NCURSES_VERSION indnl the header.dnldnl If the installer has set $CFLAGS or $CPPFLAGS so that the ncurses headerdnl is already in the include-path, don't even bother with this, since we cannotdnl easily determine which file it is. In this case, it has to be <curses.h>.dnldnl The optional parameter gives the root name of the library, in case it isdnl not installed as the default curses library. That is how thednl wide-character version of ncurses is installed.AC_DEFUN([CF_NCURSES_CPPFLAGS],[AC_REQUIRE([CF_WITH_CURSES_DIR])cf_ncuhdr_root=ifelse($1,,ncurses,$1)test -n "$cf_cv_curses_dir" && \test "$cf_cv_curses_dir" != "no" && \CPPFLAGS="-I$cf_cv_curses_dir/include -I$cf_cv_curses_dir/include/$cf_ncuhdr_root $CPPFLAGS"AC_CACHE_CHECK(for $cf_ncuhdr_root header in include-path, cf_cv_ncurses_h,[ cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h" ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h" for cf_header in $cf_header_list do CF_NCURSES_CC_CHECK(cf_cv_ncurses_h,$cf_header,$1) test "$cf_cv_ncurses_h" != no && break done])if test "$cf_cv_ncurses_h" != no ; then cf_cv_ncurses_header=$cf_cv_ncurses_helseAC_CACHE_CHECK(for $cf_ncuhdr_root include-path, cf_cv_ncurses_h2,[ test -n "$verbose" && echo CF_HEADER_PATH(cf_search,$cf_ncuhdr_root) test -n "$verbose" && echo search path $cf_search cf_save2_CPPFLAGS="$CPPFLAGS" for cf_incdir in $cf_search do CF_ADD_INCDIR($cf_incdir) for cf_header in \ ncurses.h \ curses.h do CF_NCURSES_CC_CHECK(cf_cv_ncurses_h2,$cf_header,$1) if test "$cf_cv_ncurses_h2" != no ; then cf_cv_ncurses_h2=$cf_incdir/$cf_header test -n "$verbose" && echo $ac_n " ... found $ac_c" 1>&AC_FD_MSG break fi test -n "$verbose" && echo " ... tested $cf_incdir/$cf_header" 1>&AC_FD_MSG done CPPFLAGS="$cf_save2_CPPFLAGS" test "$cf_cv_ncurses_h2" != no && break done test "$cf_cv_ncurses_h2" = no && AC_ERROR(not found) ]) CF_DIRNAME(cf_1st_incdir,$cf_cv_ncurses_h2) cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2` if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header fi CF_ADD_INCDIR($cf_1st_incdir)fiAC_DEFINE(NCURSES)case $cf_cv_ncurses_header in # (vi*ncurses.h) AC_DEFINE(HAVE_NCURSES_H) ;;esaccase $cf_cv_ncurses_header in # (vincurses/curses.h|ncurses/ncurses.h) AC_DEFINE(HAVE_NCURSES_NCURSES_H) ;;ncursesw/curses.h|ncursesw/ncurses.h) AC_DEFINE(HAVE_NCURSESW_NCURSES_H) ;;esacCF_NCURSES_VERSION])dnldnl ---------------------------------------------------------------------------dnl CF_NCURSES_LIBS version: 11 updated: 2002/12/22 14:22:25dnl ---------------dnl Look for the ncurses library. This is a little complicated on Linux,dnl because it may be linked with the gpm (general purpose mouse) library.dnl Some distributions have gpm linked with (bsd) curses, which makes itdnl unusable with ncurses. However, we don't want to link with gpm unlessdnl ncurses has a dependency, since gpm is normally set up as a shared library,dnl and the linker will record a dependency.dnldnl The optional parameter gives the root name of the library, in case it isdnl not installed as the default curses library. That is how thednl wide-character version of ncurses is installed.AC_DEFUN([CF_NCURSES_LIBS],[AC_REQUIRE([CF_NCURSES_CPPFLAGS])cf_nculib_root=ifelse($1,,ncurses,$1) # This works, except for the special case where we find gpm, but # ncurses is in a nonstandard location via $LIBS, and we really want # to link gpm.cf_ncurses_LIBS=""cf_ncurses_SAVE="$LIBS"AC_CHECK_LIB(gpm,Gpm_Open, [AC_CHECK_LIB(gpm,initscr, [LIBS="$cf_ncurses_SAVE"], [cf_ncurses_LIBS="-lgpm"])])case $host_os in #(vifreebsd*) # This is only necessary if you are linking against an obsolete # version of ncurses (but it should do no harm, since it's static). AC_CHECK_LIB(mytinfo,tgoto,[cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"]) ;;esacLIBS="$cf_ncurses_LIBS $LIBS"if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )then LIBS="-L$cf_cv_curses_dir/lib -l$cf_nculib_root $LIBS"else CF_FIND_LIBRARY($cf_nculib_root,$cf_nculib_root, [#include <${cf_cv_ncurses_header-curses.h}>], [initscr()], initscr)fiif test -n "$cf_ncurses_LIBS" ; then AC_MSG_CHECKING(if we can link $cf_nculib_root without $cf_ncurses_LIBS) cf_ncurses_SAVE="$LIBS" for p in $cf_ncurses_LIBS ; do q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"` if test "$q" != "$LIBS" ; then LIBS="$q" fi done AC_TRY_LINK([#include <${cf_cv_ncurses_header-curses.h}>], [initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);], [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no) LIBS="$cf_ncurses_SAVE"])fiCF_UPPER(cf_nculib_ROOT,HAVE_LIB$cf_nculib_root)AC_DEFINE_UNQUOTED($cf_nculib_ROOT)])dnldnl ---------------------------------------------------------------------------dnl CF_NCURSES_VERSION version: 10 updated: 2002/10/27 18:21:42dnl ------------------dnl Check for the version of ncurses, to aid in reporting bugs, etc.dnl Call CF_CURSES_CPPFLAGS first, or CF_NCURSES_CPPFLAGS. We don't usednl AC_REQUIRE since that does not work with the shell's if/then/else/fi.AC_DEFUN([CF_NCURSES_VERSION],[AC_CACHE_CHECK(for ncurses version, cf_cv_ncurses_version,[ cf_cv_ncurses_version=no cf_tempfile=out$$ rm -f $cf_tempfile AC_TRY_RUN([#include <${cf_cv_ncurses_header-curses.h}>#include <stdio.h>int main(){ FILE *fp = fopen("$cf_tempfile", "w");#ifdef NCURSES_VERSION# ifdef NCURSES_VERSION_PATCH fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);# else fprintf(fp, "%s\n", NCURSES_VERSION);# endif#else# ifdef __NCURSES_H fprintf(fp, "old\n");# else make an error# endif#endif exit(0);}],[ cf_cv_ncurses_version=`cat $cf_tempfile`],,[ # This will not work if the preprocessor splits the line after the # Autoconf token. The 'unproto' program does that. cat > conftest.$ac_ext <<EOF#include <${cf_cv_ncurses_header-curses.h}>#undef Autoconf#ifdef NCURSES_VERSIONAutoconf NCURSES_VERSION#else#ifdef __NCURSES_HAutoconf "old"#endif;#endifEOF cf_try="$ac_cpp conftest.$ac_ext 2>&AC_FD_CC | grep '^Autoconf ' >conftest.out" AC_TRY_EVAL(cf_try) if test -f conftest.out ; then cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[[^"]]*"%%' -e 's%".*%%'` test -n "$cf_out" && cf_cv_ncurses_version="$cf_out" rm -f conftest.out fi]) rm -f $cf_tempfile])test "$cf_cv_ncurses_version" = no || AC_DEFINE(NCURSES)])dnldnl ---------------------------------------------------------------------------dnl CF_PATH_SYNTAX version: 9 updated: 2002/09/17 23:03:38dnl --------------dnl Check the argument to see that it looks like a pathname. Rewrite it if itdnl begins with one of the prefix/exec_prefix variables, and then again if thednl result begins with 'NONE'. This is necessary to work around autoconf'sdnl delayed evaluation of those symbols.AC_DEFUN([CF_PATH_SYNTAX],[case ".[$]$1" in #(vi.\[$]\(*\)*|.\'*\'*) #(vi ;;..|./*|.\\*) #(vi ;;.[[a-zA-Z]]:[[\\/]]*) #(vi OS/2 EMX ;;.\[$]{*prefix}*) #(vi eval $1="[$]$1" case ".[$]$1" in #(vi .NONE/*) $1=`echo [$]$1 | sed -e s%NONE%$ac_default_prefix%` ;; esac ;; #(vi.NONE/*) $1=`echo [$]$1 | sed -e s%NONE%$ac_default_prefix%` ;;*) ifelse($2,,[AC_ERROR([expected a pathname, not \"[$]$1\"])],$2) ;;esac])dnldnl ---------------------------------------------------------------------------dnl CF_PREDEFINE version: 1 updated: 2003/07/26 17:53:56dnl ------------dnl Add definitions to CPPFLAGS to ensure they're predefined for all compiles.dnldnl $1 = symbol to testdnl $2 = value (if any) to use for a predefinitionAC_DEFUN([CF_PREDEFINE],[AC_MSG_CHECKING(if we must define $1)AC_TRY_COMPILE([#include <sys/types.h>],[#ifndef $1make an error#endif],[cf_result=no],[cf_result=yes])AC_MSG_RESULT($cf_result)if test "$cf_result" = yes ; then CPPFLAGS="$CPPFLAGS ifelse($2,,-D$1,[-D$1=$2])"elif test "x$2" != "x" ; then AC_MSG_CHECKING(checking for compatible value versus $2) AC_TRY_COMPILE([#include <sys/types.h>],[#if $1-$2 < 0make an error#endif],[cf_result=yes],[cf_result=no]) AC_MSG_RESULT($cf_result) if test "$cf_result" = no ; then # perhaps we can override it - try... CPPFLAGS="$CPPFLAGS -D$1=$2" fifi])dnldnl ---------------------------------------------------------------------------dnl CF_SUBDIR_PATH version: 3 updated: 2002/12/29 18:30:46dnl --------------dnl Construct a search-list for a nonstandard header/lib-filednl $1 = the variable to return as resultdnl $2 = the package namednl $3 = the subdirectory, e.g., bin, include or libAC_DEFUN([CF_SUBDIR_PATH],[$1=""test -d [$]HOME && { test -n "$verbose" && echo " ... testing $3-directories under [$]HOME" test -d [$]HOME/$3 && $1="[$]$1 [$]HOME/$3" test -d [$]HOME/$3/$2 && $1="[$]$1 [$]HOME/$3/$2" test -d [$]HOME/$3/$2/$3 && $1="[$]$1 [$]HOME/$3/$2/$3"}# For other stuff under the home directory, it should be sufficient to put# a symbolic link for $HOME/$2 to the actual package location:test -d [$]HOME/$2 && { test -n "$verbose" && echo " ... testing $3-directories under [$]HOME/$2" test -d [$]HOME/$2/$3 && $1="[$]$1 [$]HOME/$2/$3" test -d [$]HOME/$2/$3/$2 && $1="[$]$1 [$]HOME/$2/$3/$2"}test "$prefix" != /usr/local && \test -d /usr/local && { test -n "$verbose" && echo " ... testing $3-directories under /usr/local" test -d /usr/local/$3 && $1="[$]$1 /usr/local/$3" test -d /usr/local/$3/$2 && $1="[$]$1 /usr/local/$3/$2" test -d /usr/local/$3/$2/$3 && $1="[$]$1 /usr/local/$3/$2/$3" test -d /usr/local/$2/$3 && $1="[$]$1 /usr/local/$2/$3" test -d /usr/local/$2/$3/$2 && $1="[$]$1 /usr/local/$2/$3/$2"}test "$prefix" != NONE && \test -d $prefix && { test -n "$verbose" && echo " ... testing $3-directories under $prefix" test -d $prefix/$3 && $1="[$]$1 $prefix/$3" test -d $prefix/$3/$2 && $1="[$]$1 $prefix/$3/$2" test -d $prefix/$3/$2/$3 && $1="[$]$1 $prefix/$3/$2/$3" test -d $prefix/$2/$3 && $1="[$]$1 $prefix/$2/$3" test -d $prefix/$2/$3/$2 && $1="[$]$1 $prefix/$2/$3/$2"}test "$prefix" != /opt && \test -d /opt && { test -n "$verbose" && echo " ... testing $3-directories under /opt" test -d /opt/$3 && $1="[$]$1 /opt/$3" test -d /opt/$3/$2 && $1="[$]$1 /opt/$3/$2" test -d /opt/$3/$2/$3 && $1="[$]$1 /opt/$3/$2/$3" test -d /opt/$2/$3 && $1="[$]$1 /opt/$2/$3" test -d /opt/$2/$3/$2 && $1="[$]$1 /opt/$2/$3/$2"}test "$prefix" != /usr && \test -d /usr && { test -n "$verbose" && echo " ... testing $3-directories under /usr" test -d /usr/$3 && $1="[$]$1 /usr/$3" test -d /usr/$3/$2 && $1="[$]$1 /usr/$3/$2" test -d /usr/$3/$2/$3 && $1="[$]$1 /usr/$3/$2/$3" test -d /usr/$2/$3 && $1="[$]$1 /usr/$2/$3"}])dnldnl ---------------------------------------------------------------------------dnl CF_SYS_TIME_SELECT version: 4 updated: 2000/10/04 09:18:40dnl ------------------dnl Check if we can include <sys/time.h> with <sys/select.h>; this breaks ondnl older SCO configurations.AC_DEFUN([CF_SYS_TIME_SELECT],[AC_MSG_CHECKING(if sys/time.h works with sys/select.h)AC_CACHE_VAL(cf_cv_sys_time_select,[AC_TRY_COMPILE([#include <sys/types.h>#ifdef HAVE_SYS_TIME_H#include <sys/time.h>#endif#ifdef HAVE_SYS_SELECT_H#include <sys/select.h>#endif],[],[cf_cv_sys_time_select=yes], [cf_cv_sys_time_select=no]) ])AC_MSG_RESULT($cf_cv_sys_time_select)test "$cf_cv_sys_time_select" = yes && AC_DEFINE(HAVE_SYS_TIME_SELECT)])dnldnl ---------------------------------------------------------------------------dnl CF_UPPER version: 5 updated: 2001/01/29 23:40:59dnl --------dnl Make an uppercase version of a variablednl $1=uppercase($2)AC_DEFUN([CF_UPPER],[$1=`echo "$2" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`])dnldnl ---------------------------------------------------------------------------dnl CF_UTF8_LIB version: 4 updated: 2003/03/01 18:36:42dnl -----------dnl Check for multibyte support, and if not found, utf8 compatibility libraryAC_DEFUN([CF_UTF8_LIB],[AC_CACHE_CHECK(for multibyte character support,cf_cv_utf8_lib,[ cf_save_LIBS="$LIBS" AC_TRY_LINK([#include <stdlib.h>],[putwc(0,0);], [cf_cv_utf8_lib=yes], [LIBS="-lutf8 $LIBS" AC_TRY_LINK([#include <libutf8.h>],[putwc(0,0);], [cf_cv_utf8_lib=add-on], [cf_cv_utf8_lib=no]) LIBS="$cf_save_LIBS"])])# HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between# ncurses/ncursesw:if test "$cf_cv_utf8_lib" = "add-on" ; then AC_DEFINE(HAVE_LIBUTF8_H) LIBS="-lutf8 $LIBS"fi])dnldnl ---------------------------------------------------------------------------dnl CF_WITH_CURSES_DIR version: 2 updated: 2002/11/10 14:46:59dnl ------------------dnl Wrapper for AC_ARG_WITH to specify directory under which to look for cursesdnl libraries.AC_DEFUN([CF_WITH_CURSES_DIR],[AC_ARG_WITH(curses-dir, [ --with-curses-dir=DIR directory in which (n)curses is installed], [CF_PATH_SYNTAX(withval) cf_cv_curses_dir=$withval], [cf_cv_curses_dir=no])])dnl
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -