root/configure.in

Revision 8a4a328d0018719687638b5a2fc4c8b147efb1c4, 15.0 kB (checked in by Theo Schlossnagle <jesus@omniti.com>, 5 years ago)

first whack at correct version on export

  • Property mode set to 100755
Line 
1 AC_INIT(src/noitd.c)
2
3 node=`hostname | cut -f1 -d '.' | tr '[A-Z]' '[a-z]'`
4 if test -f ".configure.$node"; then
5         echo "***********************************************************"
6         echo "* Loading node specific configure settings for $node."
7         echo "***********************************************************"
8         . ./.configure.$node
9 fi
10
11 AC_CANONICAL_HOST
12 AC_CONFIG_HEADER(src/noit_config.h)
13 AC_CONFIG_HEADER(src/jlog/jlog_config.h)
14
15 AC_PROG_CC
16 AC_C_INLINE
17 AC_C_BIGENDIAN
18 AC_PROG_CPP
19 AC_PROG_RANLIB
20 AC_PROG_INSTALL
21 AC_PROG_LN_S
22 AC_PATH_PROG(AR, ar)
23 AC_PATH_PROGS(PERL, perl)
24 AC_PATH_PROGS(XSLTPROC, xsltproc)
25 AC_PATH_PROGS(XMLLINT, xmllint)
26 AC_PATH_PROGS(JAVA, java)
27 AC_PATH_PROGS(JAVAC, javac)
28 AC_PATH_PROGS(JAR, jar)
29 AC_PATH_PROG(NROFF, nroff)
30 AC_SUBST(PERL)
31
32 if test "x$CC" = "xgcc" ; then
33   CFLAGS="$CFLAGS -g -Wall"
34 else
35   CFLAGS="$CFLAGS -g"
36 fi
37
38 CPPFLAGS="$CPPFLAGS "'-I$(top_srcdir)/src'
39
40 case $host in
41 *-*-darwin*)
42         DTRACE=/usr/sbin/dtrace
43         DTRACEHDR=dtrace_probes.h
44         DTRACE_ENABLED=1
45         PICFLAGS="-fPIC"
46         MODULELD="$CC -bundle -flat_namespace -undefined suppress"
47         SHLD="$CC -dynamiclib -flat_namespace -undefined suppress"
48         MODULEEXT=bundle
49         RLDFLAG="-Wl,--rpath="
50         ;;
51 *-*-solaris*)
52         DTRACE=/usr/sbin/dtrace
53         DTRACEHDR=dtrace_probes.h
54         DTRACE_ENABLED=1
55         DTRACEOBJ=dtrace_stub.o
56         AC_MSG_CHECKING([32 or 64 bit Solaris assembly])
57         if test -n "`echo $CFLAGS | grep m64`"; then
58                 AC_MSG_RESULT([64])
59                 DTRACEFLAGS=-64
60                 ATOMIC_OBJS="noit_atomic_sol_x86_64.o"
61         else
62                 AC_MSG_RESULT([32])
63                 ATOMIC_OBJS="noit_atomic_sol_x86_32.o"
64         fi
65         if test "x$CC" != "xgcc" ; then
66                 CFLAGS="$CFLAGS -mt"
67         fi
68         PICFLAGS="-Kpic"
69         MODULELD="$CC -G"
70         SHLD="$CC -G"
71         MODULEEXT=so
72         RLDFLAG="-R"
73         WHOLE_ARCHIVE="-Wl,-z -Wl,allextract"
74         NOWHOLE_ARCHIVE="-Wl,-z -Wl,defaultextract"
75         ;;
76 *-*-openbsd*)
77         PICFLAGS="-fpic"
78         LDFLAGS="$LDFLAGS -Wl,-E"
79         MODULELD="$CC -shared"
80         SHLD="$CC -shared"
81         MODULEEXT=so
82         LDFLAGS="$LDFLAGS -L/usr/local/lib"
83         CFLAGS="$CFLAGS -I/usr/local/include"
84         RLDFLAG="-Wl,--rpath="
85         WHOLE_ARCHIVE="-Wl,--whole-archive"
86         NOWHOLE_ARCHIVE="-Wl,--no-whole-archive"
87         ;;
88 *-*-linux*)
89         LDFLAGS="$LDFLAGS -Wl,-E"
90         CPPFLAGS="$CPPFLAGS"
91         PICFLAGS="-fpic"
92         MODULELD="$CC -shared"
93         SHLD="$CC -shared"
94         MODULEEXT=so
95         RLDFLAG="-Wl,--rpath="
96         WHOLE_ARCHIVE="-Wl,--whole-archive"
97         NOWHOLE_ARCHIVE="-Wl,--no-whole-archive"
98         ;;
99 *-*-freebsd*)
100         PICFLAGS="-fpic"
101         MODULELD="$CC -shared"
102         LDFLAGS="$LDFLAGS -export-dynamic -L/usr/local/lib"
103         CFLAGS="$CFLAGS -I/usr/local/include"
104         MODULEEXT=so
105         RLDFLAG="-Wl,--rpath="
106         ;;
107 *)
108         PICFLAGS="-fpic"
109         MODULELD="$CC -shared"
110         MODULEEXT=so
111         RLDFLAG="-Wl,--rpath="
112         ;;
113 esac
114 AC_SUBST(DTRACE)
115 AC_SUBST(DTRACE_ENABLED)
116 if [ "$DTRACE_ENABLED" == "1" ]; then
117         AC_DEFINE(DTRACE_ENABLED)
118 fi
119 AC_SUBST(DTRACEOBJ)
120 AC_SUBST(DTRACEFLAGS)
121 AC_SUBST(SHLD)
122 AC_SUBST(RLDFLAG)
123 AC_SUBST(MODULELD)
124 AC_SUBST(MODULEEXT)
125 AC_SUBST(WHOLE_ARCHIVE)
126 AC_SUBST(NOWHOLE_ARCHIVE)
127 AC_SUBST(ATOMIC_OBJS)
128 AC_DEFINE_UNQUOTED(MODULEEXT, "$MODULEEXT", [module extension])
129 AC_MSG_CHECKING([enable build/install of the Java IEP bits])
130
131 if test -z "$ac_cv_path_JAVA" ; then
132         AC_MSG_RESULT([no])
133 else
134         JAVAPARTS=java
135         AC_MSG_RESULT([yes])
136 fi
137 AC_SUBST(JAVAPARTS)
138
139 NOIT_FALLBACK_VERSION=`echo '$Revision$ | awk '{print $2;}'`
140 NOIT_SVNVERSION=`svnversion`
141 if [ "x$NOIT_SVNVERSION" = "xexported" ]; then
142         NOIT_SVNVERSION="$NOIT_FALLBACK_VERSION"
143 fi
144 AC_DEFINE_UNQUOTED(NOIT_SVNVERSION, "$NOIT_SVNVERSION", [svn version from wc])
145
146 # Checks for data types
147 AC_CHECK_SIZEOF(char, 1)
148 AC_CHECK_SIZEOF(short int, 2)
149 AC_CHECK_SIZEOF(int, 4)
150 AC_CHECK_SIZEOF(long int, 4)
151 AC_CHECK_SIZEOF(long long int, 8)
152 AC_CHECK_SIZEOF(void *, 1)
153
154 AC_CHECK_LIB(z, compress2, , [AC_MSG_ERROR(*** zlib is required ***)])
155 AC_CHECK_LIB(rt, sem_init, , )
156 AC_CHECK_LIB(posix4, sem_wait, , )
157 AC_CHECK_LIB(pthread, pthread_create, , )
158 AC_CHECK_FUNC(uuid_generate, , [
159   AC_MSG_WARN([uuid_generate not available])
160   AC_CHECK_LIB(uuid, uuid_generate, , [AC_MSG_ERROR(*** uuid is required ***)])])
161
162 # Some libraries provide an unparse_lower command
163 # we use that, so if it isn't present, we'll need
164 # to implement it.
165 AC_CHECK_FUNC(uuid_unparse_lower, [AC_DEFINE(HAVE_UUID_UNPARSE_LOWER)], )
166 AC_CHECK_LIB(util, openpty, , )
167 AC_CHECK_LIB(termcap, tputs, , )
168 AC_CHECK_LIB(curses, clear, , [AC_MSG_ERROR([curses not found, but required])])
169
170 CPPFLAGS="$CPPFLAGS `pcre-config --cflags`"
171 LDFLAGS="$LDFLAGS `pcre-config --libs`"
172 AC_CHECK_LIB(pcre, pcre_compile, ,
173         [
174                 AC_MSG_ERROR([libpcre not found, but required])
175         ]
176 )
177 AC_CHECK_LIB(crypto, ERR_load_CRYPTO_strings, ,
178         [
179                 AC_MSG_ERROR([libcrypto not found, but required])
180         ]
181 )
182 AC_CHECK_LIB(ssl, SSL_library_init, ,
183         [
184                 AC_MSG_ERROR([libssl not found, but required])
185         ]
186 )
187
188 old_LIBS=$LIBS
189 old_CFLAGS=$CFLAGS
190 AC_CHECK_LIB(pq, PQconnectdb,
191         [
192                 LIBS="$LIBS -lpq"
193                 PGLIBS="$LIBS"
194                 AC_SUBST(PGLIBS)
195         ],
196         [
197                 AC_MSG_ERROR([libpq required])
198         ]
199 )
200
201 AC_MSG_CHECKING([libpq includes])
202 PQICFLAGS=`pg_config --includedir`
203 if test -n "$PQICFLAGS" ; then
204   CFLAGS="$CFLAGS -I$PQICFLAGS"
205 fi
206
207 AC_TRY_LINK([
208         #include <libpq-fe.h>
209         ],
210         [ PGconn *dbh = PQconnectdb(""); ],
211         [],
212         [ AC_MSG_ERROR([Cannot compile/link against libpq]) ]
213 )
214 PGCFLAGS=$CFLAGS
215 AC_SUBST(PGCFLAGS)
216
217 AC_CHECK_HEADERS(mysql.h mysql/mysql.h)
218
219 if test "$ac_cv_header_mysql_h" = "no" -a "$ac_cv_header_mysql_mysql_h" = "no" ; then
220         AC_MSG_WARN([No libmysqlclient, skipping mysql module])
221         AC_SUBST(MYCFLAGS)
222         AC_SUBST(MYLIBS)
223 else
224         LIBS=$old_LIBS
225         CFLAGS=$old_CFLAGS
226        
227         if test -z "$MYLIBS" ; then
228           MYLIBS="-lmysqlclient_r -lz -lssl -lcrypto"
229         fi
230        
231         old_CFLAGS=$CFLAGS
232         old_LIBS=$LIBS
233         CFLAGS="$CFLAGS $MYCFLAGS"
234         LIBS="$MYLIBS"
235        
236         AC_CHECK_FUNC(mysql_real_connect,
237                 [
238                         BUILD_MODULES="$BUILD_MODULES mysql.$MODULEEXT"
239                         MYCFLAGS="$CFLAGS"
240                         MYLIBS="$LIBS"
241                         AC_SUBST(MYCFLAGS)
242                         AC_SUBST(MYLIBS)
243                 ],
244                 [
245                         AC_MSG_WARN([No libmysqlclient, skipping mysql module])
246                         AC_SUBST(MYCFLAGS)
247                         AC_SUBST(MYLIBS)
248                 ]
249         )
250        
251        
252         LIBS=$old_LIBS
253         CFLAGS=$old_CFLAGS
254 fi
255
256 ########
257 #
258 # CHECK FOR VARIOUS MODULE CRITERIA
259 # We don't track the libs themselves, as we'll just explictly link
260 # against the in the makefile if we enable them to build (by adding
261 # them to the BUILD_MODULES list).
262 #
263 ########
264
265 # Should we build snmp checks?
266 AC_CHECK_HEADERS(net-snmp/net-snmp-config.h)
267 if test "$ac_cv_header_net_snmp_net_snmp_config_h" = "yes" ; then
268 SAVELIBS="$LIBS"
269 AC_CHECK_LIB(netsnmp, snmp_sess_open,
270         [
271                 BUILD_MODULES="$BUILD_MODULES snmp.$MODULEEXT"
272         ],
273         [
274                 AC_MSG_WARN([No libnetsnmp, skipping snmp module])
275         ]
276 )
277 LIBS="$SAVELIBS"
278 else
279         AC_MSG_WARN([No libnetsnmp, skipping snmp module])
280 fi
281
282 # Should we build ssh2 checks?
283 SAVELIBS="$LIBS"
284 AC_CHECK_LIB(ssh2, libssh2_session_init_ex,
285         [
286                 BUILD_MODULES="$BUILD_MODULES ssh2.$MODULEEXT"
287         ],
288         [
289                 AC_MSG_WARN([No libssh2, skipping ssh2 module])
290         ]
291 )
292 LIBS="$SAVELIBS"
293
294 AC_MSG_CHECKING([libxml2 cflags])
295 XML2CFLAGS=`xml2-config --cflags`
296 CFLAGS="$CFLAGS $XML2CFLAGS"
297 AC_MSG_RESULT([$XML2CFLAGS])
298
299 AC_MSG_CHECKING([libxml2 libs])
300 XML2LIBS=`xml2-config --libs`
301 LIBS="$LIBS $XML2LIBS"
302 AC_MSG_RESULT([$XML2LIBS])
303
304 AC_CHECK_FUNC(xmlParseDocument, , [AC_MSG_ERROR(*** libxml2 is required ***)])
305
306 AC_MSG_CHECKING([libxslt cflags])
307 XSLTCFLAGS=`xslt-config --cflags`
308 CFLAGS="$CFLAGS $XSLTCFLAGS"
309 AC_MSG_RESULT([$XSLTCFLAGS])
310
311 AC_MSG_CHECKING([libxslt libs])
312 XSLTLIBS=`xslt-config --libs`
313 LIBS="$LIBS $XSLTLIBS"
314 AC_MSG_RESULT([$XSLTLIBS])
315
316 AC_CHECK_FUNC(xsltParseStylesheetDoc, , [AC_MSG_ERROR(*** libxslt is required ***)])
317
318 APRPREFIX="`apr-1-config --prefix`"
319 AC_SUBST(APRPREFIX)
320 AC_MSG_RESULT([$APRPREFIX])
321
322 AC_MSG_CHECKING([libapr cflags])
323 APRCFLAGS="`apr-1-config --cflags --cppflags --includes`"
324 AC_SUBST(APRCFLAGS)
325 AC_MSG_RESULT([$APRCFLAGS])
326
327 AC_MSG_CHECKING([libapr libs])
328 APRLIBS="`apr-1-config --link-ld --ldflags --libs`"
329 AC_SUBST(APRLIBS)
330 AC_MSG_RESULT([$APRLIBS])
331
332 AC_TRY_LINK([],
333         [ issetugid(); ],
334         [ ac_cv_libc_defines_issetugid="yes" ],
335         [ ac_cv_libc_defines_issetugid="no" ]
336 )
337 if test "x$ac_cv_libc_defines_issetugid" = "xyes" ; then
338         AC_DEFINE(HAVE_ISSETUGID)
339 fi
340
341 AC_MSG_CHECKING([whether sem_init works])
342 AC_TRY_RUN(
343         [
344 #include <semaphore.h>
345 int main(void){sem_t s;return (0 != sem_init(&s,0,0));}
346         ],
347         [
348                 AC_MSG_RESULT(yes)
349                 AC_DEFINE(WORKING_SEM_INIT)
350         ],
351         [
352                 AC_MSG_RESULT(no)
353                 AC_MSG_WARN([****** sem_init() is broken, I'll implement one myself.])
354         ]
355 )
356
357 AC_FUNC_STRFTIME
358 AC_CHECK_FUNCS(ssetugid strlcpy strnstrn openpty inet_pton inet_ntop getopt \
359                poll)
360
361 # Checks for header files.
362 AC_CHECK_HEADERS(sys/file.h sys/types.h dirent.h sys/param.h fcntl.h errno.h limits.h \
363                  sys/resource.h pthread.h semaphore.h pwd.h stdio.h stdlib.h string.h \
364                  ctype.h unistd.h time.h pty.h sys/stat.h sys/event.h libkern/OSAtomic.h \
365                  term.h termio.h termios.h curses.h sys/cdefs.h grp.h netinet/in_systm.h \
366                  sys/ioctl_compat.h sys/filio.h util.h sys/time.h sys/mman.h \
367                  stropts.h sys/stream.h alloca.h sys/wait.h)
368
369 AC_CHECK_FUNCS(getpwnam_r)
370 GETPWNAM_R_POSIX
371 AC_CHECK_FUNCS(getgrnam_r)
372 GETGRNAM_R_POSIX
373
374 AC_MSG_CHECKING(for tputs() function final argument type)
375 AC_EGREP_CPP([tputs.*[(][       ]*char[         ]*[)]],
376                 [#if defined(HAVE_TERM_H)
377                  #include <term.h>
378                  #endif
379                  #if defined(HAVE_CURSES_H)
380                  #include <curses.h>
381                  #endif],
382                 [AC_MSG_RESULT(char)
383                  AC_DEFINE(TPUTS_TAKES_CHAR)],
384                 [AC_MSG_RESULT(not char)])
385
386 AC_CACHE_CHECK([for epoll support], ac_cv_have_epoll, [
387         AC_TRY_LINK(
388                 [ #include <sys/types.h> ],
389                 [ u_int a; a = epoll_create(); ],
390                 [ ac_cv_have_epoll="yes" ],
391                 [ ac_cv_have_epoll="no" ]
392         )
393 ])
394 if test "x$ac_cv_have_epoll" = "xyes" ; then
395         AC_DEFINE(HAVE_EPOLL)
396         EVENTER_OBJS="$EVENTER_OBJS eventer_epoll_impl.o"
397         AC_DEFINE_UNQUOTED(DEFAULT_EVENTER, "epoll")
398         have_epoll=1
399 fi
400
401 AC_CACHE_CHECK([for kqueue support], ac_cv_have_kqueue, [
402         AC_TRY_LINK(
403                 [ #include <sys/types.h> ],
404                 [ u_int a; a = kqueue(); ],
405                 [ ac_cv_have_kqueue="yes" ],
406                 [ ac_cv_have_kqueue="no" ]
407         )
408 ])
409 if test "x$ac_cv_have_kqueue" = "xyes" ; then
410         AC_DEFINE(HAVE_KQUEUE)
411         EVENTER_OBJS="$EVENTER_OBJS eventer_kqueue_impl.o"
412         AC_DEFINE_UNQUOTED(DEFAULT_EVENTER, "kqueue")
413         have_kqueue=1
414 fi
415
416 AC_CACHE_CHECK([for Solaris ports support], ac_cv_have_ports, [
417         AC_TRY_LINK(
418                 [ #include <port.h> ],
419                 [ u_int a; a = port_create(); ],
420                 [ ac_cv_have_ports="yes" ],
421                 [ ac_cv_have_ports="no" ]
422         )
423 ])
424 if test "x$ac_cv_have_ports" = "xyes" ; then
425         AC_DEFINE(HAVE_PORTS)
426         EVENTER_OBJS="$EVENTER_OBJS eventer_ports_impl.o"
427         AC_DEFINE_UNQUOTED(DEFAULT_EVENTER, "ports")
428         have_ports=1
429 fi
430
431 AC_SUBST(EVENTER_OBJS)
432
433 AC_CACHE_CHECK([for posix_readdir_r], ac_cv_have_posix_readdir_r, [
434         AC_TRY_COMPILE(
435                 [ #include <dirent.h> ],
436                 [ struct dirent *dep, de; readdir_r("/", &de, &dep); ],
437                 [ ac_cv_have_posix_readdir_r="yes" ],
438                 [ ac_cv_have_posix_readdir_r="no" ]
439         )
440 ])
441 if test "x$ac_cv_have_posix_readdir_r" = "xyes" ; then
442         AC_DEFINE(HAVE_POSIX_READDIR_R)
443         have_posix_readdir_r=1
444 fi
445
446 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
447         AC_TRY_COMPILE(
448                 [ #include <sys/types.h> ],
449                 [ u_int a; a = 1;],
450                 [ ac_cv_have_u_int="yes" ],
451                 [ ac_cv_have_u_int="no" ]
452         )
453 ])
454 if test "x$ac_cv_have_u_int" = "xyes" ; then
455         AC_DEFINE(HAVE_U_INT)
456         have_u_int=1
457 fi
458
459 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
460         AC_TRY_COMPILE(
461                 [ #include <sys/types.h> ],
462                 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
463                 [ ac_cv_have_intxx_t="yes" ],
464                 [ ac_cv_have_intxx_t="no" ]
465         )
466 ])
467 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
468         AC_DEFINE(HAVE_INTXX_T)
469         have_intxx_t=1
470 fi
471        
472 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
473         AC_TRY_COMPILE(
474                 [ #include <sys/types.h> ],
475                 [ int64_t a; a = 1;],
476                 [ ac_cv_have_int64_t="yes" ],
477                 [ ac_cv_have_int64_t="no" ]
478         )
479 ])
480 if test "x$ac_cv_have_int64_t" = "xyes" ; then
481         AC_DEFINE(HAVE_INT64_T)
482         have_int64_t=1
483 fi
484        
485 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
486         AC_TRY_COMPILE(
487                 [ #include <sys/types.h> ],
488                 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
489                 [ ac_cv_have_u_intxx_t="yes" ],
490                 [ ac_cv_have_u_intxx_t="no" ]
491         )
492 ])
493 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
494         AC_DEFINE(HAVE_U_INTXX_T)
495         have_u_intxx_t=1
496 fi
497
498 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
499         AC_TRY_COMPILE(
500                 [ #include <sys/types.h> ],
501                 [ u_int64_t a; a = 1;],
502                 [ ac_cv_have_u_int64_t="yes" ],
503                 [ ac_cv_have_u_int64_t="no" ]
504         )
505 ])
506 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
507         AC_DEFINE(HAVE_U_INT64_T)
508         have_u_int64_t=1
509 fi
510
511 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
512            test "x$ac_cv_header_sys_bitypes_h" = "xyes")
513 then
514         AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
515         AC_TRY_COMPILE(
516                 [
517 #include <sys/bitypes.h>
518                 ],
519                 [
520                         int8_t a; int16_t b; int32_t c;
521                         u_int8_t e; u_int16_t f; u_int32_t g;
522                         a = b = c = e = f = g = 1;
523                 ],
524                 [
525                         AC_DEFINE(HAVE_U_INTXX_T)
526                         AC_DEFINE(HAVE_INTXX_T)
527                         AC_MSG_RESULT(yes)
528                 ],
529                 [AC_MSG_RESULT(no)]
530         )
531 fi
532
533 if test -z "$have_u_intxx_t" ; then
534         AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
535                 AC_TRY_COMPILE(
536                         [
537 #include <sys/types.h>
538                         ],
539                         [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
540                         [ ac_cv_have_uintxx_t="yes" ],
541                         [ ac_cv_have_uintxx_t="no" ]
542                 )
543         ])
544         if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
545                 AC_DEFINE(HAVE_UINTXX_T)
546         fi
547 fi
548
549 AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, [
550         AC_TRY_COMPILE(
551                 [
552 #include <sys/types.h>
553 #include <sys/socket.h>
554                 ],
555                 [socklen_t foo; foo = 1235;],
556                 [ ac_cv_have_socklen_t="yes" ],
557                 [ ac_cv_have_socklen_t="no" ]
558         )
559 ])
560 if test "x$ac_cv_have_socklen_t" = "xyes" ; then
561         AC_DEFINE(HAVE_SOCKLEN_T)
562 fi
563
564 AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
565         AC_TRY_COMPILE(
566                 [
567 #include <sys/types.h>
568                 ],
569                 [ size_t foo; foo = 1235; ],
570                 [ ac_cv_have_size_t="yes" ],
571                 [ ac_cv_have_size_t="no" ]
572         )
573 ])
574 if test "x$ac_cv_have_size_t" = "xyes" ; then
575         AC_DEFINE(HAVE_SIZE_T)
576 fi
577
578 AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
579         AC_TRY_COMPILE(
580                 [
581 #include <sys/types.h>
582                 ],
583                 [ ssize_t foo; foo = 1235; ],
584                 [ ac_cv_have_ssize_t="yes" ],
585                 [ ac_cv_have_ssize_t="no" ]
586         )
587 ])
588 if test "x$ac_cv_have_ssize_t" = "xyes" ; then
589         AC_DEFINE(HAVE_SSIZE_T)
590 fi
591
592 AC_SUBST(BUILD_MODULES)
593
594 docdir="docs"
595 mansubdir="man"
596 AC_SUBST(docdir)
597 AC_SUBST(mansubdir)
598 SHCFLAGS="$PICFLAGS $CFLAGS"
599 AC_SUBST(SHCFLAGS)
600
601 AC_MSG_CHECKING([Resolving libexec path...])
602 fullpath=$libexecdir
603 while test "x$temppath" != "x$fullpath" ; do
604   temppath=$fullpath
605   fullpath=`eval echo ${fullpath}`
606 done
607 fullpath=`echo $fullpath | sed "s~NONE~$ac_default_prefix~"`
608 AC_MSG_RESULT([$fullpath/noit])
609 AC_DEFINE_UNQUOTED(MODULES_DIR, "${fullpath}/noit")
610 MODULES_DIR=${fullpath}/noit
611 AC_SUBST(MODULES_DIR)
612
613 AC_MSG_CHECKING([Resolving sysconfdir path...])
614 fullpath=$sysconfdir
615 while test "x$temppath" != "x$fullpath" ; do
616   temppath=$fullpath
617   fullpath=`eval echo ${fullpath}`
618 done
619 fullpath=`echo $fullpath | sed "s~NONE~$ac_default_prefix~"`
620 AC_MSG_RESULT([$fullpath])
621 AC_DEFINE_UNQUOTED(ETC_DIR, "${fullpath}")
622 ETC_DIR=${fullpath}
623 AC_SUBST(ETC_DIR)
624
625
626 AC_OUTPUT([
627 Makefile
628 src/Makefile
629 src/eventer/Makefile
630 src/jlog/Makefile
631 src/jlog/perl/Makefile.PL
632 src/udns/Makefile
633 src/man/Makefile
634 src/modules/Makefile
635 src/modules-lua/Makefile
636 src/utils/Makefile
637 src/noitedit/Makefile
638 src/lua/Makefile
639 src/java/Makefile
640 src/java/run-iep.sh
641 src/scripts/noit-config
642 sql/Makefile
643 test/Makefile
644 ])
Note: See TracBrowser for help on using the browser.