Subject: Re: building lang/gcc under IRIX 6.5.22f fails (or: how to disable this dependancy)
To: None <tech-pkg@NetBSD.org>
From: Jan Schaumann <jschauma@netmeister.org>
List: tech-pkg
Date: 01/26/2005 15:33:00
--YkJPYEFdoxh/AXLE
Content-Type: multipart/mixed; boundary="pZs/OQEoSSbxGlYw"
Content-Disposition: inline


--pZs/OQEoSSbxGlYw
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Adrian Kiess <dac@conglom-o.org> wrote:
=20
> the build of lang/gcc under IRIX 6.5.22f fails.
> A lot of packages like pkgtools/pkgfind for example depend on it

For pkgfind, try the attached patch.  That should make it compile
without lang/gcc.

-Jan

--=20
Information wants to be free.

--pZs/OQEoSSbxGlYw
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=diff
Content-Transfer-Encoding: quoted-printable

Index: Makefile
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvsroot/pkgsrc/pkgtools/pkgfind/Makefile,v
retrieving revision 1.7
diff -b -u -r1.7 Makefile
--- Makefile	25 Jan 2005 23:39:30 -0000	1.7
+++ Makefile	26 Jan 2005 20:05:17 -0000
@@ -34,8 +34,10 @@
=20
 .include "../../mk/bsd.prefs.mk"
=20
-.if ${OPSYS} =3D=3D "Interix"
-.  include "../../devel/libiberty/application.mk" # need asprintf(3)
+.if ${OPSYS} =3D=3D "IRIX"
+CFLAGS+=3D	-DNEED_LIBNBCOMPAT
+LDFLAGS+=3D	-lnbcompat
+.  include "../../pkgtools/libnbcompat/buildlink3.mk" # need err(1), warn(=
1)
 .endif
=20
 .include "../../mk/bsd.pkg.mk"
Index: files/pkgfind.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvsroot/pkgsrc/pkgtools/pkgfind/files/pkgfind.c,v
retrieving revision 1.4
diff -b -u -r1.4 pkgfind.c
--- files/pkgfind.c	23 Oct 2004 10:48:08 -0000	1.4
+++ files/pkgfind.c	26 Jan 2005 20:05:17 -0000
@@ -38,8 +38,13 @@
 #include <sys/param.h>
 #include <sys/stat.h>
=20
-#include <ctype.h>
+#ifdef NEED_LIBNBCOMPAT
+#include <nbcompat.h>
+#else
 #include <err.h>
+#endif
+
+#include <ctype.h>
 #include <dirent.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -71,6 +76,8 @@
 	const char *path;
 	int ch;
=20
+	setprogname("pkgfind");
+
 	/* default searches have partial matches */
 	search =3D partialmatch;
=20
@@ -165,18 +172,23 @@
 showpkg(const char *path, const char *cat, const char *pkg)
 {
 	char *mk, *comment =3D NULL;
+	int len;
+
+	len =3D strlen(path) + strlen(cat) + strlen(pkg) + strlen("Makefile") + 3=
 + 1;
=20
 	if (!qflag) {
-		(void)asprintf(&mk, "%s/%s/%s/Makefile", path, cat, pkg);
-		if (mk =3D=3D NULL)
-			err(EXIT_FAILURE, "asprintf");
+		if ((mk =3D malloc(len)) =3D=3D NULL)
+			err(EXIT_FAILURE, "malloc");
+		(void)snprintf(mk, len, "%s/%s/%s/Makefile", path, cat, pkg);
=20
 		if (getcomment(mk, &comment) =3D=3D 0) {
 			free(mk);
-			(void)asprintf(&mk, "%s/%s/%s/Makefile.common",
+			if ((mk =3D malloc(len + 7)) =3D=3D NULL)
+				err(EXIT_FAILURE, "malloc");
+			(void)snprintf(mk, len+7, "%s/%s/%s/Makefile.common",
 			    path, cat, pkg);
 			if (mk =3D=3D NULL)
-				err(EXIT_FAILURE, "asprintf");
+				err(EXIT_FAILURE, "snprintf");
 			(void)getcomment(mk, &comment);
 		}
 		free(mk);
@@ -259,8 +271,6 @@
 static void
 usage(void)
 {
-	extern char *__progname;
-
-	(void)fprintf(stderr, "Usage: %s [-Ccqx] keyword [...]\n", __progname);
+	(void)fprintf(stderr, "Usage: %s [-Ccqx] keyword [...]\n", getprogname());
 	exit(EXIT_FAILURE);
 }

--pZs/OQEoSSbxGlYw--

--YkJPYEFdoxh/AXLE
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (NetBSD)

iD8DBQFB9/58fFtkr68iakwRAtdGAKC4SXdbC696P0kxzyh5WNaJ3Zh4NgCdFrg5
EeSGGXcXGpRqLsUVUenOKe4=
=V14Y
-----END PGP SIGNATURE-----

--YkJPYEFdoxh/AXLE--