1 dnl Process this file with autoconf to produce configure.
3 . $srcdir/GUILE-VERSION
4 AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
6 AM_CONFIG_HEADER(libguile/scmconfig.h)
8 #--------------------------------------------------------------------
12 #--------------------------------------------------------------------
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"
22 AC_ARG_ENABLE(dynamic-linking,
23 [ --enable-dynamic-linking Include support for dynamic linking],,
24 enable_dynamic_linking=yes)
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)
32 #--------------------------------------------------------------------
48 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)
49 GUILE_HEADER_LIBC_WITH_UNISTD
55 AC_CHECK_LIB(rx, main)
57 # Checks for dynamic linking
60 AC_CHECK_FUNC(gethostbyname)
61 if test $ac_cv_func_gethostbyname = no; then
62 AC_CHECK_LIB(nsl, gethostbyname)
64 AC_CHECK_FUNC(connect)
65 if test $ac_cv_func_connect = no; then
66 AC_CHECK_LIB(socket, connect)
69 if test "$enable_dynamic_linking" = "yes"; then
71 AC_CHECK_LIB(dl,dlopen)
72 if test "$ac_cv_lib_dl_dlopen" = "yes"; then
73 AC_DEFINE(DYNAMIC_LINKING)
75 AC_CHECK_LIB(dld,dld_link)
76 if test "$ac_cv_lib_dld_dld_link" = "yes"; then
77 AC_DEFINE(DYNAMIC_LINKING)
79 AC_CHECK_FUNCS(shl_load)
80 if test "$ac_cv_func_shl_load" = "yes"; then
81 AC_DEFINE(DYNAMIC_LINKING)
89 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)
91 AC_CACHE_CHECK([for restartable system calls], scm_cv_restarts,
92 if test $ac_cv_func_sigaction = yes; then
93 [AC_TRY_COMPILE([#include <signal.h>],
100 if test $scm_cv_restarts = yes; then
101 AC_DEFINE(HAVE_RESTARTS)
104 AC_CHECK_FUNCS(regcomp, [LIBOBJS="regex-posix.o $LIBOBJS"])
106 AC_REPLACE_FUNCS(inet_aton putenv strerror)
113 # We could use AC_STRUCT_ST_BLOCKS here, but that adds fileblocks.o to
114 # LIBOBJS, which we don't need. This seems more direct.
115 AC_CACHE_CHECK([for st_blocks in struct stat], ac_cv_struct_st_blocks,
116 [AC_TRY_COMPILE([#include <sys/types.h>
117 #include <sys/stat.h>], [struct stat s; s.st_blocks;],
118 ac_cv_struct_st_blocks=yes, ac_cv_struct_st_blocks=no)])
119 if test $ac_cv_struct_st_blocks = yes; then
120 AC_DEFINE(HAVE_ST_BLOCKS)
126 #--------------------------------------------------------------------
128 # Which way does the stack grow?
130 #--------------------------------------------------------------------
132 AC_TRY_RUN(aux (l) unsigned long l;
133 { int x; exit (l >= ((unsigned long)&x)); }
134 main () { int q; aux((unsigned long)&q); },
135 AC_DEFINE(SCM_STACK_GROWS_UP),,AC_MSG_WARN(Guessing that stack grows down -- see scmconfig.h.in))
138 AC_TRY_RUN(main () { exit (sizeof(float) != sizeof(long)); },
139 AC_DEFINE(SCM_SINGLES),,AC_DEFINE(SCM_SINGLES)
140 AC_MSG_WARN(Guessing that sizeof(long) == sizeof(float) -- see scmconfig.h.in))
142 AC_MSG_CHECKING(for struct linger)
143 AC_CACHE_VAL(scm_cv_struct_linger,
145 #include <sys/types.h>
146 #include <sys/socket.h>],
147 [struct linger lgr; lgr.l_linger = 100],
148 scm_cv_struct_linger="yes",
149 scm_cv_struct_linger="no"))
150 AC_MSG_RESULT($scm_cv_struct_linger)
151 if test $scm_cv_struct_linger = yes; then
152 AC_DEFINE(HAVE_STRUCT_LINGER)
155 #--------------------------------------------------------------------
157 # How can you violate a stdio abstraction by setting a stream's fd?
159 #--------------------------------------------------------------------
161 AC_MSG_CHECKING(how to set a stream file descriptor)
162 AC_CACHE_VAL(scm_cv_fd_setter,
163 AC_TRY_COMPILE([#include <stdio.h>],
165 scm_cv_fd_setter="_file",
166 AC_TRY_COMPILE([#include <stdio.h>],
167 [stdout->_fileno = 1],
168 scm_cv_fd_setter="_fileno",
169 scm_cv_fd_setter="")))
171 if test "$scm_cv_fd_setter"; then
172 AC_MSG_RESULT($scm_cv_fd_setter)
173 AC_DEFINE_UNQUOTED(FD_SETTER, $scm_cv_fd_setter)
175 AC_MSG_RESULT(we couldn't do it!)
178 #--------------------------------------------------------------------
179 # How to find out whether a FILE structure contains buffered data.
180 # From Tk we have the following list:
181 # _cnt: Most UNIX systems
185 # Or, in GNU libc there are two fields, _gptr and _egptr, which
186 # have to be compared.
187 # These can also be known as _IO_read_ptr and _IO_read_end.
188 #--------------------------------------------------------------------
190 AC_MSG_CHECKING(how to get buffer char count from FILE structure)
191 AC_CACHE_VAL(scm_cv_struct_file_count,
192 AC_TRY_COMPILE([#include <stdio.h>],
193 [FILE *f = stdin; f->_cnt = 0],
194 scm_cv_struct_file_count="_cnt",
195 AC_TRY_COMPILE([#include <stdio.h>],
196 [FILE *f = stdin; f->_r = 0],
197 scm_cv_struct_file_count="_r",
198 AC_TRY_COMPILE([#include <stdio.h>],
199 [FILE *f = stdin; f->readCount = 0],
200 scm_cv_struct_file_count="readCount",
201 scm_cv_struct_file_count=""))))
202 if test "$scm_cv_struct_file_count"; then
203 AC_MSG_RESULT($scm_cv_struct_file_count)
204 AC_DEFINE_UNQUOTED(FILE_CNT_FIELD, $scm_cv_struct_file_count)
206 AC_CACHE_VAL(scm_cv_struct_file_gptr,
207 AC_TRY_COMPILE([#include <stdio.h>],
208 [FILE *f = stdin; f->_gptr = f->egptr;],
209 scm_cv_struct_file_gptr=1,
210 scm_cv_struct_file_gptr=""))
211 if test "$scm_cv_struct_gptr"; then
213 AC_DEFINE_UNQUOTED(FILE_CNT_GPTR, $scm_cv_struct_file_gptr)
215 AC_CACHE_VAL(scm_cv_struct_file_readptr,
216 AC_TRY_COMPILE([#include <stdio.h>],
217 [FILE *f = stdin; f->_IO_read_ptr = f->_IO_read_end;],
218 scm_cv_struct_file_readptr=1))
219 if test "$scm_cv_struct_file_readptr"; then
220 AC_MSG_RESULT(read_ptr)
221 AC_DEFINE_UNQUOTED(FILE_CNT_READPTR, $scm_cv_struct_file_readptr)
223 AC_MSG_RESULT(we couldn't do it!)
228 #--------------------------------------------------------------------
230 # Flags for thread support
232 #--------------------------------------------------------------------
235 CFLAGS="$CFLAGS $cy_cv_threads_cflags"
236 THREAD_LIBS="$cy_cv_threads_libs"
237 AC_SUBST(THREAD_LIBS)
240 dnl Set the appropriate flags!
242 if test "$cy_cv_threads_package" = FSU; then
243 AC_DEFINE(USE_FSU_PTHREADS, 1)
244 else if test "$cy_cv_threads_package" = COOP; then
245 AC_DEFINE(USE_COOP_THREADS, 1)
246 else if test "$cy_cv_threads_package" = MIT; then
247 AC_DEFINE(USE_MIT_PTHREADS, 1)
248 else if test "$cy_cv_threads_package" = PCthreads; then
249 AC_DEFINE(USE_PCTHREADS_PTHREADS, 1)
250 else if test "$cy_cv_threads_package" = unknown; then
251 AC_MSG_ERROR("cannot find threads installation")
258 if test "$cy_cv_threads_package" != ""; then
259 AC_DEFINE(USE_THREADS)
260 LIBOBJS="$LIBOBJS threads.o"
263 ## If we're using GCC, ask for aggressive warnings.
265 yes ) CFLAGS="$CFLAGS -Wall -Wpointer-arith" ;;
270 ## If we're creating a shared library (using libtool!), then we'll
271 ## need to generate a list of .lo files corresponding to the .o files
272 ## given in LIBOBJS. We'll call it LIBLOBJS.
273 LIBLOBJS="`echo ${LIBOBJS} | sed 's/\.o/.lo/g'`"
275 AC_SUBST(GUILE_MAJOR_VERSION)
276 AC_SUBST(GUILE_MINOR_VERSION)
277 AC_SUBST(GUILE_VERSION)
279 dnl timestamping the interpreter and scheme libraries:
281 dnl Help us notice when we're running one version of the Guile
282 dnl interpreter against a different version of the ice-9 Scheme code.
283 dnl This will definitely detect version skew due to differing
284 dnl snapshots and releases, but may not catch skew for the developers.
285 dnl Hopefully it will not detect skew when there is none; if that
286 dnl happens, the warnings will be useless, and we should remove this.
288 AC_SUBST(GUILE_STAMP)
294 dnl ======================================================================
295 dnl configuration for the Qt package
296 dnl ======================================================================
298 threads_enabled=false
299 if test "$cy_cv_threads_package" = COOP; then
303 # Determine the host we are working on
306 # How can we refer to the qt source directory from within the qt build
307 # directory? For headers, we can rely on the fact that the qt src
308 # directory appears in the #include path.
310 qtsrcdir="`(cd $srcdir; pwd)`/qt"
312 changequote(,)dnl We use [ and ] in a regexp in the case
315 qtmds_s=$qtsrcdir/md/i386.s
317 qtmdc_c=$qtsrcdir/md/null.c
320 qtmds_s=$qtsrcdir/md/mips-irix5.s
322 qtmdc_c=$qtsrcdir/md/null.c
323 qtdmdb_s=$qtsrcdir/md/mips_b.s
326 qtmds_s=$qtsrcdir/md/mips.s
328 qtmdc_c=$qtsrcdir/md/null.c
329 qtdmdb_s=$qtsrcdir/md/mips_b.s
333 qtmdc_c=$qtsrcdir/md/null.c
334 qtmds_s=$qtsrcdir/md/_sparc.s
335 qtdmdb_s=$qtsrcdir/md/_sparc_b.s
339 qtmdc_c=$qtsrcdir/md/null.c
340 qtmds_s=$qtsrcdir/md/sparc.s
341 qtdmdb_s=$qtsrcdir/md/sparc_b.s
344 echo "Unknown configuration; threads package disabled"
345 threads_enabled=false
351 if $threads_enabled; then
357 # Give the Makefile the names of the object files that will be
358 # generated by compiling $qtmdc_c and $qtmds_s.
359 qtmdc_o="`echo ${qtmdc_c} | sed -e 's:^.*/::' | sed -e 's:\.c$:\.o:'`"
360 qtmds_o="`echo ${qtmds_s} | sed -e 's:^.*/::' | sed -e 's:\.s$:\.o:'`"
362 AC_SUBST(target_libs)
370 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], [chmod +x libguile/guile-snarf])
373 dnl comment-start: "dnl "
375 dnl comment-start-skip: "\\bdnl\\b\\s *"