Commit | Line | Data |
---|---|---|
3a629497 JB |
1 | dnl On the NeXT, #including <utime.h> doesn't give you a definition for |
2 | dnl struct utime, unless you #define _POSIX_SOURCE. | |
3 | ||
4 | AC_DEFUN(GUILE_STRUCT_UTIMBUF, [ | |
5 | AC_CACHE_CHECK([whether we need POSIX to get struct utimbuf], | |
6 | guile_cv_struct_utimbuf_needs_posix, | |
7 | [AC_TRY_CPP([ | |
8 | #ifdef __EMX__ | |
9 | #include <sys/utime.h> | |
10 | #else | |
11 | #include <utime.h> | |
12 | #endif | |
13 | struct utime blah; | |
14 | ], | |
15 | guile_cv_struct_utimbuf_needs_posix=no, | |
16 | guile_cv_struct_utimbuf_needs_posix=yes)]) | |
17 | if test "$guile_cv_struct_utimbuf_needs_posix" = yes; then | |
18 | AC_DEFINE(UTIMBUF_NEEDS_POSIX) | |
19 | fi]) | |
20 | ||
21 | ||
22 | ||
23 | ||
24 | dnl | |
25 | dnl Apparently, at CMU they have a weird version of libc.h that is | |
26 | dnl installed in /usr/local/include and conflicts with unistd.h. | |
27 | dnl In these situations, we should not #include libc.h. | |
28 | dnl This test arranges to #define LIBC_H_WITH_UNISTD_H iff libc.h is | |
29 | dnl present on the system, and is safe to #include. | |
30 | dnl | |
31 | AC_DEFUN([GUILE_HEADER_LIBC_WITH_UNISTD], | |
32 | [ | |
33 | AC_CHECK_HEADERS(libc.h unistd.h) | |
34 | AC_CACHE_CHECK( | |
35 | "whether libc.h and unistd.h can be included together", | |
36 | guile_cv_header_libc_with_unistd, | |
37 | [ | |
38 | if test "$ac_cv_header_libc_h" = "no"; then | |
39 | guile_cv_header_libc_with_unistd="no" | |
40 | elif test "$ac_cv_header_unistd.h" = "no"; then | |
41 | guile_cv_header_libc_with_unistd="yes" | |
42 | else | |
43 | AC_TRY_COMPILE( | |
44 | [ | |
45 | # include <libc.h> | |
46 | # include <unistd.h> | |
47 | ], | |
48 | [], | |
49 | [guile_cv_header_libc_with_unistd=yes], | |
50 | [guile_cv_header_libc_with_unistd=no] | |
51 | ) | |
52 | fi | |
53 | ] | |
54 | ) | |
55 | if test "$guile_cv_header_libc_with_unistd" = yes; then | |
56 | AC_DEFINE(LIBC_H_WITH_UNISTD_H) | |
57 | fi | |
58 | ] | |
59 | ) |