Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 31 Mar 2000 20:57:28 -0500
From:      "Thimble Smith" <tim@mysql.com>
To:        Kris Kennaway <kris@FreeBSD.org>, dirk@FreeBSD.org
Cc:        freebsd-stable@FreeBSD.org
Subject:   Re: please help - thread-safe mysql client link problem
Message-ID:  <20000331205728.B15870@threads.polyesthetic.msg>
In-Reply-To: <Pine.BSF.4.21.0003311157440.95920-100000@freefall.freebsd.org>; from kris@FreeBSD.org on Fri, Mar 31, 2000 at 11:58:51AM -0800
References:  <20000331080352.G76293@threads.polyesthetic.msg> <Pine.BSF.4.21.0003311157440.95920-100000@freefall.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Mar 31, 2000 at 11:58:51AM -0800, Kris Kennaway wrote:
>On Fri, 31 Mar 2000, Thimble Smith wrote:
>> The port doesn't have an option for building a thread-safe client,
>> either (unless it's hidden somewhere that I didn't see it).
>
>It uses the same options as the server makefile, so
>'make NATIVE_THREADS=1 all install clean' should work for the client or
>the server.

MySQL doesn't make thread-safe client libs unless you pass the
--enable-thread-safe-client flag to configure.  Here'a a patch
to mysql322-server/Makefile that will cause this to happen if
THREAD_SAFE_CLIENT is set in the environment:


--- Makefile.orig	Fri Mar 31 20:17:25 2000
+++ Makefile	Fri Mar 31 20:53:30 2000
@@ -34,11 +34,10 @@
 		INSTALL_SCRIPT="${INSTALL_SCRIPT}" \
 		CONFIGURE_ARGS="${CONFIGURE_ARGS}"
 
-.if !defined(CLIENT_ONLY)
-RUN_DEPENDS=	mysql:${PORTSDIR}/databases/mysql322-client
-
 .include <bsd.port.pre.mk>
 
+.if !defined(CLIENT_ONLY) || defined(THREAD_SAFE_CLIENT)
+
 .if ${OSVERSION} >= 320000
 .if defined(MIT_PTHREADS)
 CONFIGURE_ARGS+=	--with-mit-threads=yes
@@ -90,6 +89,11 @@
 	@${ECHO}
 .endif
 
+.endif # !CLIENT_ONLY || THREAD_SAFE_CLIENT
+
+.if !defined(CLIENT_ONLY)
+RUN_DEPENDS=	mysql:${PORTSDIR}/databases/mysql322-client
+
 post-patch:
 	${MV} ${WRKSRC}/strings/strings-x86.s ${WRKSRC}/strings/strings-x86.S
 	${MV} ${WRKSRC}/strings/longlong2str-x86.s ${WRKSRC}/strings/longlong2str-x86.S
@@ -140,6 +144,17 @@
 .else
 MAN1=		mysql.1
 
+.if defined(THREAD_SAFE_CLIENT)
+CONFIGURE_ARGS+=--enable-thread-safe-client
+.else
+pre-fetch:
+	@${ECHO} ""
+	@${ECHO} "You may set THREAD_SAFE_CLIENT (make THREAD_SAFE_CLIENT=yes)"
+	@${ECHO} "to compile a thread-safe libmysqlclient.  (You should not"
+	@${ECHO} "do this unless you are linking with threaded applications.)"
+	@${ECHO} ""
+.endif
+
 CONFIGURE_ARGS+=--without-server
 MAKE_ENV=	CLIENT_ONLY="${CLIENT_ONLY}"
 
@@ -151,5 +166,5 @@
 
 	${SETENV} OBJFORMAT=${PORTOBJFORMAT} ${LDCONFIG} -m ${PREFIX}/lib/mysql
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
 .endif


I'm not super-familiar with the ports structure, so I may have
botched something.  Dirk, if this looks okay (or can be salvaged
into something that is okay), could you commit it?

Thanks,

Tim
-- 
Tim Smith   < tim@mysql.com >  :MySQL Development Team:  Boone, NC  USA.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000331205728.B15870>