PreviousUpNext

15.4.79  src/app/makelib/main/makelib-state.pkg

## makelib-state.pkg -- general makelib state information.

# Compiled by:
#     src/app/makelib/makelib.sublib



# This file specifies the core state
# maintained during a makelib session:
#
# anchor_dictionary Tracks the 'anchors' such as '$ROOT'
#                   which appear in .lib files to re/locate
#                   files and directories.  The anchor_dictionary
#                   is a lot like the unix string "environment"
#                   holding the TMPDIR and PATH etc settings.
#                   Currently $ROOT is the only anchor used.
#
# filename_policy   Records the naming conventions for various
#                   compiler-generated files like foo.pkg.compiled etc.
#
# find_makelib_preprocessor_symbol
#                   Provides read/write access to the makelib preprocessor
#                   dictionary which holds the values tested by .lib file lines like
#                       #if defined(FOO)
#                   This dictionary is pre-loaded with a few machine-dependent values
#                   such as architecture name ("PWRPC32"/"SPARC32"/"INTEL32") and word length
#                   in bits -- see
#                       src/app/makelib/main/makelib-preprocessor-state-g.pkg
#                       src/app/makelib/main/makelib-preprocessor-dictionary.pkg
#
# platform          Names architecture and operating system:  "intel32-linux" or such.
#
# keep_going_after_compile_errors
#                   A boolean flag indicating whether makelib should attempt
#                   to continue compiling after encountering a file with
#                   compile errors.
#
# we_are_a_subprocess
#                   Used to remember whether we're the primary compile
#                   process or a secondary compile-server subprocess.
#
# library_source_index
#                   Maps filenames to sourcefile line-and-column info.
#
# plaint_sink is where we send compile error messages.
#                  Think 'stderr'.
#
# youngest          Most recent known edit of any sourcefile in the library --
#                   we need to recompile if the .lib.frozen or "executable"
#                   files are older than this,



###                    "Simple things should be simple.
###                     Complex things should be possible."
###
###                                     -- Alan Kay


stipulate
    package ad  =  anchor_dictionary;                                                   # anchor_dictionary             is from   src/app/makelib/paths/anchor-dictionary.pkg
    package fp  =  filename_policy;                                                     # filename_policy               is from   src/app/makelib/main/filename-policy.pkg
    package lsi =  library_source_index;                                                # library_source_index          is from   src/app/makelib/stuff/library-source-index.pkg
    package mtq =  makelib_thread_boss;                                                 # makelib_thread_boss           is from   src/app/makelib/concurrency/makelib-thread-boss.pkg
    package pp  =  standard_prettyprinter;                                              # standard_prettyprinter        is from   src/lib/prettyprint/big/src/standard-prettyprinter.pkg
    package ts  =  timestamp;                                                           # timestamp                     is from   src/app/makelib/paths/timestamp.pkg
herein

    package makelib_state {
        #
        Makelib_Session
          =
          { anchor_dictionary:                  ad::Anchor_Dictionary,
            filename_policy:                    fp::Policy,
            #   
            platform:                           String,                                 # "intel32-linux" or such.   Should be some proper sumtype.  XXX BUGGO FIXME.
            we_are_a_subprocess:                Ref( Bool ),                            # Should be a CLIENT/SERVER sumtype.                     XXX SUCKO FIXME        So far as I can see, this value is written but NEVER READ. -- 2011-09-22 CrT
            #   
            keep_going_after_compile_errors:    Bool,
            #
            find_makelib_preprocessor_symbol
                :
                String
                ->
                { get: Void -> Null_Or(Int),                                            # Returns Int value of symbol, or NULL if it is not set.
                  set: Null_Or(Int) -> Void                                             # Sets symbol value to given Int; if given value is NULL, deletes symbol from preprocessor dictionary.
                },

            makelib_thread_boss:                mtq::Makelib_Thread_Boss
          };

        Makelib_State
          =
          { makelib_session:                    Makelib_Session,
            library_source_index:               lsi::Library_Source_Index,
            plaint_sink:                        pp::Prettyprint_Output_Stream,
            #
            timestamp_of_youngest_sourcefile_in_library:     Ref( ts::Timestamp )       # Used to decide whether to rebuild library, in   src/app/makelib/main/makelib-g.pkg
          };
    };

end;

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


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext