List:General Discussion« Previous MessageNext Message »
From:Dan Nelson Date:July 14 2002 7:04pm
Subject:Re: mysql-4.0.2-alpha BROKEN on OSX 10.1.4 Server; WORKAROUNDS incl., but need help with FIXes
View as plain text  
In the last episode (Jul 13), R Blake said:
> BUG #1:
> <sys/poll.h> does not seem to exist in BSD variants (cref: 
> http://www.netsys.com/bsdi-users/2001-11/msg00093.html), but nonetheless, 
> "./configure" sets HAVE_POLL as defined, causing make to fail with 
> sys/poll.h "not found".
> 
> WORKAROUND:
> ==========================
> (EDITOR) /usr/ports/mysql-4.0.2-alph/configure.in
> (CHANGE)
> 	/* Define if you have the poll function.  */
> 	#define HAVE_POLL 1
> (TO)
> 	/* Define if you have the poll function.  */
> 	/* #define HAVE_POLL 1 */
> ==========================

The correct thing to do is probably to fix include/my_net.h.  poll
requires <poll.h>, not <sys/poll.h>.  In addition, there should be an
autoconf check for <poll.h>, instead of assuming that because you have
a poll function there is also a poll.h.

http://www.opengroup.org/onlinepubs/007904975/functions/poll.html

--- include/my_net.h~   Mon Jul  1 06:16:44 2002
+++ include/my_net.h    Sun Jul 14 13:43:49 2002
@@ -38,7 +38,7 @@
 #include <arpa/inet.h>
 #endif
 #ifdef HAVE_POLL
-#include <sys/poll.h>
+#include <poll.h>
 #endif
 #ifdef HAVE_SYS_IOCTL_H
 #include <sys/ioctl.h>
 
> 
> BUG #2:
> a subsequent "make" fails with:
> 
> ar cru libreadline.a readline.o funmap.o keymaps.o vi_mode.o parens.o 
> rltty.o complete.o bind.o isearch.o display.o signals.o util.o kill.o 
> undo.o macro.o input.o callback.o terminal.o xmalloc.o history.o 
> histsearch.o histexpand.o histfile.o nls.o search.o shell.o tilde.o
> ranlib libreadline.a
> make[2]: Leaving directory 
> `/Volumes/ServerSystem/ports/mysql-4.0.2-alpha/readline'
> Making all in pstack
> make[2]: Entering directory 
> `/Volumes/ServerSystem/ports/mysql-4.0.2-alpha/pstack'
> Making all in aout
> make[3]: Entering directory 
> `/Volumes/ServerSystem/ports/mysql-4.0.2-alpha/pstack/aout'
> make[3]: Nothing to be done for `all'.
> make[3]: Leaving directory 
> `/Volumes/ServerSystem/ports/mysql-4.0.2-alpha/pstack/aout'
> make[3]: Entering directory 
> `/Volumes/ServerSystem/ports/mysql-4.0.2-alpha/pstack'
> make[3]: Nothing to be done for `all-am'.
> make[3]: Leaving directory 
> `/Volumes/ServerSystem/ports/mysql-4.0.2-alpha/pstack'
> make[2]: Leaving directory 
> `/Volumes/ServerSystem/ports/mysql-4.0.2-alpha/pstack'
> Making all in libmysql
> make[2]: Entering directory 
> `/Volumes/ServerSystem/ports/mysql-4.0.2-alpha/libmysql'
> /bin/sh ../libtool --mode=compile cc 
> -DDEFAULT_CHARSET_HOME="\"/usr/local/mysql\"" 
> -DDATADIR="\"/private/var/mysql\"" 
> -DSHAREDIR="\"/usr/local/var/mysql/mysql\"" -DUNDEF_THREADS_HACK 
> -DDONT_USE_RAID  -DMYSQL_CLIENT -I./../include -I../include -I./.. -I.. 
> -I..   -I/System/Library/Frameworks -I/usr/include -I/usr/local/include 
> -I/usr/X11R6/include -I/usr/local/BerkeleyDB/include -O -DDBUG_OFF -O3 
> -fno-omit-frame-pointer -L/System/Library/Frameworks -L/usr/lib 
> -L/usr/local/lib -L/usr/X11R6/lib -L/usr/local/BerkeleyDB/lib 
> -traditional-cpp -DHAVE_DARWIN_THREADS -D_P1003_1B_VISIBLE 
> -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DHAVE_BROKEN_REALPATH -c 
> libmysql.c
> cc -DDEFAULT_CHARSET_HOME=\"/usr/local/mysql\" 
> -DDATADIR=\"/private/var/mysql\" -DSHAREDIR=\"/usr/local/var/mysql/mysql\" 
> -DUNDEF_THREADS_HACK -DDONT_USE_RAID -DMYSQL_CLIENT -I./../include 
> -I../include -I./.. -I.. -I.. -I/System/Library/Frameworks -I/usr/include 
> -I/usr/local/include -I/usr/X11R6/include -I/usr/local/BerkeleyDB/include 
> -O -DDBUG_OFF -O3 -fno-omit-frame-pointer -L/System/Library/Frameworks 
> -L/usr/lib -L/usr/local/lib -L/usr/X11R6/lib -L/usr/local/BerkeleyDB/lib 
> -traditional-cpp -DHAVE_DARWIN_THREADS -D_P1003_1B_VISIBLE 
> -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DHAVE_BROKEN_REALPATH -c 
> libmysql.c -o libmysql.o
> libmysql.c: In function `mysql_real_connect':
> libmysql.c:1663: sizeof applied to an incomplete type
> make[2]: *** [libmysql.lo] Error 1
> make[2]: Leaving directory 
> `/Volumes/ServerSystem/ports/mysql-4.0.2-alpha/libmysql'
> make[1]: *** [all-recursive] Error 1
> make[1]: Leaving directory `/Volumes/ServerSystem/ports/mysql-4.0.2-alpha'
> make: *** [all-recursive-am] Error 2
> [root@server]
> 
> i don't have a FIX, but commenting out the offending code (also in 
> 'manager.c') seems to do the trick ....

The error is because GETHOSTBYNAME_BUFF_SIZE expands to sizeof(struct
hostent_data) and hostent_data is not defined.  I think that should be
"struct hostent" instead (I can't find "struct hostent_data" defined
anywhere on the systems I have access to).

--- include/my_net.h~	Sun Jul 14 13:43:49 2002
+++ include/my_net.h	Sun Jul 14 14:00:37 2002
@@ -89,7 +89,7 @@
 #endif /* !defined(HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE) */
 
 #elif defined(HAVE_GETHOSTBYNAME_R_RETURN_INT)
-#define GETHOSTBYNAME_BUFF_SIZE sizeof(struct hostent_data)
+#define GETHOSTBYNAME_BUFF_SIZE sizeof(struct hostent)
 struct hostent *my_gethostbyname_r(const char *name,
 				   struct hostent *result, char *buffer,
 				   int buflen, int *h_errnop);

 

-- 
	Dan Nelson
	dnelson@stripped
Thread
mysql-4.0.2-alpha BROKEN on OSX 10.1.4 Server; WORKAROUNDS incl.,but need help with FIXesR Blake14 Jul
  • Re: mysql-4.0.2-alpha BROKEN on OSX 10.1.4 Server; WORKAROUNDS incl., but need help with FIXesDan Nelson14 Jul
Re: mysql-4.0.2-alpha BROKEN on OSX 10.1.4 Server; WORKAROUNDSincl., but need help with FIXesR Blake14 Jul
  • Re: mysql-4.0.2-alpha BROKEN on OSX 10.1.4 Server; WORKAROUNDS incl., but need help with FIXesDan Nelson15 Jul
Re: mysql-4.0.2-alpha BROKEN on OSX 10.1.4 Server; WORKAROUNDSincl., but need help with FIXesR Blake15 Jul