Commit | Line | Data |
---|---|---|
733943b9 | 1 | dnl Process this file with autoconf to produce configure. |
0f2d19dd | 2 | AC_INIT(Makefile.in) |
2d26def0 | 3 | . $srcdir/GUILE-VERSION |
3a629497 | 4 | AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define) |
15ae1bee | 5 | AM_MAINTAINER_MODE |
3a629497 | 6 | AM_CONFIG_HEADER(libguile/scmconfig.h) |
2d26def0 | 7 | |
3a629497 JB |
8 | #-------------------------------------------------------------------- |
9 | # | |
10 | # User options | |
11 | # | |
12 | #-------------------------------------------------------------------- | |
86789f9b | 13 | |
3a629497 JB |
14 | AC_ARG_ENABLE(debug, |
15 | [ --disable-debug Don't include debugging support]) | |
16 | if test "$enableval" != n && test "$enableval" != no; then | |
17 | AC_DEFINE(DEBUG_EXTENSIONS) | |
18 | AC_DEFINE(READER_EXTENSIONS) | |
19 | LIBOBJS="backtrace.o stacks.o debug.o srcprop.o $LIBOBJS" | |
20 | fi | |
21 | ||
22 | AC_ARG_ENABLE(dynamic-linking, | |
af8865f7 JB |
23 | [ --enable-dynamic-linking Include support for dynamic linking],, |
24 | enable_dynamic_linking=yes) | |
3a629497 JB |
25 | |
26 | AC_ARG_ENABLE(guile-debug, | |
27 | [ --enable-guile-debug Include internal debugging functions]) | |
28 | if test "$enableval" = y || test "$enableval" = yes; then | |
29 | AC_DEFINE(GUILE_DEBUG) | |
30 | fi | |
31 | ||
32 | #-------------------------------------------------------------------- | |
33 | ||
34 | AC_PROG_CC | |
35 | AC_PROG_CPP | |
36 | AM_PROG_LIBTOOL | |
37 | ||
38 | AC_AIX | |
39 | AC_ISC_POSIX | |
40 | AC_MINIX | |
41 | ||
42 | AC_C_CONST | |
43 | ||
44 | AC_HEADER_STDC | |
45 | AC_HEADER_DIRENT | |
46 | AC_HEADER_TIME | |
47 | AC_HEADER_SYS_WAIT | |
e9cd5d2f | 48 | AC_CHECK_HEADERS(libc.h limits.h malloc.h memory.h string.h regex.h rxposix.h rx/rxposix.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) |
3a629497 JB |
49 | GUILE_HEADER_LIBC_WITH_UNISTD |
50 | ||
51 | AC_TYPE_GETGROUPS | |
52 | AC_TYPE_SIGNAL | |
53 | AC_TYPE_MODE_T | |
54 | ||
5852c051 JB |
55 | AC_CHECK_LIB(m, main) |
56 | AC_CHECK_FUNC(gethostbyname) | |
57 | if test $ac_cv_func_gethostbyname = no; then | |
58 | AC_CHECK_LIB(nsl, gethostbyname) | |
59 | fi | |
60 | AC_CHECK_FUNC(connect) | |
61 | if test $ac_cv_func_connect = no; then | |
62 | AC_CHECK_LIB(socket, connect) | |
63 | fi | |
64 | ||
90fcac06 JB |
65 | # Checks for dynamic linking |
66 | ||
5852c051 JB |
67 | if test "$enable_dynamic_linking" = "yes"; then |
68 | ||
69 | AC_CHECK_LIB(dl,dlopen) | |
70 | if test "$ac_cv_lib_dl_dlopen" = "yes"; then | |
5852c051 JB |
71 | AC_DEFINE(DYNAMIC_LINKING) |
72 | else | |
73 | AC_CHECK_LIB(dld,dld_link) | |
74 | if test "$ac_cv_lib_dld_dld_link" = "yes"; then | |
5852c051 JB |
75 | AC_DEFINE(DYNAMIC_LINKING) |
76 | else | |
77 | AC_CHECK_FUNCS(shl_load) | |
78 | if test "$ac_cv_func_shl_load" = "yes"; then | |
79 | AC_DEFINE(DYNAMIC_LINKING) | |
a4995389 MV |
80 | else |
81 | AC_CHECK_FUNCS(dlopen) | |
82 | if test "$ac_cv_func_dlopen" = "yes"; then | |
83 | AC_DEFINE(DYNAMIC_LINKING) | |
84 | fi | |
5852c051 JB |
85 | fi |
86 | fi | |
87 | fi | |
88 | ||
89 | fi | |
90 | ||
91 | ||
e1a191a8 GH |
92 | AC_CHECK_FUNCS(ctermid ftime getcwd geteuid gethostent gettimeofday lstat mkdir mknod nice readlink rename rmdir select setegid seteuid setlocale setpgid setsid sigaction strftime strptime symlink sync tcgetpgrp tcsetpgrp times uname waitpid) |
93 | ||
da88f0cb JB |
94 | dnl <GNU-WIN32 hacks> |
95 | ||
96 | AC_CHECK_HEADER(sys/un.h, have_sys_un_h=1) | |
97 | if test -n "$have_sys_un_h" ; then | |
98 | AC_DEFINE(HAVE_UNIX_DOMAIN_SOCKETS) | |
99 | fi | |
100 | ||
101 | AC_CHECK_FUNCS(socketpair getgroups setpwent pause tzset) | |
102 | ||
f4e5b810 GH |
103 | dnl I don't know what this prefixing of cygwin32_ is for. |
104 | dnl scmconfig.h wasn't updated with the test results. | |
105 | dnl so use AC_CHECK_FUNCS for now. | |
106 | ||
107 | dnl how about: | |
108 | dnl save confdefs.h | |
109 | dnl if test $ac_cv_cigwin = yes; then | |
110 | dnl modify confdefs.h | |
111 | dnl fi | |
112 | dnl AC_CHECK_FUNCS... | |
113 | dnl restore confdefs.h | |
114 | ||
115 | dnl cp confdefs.h confdefs.h.bak | |
116 | dnl for func in sethostent endhostent getnetent setnetent endnetent getprotoent endprotoent getservent endservent getnetbyaddr getnetbyname inet_lnaof inet_makeaddr inet_netof ; do | |
117 | dnl cp confdefs.h.bak confdefs.h | |
118 | dnl cat >> confdefs.h << EOF | |
119 | dnl #ifdef __CYGWIN32__ | |
120 | dnl #define $func cygwin32_$func | |
121 | dnl #endif | |
122 | dnl EOF | |
123 | dnl AC_CHECK_FUNC($func) | |
124 | dnl done | |
125 | dnl cp confdefs.h.bak confdefs.h | |
126 | ||
127 | AC_CHECK_FUNCS(sethostent endhostent getnetent setnetent endnetent getprotoent endprotoent getservent endservent getnetbyaddr getnetbyname inet_lnaof inet_makeaddr inet_netof) | |
da88f0cb JB |
128 | |
129 | dnl </GNU-WIN32 hacks> | |
130 | ||
e1a191a8 GH |
131 | AC_CACHE_CHECK([for restartable system calls], scm_cv_restarts, |
132 | if test $ac_cv_func_sigaction = yes; then | |
133 | [AC_TRY_COMPILE([#include <signal.h>], | |
134 | [int a = SA_RESTART], | |
135 | scm_cv_restarts=yes, | |
136 | scm_cv_restarts=no)] | |
137 | else | |
138 | scm_cv_restarts=no | |
139 | fi) | |
140 | if test $scm_cv_restarts = yes; then | |
141 | AC_DEFINE(HAVE_RESTARTS) | |
142 | fi | |
143 | ||
e9cd5d2f MD |
144 | if test "$ac_cv_header_regex_h" = yes || |
145 | test "$ac_cv_header_rxposix_h" = yes || | |
146 | test "$ac_cv_header_rx_rxposix_h" = yes; then | |
0b89e78e MD |
147 | GUILE_NAMED_CHECK_FUNC(regcomp, norx, [LIBOBJS="regex-posix.o $LIBOBJS"], |
148 | [AC_CHECK_LIB(rx, main) | |
149 | GUILE_NAMED_CHECK_FUNC(regcomp, rx, [LIBOBJS="regex-posix.o $LIBOBJS"])] | |
150 | ) | |
e9cd5d2f MD |
151 | dnl The following should not be necessary, but for some reason |
152 | dnl autoheader misses it if we don't include it! | |
0b89e78e MD |
153 | if test "$ac_cv_func_regcomp_norx" = yes || |
154 | test "$ac_cv_func_regcomp_rx" = yes; then | |
e9cd5d2f MD |
155 | AC_DEFINE(HAVE_REGCOMP) |
156 | fi | |
da88f0cb | 157 | fi |
8e1bfcd0 | 158 | |
3a629497 JB |
159 | AC_REPLACE_FUNCS(inet_aton putenv strerror) |
160 | ||
4a5fa91c TP |
161 | # When testing for the presence of alloca, we need to add alloca.o |
162 | # explicitly to LIBOBJS to make sure that it is translated to | |
163 | # `alloca.lo' for libtool later on. This can and should be done more cleanly. | |
3a629497 | 164 | AC_FUNC_ALLOCA |
4a5fa91c | 165 | if test "$ALLOCA" = "alloca.o"; then LIBOBJS="alloca.o $LIBOBJS"; fi |
3a629497 JB |
166 | |
167 | AC_STRUCT_ST_RDEV | |
168 | AC_STRUCT_ST_BLKSIZE | |
075edbde JB |
169 | |
170 | # We could use AC_STRUCT_ST_BLOCKS here, but that adds fileblocks.o to | |
171 | # LIBOBJS, which we don't need. This seems more direct. | |
172 | AC_CACHE_CHECK([for st_blocks in struct stat], ac_cv_struct_st_blocks, | |
173 | [AC_TRY_COMPILE([#include <sys/types.h> | |
174 | #include <sys/stat.h>], [struct stat s; s.st_blocks;], | |
175 | ac_cv_struct_st_blocks=yes, ac_cv_struct_st_blocks=no)]) | |
176 | if test $ac_cv_struct_st_blocks = yes; then | |
177 | AC_DEFINE(HAVE_ST_BLOCKS) | |
178 | fi | |
179 | ||
3a629497 JB |
180 | AC_STRUCT_TIMEZONE |
181 | GUILE_STRUCT_UTIMBUF | |
182 | ||
3a629497 JB |
183 | #-------------------------------------------------------------------- |
184 | # | |
185 | # Which way does the stack grow? | |
186 | # | |
187 | #-------------------------------------------------------------------- | |
188 | ||
189 | AC_TRY_RUN(aux (l) unsigned long l; | |
190 | { int x; exit (l >= ((unsigned long)&x)); } | |
191 | main () { int q; aux((unsigned long)&q); }, | |
192 | AC_DEFINE(SCM_STACK_GROWS_UP),,AC_MSG_WARN(Guessing that stack grows down -- see scmconfig.h.in)) | |
193 | ||
194 | ||
195 | AC_TRY_RUN(main () { exit (sizeof(float) != sizeof(long)); }, | |
196 | AC_DEFINE(SCM_SINGLES),,AC_DEFINE(SCM_SINGLES) | |
197 | AC_MSG_WARN(Guessing that sizeof(long) == sizeof(float) -- see scmconfig.h.in)) | |
198 | ||
199 | AC_MSG_CHECKING(for struct linger) | |
200 | AC_CACHE_VAL(scm_cv_struct_linger, | |
201 | AC_TRY_COMPILE([ | |
202 | #include <sys/types.h> | |
203 | #include <sys/socket.h>], | |
204 | [struct linger lgr; lgr.l_linger = 100], | |
205 | scm_cv_struct_linger="yes", | |
206 | scm_cv_struct_linger="no")) | |
207 | AC_MSG_RESULT($scm_cv_struct_linger) | |
208 | if test $scm_cv_struct_linger = yes; then | |
209 | AC_DEFINE(HAVE_STRUCT_LINGER) | |
210 | fi | |
211 | ||
212 | #-------------------------------------------------------------------- | |
213 | # | |
214 | # How can you violate a stdio abstraction by setting a stream's fd? | |
215 | # | |
216 | #-------------------------------------------------------------------- | |
217 | ||
218 | AC_MSG_CHECKING(how to set a stream file descriptor) | |
219 | AC_CACHE_VAL(scm_cv_fd_setter, | |
220 | AC_TRY_COMPILE([#include <stdio.h>], | |
221 | [stdout->_file = 1], | |
222 | scm_cv_fd_setter="_file", | |
223 | AC_TRY_COMPILE([#include <stdio.h>], | |
224 | [stdout->_fileno = 1], | |
225 | scm_cv_fd_setter="_fileno", | |
226 | scm_cv_fd_setter=""))) | |
227 | ||
228 | if test "$scm_cv_fd_setter"; then | |
229 | AC_MSG_RESULT($scm_cv_fd_setter) | |
230 | AC_DEFINE_UNQUOTED(FD_SETTER, $scm_cv_fd_setter) | |
231 | else | |
232 | AC_MSG_RESULT(we couldn't do it!) | |
233 | fi | |
234 | ||
235 | #-------------------------------------------------------------------- | |
236 | # How to find out whether a FILE structure contains buffered data. | |
237 | # From Tk we have the following list: | |
238 | # _cnt: Most UNIX systems | |
239 | # __cnt: HPUX | |
240 | # _r: BSD | |
241 | # readCount: Sprite | |
242 | # Or, in GNU libc there are two fields, _gptr and _egptr, which | |
243 | # have to be compared. | |
244 | # These can also be known as _IO_read_ptr and _IO_read_end. | |
245 | #-------------------------------------------------------------------- | |
246 | ||
247 | AC_MSG_CHECKING(how to get buffer char count from FILE structure) | |
248 | AC_CACHE_VAL(scm_cv_struct_file_count, | |
249 | AC_TRY_COMPILE([#include <stdio.h>], | |
250 | [FILE *f = stdin; f->_cnt = 0], | |
251 | scm_cv_struct_file_count="_cnt", | |
252 | AC_TRY_COMPILE([#include <stdio.h>], | |
253 | [FILE *f = stdin; f->_r = 0], | |
254 | scm_cv_struct_file_count="_r", | |
255 | AC_TRY_COMPILE([#include <stdio.h>], | |
256 | [FILE *f = stdin; f->readCount = 0], | |
257 | scm_cv_struct_file_count="readCount", | |
258 | scm_cv_struct_file_count="")))) | |
259 | if test "$scm_cv_struct_file_count"; then | |
260 | AC_MSG_RESULT($scm_cv_struct_file_count) | |
261 | AC_DEFINE_UNQUOTED(FILE_CNT_FIELD, $scm_cv_struct_file_count) | |
262 | else | |
263 | AC_CACHE_VAL(scm_cv_struct_file_gptr, | |
264 | AC_TRY_COMPILE([#include <stdio.h>], | |
265 | [FILE *f = stdin; f->_gptr = f->egptr;], | |
266 | scm_cv_struct_file_gptr=1, | |
267 | scm_cv_struct_file_gptr="")) | |
268 | if test "$scm_cv_struct_gptr"; then | |
269 | AC_MSG_RESULT(gptr) | |
270 | AC_DEFINE_UNQUOTED(FILE_CNT_GPTR, $scm_cv_struct_file_gptr) | |
271 | else | |
272 | AC_CACHE_VAL(scm_cv_struct_file_readptr, | |
273 | AC_TRY_COMPILE([#include <stdio.h>], | |
274 | [FILE *f = stdin; f->_IO_read_ptr = f->_IO_read_end;], | |
275 | scm_cv_struct_file_readptr=1)) | |
276 | if test "$scm_cv_struct_file_readptr"; then | |
277 | AC_MSG_RESULT(read_ptr) | |
278 | AC_DEFINE_UNQUOTED(FILE_CNT_READPTR, $scm_cv_struct_file_readptr) | |
279 | else | |
280 | AC_MSG_RESULT(we couldn't do it!) | |
281 | fi | |
282 | fi | |
283 | fi | |
284 | ||
285 | #-------------------------------------------------------------------- | |
286 | # | |
287 | # Flags for thread support | |
288 | # | |
289 | #-------------------------------------------------------------------- | |
290 | ||
291 | CY_AC_WITH_THREADS | |
292 | CFLAGS="$CFLAGS $cy_cv_threads_cflags" | |
293 | THREAD_LIBS="$cy_cv_threads_libs" | |
294 | AC_SUBST(THREAD_LIBS) | |
295 | ||
296 | dnl | |
297 | dnl Set the appropriate flags! | |
298 | dnl | |
299 | if test "$cy_cv_threads_package" = FSU; then | |
300 | AC_DEFINE(USE_FSU_PTHREADS, 1) | |
301 | else if test "$cy_cv_threads_package" = COOP; then | |
302 | AC_DEFINE(USE_COOP_THREADS, 1) | |
303 | else if test "$cy_cv_threads_package" = MIT; then | |
304 | AC_DEFINE(USE_MIT_PTHREADS, 1) | |
305 | else if test "$cy_cv_threads_package" = PCthreads; then | |
306 | AC_DEFINE(USE_PCTHREADS_PTHREADS, 1) | |
307 | else if test "$cy_cv_threads_package" = unknown; then | |
308 | AC_MSG_ERROR("cannot find threads installation") | |
309 | fi | |
310 | fi | |
311 | fi | |
0f2d19dd | 312 | fi |
3a629497 JB |
313 | fi |
314 | ||
315 | if test "$cy_cv_threads_package" != ""; then | |
316 | AC_DEFINE(USE_THREADS) | |
317 | LIBOBJS="$LIBOBJS threads.o" | |
318 | fi | |
319 | ||
320 | ## If we're using GCC, ask for aggressive warnings. | |
321 | case "$GCC" in | |
322 | yes ) CFLAGS="$CFLAGS -Wall -Wpointer-arith" ;; | |
323 | esac | |
324 | ||
325 | AC_PROG_AWK | |
326 | ||
327 | ## If we're creating a shared library (using libtool!), then we'll | |
328 | ## need to generate a list of .lo files corresponding to the .o files | |
329 | ## given in LIBOBJS. We'll call it LIBLOBJS. | |
330 | LIBLOBJS="`echo ${LIBOBJS} | sed 's/\.o/.lo/g'`" | |
331 | ||
7c86ae05 JB |
332 | AC_SUBST(GUILE_MAJOR_VERSION) |
333 | AC_SUBST(GUILE_MINOR_VERSION) | |
334 | AC_SUBST(GUILE_VERSION) | |
335 | ||
336 | dnl timestamping the interpreter and scheme libraries: | |
337 | dnl | |
338 | dnl Help us notice when we're running one version of the Guile | |
339 | dnl interpreter against a different version of the ice-9 Scheme code. | |
340 | dnl This will definitely detect version skew due to differing | |
341 | dnl snapshots and releases, but may not catch skew for the developers. | |
342 | dnl Hopefully it will not detect skew when there is none; if that | |
343 | dnl happens, the warnings will be useless, and we should remove this. | |
344 | GUILE_STAMP="`date`" | |
345 | AC_SUBST(GUILE_STAMP) | |
3a629497 JB |
346 | |
347 | AC_SUBST(AWK) | |
348 | AC_SUBST(LIBLOBJS) | |
349 | ||
350 | ||
351 | dnl ====================================================================== | |
352 | dnl configuration for the Qt package | |
353 | dnl ====================================================================== | |
354 | ||
355 | threads_enabled=false | |
356 | if test "$cy_cv_threads_package" = COOP; then | |
357 | threads_enabled=true | |
358 | fi | |
359 | ||
360 | # Determine the host we are working on | |
361 | AC_CANONICAL_HOST | |
362 | ||
77c7a433 JB |
363 | # How can we refer to the qt source directory from within the qt build |
364 | # directory? For headers, we can rely on the fact that the qt src | |
365 | # directory appears in the #include path. | |
366 | ||
367 | qtsrcdir="`(cd $srcdir; pwd)`/qt" | |
368 | ||
3a629497 JB |
369 | changequote(,)dnl We use [ and ] in a regexp in the case |
370 | case "$host" in | |
371 | i[3456]86-*-*) | |
77c7a433 JB |
372 | qtmds_s=$qtsrcdir/md/i386.s |
373 | qtmd_h=md/i386.h | |
374 | qtmdc_c=$qtsrcdir/md/null.c | |
3a629497 | 375 | ;; |
894e484e | 376 | mips-sgi-irix[56]*) |
77c7a433 JB |
377 | qtmds_s=$qtsrcdir/md/mips-irix5.s |
378 | qtmd_h=md/mips.h | |
379 | qtmdc_c=$qtsrcdir/md/null.c | |
380 | qtdmdb_s=$qtsrcdir/md/mips_b.s | |
3a629497 JB |
381 | ;; |
382 | mips-*-*) | |
77c7a433 JB |
383 | qtmds_s=$qtsrcdir/md/mips.s |
384 | qtmd_h=md/mips.h | |
385 | qtmdc_c=$qtsrcdir/md/null.c | |
386 | qtdmdb_s=$qtsrcdir/md/mips_b.s | |
3a629497 | 387 | ;; |
2a18e748 | 388 | sparc-*-sunos*) |
77c7a433 JB |
389 | qtmd_h=md/sparc.h |
390 | qtmdc_c=$qtsrcdir/md/null.c | |
2a18e748 JB |
391 | qtmds_s=$qtsrcdir/md/_sparc.s |
392 | qtdmdb_s=$qtsrcdir/md/_sparc_b.s | |
3a629497 JB |
393 | ;; |
394 | sparc-*-*) | |
77c7a433 JB |
395 | qtmd_h=md/sparc.h |
396 | qtmdc_c=$qtsrcdir/md/null.c | |
2a18e748 JB |
397 | qtmds_s=$qtsrcdir/md/sparc.s |
398 | qtdmdb_s=$qtsrcdir/md/sparc_b.s | |
3a629497 | 399 | ;; |
757cfb94 MD |
400 | alpha-*-*) |
401 | qtmd_h=md/axp.h | |
402 | qtmdc_c=$qtsrcdir/md/null.c | |
403 | qtmds_s=$qtsrcdir/md/axp.s | |
404 | qtdmdb_s=$qtsrcdir/md/axp_b.s | |
405 | ;; | |
3a629497 JB |
406 | *) |
407 | echo "Unknown configuration; threads package disabled" | |
408 | threads_enabled=false | |
409 | ;; | |
410 | esac | |
411 | changequote([, ]) | |
412 | ||
413 | ||
414 | if $threads_enabled; then | |
415 | target_libs=libqt.a | |
416 | else | |
417 | target_libs= | |
418 | fi | |
419 | ||
420 | # Give the Makefile the names of the object files that will be | |
421 | # generated by compiling $qtmdc_c and $qtmds_s. | |
422 | qtmdc_o="`echo ${qtmdc_c} | sed -e 's:^.*/::' | sed -e 's:\.c$:\.o:'`" | |
423 | qtmds_o="`echo ${qtmds_s} | sed -e 's:^.*/::' | sed -e 's:\.s$:\.o:'`" | |
424 | ||
425 | AC_SUBST(target_libs) | |
426 | AC_SUBST(qtmd_h) | |
427 | AC_SUBST(qtmdc_c) | |
428 | AC_SUBST(qtmdc_o) | |
429 | AC_SUBST(qtmds_s) | |
430 | AC_SUBST(qtmds_o) | |
431 | AC_SUBST(qtmdb_s) | |
0f2d19dd | 432 | |
9ba3d403 | 433 | AC_OUTPUT([Makefile libguile/Makefile libguile/guile-snarf ice-9/Makefile ice-9/version.scm qt/Makefile qt/qt.h qt/md/Makefile qt/time/Makefile build/Makefile], [chmod +x libguile/guile-snarf]) |
0f2d19dd | 434 | |
3a629497 JB |
435 | dnl Local Variables: |
436 | dnl comment-start: "dnl " | |
437 | dnl comment-end: "" | |
438 | dnl comment-start-skip: "\\bdnl\\b\\s *" | |
439 | dnl End: |