📄 aclocal.m4
字号:
#include <stdio.h> #include <math.h> ], [double x = rand(); printf("result = %g\n", ]ifelse($2,,sin(x),$2)[)], [cf_cv_need_libm=no], [cf_cv_need_libm=yes])])if test "$cf_cv_need_libm" = yesthenifelse($1,,[ LIBS="$LIBS -lm"],[$1=-lm])fi])dnl ---------------------------------------------------------------------------dnl CF_MIXEDCASE_FILENAMES version: 3 updated: 2003/09/20 17:07:55dnl ----------------------dnl Check if the file-system supports mixed-case filenames. If we're able todnl create a lowercase name and see it as uppercase, it doesn't support that.AC_DEFUN([CF_MIXEDCASE_FILENAMES],[AC_CACHE_CHECK(if filesystem supports mixed-case filenames,cf_cv_mixedcase,[if test "$cross_compiling" = yes ; then case $target_alias in #(vi *-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-mingw32*|*-uwin*) #(vi cf_cv_mixedcase=no ;; *) cf_cv_mixedcase=yes ;; esacelse rm -f conftest CONFTEST echo test >conftest if test -f CONFTEST ; then cf_cv_mixedcase=no else cf_cv_mixedcase=yes fi rm -f conftest CONFTESTfi])test "$cf_cv_mixedcase" = yes && AC_DEFINE(MIXEDCASE_FILENAMES)])dnldnl ---------------------------------------------------------------------------dnl CF_MSG_LOG version: 3 updated: 1997/09/07 14:05:52dnl ----------dnl Write a debug message to config.log, along with the line number in thednl configure script.AC_DEFUN([CF_MSG_LOG],[echo "(line __oline__) testing $* ..." 1>&AC_FD_CC])dnldnl ---------------------------------------------------------------------------dnl CF_NCURSES_CC_CHECK version: 3 updated: 2003/01/12 18:59:28dnl -------------------dnl Check if we can compile with ncurses' header filednl $1 is the cache variable to setdnl $2 is the header-file to includednl $3 is the root name (ncurses or ncursesw)AC_DEFUN([CF_NCURSES_CC_CHECK],[ AC_TRY_COMPILE([]ifelse($3,ncursesw,[#define _XOPEN_SOURCE_EXTENDED#undef HAVE_LIBUTF8_H /* in case we used CF_UTF8_LIB */#define HAVE_LIBUTF8_H /* to force ncurses' header file to use cchar_t */])[#include <$2>],[#ifdef NCURSES_VERSION]ifelse($3,ncursesw,[#ifndef WACS_BSSB make an error#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: 17 updated: 2003/11/06 19:59:57dnl -------------------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])AC_PROVIDE([CF_CURSES_CPPFLAGS])dnlcf_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: 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_OUR_MESSAGES version: 5 updated: 2003/06/16 20:33:11dnl ---------------dnl Check if we use the messages included with this programdnldnl $1 specifies either Makefile or makefile, defaulting to the former.dnldnl Sets variables which can be used to substitute in makefiles:dnl MSG_DIR_MAKE - to make ./po directorydnl SUB_MAKEFILE - makefile in ./po directory (see CF_BUNDLED_INTL)dnlAC_DEFUN([CF_OUR_MESSAGES],[cf_makefile=ifelse($1,,Makefile,$1)use_our_messages=noif test "$USE_NLS" = yes ; thenif test -d $srcdir/po ; thenAC_MSG_CHECKING(if we should use included message-library) AC_ARG_ENABLE(included-msgs, [ --enable-included-msgs use included messages, for i18n support], [use_our_messages=$enableval], [use_our_messages=yes])fiAC_MSG_RESULT($use_our_messages)fiMSG_DIR_MAKE="#"if test "$use_our_messages" = yesthen SUB_MAKEFILE="$SUB_MAKEFILE $srcdir/po/$cf_makefile.in:$srcdir/po/$cf_makefile.inn" MSG_DIR_MAKE=fiAC_SUBST(MSG_DIR_MAKE)AC_SUBST(SUB_MAKEFILE)])dnldnl ---------------------------------------------------------------------------dnl CF_PATHSEP version: 3 updated: 2001/01/12 01:23:53dnl ----------dnl Provide a value for the $PATH and similar separatorAC_DEFUN([CF_PATHSEP],[ case $cf_cv_system_name in os2*) PATHSEP=';' ;; *) PATHSEP=':' ;; esacifelse($1,,,[$1=$PATHSEP]) AC_SUBST(PATHSEP)])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_PROG_EXT version: 9 updated: 2003/10/18 16:36:22dnl -----------dnl Compute $PROG_EXT, used for non-Unix ports, such as OS/2 EMX.AC_DEFUN([CF_PROG_EX
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -