aclocal.m4
来自「linux平台中」· M4 代码 · 共 1,830 行 · 第 1/4 页
M4
1,830 行
done IFS="$ac_save_ifs"dnl If no 4th arg is given, leave the cache variable unset,dnl so AC_PATH_PROGS will keep looking.ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"])dnl ;;esac])dnl$1="$ac_cv_path_$1"if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then AC_MSG_RESULT([$]$1)else AC_MSG_RESULT(no)fiAC_SUBST($1)dnl])#serial 1# This test replaces the one in autoconf.# Currently this macro should have the same name as the autoconf macro# because gettext's gettext.m4 (distributed in the automake package)# still uses it. Otherwise, the use in gettext.m4 makes autoheader# give these diagnostics:# configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX# configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIXundefine([AC_ISC_POSIX])AC_DEFUN([AC_ISC_POSIX], [ dnl This test replaces the obsolescent AC_ISC_POSIX kludge. AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"]) ])#serial 2# Test for the GNU C Library, version 2.1 or newer.# From Bruno Haible.AC_DEFUN([jm_GLIBC21], [ AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer, ac_cv_gnu_library_2_1, [AC_EGREP_CPP([Lucky GNU user], [#include <features.h>#ifdef __GNU_LIBRARY__ #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2) Lucky GNU user #endif#endif ], ac_cv_gnu_library_2_1=yes, ac_cv_gnu_library_2_1=no) ] ) AC_SUBST(GLIBC21) GLIBC21="$ac_cv_gnu_library_2_1" ])#serial AM2dnl From Bruno Haible.AC_DEFUN([AM_ICONV],[ dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and dnl those with the standalone portable GNU libiconv installed). AC_ARG_WITH([libiconv-prefix],[ --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib], [ for dir in `echo "$withval" | tr : ' '`; do if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi if test -d $dir/lib; then LDFLAGS="$LDFLAGS -L$dir/lib"; fi done ]) AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [ am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no AC_TRY_LINK([#include <stdlib.h>#include <iconv.h>], [iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);], am_cv_func_iconv=yes) if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS -liconv" AC_TRY_LINK([#include <stdlib.h>#include <iconv.h>], [iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);], am_cv_lib_iconv=yes am_cv_func_iconv=yes) LIBS="$am_save_LIBS" fi ]) if test "$am_cv_func_iconv" = yes; then AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.]) AC_MSG_CHECKING([for iconv declaration]) AC_CACHE_VAL(am_cv_proto_iconv, [ AC_TRY_COMPILE([#include <stdlib.h>#include <iconv.h>extern#ifdef __cplusplus"C"#endif#if defined(__STDC__) || defined(__cplusplus)size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);#elsesize_t iconv();#endif], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const") am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` AC_MSG_RESULT([$]{ac_t:- }[$]am_cv_proto_iconv) AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1, [Define as const if the declaration of iconv() needs const.]) fi LIBICONV= if test "$am_cv_lib_iconv" = yes; then LIBICONV="-liconv" fi AC_SUBST(LIBICONV)])#serial AM1dnl 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])# Check whether LC_MESSAGES is available in <locale.h>.# Ulrich Drepper <drepper@cygnus.com>, 1995.## This file can be copied and used freely without restrictions. It can# be used in projects which are not available under the GNU General Public# License or the GNU Library General Public License but which still want# to provide support for the GNU gettext functionality.# Please note that the actual code of the GNU gettext library is covered# by the GNU Library General Public License, and the rest of the GNU# gettext package package is covered by the GNU General Public License.# They are *not* in the public domain.# serial 2AC_DEFUN([AM_LC_MESSAGES], [if test $ac_cv_header_locale_h = yes; then AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES, [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES], am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)]) if test $am_cv_val_LC_MESSAGES = yes; then AC_DEFINE(HAVE_LC_MESSAGES, 1, [Define if your <locale.h> file defines LC_MESSAGES.]) fi fi])# Check to see if we use dir\file name conventtion# If so, set macro HAVE_DOS_FILE_NAMES# Also set the macro HAVE_DOS_FILE_CONTENTS for now,# since don't know of a good way to independently check this.dnl AC_DOSFILE()AC_DEFUN(AC_DOSFILE,[ AC_CACHE_CHECK([for dos file convention], ac_cv_dosfile, [if test -d ".\."; then ac_cv_dosfile=yes else ac_cv_dosfile=no fi ]) if test $ac_cv_dosfile = yes; then AC_DEFINE(HAVE_DOS_FILE_NAMES, 1, [Define if your OS uses backslashes as directory separators]) AC_DEFINE(HAVE_DOS_FILE_CONTENTS, 1, [Define if text file lines end in CRLF.]) fi])# Check to see the separator for the environment variables# and set SEP to ";" or default ":"dnl AM_SEP()dnl SEPAC_DEFUN(AM_SEP,[AC_REQUIRE([AC_CYGWIN])AC_REQUIRE([AC_MINGW32])AC_REQUIRE([AC_DJGPP])AC_MSG_CHECKING([for environ variable separator])AC_CACHE_VAL(ac_cv_sep,[if test "$CYGWIN" = yes || test "$MINGW32" = yes || test "$DJ_GPP" = yes ; then ac_cv_sep=yeselse ac_cv_sep=nofi])SEP=":"test x"$ac_cv_sep" = xyes && SEP=";"AC_MSG_RESULT(${SEP})AC_SUBST(SEP)])dnl Check for DJGPP. we use DJ_GPP as the variablednl EXEEXXTAC_DEFUN(AC_DJGPP,[AC_CACHE_CHECK(for DJGPP environment, ac_cv_djgpp,[AC_TRY_COMPILE(,[ return __DJGPP__;],ac_cv_djgpp=yes, ac_cv_djgpp=no)rm -f conftest*])DJ_GPP=test "$ac_cv_djgpp" = yes && DJ_GPP=yes])#serial 5001dnl Initially derived from code in GNU grep.dnl Mostly written by Jim Meyering.dnl Usage: jm_INCLUDED_REGEX([lib/regex.c])dnlAC_DEFUN(jm_INCLUDED_REGEX, [ dnl Even packages that don't use regex.c can use this macro. dnl Of course, for them it doesn't do anything. # Assume we'll default to using the included regex.c. ac_use_included_regex=yes # However, if the system regex support is good enough that it passes the # the following run test, then default to *not* using the included regex.c. # If cross compiling, assume the test would fail and use the included # regex.c. The first failing regular expression is from `Spencer ere # test #75' in grep-2.3. AC_CACHE_CHECK([for working re_compile_pattern], jm_cv_func_working_re_compile_pattern, AC_TRY_RUN( changequote(<<, >>)dnl <<#include <stdio.h>#include <regex.h> int main () { static struct re_pattern_buffer regex; const char *s; re_set_syntax (RE_SYNTAX_POSIX_EGREP); /* Add this third left square bracket, [, to balance the three right ones below. Otherwise autoconf-2.14 chokes. */ s = re_compile_pattern ("a[[:]:]]b\n", 9, ®ex); /* This should fail with _Invalid character class name_ error. */ if (!s) exit (1); /* This should succeed, but doesn't for e.g. glibc-2.1.3. */ s = re_compile_pattern ("{1", 2, ®ex); exit (s ? 1 : 0); } >>, changequote([, ])dnl jm_cv_func_working_re_compile_pattern=yes, jm_cv_func_working_re_compile_pattern=no, dnl When crosscompiling, assume it's broken. jm_cv_func_working_re_compile_pattern=no)) if test $jm_cv_func_working_re_compile_pattern = yes; then ac_use_included_regex=no fi test -n "$1" || AC_MSG_ERROR([missing argument]) syscmd([test -f $1]) ifelse(sysval, 0, [ AC_ARG_WITH(included-regex, [ --without-included-regex don't compile regex; this is the default on systems with version 2 of the GNU C library (use with caution on other system)], jm_with_regex=$withval, jm_with_regex=$ac_use_included_regex) if test "$jm_with_regex" = yes; then AC_LIBOBJ(regex) fi ], ) ])#serial 1002, but ported to autoconf 2.13 by eggert# Experimental replacement for the function in the latest CVS autoconf.# If the compile-test says strerror_r doesn't work, then resort to a# `run'-test that works on BeOS and segfaults on DEC Unix.# Use with the error.c file in ../lib.undefine([AC_FUNC_STRERROR_R])# AC_FUNC_STRERROR_R# ------------------AC_DEFUN([AC_FUNC_STRERROR_R],[jm_CHECK_DECLARATION(strerror_r, [#include <string.h>])test $jm_cv_func_decl_strerror_r != yesAC_DEFINE_UNQUOTED(HAVE_DECL_STRERROR_R, $?, [Define to 1 if strerror_r is declared.])AC_CHECK_FUNCS([strerror_r])if test $ac_cv_func_strerror_r = yes; then AC_CHECK_HEADERS(string.h) AC_CACHE_CHECK([for working strerror_r], ac_cv_func_strerror_r_works, [ AC_TRY_COMPILE( [# include <stdio.h># if HAVE_STRING_H# include <string.h># endif ], [ char buf[100]; char x = *strerror_r (0, buf, sizeof buf); ], ac_cv_func_strerror_r_works=yes, ac_cv_func_strerror_r_works=no ) if test $ac_cv_func_strerror_r_works = no; then # strerror_r seems not to work, but now we have to choose between # systems that have relatively inaccessible declarations for the # function. BeOS and DEC UNIX 4.0 fall in this category, but the # former has a strerror_r that returns char*, while the latter # has a strerror_r that returns int. # This test should segfault on the DEC system. AC_TRY_RUN( [# include <stdio.h># include <string.h># include <ctype.h> extern char *strerror_r (); int main () { char buf[100]; char x = *strerror_r (0, buf, sizeof buf); exit (!isalpha (x)); } ], ac_cv_func_strerror_r_works=yes, ac_cv_func_strerror_r_works=no, ac_cv_func_strerror_r_works=no) fi ]) if test $ac_cv_func_strerror_r_works = yes; then AC_DEFINE_UNQUOTED(HAVE_WORKING_STRERROR_R, 1, [Define to 1 if strerror_r returns a string.]) fifi])# AC_FUNC_STRERROR_R#serial 1dnl FIXME: put these prerequisite-only *.m4 files in a separatednl directory -- otherwise, they'll conflict with existing files.dnl These are the prerequisite macros for GNU's error.c file.AC_DEFUN(jm_PREREQ_ERROR,[ AC_CHECK_FUNCS(strerror strerror_r vprintf doprnt) AC_HEADER_STDC])#serial 3dnl From Jim Meyering.dnl Determine whether malloc accepts 0 as its argument.dnl If it doesn't, arrange to use the replacement function.dnlAC_DEFUN(jm_FUNC_MALLOC,[ dnl xmalloc.c requires that this symbol be defined so it doesn't dnl mistakenly use a broken malloc -- as it might if this test were omitted. AC_DEFINE_UNQUOTED(HAVE_DONE_WORKING_MALLOC_CHECK, 1, [Define if the malloc check has been performed. ]) AC_CACHE_CHECK([for working malloc], jm_cv_func_working_malloc, [AC_TRY_RUN([ char *malloc (); int main () { exit (malloc (0) ? 0 : 1); } ], jm_cv_func_working_malloc=yes, jm_cv_func_working_malloc=no, dnl When crosscompiling, assume malloc is broken. jm_cv_func_working_malloc=no) ]) if test $jm_cv_func_working_malloc = no; then AC_LIBOBJ(malloc) AC_DEFINE_UNQUOTED(malloc, rpl_malloc, [Define to rpl_malloc if the replacement function should be used.]) fi])#serial 3dnl From Jim Meyering.dnl Determine whether realloc works when both arguments are 0.dnl If it doesn't, arrange to use the replacement function.dnlAC_DEFUN(jm_FUNC_REALLOC,[ dnl xmalloc.c requires that this symbol be defined so it doesn't dnl mistakenly use a broken realloc -- as it might if this test were omitted. AC_DEFINE_UNQUOTED(HAVE_DONE_WORKING_REALLOC_CHECK, 1, [Define if the realloc check has been performed. ]) AC_CACHE_CHECK([for working realloc], jm_cv_func_working_realloc, [AC_TRY_RUN([ char *realloc (); int main () { exit (realloc (0, 0) ? 0 : 1); } ], jm_cv_func_working_realloc=yes, jm_cv_func_working_realloc=no, dnl When crosscompiling, assume realloc is broken. jm_cv_func_working_realloc=no) ]) if test $jm_cv_func_working_realloc = no; then AC_LIBOBJ(realloc) AC_DEFINE_UNQUOTED(realloc, rpl_realloc, [Define to rpl_realloc if the replacement function should be used.]) fi])
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?