📄 aclocal.m4
字号:
dnl***************************************************************************dnl Copyright (c) 1998-2004,2005 Free Software Foundation, Inc. *dnl *dnl Permission is hereby granted, free of charge, to any person obtaining a *dnl copy of this software and associated documentation files (the *dnl "Software"), to deal in the Software without restriction, including *dnl without limitation the rights to use, copy, modify, merge, publish, *dnl distribute, distribute with modifications, sublicense, and/or sell *dnl copies of the Software, and to permit persons to whom the Software is *dnl furnished to do so, subject to the following conditions: *dnl *dnl The above copyright notice and this permission notice shall be included *dnl in all copies or substantial portions of the Software. *dnl *dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *dnl IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *dnl DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *dnl OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *dnl THE USE OR OTHER DEALINGS IN THE SOFTWARE. *dnl *dnl Except as contained in this notice, the name(s) of the above copyright *dnl holders shall not be used in advertising or otherwise to promote the *dnl sale, use or other dealings in this Software without prior written *dnl authorization. *dnl***************************************************************************dnldnl Author: Thomas E. Dickey 1995-ondnldnl $Id: aclocal.m4,v 1.373 2005/09/24 21:58:59 tom Exp $dnl Macros used in NCURSES auto-configuration script.dnldnl See http://invisible-island.net/autoconf/ for additional information.dnldnl ---------------------------------------------------------------------------dnl ---------------------------------------------------------------------------dnl AM_LANGINFO_CODESET version: 3 updated: 2002/10/27 23:21:42dnl -------------------dnl Inserted as requested by gettext 0.10.40dnl File from /usr/share/aclocaldnl codeset.m4dnl ====================dnl serial AM1dnldnl From Bruno Haible.AC_DEFUN([AM_LANGINFO_CODESET],[ AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset, [AC_TRY_LINK([#include <langinfo.h>], [char* cs = nl_langinfo(CODESET);], am_cv_langinfo_codeset=yes, am_cv_langinfo_codeset=no) ]) if test $am_cv_langinfo_codeset = yes; then AC_DEFINE(HAVE_LANGINFO_CODESET, 1, [Define if you have <langinfo.h> and nl_langinfo(CODESET).]) fi])dnldnl ---------------------------------------------------------------------------dnl CF_ADA_INCLUDE_DIRS version: 4 updated: 2002/12/01 00:12:15dnl -------------------dnl Construct the list of include-options for the C programs in the Ada95dnl binding.AC_DEFUN([CF_ADA_INCLUDE_DIRS],[ACPPFLAGS="-I. -I../../include $ACPPFLAGS"if test "$srcdir" != "."; then ACPPFLAGS="-I\$(srcdir)/../../include $ACPPFLAGS"fiif test "$GCC" != yes; then ACPPFLAGS="$ACPPFLAGS -I\$(includedir)"elif test "$includedir" != "/usr/include"; then if test "$includedir" = '${prefix}/include' ; then if test $prefix != /usr ; then ACPPFLAGS="$ACPPFLAGS -I\$(includedir)" fi else ACPPFLAGS="$ACPPFLAGS -I\$(includedir)" fifiAC_SUBST(ACPPFLAGS)])dnldnl ---------------------------------------------------------------------------dnl CF_ADD_CFLAGS version: 7 updated: 2004/04/25 17:48:30dnl -------------dnl Copy non-preprocessor flags to $CFLAGS, preprocessor flags to $CPPFLAGSdnl The second parameter if given makes this macro verbose.dnldnl Put any preprocessor definitions that use quoted strings in $EXTRA_CPPFLAGS,dnl to simplify use of $CPPFLAGS in compiler checks, etc., that are easilydnl confused by the quotes (which require backslashes to keep them usable).AC_DEFUN([CF_ADD_CFLAGS],[cf_fix_cppflags=nocf_new_cflags=cf_new_cppflags=cf_new_extra_cppflags=for cf_add_cflags in $1docase $cf_fix_cppflags inno) case $cf_add_cflags in #(vi -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi case $cf_add_cflags in -D*) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[[^=]]*='\''\"[[^"]]*//'` test "${cf_add_cflags}" != "${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" continue elif test "${cf_tst_cflags}" = "\"'" ; then cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" continue fi ;; esac case "$CPPFLAGS" in *$cf_add_cflags) #(vi ;; *) #(vi cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" ;; esac ;; *) cf_new_cflags="$cf_new_cflags $cf_add_cflags" ;; esac ;;yes) cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[[^"]]*"'\''//'` test "${cf_add_cflags}" != "${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=no ;;esacdoneif test -n "$cf_new_cflags" ; then ifelse($2,,,[CF_VERBOSE(add to \$CFLAGS $cf_new_cflags)]) CFLAGS="$CFLAGS $cf_new_cflags"fiif test -n "$cf_new_cppflags" ; then ifelse($2,,,[CF_VERBOSE(add to \$CPPFLAGS $cf_new_cppflags)]) CPPFLAGS="$cf_new_cppflags $CPPFLAGS"fiif test -n "$cf_new_extra_cppflags" ; then ifelse($2,,,[CF_VERBOSE(add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags)]) EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"fiAC_SUBST(EXTRA_CPPFLAGS)])dnldnl ---------------------------------------------------------------------------dnl CF_ANSI_CC_CHECK version: 9 updated: 2001/12/30 17:53:34dnl ----------------dnl This is adapted from the macros 'fp_PROG_CC_STDC' and 'fp_C_PROTOTYPES'dnl in the sharutils 4.2 distribution.AC_DEFUN([CF_ANSI_CC_CHECK],[AC_CACHE_CHECK(for ${CC-cc} option to accept ANSI C, cf_cv_ansi_cc,[cf_cv_ansi_cc=nocf_save_CFLAGS="$CFLAGS"cf_save_CPPFLAGS="$CPPFLAGS"# Don't try gcc -ansi; that turns off useful extensions and# breaks some systems' header files.# AIX -qlanglvl=ansi# Ultrix and OSF/1 -std1# HP-UX -Aa -D_HPUX_SOURCE# SVR4 -Xc# UnixWare 1.2 (cannot use -Xc, since ANSI/POSIX clashes)for cf_arg in "-DCC_HAS_PROTOS" \ "" \ -qlanglvl=ansi \ -std1 \ -Ae \ "-Aa -D_HPUX_SOURCE" \ -Xcdo CF_ADD_CFLAGS($cf_arg) AC_TRY_COMPILE([#ifndef CC_HAS_PROTOS#if !defined(__STDC__) || (__STDC__ != 1)choke me#endif#endif],[ int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);};], [cf_cv_ansi_cc="$cf_arg"; break])doneCFLAGS="$cf_save_CFLAGS"CPPFLAGS="$cf_save_CPPFLAGS"])if test "$cf_cv_ansi_cc" != "no"; thenif test ".$cf_cv_ansi_cc" != ".-DCC_HAS_PROTOS"; then CF_ADD_CFLAGS($cf_cv_ansi_cc)else AC_DEFINE(CC_HAS_PROTOS)fifi])dnldnl ---------------------------------------------------------------------------dnl CF_ANSI_CC_REQD version: 3 updated: 1997/09/06 13:40:44dnl ---------------dnl For programs that must use an ANSI compiler, obtain compiler options thatdnl will make it recognize prototypes. We'll do preprocessor checks in otherdnl macros, since tools such as unproto can fake prototypes, but only part ofdnl the preprocessor.AC_DEFUN([CF_ANSI_CC_REQD],[AC_REQUIRE([CF_ANSI_CC_CHECK])if test "$cf_cv_ansi_cc" = "no"; then AC_ERROR([Your compiler does not appear to recognize prototypes.You have the following choices: a. adjust your compiler options b. get an up-to-date compiler c. use a wrapper such as unproto])fi])dnldnl ---------------------------------------------------------------------------dnl CF_BOOL_DECL version: 8 updated: 2004/01/30 15:51:18dnl ------------dnl Test if 'bool' is a builtin type in the configured C++ compiler. Somednl older compilers (e.g., gcc 2.5.8) don't support 'bool' directly; gccdnl 2.6.3 does, in anticipation of the ANSI C++ standard.dnldnl Treat the configuration-variable specially here, since we're directlydnl substituting its value (i.e., 1/0).dnldnl $1 is the shell variable to store the result in, if not $cv_cv_builtin_boolAC_DEFUN([CF_BOOL_DECL],[AC_MSG_CHECKING(if we should include stdbool.h)AC_CACHE_VAL(cf_cv_header_stdbool_h,[ AC_TRY_COMPILE([],[bool foo = false], [cf_cv_header_stdbool_h=0], [AC_TRY_COMPILE([#ifndef __BEOS__#include <stdbool.h>#endif],[bool foo = false], [cf_cv_header_stdbool_h=1], [cf_cv_header_stdbool_h=0])])])if test "$cf_cv_header_stdbool_h" = 1then AC_MSG_RESULT(yes)else AC_MSG_RESULT(no)fiAC_MSG_CHECKING([for builtin bool type])AC_CACHE_VAL(ifelse($1,,cf_cv_builtin_bool,[$1]),[ AC_TRY_COMPILE([#include <stdio.h>#include <sys/types.h>],[bool x = false], [ifelse($1,,cf_cv_builtin_bool,[$1])=1], [ifelse($1,,cf_cv_builtin_bool,[$1])=0]) ])if test "$ifelse($1,,cf_cv_builtin_bool,[$1])" = 1then AC_MSG_RESULT(yes)else AC_MSG_RESULT(no)fi])dnldnl ---------------------------------------------------------------------------dnl CF_BOOL_SIZE version: 10 updated: 2002/02/23 20:38:31dnl ------------dnl Test for the size of 'bool' in the configured C++ compiler (e.g., a type).dnl Don't bother looking for bool.h, since it's been deprecated.dnldnl If the current compiler is C rather than C++, we get the bool definitiondnl from <stdbool.h>.AC_DEFUN([CF_BOOL_SIZE],[AC_MSG_CHECKING([for size of bool])AC_CACHE_VAL(cf_cv_type_of_bool,[ rm -f cf_test.out AC_TRY_RUN([#include <stdlib.h>#include <stdio.h>#if defined(__cplusplus)#ifdef HAVE_GXX_BUILTIN_H#include <g++/builtin.h>#elif HAVE_GPP_BUILTIN_H#include <gpp/builtin.h>#elif HAVE_BUILTIN_H#include <builtin.h>#endif#else#if $cf_cv_header_stdbool_h#include <stdbool.h>#endif#endifmain(){ FILE *fp = fopen("cf_test.out", "w"); if (fp != 0) { bool x = true; if ((bool)(-x) >= 0) fputs("unsigned ", fp); if (sizeof(x) == sizeof(int)) fputs("int", fp); else if (sizeof(x) == sizeof(char)) fputs("char", fp); else if (sizeof(x) == sizeof(short))fputs("short",fp); else if (sizeof(x) == sizeof(long)) fputs("long", fp); fclose(fp); } exit(0);} ], [cf_cv_type_of_bool=`cat cf_test.out` if test -z "$cf_cv_type_of_bool"; then cf_cv_type_of_bool=unknown fi], [cf_cv_type_of_bool=unknown], [cf_cv_type_of_bool=unknown]) ]) rm -f cf_test.outAC_MSG_RESULT($cf_cv_type_of_bool)if test "$cf_cv_type_of_bool" = unknown ; then case .$NCURSES_BOOL in #(vi .auto|.) NCURSES_BOOL=unsigned;; esac AC_MSG_WARN(Assuming $NCURSES_BOOL for type of bool) cf_cv_type_of_bool=$NCURSES_BOOLfi])dnldnl ---------------------------------------------------------------------------dnl CF_BUILD_CC version: 5 updated: 2005/09/24 17:55:52dnl -----------dnl If we're cross-compiling, allow the user to override the tools and theirdnl options. The configure script is oriented toward identifying the hostdnl compiler, etc., but we need a build compiler to generate parts of thednl source.dnldnl $1 = default for $CPPFLAGSdnl $2 = default for $LIBSAC_DEFUN([CF_BUILD_CC],[AC_REQUIRE([CF_PROG_EXT])if test "$cross_compiling" = yes ; then # defaults that we might want to override : ${BUILD_CFLAGS:=''} : ${BUILD_CPPFLAGS:='ifelse([$1],,,[$1])'} : ${BUILD_LDFLAGS:=''} : ${BUILD_LIBS:='ifelse([$2],,,[$2])'} : ${BUILD_EXEEXT:='$x'} : ${BUILD_OBJEXT:='o'} AC_ARG_WITH(build-cc, [ --with-build-cc=XXX the build C compiler ($BUILD_CC)], [BUILD_CC="$withval"], [AC_CHECK_PROGS(BUILD_CC, gcc cc cl)]) AC_MSG_CHECKING(for native build C compiler) AC_MSG_RESULT($BUILD_CC) AC_MSG_CHECKING(for native build C preprocessor) AC_ARG_WITH(build-cpp, [ --with-build-cpp=XXX the build C preprocessor ($BUILD_CPP)], [BUILD_CPP="$withval"], [BUILD_CPP='$(BUILD_CC) -E']) AC_MSG_RESULT($BUILD_CPP) AC_MSG_CHECKING(for native build C flags) AC_ARG_WITH(build-cflags, [ --with-build-cflags=XXX the build C compiler-flags ($BUILD_CFLAGS)], [BUILD_CFLAGS="$withval"]) AC_MSG_RESULT($BUILD_CFLAGS) AC_MSG_CHECKING(for native build C preprocessor-flags) AC_ARG_WITH(build-cppflags, [ --with-build-cppflags=XXX the build C preprocessor-flags ($BUILD_CPPFLAGS)], [BUILD_CPPFLAGS="$withval"]) AC_MSG_RESULT($BUILD_CPPFLAGS) AC_MSG_CHECKING(for native build linker-flags) AC_ARG_WITH(build-ldflags, [ --with-build-ldflags=XXX the build linker-flags ($BUILD_LDFLAGS)], [BUILD_LDFLAGS="$withval"]) AC_MSG_RESULT($BUILD_LDFLAGS) AC_MSG_CHECKING(for native build linker-libraries) AC_ARG_WITH(build-libs, [ --with-build-libs=XXX the build libraries ($(BUILD_LIBS)], [BUILD_LIBS="$withval"]) AC_MSG_RESULT($BUILD_LIBS) # this assumes we're on Unix. BUILD_EXEEXT= BUILD_OBJEXT=o : ${BUILD_CC:='$(CC)'} if ( test "$BUILD_CC" = "$CC" || test "$BUILD_CC" = '$(CC)' ) ; then AC_MSG_ERROR([Cross-build requires two compilers.Use --with-build-cc to specify the native compiler.]) fielse : ${BUILD_CC:='$(CC)'} : ${BUILD_CPP:='$(CPP)'} : ${BUILD_CFLAGS:='$(CFLAGS)'} : ${BUILD_CPPFLAGS:='$(CPPFLAGS)'} : ${BUILD_LDFLAGS:='$(LDFLAGS)'} : ${BUILD_LIBS:='$(LIBS)'} : ${BUILD_EXEEXT:='$x'} : ${BUILD_OBJEXT:='o'}fiAC_SUBST(BUILD_CC)AC_SUBST(BUILD_CPP)AC_SUBST(BUILD_CFLAGS)AC_SUBST(BUILD_CPPFLAGS)AC_SUBST(BUILD_LDFLAGS)AC_SUBST(BUILD_LIBS)AC_SUBST(BUILD_EXEEXT)AC_SUBST(BUILD_OBJEXT)])dnldnl ---------------------------------------------------------------------------dnl CF_CFG_DEFAULTS version: 7 updated: 2005/09/24 16:15:00dnl ---------------dnl Determine the default configuration into which we'll install ncurses. Thisdnl can be overridden by the user's command-line options. There's two items todnl look for:dnl 1. the prefix (e.g., /usr)dnl 2. the header files (e.g., /usr/include/ncurses)dnl We'll look for a previous installation of ncurses and use the same defaults.dnl
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -