From owner-freebsd-stable Fri Mar 31 17:58:33 2000 Delivered-To: freebsd-stable@freebsd.org Received: from mail.hcisp.net (Stargate.hcisp.net [208.60.89.18]) by hub.freebsd.org (Postfix) with SMTP id 008AD37BA16 for ; Fri, 31 Mar 2000 17:58:25 -0800 (PST) (envelope-from tim@mysql.com) Received: (qmail 1300 invoked from network); 1 Apr 2000 02:06:54 -0000 Received: from modem1.hcisp.net (HELO threads.polyesthetic.msg) (208.60.89.67) by stargate.hcisp.net with SMTP; 1 Apr 2000 02:06:54 -0000 Received: (qmail 52307 invoked by uid 1001); 1 Apr 2000 01:57:28 -0000 From: "Thimble Smith" Date: Fri, 31 Mar 2000 20:57:28 -0500 To: Kris Kennaway , 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> References: <20000331080352.G76293@threads.polyesthetic.msg> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0.1i In-Reply-To: ; from kris@FreeBSD.org on Fri, Mar 31, 2000 at 11:58:51AM -0800 Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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 +.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 +.include .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