Should not be archived in the CVS repository
[bpt/guile.git] / configure.in
index ffe3f03..81c8eb1 100644 (file)
@@ -1,7 +1,7 @@
 dnl   configuration script for Guile
 dnl   Process this file with autoconf to produce configure.
 dnl
-dnl  Copyright (C) 1998 Free Software Foundation, Inc.
+dnl  Copyright (C) 1998, 1999 Free Software Foundation, Inc.
 dnl
 dnl  This file is part of GUILE
 dnl
@@ -26,6 +26,14 @@ AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
 AM_MAINTAINER_MODE
 AM_CONFIG_HEADER(libguile/scmconfig.h)
 
+#--------------------------------------------------------------------
+#
+# Independent Subdirectories
+#
+#--------------------------------------------------------------------
+
+AC_CONFIG_SUBDIRS(guile-readline)
+
 #--------------------------------------------------------------------
 #
 # User options
@@ -37,10 +45,10 @@ AC_ARG_ENABLE(dynamic-linking,
   enable_dynamic_linking=yes)
 
 AC_ARG_ENABLE(guile-debug,
-[  --enable-guile-debug    Include internal debugging functions])
-if test "$enableval" = y || test "$enableval" = yes; then
-  AC_DEFINE(GUILE_DEBUG)
-fi
+  [  --enable-guile-debug    Include internal debugging functions],
+  if test "$enable_guile_debug" = y || test "$enable_guile_debug" = yes; then
+    AC_DEFINE(GUILE_DEBUG)
+  fi)
 
 dnl The --disable-debug used to control these two.  But now they are
 dnl a required part of the distribution.
@@ -61,12 +69,22 @@ AM_PROG_CC_STDC
 
 AC_C_CONST
 AC_C_INLINE
+AC_CHECK_SIZEOF(int)
+AC_CHECK_SIZEOF(long)
+AC_CACHE_CHECK([for long longs], scm_cv_long_longs,
+              AC_TRY_COMPILE(,
+                             [long long a],
+                             scm_cv_long_longs=yes,
+                             scm_cv_long_longs=no))
+if test "$scm_cv_long_longs" = yes; then
+  AC_DEFINE(HAVE_LONG_LONGS)
+fi
 
 AC_HEADER_STDC
 AC_HEADER_DIRENT
 AC_HEADER_TIME
 AC_HEADER_SYS_WAIT
-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)
+AC_CHECK_HEADERS(io.h 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)
 GUILE_HEADER_LIBC_WITH_UNISTD
 
 AC_TYPE_GETGROUPS
@@ -83,30 +101,6 @@ if test $ac_cv_func_connect = no; then
     AC_CHECK_LIB(socket, connect)
 fi
 
-dnl Should we check for curses, terminfo, and termlib, too?
-for termlib in ncurses termcap ; do
-   AC_CHECK_LIB(${termlib}, tgoto, 
-                [LIBS="-l${termlib} $LIBS"; break])
-done
-AC_CHECK_LIB(readline, main)
-AC_CHECK_FUNCS(rl_clear_signals rl_cleanup_after_signal)
-
-AC_CACHE_CHECK([for rl_getc_function pointer in readline],
-               ac_cv_var_rl_getc_function,
-               [AC_TRY_LINK([
-#include <stdio.h>
-#include <readline/readline.h>],
-                            [rl_getc_function;],
-                            [ac_cv_var_rl_getc_function=yes],
-                            [ac_cv_var_rl_getc_function=no])])
-if test "$ac_cv_var_rl_getc_function" = "yes"; then
-  AC_DEFINE(HAVE_RL_GETC_FUNCTION)
-fi
-
-if test $ac_cv_lib_readline_readline = yes -a $ac_cv_var_rl_getc_function = no; then
-  echo 'Warning: libreadline is too old on your system.  Need >= 2.1.'
-fi
-
 # Checks for dynamic linking
 
 if test "$enable_dynamic_linking" = "yes"; then
@@ -136,7 +130,7 @@ fi
 
 GUILE_DLSYM_USCORE
 
-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 bzero strdup system usleep)
+AC_CHECK_FUNCS(ctermid ftime getcwd geteuid gettimeofday lstat mkdir mknod nice readlink rename rmdir select setegid seteuid setlocale setpgid setsid sigaction strftime strptime symlink sync tcgetpgrp tcsetpgrp times uname waitpid bzero strdup system usleep atexit on_exit)
 
 ### Some systems don't declare some functions.  On such systems, we
 ### need to at least provide our own K&R-style declarations.
@@ -195,7 +189,7 @@ dnl AC_CHECK_FUNCS...
 dnl restore confdefs.h
 
 dnl cp confdefs.h confdefs.h.bak
-dnl for func in sethostent endhostent getnetent setnetent endnetent getprotoent endprotoent getservent endservent getnetbyaddr getnetbyname inet_lnaof inet_makeaddr inet_netof ; do
+dnl for func in gethostent sethostent endhostent getnetent setnetent endnetent getprotoent setprotoent endprotoent getservent setservent endservent getnetbyaddr getnetbyname inet_lnaof inet_makeaddr inet_netof ; do
 dnl cp confdefs.h.bak confdefs.h
 dnl cat >> confdefs.h << EOF 
 dnl #ifdef __CYGWIN32__
@@ -206,7 +200,11 @@ dnl AC_CHECK_FUNC($func)
 dnl done
 dnl cp confdefs.h.bak confdefs.h
 
-AC_CHECK_FUNCS(sethostent endhostent getnetent setnetent endnetent getprotoent endprotoent getservent endservent getnetbyaddr getnetbyname inet_lnaof inet_makeaddr inet_netof)
+AC_CHECK_FUNCS(sethostent   gethostent   endhostent   dnl
+               setnetent    getnetent    endnetent    dnl
+               setprotoent  getprotoent  endprotoent  dnl
+               setservent   getservent   endservent   dnl
+               getnetbyaddr getnetbyname inet_lnaof inet_makeaddr inet_netof)
 
 dnl </GNU-WIN32 hacks>
 
@@ -238,7 +236,7 @@ if test "$ac_cv_header_regex_h" = yes ||
   fi
 fi
 
-AC_REPLACE_FUNCS(inet_aton putenv strerror)
+AC_REPLACE_FUNCS(inet_aton putenv strerror memmove)
 
 # When testing for the presence of alloca, we need to add alloca.o
 # explicitly to LIBOBJS to make sure that it is translated to
@@ -259,6 +257,17 @@ if test $ac_cv_struct_st_blocks = yes; then
   AC_DEFINE(HAVE_ST_BLOCKS)
 fi
 
+AC_CACHE_CHECK([for S_ISLNK in sys/stat.h], ac_cv_macro_S_ISLNK,
+  [AC_TRY_CPP([#include <sys/stat.h>
+               #ifndef S_ISLNK
+               #error no S_ISLNK
+               #endif],
+               ac_cv_macro_S_ISLNK=yes,
+               ac_cv_macro_S_ISLNK=no)])
+if test $ac_cv_macro_S_ISLNK = yes; then
+  AC_DEFINE(HAVE_S_ISLNK)
+fi
+
 AC_STRUCT_TIMEZONE
 GUILE_STRUCT_UTIMBUF
 
@@ -309,25 +318,25 @@ fi
 #
 #--------------------------------------------------------------------
 
-AC_MSG_CHECKING(how to set a stream file descriptor)
-AC_CACHE_VAL(scm_cv_fd_setter,
-       AC_TRY_COMPILE([#include <stdio.h>],
-                       [stdout->_file = 1],
-                       scm_cv_fd_setter="_file",
-       AC_TRY_COMPILE([#include <stdio.h>],
-                       [stdout->__file = 1],
-                       scm_cv_fd_setter="__file",
-       AC_TRY_COMPILE([#include <stdio.h>],
-                       [stdout->_fileno = 1],
-                       scm_cv_fd_setter="_fileno",
-                       scm_cv_fd_setter=""))))
-
-if test "$scm_cv_fd_setter"; then
-       AC_MSG_RESULT($scm_cv_fd_setter)
-       AC_DEFINE_UNQUOTED(FD_SETTER, $scm_cv_fd_setter)
-else
-       AC_MSG_RESULT(we couldn't do it!)
-fi
+dnl  AC_MSG_CHECKING(how to set a stream file descriptor)
+dnl  AC_CACHE_VAL(scm_cv_fd_setter,
+dnl    AC_TRY_COMPILE([#include <stdio.h>],
+dnl                    [stdout->_file = 1],
+dnl                    scm_cv_fd_setter="_file",
+dnl    AC_TRY_COMPILE([#include <stdio.h>],
+dnl                    [stdout->__file = 1],
+dnl                    scm_cv_fd_setter="__file",
+dnl    AC_TRY_COMPILE([#include <stdio.h>],
+dnl                    [stdout->_fileno = 1],
+dnl                    scm_cv_fd_setter="_fileno",
+dnl                    scm_cv_fd_setter=""))))
+
+dnl  if test "$scm_cv_fd_setter"; then
+dnl    AC_MSG_RESULT($scm_cv_fd_setter)
+dnl    AC_DEFINE_UNQUOTED(FD_SETTER, $scm_cv_fd_setter)
+dnl  else
+dnl    AC_MSG_RESULT(we couldn't do it!)
+dnl  fi
 
 #--------------------------------------------------------------------
 # How to find out whether a FILE structure contains buffered data.
@@ -341,46 +350,46 @@ fi
 #      These can also be known as _IO_read_ptr and _IO_read_end.
 #--------------------------------------------------------------------
 
-AC_MSG_CHECKING(how to get buffer char count from FILE structure)
-AC_CACHE_VAL(scm_cv_struct_file_count,
-       AC_TRY_COMPILE([#include <stdio.h>],
-                       [FILE *f = stdin; f->_cnt = 0],
-                       scm_cv_struct_file_count="_cnt",
-       AC_TRY_COMPILE([#include <stdio.h>],
-                       [FILE *f = stdin; f->__cnt = 0],
-                       scm_cv_struct_file_count="__cnt",
-       AC_TRY_COMPILE([#include <stdio.h>],
-                       [FILE *f = stdin; f->_r = 0],
-                       scm_cv_struct_file_count="_r",
-       AC_TRY_COMPILE([#include <stdio.h>],
-                       [FILE *f = stdin; f->readCount = 0],
-                       scm_cv_struct_file_count="readCount",
-       scm_cv_struct_file_count="")))))
-if test "$scm_cv_struct_file_count"; then
-       AC_MSG_RESULT($scm_cv_struct_file_count)
-       AC_DEFINE_UNQUOTED(FILE_CNT_FIELD, $scm_cv_struct_file_count)
-else
-AC_CACHE_VAL(scm_cv_struct_file_gptr,
-       AC_TRY_COMPILE([#include <stdio.h>],
-                       [FILE *f = stdin; f->_gptr = f->egptr;],
-                       scm_cv_struct_file_gptr=1,
-       scm_cv_struct_file_gptr=""))
-if test "$scm_cv_struct_gptr"; then
-       AC_MSG_RESULT(gptr)
-       AC_DEFINE_UNQUOTED(FILE_CNT_GPTR, $scm_cv_struct_file_gptr)
-else
-AC_CACHE_VAL(scm_cv_struct_file_readptr,
-       AC_TRY_COMPILE([#include <stdio.h>],
-                       [FILE *f = stdin; f->_IO_read_ptr = f->_IO_read_end;],
-                       scm_cv_struct_file_readptr=1))
-if test "$scm_cv_struct_file_readptr"; then
-       AC_MSG_RESULT(read_ptr)
-       AC_DEFINE_UNQUOTED(FILE_CNT_READPTR, $scm_cv_struct_file_readptr)
-else
-       AC_MSG_RESULT(we couldn't do it!)
-fi
-fi
-fi
+dnl  AC_MSG_CHECKING(how to get buffer char count from FILE structure)
+dnl  AC_CACHE_VAL(scm_cv_struct_file_count,
+dnl    AC_TRY_COMPILE([#include <stdio.h>],
+dnl                    [FILE *f = stdin; f->_cnt = 0],
+dnl                    scm_cv_struct_file_count="_cnt",
+dnl    AC_TRY_COMPILE([#include <stdio.h>],
+dnl                    [FILE *f = stdin; f->__cnt = 0],
+dnl                    scm_cv_struct_file_count="__cnt",
+dnl    AC_TRY_COMPILE([#include <stdio.h>],
+dnl                    [FILE *f = stdin; f->_r = 0],
+dnl                    scm_cv_struct_file_count="_r",
+dnl    AC_TRY_COMPILE([#include <stdio.h>],
+dnl                    [FILE *f = stdin; f->readCount = 0],
+dnl                    scm_cv_struct_file_count="readCount",
+dnl    scm_cv_struct_file_count="")))))
+dnl  if test "$scm_cv_struct_file_count"; then
+dnl    AC_MSG_RESULT($scm_cv_struct_file_count)
+dnl    AC_DEFINE_UNQUOTED(FILE_CNT_FIELD, $scm_cv_struct_file_count)
+dnl  else
+dnl  AC_CACHE_VAL(scm_cv_struct_file_gptr,
+dnl    AC_TRY_COMPILE([#include <stdio.h>],
+dnl                    [FILE *f = stdin; f->_gptr = f->egptr;],
+dnl                    scm_cv_struct_file_gptr=1,
+dnl    scm_cv_struct_file_gptr=""))
+dnl  if test "$scm_cv_struct_gptr"; then
+dnl    AC_MSG_RESULT(gptr)
+dnl    AC_DEFINE_UNQUOTED(FILE_CNT_GPTR, $scm_cv_struct_file_gptr)
+dnl  else
+dnl  AC_CACHE_VAL(scm_cv_struct_file_readptr,
+dnl    AC_TRY_COMPILE([#include <stdio.h>],
+dnl                    [FILE *f = stdin; f->_IO_read_ptr = f->_IO_read_end;],
+dnl                    scm_cv_struct_file_readptr=1))
+dnl  if test "$scm_cv_struct_file_readptr"; then
+dnl    AC_MSG_RESULT(read_ptr)
+dnl    AC_DEFINE_UNQUOTED(FILE_CNT_READPTR, $scm_cv_struct_file_readptr)
+dnl  else
+dnl    AC_MSG_RESULT(we couldn't do it!)
+dnl  fi
+dnl  fi
+dnl  fi
 
 #--------------------------------------------------------------------
 #
@@ -444,6 +453,7 @@ if test "${THREAD_PACKAGE}" != "" ; then
   fi
 fi
 
+
 ## If we're using GCC, ask for aggressive warnings.
 case "$GCC" in
   yes )
@@ -468,17 +478,6 @@ dnl Tell guile-config what flags guile users should link against.
 GUILE_LIBS="$LDFLAGS $THREAD_LIBS_INSTALLED $LIBS"
 AC_SUBST(GUILE_LIBS)
 
-dnl timestamping the interpreter and scheme libraries:
-dnl
-dnl Help us notice when we're running one version of the Guile
-dnl interpreter against a different version of the ice-9 Scheme code.
-dnl This will definitely detect version skew due to differing
-dnl snapshots and releases, but may not catch skew for the developers.
-dnl Hopefully it will not detect skew when there is none; if that
-dnl happens, the warnings will be useless, and we should remove this.
-GUILE_STAMP="`date`"
-AC_SUBST(GUILE_STAMP)
-
 AC_SUBST(AWK)
 AC_SUBST(LIBLOBJS)