diff options
author | ryoon <ryoon@pkgsrc.org> | 2014-07-18 13:42:24 +0000 |
---|---|---|
committer | ryoon <ryoon@pkgsrc.org> | 2014-07-18 13:42:24 +0000 |
commit | 496b93ed634b8cd476e5f74b9c9e30dee1891680 (patch) | |
tree | 8ccd7cf948aad30e6900ede453dd8abd74e23b49 /databases/mysql55-client/patches | |
parent | b424a4c45969ec0b92391bb802c5293ace525a67 (diff) | |
download | pkgsrc-496b93ed634b8cd476e5f74b9c9e30dee1891680.tar.gz |
Fix build under SCO OpenServer 5.0.7/3.2.
Diffstat (limited to 'databases/mysql55-client/patches')
7 files changed, 433 insertions, 3 deletions
diff --git a/databases/mysql55-client/patches/patch-client_mysqladmin.cc b/databases/mysql55-client/patches/patch-client_mysqladmin.cc index 9912158c1db..b71af08d9c0 100644 --- a/databases/mysql55-client/patches/patch-client_mysqladmin.cc +++ b/databases/mysql55-client/patches/patch-client_mysqladmin.cc @@ -1,10 +1,22 @@ -$NetBSD: patch-client_mysqladmin.cc,v 1.2 2012/10/01 15:54:40 adam Exp $ +$NetBSD: patch-client_mysqladmin.cc,v 1.3 2014/07/18 13:42:24 ryoon Exp $ Redefine signals for Irix. ---- client/mysqladmin.cc.orig 2010-02-04 11:36:52.000000000 +0000 +--- client/mysqladmin.cc.orig 2014-01-14 08:16:26.000000000 +0000 +++ client/mysqladmin.cc -@@ -332,8 +332,14 @@ int main(int argc,char *argv[]) +@@ -29,6 +29,11 @@ + #define SHUTDOWN_DEF_TIMEOUT 3600 /* Wait for shutdown */ + #define MAX_TRUNC_LENGTH 3 + ++#if defined(_SCO_DS) ++#include "../strtoull.c" ++#define strtoull pkgsrc_strtoull ++#endif ++ + char *host= NULL, *user= 0, *opt_password= 0, + *default_charset= (char*) MYSQL_AUTODETECT_CHARSET_NAME; + char truncated_var_names[MAX_MYSQL_VAR][MAX_TRUNC_LENGTH]; +@@ -332,8 +337,14 @@ int main(int argc,char *argv[]) if (tty_password) opt_password = get_tty_password(NullS); diff --git a/databases/mysql55-client/patches/patch-client_mysqlshow.c b/databases/mysql55-client/patches/patch-client_mysqlshow.c new file mode 100644 index 00000000000..a3f1d9907e3 --- /dev/null +++ b/databases/mysql55-client/patches/patch-client_mysqlshow.c @@ -0,0 +1,16 @@ +$NetBSD: patch-client_mysqlshow.c,v 1.1 2014/07/18 13:42:24 ryoon Exp $ + +--- client/mysqlshow.c.orig 2014-01-14 08:16:26.000000000 +0000 ++++ client/mysqlshow.c +@@ -29,6 +29,11 @@ + #include <sslopt-vars.h> + #include <welcome_copyright_notice.h> /* ORACLE_WELCOME_COPYRIGHT_NOTICE */ + ++#if defined(_SCO_DS) ++#include "../strtoull.c" ++#define strtoull pkgsrc_strtoull ++#endif ++ + static char * host=0, *opt_password=0, *user=0; + static my_bool opt_show_keys= 0, opt_compress= 0, opt_count=0, opt_status= 0; + static my_bool tty_password= 0, opt_table_type= 0; diff --git a/databases/mysql55-client/patches/patch-include_violite.h b/databases/mysql55-client/patches/patch-include_violite.h new file mode 100644 index 00000000000..419f8f4e647 --- /dev/null +++ b/databases/mysql55-client/patches/patch-include_violite.h @@ -0,0 +1,32 @@ +$NetBSD: patch-include_violite.h,v 1.1 2014/07/18 13:42:24 ryoon Exp $ + +--- include/violite.h.orig 2014-01-14 08:16:26.000000000 +0000 ++++ include/violite.h +@@ -196,8 +196,14 @@ struct st_vio + HANDLE hPipe; + my_bool localhost; /* Are we from localhost? */ + int fcntl_mode; /* Buffered fcntl(sd,F_GETFL) */ ++#if defined(_SCO_DS) ++/* SCO OpenServer 5.0.7/3.2 has no sockaddr_storage. */ ++ struct sockaddr_in local; /* Local internet address */ ++ struct sockaddr_in remote; /* Remote internet address */ ++#else + struct sockaddr_storage local; /* Local internet address */ + struct sockaddr_storage remote; /* Remote internet address */ ++#endif + int addrLen; /* Length of remote address */ + enum enum_vio_type type; /* Type of connection */ + char desc[30]; /* String description */ +@@ -215,7 +221,12 @@ struct st_vio + int (*viokeepalive)(Vio*, my_bool); + int (*fastsend)(Vio*); + my_bool (*peer_addr)(Vio*, char *, uint16*, size_t); ++/* SCO OpenServer 5.0.7/3.2 has no sockaddr_storage. */ ++#if defined(_SCO_DS) ++ void (*in_addr)(Vio*, struct sockaddr_in*); ++#else + void (*in_addr)(Vio*, struct sockaddr_storage*); ++#endif + my_bool (*should_retry)(Vio*); + my_bool (*was_interrupted)(Vio*); + int (*vioclose)(Vio*); diff --git a/databases/mysql55-client/patches/patch-mysys_my__getopt.c b/databases/mysql55-client/patches/patch-mysys_my__getopt.c new file mode 100644 index 00000000000..4f01ec97159 --- /dev/null +++ b/databases/mysql55-client/patches/patch-mysys_my__getopt.c @@ -0,0 +1,16 @@ +$NetBSD: patch-mysys_my__getopt.c,v 1.1 2014/07/18 13:42:24 ryoon Exp $ + +--- mysys/my_getopt.c.orig 2014-01-14 08:16:26.000000000 +0000 ++++ mysys/my_getopt.c +@@ -22,6 +22,11 @@ + #include <errno.h> + #include <m_string.h> + ++#if defined(_SCO_DS) ++#include "../strtoll.c" ++#define strtoll pkgsrc_strtoll ++#endif ++ + typedef void (*init_func_p)(const struct my_option *option, void *variable, + longlong value); + diff --git a/databases/mysql55-client/patches/patch-strtoll.c b/databases/mysql55-client/patches/patch-strtoll.c new file mode 100644 index 00000000000..943e02be3a1 --- /dev/null +++ b/databases/mysql55-client/patches/patch-strtoll.c @@ -0,0 +1,163 @@ +$NetBSD: patch-strtoll.c,v 1.1 2014/07/18 13:42:24 ryoon Exp $ + +--- strtoll.c.orig 2014-03-09 04:03:38.000000000 +0000 ++++ strtoll.c +@@ -0,0 +1,158 @@ ++#if !defined(LLONG_MAX) ++#define LLONG_MAX 0x7fffffffffffffffLL ++#endif ++ ++#if !defined(LLONG_MIN) ++#define LLONG_MIN -0x7fffffffffffffffLL-1 ++#endif ++ ++#if !defined(ULLONG_MAX) ++#define ULLONG_MAX 0xffffffffffffffffULL ++#endif ++ ++/*- ++ * Copyright (c) 1992, 1993 ++ * The Regents of the University of California. All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * 3. All advertising materials mentioning features or use of this software ++ * must display the following acknowledgement: ++ * This product includes software developed by the University of ++ * California, Berkeley and its contributors. ++ * 4. Neither the name of the University nor the names of its contributors ++ * may be used to endorse or promote products derived from this software ++ * without specific prior written permission. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ++ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE ++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL ++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS ++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT ++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY ++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF ++ * SUCH DAMAGE. ++ */ ++ ++#if 0 ++#if defined(LIBC_SCCS) && !defined(lint) ++static char sccsid[] = "@(#)strtoq.c 8.1 (Berkeley) 6/4/93"; ++#endif /* LIBC_SCCS and not lint */ ++ ++#ifndef lint ++static const char rcsid[] = ++ "$FreeBSD$"; ++#endif ++#endif ++ ++#include <sys/types.h> ++ ++#include <limits.h> ++#include <errno.h> ++#include <ctype.h> ++#include <stdlib.h> ++ ++/* ++ * Convert a string to a long long integer. ++ * ++ * Ignores `locale' stuff. Assumes that the upper and lower case ++ * alphabets and digits are each contiguous. ++ */ ++long long ++pkgsrc_strtoll(nptr, endptr, base) ++ const char *nptr; ++ char **endptr; ++ register int base; ++{ ++ register const char *s; ++ register unsigned long long acc; ++ register unsigned char c; ++ register unsigned long long qbase, cutoff; ++ register int neg, any, cutlim; ++ ++ /* ++ * Skip white space and pick up leading +/- sign if any. ++ * If base is 0, allow 0x for hex and 0 for octal, else ++ * assume decimal; if base is already 16, allow 0x. ++ */ ++ s = nptr; ++ do { ++ c = *s++; ++ } while (isspace(c)); ++ if (c == '-') { ++ neg = 1; ++ c = *s++; ++ } else { ++ neg = 0; ++ if (c == '+') ++ c = *s++; ++ } ++ if ((base == 0 || base == 16) && ++ c == '0' && (*s == 'x' || *s == 'X')) { ++ c = s[1]; ++ s += 2; ++ base = 16; ++ } ++ if (base == 0) ++ base = c == '0' ? 8 : 10; ++ ++ /* ++ * Compute the cutoff value between legal numbers and illegal ++ * numbers. That is the largest legal value, divided by the ++ * base. An input number that is greater than this value, if ++ * followed by a legal input character, is too big. One that ++ * is equal to this value may be valid or not; the limit ++ * between valid and invalid numbers is then based on the last ++ * digit. For instance, if the range for quads is ++ * [-9223372036854775808..9223372036854775807] and the input base ++ * is 10, cutoff will be set to 922337203685477580 and cutlim to ++ * either 7 (neg==0) or 8 (neg==1), meaning that if we have ++ * accumulated a value > 922337203685477580, or equal but the ++ * next digit is > 7 (or 8), the number is too big, and we will ++ * return a range error. ++ * ++ * Set any if any `digits' consumed; make it negative to indicate ++ * overflow. ++ */ ++ qbase = (unsigned)base; ++ cutoff = neg ? (unsigned long long)-(LLONG_MIN + LLONG_MAX) + LLONG_MAX ++ : LLONG_MAX; ++ cutlim = cutoff % qbase; ++ cutoff /= qbase; ++ for (acc = 0, any = 0;; c = *s++) { ++ if (!isascii(c)) ++ break; ++ if (isdigit(c)) ++ c -= '0'; ++ else if (isalpha(c)) ++ c -= isupper(c) ? 'A' - 10 : 'a' - 10; ++ else ++ break; ++ if (c >= base) ++ break; ++ if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim)) ++ any = -1; ++ else { ++ any = 1; ++ acc *= qbase; ++ acc += c; ++ } ++ } ++ if (any < 0) { ++ acc = neg ? LLONG_MIN : LLONG_MAX; ++ errno = ERANGE; ++ } else if (neg) ++ acc = -acc; ++ if (endptr != 0) ++ *endptr = (char *)(any ? s - 1 : nptr); ++ return (acc); ++} diff --git a/databases/mysql55-client/patches/patch-strtoull.c b/databases/mysql55-client/patches/patch-strtoull.c new file mode 100644 index 00000000000..d7031fb598e --- /dev/null +++ b/databases/mysql55-client/patches/patch-strtoull.c @@ -0,0 +1,136 @@ +$NetBSD: patch-strtoull.c,v 1.1 2014/07/18 13:42:24 ryoon Exp $ + +--- strtoull.c.orig 2014-03-09 04:03:38.000000000 +0000 ++++ strtoull.c +@@ -0,0 +1,131 @@ ++/*- ++ * Copyright (c) 1992, 1993 ++ * The Regents of the University of California. All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * 3. All advertising materials mentioning features or use of this software ++ * must display the following acknowledgement: ++ * This product includes software developed by the University of ++ * California, Berkeley and its contributors. ++ * 4. Neither the name of the University nor the names of its contributors ++ * may be used to endorse or promote products derived from this software ++ * without specific prior written permission. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ++ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE ++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL ++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS ++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT ++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY ++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF ++ * SUCH DAMAGE. ++ */ ++ ++#if defined(LIBC_SCCS) && !defined(lint) ++static char sccsid[] = "@(#)strtouq.c 8.1 (Berkeley) 6/4/93"; ++#endif /* LIBC_SCCS and not lint */ ++#include <sys/cdefs.h> ++/*__FBSDID("$FreeBSD: src/lib/libc/stdlib/strtoull.c,v 1.18 2002/09/06 11:23:59 tjr Exp $"); */ ++ ++#include <limits.h> ++#include <errno.h> ++#include <ctype.h> ++#include <stdlib.h> ++ ++#if !defined(LLONG_MAX) ++#define LLONG_MAX 0x7fffffffffffffffLL ++#endif ++ ++#if !defined(LLONG_MIN) ++#define LLONG_MIN -0x7fffffffffffffffLL-1 ++#endif ++ ++#if !defined(ULLONG_MAX) ++#define ULLONG_MAX 0xffffffffffffffffULL ++#endif ++ ++/* ++ * Convert a string to an unsigned long long integer. ++ * ++ * Assumes that the upper and lower case ++ * alphabets and digits are each contiguous. ++ */ ++unsigned long long ++pkgsrc_strtoull(const char * __restrict nptr, char ** __restrict endptr, int base) ++{ ++ const char *s; ++ unsigned long long acc; ++ char c; ++ unsigned long long cutoff; ++ int neg, any, cutlim; ++ ++ /* ++ * See strtoq for comments as to the logic used. ++ */ ++ s = nptr; ++ do { ++ c = *s++; ++ } while (isspace((unsigned char)c)); ++ if (c == '-') { ++ neg = 1; ++ c = *s++; ++ } else { ++ neg = 0; ++ if (c == '+') ++ c = *s++; ++ } ++ if ((base == 0 || base == 16) && ++ c == '0' && (*s == 'x' || *s == 'X')) { ++ c = s[1]; ++ s += 2; ++ base = 16; ++ } ++ if (base == 0) ++ base = c == '0' ? 8 : 10; ++ acc = any = 0; ++ if (base < 2 || base > 36) ++ goto noconv; ++ ++ cutoff = ULLONG_MAX / base; ++ cutlim = ULLONG_MAX % base; ++ for ( ; ; c = *s++) { ++ if (c >= '0' && c <= '9') ++ c -= '0'; ++ else if (c >= 'A' && c <= 'Z') ++ c -= 'A' - 10; ++ else if (c >= 'a' && c <= 'z') ++ c -= 'a' - 10; ++ else ++ break; ++ if (c >= base) ++ break; ++ if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim)) ++ any = -1; ++ else { ++ any = 1; ++ acc *= base; ++ acc += c; ++ } ++ } ++ if (any < 0) { ++ acc = ULLONG_MAX; ++ errno = ERANGE; ++ } else if (!any) { ++noconv: ++ errno = EINVAL; ++ } else if (neg) ++ acc = -acc; ++ if (endptr != NULL) ++ *endptr = (char *)(any ? s - 1 : nptr); ++ return (acc); ++} diff --git a/databases/mysql55-client/patches/patch-vio_viosocket.c b/databases/mysql55-client/patches/patch-vio_viosocket.c new file mode 100644 index 00000000000..4f92c686f46 --- /dev/null +++ b/databases/mysql55-client/patches/patch-vio_viosocket.c @@ -0,0 +1,55 @@ +$NetBSD: patch-vio_viosocket.c,v 1.1 2014/07/18 13:42:24 ryoon Exp $ + +--- vio/viosocket.c.orig 2014-01-14 08:16:26.000000000 +0000 ++++ vio/viosocket.c +@@ -34,6 +34,12 @@ + # include <sys/filio.h> + #endif + ++#if defined(_SCO_DS) ++/* SCO OpenServer 5.0.7/3.2 has no SHUT_* macros. ++ See http://osr507doc.sco.com/en/netguide/disockD.system_calls.html */ ++#define SHUT_RDWR 2 ++#endif ++ + int vio_errno(Vio *vio __attribute__((unused))) + { + return socket_errno; /* On Win32 this mapped to WSAGetLastError() */ +@@ -460,7 +466,12 @@ my_bool vio_get_normalized_ip_string(con + char *ip_string, + size_t ip_string_size) + { ++/* SCO OpenServer 5.0.7/3.2 has no sockaddr_storage. */ ++#if defined(_SCO_DS) ++ struct sockaddr_in norm_addr_storage; ++#else + struct sockaddr_storage norm_addr_storage; ++#endif + struct sockaddr *norm_addr= (struct sockaddr *) &norm_addr_storage; + int norm_addr_length; + int err_code; +@@ -504,7 +515,11 @@ my_bool vio_peer_addr(Vio *vio, char *ip + */ + struct in_addr *ip4= &((struct sockaddr_in *) &(vio->remote))->sin_addr; + ++/* SCO OpenServer 5.0.7/3.2 has no sockaddr_storage, and use sockaddr_in. ++ So there is no ss_family in sockaddr_in. */ ++#if !defined(_SCO_DS) + vio->remote.ss_family= AF_INET; ++#endif + vio->addrLen= sizeof (struct sockaddr_in); + + ip4->s_addr= htonl(INADDR_LOOPBACK); +@@ -519,7 +534,12 @@ my_bool vio_peer_addr(Vio *vio, char *ip + int err_code; + char port_buffer[NI_MAXSERV]; + ++/* SCO OpenServer 5.0.7/3.2 has no sockaddr_storage. */ ++#if defined(_SCO_DS) ++ struct sockaddr_in addr_storage; ++#else + struct sockaddr_storage addr_storage; ++#endif + struct sockaddr *addr= (struct sockaddr *) &addr_storage; + size_socket addr_length= sizeof (addr_storage); + |