Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Jan 2001 14:49:20 +0200
From:      Peter Pentchev <roam@orbitel.bg>
To:        Radovan Gibala <gigi@agraf.sk>
Cc:        Dirk Froemberg <dirk@FreeBSD.org>, ports@FreeBSD.org
Subject:   Re: MySQL and BerkleyDB
Message-ID:  <20010123144920.I2376@ringworld.oblivion.bg>
In-Reply-To: <20010122185314.D5657@ringworld.oblivion.bg>; from roam@orbitel.bg on Mon, Jan 22, 2001 at 06:53:15PM %2B0200
References:  <3A6C158C.7F8794B1@agraf.sk> <20010122185314.D5657@ringworld.oblivion.bg>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Jan 22, 2001 at 06:53:15PM +0200, Peter Pentchev wrote:
> On Mon, Jan 22, 2001 at 12:12:12PM +0100, Radovan Gibala wrote:
> > Hi !
> > 
> > Is there any possibility to get a port for MySQL with BerkleyDB support
> > ?
> > I realy need the transaction support and I'd like to build MySQL from a
> > port.
> 
> I'm currently working on a patch to the MySQL port to allow specifying
> charsets (the --with-charset and --with-extra-charsets configure script
> options).  I'll throw in Berkeley DB there for good measure.  Expect
> patches tomorrow, and hopefully, if they do not screw up things very
> badly, Dirk may include them sometime soon :)

OK, here's the patch as promised.  WITH_CHARSET=charset defines the
primary charset (Latin-1 is the MySQL default), WITH_XCHARSET=list
defines the other compiled-in charsets (may be 'all'), and WITH_BDB=yes
(or simply -DWITH_BDB) compiles in Berkeley DB support.

You'd need the patch Dirk posted for the databases/db3 port.

Hmm.  A question to Dirk:  The configure script needed to be patched
to look for libdb3.so instead of libdb.so (-ldb3).  I could have
patched aclocal.m4, then specified USE_AUTOCONF and called aclocal;
I chose to run a Perl regex on the configure script itself.  This is
cheaper, and less error-prone for this particular MySQL version; it is,
however, more error-prone for future MySQL versions, where this blind
replacement could garble something else.  How do you feel about it?

G'luck,
Peter

-- 
This sentence is false.

Index: ports/databases/mysql323-server/Makefile
===================================================================
RCS file: /home/ncvs/ports/databases/mysql323-server/Makefile,v
retrieving revision 1.102
diff -u -r1.102 Makefile
--- ports/databases/mysql323-server/Makefile	2001/01/22 22:46:32	1.102
+++ ports/databases/mysql323-server/Makefile	2001/01/23 12:44:22
@@ -7,6 +7,7 @@
 
 PORTNAME?=	${MASTERPORTNAME}
 PORTVERSION=	3.23.32
+PORTREVISION?=	1
 CATEGORIES=	databases
 MASTER_SITES=	http://www.kernelnotes.de/MySQL/Downloads/MySQL-3.23/ \
 		http://www.mysql.net/Downloads/MySQL-3.23/ \
@@ -29,6 +30,14 @@
 		--with-mit-threads=no \
 		--with-libwrap \
 		--with-low-memory
+
+.if		defined(WITH_CHARSET)
+CONFIGURE_ARGS+=--with-charset=${WITH_CHARSET}
+.if		defined(WITH_XCHARSET)
+CONFIGURE_ARGS+=--with-extra-charsets=${WITH_XCHARSET}
+.endif
+.endif
+
 .if ${MACHINE_ARCH} == "i386"
 CONFIGURE_ARGS+=--enable-assembler
 .endif
@@ -45,8 +54,23 @@
 CXXFLAGS+=	-fno-exceptions
 .endif
 
+pre-fetch:
+	@${ECHO} "You may use the following build options:"
+	@${ECHO} ""
+	@${ECHO} "      WITH_CHARSET=charset    define the primary built-in charset (Latin1);"
+	@${ECHO} "      WITH_XCHARSET=list      define other built-in charsets (may be 'all');"
+	@${ECHO} "      WITH_BDB=yes            build with Berkeley DB support."
+	@${ECHO} ""
+
 # MySQL-Server part
 .if !defined(CLIENT_ONLY)
+
+.if		defined(WITH_BDB)
+LIB_DEPENDS+=	db3.1:${PORTSDIR}/databases/db3
+CONFIGURE_ARGS+=--with-berkeley-db-includes=${LOCALBASE}/include/db3 \
+		--with-berkeley-db-libs=${LOCALBASE}/lib
+.endif
+
 RUN_DEPENDS=	mysql:${PORTSDIR}/databases/mysql323-client
 
 PLIST_SUB=	MYSQL_VERSION=${PORTVERSION}
@@ -54,6 +78,11 @@
 post-patch:
 	${MV} ${WRKSRC}/strings/strings-x86.s ${WRKSRC}/strings/strings-x86.S
 	${MV} ${WRKSRC}/strings/longlong2str-x86.s ${WRKSRC}/strings/longlong2str-x86.S
+
+.if		defined(WITH_BDB)
+pre-configure:
+		${PERL} -pi -e 's/([^\w\d-])-ldb\b/\1-ldb3/g' ${WRKSRC}/configure
+.endif
 
 pre-install:
 .if !defined(PACKAGE_BUILDING) && exists(${DB_DIR}) && !defined(OVERWRITE_DB)


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




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