pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/devel/bmkdep Fix compilation failure on SunOS



details:   https://anonhg.NetBSD.org/pkgsrc/rev/f95f87461161
branches:  trunk
changeset: 627753:f95f87461161
user:      cheusov <cheusov%pkgsrc.org@localhost>
date:      Sat Dec 14 17:56:22 2013 +0000

description:
Fix compilation failure on SunOS

diffstat:

 devel/bmkdep/distinfo               |   5 +-
 devel/bmkdep/patches/patch-findcc.c |  12 ++++++
 devel/bmkdep/patches/patch-mkdep.c  |  68 ++++++++++++++++++++++++++++++++++--
 3 files changed, 78 insertions(+), 7 deletions(-)

diffs (117 lines):

diff -r d1bdd9fa40f6 -r f95f87461161 devel/bmkdep/distinfo
--- a/devel/bmkdep/distinfo     Sat Dec 14 17:11:22 2013 +0000
+++ b/devel/bmkdep/distinfo     Sat Dec 14 17:56:22 2013 +0000
@@ -1,6 +1,7 @@
-$NetBSD: distinfo,v 1.2 2013/12/08 16:33:35 cheusov Exp $
+$NetBSD: distinfo,v 1.3 2013/12/14 17:56:22 cheusov Exp $
 
 SHA1 (bmkdep-20131009.tar.gz) = ee39788129f1f755718aeb63ede9214c17fe8e33
 RMD160 (bmkdep-20131009.tar.gz) = 4fb5ce80f88ee6b342830805a5ce15bd82e38160
 Size (bmkdep-20131009.tar.gz) = 7389 bytes
-SHA1 (patch-mkdep.c) = 389045b65d9d6e4782caa9e6a9412601d6a70122
+SHA1 (patch-findcc.c) = c4b373f7f0a7967c76bc7c2be169eb4161605e3d
+SHA1 (patch-mkdep.c) = 22bfb9801e216e4e02802c534244f466d523dd9b
diff -r d1bdd9fa40f6 -r f95f87461161 devel/bmkdep/patches/patch-findcc.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/bmkdep/patches/patch-findcc.c       Sat Dec 14 17:56:22 2013 +0000
@@ -0,0 +1,12 @@
+$NetBSD: patch-findcc.c,v 1.3 2013/12/14 17:56:22 cheusov Exp $
+
+--- findcc.c.orig      2013-10-09 14:38:38.000000000 +0000
++++ findcc.c
+@@ -33,7 +33,6 @@
+ #include "nbtool_config.h"
+ #endif
+ 
+-#include <sys/cdefs.h>
+ #if !defined(lint)
+ __COPYRIGHT("@(#) Copyright (c) 1999 The NetBSD Foundation, Inc.\
+  All rights reserved.");
diff -r d1bdd9fa40f6 -r f95f87461161 devel/bmkdep/patches/patch-mkdep.c
--- a/devel/bmkdep/patches/patch-mkdep.c        Sat Dec 14 17:11:22 2013 +0000
+++ b/devel/bmkdep/patches/patch-mkdep.c        Sat Dec 14 17:56:22 2013 +0000
@@ -1,9 +1,46 @@
-$NetBSD: patch-mkdep.c,v 1.2 2013/12/08 16:33:35 cheusov Exp $
+$NetBSD: patch-mkdep.c,v 1.3 2013/12/14 17:56:22 cheusov Exp $
 
 For better portability
---- mkdep.c.orig       2013-10-09 17:38:38.000000000 +0300
-+++ mkdep.c    2013-12-08 17:31:52.000000000 +0300
-@@ -89,13 +83,13 @@
+--- mkdep.c.orig       2013-10-09 14:38:38.000000000 +0000
++++ mkdep.c
+@@ -33,7 +33,6 @@
+ #include "nbtool_config.h"
+ #endif
+ 
+-#include <sys/cdefs.h>
+ #if !defined(lint)
+ __COPYRIGHT("@(#) Copyright (c) 1999 The NetBSD Foundation, Inc.\
+  All rights reserved.");
+@@ -48,15 +47,28 @@ __RCSID("$NetBSD: mkdep.c,v 1.43 2013/03
+ #include <fcntl.h>
+ #include <getopt.h>
+ #include <locale.h>
++
++#ifndef __sun
+ #include <paths.h>
+ #define _WITH_DPRINTF
++#endif
++
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+ #include <unistd.h>
++#include <limits.h>
+ 
+ #include "findcc.h"
+ 
++#ifndef _PATH_TMP
++#define _PATH_TMP "/tmp"
++#endif
++
++#ifndef _PATH_DEFPATH
++#define _PATH_DEFPATH "/usr/bin:/bin:/usr/local/bin"
++#endif
++
+ typedef struct opt opt_t;
+ struct opt {
+       opt_t   *left;
+@@ -89,13 +101,13 @@ deconst(const void *p)
        return (const char *)p - (const char *)0 + (char *)0;
  }
  
@@ -19,7 +56,13 @@
        exit(EXIT_FAILURE);
  }
  
-@@ -234,7 +228,6 @@
+@@ -229,12 +241,12 @@ main(int argc, char **argv)
+       const char *prefix = NULL;
+       const char *suffixes = NULL, *s;
+       suff_list_t *suff_list = NULL, *sl;
++      char incl [PATH_MAX+100];
+ 
+       suf = NULL;             /* XXXGCC -Wuninitialized [sun2] */
        sl = NULL;              /* XXXGCC -Wuninitialized [sun2] */
  
        setlocale(LC_ALL, "");
@@ -27,3 +70,18 @@
  
        aflag = O_WRONLY | O_APPEND | O_CREAT | O_TRUNC;
        dflag = 0;
+@@ -329,8 +341,14 @@ main(int argc, char **argv)
+                       } else
+                               fname = *argv++;
+                       if (iflag) {
++#ifdef _WITH_DPRINTF
+                               if (dprintf(dependfile, ".-include \"%s\"\n",
+                                   fname) < 0)
++#else
++                              snprintf (incl, sizeof (incl),
++                                  ".-include \"%s\"\n", fname);
++                              if (write(dependfile, incl, strlen(incl)) < 0)
++#endif
+                                       goto wrerror;
+                               continue;
+                       }



Home | Main Index | Thread Index | Old Index