]> granicus.if.org Git - postgresql/blob - config/c-library.m4
Throw error if Ant is not found and Java is requested. Remove redundant
[postgresql] / config / c-library.m4
1 # Macros that test various C library quirks
2 # $Header: /cvsroot/pgsql/config/c-library.m4,v 1.8 2001/01/22 23:28:50 tgl Exp $
3
4
5 # PGAC_VAR_INT_TIMEZONE
6 # ---------------------
7 # Check if the global variable `timezone' exists. If so, define
8 # HAVE_INT_TIMEZONE.
9 AC_DEFUN([PGAC_VAR_INT_TIMEZONE],
10 [AC_CACHE_CHECK(for int timezone, pgac_cv_var_int_timezone,
11 [AC_TRY_LINK([#include <time.h>
12 int res;],
13   [res = timezone / 60;],
14   [pgac_cv_var_int_timezone=yes],
15   [pgac_cv_var_int_timezone=no])])
16 if test x"$pgac_cv_var_int_timezone" = xyes ; then
17   AC_DEFINE(HAVE_INT_TIMEZONE,, [Set to 1 if you have the global variable timezone])
18 fi])# PGAC_VAR_INT_TIMEZONE
19
20
21 # PGAC_FUNC_GETTIMEOFDAY_1ARG
22 # ---------------------------
23 # Check if gettimeofday() has only one arguments. (Normal is two.)
24 # If so, define GETTIMEOFDAY_1ARG.
25 AC_DEFUN([PGAC_FUNC_GETTIMEOFDAY_1ARG],
26 [AC_CACHE_CHECK(whether gettimeofday takes only one argument,
27 pgac_cv_func_gettimeofday_1arg,
28 [AC_TRY_COMPILE([#include <sys/time.h>],
29 [struct timeval *tp;
30 struct timezone *tzp;
31 gettimeofday(tp,tzp);],
32 [pgac_cv_func_gettimeofday_1arg=no],
33 [pgac_cv_func_gettimeofday_1arg=yes])])
34 if test x"$pgac_cv_func_gettimeofday_1arg" = xyes ; then
35   AC_DEFINE(GETTIMEOFDAY_1ARG,, [Set to 1 if gettimeofday() takes only 1 argument])
36 fi])# PGAC_FUNC_GETTIMEOFDAY_1ARG
37
38
39 # PGAC_UNION_SEMUN
40 # ----------------
41 # Check if `union semun' exists. Define HAVE_UNION_SEMUN if so.
42 # If it doesn't then one could define it as
43 # union semun { int val; struct semid_ds *buf; unsigned short *array; }
44 AC_DEFUN([PGAC_UNION_SEMUN],
45 [AC_CACHE_CHECK(for union semun, pgac_cv_union_semun,
46 [AC_TRY_COMPILE([#include <sys/types.h>
47 #include <sys/ipc.h>
48 #include <sys/sem.h>],
49   [union semun semun;],
50   [pgac_cv_union_semun=yes],
51   [pgac_cv_union_semun=no])])
52 if test x"$pgac_cv_union_semun" = xyes ; then
53   AC_DEFINE(HAVE_UNION_SEMUN, 1, [Set to 1 if you have `union semun'])
54 fi])# PGAC_UNION_SEMUN
55
56
57 # PGAC_STRUCT_SOCKADDR_UN
58 # -----------------------
59 # If `struct sockaddr_un' exists, define HAVE_STRUCT_SOCKADDR_UN. If
60 # it is missing then one could define it as { short int sun_family;
61 # char sun_path[108]; }. (Requires test for <sys/un.h>!)
62 AC_DEFUN([PGAC_STRUCT_SOCKADDR_UN],
63 [AC_CACHE_CHECK([for struct sockaddr_un], pgac_cv_struct_sockaddr_un,
64 [AC_TRY_COMPILE([#include <sys/types.h>
65 #ifdef HAVE_SYS_UN_H
66 #include <sys/un.h>
67 #endif],
68                 [struct sockaddr_un un;],
69                 [pgac_cv_struct_sockaddr_un=yes],
70                 [pgac_cv_struct_sockaddr_un=no])])
71 if test x"$pgac_cv_struct_sockaddr_un" = xyes; then
72   AC_DEFINE(HAVE_STRUCT_SOCKADDR_UN, 1, [Set to 1 if you have `struct sockaddr_un'])
73 fi])# PGAC_STRUCT_SOCKADDR_UN
74
75
76 # PGAC_FUNC_POSIX_SIGNALS
77 # -----------------------
78 # Check to see if the machine has the POSIX signal interface. Define
79 # HAVE_POSIX_SIGNALS if so. Also set the output variable HAVE_POSIX_SIGNALS
80 # to yes or no.
81 #
82 # Note that this test only compiles a test program, it doesn't check
83 # whether the routines actually work. If that becomes a problem, make
84 # a fancier check.
85 AC_DEFUN([PGAC_FUNC_POSIX_SIGNALS],
86 [AC_CACHE_CHECK(for POSIX signal interface, pgac_cv_func_posix_signals,
87 [AC_TRY_LINK([#include <signal.h>
88 ],
89 [struct sigaction act, oact;
90 sigemptyset(&act.sa_mask);
91 act.sa_flags = SA_RESTART;
92 sigaction(0, &act, &oact);],
93 [pgac_cv_func_posix_signals=yes],
94 [pgac_cv_func_posix_signals=no])])
95 if test x"$pgac_cv_func_posix_signals" = xyes ; then
96   AC_DEFINE(HAVE_POSIX_SIGNALS,, [Set to 1 if you have the POSIX signal interface])
97 fi
98 HAVE_POSIX_SIGNALS=$pgac_cv_func_posix_signals
99 AC_SUBST(HAVE_POSIX_SIGNALS)])# PGAC_FUNC_POSIX_SIGNALS
100
101
102 # PGAC_HEADER_STRING
103 # ------------------
104 # Tests whether <string.h> and <strings.h> can both be included
105 # (without generating warnings).  This is mostly useful if you need
106 # str[n]casecmp(), since this is not in the "standard" <string.h>
107 # on some systems.
108 AC_DEFUN([PGAC_HEADER_STRING],
109 [AC_CACHE_CHECK([whether string.h and strings.h may both be included],
110                 [pgac_cv_header_strings_both],
111 [AC_TRY_CPP(
112 [#include <string.h>
113 #include <strings.h>
114 ],
115 [AC_TRY_COMPILE(
116 [#include <string.h>
117 #include <strings.h>
118 ],
119 [int n = strcasecmp("a", "b");],
120 [pgac_cv_header_strings_both=yes],
121 [pgac_cv_header_strings_both=no])],
122 [pgac_cv_header_strings_both=no])])
123 if test x"$pgac_cv_header_strings_both" = x"yes"; then
124   AC_DEFINE([STRING_H_WITH_STRINGS_H], 1,
125             [Define if string.h and strings.h may both be included])
126 fi])