Bug #556 bogus vio/Makefile.am
Submitted: 31 May 2003 7:14 Modified: 3 Jul 2003 1:59
Reporter: Jens Elkner Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S1 (Critical)
Version:4.0.13 OS:Linux (Linux 2.4.20)
Assigned to: Michael Widenius CPU Architecture:Any

[31 May 2003 7:14] Jens Elkner
Description:
/bin/sh ../libtool --mode=link gcc  -O3 -DDBUG_OFF -O3 -march=i686 -mcpu=i686 	
        -I/export/scratch/build/root4build/usr/include 		-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE   -L/export/scratch/build/root4build/usr/lib -rdynamic  -o test-ssl  test-ssl.o ../dbug/libdbug.a libvio.a ../mysys/libmysys.a ../strings/libmystrings.a libvio.a -L/export/scratch/build/root4build/usr/lib -lssl -lcrypto -lpthread -lz -lcrypt -lnsl -lm  -lpthread 
gcc -O3 -DDBUG_OFF -O3 -march=i686 -mcpu=i686 -I/export/scratch/build/root4build/usr/include -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -rdynamic -o test-ssl test-ssl.o  -L/export/scratch/build/root4build/usr/lib ../dbug/libdbug.a ../mysys/libmysys.a ../strings/libmystrings.a libvio.a -lssl -lcrypto -lz -lcrypt -lnsl -lm -lpthread
libvio.a(viosocket.o): In function `vio_peer_addr':
viosocket.o(.text+0x61): undefined reference to `my_inet_ntoa'
collect2: ld returned 1 exit status
make[1]: *** [test-ssl] Error 1
make[1]: Leaving directory `/export/scratch/build/mysql-4.0.13/vio'
make: *** [install-recursive] Error 1

How to repeat:
gcc 2.95.3, autoconf 2.57, automake 1.7.5, libtool 1.5

export	CC=gcc CXX=gcc \
	CFLAGS="-O3 -march=$PKG_ARCH -mcpu=$PKG_CPU \
		-I${ROOT4BUILD}/usr/include \
		-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE" \
	CXXFLAGS="-O3 -march=$PKG_ARCH -mcpu=$PKG_CPU \
		-I${ROOT4BUILD}/usr/include \
		-felide-constructors -fno-exceptions -fno-rtti \
		-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE" \
	LDFLAGS="-L${ROOT4BUILD}/usr/lib"
	CXXFLAGS="$LDFLAGS"

	libtoolize --force
	aclocal
        # autoheader  -  not neccesary + would produce garbage
	autoconf
	automake

	./configure \
	--prefix=/opt/mysql \
	--sysconfdir=/etc \
	--libexecdir=/opt/mysql/sbin \
	--localstatedir=/var/mysql \
	--enable-shared \
	--with-pthread \
	--enable-thread-safe-client \
	--enable-assembler \
	--enable-raid \
	--enable-local-infile \
	--with-unix-socket-path=/var/run/mysql.sock \
	--with-mysqld-user=mysql \
	--without-debug \
	--with-innodb \
	--without-berkeley-db \
	--without-readline \
	--without-mysqlfs \
	--without-libwrap \
	--with-openssl=${ROOT4BUILD}/usr \
	--with-vio \
	--with-extra-charsets=complex \
	--with-embedded-server

        make

Suggested fix:
--- mysql-4.0.13/vio/Makefile.am.orig	Wed May 14 22:24:38 2003
+++ mysql-4.0.13/vio/Makefile.am	Fri May 30 16:27:53 2003
@@ -15,19 +15,19 @@
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
 INCLUDES =		-I$(srcdir)/../include -I../include $(openssl_includes)
-LDADD =			@CLIENT_EXTRA_LDFLAGS@ libvio.a $(openssl_libs) +LDADD =			@CLIENT_EXTRA_LDFLAGS@ $(openssl_libs) 
 pkglib_LIBRARIES =	libvio.a
 noinst_PROGRAMS	=	test-ssl test-sslserver test-sslclient
 noinst_HEADERS =	
 test_ssl_SOURCES =   test-ssl.c
 test_ssl_LDADD =   	@CLIENT_EXTRA_LDFLAGS@ ../dbug/libdbug.a libvio.a ../mysys/libmysys.a \
-			../strings/libmystrings.a libvio.a $(openssl_libs)
+			../strings/libmystrings.a $(openssl_libs)
 test_sslserver_SOURCES =   test-sslserver.c
 test_sslserver_LDADD =   @CLIENT_EXTRA_LDFLAGS@	../dbug/libdbug.a libvio.a ../mysys/libmysys.a \
-			../strings/libmystrings.a libvio.a $(openssl_libs)
+			../strings/libmystrings.a $(openssl_libs)
 test_sslclient_SOURCES =   test-sslclient.c
 test_ssl_LDADD =   	@CLIENT_EXTRA_LDFLAGS@ ../dbug/libdbug.a libvio.a ../mysys/libmysys.a \
-			../strings/libmystrings.a libvio.a $(openssl_libs)
+			../strings/libmystrings.a $(openssl_libs)
 test_sslserver_SOURCES =   test-sslserver.c
 test_sslserver_LDADD =   @CLIENT_EXTRA_LDFLAGS@	../dbug/libdbug.a libvio.a ../mysys/libmysys.a \
-			../strings/libmystrings.a libvio.a $(openssl_libs)
+			../strings/libmystrings.a $(openssl_libs)
 test_sslclient_SOURCES =   test-sslclient.c
 test_sslclient_LDADD =   @CLIENT_EXTRA_LDFLAGS@	../dbug/libdbug.a libvio.a ../mysys/libmysys.a \
-			../strings/libmystrings.a libvio.a $(openssl_libs)
+			../strings/libmystrings.a $(openssl_libs)
 libvio_a_SOURCES =	vio.c viosocket.c viossl.c viosslfactories.c
 
 # Don't update the files from bitkeeper
[11 Jun 2003 3:46] Lenz Grimmer
Gluh, could you please take a look at this one? Thanks.
[3 Jul 2003 1:59] Michael Widenius
Thank you for your bug report. This issue has been fixed in the latest
development tree for that product. You can find more information about
accessing our development trees at 
    http://www.mysql.com/doc/en/Installing_source_tree.html

Thanks for the patch. I have now applied it (slight modified) to the MySQL 4.0 tree.
The fix will be in 4.0.14