/[gentoo-x86]/eclass/qt4-build.eclass
Gentoo

Diff of /eclass/qt4-build.eclass

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

Revision 1.120 Revision 1.122
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/qt4-build.eclass,v 1.120 2012/02/28 18:53:45 pesa Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/qt4-build.eclass,v 1.122 2012/03/01 15:19:14 pesa Exp $
4 4
5# @ECLASS: qt4-build.eclass 5# @ECLASS: qt4-build.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# Qt herd <qt@gentoo.org> 7# Qt herd <qt@gentoo.org>
8# @BLURB: Eclass for Qt4 split ebuilds. 8# @BLURB: Eclass for Qt4 split ebuilds.
315# @FUNCTION: qt4-build_src_configure 315# @FUNCTION: qt4-build_src_configure
316# @DESCRIPTION: 316# @DESCRIPTION:
317# Default configure phase 317# Default configure phase
318qt4-build_src_configure() { 318qt4-build_src_configure() {
319 setqtenv 319 setqtenv
320 myconf="$(standard_configure_options) ${myconf}" 320
321 local conf="
322 -prefix ${QTPREFIXDIR}
323 -bindir ${QTBINDIR}
324 -libdir ${QTLIBDIR}
325 -docdir ${QTDOCDIR}
326 -headerdir ${QTHEADERDIR}
327 -plugindir ${QTPLUGINDIR}
328 $(version_is_at_least 4.7 && echo -importdir ${QTIMPORTDIR})
329 -datadir ${QTDATADIR}
330 -translationdir ${QTTRANSDIR}
331 -sysconfdir ${QTSYSCONFDIR}
332 -examplesdir ${QTEXAMPLESDIR}
333 -demosdir ${QTDEMOSDIR}
334 -opensource -confirm-license
335 -shared -fast -largefile -stl -verbose
336 -nomake examples -nomake demos"
337
338 # ARCH is set on Gentoo. Qt now falls back to generic on an unsupported
339 # $(tc-arch). Therefore we convert it to supported values.
340 case "$(tc-arch)" in
341 amd64|x64-*) conf+=" -arch x86_64" ;;
342 ppc-macos) conf+=" -arch ppc" ;;
343 ppc|ppc64|ppc-*) conf+=" -arch powerpc" ;;
344 sparc|sparc-*|sparc64-*) conf+=" -arch sparc" ;;
345 x86-macos) conf+=" -arch x86" ;;
346 x86|x86-*) conf+=" -arch i386" ;;
347 alpha|arm|ia64|mips|s390) conf+=" -arch $(tc-arch)" ;;
348 hppa|sh) conf+=" -arch generic" ;;
349 *) die "$(tc-arch) is unsupported by this eclass. Please file a bug." ;;
350 esac
351
352 conf+=" -platform $(qt_mkspecs_dir)"
353
354 [[ $(get_libdir) != lib ]] && conf+=" -L${EPREFIX}/usr/$(get_libdir)"
355
356 # debug/release
357 if use debug; then
358 conf+=" -debug"
359 else
360 conf+=" -release"
361 fi
362 conf+=" -no-separate-debug-info"
363
364 # exceptions USE flag
365 conf+=" $(in_iuse exceptions && qt_use exceptions || echo -exceptions)"
366
367 # disable RPATH on Qt >= 4.8 (bug 380415)
368 version_is_at_least 4.8 && conf+=" -no-rpath"
369
370 # precompiled headers don't work on hardened, where the flag is masked
371 conf+=" $(qt_use pch)"
372
373 # -reduce-relocations
374 # This flag seems to introduce major breakage to applications,
375 # mostly to be seen as a core dump with the message "QPixmap: Must
376 # construct a QApplication before a QPaintDevice" on Solaris.
377 # -- Daniel Vergien
378 [[ ${CHOST} != *-solaris* ]] && conf+=" -reduce-relocations"
321 379
322 # this one is needed for all systems with a separate -liconv, apart from 380 # this one is needed for all systems with a separate -liconv, apart from
323 # Darwin, for which the sources already cater for -liconv 381 # Darwin, for which the sources already cater for -liconv
324 if use !elibc_glibc && [[ ${CHOST} != *-darwin* ]]; then 382 if use !elibc_glibc && [[ ${CHOST} != *-darwin* ]]; then
325 myconf+=" -liconv" 383 conf+=" -liconv"
326 fi 384 fi
327 385
328 if use_if_iuse glib; then 386 if use_if_iuse glib; then
329 local glibflags="$(pkg-config --cflags --libs glib-2.0 gthread-2.0)" 387 local glibflags="$(pkg-config --cflags --libs glib-2.0 gthread-2.0)"
330 # avoid the -pthread argument 388 # avoid the -pthread argument
331 myconf+=" ${glibflags//-pthread}" 389 conf+=" ${glibflags//-pthread}"
332 unset glibflags 390 unset glibflags
333 fi 391 fi
334 392
335 if use_if_iuse qpa; then 393 if use_if_iuse qpa; then
336 ewarn 394 ewarn
337 ewarn "The qpa useflag enables the Qt Platform Abstraction, formely" 395 ewarn "The qpa useflag enables the Qt Platform Abstraction, formely"
338 ewarn "known as Qt Lighthouse. If you are not sure what that is, then" 396 ewarn "known as Qt Lighthouse. If you are not sure what that is, then"
339 ewarn "disable it before reporting any bugs related to this useflag." 397 ewarn "disable it before reporting any bugs related to this useflag."
340 ewarn 398 ewarn
341 myconf+=" -qpa" 399 conf+=" -qpa"
342 fi 400 fi
343 401
344 if use aqua; then 402 if use aqua; then
345 # On (snow) leopard use the new (frameworked) cocoa code. 403 # On (snow) leopard use the new (frameworked) cocoa code.
346 if [[ ${CHOST##*-darwin} -ge 9 ]]; then 404 if [[ ${CHOST##*-darwin} -ge 9 ]]; then
347 myconf+=" -cocoa -framework" 405 conf+=" -cocoa -framework"
348 # We need the source's headers, not the installed ones. 406 # We need the source's headers, not the installed ones.
349 myconf+=" -I${S}/include" 407 conf+=" -I${S}/include"
350 # Add hint for the framework location. 408 # Add hint for the framework location.
351 myconf+=" -F${QTLIBDIR}" 409 conf+=" -F${QTLIBDIR}"
352 410
353 # We are crazy and build cocoa + qt3support :-) 411 # We are crazy and build cocoa + qt3support :-)
354 if use qt3support; then 412 if use qt3support; then
355 sed -e "/case \"\$PLATFORM,\$CFG_MAC_COCOA\" in/,/;;/ s|CFG_QT3SUPPORT=\"no\"|CFG_QT3SUPPORT=\"yes\"|" \ 413 sed -e "/case \"\$PLATFORM,\$CFG_MAC_COCOA\" in/,/;;/ s|CFG_QT3SUPPORT=\"no\"|CFG_QT3SUPPORT=\"yes\"|" \
356 -i configure || die 414 -i configure || die
357 fi 415 fi
358 else 416 else
359 myconf+=" -no-framework" 417 conf+=" -no-framework"
360 fi 418 fi
361 else 419 else
362 # freetype2 include dir is non-standard, thus include it on configure 420 # freetype2 include dir is non-standard, thus pass it to configure
363 # use -I from configure
364 myconf+=" $(pkg-config --cflags freetype2)" 421 conf+=" $(pkg-config --cflags-only-I freetype2)"
365 fi 422 fi
366 423
424 conf+=" ${myconf}"
425 myconf=
426
367 echo ./configure ${myconf} 427 echo ./configure ${conf}
368 ./configure ${myconf} || die "./configure failed" 428 ./configure ${conf} || die "./configure failed"
369 myconf=""
370 429
371 prepare_directories ${QT4_TARGET_DIRECTORIES} 430 prepare_directories ${QT4_TARGET_DIRECTORIES}
372} 431}
373 432
374# @FUNCTION: qt4-build_src_compile 433# @FUNCTION: qt4-build_src_compile
455 QT_INSTALL_PREFIX=${EPREFIX}/usr/$(get_libdir)/qt4 514 QT_INSTALL_PREFIX=${EPREFIX}/usr/$(get_libdir)/qt4
456 515
457 PLATFORM=$(qt_mkspecs_dir) 516 PLATFORM=$(qt_mkspecs_dir)
458 517
459 unset QMAKESPEC 518 unset QMAKESPEC
460}
461
462# @FUNCTION: standard_configure_options
463# @INTERNAL
464# @DESCRIPTION:
465# Sets up some standard configure options, like libdir (if necessary), whether
466# debug info is wanted or not.
467standard_configure_options() {
468 local myconf="
469 -prefix ${QTPREFIXDIR} -bindir ${QTBINDIR} -libdir ${QTLIBDIR}
470 -docdir ${QTDOCDIR} -headerdir ${QTHEADERDIR} -plugindir ${QTPLUGINDIR}
471 $(version_is_at_least 4.7 && echo -importdir ${QTIMPORTDIR})
472 -datadir ${QTDATADIR} -translationdir ${QTTRANSDIR} -sysconfdir ${QTSYSCONFDIR}
473 -examplesdir ${QTEXAMPLESDIR} -demosdir ${QTDEMOSDIR}
474 -opensource -confirm-license -shared -fast -largefile -stl -verbose
475 -platform $(qt_mkspecs_dir) -nomake examples -nomake demos"
476
477 [[ $(get_libdir) != lib ]] && myconf+=" -L${EPREFIX}/usr/$(get_libdir)"
478
479 # debug/release
480 if use debug; then
481 myconf+=" -debug"
482 else
483 myconf+=" -release"
484 fi
485 myconf+=" -no-separate-debug-info"
486
487 # exceptions USE flag
488 myconf+=" $(in_iuse exceptions && qt_use exceptions || echo -exceptions)"
489
490 # disable RPATH on Qt >= 4.8 (bug 380415)
491 version_is_at_least 4.8 && myconf+=" -no-rpath"
492
493 # precompiled headers don't work on hardened, where the flag is masked
494 myconf+=" $(qt_use pch)"
495
496 # -reduce-relocations
497 # This flag seems to introduce major breakage to applications,
498 # mostly to be seen as a core dump with the message "QPixmap: Must
499 # construct a QApplication before a QPaintDevice" on Solaris.
500 # -- Daniel Vergien
501 [[ ${CHOST} != *-solaris* ]] && myconf+=" -reduce-relocations"
502
503 # ARCH is set on Gentoo. Qt now falls back to generic on an unsupported
504 # $(tc-arch). Therefore we convert it to supported values.
505 case "$(tc-arch)" in
506 amd64|x64-*) myconf+=" -arch x86_64" ;;
507 ppc-macos) myconf+=" -arch ppc" ;;
508 ppc|ppc64|ppc-*) myconf+=" -arch powerpc" ;;
509 sparc|sparc-*|sparc64-*) myconf+=" -arch sparc" ;;
510 x86-macos) myconf+=" -arch x86" ;;
511 x86|x86-*) myconf+=" -arch i386" ;;
512 alpha|arm|ia64|mips|s390) myconf+=" -arch $(tc-arch)" ;;
513 hppa|sh) myconf+=" -arch generic" ;;
514 *) die "$(tc-arch) is unsupported by this eclass. Please file a bug." ;;
515 esac
516
517 echo "${myconf}"
518} 519}
519 520
520# @FUNCTION: prepare_directories 521# @FUNCTION: prepare_directories
521# @USAGE: < directories > 522# @USAGE: < directories >
522# @INTERNAL 523# @INTERNAL
750# @RETURN: the specs-directory w/o path 751# @RETURN: the specs-directory w/o path
751# @DESCRIPTION: 752# @DESCRIPTION:
752# Allows us to define which mkspecs dir we want to use. 753# Allows us to define which mkspecs dir we want to use.
753qt_mkspecs_dir() { 754qt_mkspecs_dir() {
754 local spec= 755 local spec=
756
755 case ${CHOST} in 757 case "${CHOST}" in
756 *-freebsd*|*-dragonfly*) 758 *-freebsd*|*-dragonfly*)
757 spec=freebsd ;; 759 spec=freebsd ;;
758 *-openbsd*) 760 *-openbsd*)
759 spec=openbsd ;; 761 spec=openbsd ;;
760 *-netbsd*) 762 *-netbsd*)
771 *-solaris*) 773 *-solaris*)
772 spec=solaris ;; 774 spec=solaris ;;
773 *-linux-*|*-linux) 775 *-linux-*|*-linux)
774 spec=linux ;; 776 spec=linux ;;
775 *) 777 *)
776 die "Unknown CHOST, no platform chosen" 778 die "${FUNCNAME}(): Unknown CHOST '${CHOST}'" ;;
777 esac 779 esac
778 780
779 CXX=$(tc-getCXX) 781 case "$(tc-getCXX)" in
780 if [[ ${CXX} == *g++* ]]; then 782 *g++*)
781 spec+=-g++ 783 spec+=-g++ ;;
782 elif [[ ${CXX} == *icpc* ]]; then 784 *icpc*)
783 spec+=-icc 785 spec+=-icc ;;
784 else 786 *)
785 die "Unknown compiler '${CXX}'" 787 die "${FUNCNAME}(): Unknown compiler '$(tc-getCXX)'" ;;
786 fi 788 esac
787 789
788 # Add -64 for 64bit profiles 790 # Add -64 for 64bit profiles
789 if use x64-freebsd || 791 if use x64-freebsd ||
790 use amd64-linux || 792 use amd64-linux ||
791 use x64-macos || 793 use x64-macos ||

Legend:
Removed from v.1.120  
changed lines
  Added in v.1.122

  ViewVC Help
Powered by ViewVC 1.1.20