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

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/make/bin/pmake.cc
          +++ new/usr/src/cmd/make/bin/pmake.cc
↓ open down ↓ 30 lines elided ↑ open up ↑
  31   31  #include <arpa/inet.h>
  32   32  #include <mk/defs.h>
  33   33  #include <mksh/misc.h>
  34   34  #include <netdb.h>
  35   35  #include <netinet/in.h>
  36   36  #include <sys/socket.h>
  37   37  #include <sys/stat.h>
  38   38  #include <sys/types.h>
  39   39  #include <sys/utsname.h>
  40   40  #include <rpc/rpc.h>            /* host2netname(), netname2host() */
  41      -#ifdef linux
  42      -#       include <unistd.h>      /* getdomainname() */
  43      -#endif
  44   41  
  45   42  /*
  46   43   * Defined macros
  47   44   */
  48   45  
  49   46  /*
  50   47   * typedefs & structs
  51   48   */
  52   49  
  53   50  /*
↓ open down ↓ 137 lines elided ↑ open up ↑
 191  188          }
 192  189  
 193  190          uname(&uts_info);
 194  191          strcpy(local_host_mb, &uts_info.nodename[0]);
 195  192          MBSTOWCS(local_host, local_host_mb);
 196  193          local_host_wslen = wslen(local_host);
 197  194  
 198  195          // There is no getdomainname() function on Solaris.
 199  196          // And netname2host() function does not work on Linux.
 200  197          // So we have to use different APIs.
 201      -#ifdef linux
 202      -        if (getdomainname(mbs_buffer, MAXNETNAMELEN+1) == 0) {
 203      -                sprintf(mbs_buffer2, "%s.%s", local_host_mb, mbs_buffer);
 204      -#else
 205  198          if (host2netname(mbs_buffer, NULL, NULL) &&
 206  199              netname2host(mbs_buffer, mbs_buffer2, MAXNETNAMELEN+1)) {
 207      -#endif
 208  200                  MBSTOWCS(full_host, mbs_buffer2);
 209  201                  full_host_wslen = wslen(full_host);
 210  202          }
 211  203  
 212  204          for (ms = make_machines_list;
 213  205               (ms) && (*ms );
 214  206               ) {
 215  207                  /*
 216  208                   * Skip white space and comments till you reach
 217  209                   * a machine name.
↓ open down ↓ 212 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX