1 |
commit: bf07ad320437cecbc578b1289ed2e2c8837a79f6 |
2 |
Author: David Seifert <soap <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Aug 30 18:00:39 2016 +0000 |
4 |
Commit: David Seifert <soap <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Aug 30 18:00:59 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bf07ad32 |
7 |
|
8 |
net-misc/bopm: Add missing AX_FUNC_SNPRINTF macro from autoconf-archive |
9 |
|
10 |
Gentoo-bug: 592404 |
11 |
|
12 |
Package-Manager: portage-2.3.0 |
13 |
|
14 |
net-misc/bopm/files/bopm-3.1.3-autotools.patch | 88 ++++++++++++++++++++++++++ |
15 |
1 file changed, 88 insertions(+) |
16 |
|
17 |
diff --git a/net-misc/bopm/files/bopm-3.1.3-autotools.patch b/net-misc/bopm/files/bopm-3.1.3-autotools.patch |
18 |
index e336150..e2927b0 100644 |
19 |
--- a/net-misc/bopm/files/bopm-3.1.3-autotools.patch |
20 |
+++ b/net-misc/bopm/files/bopm-3.1.3-autotools.patch |
21 |
@@ -44,6 +44,94 @@ |
22 |
AC_CONFIG_SRCDIR(src/libopm.h) |
23 |
AM_CONFIG_HEADER(src/setup.h) |
24 |
AM_INIT_AUTOMAKE() |
25 |
+--- bopm-3.1.3/src/libopm/m4/ax_func_snprintf.m4 |
26 |
++++ bopm-3.1.3/src/libopm/m4/ax_func_snprintf.m4 |
27 |
+@@ -0,0 +1,85 @@ |
28 |
++# =========================================================================== |
29 |
++# http://www.gnu.org/software/autoconf-archive/ax_func_snprintf.html |
30 |
++# =========================================================================== |
31 |
++# |
32 |
++# SYNOPSIS |
33 |
++# |
34 |
++# AX_FUNC_SNPRINTF |
35 |
++# |
36 |
++# DESCRIPTION |
37 |
++# |
38 |
++# Checks for a fully C99 compliant snprintf, in particular checks whether |
39 |
++# it does bounds checking and returns the correct string length; does the |
40 |
++# same check for vsnprintf. If no working snprintf or vsnprintf is found, |
41 |
++# request a replacement and warn the user about it. Note: the mentioned |
42 |
++# replacement is freely available and may be used in any project |
43 |
++# regardless of it's license. |
44 |
++# |
45 |
++# LICENSE |
46 |
++# |
47 |
++# Copyright (c) 2008 Ruediger Kuhlmann <info@×××××××××××××××××.de> |
48 |
++# |
49 |
++# Copying and distribution of this file, with or without modification, are |
50 |
++# permitted in any medium without royalty provided the copyright notice |
51 |
++# and this notice are preserved. This file is offered as-is, without any |
52 |
++# warranty. |
53 |
++ |
54 |
++#serial 5 |
55 |
++ |
56 |
++AU_ALIAS([AC_FUNC_SNPRINTF], [AX_FUNC_SNPRINTF]) |
57 |
++AC_DEFUN([AX_FUNC_SNPRINTF], |
58 |
++[AC_CHECK_FUNCS(snprintf vsnprintf) |
59 |
++AC_MSG_CHECKING(for working snprintf) |
60 |
++AC_CACHE_VAL(ac_cv_have_working_snprintf, |
61 |
++[AC_TRY_RUN( |
62 |
++[#include <stdio.h> |
63 |
++ |
64 |
++int main(void) |
65 |
++{ |
66 |
++ char bufs[5] = { 'x', 'x', 'x', '\0', '\0' }; |
67 |
++ char bufd[5] = { 'x', 'x', 'x', '\0', '\0' }; |
68 |
++ int i; |
69 |
++ i = snprintf (bufs, 2, "%s", "111"); |
70 |
++ if (strcmp (bufs, "1")) exit (1); |
71 |
++ if (i != 3) exit (1); |
72 |
++ i = snprintf (bufd, 2, "%d", 111); |
73 |
++ if (strcmp (bufd, "1")) exit (1); |
74 |
++ if (i != 3) exit (1); |
75 |
++ exit(0); |
76 |
++}], ac_cv_have_working_snprintf=yes, ac_cv_have_working_snprintf=no, ac_cv_have_working_snprintf=cross)]) |
77 |
++AC_MSG_RESULT([$ac_cv_have_working_snprintf]) |
78 |
++AC_MSG_CHECKING(for working vsnprintf) |
79 |
++AC_CACHE_VAL(ac_cv_have_working_vsnprintf, |
80 |
++[AC_TRY_RUN( |
81 |
++[#include <stdio.h> |
82 |
++#include <stdarg.h> |
83 |
++ |
84 |
++int my_vsnprintf (char *buf, const char *tmpl, ...) |
85 |
++{ |
86 |
++ int i; |
87 |
++ va_list args; |
88 |
++ va_start (args, tmpl); |
89 |
++ i = vsnprintf (buf, 2, tmpl, args); |
90 |
++ va_end (args); |
91 |
++ return i; |
92 |
++} |
93 |
++ |
94 |
++int main(void) |
95 |
++{ |
96 |
++ char bufs[5] = { 'x', 'x', 'x', '\0', '\0' }; |
97 |
++ char bufd[5] = { 'x', 'x', 'x', '\0', '\0' }; |
98 |
++ int i; |
99 |
++ i = my_vsnprintf (bufs, "%s", "111"); |
100 |
++ if (strcmp (bufs, "1")) exit (1); |
101 |
++ if (i != 3) exit (1); |
102 |
++ i = my_vsnprintf (bufd, "%d", 111); |
103 |
++ if (strcmp (bufd, "1")) exit (1); |
104 |
++ if (i != 3) exit (1); |
105 |
++ exit(0); |
106 |
++}], ac_cv_have_working_vsnprintf=yes, ac_cv_have_working_vsnprintf=no, ac_cv_have_working_vsnprintf=cross)]) |
107 |
++AC_MSG_RESULT([$ac_cv_have_working_vsnprintf]) |
108 |
++if test x$ac_cv_have_working_snprintf$ac_cv_have_working_vsnprintf != "xyesyes"; then |
109 |
++ AC_LIBOBJ(snprintf) |
110 |
++ AC_MSG_WARN([Replacing missing/broken (v)snprintf() with version from http://www.ijs.si/software/snprintf/.]) |
111 |
++ AC_DEFINE(PREFER_PORTABLE_SNPRINTF, 1, "enable replacement (v)snprintf if system (v)snprintf is broken") |
112 |
++fi]) |
113 |
--- bopm-3.1.3/src/libopm/m4/etr_socket_nsl.m4 |
114 |
+++ bopm-3.1.3/src/libopm/m4/etr_socket_nsl.m4 |
115 |
@@ -0,0 +1,81 @@ |