📄 aclocal.m4
字号:
int main(int argc GCC_UNUSED, char *argv[[]] GCC_UNUSED) { return 0; }EOF for cf_attribute in scanf printf unused noreturn do CF_UPPER(cf_ATTRIBUTE,$cf_attribute) cf_directive="__attribute__(($cf_attribute))" echo "checking for $CC $cf_directive" 1>&AC_FD_CC case $cf_attribute in scanf|printf) cat >conftest.h <<EOF#define GCC_$cf_ATTRIBUTE 1EOF ;; *) cat >conftest.h <<EOF#define GCC_$cf_ATTRIBUTE $cf_directiveEOF ;; esac if AC_TRY_EVAL(ac_compile); then test -n "$verbose" && AC_MSG_RESULT(... $cf_attribute) cat conftest.h >>confdefs.h fi doneelse fgrep define conftest.i >>confdefs.hfirm -rf conftest*fi])dnldnl ---------------------------------------------------------------------------dnl CF_GCC_VERSION version: 4 updated: 2005/08/27 09:53:42dnl --------------dnl Find version of gccAC_DEFUN([CF_GCC_VERSION],[AC_REQUIRE([AC_PROG_CC])GCC_VERSION=noneif test "$GCC" = yes ; then AC_MSG_CHECKING(version of $CC) GCC_VERSION="`${CC} --version| sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[[^0-9.]]*//' -e 's/[[^0-9.]].*//'`" test -z "$GCC_VERSION" && GCC_VERSION=unknown AC_MSG_RESULT($GCC_VERSION)fi])dnldnl ---------------------------------------------------------------------------dnl CF_GCC_WARNINGS version: 20 updated: 2005/08/06 18:37:29dnl ---------------dnl Check if the compiler supports useful warning options. There's a few thatdnl we don't use, simply because they're too noisy:dnldnl -Wconversion (useful in older versions of gcc, but not in gcc 2.7.x)dnl -Wredundant-decls (system headers make this too noisy)dnl -Wtraditional (combines too many unrelated messages, only a few useful)dnl -Wwrite-strings (too noisy, but should review occasionally). Thisdnl is enabled for ncurses using "--enable-const".dnl -pedanticdnldnl Parameter:dnl $1 is an optional list of gcc warning flags that a particulardnl application might want to use, e.g., "no-unused" fordnl -Wno-unuseddnl Special:dnl If $with_ext_const is "yes", add a check for -Wwrite-stringsdnlAC_DEFUN([CF_GCC_WARNINGS],[AC_REQUIRE([CF_GCC_VERSION])CF_INTEL_COMPILER(GCC,INTEL_COMPILER,CFLAGS)cat > conftest.$ac_ext <<EOF#line __oline__ "configure"int main(int argc, char *argv[[]]) { return (argv[[argc-1]] == 0) ; }EOFif test "$INTEL_COMPILER" = yesthen# The "-wdXXX" options suppress warnings:# remark #1419: external declaration in primary source file# remark #1682: implicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)# remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)# remark #1684: conversion from pointer to same-sized integral type (potential portability problem)# remark #193: zero used for undefined preprocessing identifier# remark #593: variable "curs_sb_left_arrow" was set but never used# remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits# remark #869: parameter "tw" was never referenced# remark #981: operands are evaluated in unspecified order# warning #269: invalid format string conversion AC_CHECKING([for $CC warning options]) cf_save_CFLAGS="$CFLAGS" EXTRA_CFLAGS="-Wall" for cf_opt in $1 \ wd1419 \ wd1682 \ wd1683 \ wd1684 \ wd193 \ wd279 \ wd593 \ wd810 \ wd869 \ wd981 do CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt" if AC_TRY_EVAL(ac_compile); then test -n "$verbose" && AC_MSG_RESULT(... -$cf_opt) EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt" fi done CFLAGS="$cf_save_CFLAGS"elif test "$GCC" = yesthen AC_CHECKING([for $CC warning options]) cf_save_CFLAGS="$CFLAGS" EXTRA_CFLAGS="-W -Wall" cf_warn_CONST="" test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings" for cf_opt in \ Wbad-function-cast \ Wcast-align \ Wcast-qual \ Winline \ Wmissing-declarations \ Wmissing-prototypes \ Wnested-externs \ Wpointer-arith \ Wshadow \ Wstrict-prototypes \ Wundef $cf_warn_CONST $1 do CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt" if AC_TRY_EVAL(ac_compile); then test -n "$verbose" && AC_MSG_RESULT(... -$cf_opt) case $cf_opt in #(vi Wcast-qual) #(vi CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES" ;; Winline) #(vi case $GCC_VERSION in 3.3*) CF_VERBOSE(feature is broken in gcc $GCC_VERSION) continue;; esac ;; esac EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt" fi done CFLAGS="$cf_save_CFLAGS"firm -f conftest*AC_SUBST(EXTRA_CFLAGS)])dnldnl ---------------------------------------------------------------------------dnl CF_INTEL_COMPILER version: 3 updated: 2005/08/06 18:37:29dnl -----------------dnl Check if the given compiler is really the Intel compiler for Linux. Itdnl tries to imitate gcc, but does not return an error when it finds a mismatchdnl between prototypes, e.g., as exercised by CF_MISSING_CHECK.dnldnl This macro should be run "soon" after AC_PROG_CC or AC_PROG_CPLUSPLUS, todnl ensure that it is not mistaken for gcc/g++. It is normally invoked fromdnl the wrappers for gcc and g++ warnings.dnldnl $1 = GCC (default) or GXXdnl $2 = INTEL_COMPILER (default) or INTEL_CPLUSPLUSdnl $3 = CFLAGS (default) or CXXFLAGSAC_DEFUN([CF_INTEL_COMPILER],[ifelse($2,,INTEL_COMPILER,[$2])=noif test "$ifelse($1,,[$1],GCC)" = yes ; then case $host_os in linux*|gnu*) AC_MSG_CHECKING(if this is really Intel ifelse($1,GXX,C++,C) compiler) cf_save_CFLAGS="$ifelse($3,,CFLAGS,[$3])" ifelse($3,,CFLAGS,[$3])="$ifelse($3,,CFLAGS,[$3]) -no-gcc" AC_TRY_COMPILE([],[#ifdef __INTEL_COMPILER#elsemake an error#endif],[ifelse($2,,INTEL_COMPILER,[$2])=yescf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc"],[]) ifelse($3,,CFLAGS,[$3])="$cf_save_CFLAGS" AC_MSG_RESULT($ifelse($2,,INTEL_COMPILER,[$2])) ;; esacfi])dnldnl ---------------------------------------------------------------------------dnl CF_NO_LEAKS_OPTION version: 4 updated: 2006/12/16 14:24:05dnl ------------------dnl see CF_WITH_NO_LEAKSAC_DEFUN([CF_NO_LEAKS_OPTION],[AC_MSG_CHECKING(if you want to use $1 for testing)AC_ARG_WITH($1, [$2], [AC_DEFINE($3)ifelse([$4],,[ $4]) : ${with_cflags:=-g} : ${with_no_leaks:=yes} with_$1=yes], [with_$1=])AC_MSG_RESULT(${with_$1:-no})case .$with_cflags in #(vi.*-g*) case .$CFLAGS in #(vi .*-g*) #(vi ;; *) CF_ADD_CFLAGS([-g]) ;; esac ;;esac])dnldnl ---------------------------------------------------------------------------dnl CF_PROG_EXT version: 10 updated: 2004/01/03 19:28:18dnl -----------dnl Compute $PROG_EXT, used for non-Unix ports, such as OS/2 EMX.AC_DEFUN([CF_PROG_EXT],[AC_REQUIRE([CF_CHECK_CACHE])case $cf_cv_system_name inos2*) CFLAGS="$CFLAGS -Zmt" CPPFLAGS="$CPPFLAGS -D__ST_MT_ERRNO__" CXXFLAGS="$CXXFLAGS -Zmt" # autoconf's macro sets -Zexe and suffix both, which conflict:w LDFLAGS="$LDFLAGS -Zmt -Zcrtdll" ac_cv_exeext=.exe ;;esacAC_EXEEXTAC_OBJEXTPROG_EXT="$EXEEXT"AC_SUBST(PROG_EXT)test -n "$PROG_EXT" && AC_DEFINE_UNQUOTED(PROG_EXT,"$PROG_EXT")])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_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_DBMALLOC version: 6 updated: 2006/12/16 14:24:05dnl ----------------dnl Configure-option for dbmalloc. The optional parameter is used to overridednl the updating of $LIBS, e.g., to avoid conflict with subsequent tests.AC_DEFUN([CF_WITH_DBMALLOC],[CF_NO_LEAKS_OPTION(dbmalloc, [ --with-dbmalloc test: use Conor Cahill's dbmalloc library], [USE_DBMALLOC])if test "$with_dbmalloc" = yes ; then AC_CHECK_HEADER(dbmalloc.h, [AC_CHECK_LIB(dbmalloc,[debug_malloc]ifelse($1,,[],[,$1]))])fi])dnldnl ---------------------------------------------------------------------------dnl CF_WITH_DMALLOC version: 6 updated: 2006/12/16 14:24:05dnl ---------------dnl Configure-option for dmalloc. The optional parameter is used to overridednl the updating of $LIBS, e.g., to avoid conflict with subsequent tests.AC_DEFUN([CF_WITH_DMALLOC],[CF_NO_LEAKS_OPTION(dmalloc, [ --with-dmalloc test: use Gray Watson's dmalloc library], [USE_DMALLOC])if test "$with_dmalloc" = yes ; then AC_CHECK_HEADER(dmalloc.h, [AC_CHECK_LIB(dmalloc,[dmalloc_debug]ifelse($1,,[],[,$1]))])fi])dnldnl ---------------------------------------------------------------------------dnl CF_WITH_VALGRIND version: 1 updated: 2006/12/14 18:00:21dnl ----------------AC_DEFUN([CF_WITH_VALGRIND],[CF_NO_LEAKS_OPTION(valgrind, [ --with-valgrind test: use valgrind], [USE_VALGRIND])])dnldnl ---------------------------------------------------------------------------dnl CF_WITH_WARNINGS version: 5 updated: 2004/07/23 14:40:34dnl ----------------dnl Combine the checks for gcc features into a configure-script optiondnldnl Parameters:dnl $1 - see CF_GCC_WARNINGSAC_DEFUN([CF_WITH_WARNINGS],[if ( test "$GCC" = yes || test "$GXX" = yes )thenAC_MSG_CHECKING(if you want to check for gcc warnings)AC_ARG_WITH(warnings, [ --with-warnings test: turn on gcc warnings], [cf_opt_with_warnings=$withval], [cf_opt_with_warnings=no])AC_MSG_RESULT($cf_opt_with_warnings)if test "$cf_opt_with_warnings" != no ; then CF_GCC_ATTRIBUTES CF_GCC_WARNINGS([$1])fifi])dnl
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -