Subject: Re: Q re net/host
To: Christos Zoulas <christos@tac.gw.com>
From: Georg Schwarz <georg.schwarz@freenet.de>
List: tech-pkg
Date: 03/26/2005 23:45:23
> I replaced the current host program with the one from Greg.

Thanks. In order to compile it on IRIX 5 I had to make the following
changes:

--- host.h.orig1        2005-03-26 23:30:37.000000000 +0100
+++ host.h      2005-03-26 23:32:07.000000000 +0100
@@ -151,7 +151,7 @@
 extern int h_errno;                    /* defined in the resolver library */
 #endif
 
-#ifndef _res
+#if !defined(_res) && !defined(IRIX5)  /* IRIX 5 typedefs _res */
 extern res_state_t _res;               /* defined in res_init.c */
 #endif

and

--- port.h.orig1        2005-03-26 23:30:20.000000000 +0100
+++ port.h      2005-03-26 23:36:28.000000000 +0100
@@ -36,7 +36,7 @@
 # define HAVE_MEMORY_H 1
 #endif
 
-#if defined(sgi)
+#if defined(__sgi)
 # define HAVE_VOID_MALLOC 1    /* XXX necessary?  not on any modern IRIX */
 # define HAVE_UNISTD_H 1
 #endif
@@ -60,7 +60,7 @@
 # define HAVE_VOID_MALLOC 1    /* XXX necessary?  not likely! */
 #endif
 
-#if !defined(sgi) && !defined(__STDC__)
+#if !defined(__sgi) && !defined(__STDC__)
 /* damned SGI compiler complains if you undef an ANSI thing!!! */
 # ifdef        NULL                    /* make sure NULL is 0 */
 #  undef NULL
@@ -192,7 +192,7 @@
 # define DEBUG_PREFIX  ""
 #endif
 
-#if defined(BIND_4_8) || defined(OLD_RES_STATE)
+#if (defined(BIND_4_8) || defined(OLD_RES_STATE)) && !defined(IRIX5)
 typedef struct state           res_state_t;
 #else
 typedef struct __res_state     res_state_t;


(remark: the IRIX 5.3 cc only defines __sig, whereas later versions define
both __sgi and sgi)

and add -DIRIX5 to CPPFLAGS in Makefile (I don't know a more elegant solution
to this).

On both IRIX 5 and IRIX 6 the package fails to build however due to a missing
nroff (it is an optional package on IRIX which is licensed separately by
SGI)

bmake: don't know how to make /usr/share/groff/tmac/tmac.andoc. Stop

Does anyone happen to know a reasonable way to deal with this? Pkgsrc
seems to silently assume the presence of nroff. The problem surfaces
with a couple of other packages as well.

Georg



-- 
Georg Schwarz    http://home.pages.de/~schwarz/
 georg.schwarz@freenet.de  +49 178 8545053