]> birchwood-abbey.net Git - mit-scheme.git/commitdiff
A bunch of changes to get things to config/compile on Ubuntu 22.04 LTS.
authorChris Hanson <org/chris-hanson/cph>
Sun, 7 Aug 2022 04:49:58 +0000 (21:49 -0700)
committerChris Hanson <org/chris-hanson/cph>
Sun, 7 Aug 2022 04:49:58 +0000 (21:49 -0700)
Many of these changes were due to autoconf 2.71, which has obsoleted a bunch of
the macros we were using, and whose advice has considerably changed as to what
macros are needed for reasonably modern systems.

The rest are changes to the C files that were affected by the autoconf changes.

src/Setup.sh
src/configure.ac
src/microcode/configure.ac
src/microcode/confshared.h
src/microcode/prosproc.c
src/microcode/ux.h

index f0db40f96fb3f5fb40ae39a593b7ea04670b2d01..c938c77eb5dc5a6895c8709549f7808b7ecda6a1 100755 (executable)
@@ -34,7 +34,10 @@ configure=done
 
 clean ()
 {
-    if [ "x${configure}" != xdone ]; then
+    if [ "x${autoheader}" != xdone ]; then
+       rm -f config.h.in
+    fi
+    if [ "x${autoconf}" != xdone ]; then
        rm -f configure
     fi
 }
@@ -67,13 +70,20 @@ EOF
     exit 1
 fi
 
+if [ ! -f config.h.in ]; then
+    autoheader=clean
+    echo "autoheader"
+    autoheader
+    autoheader=done
+fi
+
 if [ ! -x configure \
        -o configure.ac -nt configure \
        -o microcode/aclocal.m4 -nt configure ]; then
-    configure=clean
+    autoconf=clean
     echo "autoconf --include=microcode"
     autoconf --include=microcode
-    configure=done
+    autoconf=done
 fi
 
 . etc/functions.sh
index f80b6c0d856c440c9b8e416f657f0f3ae2062398..06c8ea52b74d1ef07782d49410c9649731cb66d2 100644 (file)
@@ -3,6 +3,7 @@ dnl Process this file with autoconf to produce a configure script.
 AC_INIT([MIT/GNU Scheme], [12.0.50], [bug-mit-scheme@gnu.org], [mit-scheme])
 AC_CONFIG_SRCDIR([microcode/boot.c])
 AC_CONFIG_AUX_DIR([microcode])
+AC_CONFIG_HEADERS([dummy-config.h])
 AC_PROG_MAKE_SET
 
 AC_COPYRIGHT(
@@ -257,10 +258,10 @@ but ${message}
 
 If you have installed MIT/GNU Scheme in an unusual location, set the
 environment variable MIT_SCHEME_EXE to the name or pathname of the
-MIT/GNU Scheme executable, which is usually \`mit-scheme' or
-\`/usr/local/bin/mit-scheme', and set the environment variable
+MIT/GNU Scheme executable, which is usually `mit-scheme' or
+`/usr/local/bin/mit-scheme', and set the environment variable
 MITSCHEME_LIBRARY_PATH to the pathname of the MIT/GNU Scheme library
-directory, which is usually \`/usr/local/lib/mit-scheme-${mit_scheme_native_code}'.
+directory, which is usually `/usr/local/lib/mit-scheme-${mit_scheme_native_code}'.
 ])
     fi
 fi
index ea2ab1e02ce07dd4a30a3395666615e3e125f5f8..8adb064d15edbe6b4ff3d8b4e6664e0f78a03ce9 100644 (file)
@@ -77,15 +77,9 @@ AH_BOTTOM(
 
 #include <sys/types.h>
 
-#ifdef TIME_WITH_SYS_TIME
+#include <time.h>
+#ifdef HAVE_SYS_TIME_H
 #  include <sys/time.h>
-#  include <time.h>
-#else
-#  ifdef HAVE_SYS_TIME_H
-#    include <sys/time.h>
-#  else
-#    include <time.h>
-#  endif
 #endif
 
 #ifdef HAVE_TERMIOS_H
@@ -181,7 +175,6 @@ SAVED_LDFLAGS=${LDFLAGS}
 dnl Checks for programs.
 AC_CHECK_TOOL([AS], [as])
 AC_PROG_CC
-AC_PROG_CC_STDC
 if test "x${ac_cv_prog_cc_c99}" != xno; then
    AC_DEFINE([HAVE_STDC_99], [1], [Does the compiler support C99?])
 fi
@@ -263,10 +256,10 @@ if test x"${GCC}" = xyes; then
        AC_MSG_CHECKING([for compiler $flag])
        SAVED_CFLAGS=${CFLAGS}
        CFLAGS="${SAVED_CFLAGS} ${flag} -Werror"
-       AC_TRY_COMPILE([],[],
-           [AC_MSG_RESULT(yes)
+       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
+            [AC_MSG_RESULT(yes)
              CFLAGS="${SAVED_CFLAGS} ${flag}"],
-           [AC_MSG_RESULT(no)
+            [AC_MSG_RESULT(no)
             CFLAGS=${SAVED_CFLAGS}])
     done
 
@@ -440,30 +433,24 @@ AC_CHECK_LIB([m], [exp])
 
 dnl Checks for header files.
 AC_HEADER_DIRENT
-AC_HEADER_STDC
 AC_HEADER_STDBOOL
 AC_HEADER_SYS_WAIT
-AC_HEADER_TIME
-AC_CHECK_HEADERS([bsdtty.h fcntl.h fenv.h ieeefp.h limits.h malloc.h poll.h])
-AC_CHECK_HEADERS([sgtty.h stropts.h time.h])
+AC_CHECK_HEADERS_ONCE([sys/time.h])
+
+AC_CHECK_HEADERS([bsdtty.h fcntl.h fenv.h ieeefp.h malloc.h poll.h])
+AC_CHECK_HEADERS([sgtty.h stropts.h])
 AC_CHECK_HEADERS([sys/file.h sys/ioctl.h sys/mount.h sys/param.h])
-AC_CHECK_HEADERS([sys/ptyio.h sys/socket.h sys/time.h sys/timex.h sys/un.h])
+AC_CHECK_HEADERS([sys/ptyio.h sys/socket.h sys/timex.h sys/un.h])
 AC_CHECK_HEADERS([sys/vfs.h])
 AC_CHECK_HEADERS([termio.h termios.h unistd.h util.h utime.h])
-AC_CHECK_HEADERS([dlfcn.h netdb.h signal.h])
-AC_CHECK_HEADERS([sys/mman.h float.h assert.h stdint.h])
+AC_CHECK_HEADERS([dlfcn.h netdb.h])
+AC_CHECK_HEADERS([sys/mman.h stdint.h])
 
 define([SCM_INC_TIME],
     [
-    #ifdef TIME_WITH_SYS_TIME
+    #include <time.h>
+    #ifdef HAVE_SYS_TIME_H
     #  include <sys/time.h>
-    #  include <time.h>
-    #else
-    #  ifdef HAVE_SYS_TIME_H
-    #    include <sys/time.h>
-    #  else
-    #    include <time.h>
-    #  endif
     #endif
     ])
 
@@ -519,7 +506,6 @@ dnl Checks for types and structs
 AC_TYPE_MODE_T
 AC_TYPE_OFF_T
 AC_TYPE_PID_T
-AC_TYPE_SIGNAL
 AC_TYPE_SIZE_T
 AC_TYPE_UID_T
 
@@ -563,18 +549,6 @@ AC_CHECK_TYPE([nlink_t],
     [AC_DEFINE([nlink_t], [short],
        [Define to 'short' if undefined.])])
 
-AC_CHECK_TYPE([clock_t],
-    [],
-    [AC_DEFINE([clock_t], [unsigned long],
-       [Define to `unsigned long' if <time.h> doesn't define.])],
-    [SCM_INC_TIME])
-
-AC_CHECK_TYPE([time_t],
-    [],
-    [AC_DEFINE([time_t], [long],
-       [Define to `long' if <time.h> doesn't define.])],
-    [SCM_INC_TIME])
-
 AC_CHECK_TYPE([socklen_t],
     [],
     [AC_DEFINE([socklen_t], [int],
@@ -737,7 +711,6 @@ AC_CHECK_TYPE([struct timex],
     [SCM_INC_SYS_TIMEX])
 
 dnl Checks for compiler characteristics.
-AC_C_BIGENDIAN
 AC_C_CHAR_UNSIGNED
 AC_C_CONST
 
@@ -746,11 +719,9 @@ AC_FUNC_GETPGRP
 AC_FUNC_MEMCMP
 AC_FUNC_MMAP
 AC_FUNC_SETPGRP
-AC_FUNC_SETVBUF_REVERSED
 AC_FUNC_UTIME_NULL
-AC_FUNC_VFORK
+AC_FUNC_FORK
 AC_FUNC_VPRINTF
-AC_FUNC_WAIT3
 AC_CHECK_FUNCS([clock_gettime closefrom ctermid])
 AC_CHECK_FUNCS([dup2])
 AC_CHECK_FUNCS([expm1])
@@ -773,11 +744,6 @@ AC_CHECK_FUNCS([times truncate])
 AC_CHECK_FUNCS([utime])
 AC_CHECK_FUNCS([waitpid])
 
-if test ${ac_cv_type_signal} = void; then
-    AC_DEFINE([VOID_SIGNAL_HANDLERS], [1],
-       [Define if RETSIGTYPE is `void'.])
-fi
-
 dnl Checks for system characteristics.
 AC_PATH_X
 AC_SYS_LARGEFILE
index b3697a1450bdae0c485ed72aff98ae52239344fd..619434b0b2bddfb459cca78711fbbbec40d0122f 100644 (file)
@@ -29,10 +29,6 @@ USA.
 #ifndef SCM_CONFSHARED_H
 #define SCM_CONFSHARED_H
 \f
-#ifndef __STDC__
-#  include "error: compiler must support ANSI C"
-#endif
-
 /* Enable the stepper.  */
 #define COMPILE_STEPPER 1
 
@@ -50,43 +46,27 @@ USA.
 #define FALSE 0
 #define TRUE 1
 
-#include <stdio.h>
+/* According to autoconf 2.71 all these headers can be assumed to exist. */
+#include <assert.h>
+#include <ctype.h>
+#include <errno.h>
+#include <float.h>
+#include <iso646.h>
+#include <limits.h>
 #include <math.h>
+#include <setjmp.h>
+#include <signal.h>
+#include <stdarg.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+#include <wchar.h>
+#include <wctype.h>
 
-#if STDC_HEADERS
-#  include <stdlib.h>
-#  include <stdarg.h>
-#  include <stddef.h>
-#  include <string.h>
-#  include <ctype.h>
-#  include <limits.h>
-#  include <float.h>
-#  include <assert.h>
-#else
-#  ifdef HAVE_LIMITS_H
-#    include <limits.h>
-#  endif
-#  ifdef HAVE_FLOAT_H
-#    include <float.h>
-#  else
-#    include "float.h"
-#  endif
-#  ifdef HAVE_ASSERT_H
-#    include <assert.h>
-#  endif
-#  ifdef HAVE_MALLOC_H
-#    include <malloc.h>
-#  endif
-#  if !HAVE_STRCHR
-#    define strchr index
-#    define strrchr rindex
-#  endif
-   extern char * strchr ();
-   extern char * strrchr ();
-#  if !HAVE_MEMCPY
-#    define memcpy(d, s, n) bcopy ((s), (d), (n))
-#    define memmove(d, s, n) bcopy ((s), (d), (n))
-#  endif
+#ifdef HAVE_STDINT_H
+#  include <stdint.h>
 #endif
 
 #ifdef HAVE_STDBOOL_H
@@ -96,22 +76,13 @@ USA.
 #    ifdef __cplusplus
        typedef bool _Bool;
 #    else
-       typedef unsigned char _Bool;
+       define _Bool signed char;
 #    endif
 #  endif
 #  define bool _Bool
 #  define false 0
 #  define true 1
 #  define __bool_true_false_are_defined 1
-#  if ((defined (__GNUC__)) && (__GNUC__ < 3))
-     /* Old versions of GCC have an incompatible <stdbool.h>.
-       This declaration should prevent them from overriding our defs.  */
-#    define __STDBOOL_H__ 1
-#  endif
-#endif
-
-#ifdef HAVE_STDINT_H
-#  include <stdint.h>
 #endif
 
 #if (CHAR_BIT != 8)
index e416837672a43b1c40ca88c6993e5dcb592d9485..7d0d9c81d4c58d94cab302a9299a5c01095ca70e 100644 (file)
@@ -31,10 +31,6 @@ USA.
 #include "osproc.h"
 #include "osio.h"
 
-#ifdef __unix__
-   extern char ** environ;
-#endif
-
 extern Tchannel arg_channel (int);
 
 static Tprocess
index 3658f80a448bf72d8971f477ea1202a567884b63..0507ee1735fc1335fde138378dbe02d1aef0864f 100644 (file)
@@ -113,7 +113,6 @@ USA.
 \f
 #include "config.h"
 
-#include <errno.h>
 #include <grp.h>
 #include <pwd.h>
 #include <signal.h>
@@ -213,15 +212,9 @@ USA.
 #  endif
 #endif
 
-#ifdef TIME_WITH_SYS_TIME
+#include <time.h>
+#ifdef HAVE_SYS_TIME_H
 #  include <sys/time.h>
-#  include <time.h>
-#else
-#  ifdef HAVE_SYS_TIME_H
-#    include <sys/time.h>
-#  else
-#    include <time.h>
-#  endif
 #endif
 
 #ifdef HAVE_SYS_TIMEX_H
@@ -315,7 +308,7 @@ USA.
 #include "osscheme.h"
 #include "syscall.h"
 \f
-typedef RETSIGTYPE Tsignal_handler_result;
+typedef void Tsignal_handler_result;
 
 #ifdef _POSIX_REALTIME_SIGNALS
 #  define HAVE_SIGACTION_SIGINFO_SIGNALS
@@ -324,14 +317,10 @@ typedef RETSIGTYPE Tsignal_handler_result;
 #ifdef HAVE_SIGACTION_SIGINFO_SIGNALS
    typedef void (*Tsignal_handler) (int, siginfo_t *, void *);
 #else
-   typedef RETSIGTYPE (*Tsignal_handler) (int);
+   typedef void (*Tsignal_handler) (int);
 #endif
 
-#ifdef VOID_SIGNAL_HANDLERS
-#  define SIGNAL_HANDLER_RETURN() return
-#else
-#  define SIGNAL_HANDLER_RETURN() return (0)
-#endif
+#define SIGNAL_HANDLER_RETURN() return
 
 /* Crufty, but it will work here. */
 #ifndef ENOSYS