Print this page
make: unifdef for other OSes (undefined)

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/make/lib/mksh/macro.cc
          +++ new/usr/src/cmd/make/lib/mksh/macro.cc
↓ open down ↓ 916 lines elided ↑ open up ↑
 917  917  {
 918  918          String_rec      result_string;
 919  919          wchar_t         wc_buf[STRING_BUFFER_LENGTH];
 920  920          char            mb_buf[STRING_BUFFER_LENGTH];
 921  921          FILE            *pipe;
 922  922          Name            value;
 923  923          int             set_host, set_target;
 924  924  #ifdef NSE
 925  925          Property        macro;
 926  926  #endif
 927      -#if defined(linux)
 928      -        const char      *mach_command = NOCATGETS("/bin/uname -p");
 929      -#else
 930  927          const char      *mach_command = NOCATGETS("/bin/mach");
 931      -#endif
 932  928  
 933  929          set_host = (get_prop(host_arch->prop, macro_prop) == NULL);
 934  930          set_target = (get_prop(target_arch->prop, macro_prop) == NULL);
 935  931  
 936  932          if (set_host || set_target) {
 937  933                  INIT_STRING_FROM_STACK(result_string, wc_buf);
 938  934                  append_char((int) hyphen_char, &result_string);
 939  935  
 940  936                  if ((pipe = popen(mach_command, "r")) == NULL) {
 941  937                          fatal_mksh(catgets(libmksdmsi18n_catd, 1, 185, "Execute of %s failed"), mach_command);
↓ open down ↓ 430 lines elided ↑ open up ↑
1372 1368                                 wcs_buffer,
1373 1369                                 wslen(wcs_buffer))) {
1374 1370                          old_vr = (wchar_t *) wschr(old_vr, (int) colon_char) + 1;
1375 1371                  }
1376 1372                  if ( (ha == ta) || (wslen(wcb_ta) == 0) ) {
1377 1373                          new_value = old_vr;
1378 1374                  } else {
1379 1375                          new_value = ALLOC_WC(length);
1380 1376                          new_value_allocated = true;
1381 1377                          WCSTOMBS(mbs_buffer, old_vr);
1382      -#if !defined(linux)
1383 1378                          (void) wsprintf(new_value,
1384 1379                                          NOCATGETS("/usr/arch/%s/%s:%s"),
1385 1380                                          ha->string_mb + 1,
1386 1381                                          ta->string_mb + 1,
1387 1382                                          mbs_buffer);
1388      -#else
1389      -                        char * mbs_new_value = (char *)getmem(length);
1390      -                        (void) sprintf(mbs_new_value,
1391      -                                        NOCATGETS("/usr/arch/%s/%s:%s"),
1392      -                                        ha->string_mb + 1,
1393      -                                        ta->string_mb + 1,
1394      -                                        mbs_buffer);
1395      -                        MBSTOWCS(new_value, mbs_new_value);
1396      -                        retmem_mb(mbs_new_value);
1397      -#endif
1398 1383                  }
1399 1384                  if (new_value[0] != 0) {
1400 1385                          (void) setvar_daemon(virtual_root,
1401 1386                                               GETNAME(new_value, FIND_LENGTH),
1402 1387                                               false,
1403 1388                                               no_daemon,
1404 1389                                               true,
1405 1390                                               debug_level);
1406 1391                  }
1407 1392                  if (new_value_allocated) {
1408 1393                          retmem(new_value);
1409 1394                  }
1410 1395          }
1411 1396          return macro;
1412 1397  }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX