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 regex.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)
93 AC_CHECK_HEADER(sys/un.h, have_sys_un_h=1)
94 if test -n "$have_sys_un_h" ; then
95 AC_DEFINE(HAVE_UNIX_DOMAIN_SOCKETS)
98 AC_CHECK_FUNCS(socketpair getgroups setpwent pause tzset)
100 cp confdefs.h confdefs.h.bak
101 for func in sethostent endhostent getnetent setnetent endnetent getprotoent endprotoent getservent endservent getnetbyaddr getnetbyname inet_lnaof inet_makeaddr inet_netof ; do
102 cp confdefs.h.bak confdefs.h
103 cat >> confdefs.h << EOF
105 #define $func cygwin32_$func
110 cp confdefs.h.bak confdefs.h
112 dnl </GNU-WIN32 hacks>
114 AC_CACHE_CHECK([for restartable system calls], scm_cv_restarts,
115 if test $ac_cv_func_sigaction = yes; then
116 [AC_TRY_COMPILE([#include <signal.h>],
117 [int a = SA_RESTART],
123 if test $scm_cv_restarts = yes; then
124 AC_DEFINE(HAVE_RESTARTS)
127 if test "$ac_cv_header_regex_h" = yes; then
128 AC_CHECK_FUNCS(regcomp, [LIBOBJS="regex-posix.o $LIBOBJS"])
131 AC_REPLACE_FUNCS(inet_aton putenv strerror)
138 # We could use AC_STRUCT_ST_BLOCKS here, but that adds fileblocks.o to
139 # LIBOBJS, which we don't need. This seems more direct.
140 AC_CACHE_CHECK([for st_blocks in struct stat], ac_cv_struct_st_blocks,
141 [AC_TRY_COMPILE([#include <sys/types.h>
142 #include <sys/stat.h>], [struct stat s; s.st_blocks;],
143 ac_cv_struct_st_blocks=yes, ac_cv_struct_st_blocks=no)])
144 if test $ac_cv_struct_st_blocks = yes; then
145 AC_DEFINE(HAVE_ST_BLOCKS)
151 #--------------------------------------------------------------------
153 # Which way does the stack grow?
155 #--------------------------------------------------------------------
157 AC_TRY_RUN(aux (l) unsigned long l;
158 { int x; exit (l >= ((unsigned long)&x)); }
159 main () { int q; aux((unsigned long)&q); },
160 AC_DEFINE(SCM_STACK_GROWS_UP),,AC_MSG_WARN(Guessing that stack grows down -- see scmconfig.h.in))
163 AC_TRY_RUN(main () { exit (sizeof(float) != sizeof(long)); },
164 AC_DEFINE(SCM_SINGLES),,AC_DEFINE(SCM_SINGLES)
165 AC_MSG_WARN(Guessing that sizeof(long) == sizeof(float) -- see scmconfig.h.in))
167 AC_MSG_CHECKING(for struct linger)
168 AC_CACHE_VAL(scm_cv_struct_linger,
170 #include <sys/types.h>
171 #include <sys/socket.h>],
172 [struct linger lgr; lgr.l_linger = 100],
173 scm_cv_struct_linger="yes",
174 scm_cv_struct_linger="no"))
175 AC_MSG_RESULT($scm_cv_struct_linger)
176 if test $scm_cv_struct_linger = yes; then
177 AC_DEFINE(HAVE_STRUCT_LINGER)
180 #--------------------------------------------------------------------
182 # How can you violate a stdio abstraction by setting a stream's fd?
184 #--------------------------------------------------------------------
186 AC_MSG_CHECKING(how to set a stream file descriptor)
187 AC_CACHE_VAL(scm_cv_fd_setter,
188 AC_TRY_COMPILE([#include <stdio.h>],
190 scm_cv_fd_setter="_file",
191 AC_TRY_COMPILE([#include <stdio.h>],
192 [stdout->_fileno = 1],
193 scm_cv_fd_setter="_fileno",
194 scm_cv_fd_setter="")))
196 if test "$scm_cv_fd_setter"; then
197 AC_MSG_RESULT($scm_cv_fd_setter)
198 AC_DEFINE_UNQUOTED(FD_SETTER, $scm_cv_fd_setter)
200 AC_MSG_RESULT(we couldn't do it!)
203 #--------------------------------------------------------------------
204 # How to find out whether a FILE structure contains buffered data.
205 # From Tk we have the following list:
206 # _cnt: Most UNIX systems
210 # Or, in GNU libc there are two fields, _gptr and _egptr, which
211 # have to be compared.
212 # These can also be known as _IO_read_ptr and _IO_read_end.
213 #--------------------------------------------------------------------
215 AC_MSG_CHECKING(how to get buffer char count from FILE structure)
216 AC_CACHE_VAL(scm_cv_struct_file_count,
217 AC_TRY_COMPILE([#include <stdio.h>],
218 [FILE *f = stdin; f->_cnt = 0],
219 scm_cv_struct_file_count="_cnt",
220 AC_TRY_COMPILE([#include <stdio.h>],
221 [FILE *f = stdin; f->_r = 0],
222 scm_cv_struct_file_count="_r",
223 AC_TRY_COMPILE([#include <stdio.h>],
224 [FILE *f = stdin; f->readCount = 0],
225 scm_cv_struct_file_count="readCount",
226 scm_cv_struct_file_count=""))))
227 if test "$scm_cv_struct_file_count"; then
228 AC_MSG_RESULT($scm_cv_struct_file_count)
229 AC_DEFINE_UNQUOTED(FILE_CNT_FIELD, $scm_cv_struct_file_count)
231 AC_CACHE_VAL(scm_cv_struct_file_gptr,
232 AC_TRY_COMPILE([#include <stdio.h>],
233 [FILE *f = stdin; f->_gptr = f->egptr;],
234 scm_cv_struct_file_gptr=1,
235 scm_cv_struct_file_gptr=""))
236 if test "$scm_cv_struct_gptr"; then
238 AC_DEFINE_UNQUOTED(FILE_CNT_GPTR, $scm_cv_struct_file_gptr)
240 AC_CACHE_VAL(scm_cv_struct_file_readptr,
241 AC_TRY_COMPILE([#include <stdio.h>],
242 [FILE *f = stdin; f->_IO_read_ptr = f->_IO_read_end;],
243 scm_cv_struct_file_readptr=1))
244 if test "$scm_cv_struct_file_readptr"; then
245 AC_MSG_RESULT(read_ptr)
246 AC_DEFINE_UNQUOTED(FILE_CNT_READPTR, $scm_cv_struct_file_readptr)
248 AC_MSG_RESULT(we couldn't do it!)
253 #--------------------------------------------------------------------
255 # Flags for thread support
257 #--------------------------------------------------------------------
260 CFLAGS="$CFLAGS $cy_cv_threads_cflags"
261 THREAD_LIBS="$cy_cv_threads_libs"
262 AC_SUBST(THREAD_LIBS)
265 dnl Set the appropriate flags!
267 if test "$cy_cv_threads_package" = FSU; then
268 AC_DEFINE(USE_FSU_PTHREADS, 1)
269 else if test "$cy_cv_threads_package" = COOP; then
270 AC_DEFINE(USE_COOP_THREADS, 1)
271 else if test "$cy_cv_threads_package" = MIT; then
272 AC_DEFINE(USE_MIT_PTHREADS, 1)
273 else if test "$cy_cv_threads_package" = PCthreads; then
274 AC_DEFINE(USE_PCTHREADS_PTHREADS, 1)
275 else if test "$cy_cv_threads_package" = unknown; then
276 AC_MSG_ERROR("cannot find threads installation")
283 if test "$cy_cv_threads_package" != ""; then
284 AC_DEFINE(USE_THREADS)
285 LIBOBJS="$LIBOBJS threads.o"
288 ## If we're using GCC, ask for aggressive warnings.
290 yes ) CFLAGS="$CFLAGS -Wall -Wpointer-arith" ;;
295 ## If we're creating a shared library (using libtool!), then we'll
296 ## need to generate a list of .lo files corresponding to the .o files
297 ## given in LIBOBJS. We'll call it LIBLOBJS.
298 LIBLOBJS="`echo ${LIBOBJS} | sed 's/\.o/.lo/g'`"
300 AC_SUBST(GUILE_MAJOR_VERSION)
301 AC_SUBST(GUILE_MINOR_VERSION)
302 AC_SUBST(GUILE_VERSION)
304 dnl timestamping the interpreter and scheme libraries:
306 dnl Help us notice when we're running one version of the Guile
307 dnl interpreter against a different version of the ice-9 Scheme code.
308 dnl This will definitely detect version skew due to differing
309 dnl snapshots and releases, but may not catch skew for the developers.
310 dnl Hopefully it will not detect skew when there is none; if that
311 dnl happens, the warnings will be useless, and we should remove this.
313 AC_SUBST(GUILE_STAMP)
319 dnl ======================================================================
320 dnl configuration for the Qt package
321 dnl ======================================================================
323 threads_enabled=false
324 if test "$cy_cv_threads_package" = COOP; then
328 # Determine the host we are working on
331 # How can we refer to the qt source directory from within the qt build
332 # directory? For headers, we can rely on the fact that the qt src
333 # directory appears in the #include path.
335 qtsrcdir="`(cd $srcdir; pwd)`/qt"
337 changequote(,)dnl We use [ and ] in a regexp in the case
340 qtmds_s=$qtsrcdir/md/i386.s
342 qtmdc_c=$qtsrcdir/md/null.c
345 qtmds_s=$qtsrcdir/md/mips-irix5.s
347 qtmdc_c=$qtsrcdir/md/null.c
348 qtdmdb_s=$qtsrcdir/md/mips_b.s
351 qtmds_s=$qtsrcdir/md/mips.s
353 qtmdc_c=$qtsrcdir/md/null.c
354 qtdmdb_s=$qtsrcdir/md/mips_b.s
358 qtmdc_c=$qtsrcdir/md/null.c
359 qtmds_s=$qtsrcdir/md/_sparc.s
360 qtdmdb_s=$qtsrcdir/md/_sparc_b.s
364 qtmdc_c=$qtsrcdir/md/null.c
365 qtmds_s=$qtsrcdir/md/sparc.s
366 qtdmdb_s=$qtsrcdir/md/sparc_b.s
369 echo "Unknown configuration; threads package disabled"
370 threads_enabled=false
376 if $threads_enabled; then
382 # Give the Makefile the names of the object files that will be
383 # generated by compiling $qtmdc_c and $qtmds_s.
384 qtmdc_o="`echo ${qtmdc_c} | sed -e 's:^.*/::' | sed -e 's:\.c$:\.o:'`"
385 qtmds_o="`echo ${qtmds_s} | sed -e 's:^.*/::' | sed -e 's:\.s$:\.o:'`"
387 AC_SUBST(target_libs)
395 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])
398 dnl comment-start: "dnl "
400 dnl comment-start-skip: "\\bdnl\\b\\s *"