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

Diff of /eclass/mysql.eclass

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

Revision 1.41 Revision 1.42
1# Copyright 1999-2006 Gentoo Foundation 1# Copyright 1999-2006 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.eclass,v 1.41 2006/10/20 18:53:45 chtekk Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/mysql.eclass,v 1.42 2006/10/21 14:32:21 chtekk Exp $
4 4
5# Author: Francesco Riosa <vivo@gentoo.org> 5# Author: Francesco Riosa <vivo@gentoo.org>
6# Maintainer: Luca Longinotti <chtekk@gentoo.org> 6# Maintainer: Luca Longinotti <chtekk@gentoo.org>
7 7
8# Both MYSQL_VERSION_ID and MYSQL_PATCHSET_REV must be set in the ebuild too 8# Both MYSQL_VERSION_ID and MYSQL_PATCHSET_REV must be set in the ebuild too
43# dev-perl/DBD-mysql is needed by some scripts installed by MySQL 43# dev-perl/DBD-mysql is needed by some scripts installed by MySQL
44PDEPEND="perl? ( >=dev-perl/DBD-mysql-2.9004 )" 44PDEPEND="perl? ( >=dev-perl/DBD-mysql-2.9004 )"
45 45
46# Shorten the path because the socket path length must be shorter than 107 chars 46# Shorten the path because the socket path length must be shorter than 107 chars
47# and we will run a mysql server during test phase 47# and we will run a mysql server during test phase
48S="${WORKDIR}/${PN}" 48S="${WORKDIR}/${PN/_alpha/-bk-}" # BitKeeper ebuilds
49 49
50# Define $MY_FIXED_PV for MySQL patchsets 50# Define $MY_FIXED_PV for MySQL patchsets
51MY_FIXED_PV="${PV/_alpha/}" 51MY_FIXED_PV="${PV/_alpha/}"
52#MY_FIXED_PV="${MY_FIXED_PV/_beta/}" 52#MY_FIXED_PV="${MY_FIXED_PV/_beta/}"
53#MY_FIXED_PV="${MY_FIXED_PV/_rc/}" 53#MY_FIXED_PV="${MY_FIXED_PV/_rc/}"
54 54
55MY_P="${P/_/-}" 55MY_P="${P/_/-}"
56MY_P="${MY_P/-alpha/-bk-}" # BitKeeper ebuilds
56 57
57# Define correct SRC_URIs 58# Define correct SRC_URIs
58SRC_URI="mirror://mysql/Downloads/MySQL-${PV%.*}/${MY_P}${MYSQL_RERELEASE}.tar.gz" 59SRC_URI="mirror://mysql/Downloads/MySQL-${PV%.*}/${MY_P}${MYSQL_RERELEASE}.tar.gz"
59if [[ -n "${MYSQL_PATCHSET_REV}" ]] ; then 60if [[ -n "${MYSQL_PATCHSET_REV}" ]] ; then
60 MYSQL_PATCHSET_FILENAME="${PN}-patchset-${MY_FIXED_PV}-r${MYSQL_PATCHSET_REV}.tar.bz2" 61 MYSQL_PATCHSET_FILENAME="${PN}-patchset-${MY_FIXED_PV}-r${MYSQL_PATCHSET_REV}.tar.bz2"
387 rm -f "scripts/mysqlbug" 388 rm -f "scripts/mysqlbug"
388 fi 389 fi
389 390
390 local rebuilddirlist bdbdir d 391 local rebuilddirlist bdbdir d
391 392
392 if mysql_version_is_at_least "5.01.00.00" ; then 393 if mysql_version_is_at_least "5.01.12.00" ; then
393 rebuilddirlist=". storage/innobase" 394 # TODO: innodb is using cmake now?
394 bdbdir='storage/bdb/dist' 395 rebuilddirlist="."
396 bdbdir=''
395 else 397 else
396 rebuilddirlist=". innobase" 398 rebuilddirlist=". innobase"
397 bdbdir='bdb/dist' 399 bdbdir='bdb/dist'
398 fi 400 fi
399 401
417 419
418mysql_src_compile() { 420mysql_src_compile() {
419 # Make sure the vars are correctly initialized 421 # Make sure the vars are correctly initialized
420 mysql_init_vars 422 mysql_init_vars
421 423
424 # $myconf is modified by the configure_* functions
422 local myconf 425 local myconf=""
423 426
424 if useq "static" ; then 427 if useq "minimal" ; then
425 myconf="${myconf} --with-mysqld-ldflags=-all-static" 428 configure_minimal
426 myconf="${myconf} --with-client-ldflags=-all-static"
427 myconf="${myconf} --disable-shared"
428 else 429 else
429 myconf="${myconf} --enable-shared --enable-static" 430 configure_common
430 fi
431
432 myconf="${myconf} --without-libwrap"
433
434 if useq "ssl" ; then
435 # --with-vio is not needed anymore, it's on by default and
436 # has been removed from configure
437 mysql_version_is_at_least "5.00.04.00" || myconf="${myconf} --with-vio"
438 if mysql_version_is_at_least "5.00.06.00" ; then 431 if mysql_version_is_at_least "5.01.10.00" ; then
439 # yassl-0.96 is still young and breaks with GCC-4.X or amd64 432 configure_51
440 # myconf="${myconf} --with-yassl"
441 myconf="${myconf} --with-openssl"
442 else 433 else
443 myconf="${myconf} --with-openssl" 434 configure_40_41_50
444 fi
445 else
446 myconf="${myconf} --without-openssl"
447 fi
448
449 if useq "debug" ; then
450 myconf="${myconf} --with-debug=full"
451 else
452 myconf="${myconf} --without-debug"
453
454 mysql_version_is_at_least "4.01.03.00" && useq "cluster" \
455 && myconf="${myconf} --without-ndb-debug"
456 fi
457
458 # These are things we exclude from a minimal build.
459 # Note that the server actually does get built and installed,
460 # but we then delete it.
461 local minimal_exclude_list="server embedded-server extra-tools innodb bench"
462
463 if ! useq "minimal" ; then
464 myconf="${myconf} --with-server"
465 myconf="${myconf} --with-extra-tools"
466
467 if ! mysql_version_is_at_least "5.00.00.00" ; then
468 if useq "raid" ; then
469 myconf="${myconf} --with-raid"
470 else
471 myconf="${myconf} --without-raid"
472 fi 435 fi
473 fi
474
475 if mysql_version_is_at_least "4.01.00.00" && ! useq "latin1" ; then
476 myconf="${myconf} --with-charset=utf8"
477 myconf="${myconf} --with-collation=utf8_general_ci"
478 else
479 myconf="${myconf} --with-charset=latin1"
480 myconf="${myconf} --with-collation=latin1_swedish_ci"
481 fi
482
483 # Optional again with MySQL 5.1
484 if mysql_version_is_at_least "5.01.00.00" ; then
485 if useq "innodb" ; then
486 myconf="${myconf} --with-innodb"
487 else
488 myconf="${myconf} --without-innodb"
489 fi
490 fi
491
492 # Lots of charsets
493 myconf="${myconf} --with-extra-charsets=all"
494
495 # The following fix is due to a bug with bdb on SPARC's. See:
496 # http://www.geocrawler.com/mail/msg.php3?msg_id=4754814&list=8
497 # It comes down to non-64-bit safety problems.
498 if useq "sparc" || useq "alpha" || useq "hppa" || useq "mips" || useq "amd64" ; then
499 elog "Berkeley DB support was disabled due to incompatible arch"
500 myconf="${myconf} --without-berkeley-db"
501 else
502 # TODO: berkdb in MySQL 5.1 needs to be worked on
503 if useq "berkdb" && ! mysql_check_version_range "5.01.00.00 to 5.01.08.99" ; then
504 myconf="${myconf} --with-berkeley-db=./bdb"
505 else
506 myconf="${myconf} --without-berkeley-db"
507 fi
508 fi
509
510 if mysql_version_is_at_least "4.01.03.00" ; then
511 myconf="${myconf} --with-geometry"
512
513 if useq "cluster" ; then
514 myconf="${myconf} --with-ndbcluster"
515 else
516 myconf="${myconf} --without-ndbcluster"
517 fi
518 fi
519
520 if useq "big-tables" ; then
521 myconf="${myconf} --with-big-tables"
522 else
523 myconf="${myconf} --without-big-tables"
524 fi
525
526 mysql_version_is_at_least "5.01.06.00" \
527 && myconf="${myconf} --with-ndb-binlog"
528
529 if useq "embedded" ; then
530 myconf="${myconf} --with-embedded-privilege-control"
531 myconf="${myconf} --with-embedded-server"
532 else
533 myconf="${myconf} --without-embedded-privilege-control"
534 myconf="${myconf} --without-embedded-server"
535 fi
536
537 # Benchmarking stuff needs Perl
538 if useq "perl" ; then
539 myconf="${myconf} --with-bench"
540 else
541 myconf="${myconf} --without-bench"
542 fi
543 else
544 for i in ${minimal_exclude_list} ; do
545 myconf="${myconf} --without-${i}"
546 done
547 myconf="${myconf} --without-berkeley-db"
548 myconf="${myconf} --with-extra-charsets=none"
549 fi
550
551 if mysql_version_is_at_least "4.01.03.00" && useq "extraengine" ; then
552 # http://dev.mysql.com/doc/mysql/en/archive-storage-engine.html
553 myconf="${myconf} --with-archive-storage-engine"
554
555 # http://dev.mysql.com/doc/mysql/en/csv-storage-engine.html
556 myconf="${myconf} --with-csv-storage-engine"
557
558 # http://dev.mysql.com/doc/mysql/en/blackhole-storage-engine.html
559 myconf="${myconf} --with-blackhole-storage-engine"
560
561 # http://dev.mysql.com/doc/mysql/en/federated-storage-engine.html
562 # http://dev.mysql.com/doc/mysql/en/federated-description.html
563 # http://dev.mysql.com/doc/mysql/en/federated-limitations.html
564 if mysql_version_is_at_least "5.00.03.00" ; then
565 elog "Before using the Federated storage engine, please be sure to read"
566 elog "http://dev.mysql.com/doc/mysql/en/federated-limitations.html"
567 myconf="${myconf} --with-federated-storage-engine"
568 fi
569
570 # http://dev.mysql.com/doc/refman/5.1/en/partitioning-overview.html
571 if mysql_version_is_at_least "5.01.00.00" ; then
572 myconf="${myconf} --with-partition"
573 fi
574 fi
575
576 mysql_version_is_at_least "5.00.18.00" \
577 && useq "max-idx-128" \
578 && myconf="${myconf} --with-max-indexes=128"
579
580 mysql_version_is_at_least "5.01.05.00" \
581 && myconf="${myconf} --with-row-based-replication"
582
583 # TODO: Recheck again later, there were problems with assembler enabled
584 # and some combinations of USE flags with MySQL 5.1
585 if mysql_check_version_range "5.01.00.00 to 5.01.08.99" ; then
586 myconf="${myconf} --disable-assembler"
587 else
588 myconf="${myconf} --enable-assembler"
589 fi 436 fi
590 437
591 # Bug #114895, bug #110149 438 # Bug #114895, bug #110149
592 filter-flags "-O" "-O[01]" 439 filter-flags "-O" "-O[01]"
593 440
606 --localstatedir="${MY_LOCALSTATEDIR}" \ 453 --localstatedir="${MY_LOCALSTATEDIR}" \
607 --sharedstatedir="${MY_SHAREDSTATEDIR}" \ 454 --sharedstatedir="${MY_SHAREDSTATEDIR}" \
608 --libdir="${MY_LIBDIR}" \ 455 --libdir="${MY_LIBDIR}" \
609 --includedir="${MY_INCLUDEDIR}" \ 456 --includedir="${MY_INCLUDEDIR}" \
610 --with-low-memory \ 457 --with-low-memory \
611 --enable-local-infile \
612 --with-mysqld-user=mysql \
613 --with-client-ldflags=-lstdc++ \ 458 --with-client-ldflags=-lstdc++ \
614 --enable-thread-safe-client \ 459 --enable-thread-safe-client \
615 --with-comment="Gentoo Linux ${PF}" \ 460 --with-comment="Gentoo Linux ${PF}" \
616 --with-unix-socket-path="/var/run/mysqld/mysqld.sock" \
617 --without-readline \
618 --without-docs \ 461 --without-docs \
619 ${myconf} || die "econf failed" 462 ${myconf} || die "econf failed"
620 463
621 # TODO: Move this before autoreconf !!! 464 # TODO: Move this before autoreconf !!!
622 find . -type f -name Makefile -print0 \ 465 find . -type f -name Makefile -print0 \

Legend:
Removed from v.1.41  
changed lines
  Added in v.1.42

  ViewVC Help
Powered by ViewVC 1.1.20