/[gentoo-x86]/eclass/mysql-autotools.eclass
Gentoo

Diff of /eclass/mysql-autotools.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.8 Revision 1.14
1# Copyright 1999-2012 Gentoo Foundation 1# Copyright 1999-2012 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/mysql-autotools.eclass,v 1.8 2012/06/02 19:16:31 zmedico Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/mysql-autotools.eclass,v 1.14 2013/01/28 02:13:05 robbat2 Exp $
4 4
5# @ECLASS: mysql-autotools.eclass 5# @ECLASS: mysql-autotools.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# MySQL Team <mysql-bugs@gentoo.org> 7# MySQL Team <mysql-bugs@gentoo.org>
8# Robin H. Johnson <robbat2@gentoo.org> 8# Robin H. Johnson <robbat2@gentoo.org>
15# The mysql-autotools.eclass provides the support to build the mysql 15# The mysql-autotools.eclass provides the support to build the mysql
16# ebuilds using the autotools build system. This eclass provides 16# ebuilds using the autotools build system. This eclass provides
17# the src_unpack, src_prepare, src_configure, src_compile, scr_install, 17# the src_unpack, src_prepare, src_configure, src_compile, scr_install,
18# pkg_preinst, pkg_postinst, pkg_config and pkg_postrm phase hooks. 18# pkg_preinst, pkg_postinst, pkg_config and pkg_postrm phase hooks.
19 19
20inherit autotools multilib 20inherit autotools flag-o-matic multilib prefix
21 21
22# 22#
23# HELPER FUNCTIONS: 23# HELPER FUNCTIONS:
24# 24#
25 25
94 myconf="${myconf} --with-collation=utf8_general_ci" 94 myconf="${myconf} --with-collation=utf8_general_ci"
95 else 95 else
96 myconf="${myconf} --with-charset=latin1" 96 myconf="${myconf} --with-charset=latin1"
97 myconf="${myconf} --with-collation=latin1_swedish_ci" 97 myconf="${myconf} --with-collation=latin1_swedish_ci"
98 fi 98 fi
99
100 # MariaDB requires this flag in order to link to GPLv3 readline v6 or greater
101 # A note is added to the configure output
102 if [[ "${PN}" == "mariadb" ]] && mysql_version_is_at_least "5.1.61" ; then
103 myconf="${myconf} --disable-distribution"
104 fi
99} 105}
100 106
101# @FUNCTION: mysql-autotools_configure_common 107# @FUNCTION: mysql-autotools_configure_common
102# @DESCRIPTION: 108# @DESCRIPTION:
103# Helper function to configure the common builds 109# Helper function to configure the common builds
293 299
294 use static && \ 300 use static && \
295 plugins_sta="${plugins_sta} ${plugins_dyn}" && \ 301 plugins_sta="${plugins_sta} ${plugins_dyn}" && \
296 plugins_dyn="" 302 plugins_dyn=""
297 303
304 # Google MySQL, bundle what upstream supports
305 if [[ "${PN}" == "google-mysql" ]]; then
306 for x in innobase innodb_plugin innodb ; do
307 plugins_sta="${plugins_sta//$x}"
308 plugins_dyn="${plugins_dyn//$x}"
309 done
310 plugins_sta="${plugins_sta} innodb_plugin googlestats"
311 myconf="${myconf} --with-perftools-dir=/usr --enable-perftools-tcmalloc"
312 # use system lzo for google-mysql
313 myconf="${myconf} --with-lzo2-dir=/usr"
314 fi
315
298 einfo "Available plugins: ${plugins_avail}" 316 einfo "Available plugins: ${plugins_avail}"
299 einfo "Dynamic plugins: ${plugins_dyn}" 317 einfo "Dynamic plugins: ${plugins_dyn}"
300 einfo "Static plugins: ${plugins_sta}" 318 einfo "Static plugins: ${plugins_sta}"
301 einfo "Disabled plugins: ${plugins_dis}" 319 einfo "Disabled plugins: ${plugins_dis}"
302 320
395 [ -d "${i}" -a ! -d "${o}" ] && mv "${i}" "${o}" 413 [ -d "${i}" -a ! -d "${o}" ] && mv "${i}" "${o}"
396 cp -ral "${WORKDIR}/${XTRADB_P}" "${i}" 414 cp -ral "${WORKDIR}/${XTRADB_P}" "${i}"
397 popd >/dev/null 415 popd >/dev/null
398 fi 416 fi
399 417
400 if pbxt_available && [[ "${PBXT_NEWSTYLE}" == "1" ]] && use pbxt ; then 418 if pbxt_patch_available && [[ "${PBXT_NEWSTYLE}" == "1" ]] && use pbxt ; then
401 einfo "Adding storage engine: PBXT" 419 einfo "Adding storage engine: PBXT"
402 pushd "${S}"/storage >/dev/null 420 pushd "${S}"/storage >/dev/null
403 i='pbxt' 421 i='pbxt'
404 [ -d "${i}" ] && rm -rf "${i}" 422 [ -d "${i}" ] && rm -rf "${i}"
405 cp -ral "${WORKDIR}/${PBXT_P}" "${i}" 423 cp -ral "${WORKDIR}/${PBXT_P}" "${i}"
424 f="${WORKDIR}/mysql-extras/pbxt/fix-low-priority.patch"
425 [[ -f $f ]] && epatch "$f"
406 popd >/dev/null 426 popd >/dev/null
407 fi 427 fi
408 428
409 rebuilddirlist="." 429 rebuilddirlist="."
410 # This does not seem to be needed presently. robbat2 2010/02/23 430 # This does not seem to be needed presently. robbat2 2010/02/23
453 filter-flags "-fstack-protector-all" 473 filter-flags "-fstack-protector-all"
454 fi 474 fi
455 475
456 CXXFLAGS="${CXXFLAGS} -fno-exceptions -fno-strict-aliasing" 476 CXXFLAGS="${CXXFLAGS} -fno-exceptions -fno-strict-aliasing"
457 CXXFLAGS="${CXXFLAGS} -felide-constructors -fno-rtti" 477 CXXFLAGS="${CXXFLAGS} -felide-constructors -fno-rtti"
478 # storage/googlestats, sql/ in google-mysql are using C++ templates
479 # implicitly. Upstream might be interested in this, exclude
480 # -fno-implicit-templates for google-mysql for now.
458 mysql_version_is_at_least "5.0" \ 481 mysql_version_is_at_least "5.0" \
482 && [[ "${PN}" != "google-mysql" ]] \
459 && CXXFLAGS="${CXXFLAGS} -fno-implicit-templates" 483 && CXXFLAGS="${CXXFLAGS} -fno-implicit-templates"
460 export CXXFLAGS 484 export CXXFLAGS
461 485
462 # bug #283926, with GCC4.4, this is required to get correct behavior. 486 # bug #283926, with GCC4.4, this is required to get correct behavior.
463 append-flags -fno-strict-aliasing 487 append-flags -fno-strict-aliasing
574 if use latin1 ; then 598 if use latin1 ; then
575 sed -i \ 599 sed -i \
576 -e "/character-set/s|utf8|latin1|g" \ 600 -e "/character-set/s|utf8|latin1|g" \
577 "${TMPDIR}/my.cnf.ok" 601 "${TMPDIR}/my.cnf.ok"
578 fi 602 fi
603 eprefixify "${TMPDIR}/my.cnf.ok"
579 newins "${TMPDIR}/my.cnf.ok" my.cnf 604 newins "${TMPDIR}/my.cnf.ok" my.cnf
580 605
581 # Minimal builds don't have the MySQL server 606 # Minimal builds don't have the MySQL server
582 if ! use minimal ; then 607 if ! use minimal ; then
583 einfo "Creating initial directories" 608 einfo "Creating initial directories"
584 # Empty directories ... 609 # Empty directories ...
585 diropts "-m0750" 610 diropts "-m0750"
611 keepdir "${MY_DATADIR#${EPREFIX}}"
586 if [[ "${PREVIOUS_DATADIR}" != "yes" ]] ; then 612 if [[ "${PREVIOUS_DATADIR}" != "yes" ]] ; then
587 dodir "${MY_DATADIR#${EPREFIX}}"
588 keepdir "${MY_DATADIR#${EPREFIX}}"
589 chown -R mysql:mysql "${D}/${MY_DATADIR}" 613 chown -R mysql:mysql "${D}/${MY_DATADIR}"
590 fi 614 fi
591 615
592 diropts "-m0755" 616 diropts "-m0755"
593 for folder in "${MY_LOGDIR#${EPREFIX}}" "/var/run/mysqld" ; do 617 for folder in "${MY_LOGDIR#${EPREFIX}}" "/var/run/mysqld" ; do

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.14

  ViewVC Help
Powered by ViewVC 1.1.20