1 /*
   2  * CDDL HEADER START
   3  *
   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*
  22  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  23  * Use is subject to license terms.
  24  */
  25 
  26 /*
  27  *      globals.cc
  28  *
  29  *      This declares all global variables
  30  */
  31 
  32 /*
  33  * Included files
  34  */
  35 #include <nl_types.h>
  36 #include <mk/defs.h>
  37 #include <sys/stat.h>
  38 
  39 /*
  40  * Defined macros
  41  */
  42 
  43 /*
  44  * typedefs & structs
  45  */
  46 
  47 /*
  48  * Global variables used by make only
  49  */
  50         FILE            *dependency_report_file;
  51 
  52 /*
  53  * Global variables used by make
  54  */
  55         Boolean         allrules_read=false;
  56         Name            posix_name;
  57         Name            svr4_name;
  58         Boolean         sdot_target;    /* used to identify s.m(/M)akefile */
  59         Boolean         all_parallel;                   /* TEAMWARE_MAKE_CMN */
  60         Boolean         assign_done;
  61         int foo;        
  62         Boolean         build_failed_seen;
  63 #ifdef DISTRIBUTED
  64         Boolean         building_serial;
  65 #endif
  66         Name            built_last_make_run;
  67         Name            c_at;
  68 #ifdef DISTRIBUTED
  69         Boolean         called_make = false;
  70 #endif
  71         Boolean         cleanup;
  72         Boolean         close_report;
  73         Boolean         command_changed;
  74         Boolean         commands_done;
  75         Chain           conditional_targets;
  76         Name            conditionals;
  77         Boolean         continue_after_error;           /* `-k' */
  78         Property        current_line;
  79         Name            current_make_version;
  80         Name            current_target;
  81         short           debug_level;
  82         Cmd_line        default_rule;
  83         Name            default_rule_name;
  84         Name            default_target_to_build;
  85         Name            dmake_group;
  86         Name            dmake_max_jobs;
  87         Name            dmake_mode;
  88         DMake_mode      dmake_mode_type;
  89         Name            dmake_output_mode;
  90         DMake_output_mode       output_mode = txt1_mode;
  91         Name            dmake_odir;
  92         Name            dmake_rcfile;
  93         Name            done;
  94         Name            dot;
  95         Name            dot_keep_state;
  96         Name            dot_keep_state_file;
  97         Name            empty_name;
  98         Boolean         fatal_in_progress;
  99         int             file_number;
 100 #if 0
 101         Boolean         filter_stderr;                  /* `-X' */
 102 #endif
 103         Name            force;
 104         Name            ignore_name;
 105         Boolean         ignore_errors;                  /* `-i' */
 106         Boolean         ignore_errors_all;              /* `-i' */
 107         Name            init;
 108         int             job_msg_id;
 109         Boolean         keep_state;
 110         Name            make_state;
 111 #ifdef TEAMWARE_MAKE_CMN
 112         timestruc_t     make_state_before;
 113 #endif
 114         Dependency      makefiles_used;
 115         Name            makeflags;
 116 //      Boolean         make_state_locked; // Moved to lib/mksh
 117         Name            make_version;
 118         char            mbs_buffer2[(MAXPATHLEN * MB_LEN_MAX)];
 119         char            *mbs_ptr;
 120         char            *mbs_ptr2;
 121         int             mtool_msgs_fd;
 122         Boolean         depinfo_already_read = false;
 123         Boolean         no_action_was_taken = true;     /* true if we've not **
 124                                                         ** run any command   */
 125 
 126         Boolean         no_parallel = false;            /* TEAMWARE_MAKE_CMN */
 127 #ifdef SGE_SUPPORT
 128         Boolean         grid = false;                   /* TEAMWARE_MAKE_CMN */
 129 #endif
 130         Name            no_parallel_name;
 131         Name            not_auto;
 132         Boolean         only_parallel;                  /* TEAMWARE_MAKE_CMN */
 133         Boolean         parallel;                       /* TEAMWARE_MAKE_CMN */
 134         Name            parallel_name;
 135         Name            localhost_name;
 136         int             parallel_process_cnt;
 137         Percent         percent_list;
 138         Dyntarget       dyntarget_list;
 139         Name            plus;
 140         Name            pmake_machinesfile;
 141         Name            precious;
 142         Name            primary_makefile;
 143         Boolean         quest;                          /* `-q' */
 144         short           read_trace_level;
 145         Boolean         reading_dependencies = false;
 146         Name            recursive_name;
 147         int             recursion_level;
 148         short           report_dependencies_level = 0;  /* -P */
 149         Boolean         report_pwd;
 150         Boolean         rewrite_statefile;
 151         Running         running_list;
 152         char            *sccs_dir_path;
 153         Name            sccs_get_name;
 154         Name            sccs_get_posix_name;
 155         Cmd_line        sccs_get_rule;
 156         Cmd_line        sccs_get_org_rule;
 157         Cmd_line        sccs_get_posix_rule;
 158         Name            get_name;
 159         Cmd_line        get_rule;
 160         Name            get_posix_name;
 161         Cmd_line        get_posix_rule;
 162         Boolean         send_mtool_msgs;                /* `-K' */
 163         Boolean         all_precious;
 164         Boolean         silent_all;                     /* `-s' */
 165         Boolean         report_cwd;                     /* `-w' */
 166         Boolean         silent;                         /* `-s' */
 167         Name            silent_name;
 168         char            *stderr_file = NULL;
 169         char            *stdout_file = NULL;
 170 #ifdef SGE_SUPPORT
 171         char            script_file[MAXPATHLEN] = "";
 172 #endif
 173         Boolean         stdout_stderr_same;
 174         Dependency      suffixes;
 175         Name            suffixes_name;
 176         Name            sunpro_dependencies;
 177         Boolean         target_variants;
 178         const char      *tmpdir = NOCATGETS("/tmp");
 179         const char      *temp_file_directory = NOCATGETS(".");
 180         Name            temp_file_name;
 181         short           temp_file_number;
 182         time_t          timing_start;
 183         wchar_t         *top_level_target;
 184         Boolean         touch;                          /* `-t' */
 185         Boolean         trace_reader;                   /* `-D' */
 186         Boolean         build_unconditional;            /* `-u' */
 187         pathpt          vroot_path = VROOT_DEFAULT;
 188         Name            wait_name;
 189         wchar_t         wcs_buffer2[MAXPATHLEN];
 190         wchar_t         *wcs_ptr;
 191         wchar_t         *wcs_ptr2;
 192         nl_catd         catd;
 193         long int        hostid;
 194 
 195 /*
 196  * File table of contents
 197  */
 198