Subject: pkg/30399: pkg_install-20050530 does not build on Solaris
To: None <,,>
From: None <>
List: pkgsrc-bugs
Date: 06/02/2005 09:27:00
>Number:         30399
>Category:       pkg
>Synopsis:       pkg_install-20050530 does not build on Solaris
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jun 02 09:27:00 +0000 2005
>Originator:     Neil Hoggarth
>Release:        Solaris 9
Laboratory of Physiology, Oxford University
SunOS saros 5.9 Generic_112233-11 sun4u sparc SUNW,Ultra-30

When building pkg_install-20050530 on Solaris 9, the compile fails:

===> Building for pkg_install-20050530
gcc -DHAVE_CONFIG_H -DDEF_LOG_DIR=\"/var/db/pkg\" -DTAR_CMD=\""/usr/pkg/bin/tar"\" -DFTP_CMD=\""/usr/pkg/bin/ftp"\" -DDEF_UMASK=022 -I/export/scratch/pkgsrc/pkgtools/pkg_install/work/libnbcompat -I. -I. -O -c exec.c
gcc -DHAVE_CONFIG_H -DDEF_LOG_DIR=\"/var/db/pkg\" -DTAR_CMD=\""/usr/pkg/bin/tar"\" -DFTP_CMD=\""/usr/pkg/bin/ftp"\" -DDEF_UMASK=022 -I/export/scratch/pkgsrc/pkgtools/pkg_install/work/libnbcompat -I. -I. -O -c fexec.c
gcc -DHAVE_CONFIG_H -DDEF_LOG_DIR=\"/var/db/pkg\" -DTAR_CMD=\""/usr/pkg/bin/tar"\" -DFTP_CMD=\""/usr/pkg/bin/ftp"\" -DDEF_UMASK=022 -I/export/scratch/pkgsrc/pkgtools/pkg_install/work/libnbcompat -I. -I. -O -c file.c
gcc -DHAVE_CONFIG_H -DDEF_LOG_DIR=\"/var/db/pkg\" -DTAR_CMD=\""/usr/pkg/bin/tar"\" -DFTP_CMD=\""/usr/pkg/bin/ftp"\" -DDEF_UMASK=022 -I/export/scratch/pkgsrc/pkgtools/pkg_install/work/libnbcompat -I. -I. -O -c ftpio.c
ftpio.c: In function `ftp_start':
ftpio.c:501: error: `MAXHOSTNAMELEN' undeclared (first use in this function)
ftpio.c:501: error: (Each undeclared identifier is reported only once
ftpio.c:501: error: for each function it appears in.)
*** Error code 1

bmake: stopped in /export/scratch/pkgsrc/pkgtools/pkg_install/work/pkg_install-20050530/lib
*** Error code 1



I searched the Solaris header files for the constant MAXHOSTNAMELEN.
It is defined in /usr/include/netdb.h. I added a #include for this file
to ftpio.c, thusly:

--- ftpio.c.orig        Thu Jun  2 10:22:59 2005
+++ ftpio.c     Thu Jun  2 10:23:40 2005
@@ -125,6 +125,9 @@
 #include <unistd.h>
+#include <netdb.h>
 #include <vis.h>