From 0d8f3ffaaef274dc163b979c542128796f963713 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Sat, 7 Apr 2007 04:03:56 +0000 Subject: [PATCH] Changes to support microcode's pre-v15 branch. --- v7/src/etc/c-bundle.sh | 72 +++++++++++++++++++++++++++--------------- 1 file changed, 46 insertions(+), 26 deletions(-) diff --git a/v7/src/etc/c-bundle.sh b/v7/src/etc/c-bundle.sh index 6db997073..5dd4a6004 100755 --- a/v7/src/etc/c-bundle.sh +++ b/v7/src/etc/c-bundle.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# $Id: c-bundle.sh,v 1.1 2007/04/04 05:08:19 riastradh Exp $ +# $Id: c-bundle.sh,v 1.2 2007/04/07 04:03:56 cph Exp $ # # Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, # 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, @@ -30,29 +30,49 @@ if [ ! $# -gt 2 ]; then exit 1 fi -TYPE="${1}" -SYSTEM="${2}" +TYPE=${1} +SYSTEM=${2} shift 2 case "${TYPE}" in - library | static) +library | static) ;; - *) +*) echo "usage: ${0} TYPE SYSTEM FILES ..." echo " TYPE must be \`library' or \`static'." exit 1 ;; esac -(grep '^DECLARE_COMPILED_CODE' "${@}" && \ - grep '^DECLARE_COMPILED_DATA' "${@}" && \ - grep '^DECLARE_DATA_OBJECT' "${@}") \ -| sed -e 's/.*:/ /' >${SYSTEM}.h +(grep '^DECLARE_COMPILED_CODE' "${@}" && \ + grep '^DECLARE_COMPILED_DATA' "${@}" && \ + grep '^DECLARE_DATA_OBJECT' "${@}") \ +| sed -e 's/.*:/ /' > "${SYSTEM}.h" -cat <"${SYSTEM}.c" +cat < "${SYSTEM}.c" #define LIARC_IN_MICROCODE #include "liarc.h" +EOF + +# pre-v15 microcode doesn't have "ansidecl.h". +if [ -e ansidecl.h ]; then + cat <> "${SYSTEM}.c" + +typedef int EXFUN (liarc_decl_code_t, (void)); +typedef int EXFUN (liarc_decl_data_t, (void)); +typedef SCHEME_OBJECT * EXFUN (liarc_code_proc_t, (SCHEME_OBJECT *, entry_count_t)); +typedef SCHEME_OBJECT * EXFUN (liarc_data_proc_t, (entry_count_t)); +typedef SCHEME_OBJECT EXFUN (liarc_object_proc_t, (void)); +EOF +else + cat <> "${SYSTEM}.c" + +#define DEFUN_VOID(name) name (void) +EOF +fi + +cat <> "${SYSTEM}.c" #undef DECLARE_COMPILED_CODE #undef DECLARE_COMPILED_DATA @@ -60,18 +80,18 @@ cat <"${SYSTEM}.c" #undef DECLARE_DATA_OBJECT #define DECLARE_COMPILED_CODE(name, nentries, decl_code, code) \\ -extern int EXFUN (decl_code, (void)); \\ -extern SCHEME_OBJECT * EXFUN (code, (SCHEME_OBJECT *, entry_count_t)); +extern liarc_decl_code_t decl_code; \\ +extern liarc_code_proc_t code; #define DECLARE_COMPILED_DATA(name, decl_data, data) \\ -extern int EXFUN (decl_data, (void)); \\ -extern SCHEME_OBJECT * EXFUN (data, (entry_count_t)); +extern liarc_decl_data_t decl_data; \\ +extern liarc_data_proc_t data; #define DECLARE_COMPILED_DATA_NS(name, data) \\ -extern SCHEME_OBJECT * EXFUN (data, (entry_count_t)); +extern liarc_data_proc_t data; #define DECLARE_DATA_OBJECT(name, data) \\ -extern SCHEME_OBJECT EXFUN (data, (void)); +extern liarc_object_proc_t data; #include "${SYSTEM}.h" @@ -82,24 +102,24 @@ extern SCHEME_OBJECT EXFUN (data, (void)); EOF case "${TYPE}" in - library) - cat <>"${SYSTEM}.c" +library) + cat <> "${SYSTEM}.c" #define DECLARE_COMPILED_CODE(name, nentries, decl_code, code) \\ if (0 != (declare_compiled_code (name, nentries, decl_code, code))) \\ - return ((char *) NULL); + return (0); #define DECLARE_COMPILED_DATA(name, decl_data, data) \\ if (0 != (declare_compiled_code (name, decl_data, data))) \\ - return ((char *) NULL); + return (0); #define DECLARE_COMPILED_DATA_NS(name, data) \\ if (0 != (declare_compiled_data_ns (name, data))) \\ - return ((char *) NULL); + return (0); #define DECLARE_DATA_OBJECT(name, data) \\ if (0 != (declare_data_object (name, data))) \\ - return ((char *) NULL); + return (0); char * DEFUN_VOID (dload_initialize_file) @@ -108,9 +128,9 @@ DEFUN_VOID (dload_initialize_file) return (0); } EOF - ;; - static) - cat <>"${SYSTEM}.c" + ;; +static) + cat <> "${SYSTEM}.c" #define DECLARE_COMPILED_CODE(name, nentries, decl_code, code) \\ result = (declare_compiled_code (name, nentries, decl_code, code)); \\ @@ -140,5 +160,5 @@ DEFUN_VOID (initialize_compiled_code_blocks) return (0); } EOF - ;; + ;; esac -- 2.25.1