annotate lib/swig/swigwin-2.0.11/CCache/configure.ac @ 1983:5cd26f2c6904

small fix
author Ritor1
date Fri, 01 Nov 2013 17:29:49 +0600
parents b3009adc0e2f
children
rev   line source
1899
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
1 dnl Process this file with autoconf to produce a configure script.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
2
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
3 AC_INIT([ccache-swig], [0.0]) # Get version from SWIG in ccache_swig_config.h.in
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
4 AC_PREREQ(2.52)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
5 AC_CONFIG_SRCDIR([ccache.h])
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
6
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
7 AC_MSG_NOTICE([Configuring ccache])
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
8
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
9 AC_CONFIG_HEADER(config.h)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
10
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
11 dnl Checks for programs.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
12 AC_PROG_CC
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
13 AC_PROG_CPP
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
14 AC_PROG_INSTALL
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
15 AC_ARG_PROGRAM # for program_transform_name
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
16
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
17 AC_DEFINE([_GNU_SOURCE], 1,
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
18 [Define _GNU_SOURCE so that we get all necessary prototypes])
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
19
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
20 # If GCC, turn on warnings.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
21 if test "x$GCC" = "xyes"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
22 then
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
23 CFLAGS="$CFLAGS -Wall -W"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
24 else
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
25 CFLAGS="$CFLAGS -O"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
26 fi
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
27
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
28 AC_HEADER_DIRENT
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
29 AC_HEADER_TIME
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
30 AC_HEADER_SYS_WAIT
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
31
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
32 AC_CHECK_HEADERS(ctype.h strings.h stdlib.h string.h pwd.h sys/time.h)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
33
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
34 AC_CHECK_FUNCS(realpath snprintf vsnprintf vasprintf asprintf mkstemp)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
35 AC_CHECK_FUNCS(gethostname getpwuid)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
36 AC_CHECK_FUNCS(utimes)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
37
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
38 AC_CACHE_CHECK([for compar_fn_t in stdlib.h],ccache_cv_COMPAR_FN_T, [
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
39 AC_TRY_COMPILE(
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
40 [#include <stdlib.h>],
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
41 [
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
42 void test_fn(void) { qsort(NULL, 0, 0, (__compar_fn_t)NULL); }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
43 ],
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
44 ccache_cv_COMPAR_FN_T=yes,ccache_cv_COMPAR_FN_T=no)])
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
45 if test x"$ccache_cv_COMPAR_FN_T" = x"yes"; then
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
46 AC_DEFINE(HAVE_COMPAR_FN_T, 1, [ ])
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
47 fi
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
48
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
49 dnl Note: This could be replaced by AC_FUNC_SNPRINTF() in the autoconf macro archive
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
50 AC_CACHE_CHECK([for C99 vsnprintf],ccache_cv_HAVE_C99_VSNPRINTF,[
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
51 AC_TRY_RUN([
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
52 #include <sys/types.h>
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
53 #include <stdarg.h>
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
54 void foo(const char *format, ...) {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
55 va_list ap;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
56 int len;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
57 char buf[5];
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
58
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
59 va_start(ap, format);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
60 len = vsnprintf(0, 0, format, ap);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
61 va_end(ap);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
62 if (len != 5) exit(1);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
63
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
64 if (snprintf(buf, 3, "hello") != 5 || strcmp(buf, "he") != 0) exit(1);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
65
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
66 exit(0);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
67 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
68 main() { foo("hello"); }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
69 ],
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
70 ccache_cv_HAVE_C99_VSNPRINTF=yes,ccache_cv_HAVE_C99_VSNPRINTF=no,ccache_cv_HAVE_C99_VSNPRINTF=cross)])
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
71 if test x"$ccache_cv_HAVE_C99_VSNPRINTF" = x"yes"; then
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
72 AC_DEFINE(HAVE_C99_VSNPRINTF, 1, [ ])
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
73 fi
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
74
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
75 dnl Check for zlib.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
76 dnl Note: This could be replaced by CHECK_ZLIB() in the autoconf macro archive
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
77 AC_ARG_ENABLE([zlib],
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
78 AS_HELP_STRING([--enable-zlib], [enable zlib support for ccache compression]),,
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
79 [enable_zlib=yes])
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
80
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
81 if test x"$enable_zlib" = x"yes"; then
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
82 AC_CHECK_HEADER(zlib.h, AC_CHECK_LIB(z, gzdopen, [LIBS="-lz $LIBS"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
83 AC_DEFINE([ENABLE_ZLIB], 1, [Define to 1 if you would like to have zlib compression for ccache.]) ] ))
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
84 fi
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
85
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
86 AC_CONFIG_FILES([Makefile])
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
87 AC_OUTPUT