📄 aclocal.m4
字号:
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: 11 updated: 2003/11/06 19:59:57dnl ------------------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_REQUIRE([CF_CURSES_CPPFLAGS])dnlAC_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_POSIX_C_SOURCE version: 3 updated: 2005/02/04 06:56:22dnl -----------------dnl Define _POSIX_C_SOURCE to the given level, and _POSIX_SOURCE if needed.dnldnl POSIX.1-1990 _POSIX_SOURCEdnl POSIX.1-1990 and _POSIX_SOURCE anddnl POSIX.2-1992 C-Language _POSIX_C_SOURCE=2dnl Bindings Optiondnl POSIX.1b-1993 _POSIX_C_SOURCE=199309Ldnl POSIX.1c-1996 _POSIX_C_SOURCE=199506Ldnl X/Open 2000 _POSIX_C_SOURCE=200112Ldnldnl Parameters:dnl $1 is the nominal value for _POSIX_C_SOURCEAC_DEFUN([CF_POSIX_C_SOURCE],[cf_POSIX_C_SOURCE=ifelse($1,,199506L,$1)AC_CACHE_CHECK(if we should define _POSIX_C_SOURCE,cf_cv_posix_c_source,[ CF_MSG_LOG(if the symbol is already defined go no further) AC_TRY_COMPILE([#include <sys/types.h>],[#ifndef _POSIX_C_SOURCEmake an error#endif], [cf_cv_posix_c_source=no], [cf_want_posix_source=no case .$cf_POSIX_C_SOURCE in .[[12]]??*) cf_cv_posix_c_source="-U_POSIX_C_SOURCE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE" ;; .2) cf_cv_posix_c_source="-U_POSIX_C_SOURCE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE" cf_want_posix_source=yes ;; .*) cf_want_posix_source=yes ;; esac if test "$cf_want_posix_source" = yes ; then AC_TRY_COMPILE([#include <sys/types.h>],[#ifdef _POSIX_SOURCEmake an error#endif],[], cf_cv_posix_c_source="$cf_cv_posix_c_source -U_POSIX_SOURCE -D_POSIX_SOURCE") fi CF_MSG_LOG(ifdef from value $cf_POSIX_C_SOURCE) cf_save="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $cf_cv_posix_c_source" CF_MSG_LOG(if the second compile does not leave our definition intact error) AC_TRY_COMPILE([#include <sys/types.h>],[#ifndef _POSIX_C_SOURCEmake an error#endif],, [cf_cv_posix_c_source=no]) CPPFLAGS="$cf_save" ])])test "$cf_cv_posix_c_source" != no && CPPFLAGS="$CPPFLAGS $cf_cv_posix_c_source"])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_VERBOSE version: 2 updated: 1997/09/05 10:45:14dnl ----------dnl Use AC_VERBOSE w/o the warningsAC_DEFUN([CF_VERBOSE],[test -n "$verbose" && echo " $1" 1>&AC_FD_MSG])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])])dnldnl ---------------------------------------------------------------------------dnl CF_XOPEN_SOURCE version: 17 updated: 2005/02/06 12:07:45dnl ---------------dnl Try to get _XOPEN_SOURCE defined properly that we can use POSIX functions,dnl or adapt to the vendor's definitions to get equivalent functionality.dnldnl Parameters:dnl $1 is the nominal value for _XOPEN_SOURCEdnl $2 is the nominal value for _POSIX_C_SOURCEAC_DEFUN([CF_XOPEN_SOURCE],[cf_XOPEN_SOURCE=ifelse($1,,500,$1)cf_POSIX_C_SOURCE=ifelse($2,,199506L,$2)case $host_os in #(viaix[[45]]*) #(vi CPPFLAGS="$CPPFLAGS -D_ALL_SOURCE" ;;freebsd*) #(vi # 5.x headers associate # _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L # _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L cf_POSIX_C_SOURCE=200112L cf_XOPEN_SOURCE=600 CPPFLAGS="$CPPFLAGS -D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE" ;;hpux*) #(vi CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE" ;;irix[[56]].*) #(vi CPPFLAGS="$CPPFLAGS -D_SGI_SOURCE" ;;linux*|gnu*) #(vi CF_GNU_SOURCE ;;mirbsd*) #(vi # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <arpa/inet.h> ;;netbsd*) #(vi # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw ;;openbsd*) #(vi # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw ;;osf[[45]]*) #(vi CPPFLAGS="$CPPFLAGS -D_OSF_SOURCE" ;;sco*) #(vi # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer ;;solaris*) #(vi CPPFLAGS="$CPPFLAGS -D__EXTENSIONS__" ;;*) AC_CACHE_CHECK(if we should define _XOPEN_SOURCE,cf_cv_xopen_source,[ AC_TRY_COMPILE([#include <sys/types.h>],[#ifndef _XOPEN_SOURCEmake an error#endif], [cf_cv_xopen_source=no], [cf_save="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE" AC_TRY_COMPILE([#include <sys/types.h>],[#ifdef _XOPEN_SOURCEmake an error#endif], [cf_cv_xopen_source=no], [cf_cv_xopen_source=$cf_XOPEN_SOURCE]) CPPFLAGS="$cf_save" ])])test "$cf_cv_xopen_source" != no && CPPFLAGS="$CPPFLAGS -U_XOPEN_SOURCE -D_XOPEN_SOURCE=$cf_cv_xopen_source" CF_POSIX_C_SOURCE($cf_POSIX_C_SOURCE) ;;esac])
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -