hid/gtk (GL): I think the polygon renderer works in mask mode now
[geda-pcb/pcjc2.git] / configure.ac.system
blob3f6ab7e2d44af88d65c16fd1bba9e0dd54d49b14
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, [RT_LIBS=-lrt], [RT_LIBS=])
57 CAIROPERF_LIBS=$RT_LIBS
58 AC_SUBST(CAIROPERF_LIBS)
60 has_shm_open=
61 AC_CHECK_LIB(rt, shm_open, [
62              SHM_LIBS=-lrt
63              has_shm_open=yes
64              ], [SHM_LIBS=])
65 AM_CONDITIONAL(HAVE_SHM, test "x$has_shm_open" = "xyes")
66 AC_SUBST(SHM_LIBS)
68 AC_CHECK_LIB(socket, connect, [SOCKET_LIBS=-lsocket], [SOCKET_LIBS=])
69 CAIROBOILERPLATE_LIBS=$SOCKET_LIBS
70 AC_SUBST(CAIROBOILERPLATE_LIBS)
72 dnl ====================================================================
73 dnl Header/function checks
74 dnl ====================================================================
76 dnl check if we have a __builtin_return_address for the cairo-trace
77 dnl utility.
78 AC_MSG_CHECKING([for __builtin_return_address(0)])
79 AC_TRY_COMPILE([],[__builtin_return_address(0);],
80                 [have_builtin_return_address=yes],
81                 [have_builtin_return_address=no])
82 AC_MSG_RESULT($have_builtin_return_address)
83 if test "x$have_builtin_return_address" = "xyes"; then
84     AC_DEFINE(HAVE_BUILTIN_RETURN_ADDRESS, 1,
85         [Define to 1 if your compiler supports the __builtin_return_address() intrinsic.])
88 dnl Checks for precise integer types
89 AC_CHECK_HEADERS([stdint.h inttypes.h sys/int_types.h])
90 AC_CHECK_TYPES([uint64_t, uint128_t, __uint128_t])
92 dnl Check for socket support for any2ppm daemon
93 AC_CHECK_HEADERS([fcntl.h unistd.h signal.h sys/stat.h sys/socket.h sys/poll.h sys/un.h])
95 dnl Check for infinite loops
96 AC_CHECK_FUNCS([alarm])
98 dnl check for CPU affinity support
99 AC_CHECK_HEADERS([sched.h], [AC_CHECK_FUNCS([sched_getaffinity])])
101 dnl check for mmap support
102 AC_CHECK_HEADERS([sys/mman.h], [AC_CHECK_FUNCS([mmap])])
104 dnl check for clock_gettime() support
105 save_LIBS="$LIBS"
106 LIBS="$LIBS $RT_LIBS"
107 AC_CHECK_HEADERS([time.h], [AC_CHECK_FUNCS([clock_gettime])])
108 LIBS="$save_LIBS"
110 dnl check for GNU-extensions to fenv
111 AC_CHECK_HEADER(fenv.h,
112         [AC_CHECK_FUNCS(feenableexcept fedisableexcept feclearexcept)])
114 dnl check for misc headers and functions
115 AC_CHECK_HEADERS([libgen.h byteswap.h signal.h setjmp.h fenv.h])
116 AC_CHECK_FUNCS([vasnprintf link ctime_r drand48 flockfile ffs])
118 dnl check for win32 headers (this detects mingw as well)
119 AC_CHECK_HEADERS([windows.h], have_windows=yes, have_windows=no)
122 dnl Possible headers for mkdir
123 AC_CHECK_HEADERS([sys/stat.h io.h])
124 AC_CHECK_FUNC(mkdir,
125               [AC_MSG_CHECKING([mkdir variant])
126               mkdir_variant="unknown"
127               save_CFLAGS="$CFLAGS"
128               CFLAGS=$WARN_CFLAGS
129               AC_TRY_COMPILE([
130 #ifdef HAVE_SYS_STAT_H
131 #include <sys/stat.h>
132 #endif
133 #ifdef HAVE_IO_H
134 #include <io.h>
135 #endif
136                       ],
137                       [mkdir ("hello.world", 0777)],
138                       mkdir_variant="mkdir(path, mode)",
139                       [AC_TRY_COMPILE([
140 #ifdef HAVE_SYS_STAT_H
141 #include <sys/stat.h>
142 #endif
143 #ifdef HAVE_IO_H
144 #include <io.h>
145 #endif
146                               ],
147                               [mkdir ("hello.world")],
148                               mkdir_variant="mkdir(path)")])
149               AC_MSG_RESULT([$mkdir_variant])
150               CFLAGS="$save_CFLAGS"
151               if test "x$mkdir_variant" = "xmkdir(path, mode)"; then
152                   AC_DEFINE(HAVE_MKDIR, 2,
153                             [Define to non-zero if your system has mkdir, and to 2 if your version of mkdir requires a mode parameter])
154               else
155                   AC_DEFINE(HAVE_MKDIR, 1,
156                             [Define to non-zero if your system has mkdir, and to 2 if your version of mkdir requires a mode parameter])
157               fi])
159 dnl ===========================================================================
161 dnl Test for the tools required for building one big test binary
164 AC_CHECK_FUNCS(fork waitpid raise)