Subject: Can't get mysql built on NetBSD 1.6
To: None <netbsd-help@netbsd.org>
From: Mike Begley <spam@hell.org>
List: netbsd-help
Date: 02/18/2003 20:50:37
I'm having a heck of a time getting mysql built and installed on NetBSD
1.6/i386.  I've also noticed that there are no longer any pre-built
packages on the ftp sites.

I'm trying to put on mysql 3.23.55.  After trial and error, I've gotten
to the following point (feel free to skip this chain of anguish and go
straight to my pleas for ignorance-reduction):

0) install gmake from the packages collection
1) unpack the mysql-2.23.55 sources
2) retrieve the MIT-pthreads source
tarball(pthreads-1_60_beta6-mysql.tar.gz)
   and untar it in a directory "mit-pthreads" inside the mysql source
tree.
3) edit mit-pthreads/config/configure so that it will compile on
   NetBSD 1.6.
   I do this by editting the line
          i386-*-netbsd1.3[H-Z]|i386-*-netbsd1.[45]*)
   so it says this:
          i386-*-netbsd1.3[H-Z]|i386-*-netbsd1.[456]*)
   It seems to allow the pthreads stuff to compile

4) run configure with the --prefix=3D/usr/local/mysql option
   (I have also configured with the low-memory flag set, because in
   the past when I have built earlier version of mysql on earlier
   versions of NetBSD, I have run into problems with running out of
   memory)

5) running gmake, I'm told that h_errno is undefined in
   mysys/my_gethostbyname.c.  not able to find a definition of h_errno
   anywhere and just looking to see if I can get it to compile, I set
   h_errno to be 0, and run gmake again.

6) this time, gmake dies in sql/mysqld.cc, claiming that select isn't
   declared in sql/mysqld.cc:

   mysqld.cc: In function `void * handle_connections_sockets(void *)':
   mysqld.cc:2434: implicit declaration of function `int select(...)'
   *** Error code 1

   I edit this file to include unistd.h, where this declaration lives.
   It still doesn't build; now some declarations in unistd conflict with
   those in the mit-pthreads directory.  So I copy the declaration of
   select out of unistd.h and put it in mysqld.cc and gmake again

7) repeat 6 with mini_client.cc, and gmake again

8) now it complains that it can't link because there's still unresolved
   references to select().  Attempts to get the Makefile to include
libc.a
   are unsuccessful, and at this point I give up...

Surely someone out there has gotten a recent mysql to build and install
on NetBSD 1.6; any pointers/smacks-to-the-head advice you can give?

Links to pre-built packages would be appreciated at this point; I was
unable to find mysql in the packages tree, which causes me some concern.

Thanks...

-m