Commit | Line | Data |
---|---|---|
0f2d19dd | 1 | AC_INIT(eval.c) |
733943b9 TT |
2 | AM_CONFIG_HEADER(scmconfig.h) |
3 | AM_INIT_GUILE_MODULE(libguile) | |
15ae1bee | 4 | AM_MAINTAINER_MODE |
0f2d19dd | 5 | |
074657b0 MD |
6 | #-------------------------------------------------------------------- |
7 | # | |
8 | # User options | |
9 | # | |
10 | #-------------------------------------------------------------------- | |
11 | ||
12 | AC_ARG_ENABLE(debug, | |
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) | |
9ab71a53 | 17 | LIBOBJS="backtrace.o stacks.o debug.o srcprop.o $LIBOBJS" |
074657b0 MD |
18 | fi |
19 | ||
abb2a7d0 MV |
20 | AC_ARG_ENABLE(dynamic-linking, |
21 | [ --enable-dynamic-linking Include support for dynamic linking]) | |
abb2a7d0 | 22 | |
280e515a MD |
23 | AC_ARG_ENABLE(guile-debug, |
24 | [ --enable-guile-debug Include internal debugging functions]) | |
25 | if test "$enableval" = y || test "$enableval" = yes; then | |
26 | AC_DEFINE(GUILE_DEBUG) | |
27 | fi | |
28 | ||
074657b0 MD |
29 | #-------------------------------------------------------------------- |
30 | ||
0f2d19dd JB |
31 | AC_PROG_CC |
32 | AC_PROG_CPP | |
1bb9f4db | 33 | AM_PROG_LIBTOOL |
0f2d19dd JB |
34 | |
35 | AC_AIX | |
36 | AC_ISC_POSIX | |
37 | AC_MINIX | |
38 | ||
027fde39 | 39 | CY_AC_WITH_THREADS |
ee2a8b9b JB |
40 | CFLAGS="$CFLAGS $cy_cv_threads_cflags" |
41 | THREAD_LIBS="$cy_cv_threads_libs" | |
42 | AC_SUBST(THREAD_LIBS) | |
027fde39 | 43 | |
0f2d19dd JB |
44 | AC_C_CONST |
45 | ||
46 | AC_HEADER_STDC | |
47 | AC_HEADER_DIRENT | |
48 | AC_HEADER_TIME | |
49 | AC_HEADER_SYS_WAIT | |
2170fce3 | 50 | 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) |
3594582b | 51 | GUILE_HEADER_LIBC_WITH_UNISTD |
0f2d19dd JB |
52 | |
53 | AC_TYPE_GETGROUPS | |
54 | AC_TYPE_SIGNAL | |
b09ca643 | 55 | AC_TYPE_MODE_T |
0f2d19dd | 56 | |
19468eff | 57 | AC_CHECK_FUNCS(ctermid ftime getcwd geteuid gettimeofday lstat mkdir mknod nice readlink rename rmdir select setegid seteuid setlocale setpgid setsid strftime strptime symlink sync tcgetpgrp tcsetpgrp times uname waitpid) |
0f2d19dd | 58 | |
19468eff | 59 | AC_REPLACE_FUNCS(inet_aton putenv strerror) |
0f2d19dd | 60 | |
48b96f4b JB |
61 | AC_FUNC_ALLOCA |
62 | ||
0f2d19dd JB |
63 | AC_STRUCT_ST_RDEV |
64 | AC_STRUCT_ST_BLKSIZE | |
65 | AC_STRUCT_ST_BLOCKS | |
b9525b92 | 66 | AC_STRUCT_TIMEZONE |
2170fce3 | 67 | GUILE_STRUCT_UTIMBUF |
0f2d19dd | 68 | |
abb2a7d0 | 69 | # Checks for dynamic linking |
5c988700 MV |
70 | |
71 | xtra_PLUGIN_guile_libs="" | |
72 | AC_SUBST(xtra_PLUGIN_guile_libs) | |
73 | ||
74 | if test "$enable_dynamic_linking" = "yes"; then | |
75 | ||
abb2a7d0 | 76 | AC_CHECK_LIB(dl,dlopen) |
5c988700 MV |
77 | if test "$ac_cv_lib_dl_dlopen" = "yes"; then |
78 | xtra_PLUGIN_guile_libs="-lguile -ldl" | |
d914fd5f | 79 | AC_DEFINE(DYNAMIC_LINKING) |
5c988700 | 80 | else |
d914fd5f | 81 | AC_CHECK_LIB(dld,dld_link) |
5c988700 MV |
82 | if test "$ac_cv_lib_dld_dld_link" = "yes"; then |
83 | xtra_PLUGIN_guile_libs="-lguile -ldld" | |
d914fd5f MV |
84 | AC_DEFINE(DYNAMIC_LINKING) |
85 | else | |
ee2a8b9b JB |
86 | AC_CHECK_LIB(m, main) |
87 | AC_CHECK_LIB(socket, main) | |
88 | AC_CHECK_LIB(nsl, main) | |
d914fd5f MV |
89 | AC_CHECK_FUNCS(shl_load) |
90 | if test "$ac_cv_func_shl_load" = "yes"; then | |
91 | AC_DEFINE(DYNAMIC_LINKING) | |
e500ef70 JB |
92 | fi |
93 | fi | |
94 | fi | |
5c988700 MV |
95 | |
96 | fi | |
97 | ||
0f2d19dd JB |
98 | #-------------------------------------------------------------------- |
99 | # | |
100 | # Which way does the stack grow? | |
101 | # | |
102 | #-------------------------------------------------------------------- | |
103 | ||
104 | AC_TRY_RUN(aux (l) unsigned long l; | |
105 | { int x; exit (l >= ((unsigned long)&x)); } | |
106 | main () { int q; aux((unsigned long)&q); }, | |
107 | AC_DEFINE(SCM_STACK_GROWS_UP),,AC_MSG_WARN(Guessing that stack grows down -- see scmconfig.h.in)) | |
108 | ||
109 | ||
110 | AC_TRY_RUN(main () { exit (sizeof(float) != sizeof(long)); }, | |
111 | AC_DEFINE(SCM_SINGLES),,AC_DEFINE(SCM_SINGLES) | |
112 | AC_MSG_WARN(Guessing that sizeof(long) == sizeof(float) -- see scmconfig.h.in)) | |
113 | ||
2e18892a GH |
114 | AC_MSG_CHECKING(for struct linger) |
115 | AC_CACHE_VAL(scm_cv_struct_linger, | |
b3310939 JB |
116 | AC_TRY_COMPILE([ |
117 | #include <sys/types.h> | |
118 | #include <sys/socket.h>], | |
2e18892a GH |
119 | [struct linger lgr; lgr.l_linger = 100], |
120 | scm_cv_struct_linger="yes", | |
121 | scm_cv_struct_linger="no")) | |
122 | AC_MSG_RESULT($scm_cv_struct_linger) | |
123 | if test $scm_cv_struct_linger = yes; then | |
124 | AC_DEFINE(HAVE_STRUCT_LINGER) | |
125 | fi | |
126 | ||
0f2d19dd JB |
127 | #-------------------------------------------------------------------- |
128 | # | |
129 | # How can you violate a stdio abstraction by setting a stream's fd? | |
130 | # | |
131 | #-------------------------------------------------------------------- | |
132 | ||
67ec3667 GH |
133 | AC_MSG_CHECKING(how to set a stream file descriptor) |
134 | AC_CACHE_VAL(scm_cv_fd_setter, | |
135 | AC_TRY_COMPILE([#include <stdio.h>], | |
136 | [stdout->_file = 1], | |
137 | scm_cv_fd_setter="_file", | |
138 | AC_TRY_COMPILE([#include <stdio.h>], | |
139 | [stdout->_fileno = 1], | |
140 | scm_cv_fd_setter="_fileno", | |
141 | scm_cv_fd_setter=""))) | |
0f2d19dd | 142 | |
67ec3667 GH |
143 | if test "$scm_cv_fd_setter"; then |
144 | AC_MSG_RESULT($scm_cv_fd_setter) | |
145 | AC_DEFINE_UNQUOTED(FD_SETTER, $scm_cv_fd_setter) | |
146 | else | |
147 | AC_MSG_RESULT(we couldn't do it!) | |
0f2d19dd JB |
148 | fi |
149 | ||
f93ddd39 GH |
150 | #-------------------------------------------------------------------- |
151 | # How to find out whether a FILE structure contains buffered data. | |
152 | # From Tk we have the following list: | |
153 | # _cnt: Most UNIX systems | |
154 | # __cnt: HPUX | |
155 | # _r: BSD | |
156 | # readCount: Sprite | |
157 | # Or, in GNU libc there are two fields, _gptr and _egptr, which | |
158 | # have to be compared. | |
159 | # These can also be known as _IO_read_ptr and _IO_read_end. | |
160 | #-------------------------------------------------------------------- | |
161 | ||
162 | AC_MSG_CHECKING(how to get buffer char count from FILE structure) | |
163 | AC_CACHE_VAL(scm_cv_struct_file_count, | |
164 | AC_TRY_COMPILE([#include <stdio.h>], | |
165 | [FILE *f = stdin; f->_cnt = 0], | |
166 | scm_cv_struct_file_count="_cnt", | |
167 | AC_TRY_COMPILE([#include <stdio.h>], | |
168 | [FILE *f = stdin; f->_r = 0], | |
169 | scm_cv_struct_file_count="_r", | |
170 | AC_TRY_COMPILE([#include <stdio.h>], | |
171 | [FILE *f = stdin; f->readCount = 0], | |
172 | scm_cv_struct_file_count="readCount", | |
173 | scm_cv_struct_file_count="")))) | |
174 | if test "$scm_cv_struct_file_count"; then | |
175 | AC_MSG_RESULT($scm_cv_struct_file_count) | |
176 | AC_DEFINE_UNQUOTED(FILE_CNT_FIELD, $scm_cv_struct_file_count) | |
177 | else | |
178 | AC_CACHE_VAL(scm_cv_struct_file_gptr, | |
179 | AC_TRY_COMPILE([#include <stdio.h>], | |
180 | [FILE *f = stdin; f->_gptr = f->egptr;], | |
181 | scm_cv_struct_file_gptr=1, | |
182 | scm_cv_struct_file_gptr="")) | |
183 | if test "$scm_cv_struct_gptr"; then | |
184 | AC_MSG_RESULT(gptr) | |
185 | AC_DEFINE_UNQUOTED(FILE_CNT_GPTR, $scm_cv_struct_file_gptr) | |
186 | else | |
187 | AC_CACHE_VAL(scm_cv_struct_file_readptr, | |
188 | AC_TRY_COMPILE([#include <stdio.h>], | |
189 | [FILE *f = stdin; f->_IO_read_ptr = f->_IO_read_end;], | |
190 | scm_cv_struct_file_readptr=1)) | |
191 | if test "$scm_cv_struct_file_readptr"; then | |
192 | AC_MSG_RESULT(read_ptr) | |
193 | AC_DEFINE_UNQUOTED(FILE_CNT_READPTR, $scm_cv_struct_file_readptr) | |
67ec3667 GH |
194 | else |
195 | AC_MSG_RESULT(we couldn't do it!) | |
f93ddd39 GH |
196 | fi |
197 | fi | |
198 | fi | |
199 | ||
027fde39 MD |
200 | #-------------------------------------------------------------------- |
201 | # | |
202 | # Flags for thread support | |
203 | # | |
204 | #-------------------------------------------------------------------- | |
205 | ||
206 | dnl | |
207 | dnl Set the appropriate flags! | |
208 | dnl | |
209 | if test "$cy_cv_threads_package" = FSU; then | |
210 | AC_DEFINE(USE_FSU_PTHREADS, 1) | |
211 | else if test "$cy_cv_threads_package" = COOP; then | |
212 | AC_DEFINE(USE_COOP_THREADS, 1) | |
213 | else if test "$cy_cv_threads_package" = MIT; then | |
214 | AC_DEFINE(USE_MIT_PTHREADS, 1) | |
215 | else if test "$cy_cv_threads_package" = PCthreads; then | |
216 | AC_DEFINE(USE_PCTHREADS_PTHREADS, 1) | |
217 | else if test "$cy_cv_threads_package" = unknown; then | |
218 | AC_MSG_ERROR("cannot find threads installation") | |
219 | fi | |
220 | fi | |
221 | fi | |
222 | fi | |
223 | fi | |
224 | ||
225 | if test "$cy_cv_threads_package" != ""; then | |
226 | AC_DEFINE(USE_THREADS) | |
227 | fi | |
228 | ||
d9098516 JB |
229 | ## If we're using GCC, ask for aggressive warnings. |
230 | case "$GCC" in | |
231 | yes ) CFLAGS="$CFLAGS -Wall -Wpointer-arith" ;; | |
232 | esac | |
0f2d19dd | 233 | |
ee78fbb0 | 234 | AC_PROG_AWK |
ee78fbb0 | 235 | |
9dcf6a02 JB |
236 | ## If we're creating a shared library (using libtool!), then we'll |
237 | ## need to generate a list of .lo files corresponding to the .o files | |
238 | ## given in LIBOBJS. We'll call it LIBLOBJS. | |
239 | LIBLOBJS="`echo ${LIBOBJS} | sed 's/\.o/.lo/g'`" | |
240 | ||
9d7e1edf JB |
241 | AC_DEFINE_UNQUOTED(GUILE_MAJOR_VERSION, "$GUILE_MAJOR_VERSION") |
242 | AC_DEFINE_UNQUOTED(GUILE_MINOR_VERSION, "$GUILE_MINOR_VERSION") | |
243 | AC_DEFINE_UNQUOTED(GUILE_VERSION, "$GUILE_VERSION") | |
0f2d19dd | 244 | |
1146b6cd | 245 | AC_SUBST(AWK) |
9dcf6a02 | 246 | AC_SUBST(LIBLOBJS) |
67ec3667 | 247 | AC_OUTPUT([Makefile guile-snarf PLUGIN/guile.libs], [chmod +x guile-snarf]) |
0f2d19dd JB |
248 | |
249 | dnl Local Variables: | |
250 | dnl comment-start: "dnl " | |
251 | dnl comment-end: "" | |
252 | dnl comment-start-skip: "\\bdnl\\b\\s *" | |
253 | dnl End: |