/[cvsroot]/skandha4/Configure.in
ViewVC logotype

Contents of /skandha4/Configure.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1.1.1 - (show annotations) (download) (vendor branch)
Tue May 25 09:37:03 1999 UTC (21 years, 4 months ago) by jsp
Branch: biostr, MAIN
CVS Tags: skandha4, skandha4_1_6, skandha4_1_6_pub, dsg_1_0, HEAD
Branch point for: skandha4_pub, autoconf
Changes since 1.1: +0 -0 lines
ANSI C version of Skandha4


1 dnl Should add tests for presence of X11 .h files before
2 dnl trying to compile with HAVE_X11.
3
4 dnl Configure.in -- Run through GNU 'autoconf' to produce 'Configure'.
5 dnl Run through GNU 'autoheader' to produce 'Config.h.in'.
6 dnl (See Makefile3).
7 dnl -----------------------------------------------------------------------
8 dnl Overview
9 dnl This file consists of GNU 'm4' macros, and requires the GNU autoconfig
10 dnl package (latest is v1.11 as of 94Jul). You don't need this just to
11 dnl install normally, only if you're doing serious hacking, and it will be
12 dnl automatically invoked by a simple 'make muq' if needed, anyhow.
13 dnl -----------------------------------------------------------------------
14 dnl History
15 dnl 94May19 CrT: Created, from autoconfig sample script.
16 dnl -----------------------------------------------------------------------
17 dnl
18 dnl Random CrT notes to itself:
19 dnl "uname -a" is the most typical way of getting host unix version info.
20 dnl "hostinfo" is the NeXT equivalent. (No "uname -a".)
21 dnl "hinv" gives hardware inventory on an SGI. (But "uname -a" is supported.)
22 dnl
23 dnl Initialize autoconf, and give it a filename which occurs
24 dnl only in the c/ directory -- it likes to use this to verify
25 dnl that it has found the intended directory before proceeding:
26 AC_INIT(Uniq-to-c-dir)
27 dnl
28 dnl Tell autoconfig that we want to generate a Config.h file
29 dnl as well as a Makefile2 (from Makefile2.in):
30 AC_CONFIG_HEADER(Config.h)
31 dnl
32 dnl List programs which "make all" should build, and tell autoconf
33 dnl to substitute it for '@PROGS@' when it builds Makefile2:
34 PROGS="muq"
35 AC_SUBST(PROGS)dnl
36 dnl
37 dnl Tell autoconf to look for '@CFLAGS@' when it builds Makefile2:
38 AC_SUBST(CFLAGS)dnl
39 dnl
40 dnl Tell autoconf to look for '@RM@' when it builds Makefile2:
41 AC_SUBST(RM)dnl
42 dnl
43 dnl Tell autoconf to look for '@MV@' when it builds Makefile2:
44 AC_SUBST(MV)dnl
45 dnl
46 dnl Tell autoconf to look for '@LN@' when it builds Makefile2:
47 AC_SUBST(LN)dnl
48 dnl
49 dnl Tell autoconf to look for '@NICE@' when it builds Makefile2:
50 AC_SUBST(NICE)dnl
51 dnl
52 dnl Tell autoconf to look for '@GREP@' when it builds Makefile2:
53 AC_SUBST(GREP)dnl
54 dnl
55 dnl Tell autoconf to look for '@SH@' when it builds Makefile2:
56 AC_SUBST(SH)dnl
57 dnl
58 dnl Tell autoconf to look for '@MAKE@' when it builds Makefile2:
59 AC_SUBST(MAKE)dnl
60 dnl
61 dnl If `gcc' is found, set `make' variable `CC' to `gcc':
62 AC_PROG_CC
63 dnl
64 dnl Set shell and `make' variable `CPP' to a command that runs the C
65 dnl preprocessor. If `$CC -E' doesn't work, it uses `/lib/cpp':
66 AC_PROG_CPP
67 dnl
68 dnl Add `-traditional' to `make' variable `CC' if using the GNU C
69 dnl compiler and `ioctl' does not work properly without `-traditional':
70 AC_PROG_GCC_TRADITIONAL
71 dnl
72 dnl Set `make' variable `INSTALL' to `install -c' if `install' is
73 dnl found and is compatible with the BSD and GNU versions. Otherwise,
74 dnl set `INSTALL' to `@top_srcdir@/install.sh -c' if that script
75 dnl exists, or to `cp' as a last resort.
76 AC_PROG_INSTALL
77 dnl
78 dnl If on AIX, define `_ALL_SOURCE'. Allows the use of some BSD
79 dnl functions. Should be called before any macros that run the C
80 dnl compiler:
81 AC_AIX
82 dnl
83 dnl If on Minix, define `_MINIX' and `_POSIX_SOURCE' and define
84 dnl `_POSIX_1_SOURCE' to be 2. This allows the use of POSIX
85 dnl facilities. Should be called before any macros that run the C
86 dnl compiler.
87 AC_MINIX
88 dnl
89 dnl If on a POSIXized ISC UNIX, define `_POSIX_SOURCE' and add
90 dnl `-posix' (for the GNU C compiler) or `-Xp' (for other C compilers)
91 dnl to `make' variable `CC'. This allows the use of POSIX facilities.
92 dnl Must be called after `AC_PROG_CC' and before any other macros
93 dnl that run the C compiler:
94 AC_ISC_POSIX
95 dnl
96 dnl If on IRIX (Silicon Graphics UNIX), add `-lsun' to `make' variable
97 dnl `LIBS'. Needed to get `getmntent'. At sites using Yellow
98 dnl Pages/NIS, it is also needed to get properly working `gethostby*',
99 dnl `getpw*', `getgr*', `getnetby*', and so on.
100 dnl old AC_IRIX_SUN
101 AC_CHECK_LIB(sun,getpwnam,,,-lc)
102 dnl
103 dnl If `signal.h' declares `signal' as returning a pointer to a
104 dnl function returning `void', define `RETSIGTYPE' to be `void';
105 dnl otherwise, define it to be `int'.
106 AC_TYPE_SIGNAL
107 dnl
108 dnl If the C compiler does not fully support the keyword `const',
109 dnl define `const' to be empty:
110 AC_C_CONST
111 dnl
112 dnl If words are stored with the most significant byte first (like
113 dnl Motorola and SPARC, but not Intel and VAX, CPUs), define
114 dnl `WORDS_BIGENDIAN'.
115 AC_C_BIGENDIAN
116 dnl
117 dnl NeXT has no .h files whatever in /usr/include: they are all
118 dnl one deeper, in /usr/include/ansi, /usr/include/bsd and such.
119 dnl Test for this and if so, add them to directory search list
120 dnl before we begin checking for specific header files:
121 AC_REQUIRE_CPP
122 dnl if test -f /usr/include/ansi/stdio.h; then
123 dnl CFLAGS="$CFLAGS -I/usr/include/ansi"
124 dnl dnl So AC_HEADER_STDC &tc work, since they don't use CFLAGS:
125 dnl ac_cpp="$ac_cpp -I/usr/include/ansi"
126 dnl fi
127 dnl if test -f /usr/include/bsd/unistd.h; then
128 dnl dnl /usr/include/bsd is a NeXT thing, and defining _POSIX_SOURCE
129 dnl dnl on NeXT gives us clock_t instead of time_t and probably other
130 dnl dnl good stuff:
131 dnl dnl LATER: -lposix seems to always give a floating point exception
132 dnl dnl at runtime on NEXTSTEP 3.2: gave up on it.
133 dnl dnl AC_DEFINE(_POSIX_SOURCE)
134 dnl CFLAGS="$CFLAGS -I/usr/include/bsd"
135 dnl dnl So AC_HEADER_STDC &tc work, since they don't use CFLAGS:
136 dnl ac_cpp="$ac_cpp -I/usr/include/bsd"
137 dnl fi
138 dnl
139 dnl If `size_t' is not defined in `sys/types.h', define `size_t' to be
140 dnl `unsigned'.
141 AC_TYPE_UID_T
142 dnl
143 AC_HEADER_STDC
144 dnl
145 dnl AC_PATH_XTRA is an enhanced version of AC_PATH_X.
146 dnl Adds the C compiler flags that X needs to output variable
147 dnl X_CFLAGS, and the X linker flags to X_LIBS. If X is not
148 dnl available, addd `-DX_DISPLAY_MISSING'
149 dnl to X_CFLAGS.
150 dnl
151 dnl Also checks for special libraries that some systems need in
152 dnl order to compile X programs. Adds any that the system needs
153 dnl to output variable X_EXTRA_LIBS. And checks for special X11R6
154 dnl libraries that need to be linked with before `-lX11', and adds
155 dnl any found to the output variable X_PRE_LIBS.
156 dnl
157 dnl Commented out, since nobody is working on completing X support:
158 dnl AC_PATH_XTRA
159 dnl
160 dnl If the above sets no_x to "yes", set X11 to -lX11, otherwise
161 dnl set it to the empty string. Either way, export X11 to the
162 dnl Makefile:
163 dnl
164 dnl Commented out, since nobody is working on completing X support:
165 dnl if test "$no_x" = yes; then
166 dnl X11=
167 dnl else
168 dnl AC_DEFINE(HAVE_X11)
169 dnl X11=-lX11
170 dnl fi
171 dnl AC_SUBST(X11)dnl
172 dnl
173 dnl For each given HEADER-FILE in the whitespace-separated argument
174 dnl list that exists, define `HAVE_HEADER-FILE' (in all caps):
175 AC_CHECK_HEADERS(string.h fcntl.h memory.h utime.h unistd.h)
176 dnl
177 AC_CHECK_HEADERS(sys/resource.h) dnl Irix 4.x declares struct rusage here.
178 AC_CHECK_HEADERS(sys/rusage.h) dnl SunOS 5.x declares struct rusage here.
179 dnl
180 dnl Using STDC_HEADERS to decide whether to include stdarg.h kinda sucks,
181 dnl since I want it even if the macro thinks one of the other files
182 dnl standard files is slightly defective. So, check for it individually:
183 AC_CHECK_HEADERS(stdarg.h stdlib.h)
184 dnl
185 dnl One place to get clock_t:
186 AC_CHECK_HEADERS(time.h)
187 dnl
188 dnl Another place to get clock_t.
189 AC_CHECK_HEADERS(sys/times.h)
190 dnl
191 dnl A place to get CLK_TCK when sysconf() is missing:
192 AC_CHECK_HEADERS(limits.h)
193 dnl
194 dnl NEXTSTEP 3.2 doesn't have malloc.h:
195 AC_CHECK_HEADERS(malloc.h)
196 dnl
197 dnl NEXTSTEP 3.2 keeps select(), open(), close() &tc in bsd/libc.h:
198 AC_CHECK_HEADERS(libc.h)
199 dnl
200 dnl Gave up and added checks for absence of everything but stdio.h:
201 AC_CHECK_HEADERS(ctype.h sys/types.h arpa/inet.h errno.h)
202 AC_CHECK_HEADERS(netdb.h netinet/in.h signal.h sys/file.h)
203 AC_CHECK_HEADERS(sys/ioctl.h sys/socket.h sys/time.h sys/stat.h sys/wait.h)
204 AC_CHECK_HEADERS(setjmp.h math.h sys/select.h)
205 AC_CHECK_HEADERS(sys/param.h) dnl Something Ultrix4.2a wants for times()
206 dnl
207 dnl
208 dnl If a program may include both `time.h' and `sys/time.h', define
209 dnl `TIME_WITH_SYS_TIME'. On some older systems, `sys/time.h'
210 dnl includes `time.h', but `time.h' is not protected against multiple
211 dnl inclusion, so programs should not explicitly include both files.
212 dnl This macro is useful in programs that use, for example, `struct
213 dnl timeval' or `struct timezone' as well as `struct tm'. It is best
214 dnl used in conjunction with `HAVE_SYS_TIME_H'.
215 AC_HEADER_TIME
216 dnl
217 dnl Figure out how to get the current timezone. If `struct tm' has a
218 dnl `tm_zone' member, define `HAVE_TM_ZONE'. Otherwise, if the
219 dnl external array `tzname' is found, define `HAVE_TZNAME'. This
220 dnl macro calls `AC_STRUCT_TM' if it hasn't been called already.
221 AC_STRUCT_TIMEZONE
222 dnl
223 dnl If `vfork.h' is found, define `HAVE_VFORK_H'. If a working
224 dnl `vfork' is not found, define `vfork' to be `fork':
225 AC_FUNC_VFORK
226 dnl
227 dnl If `vprintf' is found, define `HAVE_VPRINTF'. Otherwise, if
228 dnl `_doprnt' is found, define `HAVE_DOPRNT'. (If `vprintf' is
229 dnl available, you may assume that `vfprintf' and `vsprintf' are
230 dnl also available.)
231 AC_FUNC_VPRINTF
232 dnl
233 dnl Check how to get `alloca'. Tries to get a builtin version by
234 dnl checking for `alloca.h' or the predefined C preprocessor macros
235 dnl `__GNUC__' and `_AIX'. If that fails, it looks for a function in
236 dnl the standard C library. If that fails, it sets the `make'
237 dnl variable `ALLOCA' to `alloca.o' and defines `C_ALLOCA' (so
238 dnl programs can periodically call `alloca(0)' to garbage collect).
239 dnl Commented out 95Aug29CrT: Causing problems on HP/UX, I
240 dnl don't use it, and I don't intend to use it.
241 dnl AC_FUNC_ALLOCA
242 dnl
243 dnl If the system has `dirent.h', define `DIRENT'; otherwise, if it
244 dnl has `sys/ndir.h', define `SYSNDIR'; otherwise, if it has
245 dnl `sys/dir.h', define `SYSDIR'; otherwise, if it has `ndir.h',
246 dnl define `NDIR'. Also, if the directory library header file
247 dnl contains a declaration of the `closedir' function with a `void'
248 dnl return type, define `VOID_CLOSEDIR'.
249 AC_HEADER_DIRENT
250 dnl
251 dnl
252 dnl See bottom of Need.h for genealogy of following stuff.
253 dnl When using this, following 5 lines need to be sorted into acconfig.h:
254 dnl #undef NEED_HOWMANY_DEF /* Need.h stuff. */
255 dnl #undef NEED_LOCKSH_DEF /* Need.h stuff. */
256 dnl #undef NEED_OPTARG /* Need.h stuff. */
257 dnl #undef NEED_OPTERR /* Need.h stuff. */
258 dnl #undef NEED_OPTIND /* Need.h stuff. */
259 dnl ------------------------ Missing Prototypes ------------------------
260 dnl
261 dnl $Id: proto_checks,v 1.4 1994/04/19 07:37:52 joel Exp root $
262 dnl Add all or some of these to the configure.in files.
263 dnl Requires actrl.m4 for TRL_PROTO_CHECK macro.
264 dnl Include need.h for missing declarations.
265 dnl Calls to check for some macro define checks, missing externals
266 dnl and many prototype declarations. It is definitely more efficient
267 dnl to select those that are actually required for a given program.
268 dnl
269 dnl Missing macro definitions checks.
270 dnl
271 dnl SOON AC_EGREP_HEADER([^#define.*howmany],
272 dnl SOON sys/types.h,,AC_DEFINE(NEED_HOWMANY_DEF))
273 dnl
274 dnl Missing externs checks.
275 dnl
276 dnl
277 dnl SOON AC_MSG_CHECKING(whether LOCKSH is defined)
278 dnl SOON AC_TRY_LINK(
279 dnl SOON [#include <sys/file.h>],[int i=LOCKSH;],
280 dnl SOON AC_MSG_RESULT(yes),
281 dnl SOON AC_MSG_RESULT(no); AC_DEFINE(NEED_LOCKSH_DEF))
282 dnl SOON dnl
283 dnl SOON AC_MSG_CHECKING(whether optarg is available)
284 dnl SOON AC_TRY_LINK(
285 dnl SOON [#include <stdlib.h>], [char* s=optarg;],
286 dnl SOON AC_MSG_RESULT(yes),
287 dnl SOON AC_MSG_RESULT(no); AC_DEFINE(NEED_OPTARG))
288 dnl SOON dnl
289 dnl SOON AC_MSG_CHECKING(whether opterr is available)
290 dnl SOON AC_TRY_LINK(opterr,
291 dnl SOON [#include <stdlib.h>], [int i=opterr;],
292 dnl SOON AC_MSG_RESULT(yes),
293 dnl SOON AC_MSG_RESULT(no); AC_DEFINE(NEED_OPTERR))
294 dnl SOON dnl
295 dnl SOON AC_MSG_CHECKING(whether optind is available)
296 dnl SOON AC_TRY_LINK(
297 dnl SOON [#include <stdlib.h>], [int i=optind;],
298 dnl SOON AC_MSG_RESULT(yes),
299 dnl SOON AC_MSG_RESULT(no); AC_DEFINE(NEED_OPTIND))
300
301 dnl Missing prototypes checks.
302 dnl
303 dnl I've commented out most ones Muq doesn't use -- Cynbe
304 dnl If you uncomment any, or add new ones, make sure that
305 dnl there is
306 dnl 1) a corresponding "#undef NEED_XXX" line in Config.h.top"
307 dnl 2) a corresponding protoype in h/Need.h
308 dnl 3) that you do a "muq-deconfigure" to force a rebuild.
309 TRL_PROTO_CHECK(_filbuf, stdio.h)
310 TRL_PROTO_CHECK(_flsbuf, stdio.h)
311 TRL_PROTO_CHECK(accept, sys/socket.h)
312 TRL_PROTO_CHECK(strcasecmp, string.h)
313 dnl OSF/Alpha keeps a bcopy prototype in Xfuncs.h:
314 TRL_PROTO_CHECK(bcopy, strings.h string.h memory.h bstring.h X11/Xfuncs.h)
315 TRL_PROTO_CHECK(bind, sys/socket.h)
316 TRL_PROTO_CHECK(bzero, strings.h string.h memory.h bstring.h)
317 dnl TRL_PROTO_CHECK(cfsetispeed, termios.h sys/termios.h)
318 dnl TRL_PROTO_CHECK(cfsetospeed, termios.h sys/termios.h)
319 TRL_PROTO_CHECK(close, unistd.h)
320 dnl TRL_PROTO_CHECK(closelog, syslog.h)
321 TRL_PROTO_CHECK(connect, sys/socket.h)
322 dnl TRL_PROTO_CHECK(crypt, unistd.h)
323 dnl TRL_PROTO_CHECK(cuserid, stdio.h)
324 dnl TRL_PROTO_CHECK(endpwent, pwd.h)
325 dnl TRL_PROTO_CHECK(fchmod, unistd.h libc.h osfcn.h sys/stat.h)
326 dnl TRL_PROTO_CHECK(fchown, unistd.h)
327 TRL_PROTO_CHECK(fclose, stdio.h)
328 TRL_PROTO_CHECK(fflush, stdio.h)
329 TRL_PROTO_CHECK(fgetc, stdio.h)
330 TRL_PROTO_CHECK(pclose, stdio.h)
331 dnl TRL_PROTO_CHECK(flock, sys/file.h)
332 dnl TRL_PROTO_CHECK(floor, math.h)
333 TRL_PROTO_CHECK(fprintf, stdio.h)
334 TRL_PROTO_CHECK(fputc, stdio.h)
335 TRL_PROTO_CHECK(fputs, stdio.h)
336 TRL_PROTO_CHECK(fread, stdio.h)
337 TRL_PROTO_CHECK(free, stdlib.h)
338 TRL_PROTO_CHECK(fscanf, stdio.h)
339 TRL_PROTO_CHECK(fwrite, stdio.h)
340 dnl TRL_PROTO_CHECK(ftruncate, unistd.h)
341 TRL_PROTO_CHECK(getdtablesize, unistd.h)
342 dnl TRL_PROTO_CHECK(geteuid, unistd.h)
343 dnl TRL_PROTO_CHECK(gethostbyaddr, netdb.h)
344 dnl TRL_PROTO_CHECK(gethostbyname, netdb.h)
345 dnl TRL_PROTO_CHECK(gethostname, unistd.h osfcn.h)
346 dnl TRL_PROTO_CHECK(getopt, stdlib.h unistd.h)
347 TRL_PROTO_CHECK(getpagesize, stdlib.h unistd.h)
348 dnl TRL_PROTO_CHECK(getpeername, sys/socket.h)
349 TRL_PROTO_CHECK(getrusage, sys/resource.h sys/rusage.h)
350 dnl TRL_PROTO_CHECK(getservbyname, netdb.h)
351 TRL_PROTO_CHECK(getsockname, sys/socket.h)
352 TRL_PROTO_CHECK(gettimeofday, sys/time.h)
353 dnl TRL_PROTO_CHECK(getuid, unistd.h)
354 TRL_PROTO_CHECK(ioctl, unistd.h sys/ioctl.h)
355 dnl TRL_PROTO_CHECK(isatty, stdlib.h unistd.h)
356 TRL_PROTO_CHECK(listen, sys/socket.h)
357 dnl TRL_PROTO_CHECK(localtime, time.h)
358 TRL_PROTO_CHECK(malloc, stdlib.h)
359 TRL_PROTO_CHECK(memmove, string.h)
360 TRL_PROTO_CHECK(memset, memory.h string.h)
361 dnl TRL_PROTO_CHECK(mkstemp, stdio.h unistd.h)
362 dnl TRL_PROTO_CHECK(mktemp, stdio.h unistd.h)
363 dnl TRL_PROTO_CHECK(openlog, syslog.h)
364 dnl TRL_PROTO_CHECK(pclose, stdio.h)
365 dnl TRL_PROTO_CHECK(popen, stdio.h)
366 TRL_PROTO_CHECK(printf, stdio.h)
367 TRL_PROTO_CHECK(puts, stdio.h)
368 TRL_PROTO_CHECK(srand48, math.h stdlib.h)
369 TRL_PROTO_CHECK(drand48, math.h stdlib.h)
370 TRL_PROTO_CHECK(random, math.h stdlib.h)
371 TRL_PROTO_CHECK(srandom, math.h stdlib.h)
372 TRL_PROTO_CHECK(read, unistd.h)
373 TRL_PROTO_CHECK(realloc, stdlib.h)
374 TRL_PROTO_CHECK(recvfrom, sys/socket.h)
375 TRL_PROTO_CHECK(remove, stdio.h)
376 TRL_PROTO_CHECK(rename, stdio.h unistd.h)
377 TRL_PROTO_CHECK(rewind, stdio.h)
378 TRL_PROTO_CHECK(sbrk, unistd.h)
379 TRL_PROTO_CHECK(select, unistd.h sys/select.h sys/time.h)
380 TRL_PROTO_CHECK(sendto, sys/socket.h)
381 dnl TRL_PROTO_CHECK(setegid, unistd.h)
382 dnl TRL_PROTO_CHECK(seteuid, unistd.h)
383 dnl TRL_PROTO_CHECK(setitimer, sys/time.h)
384 TRL_PROTO_CHECK(setsockopt, sys/socket.h)
385 TRL_PROTO_CHECK(shutdown, sys/socket.h)
386 TRL_PROTO_CHECK(sigaction, signal.h)
387 TRL_PROTO_CHECK(sigvec, signal.h)
388 TRL_PROTO_CHECK(socket, sys/socket.h)
389 TRL_PROTO_CHECK(sscanf, stdio.h)
390 TRL_PROTO_CHECK(strcasecmp, string.h)
391 TRL_PROTO_CHECK(strdup, string.h)
392 TRL_PROTO_CHECK(strerror, string.h)
393 TRL_PROTO_CHECK(strftime, time.h)
394 TRL_PROTO_CHECK(strncasecmp, string.h)
395 dnl TRL_PROTO_CHECK(strtoul, stdlib.h)
396 TRL_PROTO_CHECK(sysconf, unistd.h)
397 dnl TRL_PROTO_CHECK(syslog, syslog.h)
398 TRL_PROTO_CHECK(system, stdlib.h)
399 dnl TRL_PROTO_CHECK(tcdrain, termios.h sys/termios.h)
400 dnl TRL_PROTO_CHECK(tcflow, termios.h sys/termios.h)
401 dnl TRL_PROTO_CHECK(tcflush, termios.h sys/termios.h)
402 dnl TRL_PROTO_CHECK(tcgetattr, termios.h sys/termios.h)
403 dnl TRL_PROTO_CHECK(tcsendbreak, termios.h sys/termios.h)
404 dnl TRL_PROTO_CHECK(tcsetattr, termios.h sys/termios.h)
405 TRL_PROTO_CHECK(time, time.h)
406 dnl bsd/libc.h is where NeXT puts times():
407 TRL_PROTO_CHECK(times, bsd/libc.h sys/times.h)
408 TRL_PROTO_CHECK(tolower, ctype.h)
409 TRL_PROTO_CHECK(toupper, ctype.h)
410 TRL_PROTO_CHECK(unlink, unistd.h)
411 TRL_PROTO_CHECK(vsprintf, stdio.h)
412 dnl TRL_PROTO_CHECK(vsyslog, syslog.h)
413 dnl TRL_PROTO_CHECK(waitpid, sys/wait.h)
414 dnl -------------------------- end prototypes -----------------------
415 dnl
416 dnl If the C compiler is a version of GCC that supports the keyword
417 dnl `__inline' but not `inline' (such as some NeXT versions), define
418 dnl `inline' to be `__inline':
419 AC_C_INLINE
420 dnl
421 dnl SunOS 5.3 has a nasty bug where searching ucblib for
422 dnl rusage() gets us the wrong setjmp() -- one that uses a
423 dnl bigger jmp_buf than the one defined by <setjmp.h>, and
424 dnl consequently trashes global variables when called. We
425 dnl can avoid this by searching libc _first_, but some systems
426 dnl (e.g., NEXTSTEP 3.2) _have_ no libc.a, so we do this only
427 dnl if it is found. Notice we _prepend_ libc to LIBS, but we
428 dnl _append_ all the rest:
429 dnl AC_HAVE_LIBRARY(c)
430 AC_CHECK_LIB(c,printf)
431 dnl
432 dnl If there are systems without libc.a, there are probably
433 dnl systems without libm.a, too, so search it only if found
434 dnl also:
435 dnl AC_HAVE_LIBRARY(m)
436 dnl AC_CHECK_LIB(m,sin,,,-lc) gives syntax error on sin() so:
437 AC_MSG_CHECKING(for -lm)
438 ac_save_LIBS=$LIBS
439 LIBS="$LIBS -lm"
440 AC_TRY_LINK([
441 #include <math.h>
442 ],
443 [sin(0.0);],
444 ac_cv_lib_m=yes,
445 ac_cv_lib_m=no)dnl
446 LIBS=$ac_save_LIBS
447 if test "$ac_cv_lib_m" = yes; then
448 AC_MSG_RESULT(present)
449 AC_DEFINE(HAVE_LIBM)
450 LIBS="-lm $LIBS"
451 else
452 AC_MSG_RESULT(absent)
453 fi
454 dnl
455 dnl SunOS hides getrusage in /usr/ucblib/libucb.a:
456 # SunOS 5.x keeps getrusage in /usr/ucblib/libucb.a:
457 LIBS_old="$LIBS"
458 # The following will only work for gcc under SunOS,
459 # I expect. (I don't have a manpage for cc under SunOS. 94Jun25Cynbe)
460 LIBS="$LIBS -L/usr/ucblib -Xlinker -R/usr/ucblib"
461 AC_CHECK_LIB(ucb, getrusage, LIBS="$LIBS -lucb",LIBS="$LIBS_old",-lc)
462 dnl
463 AC_MSG_CHECKING(for getrusage)
464 AC_TRY_LINK([
465 #ifdef HAVE_SYS_TIME_H
466 #include <sys/time.h>
467 #endif
468 #ifdef HAVE_SYS_RUSAGE_H
469 #include <sys/rusage.h> /* Sunos 5.4 manpage specs this */
470 #endif
471 #ifdef HAVE_SYS_RESOURCE_H
472 #include <sys/resource.h> /* Irix 5.2 wants this instead */
473 #endif
474 ],
475 [ struct rusage r; /* = */ getrusage( RUSAGE_SELF, &r ); ],
476 muq_got_rusage=yes,
477 muq_got_rusage=no)dnl
478
479 if test "$muq_got_rusage" = yes; then
480 AC_MSG_RESULT(present)
481 AC_DEFINE(HAVE_GETRUSAGE)
482 else
483 AC_MSG_RESULT(ABSENT)
484 fi
485 dnl
486 dnl Sometimes we have struct rusage.ru_stime.tv_usec, and
487 dnl sometimes we have struct rusage.ru_stime.tv_nsec, and
488 dnl sometimew we have nothing:
489 AC_MSG_CHECKING(for rusage.ru_stime.tv_usec)
490 AC_TRY_LINK([
491 #ifdef HAVE_SYS_TIME_H
492 #include <sys/time.h>
493 #endif
494 #ifdef HAVE_SYS_RUSAGE_H
495 #include <sys/rusage.h> /* Sunos 5.4 manpage specs this */
496 #endif
497 #ifdef HAVE_SYS_RESOURCE_H
498 #include <sys/resource.h> /* Irix 5.2 wants this instead */
499 #endif
500 ],
501 [ struct rusage r; int i = (int) r.ru_stime.tv_usec; ],
502 muq_got_rusage_ru_stime_tv_usec=yes,
503 muq_got_rusage_ru_stime_tv_usec=no)
504 if test "$muq_got_rusage_ru_stime_tv_usec" = yes; then
505 AC_MSG_RESULT(present)
506 AC_DEFINE(HAVE_RUSAGE_RU_STIME_TV_USEC)
507 else
508 AC_MSG_RESULT(ABSENT)
509 fi
510 dnl ---
511 AC_MSG_CHECKING(for rusage.ru_stime.tv_nsec)
512 AC_TRY_LINK([
513 #ifdef HAVE_SYS_TIME_H
514 #include <sys/time.h>
515 #endif
516 #ifdef HAVE_SYS_RUSAGE_H
517 #include <sys/rusage.h> /* Sunos 5.4 manpage specs this */
518 #endif
519 #ifdef HAVE_SYS_RESOURCE_H
520 #include <sys/resource.h> /* Irix 5.2 wants this instead */
521 #endif
522 ],
523 [ struct rusage r; int i = (int) r.ru_stime.tv_nsec; ],
524 muq_got_rusage_ru_stime_tv_nsec=yes,
525 muq_got_rusage_ru_stime_tv_nsec=no)
526 if test "$muq_got_rusage_ru_stime_tv_nsec" = yes; then
527 AC_MSG_RESULT(present)
528 AC_DEFINE(HAVE_RUSAGE_RU_STIME_TV_NSEC)
529 else
530 AC_MSG_RESULT(ABSENT)
531 fi
532 dnl -- Ditto:
533 dnl Sometimes we have struct rusage.ru_utime.tv_usec, and
534 dnl sometimes we have struct rusage.ru_utime.tv_nsec, and
535 dnl sometimew we have nothing:
536 AC_MSG_CHECKING(for rusage.ru_utime.tv_usec)
537 AC_TRY_LINK([
538 #ifdef HAVE_SYS_TIME_H
539 #include <sys/time.h>
540 #endif
541 #ifdef HAVE_SYS_RUSAGE_H
542 #include <sys/rusage.h> /* Sunos 5.4 manpage specs this */
543 #endif
544 #ifdef HAVE_SYS_RESOURCE_H
545 #include <sys/resource.h> /* Irix 5.2 wants this instead */
546 #endif
547 ],
548 [ struct rusage r; int i = (int) r.ru_utime.tv_usec; ],
549 muq_got_rusage_ru_utime_tv_usec=yes,
550 muq_got_rusage_ru_utime_tv_usec=no)
551 if test "$muq_got_rusage_ru_utime_tv_usec" = yes; then
552 AC_MSG_RESULT(present)
553 AC_DEFINE(HAVE_RUSAGE_RU_UTIME_TV_USEC)
554 else
555 AC_MSG_RESULT(ABSENT)
556 fi
557 dnl ---
558 AC_MSG_CHECKING(for rusage.ru_utime.tv_nsec)
559 AC_TRY_LINK([
560 #ifdef HAVE_SYS_TIME_H
561 #include <sys/time.h>
562 #endif
563 #ifdef HAVE_SYS_RUSAGE_H
564 #include <sys/rusage.h> /* Sunos 5.4 manpage specs this */
565 #endif
566 #ifdef HAVE_SYS_RESOURCE_H
567 #include <sys/resource.h> /* Irix 5.2 wants this instead */
568 #endif
569 ],
570 [ struct rusage r; int i = (int) r.ru_utime.tv_nsec; ],
571 muq_got_rusage_ru_utime_tv_nsec=yes,
572 muq_got_rusage_ru_utime_tv_nsec=no)
573 if test "$muq_got_rusage_ru_utime_tv_nsec" = yes; then
574 AC_MSG_RESULT(present)
575 AC_DEFINE(HAVE_RUSAGE_RU_UTIME_TV_NSEC)
576 else
577 AC_MSG_RESULT(ABSENT)
578 fi
579 dnl
580 dnl If libcrypt.a is found, add to LIBS:
581 dnl AC_CHECK_LIB(crypt,crypt,,,-lc)
582 dnl
583 dnl If libsocket.a is found, add to LIBS:
584 AC_CHECK_LIB(socket,select,,,-lc)
585 dnl
586 dnl If libposix.a (NEXTSTEP 3.2) is found, add to LIBS:
587 dnl LATER: -lposix seems to always give a floating point exception
588 dnl at runtime on NEXTSTEP 3.2:
589 dnl % cat x.c
590 dnl #include <stdio.h>
591 dnl int main( int argc, char** argv ) {
592 dnl printf("test...\n");
593 dnl }
594 dnl % cc x.c -o x
595 dnl % ./x
596 dnl test...
597 dnl % cc x.c -o x -lposix
598 dnl % ./x
599 dnl Floating exception (core dumped)
600 dnl % gdb ./x ./core
601 dnl (gdb) bt
602 dnl #0 0x5bd8 in NXCreateZone ()
603 dnl #1 0x5728 in malloc_init ()
604 dnl #2 0x7cb4 in malloc ()
605 dnl #3 0x837c in _flsbuf ()
606 dnl #4 0x4768 in _doprnt ()
607 dnl #5 0x445c in printf ()
608 dnl #6 0x441c in main ()
609 dnl (gdb)
610 dnl So, I gave up trying to use -lposix:
611 dnl AC_CHECK_LIB(posix)
612 dnl
613 dnl If libnsl.a is found, add to LIBS:
614 AC_CHECK_LIB(nsl,select,,,-lc)
615 dnl
616 dnl For each given FUNCTION-NAME in the whitespace-separated argument
617 dnl list that is not in the C library, add `FUNCTION-NAME.o' to the
618 dnl value of the `make' variable `LIBOBJS'. If the functions might be
619 dnl AC_REPLACE_FUNCS(fnmatch bcopy mkdir strdup)
620 dnl
621 dnl For each given FUNCTION in the whitespace-separated argument list
622 dnl that is available, define `HAVE_FUNCTION' (in all caps):
623 dnl We want to check for crypt() AFTER we do
624 dnl AC_CHECK_LIB(crypt)
625 dnl and so forth, else they may not get found even when
626 dnl present:
627 AC_CHECK_FUNCS(sysconf memset memmove drand48 srand48 random srandom)
628 AC_CHECK_FUNCS(getpagesize gettimeofday strerror)
629 dnl
630 dnl Random variables useful in Makefile2
631 dnl
632 dnl Find 'rm'. Pakrat moved it from /bin to /usr/bin, bless him:
633 dnl "Do not use test -x because 4.3BSD does not have it." --autoconfig docs
634 AC_MSG_CHECKING(for rm)
635 if test -f "/bin/rm" ; then
636 RM=/bin/rm
637 else
638 if test -f "/usr/bin/rm" ; then
639 RM=/usr/bin/rm
640 else
641 if test -f "/sbin/rm" ; then
642 RM=/sbin/rm
643 else
644 RM=rm # `which` prolly isn't portable, alas.
645 fi
646 fi
647 fi
648 AC_MSG_RESULT($RM)
649 dnl
650 dnl Find 'mv'
651 AC_MSG_CHECKING(for mv)
652 if test -f "/bin/mv" ; then
653 MV=/bin/mv
654 else
655 if test -f "/usr/bin/mv" ; then
656 MV=/usr/bin/mv
657 else
658 if test -f "/sbin/mv" ; then
659 MV=/sbin/mv
660 else
661 MV=mv
662 fi
663 fi
664 fi
665 AC_MSG_RESULT($MV)
666 dnl
667 dnl Find 'ln'
668 AC_MSG_CHECKING(for ln)
669 if test -f "/bin/ln" ; then
670 LN=/bin/ln
671 else
672 if test -f "/usr/bin/ln" ; then
673 LN=/usr/bin/ln
674 else
675 if test -f "/sbin/ln" ; then
676 LN=/sbin/ln
677 else
678 LN=ln
679 fi
680 fi
681 fi
682 AC_MSG_RESULT($LN)
683 dnl
684 dnl Find 'sh'
685 AC_MSG_CHECKING(for sh)
686 if test -f "/bin/sh" ; then
687 SH=/bin/sh
688 else
689 if test -f "/usr/bin/sh" ; then
690 SH=/usr/bin/sh
691 else
692 if test -f "/sbin/sh" ; then
693 SH=/sbin/sh
694 else
695 SH=sh
696 fi
697 fi
698 fi
699 AC_MSG_RESULT($SH)
700 dnl
701 dnl Find 'grep'
702 AC_MSG_CHECKING(for grep)
703 if test -f "/bin/egrep" ; then
704 GREP=/bin/egrep
705 else
706 if test -f "/usr/bin/egrep" ; then
707 GREP=/usr/bin/egrep
708 else
709 if test -f "/sbin/egrep" ; then
710 GREP=/sbin/egrep
711 else
712 if test -f "/bin/grep" ; then
713 GREP=/bin/grep
714 else
715 if test -f "/usr/bin/grep" ; then
716 GREP=/usr/bin/grep
717 else
718 if test -f "/usr/sbin/grep" ; then
719 GREP=/usr/bin/grep
720 else
721 GREP=grep
722 fi
723 fi
724 fi
725 fi
726 fi
727 fi
728 dnl
729 dnl Find 'nice'
730 AC_MSG_CHECKING(for nice)
731 if test -f "/bin/nice" ; then
732 NICE=/bin/nice
733 else
734 if test -f "/usr/bin/nice" ; then
735 NICE=/usr/bin/nice
736 else
737 if test -f "/sbin/nice" ; then
738 NICE=/sbin/nice
739 else
740 if test -f "/usr/local/bin/nice" ; then
741 NICE=/usr/local/bin/nice
742 else
743 dnl Don't actually need nice anyhow:
744 NICE=
745 fi
746 fi
747 fi
748 fi
749 AC_MSG_RESULT($NICE)
750 dnl
751 dnl Find 'make', trying to use GNU make if possible.
752 AC_MSG_CHECKING(for make)
753 if test -f "/usr/local/bin/make" ; then
754 MAKE=/usr/local/bin/make
755 else
756 if test -f "/usr/local/bin/gmake" ; then
757 MAKE=/usr/local/bin/gmake
758 else
759 if test -f "/usr/local/bin/gnumake" ; then
760 MAKE=/usr/local/bin/gnumake
761 else
762 if test -f "/usr/bin/gmake" ; then
763 MAKE=/usr/bin/gmake
764 else
765 if test -f "/usr/bin/gnumake" ; then
766 MAKE=/usr/bin/gnumake
767 else
768 if test -f "/bin/gmake" ; then
769 MAKE=/bin/gmake
770 else
771 if test -f "/bin/gnumake" ; then
772 MAKE=/bin/gnumake
773 else
774 MAKE=make
775 fi
776 fi
777 fi
778 fi
779 fi
780 fi
781 fi
782 AC_MSG_RESULT($MAKE)
783 dnl
784 dnl WRStevens says SysV setpgrp() takes two
785 dnl args, but that BSD setpgrp() takes none.
786 dnl Try to figure out which this system has:
787 AC_MSG_CHECKING(setpgrp args)
788 AC_TRY_COMPILE(,[
789 #ifdef HAVE_UNISTD_H
790 #include <unistd.h>
791 #endif
792 setpgrp();
793 ],[AC_MSG_RESULT(0);AC_DEFINE(HAVE_ZERO_SETPGRP_ARGS)],
794 AC_MSG_RESULT(2))
795 dnl
796 dnl If using MIPS cc, add -Wf,-XNc1000 options to CC.
797 dnl This keeps us from overflowing its string table.
798 dnl Don't be fooled by the fact that gcc using the
799 dnl MIPS cpp will still have __mips defined:
800 if test -z "$GCC" ; then
801 AC_MSG_CHECKING(MIPS cc)
802 AC_TRY_COMPILE(,[
803 /* Do NOT indent the following #ifndef: */
804 /* that's an unwanted syntax error in */
805 /* K&R C, and we've not yet established */
806 /* that we have ANSI C: */
807 /* On Irix 5.2 using the MIPS/SGI cc, */
808 /* -fullwarn provides extra diagnostics,*/
809 /* and is recommended during development*/
810 /* The -XNc1000 avoids a table overflow.*/
811 #ifndef __mips
812 error error error /* Force compile error -- nothing more elegant? */
813 #endif
814 ],[AC_MSG_RESULT(yes, adding -Wf,-XNc1000 -fullwarn compile switches);CC="$CC -Wf,-XNc1000 -fullwarn"],
815 AC_MSG_RESULT(no))
816 fi
817 dnl
818 dnl On HP/UX, Nightmare (mkaufman@mcs.kent.edu) reports
819 dnl we need -Aa -D_HPUX_SOURCE to get ANSI C support from
820 dnl the native compiler. It appears from the HPUX cc manpage
821 dnl that this still won't work on the vanilla HPUX cc, but requires
822 dnl "the C compiler sold as an optional separate product".
823 dnl Still, no harm adding it:
824 if test -z "$GCC" ; then
825 AC_MSG_CHECKING(HPUX cc)
826 AC_TRY_COMPILE(,[
827 #ifndef __hpux
828 error error error /* Force compile error -- nothing more elegant? */
829 #endif
830 ],[AC_MSG_RESULT(yes, adding -As -D_HPUX_SOURCE compile switches);CC="$CC -As -D_HPUX_SOURCE"],
831 AC_MSG_RESULT(no))
832 fi
833 dnl
834 dnl If using DEC Alpha cc (on OSF/1 v1.3a test system,
835 dnl at least), need -std switch to get ANSI C support:
836 if test -z "$GCC" ; then
837 AC_MSG_CHECKING(DEC Alpha cc)
838 AC_TRY_COMPILE(,[
839 /* Do NOT indent the following #ifndef: */
840 /* that's an unwanted syntax error in */
841 /* K&R C, and we've not yet established */
842 /* that we have ANSI C: */
843 #ifndef __alpha
844 error error error /* Force compile error -- nothing more elegant? */
845 #endif
846 ],[AC_MSG_RESULT(yes, using -std to get ANSI support);CC="$CC -std"],
847 AC_MSG_RESULT(no))
848 fi
849 dnl
850 dnl If using gcc, add -Wall -Wno-parentheses -Wno-comment -O options to CC:
851 if test -n "${GCC-}" ; then
852 CC="$CC -Wall -Wno-parentheses -Wno-comment"
853 fi
854 dnl
855 dnl Make sure MUQDIR environment variable got set,
856 dnl or failing that, that the default $HOME/muq/bin
857 dnl directory exists:
858 if test -z "${MUQDIR-}" ; then
859 if test -d ${HOME}/muq/bin ; then
860 echo
861 echo "==============================================="
862 echo "You have not set MUQDIR, but I see"
863 echo " $HOME/muq/bin"
864 echo "exists, so I'll go ahead and use that."
865 echo "==============================================="
866 echo
867 else
868 echo
869 echo "==============================================="
870 echo "Sorry: MUQDIR isn't set in the environment,"
871 echo "and $HOME/muq/bin does not exist, so I don't"
872 echo "know where to find my files. Please read muq/INSTALL."
873 echo "==============================================="
874 echo
875 exit 1
876 fi
877 fi
878 dnl
879 dnl Maybe issue warnings about needed by-hand patches:
880 dnl (Putting the following in AC_OUTPUT appears to result
881 dnl in it running when $DEFS is no longer defined.)
882 if test "$ac_cv_struct_tm_zone" != yes ; then
883 if test "$ac_cv_var_tzname" != yes ; then
884 echo ''
885 echo ' ++++++++++++++++++++++++++++++++++++++++++'
886 echo ' + I could not figure out your timezone. +'
887 echo ' + Please put a line like +'
888 echo ' + #define LOCAL_TIME_ZONE "PST", "PDT" +'
889 echo ' + in muq/h/Site-config.h and recompile. +'
890 echo ' ++++++++++++++++++++++++++++++++++++++++++'
891 echo ''
892 fi fi
893 dnl
894 dnl Create a 'Configure' that will when run
895 dnl create a Makefile2 from Makefile2.in,
896 dnl and a Config.h from Config.h.in (made in turn from Configure.in):
897 AC_OUTPUT(Makefile Makefile2,[dnl
898 #echo "x_includes $x_includes"
899 #echo "x_libraries $x_libraries"
900 #echo "no_x $no_x"
901 #echo "X_CFLAGS $X_CFLAGS"
902 #echo "X_LIBS $X_LIBS"
903 #echo "X_PRE_LIBS $X_PRE_LIBS"
904 #echo "X_EXTRA_LIBS $X_EXTRA_LIBS"
905 mv Config.h `${MUQDIR-$HOME/muq/bin}/muq-config hdir`
906 # What is config.status supposed to be good for?
907 # Move it to a name that doesn't clutter up the
908 # main codefile space, anyhow:
909 mv config.status Config.status
910 ])

brinkley@uw.edu
ViewVC Help
Powered by ViewVC 1.1.26