root/configure.in

Revision 37a1f1d07dcb17c546b0201d79c75fb8cd39c22d, 7.2 kB (checked in by Theo Schlossnagle <jesus@omniti.com>, 6 years ago)

missing commit

  • Property mode set to 100755
Line 
1 AC_INIT(src/noitd.c)
2 AC_CANONICAL_HOST
3 AC_CONFIG_HEADER(src/noit_config.h)
4 AC_CONFIG_HEADER(src/jlog/jlog_config.h)
5
6 AC_PROG_CC
7 AC_C_INLINE
8 AC_C_BIGENDIAN
9 AC_PROG_CPP
10 AC_PROG_RANLIB
11 AC_PROG_INSTALL
12 AC_PROG_LN_S
13 AC_PATH_PROG(AR, ar)
14 AC_PATH_PROGS(PERL, perl)
15 AC_SUBST(PERL)
16
17 if test "x$CC" = "xgcc" ; then
18   CFLAGS="$CFLAGS -g -Wall"
19 fi
20
21 case $host in
22 *-*-darwin*)
23         PICFLAGS="-fPIC"
24         MODULELD="$CC -bundle -flat_namespace -undefined suppress"
25         MODULEEXT=bundle
26         ;;
27 *-*-solaris*)
28         PICFLAGS="-Kpic"
29         MODULELD="$CC -G"
30         MODULEEXT=so
31         ;;
32 *-*-openbsd*)
33         PICFLAGS="-fpic"
34         LDFLAGS="$LDFLAGS -Wl,-E"
35         MODULELD="$CC -shared"
36         MODULEEXT=so
37         ;;
38 *)
39         PICFLAGS="-fpic"
40         MODULELD="$CC -shared"
41         MODULEEXT=so
42         ;;
43 esac
44 AC_SUBST(MODULELD)
45 AC_SUBST(MODULEEXT)
46 AC_DEFINE_UNQUOTED(MODULEEXT, "$MODULEEXT", [module extension])
47
48 # Checks for data types
49 AC_CHECK_SIZEOF(char, 1)
50 AC_CHECK_SIZEOF(short int, 2)
51 AC_CHECK_SIZEOF(int, 4)
52 AC_CHECK_SIZEOF(long int, 4)
53 AC_CHECK_SIZEOF(long long int, 8)
54 AC_CHECK_SIZEOF(void *, 1)
55
56 AC_CHECK_LIB(rt, sem_init, , )
57 AC_CHECK_LIB(posix4, sem_wait, , )
58 AC_CHECK_LIB(pthread, pthread_create, , )
59 AC_CHECK_LIB(uuid, uuid_generate, , )
60 AC_CHECK_LIB(util, openpty, , )
61 AC_CHECK_LIB(termcap, tputs, , )
62 AC_CHECK_LIB(curses, clear, , )
63
64 AC_MSG_CHECKING([libxml2 cflags])
65 XML2CFLAGS=`xml2-config --cflags`
66 CFLAGS="$CFLAGS $XML2CFLAGS"
67 AC_MSG_RESULT([$XML2CFLAGS])
68
69 AC_MSG_CHECKING([libxml2 libs])
70 XML2LIBS=`xml2-config --libs`
71 LIBS="$LIBS $XML2LIBS"
72 AC_MSG_RESULT([$XML2LIBS])
73
74 AC_MSG_CHECKING([libserf cflags])
75 SERFCFLAGS="`apr-1-config --cflags --cppflags`"
76 SERFCFLAGS="$SERFCFLAGS -I`apu-1-config --includedir` -I`apr-1-config --includedir`"
77 AC_SUBST(SERFCFLAGS)
78 AC_MSG_RESULT([$SERFCFLAGS])
79
80 AC_MSG_CHECKING([libserf libs])
81 SERFLIBS="`apu-1-config --link-ld --ldflags --libs` `apr-1-config --link-ld --ldflags --libs`"
82 AC_SUBST(SERFLIBS)
83 AC_MSG_RESULT([$SERFLIBS])
84
85 AC_TRY_LINK([],
86         [ issetugid(); ],
87         [ ac_cv_libc_defines_issetugid="yes" ],
88         [ ac_cv_libc_defines_issetugid="no" ]
89 )
90 if test "x$ac_cv_libc_defines_issetugid" = "xyes" ; then
91         AC_DEFINE(HAVE_ISSETUGID)
92 fi
93
94 AC_MSG_CHECKING([whether sem_init works])
95 AC_TRY_RUN(
96         [
97 #include <semaphore.h>
98 int main(void){sem_t s;return (0 != sem_init(&s,0,0));}
99         ],
100         [AC_MSG_RESULT(yes)],
101         [
102                 AC_MSG_RESULT(no)
103                 AC_DEFINE(BROKEN_SEM_INIT)
104                 AC_MSG_WARN([****** sem_init() is broken, I'll implement one myself.])
105         ]
106 )
107
108 AC_CHECK_LIB(rt, sem_init, , )
109 AC_FUNC_STRFTIME
110 AC_CHECK_FUNC(ssetugid strlcpy)
111
112 # Checks for header files.
113 AC_CHECK_HEADERS(sys/file.h sys/types.h dirent.h sys/param.h fcntl.h errno.h limits.h \
114                  sys/resource.h pthread.h semaphore.h pwd.h stdio.h stdlib.h string.h \
115                  ctype.h unistd.h time.h sys/stat.h sys/event.h libkern/OSAtomic.h \
116                  term.h termio.h termios.h curses.h sys/cdefs.h pwd.h netinet/in_systm.h \
117                  util.h sys/time.h sys/mman.h)
118
119 AC_CACHE_CHECK([for kqueue support], ac_cv_have_kqueue, [
120         AC_TRY_LINK(
121                 [ #include <sys/types.h> ],
122                 [ u_int a; a = kqueue(); ],
123                 [ ac_cv_have_kqueue="yes" ],
124                 [ ac_cv_have_kqueue="no" ]
125         )
126 ])
127 if test "x$ac_cv_have_kqueue" = "xyes" ; then
128         AC_DEFINE(HAVE_KQUEUE)
129         have_kqueue=1
130 fi
131
132
133 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
134         AC_TRY_COMPILE(
135                 [ #include <sys/types.h> ],
136                 [ u_int a; a = 1;],
137                 [ ac_cv_have_u_int="yes" ],
138                 [ ac_cv_have_u_int="no" ]
139         )
140 ])
141 if test "x$ac_cv_have_u_int" = "xyes" ; then
142         AC_DEFINE(HAVE_U_INT)
143         have_u_int=1
144 fi
145
146 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
147         AC_TRY_COMPILE(
148                 [ #include <sys/types.h> ],
149                 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
150                 [ ac_cv_have_intxx_t="yes" ],
151                 [ ac_cv_have_intxx_t="no" ]
152         )
153 ])
154 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
155         AC_DEFINE(HAVE_INTXX_T)
156         have_intxx_t=1
157 fi
158        
159 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
160         AC_TRY_COMPILE(
161                 [ #include <sys/types.h> ],
162                 [ int64_t a; a = 1;],
163                 [ ac_cv_have_int64_t="yes" ],
164                 [ ac_cv_have_int64_t="no" ]
165         )
166 ])
167 if test "x$ac_cv_have_int64_t" = "xyes" ; then
168         AC_DEFINE(HAVE_INT64_T)
169         have_int64_t=1
170 fi
171        
172 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
173         AC_TRY_COMPILE(
174                 [ #include <sys/types.h> ],
175                 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
176                 [ ac_cv_have_u_intxx_t="yes" ],
177                 [ ac_cv_have_u_intxx_t="no" ]
178         )
179 ])
180 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
181         AC_DEFINE(HAVE_U_INTXX_T)
182         have_u_intxx_t=1
183 fi
184
185 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
186         AC_TRY_COMPILE(
187                 [ #include <sys/types.h> ],
188                 [ u_int64_t a; a = 1;],
189                 [ ac_cv_have_u_int64_t="yes" ],
190                 [ ac_cv_have_u_int64_t="no" ]
191         )
192 ])
193 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
194         AC_DEFINE(HAVE_U_INT64_T)
195         have_u_int64_t=1
196 fi
197
198 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
199            test "x$ac_cv_header_sys_bitypes_h" = "xyes")
200 then
201         AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
202         AC_TRY_COMPILE(
203                 [
204 #include <sys/bitypes.h>
205                 ],
206                 [
207                         int8_t a; int16_t b; int32_t c;
208                         u_int8_t e; u_int16_t f; u_int32_t g;
209                         a = b = c = e = f = g = 1;
210                 ],
211                 [
212                         AC_DEFINE(HAVE_U_INTXX_T)
213                         AC_DEFINE(HAVE_INTXX_T)
214                         AC_MSG_RESULT(yes)
215                 ],
216                 [AC_MSG_RESULT(no)]
217         )
218 fi
219
220 if test -z "$have_u_intxx_t" ; then
221         AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
222                 AC_TRY_COMPILE(
223                         [
224 #include <sys/types.h>
225                         ],
226                         [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
227                         [ ac_cv_have_uintxx_t="yes" ],
228                         [ ac_cv_have_uintxx_t="no" ]
229                 )
230         ])
231         if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
232                 AC_DEFINE(HAVE_UINTXX_T)
233         fi
234 fi
235
236 AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, [
237         AC_TRY_COMPILE(
238                 [
239 #include <sys/types.h>
240 #include <sys/socket.h>
241                 ],
242                 [socklen_t foo; foo = 1235;],
243                 [ ac_cv_have_socklen_t="yes" ],
244                 [ ac_cv_have_socklen_t="no" ]
245         )
246 ])
247 if test "x$ac_cv_have_socklen_t" = "xyes" ; then
248         AC_DEFINE(HAVE_SOCKLEN_T)
249 fi
250
251 AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
252         AC_TRY_COMPILE(
253                 [
254 #include <sys/types.h>
255                 ],
256                 [ size_t foo; foo = 1235; ],
257                 [ ac_cv_have_size_t="yes" ],
258                 [ ac_cv_have_size_t="no" ]
259         )
260 ])
261 if test "x$ac_cv_have_size_t" = "xyes" ; then
262         AC_DEFINE(HAVE_SIZE_T)
263 fi
264
265 AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
266         AC_TRY_COMPILE(
267                 [
268 #include <sys/types.h>
269                 ],
270                 [ ssize_t foo; foo = 1235; ],
271                 [ ac_cv_have_ssize_t="yes" ],
272                 [ ac_cv_have_ssize_t="no" ]
273         )
274 ])
275 if test "x$ac_cv_have_ssize_t" = "xyes" ; then
276         AC_DEFINE(HAVE_SSIZE_T)
277 fi
278
279 docdir="docs"
280 mansubdir="man"
281 AC_SUBST(docdir)
282 AC_SUBST(mansubdir)
283
284 CPPFLAGS='-I$(top_srcdir)/src'
285 SHCFLAGS="$PICFLAGS $CFLAGS"
286 AC_SUBST(SHCFLAGS)
287
288 AC_MSG_CHECKING([Resolving libexec path...])
289 fullpath=$libexecdir
290 while test "x$temppath" != "x$fullpath" ; do
291   temppath=$fullpath
292   fullpath=`eval echo ${fullpath}`
293 done
294 fullpath=`echo $fullpath | sed "s~NONE~$ac_default_prefix~"`
295 AC_MSG_RESULT([$fullpath])
296 AC_DEFINE_UNQUOTED(MODULES_DIR, "${fullpath}")
297 MODULES_DIR=${fullpath}
298 AC_SUBST(MODULES_DIR)
299
300 AC_MSG_CHECKING([Resolving sysconfdir path...])
301 fullpath=$sysconfdir
302 while test "x$temppath" != "x$fullpath" ; do
303   temppath=$fullpath
304   fullpath=`eval echo ${fullpath}`
305 done
306 fullpath=`echo $fullpath | sed "s~NONE~$ac_default_prefix~"`
307 AC_MSG_RESULT([$fullpath])
308 AC_DEFINE_UNQUOTED(ETC_DIR, "${fullpath}")
309 ETC_DIR=${fullpath}
310 AC_SUBST(ETC_DIR)
311
312
313 AC_OUTPUT([
314 Makefile
315 src/Makefile
316 src/eventer/Makefile
317 src/jlog/Makefile
318 src/modules/Makefile
319 src/utils/Makefile
320 src/noitedit/Makefile
321 ])
Note: See TracBrowser for help on using the browser.