configure.in

来自「ccache 是一个快速的编译器缓存。当您编译一个程序的时候」· IN 代码 · 共 72 行

IN
72
字号
dnl Process this file with autoconf to produce a configure script.AC_INIT()AC_PREREQ(2.52)AC_MSG_NOTICE([Configuring ccache])AC_CONFIG_HEADER(config.h)dnl Checks for programs.AC_PROG_CCAC_PROG_CPPAC_PROG_INSTALLAC_DEFINE([_GNU_SOURCE], 1,          [Define _GNU_SOURCE so that we get all necessary prototypes])# If GCC, turn on warnings.if test "x$GCC" = "xyes"then	CFLAGS="$CFLAGS -Wall -W"else	CFLAGS="$CFLAGS -O"fiAC_HEADER_DIRENTAC_HEADER_TIMEAC_HEADER_SYS_WAITAC_CHECK_HEADERS(ctype.h strings.h stdlib.h string.h)AC_CHECK_FUNCS(realpath snprintf vsnprintf vasprintf asprintf mkstemp gethostname)AC_CACHE_CHECK([for compar_fn_t in stdlib.h],ccache_cv_COMPAR_FN_T, [    AC_TRY_COMPILE([#include <stdlib.h>],[void test_fn(void) { qsort(NULL, 0, 0, (__compar_fn_t)NULL); }],	ccache_cv_COMPAR_FN_T=yes,ccache_cv_COMPAR_FN_T=no)])if test x"$ccache_cv_COMPAR_FN_T" = x"yes"; then   AC_DEFINE(HAVE_COMPAR_FN_T, 1, [ ])fiAC_CACHE_CHECK([for C99 vsnprintf],ccache_cv_HAVE_C99_VSNPRINTF,[AC_TRY_RUN([#include <sys/types.h>#include <stdarg.h>void foo(const char *format, ...) {        va_list ap;       int len;       char buf[5];       va_start(ap, format);       len = vsnprintf(0, 0, format, ap);       va_end(ap);       if (len != 5) exit(1);       if (snprintf(buf, 3, "hello") != 5 || strcmp(buf, "he") != 0) exit(1);       exit(0);}main() { foo("hello"); }],ccache_cv_HAVE_C99_VSNPRINTF=yes,ccache_cv_HAVE_C99_VSNPRINTF=no,ccache_cv_HAVE_C99_VSNPRINTF=cross)])if test x"$ccache_cv_HAVE_C99_VSNPRINTF" = x"yes"; then    AC_DEFINE(HAVE_C99_VSNPRINTF, 1, [ ])fiAC_CONFIG_FILES([Makefile])AC_OUTPUT

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?