root/configure.in

Revision 81ac86a15e3940ff0b787698853fb6a6157f800b, 4.3 kB (checked in by Theo Schlossnagle <jesus@omniti.com>, 7 years ago)

initial import with Ecelerity bits removed and some autoconf glue added in. Could certainly use some work on the build/install. Needs shared lib support for multiple platforms

  • Property mode set to 100755
Line 
1 AC_INIT(jlog.c)
2 AC_CONFIG_HEADER(jlog_config.h)
3
4 AC_PROG_CC
5 AC_C_INLINE
6 AC_C_BIGENDIAN
7 AC_PROG_CPP
8 AC_PROG_RANLIB
9 AC_PROG_INSTALL
10 AC_PROG_LN_S
11 AC_PATH_PROG(AR, ar)
12 AC_PATH_PROGS(PERL, perl)
13 AC_SUBST(PERL)
14
15 # Checks for data types
16 AC_CHECK_SIZEOF(char, 1)
17 AC_CHECK_SIZEOF(short int, 2)
18 AC_CHECK_SIZEOF(int, 4)
19 AC_CHECK_SIZEOF(long int, 4)
20 AC_CHECK_SIZEOF(long long int, 8)
21 AC_CHECK_SIZEOF(void *, 1)
22
23 AC_CHECK_LIB(rt, sem_init, , )
24 AC_CHECK_LIB(posix4, sem_wait, , )
25
26 AC_MSG_CHECKING([whether sem_init works])
27 AC_TRY_RUN(
28         [
29 #include <semaphore.h>
30 int main(void){sem_t s;return (0 != sem_init(&s,0,0));}
31         ],
32         [AC_MSG_RESULT(yes)],
33         [
34                 AC_MSG_RESULT(no)
35                 AC_DEFINE(BROKEN_SEM_INIT)
36                 AC_MSG_WARN([****** sem_init() is broken, I'll implement one myself.])
37         ]
38 )
39
40 AC_CHECK_LIB(rt, sem_init, , )
41 AC_FUNC_STRFTIME
42
43 # Checks for header files.
44 AC_CHECK_HEADERS(sys/file.h sys/types.h dirent.h sys/param.h fcntl.h errno.h limits.h \
45                  sys/resource.h pthread.h semaphore.h pwd.h stdio.h stdlib.h string.h \
46                  ctype.h unistd.h time.h sys/stat.h)
47
48 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
49         AC_TRY_COMPILE(
50                 [ #include <sys/types.h> ],
51                 [ u_int a; a = 1;],
52                 [ ac_cv_have_u_int="yes" ],
53                 [ ac_cv_have_u_int="no" ]
54         )
55 ])
56 if test "x$ac_cv_have_u_int" = "xyes" ; then
57         AC_DEFINE(HAVE_U_INT)
58         have_u_int=1
59 fi
60
61 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
62         AC_TRY_COMPILE(
63                 [ #include <sys/types.h> ],
64                 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
65                 [ ac_cv_have_intxx_t="yes" ],
66                 [ ac_cv_have_intxx_t="no" ]
67         )
68 ])
69 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
70         AC_DEFINE(HAVE_INTXX_T)
71         have_intxx_t=1
72 fi
73        
74 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
75         AC_TRY_COMPILE(
76                 [ #include <sys/types.h> ],
77                 [ int64_t a; a = 1;],
78                 [ ac_cv_have_int64_t="yes" ],
79                 [ ac_cv_have_int64_t="no" ]
80         )
81 ])
82 if test "x$ac_cv_have_int64_t" = "xyes" ; then
83         AC_DEFINE(HAVE_INT64_T)
84         have_int64_t=1
85 fi
86        
87 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
88         AC_TRY_COMPILE(
89                 [ #include <sys/types.h> ],
90                 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
91                 [ ac_cv_have_u_intxx_t="yes" ],
92                 [ ac_cv_have_u_intxx_t="no" ]
93         )
94 ])
95 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
96         AC_DEFINE(HAVE_U_INTXX_T)
97         have_u_intxx_t=1
98 fi
99
100 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
101         AC_TRY_COMPILE(
102                 [ #include <sys/types.h> ],
103                 [ u_int64_t a; a = 1;],
104                 [ ac_cv_have_u_int64_t="yes" ],
105                 [ ac_cv_have_u_int64_t="no" ]
106         )
107 ])
108 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
109         AC_DEFINE(HAVE_U_INT64_T)
110         have_u_int64_t=1
111 fi
112
113 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
114            test "x$ac_cv_header_sys_bitypes_h" = "xyes")
115 then
116         AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
117         AC_TRY_COMPILE(
118                 [
119 #include <sys/bitypes.h>
120                 ],
121                 [
122                         int8_t a; int16_t b; int32_t c;
123                         u_int8_t e; u_int16_t f; u_int32_t g;
124                         a = b = c = e = f = g = 1;
125                 ],
126                 [
127                         AC_DEFINE(HAVE_U_INTXX_T)
128                         AC_DEFINE(HAVE_INTXX_T)
129                         AC_MSG_RESULT(yes)
130                 ],
131                 [AC_MSG_RESULT(no)]
132         )
133 fi
134
135 if test -z "$have_u_intxx_t" ; then
136         AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
137                 AC_TRY_COMPILE(
138                         [
139 #include <sys/types.h>
140                         ],
141                         [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
142                         [ ac_cv_have_uintxx_t="yes" ],
143                         [ ac_cv_have_uintxx_t="no" ]
144                 )
145         ])
146         if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
147                 AC_DEFINE(HAVE_UINTXX_T)
148         fi
149 fi
150
151 AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, [
152         AC_TRY_COMPILE(
153                 [
154 #include <sys/types.h>
155 #include <sys/socket.h>
156                 ],
157                 [socklen_t foo; foo = 1235;],
158                 [ ac_cv_have_socklen_t="yes" ],
159                 [ ac_cv_have_socklen_t="no" ]
160         )
161 ])
162 if test "x$ac_cv_have_socklen_t" = "xyes" ; then
163         AC_DEFINE(HAVE_SOCKLEN_T)
164 fi
165
166 AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
167         AC_TRY_COMPILE(
168                 [
169 #include <sys/types.h>
170                 ],
171                 [ size_t foo; foo = 1235; ],
172                 [ ac_cv_have_size_t="yes" ],
173                 [ ac_cv_have_size_t="no" ]
174         )
175 ])
176 if test "x$ac_cv_have_size_t" = "xyes" ; then
177         AC_DEFINE(HAVE_SIZE_T)
178 fi
179
180 AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
181         AC_TRY_COMPILE(
182                 [
183 #include <sys/types.h>
184                 ],
185                 [ ssize_t foo; foo = 1235; ],
186                 [ ac_cv_have_ssize_t="yes" ],
187                 [ ac_cv_have_ssize_t="no" ]
188         )
189 ])
190 if test "x$ac_cv_have_ssize_t" = "xyes" ; then
191         AC_DEFINE(HAVE_SSIZE_T)
192 fi
193
194 docdir="docs"
195 mansubdir="man"
196 AC_SUBST(docdir)
197 AC_SUBST(mansubdir)
198
199 AC_OUTPUT([
200 Makefile
201 ])
Note: See TracBrowser for help on using the browser.