Print this page
make: unifdef for TEAMWARE_MAKE_CMN (defined)

@@ -65,17 +65,15 @@
 
 // From read2.cc
 extern  Name            normalize_name(register wchar_t *name_string, register int length);
 
 // From parallel.cc
-#if defined(TEAMWARE_MAKE_CMN)
 #define MAXJOBS_ADJUST_RFE4694000
 
 #ifdef MAXJOBS_ADJUST_RFE4694000
 extern void job_adjust_fini();
 #endif /* MAXJOBS_ADJUST_RFE4694000 */
-#endif /* TEAMWARE_MAKE_CMN */
 
 
 /*
  * Defined macros
  */

@@ -119,27 +117,23 @@
 
 #ifdef DMAKE_STATISTICS
 static  Boolean         getname_stat = false;
 #endif
 
-#if defined(TEAMWARE_MAKE_CMN)
         static  time_t          start_time;
         static  int             g_argc;
         static  char            **g_argv;
-#endif
 
 /*
  * File table of contents
  */
         extern "C" void         cleanup_after_exit(void);
 
-#ifdef TEAMWARE_MAKE_CMN
 extern "C" {
         extern  void            dmake_exit_callback(void);
         extern  void            dmake_message_callback(char *);
 }
-#endif
 
 extern  Name            normalize_name(register wchar_t *name_string, register int length);
 
 extern  int             main(int, char * []);
 

@@ -158,13 +152,11 @@
 static  void            setup_makeflags_argv(void);
 static  void            report_dir_enter_leave(Boolean entering);
 
 extern void expand_value(Name, register String , Boolean);
 
-#ifdef TEAMWARE_MAKE_CMN
-        static const char       verstring[] = "illumos make";
-#endif
+static const char       verstring[] = "illumos make";
 
 jmp_buf jmpbuffer;
 extern nl_catd catd;
 
 /*

@@ -202,19 +194,17 @@
         Boolean                 parallel_flag = false;
         char                    *prognameptr;
         char                    *slash_ptr;
         mode_t                  um;
         int                     i;
-#ifdef TEAMWARE_MAKE_CMN
         struct itimerval        value;
         char                    def_dmakerc_path[MAXPATHLEN];
         Name                    dmake_name, dmake_name2;
         Name                    dmake_value, dmake_value2;
         Property                prop, prop2;
         struct stat             statbuf;
         int                     statval;
-#endif
 
         struct stat             out_stat, err_stat;
         hostid = gethostid();
         bsd_signals();
 

@@ -225,38 +215,30 @@
         if (getenv(NOCATGETS("DMAKE_STATISTICS"))) {
                 getname_stat = true;
         }
 #endif
 
-#if defined(TEAMWARE_MAKE_CMN)
         catd = catopen(AVO_DOMAIN_DMAKE, NL_CAT_LOCALE);
-#endif
 
 // ---> fprintf(stderr, catgets(catd, 15, 666, "--- SUN make ---\n"));
 
 
-#if defined(TEAMWARE_MAKE_CMN)
 /*
  * I put libmksdmsi18n_init() under #ifdef because it requires avo_i18n_init()
  * from avo_util library. 
  */
         libmksdmsi18n_init();
-#endif
 
 
-#ifndef TEAMWARE_MAKE_CMN
         textdomain(NOCATGETS("SUNW_SPRO_MAKE"));
-#endif /* TEAMWARE_MAKE_CMN */
 
-#ifdef TEAMWARE_MAKE_CMN
         g_argc = argc;
         g_argv = (char **) malloc((g_argc + 1) * sizeof(char *));
         for (i = 0; i < argc; i++) {
                 g_argv[i] = argv[i];
         }
         g_argv[i] = NULL;
-#endif /* TEAMWARE_MAKE_CMN */
 
         /*
          * Set argv_zero_string to some form of argv[0] for
          * recursive MAKE builds.
          */

@@ -401,11 +383,10 @@
 
         setup_interrupt(handle_interrupt);
 
         read_files_and_state(argc, argv);
 
-#ifdef TEAMWARE_MAKE_CMN
         /*
          * Find the dmake_output_mode: TXT1, TXT2 or HTML1.
          */
         MBSTOWCS(wcs_buffer, NOCATGETS("DMAKE_OUTPUT_MODE"));
         dmake_name2 = GETNAME(wcs_buffer, FIND_LENGTH);

@@ -469,13 +450,11 @@
                         dmake_mode_type = parallel_mode;
                         no_parallel = false;
                 }
         }
     }
-#endif
 
-#ifdef TEAMWARE_MAKE_CMN
         parallel_flag = true;
         putenv(strdup(NOCATGETS("DMAKE_CHILD=TRUE")));
 
 //
 // If dmake is running with -t option, set dmake_mode_type to serial.

@@ -484,15 +463,11 @@
 //
         if(touch) {
                 dmake_mode_type = serial_mode;
                 no_parallel = true;
         }
-#else
-        parallel_flag = false;
-#endif
 
-#if defined (TEAMWARE_MAKE_CMN)
         /*
          * Check whether stdout and stderr are physically same.
          * This is in order to decide whether we need to redirect
          * stderr separately from stdout.
          * This check is performed only if __DMAKE_SEPARATE_STDERR

@@ -512,11 +487,10 @@
                         {
                                 out_err_same = false;
                         }
                 }
         }
-#endif
 
                 
 /*
  *      Enable interrupt handler for alarms
  */

@@ -689,27 +663,23 @@
                 Name            failed_name;
 
                 MBSTOWCS(wcs_buffer, NOCATGETS(".FAILED"));
                 failed_name = GETNAME(wcs_buffer, FIND_LENGTH);
                 if ((exit_status != 0) && (failed_name->prop != NULL)) {
-#ifdef TEAMWARE_MAKE_CMN
                         /*
                          * [tolik] switch DMake to serial mode
                          */
                         dmake_mode_type = serial_mode;
                         no_parallel = true;
-#endif
                         (void) doname(failed_name, false, true);
                 } else {
                     if (!trace_status) {
-#ifdef TEAMWARE_MAKE_CMN
                         /*
                          * Switch DMake to serial mode
                          */
                         dmake_mode_type = serial_mode;
                         no_parallel = true;
-#endif
                         (void) doname(done, false, true);
                     }
                 }
             }
         }

@@ -808,14 +778,12 @@
         }
         if (getpid() == getpgrp()) {
                 bsd_signal(SIGTERM, SIG_IGN);
                 kill (-getpid(), SIGTERM);
         }
-#ifdef TEAMWARE_MAKE_CMN
         /* Clean up all parallel/distributed children already finished */
         finish_children(false);
-#endif
 
         /* Make sure the processes running under us terminate first */
 
         while (wait((int *) NULL) != -1);
         /* Delete the current targets unless they are precious */

@@ -963,15 +931,11 @@
         extern char             *optarg;
         extern int              optind, opterr, optopt;
 
 #define SUNPRO_CMD_OPTS "-~Bbc:Ddef:g:ij:K:kM:m:NnO:o:PpqRrSsTtuVvwx:"
 
-#ifdef TEAMWARE_MAKE_CMN
 #       define SVR4_CMD_OPTS   "-c:ef:g:ij:km:nO:o:pqrsTtVv"
-#else
-#       define SVR4_CMD_OPTS   "-ef:iknpqrstV"
-#endif
 
         /*
          * Added V in SVR4_CMD_OPTS also, which is going to be a hidden
          * option, just to make sure that the getopt doesn't fail when some
          * users leave their USE_SVR4_MAKE set and try to use the makefiles

@@ -1044,42 +1008,26 @@
                         }
                 }
 
                 if (ch == '?') {
                         if (svr4) {
-#ifdef TEAMWARE_MAKE_CMN
                                 fprintf(stderr,
                                         catgets(catd, 1, 267, "Usage : dmake [ -f makefile ][ -c dmake_rcfile ][ -g dmake_group ]\n"));
                                 fprintf(stderr,
                                         catgets(catd, 1, 268, "              [ -j dmake_max_jobs ][ -m dmake_mode ][ -o dmake_odir ]...\n"));
                                 fprintf(stderr,
                                         catgets(catd, 1, 269, "              [ -e ][ -i ][ -k ][ -n ][ -p ][ -q ][ -r ][ -s ][ -t ][ -v ]\n"));
-#else
-                                fprintf(stderr,
-                                        catgets(catd, 1, 270, "Usage : make [ -f makefile ]... [ -e ][ -i ][ -k ][ -n ][ -p ][ -q ][ -r ]\n"));
-                                fprintf(stderr,
-                                        catgets(catd, 1, 271, "             [ -s ][ -t ]\n"));
-#endif
                                 tptr = strchr(SVR4_CMD_OPTS, optopt);
                         } else {
-#ifdef TEAMWARE_MAKE_CMN
                                 fprintf(stderr,
                                         catgets(catd, 1, 272, "Usage : dmake [ -f makefile ][ -c dmake_rcfile ][ -g dmake_group ]\n"));
                                 fprintf(stderr,
                                         catgets(catd, 1, 273, "              [ -j dmake_max_jobs ][ -K statefile ][ -m dmake_mode ][ -x MODE_NAME=VALUE ][ -o dmake_odir ]...\n"));
                                 fprintf(stderr,
                                         catgets(catd, 1, 274, "              [ -d ][ -dd ][ -D ][ -DD ][ -e ][ -i ][ -k ][ -n ][ -p ][ -P ][ -u ][ -w ]\n"));
                                 fprintf(stderr,
                                         catgets(catd, 1, 275, "              [ -q ][ -r ][ -s ][ -S ][ -t ][ -v ][ -V ][ target... ][ macro=value... ][ \"macro +=value\"... ]\n"));
-#else
-                                fprintf(stderr,
-                                        catgets(catd, 1, 276, "Usage : make [ -f makefile ][ -K statefile ]... [ -d ][ -dd ][ -D ][ -DD ]\n"));
-                                fprintf(stderr,
-                                        catgets(catd, 1, 277, "             [ -e ][ -i ][ -k ][ -n ][ -p ][ -P ][ -q ][ -r ][ -s ][ -S ][ -t ]\n"));
-                                fprintf(stderr,
-                                        catgets(catd, 1, 278, "             [ -u ][ -w ][ -V ][ target... ][ macro=value... ][ \"macro +=value\"... ]\n"));
-#endif
                                 tptr = strchr(SUNPRO_CMD_OPTS, optopt);
                         }
                         if (!tptr) {
                                 fatal(catgets(catd, 1, 279, "Unknown option `-%c'"), optopt);
                         } else {

@@ -1112,55 +1060,34 @@
                         case 1: /* -f seen */
                                 argv[i] = (char *)NOCATGETS("-f");
                                 break;
                         case 2: /* -c seen */
                                 argv[i] = (char *)NOCATGETS("-c");
-#ifndef TEAMWARE_MAKE_CMN
-                                warning(catgets(catd, 1, 281, "Ignoring DistributedMake -c option"));
-#endif
                                 break;
                         case 4: /* -g seen */
                                 argv[i] = (char *)NOCATGETS("-g");
-#ifndef TEAMWARE_MAKE_CMN
-                                warning(catgets(catd, 1, 282, "Ignoring DistributedMake -g option"));
-#endif
                                 break;
                         case 8: /* -j seen */
                                 argv[i] = (char *)NOCATGETS("-j");
-#ifndef TEAMWARE_MAKE_CMN
-                                warning(catgets(catd, 1, 283, "Ignoring DistributedMake -j option"));
-#endif
                                 break;
                         case 16: /* -M seen */
                                 argv[i] = (char *)NOCATGETS("-M");
-#ifndef TEAMWARE_MAKE_CMN
-                                warning(catgets(catd, 1, 284, "Ignoring ParallelMake -M option"));
-#endif
                                 break;
                         case 32: /* -m seen */
                                 argv[i] = (char *)NOCATGETS("-m");
-#ifndef TEAMWARE_MAKE_CMN
-                                warning(catgets(catd, 1, 285, "Ignoring DistributedMake -m option"));
-#endif
                                 break;
                         case 128: /* -O seen */
                                 argv[i] = (char *)NOCATGETS("-O");
                                 break;
                         case 256: /* -K seen */
                                 argv[i] = (char *)NOCATGETS("-K");
                                 break;
                         case 512:       /* -o seen */
                                 argv[i] = (char *)NOCATGETS("-o");
-#ifndef TEAMWARE_MAKE_CMN
-                                warning(catgets(catd, 1, 311, "Ignoring DistributedMake -o option"));
-#endif
                                 break;
                         case 1024: /* -x seen */
                                 argv[i] = (char *)NOCATGETS("-x");
-#ifndef TEAMWARE_MAKE_CMN
-                                warning(catgets(catd, 1, 353, "Ignoring DistributedMake -x option"));
-#endif
                                 break;
                         default: /* > 1 of -c, f, g, j, K, M, m, O, o, x seen */
                                 fatal(catgets(catd, 1, 286, "Illegal command line. More than one option requiring\nan argument given in the same argument group"));
                         }
 

@@ -1539,22 +1466,18 @@
                 } else {
                         quest = true;
                 }
                 return 0;
         case 'R':                        /* Don't run in parallel */
-#ifdef TEAMWARE_MAKE_CMN
                 if (invert_this) {
                         pmake_cap_r_specified = false;
                         no_parallel = false;
                 } else {
                         pmake_cap_r_specified = true;
                         dmake_mode_type = serial_mode;
                         no_parallel = true;
                 }
-#else
-                warning(catgets(catd, 1, 182, "Ignoring ParallelMake -R option"));
-#endif
                 return 0;
         case 'r':                        /* Turn off internal rules */
                 if (invert_this) {
                         ignore_default_mk = false;
                 } else {

@@ -1603,17 +1526,13 @@
                 svr4 = true;
                 return 0;
         case 'v':                       /* Version flag */
                 if (invert_this) {
                 } else {
-#ifdef TEAMWARE_MAKE_CMN
                         fprintf(stdout, NOCATGETS("dmake: %s\n"), verstring);
                         exit_status = 0;
                         exit(0);
-#else
-                        warning(catgets(catd, 1, 324, "Ignoring DistributedMake -v option"));
-#endif
                 }
                 return 0;
         case 'w':                        /* Unconditional flag */
                 if (invert_this) {
                         report_cwd = false;

@@ -2874,11 +2793,10 @@
         recursion_level = 1;
         parallel = parallel_flag;
 /*
  *      make remaining args
  */
-#ifdef TEAMWARE_MAKE_CMN
 /*
         if ((report_dependencies_level == 0) && parallel) {
  */
         if (parallel) {
                 /*

@@ -2955,11 +2873,10 @@
                 /* Now wait for all of the targets to finish running */
                 finish_running();
                 //              setjmp(jmpbuffer);
                 
         }
-#endif
         for (i = 1; i < argc; i++) {
                 if ((cp = argv[i]) != NULL) {
                         target_to_make_found = true;
                         if ((cp[0] == (int) period_char) &&
                             (cp[1] == (int) slash_char)) {

@@ -3047,16 +2964,11 @@
                         (void) printf(NOCATGETS("::(%s)\n"),
                                       default_target_to_build->string_mb);
                 }
 
 
-#ifdef TEAMWARE_MAKE_CMN
                 result = doname_parallel(default_target_to_build, true, false);
-#else
-                result = doname_check(default_target_to_build, true,
-                                      false, false);
-#endif
                 gather_recursive_deps();
                 if (build_failed_seen) {
                         build_failed_ever_seen = true;
                         warning(catgets(catd, 1, 203, "Target `%s' not remade because of errors"),
                                 default_target_to_build->string_mb);

@@ -3320,51 +3232,27 @@
         putenv(mlev);
 
         if(report_cwd) {
                 if(make_level_val <= 0) {
                         if(entering) {
-#ifdef TEAMWARE_MAKE_CMN
                                 sprintf( rcwd
                                        , catgets(catd, 1, 329, "dmake: Entering directory `%s'\n")
                                        , get_current_path());
-#else
-                                sprintf( rcwd
-                                       , catgets(catd, 1, 330, "make: Entering directory `%s'\n")
-                                       , get_current_path());
-#endif
                         } else {
-#ifdef TEAMWARE_MAKE_CMN
                                 sprintf( rcwd
                                        , catgets(catd, 1, 331, "dmake: Leaving directory `%s'\n")
                                        , get_current_path());
-#else
-                                sprintf( rcwd
-                                       , catgets(catd, 1, 332, "make: Leaving directory `%s'\n")
-                                       , get_current_path());
-#endif
                         }
                 } else {
                         if(entering) {
-#ifdef TEAMWARE_MAKE_CMN
                                 sprintf( rcwd
                                        , catgets(catd, 1, 333, "dmake[%d]: Entering directory `%s'\n")
                                        , make_level_val, get_current_path());
-#else
-                                sprintf( rcwd
-                                       , catgets(catd, 1, 334, "make[%d]: Entering directory `%s'\n")
-                                       , make_level_val, get_current_path());
-#endif
                         } else {
-#ifdef TEAMWARE_MAKE_CMN
                                 sprintf( rcwd
                                        , catgets(catd, 1, 335, "dmake[%d]: Leaving directory `%s'\n")
                                        , make_level_val, get_current_path());
-#else
-                                sprintf( rcwd
-                                       , catgets(catd, 1, 336, "make[%d]: Leaving directory `%s'\n")
-                                       , make_level_val, get_current_path());
-#endif
                         }
                 }
                 printf(NOCATGETS("%s"), rcwd);
         }
 }