pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/devel/m4 Fix IRIX build by providing a getprogname imp...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/463269ee4c33
branches:  trunk
changeset: 377187:463269ee4c33
user:      jmcneill <jmcneill%pkgsrc.org@localhost>
date:      Tue Mar 13 20:26:42 2018 +0000

description:
Fix IRIX build by providing a getprogname implementation.

diffstat:

 devel/m4/distinfo                        |   3 +-
 devel/m4/patches/patch-lib_getprogname.c |  52 ++++++++++++++++++++++++++++++++
 2 files changed, 54 insertions(+), 1 deletions(-)

diffs (71 lines):

diff -r 4e6fa7ae249d -r 463269ee4c33 devel/m4/distinfo
--- a/devel/m4/distinfo Tue Mar 13 20:11:14 2018 +0000
+++ b/devel/m4/distinfo Tue Mar 13 20:26:42 2018 +0000
@@ -1,9 +1,10 @@
-$NetBSD: distinfo,v 1.42 2017/08/25 05:28:53 adam Exp $
+$NetBSD: distinfo,v 1.43 2018/03/13 20:26:42 jmcneill Exp $
 
 SHA1 (m4-1.4.18.tar.gz) = 2f76f8105a45b05c8cfede97b3193cd88b31c657
 RMD160 (m4-1.4.18.tar.gz) = 16396a6ffbb2105cdd0a36c773b44d16854ed740
 SHA512 (m4-1.4.18.tar.gz) = 29254dd4267a093e8d9da3a26df8b02564044cdb4506be539ec1aff4e5d406477bcf32f5e813c840f3aec77293bfe2cdde18f6a21724a7e0bfff646ec88b74ae
 Size (m4-1.4.18.tar.gz) = 2006643 bytes
 SHA1 (patch-isnan.c) = a960f35e5168bed47c5924e36bfb254dc1a44621
+SHA1 (patch-lib_getprogname.c) = 3a8e7c028342ef3a9f86839f1a5ae36571a65f12
 SHA1 (patch-lib_stdio.in.h) = 21557ea9d86dbeb36062df4e62cb71735b06480b
 SHA1 (patch-lib_vasnprintf.c) = 2bced6c121efc9bc5894174c7745ba89e8f53033
diff -r 4e6fa7ae249d -r 463269ee4c33 devel/m4/patches/patch-lib_getprogname.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/m4/patches/patch-lib_getprogname.c  Tue Mar 13 20:26:42 2018 +0000
@@ -0,0 +1,52 @@
+$NetBSD: patch-lib_getprogname.c,v 1.1 2018/03/13 20:26:43 jmcneill Exp $
+
+--- lib/getprogname.c.orig     Tue Mar 13 15:45:15 AST 2018
++++ lib/getprogname.c  Tue Mar 13 15:49:41 AST 2018
+@@ -43,6 +43,14 @@
+ # include <string.h>
+ #endif
+ 
++#ifdef __sgi
++# include <string.h>
++# include <unistd.h>
++# include <stdio.h>
++# include <fcntl.h>
++# include <sys/procfs.h>
++#endif
++
+ #include "dirname.h"
+ 
+ #ifndef HAVE_GETPROGNAME             /* not Mac OS X, FreeBSD, NetBSD, OpenBSD >= 5.4, Cygwin */
+@@ -143,6 +151,32 @@
+       free (buf.ps_pathptr);
+     }
+   return p;
++# elif defined __sgi
++  char filename[50];
++  int fd;
++
++  sprintf (filename, "/proc/pinfo/%d", (int) getpid ());
++  fd = open (filename, O_RDONLY);
++  if (0 <= fd)
++    {
++      prpsinfo_t buf;
++      int ioctl_ok = 0 <= ioctl (fd, PIOCPSINFO, &buf);
++      close (fd);
++      if (ioctl_ok)
++      {
++        char *name = buf.pr_fname;
++        char *namesize = sizeof buf.pr_fname;
++        char *namenul = memchr (name, '\0', namesize);
++        size_t namelen = namenul ? namenul - name : namesize;
++        char *namecopy = malloc (namelen + 1);
++        if (namecopy)
++          {
++            namecopy[namelen] = 0;
++            return memcpy (namecopy, name, namelen);
++          }
++      }
++    }
++  return NULL;
+ # else
+ #  error "getprogname module not ported to this OS"
+ # endif



Home | Main Index | Thread Index | Old Index