PreviousUpNext

15.4.65  src/app/make7/main/host-properties-g.pkg

## host-properties-g.pkg
## (C) 1999 Lucent Technologies, Bell Laboratories
## Author: Matthias Blume (blume@kurims.kyoto-u.ac.jp)

# Compiled by:
#     src/app/make7/Make7.make6



# Building a host/OS-specific dictionary
# for make7 "preprocessor" variables.

# We are invoked from;
#
#     src/app/make7/main/make7-g.pkg
#     src/app/make7/make-compiler/make-compiler-g.pkg

generic package host_properties_g (

     architecture_name:   String;                               # "ppc", "sparc" or "x86".
     os:                  host_info::Os_Kind;
     abi_variant:         Null_Or( String );
)
{
    stipulate
        my (architecture, big_endian, size)
            =
            case architecture_name                              # architecture_name should be an enum not a String -- this is an untypesafe  maintainance headache. XXX BUGGO FIXME
              
                 "sparc"   => ("SPARC",  TRUE,  32);
                 "x86"     => ("X86",    FALSE, 32);
                 "rs6000"  => ("RS6000", FALSE, 32);
                 "ppc"     => ("PPC",    TRUE,  32);
                 other     => error_message::impossible ("unknown architecture: " + other);
            esac;

        extra_symbols
            =
            case abi_variant
              
                 NULL  =>  [];
                 THE s =>  ["ABI_" + s];
            esac;
                                                                # lib7                                  is from   src/lib/std/lib7.pkg
        dict0                                                   # error_message                         is from   src/lib/compiler/front/basics/errormsg/error-message.pkg
            =                                                   # lib7_version                          is from   src/lib/core/internal/version.pkg
            preprocessor_symbol_dictionary::default             # preprocessor_symbol_dictionary        is from   src/app/make7/main/preprocessor-symbol-dictionary.pkg
                {   architecture,
                    big_endian,
                    size,
                    os,
                    version => lib7_version::version.version_id,
                    extra_symbols
                };

        er   =   REF dict0;
    herein
        fun symbol_value s
            =
            {   fun get () =   preprocessor_symbol_dictionary::get *er s;
                fun set v  =   er := preprocessor_symbol_dictionary::define (*er, s, v);
            
                { get,
                  set
                };
            };
    end;
};


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext