beta-0.89.2
[luatex.git] / source / libs / cairo / cairo-src / build / configure.ac.system
blobb9d71c8d783605ddb485b1dff5376093a5128095
1 dnl
2 dnl Non-failing checks for functions, headers, libraries, etc go here
3 dnl
5 dnl ====================================================================
6 dnl Feature checks
7 dnl ====================================================================
9 AM_CONDITIONAL(CROSS_COMPILING, test "x$cross_compiling" = "xyes")
10 CAIRO_BIGENDIAN
11 AC_ARG_ENABLE(atomic,
12               [AS_HELP_STRING([--disable-atomic],
13                               [disable use of native atomic operations])],
14               [use_atomic=$enableval], [use_atomic=yes])
15 AS_IF([test "x$use_atomic" = "xyes"], [
16   CAIRO_CHECK_NATIVE_ATOMIC_PRIMITIVES
17   CAIRO_CHECK_ATOMIC_OP_NEEDS_MEMORY_BARRIER
19 AC_CHECK_SIZEOF(void *)
20 AC_CHECK_SIZEOF(int)
21 AC_CHECK_SIZEOF(long)
22 AC_CHECK_SIZEOF(long long)
23 AC_CHECK_SIZEOF(size_t)
25 AC_MSG_CHECKING([for native Win32])
26 case "$host" in
27   *-*-mingw*)
28     cairo_os_win32=yes
29     ;;
30   *)
31     cairo_os_win32=no
32     ;;
33 esac
34 AC_MSG_RESULT([$cairo_os_win32])
35 AM_CONDITIONAL(OS_WIN32, test "$cairo_os_win32" = "yes")
37 AC_MSG_CHECKING([for Sun Solaris (non-POSIX ctime_r)])
38 case "$host" in
39     *-*-solaris*)
40         CFLAGS="$CFLAGS -D_POSIX_PTHREAD_SEMANTICS"
41         solaris_posix_pthread=yes
42         ;;
43     *)
44         solaris_posix_pthread=no
45         ;;
46 esac
47 AC_MSG_RESULT([$solaris_posix_pthread])
49 dnl ====================================================================
50 dnl Library checks
51 dnl ====================================================================
53 AC_CHECK_LIBM
54 LIBS="$LIBS $LIBM"
56 AC_CHECK_LIB(rt, sched_yield)
58 has_shm_open=
59 AC_CHECK_LIB(rt, shm_open, [
60              SHM_LIBS=-lrt
61              has_shm_open=yes
62              ], [SHM_LIBS=])
63 AM_CONDITIONAL(HAVE_SHM, test "x$has_shm_open" = "xyes")
64 AC_SUBST(SHM_LIBS)
66 AC_CHECK_LIB(socket, connect, [SOCKET_LIBS=-lsocket], [SOCKET_LIBS=])
67 CAIROBOILERPLATE_LIBS=$SOCKET_LIBS
68 AC_SUBST(CAIROBOILERPLATE_LIBS)
70 dnl ====================================================================
71 dnl Header/function checks
72 dnl ====================================================================
74 dnl check if we have a __builtin_return_address for the cairo-trace
75 dnl utility.
76 AC_MSG_CHECKING([for __builtin_return_address(0)])
77 AC_TRY_COMPILE([],[__builtin_return_address(0);],
78                 [have_builtin_return_address=yes],
79                 [have_builtin_return_address=no])
80 AC_MSG_RESULT($have_builtin_return_address)
81 if test "x$have_builtin_return_address" = "xyes"; then
82     AC_DEFINE(HAVE_BUILTIN_RETURN_ADDRESS, 1,
83         [Define to 1 if your compiler supports the __builtin_return_address() intrinsic.])
86 dnl Checks for precise integer types
87 AC_CHECK_HEADERS([stdint.h inttypes.h sys/int_types.h])
88 AC_CHECK_TYPES([uint64_t, uint128_t, __uint128_t])
90 dnl Check for socket support for any2ppm daemon
91 AC_CHECK_HEADERS([fcntl.h unistd.h signal.h sys/stat.h sys/socket.h sys/poll.h sys/un.h])
93 dnl Check for infinite loops
94 AC_CHECK_FUNCS([alarm])
96 dnl check for CPU affinity support
97 AC_CHECK_HEADERS([sched.h], [AC_CHECK_FUNCS([sched_getaffinity])])
99 dnl check for mmap support
100 AC_CHECK_HEADERS([sys/mman.h], [AC_CHECK_FUNCS([mmap])])
102 dnl check for clock_gettime() support
103 AC_CHECK_HEADERS([time.h], [AC_CHECK_FUNCS([clock_gettime])])
105 dnl check for GNU-extensions to fenv
106 AC_CHECK_HEADER(fenv.h,
107         [AC_CHECK_FUNCS(feenableexcept fedisableexcept feclearexcept)])
109 dnl check for misc headers and functions
110 AC_CHECK_HEADERS([libgen.h byteswap.h signal.h setjmp.h fenv.h sys/wait.h])
111 AC_CHECK_FUNCS([ctime_r drand48 flockfile funlockfile getline link strndup])
113 dnl check for win32 headers (this detects mingw as well)
114 AC_CHECK_HEADERS([windows.h], have_windows=yes, have_windows=no)
117 dnl Possible headers for mkdir
118 AC_CHECK_HEADERS([sys/stat.h io.h])
119 AC_CHECK_FUNC(mkdir,
120               [AC_MSG_CHECKING([mkdir variant])
121               mkdir_variant="unknown"
122               save_CFLAGS="$CFLAGS"
123               CFLAGS=$WARN_CFLAGS
124               AC_TRY_COMPILE([
125 #ifdef HAVE_SYS_STAT_H
126 #include <sys/stat.h>
127 #endif
128 #ifdef HAVE_IO_H
129 #include <io.h>
130 #endif
131                       ],
132                       [mkdir ("hello.world", 0777)],
133                       mkdir_variant="mkdir(path, mode)",
134                       [AC_TRY_COMPILE([
135 #ifdef HAVE_SYS_STAT_H
136 #include <sys/stat.h>
137 #endif
138 #ifdef HAVE_IO_H
139 #include <io.h>
140 #endif
141                               ],
142                               [mkdir ("hello.world")],
143                               mkdir_variant="mkdir(path)")])
144               AC_MSG_RESULT([$mkdir_variant])
145               CFLAGS="$save_CFLAGS"
146               if test "x$mkdir_variant" = "xmkdir(path, mode)"; then
147                   AC_DEFINE(HAVE_MKDIR, 2,
148                             [Define to non-zero if your system has mkdir, and to 2 if your version of mkdir requires a mode parameter])
149               else
150                   AC_DEFINE(HAVE_MKDIR, 1,
151                             [Define to non-zero if your system has mkdir, and to 2 if your version of mkdir requires a mode parameter])
152               fi])
154 dnl ===========================================================================
156 dnl Test for the tools required for building one big test binary
159 AC_CHECK_FUNCS(fork waitpid raise)