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])
25 AC_ARG_ENABLE(guile-debug,
26 [ --enable-guile-debug Include internal debugging functions])
27 if test "$enableval" = y || test "$enableval" = yes; then
28 AC_DEFINE(GUILE_DEBUG)
31 #--------------------------------------------------------------------
47 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)
48 GUILE_HEADER_LIBC_WITH_UNISTD
54 AC_CHECK_FUNCS(ctermid ftime getcwd geteuid gethostent gettimeofday lstat mkdir mknod nice readlink rename rmdir select setegid seteuid setlocale setpgid setsid strftime strptime symlink sync tcgetpgrp tcsetpgrp times uname waitpid)
56 AC_REPLACE_FUNCS(inet_aton putenv strerror)
66 # Checks for dynamic linking
68 xtra_PLUGIN_guile_libs=""
69 AC_SUBST(xtra_PLUGIN_guile_libs)
72 AC_CHECK_LIB(socket, main)
73 AC_CHECK_LIB(nsl, main)
75 if test "$enable_dynamic_linking" = "yes"; then
77 AC_CHECK_LIB(dl,dlopen)
78 if test "$ac_cv_lib_dl_dlopen" = "yes"; then
79 xtra_PLUGIN_guile_libs="-lguile -ldl"
80 AC_DEFINE(DYNAMIC_LINKING)
82 AC_CHECK_LIB(dld,dld_link)
83 if test "$ac_cv_lib_dld_dld_link" = "yes"; then
84 xtra_PLUGIN_guile_libs="-lguile -ldld"
85 AC_DEFINE(DYNAMIC_LINKING)
87 AC_CHECK_FUNCS(shl_load)
88 if test "$ac_cv_func_shl_load" = "yes"; then
89 AC_DEFINE(DYNAMIC_LINKING)
96 #--------------------------------------------------------------------
98 # Which way does the stack grow?
100 #--------------------------------------------------------------------
102 AC_TRY_RUN(aux (l) unsigned long l;
103 { int x; exit (l >= ((unsigned long)&x)); }
104 main () { int q; aux((unsigned long)&q); },
105 AC_DEFINE(SCM_STACK_GROWS_UP),,AC_MSG_WARN(Guessing that stack grows down -- see scmconfig.h.in))
108 AC_TRY_RUN(main () { exit (sizeof(float) != sizeof(long)); },
109 AC_DEFINE(SCM_SINGLES),,AC_DEFINE(SCM_SINGLES)
110 AC_MSG_WARN(Guessing that sizeof(long) == sizeof(float) -- see scmconfig.h.in))
112 AC_MSG_CHECKING(for struct linger)
113 AC_CACHE_VAL(scm_cv_struct_linger,
115 #include <sys/types.h>
116 #include <sys/socket.h>],
117 [struct linger lgr; lgr.l_linger = 100],
118 scm_cv_struct_linger="yes",
119 scm_cv_struct_linger="no"))
120 AC_MSG_RESULT($scm_cv_struct_linger)
121 if test $scm_cv_struct_linger = yes; then
122 AC_DEFINE(HAVE_STRUCT_LINGER)
125 #--------------------------------------------------------------------
127 # How can you violate a stdio abstraction by setting a stream's fd?
129 #--------------------------------------------------------------------
131 AC_MSG_CHECKING(how to set a stream file descriptor)
132 AC_CACHE_VAL(scm_cv_fd_setter,
133 AC_TRY_COMPILE([#include <stdio.h>],
135 scm_cv_fd_setter="_file",
136 AC_TRY_COMPILE([#include <stdio.h>],
137 [stdout->_fileno = 1],
138 scm_cv_fd_setter="_fileno",
139 scm_cv_fd_setter="")))
141 if test "$scm_cv_fd_setter"; then
142 AC_MSG_RESULT($scm_cv_fd_setter)
143 AC_DEFINE_UNQUOTED(FD_SETTER, $scm_cv_fd_setter)
145 AC_MSG_RESULT(we couldn't do it!)
148 #--------------------------------------------------------------------
149 # How to find out whether a FILE structure contains buffered data.
150 # From Tk we have the following list:
151 # _cnt: Most UNIX systems
155 # Or, in GNU libc there are two fields, _gptr and _egptr, which
156 # have to be compared.
157 # These can also be known as _IO_read_ptr and _IO_read_end.
158 #--------------------------------------------------------------------
160 AC_MSG_CHECKING(how to get buffer char count from FILE structure)
161 AC_CACHE_VAL(scm_cv_struct_file_count,
162 AC_TRY_COMPILE([#include <stdio.h>],
163 [FILE *f = stdin; f->_cnt = 0],
164 scm_cv_struct_file_count="_cnt",
165 AC_TRY_COMPILE([#include <stdio.h>],
166 [FILE *f = stdin; f->_r = 0],
167 scm_cv_struct_file_count="_r",
168 AC_TRY_COMPILE([#include <stdio.h>],
169 [FILE *f = stdin; f->readCount = 0],
170 scm_cv_struct_file_count="readCount",
171 scm_cv_struct_file_count=""))))
172 if test "$scm_cv_struct_file_count"; then
173 AC_MSG_RESULT($scm_cv_struct_file_count)
174 AC_DEFINE_UNQUOTED(FILE_CNT_FIELD, $scm_cv_struct_file_count)
176 AC_CACHE_VAL(scm_cv_struct_file_gptr,
177 AC_TRY_COMPILE([#include <stdio.h>],
178 [FILE *f = stdin; f->_gptr = f->egptr;],
179 scm_cv_struct_file_gptr=1,
180 scm_cv_struct_file_gptr=""))
181 if test "$scm_cv_struct_gptr"; then
183 AC_DEFINE_UNQUOTED(FILE_CNT_GPTR, $scm_cv_struct_file_gptr)
185 AC_CACHE_VAL(scm_cv_struct_file_readptr,
186 AC_TRY_COMPILE([#include <stdio.h>],
187 [FILE *f = stdin; f->_IO_read_ptr = f->_IO_read_end;],
188 scm_cv_struct_file_readptr=1))
189 if test "$scm_cv_struct_file_readptr"; then
190 AC_MSG_RESULT(read_ptr)
191 AC_DEFINE_UNQUOTED(FILE_CNT_READPTR, $scm_cv_struct_file_readptr)
193 AC_MSG_RESULT(we couldn't do it!)
198 #--------------------------------------------------------------------
200 # Flags for thread support
202 #--------------------------------------------------------------------
205 CFLAGS="$CFLAGS $cy_cv_threads_cflags"
206 THREAD_LIBS="$cy_cv_threads_libs"
207 AC_SUBST(THREAD_LIBS)
210 dnl Set the appropriate flags!
212 if test "$cy_cv_threads_package" = FSU; then
213 AC_DEFINE(USE_FSU_PTHREADS, 1)
214 else if test "$cy_cv_threads_package" = COOP; then
215 AC_DEFINE(USE_COOP_THREADS, 1)
216 else if test "$cy_cv_threads_package" = MIT; then
217 AC_DEFINE(USE_MIT_PTHREADS, 1)
218 else if test "$cy_cv_threads_package" = PCthreads; then
219 AC_DEFINE(USE_PCTHREADS_PTHREADS, 1)
220 else if test "$cy_cv_threads_package" = unknown; then
221 AC_MSG_ERROR("cannot find threads installation")
228 if test "$cy_cv_threads_package" != ""; then
229 AC_DEFINE(USE_THREADS)
230 LIBOBJS="$LIBOBJS threads.o"
233 ## If we're using GCC, ask for aggressive warnings.
235 yes ) CFLAGS="$CFLAGS -Wall -Wpointer-arith" ;;
240 ## If we're creating a shared library (using libtool!), then we'll
241 ## need to generate a list of .lo files corresponding to the .o files
242 ## given in LIBOBJS. We'll call it LIBLOBJS.
243 LIBLOBJS="`echo ${LIBOBJS} | sed 's/\.o/.lo/g'`"
245 AC_DEFINE_UNQUOTED(GUILE_MAJOR_VERSION, "$GUILE_MAJOR_VERSION")
246 AC_DEFINE_UNQUOTED(GUILE_MINOR_VERSION, "$GUILE_MINOR_VERSION")
247 AC_DEFINE_UNQUOTED(GUILE_VERSION, "$GUILE_VERSION")
253 dnl ======================================================================
254 dnl configuration for the Qt package
255 dnl ======================================================================
257 threads_enabled=false
258 if test "$cy_cv_threads_package" = COOP; then
262 # Determine the host we are working on
265 # How can we refer to the qt source directory from within the qt build
266 # directory? For headers, we can rely on the fact that the qt src
267 # directory appears in the #include path.
269 qtsrcdir="`(cd $srcdir; pwd)`/qt"
271 changequote(,)dnl We use [ and ] in a regexp in the case
274 qtmds_s=$qtsrcdir/md/i386.s
276 qtmdc_c=$qtsrcdir/md/null.c
279 qtmds_s=$qtsrcdir/md/mips-irix5.s
281 qtmdc_c=$qtsrcdir/md/null.c
282 qtdmdb_s=$qtsrcdir/md/mips_b.s
285 qtmds_s=$qtsrcdir/md/mips.s
287 qtmdc_c=$qtsrcdir/md/null.c
288 qtdmdb_s=$qtsrcdir/md/mips_b.s
292 qtmdc_c=$qtsrcdir/md/null.c
293 qtmds_s=$qtsrcdir/md/_sparc.s
294 qtdmdb_s=$qtsrcdir/md/_sparc_b.s
298 qtmdc_c=$qtsrcdir/md/null.c
299 qtmds_s=$qtsrcdir/md/sparc.s
300 qtdmdb_s=$qtsrcdir/md/sparc_b.s
303 echo "Unknown configuration; threads package disabled"
304 threads_enabled=false
310 if $threads_enabled; then
316 # Give the Makefile the names of the object files that will be
317 # generated by compiling $qtmdc_c and $qtmds_s.
318 qtmdc_o="`echo ${qtmdc_c} | sed -e 's:^.*/::' | sed -e 's:\.c$:\.o:'`"
319 qtmds_o="`echo ${qtmds_s} | sed -e 's:^.*/::' | sed -e 's:\.s$:\.o:'`"
321 AC_SUBST(target_libs)
329 AC_OUTPUT([Makefile libguile/Makefile libguile/guile-snarf ice-9/Makefile qt/Makefile qt/qt.h qt/md/Makefile qt/time/Makefile], [chmod +x libguile/guile-snarf])
332 dnl comment-start: "dnl "
334 dnl comment-start-skip: "\\bdnl\\b\\s *"