2 AC_CONFIG_HEADER(scmconfig.h)
4 . $srcdir/../GUILE-VERSION
6 #--------------------------------------------------------------------
10 #--------------------------------------------------------------------
13 [ --disable-debug Don't include debugging support])
14 if test "$enableval" != n && test "$enableval" != no; then
15 AC_DEFINE(DEBUG_EXTENSIONS)
16 AC_DEFINE(READER_EXTENSIONS)
17 LIBOBJS="backtrace.o stacks.o debug.o srcprop.o $LIBOBJS"
20 #--------------------------------------------------------------------
22 test -z "$CFLAGS" && CFLAGS=-g
23 test -z "$LDFLAGS" && LDFLAGS=-g
33 builtin(sinclude, ../aclocal.m4)
35 CFLAGS="$CPPFLAGS $CFLAGS"
43 AC_CHECK_HEADERS(libc.h limits.h malloc.h memory.h string.h sys/ioctl.h sys/select.h sys/time.h sys/timeb.h sys/times.h sys/types.h sys/utime.h time.h unistd.h utime.h)
44 GUILE_HEADER_LIBC_WITH_UNISTD
50 AC_CHECK_FUNCS(ctermid ftime getcwd geteuid lstat mkdir mknod nice putenv readlink rename rmdir select setegid seteuid setlocale setpgid setsid strftime strptime symlink sync tcgetpgrp tcsetpgrp times uname waitpid)
52 AC_REPLACE_FUNCS(inet_aton strerror)
59 #--------------------------------------------------------------------
61 # Which way does the stack grow?
63 #--------------------------------------------------------------------
65 AC_TRY_RUN(aux (l) unsigned long l;
66 { int x; exit (l >= ((unsigned long)&x)); }
67 main () { int q; aux((unsigned long)&q); },
68 AC_DEFINE(SCM_STACK_GROWS_UP),,AC_MSG_WARN(Guessing that stack grows down -- see scmconfig.h.in))
71 AC_TRY_RUN(main () { exit (sizeof(float) != sizeof(long)); },
72 AC_DEFINE(SCM_SINGLES),,AC_DEFINE(SCM_SINGLES)
73 AC_MSG_WARN(Guessing that sizeof(long) == sizeof(float) -- see scmconfig.h.in))
75 AC_MSG_CHECKING(for struct linger)
76 AC_CACHE_VAL(scm_cv_struct_linger,
77 AC_TRY_COMPILE([#include <sys/socket.h>],
78 [struct linger lgr; lgr.l_linger = 100],
79 scm_cv_struct_linger="yes",
80 scm_cv_struct_linger="no"))
81 AC_MSG_RESULT($scm_cv_struct_linger)
82 if test $scm_cv_struct_linger = yes; then
83 AC_DEFINE(HAVE_STRUCT_LINGER)
86 #--------------------------------------------------------------------
88 # How can you violate a stdio abstraction by setting a stream's fd?
90 #--------------------------------------------------------------------
94 if test "x$FD_SETTER" = x; then
95 AC_TRY_COMPILE(#include <stdio.h>
97 FD_SETTER="((F)->_file = (D))")
100 if test "x$FD_SETTER" = x; then
101 AC_TRY_COMPILE(#include <stdio.h>
103 FD_SETTER="((F)->_fileno = (D))")
107 dnl Add FD_SETTER tests for other systems here. Your test should
108 dnl try a particular style of assigning to the descriptor
109 dnl field(s) of a FILE* and define FD_SETTER accordingly.
111 dnl The value of FD_SETTER is used as a macro body, as in:
113 dnl #define SET_FILE_FD_FIELD(F,D) @FD_SETTER@
115 dnl F is a FILE* and D a descriptor (int).
118 test "x$FD_SETTER" != x && AC_DEFINE(HAVE_FD_SETTER)
120 #--------------------------------------------------------------------
121 # How to find out whether a FILE structure contains buffered data.
122 # From Tk we have the following list:
123 # _cnt: Most UNIX systems
127 # Or, in GNU libc there are two fields, _gptr and _egptr, which
128 # have to be compared.
129 # These can also be known as _IO_read_ptr and _IO_read_end.
130 #--------------------------------------------------------------------
132 AC_MSG_CHECKING(how to get buffer char count from FILE structure)
133 AC_CACHE_VAL(scm_cv_struct_file_count,
134 AC_TRY_COMPILE([#include <stdio.h>],
135 [FILE *f = stdin; f->_cnt = 0],
136 scm_cv_struct_file_count="_cnt",
137 AC_TRY_COMPILE([#include <stdio.h>],
138 [FILE *f = stdin; f->_r = 0],
139 scm_cv_struct_file_count="_r",
140 AC_TRY_COMPILE([#include <stdio.h>],
141 [FILE *f = stdin; f->readCount = 0],
142 scm_cv_struct_file_count="readCount",
143 scm_cv_struct_file_count=""))))
144 if test "$scm_cv_struct_file_count"; then
145 AC_MSG_RESULT($scm_cv_struct_file_count)
146 AC_DEFINE_UNQUOTED(FILE_CNT_FIELD, $scm_cv_struct_file_count)
148 AC_CACHE_VAL(scm_cv_struct_file_gptr,
149 AC_TRY_COMPILE([#include <stdio.h>],
150 [FILE *f = stdin; f->_gptr = f->egptr;],
151 scm_cv_struct_file_gptr=1,
152 scm_cv_struct_file_gptr=""))
153 if test "$scm_cv_struct_gptr"; then
155 AC_DEFINE_UNQUOTED(FILE_CNT_GPTR, $scm_cv_struct_file_gptr)
157 AC_CACHE_VAL(scm_cv_struct_file_readptr,
158 AC_TRY_COMPILE([#include <stdio.h>],
159 [FILE *f = stdin; f->_IO_read_ptr = f->_IO_read_end;],
160 scm_cv_struct_file_readptr=1))
161 if test "$scm_cv_struct_file_readptr"; then
162 AC_MSG_RESULT(read_ptr)
163 AC_DEFINE_UNQUOTED(FILE_CNT_READPTR, $scm_cv_struct_file_readptr)
168 #--------------------------------------------------------------------
170 # Flags for thread support
172 #--------------------------------------------------------------------
175 dnl Set the appropriate flags!
177 if test "$cy_cv_threads_package" = FSU; then
178 AC_DEFINE(USE_FSU_PTHREADS, 1)
179 else if test "$cy_cv_threads_package" = COOP; then
180 AC_DEFINE(USE_COOP_THREADS, 1)
181 else if test "$cy_cv_threads_package" = MIT; then
182 AC_DEFINE(USE_MIT_PTHREADS, 1)
183 else if test "$cy_cv_threads_package" = PCthreads; then
184 AC_DEFINE(USE_PCTHREADS_PTHREADS, 1)
185 else if test "$cy_cv_threads_package" = unknown; then
186 AC_MSG_ERROR("cannot find threads installation")
193 if test "$cy_cv_threads_package" != ""; then
194 AC_DEFINE(USE_THREADS)
197 ## If we're using GCC, ask for aggressive warnings.
199 yes ) CFLAGS="$CFLAGS -Wall -Wpointer-arith" ;;
202 AC_DEFINE_UNQUOTED(GUILE_MAJOR_VERSION, "$GUILE_MAJOR_VERSION")
203 AC_DEFINE_UNQUOTED(GUILE_MINOR_VERSION, "$GUILE_MINOR_VERSION")
204 AC_DEFINE_UNQUOTED(GUILE_VERSION, "$GUILE_VERSION")
211 AC_SUBST(GUILE_MAJOR_VERSION)
212 AC_SUBST(GUILE_MINOR_VERSION)
213 AC_SUBST(GUILE_VERSION)
214 AC_OUTPUT(Makefile fd.h)
217 dnl comment-start: "dnl "
219 dnl comment-start-skip: "\\bdnl\\b\\s *"