* Makefile.in: Added entries for new files: backtrace.c,
[bpt/guile.git] / libguile / configure.in
CommitLineData
0f2d19dd
JB
1AC_INIT(eval.c)
2AC_CONFIG_HEADER(scmconfig.h)
3
4. $srcdir/../GUILE-VERSION
5
074657b0
MD
6#--------------------------------------------------------------------
7#
8# User options
9#
10#--------------------------------------------------------------------
11
12AC_ARG_ENABLE(debug,
13[ --disable-debug Don't include debugging support])
14if test "$enableval" != n && test "$enableval" != no; then
15 AC_DEFINE(DEBUG_EXTENSIONS)
16 AC_DEFINE(READER_EXTENSIONS)
17 LIBOBJS="debug.o srcprop.o $LIBOBJS"
18fi
19
20#--------------------------------------------------------------------
21
0f2d19dd
JB
22test -z "$CFLAGS" && CFLAGS=-g
23test -z "$LDFLAGS" && LDFLAGS=-g
24
25AC_PROG_CC
26AC_PROG_CPP
27AC_PROG_RANLIB
28
29AC_AIX
30AC_ISC_POSIX
31AC_MINIX
32
027fde39
MD
33builtin(sinclude, ../aclocal.m4)
34CY_AC_WITH_THREADS
35CFLAGS="$CPPFLAGS $CFLAGS"
36
0f2d19dd
JB
37AC_C_CONST
38
39AC_HEADER_STDC
40AC_HEADER_DIRENT
41AC_HEADER_TIME
42AC_HEADER_SYS_WAIT
2170fce3 43AC_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)
0f2d19dd
JB
44
45AC_TYPE_GETGROUPS
46AC_TYPE_SIGNAL
b09ca643 47AC_TYPE_MODE_T
0f2d19dd 48
1fd838af 49AC_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)
0f2d19dd 50
14a7e04c 51AC_REPLACE_FUNCS(inet_aton strerror)
0f2d19dd
JB
52
53AC_STRUCT_ST_RDEV
54AC_STRUCT_ST_BLKSIZE
55AC_STRUCT_ST_BLOCKS
2170fce3 56GUILE_STRUCT_UTIMBUF
0f2d19dd
JB
57
58#--------------------------------------------------------------------
59#
60# Which way does the stack grow?
61#
62#--------------------------------------------------------------------
63
64AC_TRY_RUN(aux (l) unsigned long l;
65 { int x; exit (l >= ((unsigned long)&x)); }
66 main () { int q; aux((unsigned long)&q); },
67 AC_DEFINE(SCM_STACK_GROWS_UP),,AC_MSG_WARN(Guessing that stack grows down -- see scmconfig.h.in))
68
69
70AC_TRY_RUN(main () { exit (sizeof(float) != sizeof(long)); },
71 AC_DEFINE(SCM_SINGLES),,AC_DEFINE(SCM_SINGLES)
72 AC_MSG_WARN(Guessing that sizeof(long) == sizeof(float) -- see scmconfig.h.in))
73
2e18892a
GH
74AC_MSG_CHECKING(for struct linger)
75AC_CACHE_VAL(scm_cv_struct_linger,
76 AC_TRY_COMPILE([#include <sys/socket.h>],
77 [struct linger lgr; lgr.l_linger = 100],
78 scm_cv_struct_linger="yes",
79 scm_cv_struct_linger="no"))
80AC_MSG_RESULT($scm_cv_struct_linger)
81if test $scm_cv_struct_linger = yes; then
82 AC_DEFINE(HAVE_STRUCT_LINGER)
83fi
84
0f2d19dd
JB
85#--------------------------------------------------------------------
86#
87# How can you violate a stdio abstraction by setting a stream's fd?
88#
89#--------------------------------------------------------------------
90
91FD_SETTER=""
92
93if test "x$FD_SETTER" = x; then
94 AC_TRY_COMPILE(#include <stdio.h>
95, stdout->_file = 1,
96 FD_SETTER="((F)->_file = (D))")
97fi
98
99if test "x$FD_SETTER" = x; then
100 AC_TRY_COMPILE(#include <stdio.h>
101, stdout->_fileno,
102 FD_SETTER="((F)->_fileno = (D))")
103fi
104
105dnl
106dnl Add FD_SETTER tests for other systems here. Your test should
107dnl try a particular style of assigning to the descriptor
108dnl field(s) of a FILE* and define FD_SETTER accordingly.
109dnl
110dnl The value of FD_SETTER is used as a macro body, as in:
111dnl
112dnl #define SET_FILE_FD_FIELD(F,D) @FD_SETTER@
113dnl
114dnl F is a FILE* and D a descriptor (int).
115dnl
116
117test "x$FD_SETTER" != x && AC_DEFINE(HAVE_FD_SETTER)
118
027fde39
MD
119#--------------------------------------------------------------------
120#
121# Flags for thread support
122#
123#--------------------------------------------------------------------
124
125dnl
126dnl Set the appropriate flags!
127dnl
128if test "$cy_cv_threads_package" = FSU; then
129 AC_DEFINE(USE_FSU_PTHREADS, 1)
130 else if test "$cy_cv_threads_package" = COOP; then
131 AC_DEFINE(USE_COOP_THREADS, 1)
132 else if test "$cy_cv_threads_package" = MIT; then
133 AC_DEFINE(USE_MIT_PTHREADS, 1)
134 else if test "$cy_cv_threads_package" = PCthreads; then
135 AC_DEFINE(USE_PCTHREADS_PTHREADS, 1)
136 else if test "$cy_cv_threads_package" = unknown; then
137 AC_MSG_ERROR("cannot find threads installation")
138 fi
139 fi
140 fi
141 fi
142fi
143
144if test "$cy_cv_threads_package" != ""; then
145 AC_DEFINE(USE_THREADS)
146fi
147
d9098516
JB
148## If we're using GCC, ask for aggressive warnings.
149case "$GCC" in
150 yes ) CFLAGS="$CFLAGS -Wall -Wpointer-arith" ;;
151esac
0f2d19dd 152
9d7e1edf
JB
153AC_DEFINE_UNQUOTED(GUILE_MAJOR_VERSION, "$GUILE_MAJOR_VERSION")
154AC_DEFINE_UNQUOTED(GUILE_MINOR_VERSION, "$GUILE_MINOR_VERSION")
155AC_DEFINE_UNQUOTED(GUILE_VERSION, "$GUILE_VERSION")
0f2d19dd
JB
156
157AC_SUBST(CFLAGS)
158AC_SUBST(LDFLAGS)
159AC_SUBST(LIBOBJS)
160AC_SUBST(FD_SETTER)
0f2d19dd
JB
161AC_SUBST(XINCLUDES)
162AC_SUBST(GUILE_MAJOR_VERSION)
163AC_SUBST(GUILE_MINOR_VERSION)
164AC_SUBST(GUILE_VERSION)
165AC_OUTPUT(Makefile fd.h)
166
167dnl Local Variables:
168dnl comment-start: "dnl "
169dnl comment-end: ""
170dnl comment-start-skip: "\\bdnl\\b\\s *"
171dnl End: