--- /usr/portage/x11-drivers/ati-drivers/ati-drivers-9.6.ebuild 2009-07-06 13:36:59.000000000 +0200 +++ ati-drivers-9.6.ebuild 2009-07-13 09:16:27.000000000 +0200 @@ -4,7 +4,7 @@ EAPI="1" -IUSE="acpi debug" +IUSE="acpi debug +modules" inherit eutils multilib linux-mod toolchain-funcs versionator @@ -25,7 +25,7 @@ >=x11-base/xorg-server-1.5.3-r7 x11-libs/libXinerama x11-libs/libXrandr - amd64? ( app-emulation/emul-linux-x86-xlibs ) + amd64? ( multilib? ( app-emulation/emul-linux-x86-xlibs ) ) acpi? ( sys-power/acpid x11-apps/xauth @@ -47,11 +47,13 @@ # Define module dir. MODULE_DIR="${S}/common/lib/modules/fglrx/build_mod" - # check kernel and sets up KV_OBJ - MODULE_NAMES="fglrx(video:${S}/common/lib/modules/fglrx/build_mod/2.6.x)" - BUILD_TARGETS="kmod_build" - linux-mod_pkg_setup - BUILD_PARAMS="GCC_VER_MAJ=$(gcc-major-version) KVER=${KV_FULL} KDIR=${KV_DIR}" + if use modules ; then + # check kernel and sets up KV_OBJ + MODULE_NAMES="fglrx(video:${S}/common/lib/modules/fglrx/build_mod/2.6.x)" + BUILD_TARGETS="kmod_build" + linux-mod_pkg_setup + BUILD_PARAMS="GCC_VER_MAJ=$(gcc-major-version) KVER=${KV_FULL} KDIR=${KV_DIR}" + fi # xorg folder BASE_DIR="${S}/x740" @@ -66,76 +68,78 @@ PKG_LIBDIR=lib ARCH_DIR="${S}/arch/x86" fi - - if ! kernel_is 2 6; then - eerror "You need a 2.6 linux kernel to compile against!" - die "No 2.6 Kernel found" - fi - - if kernel_is ge 2 6 25 && linux_chkconfig_present PREEMPT_RCU; then - eerror "${P} is incompatible with RCU preemption (bug #223281)." - eerror "Please disable it:" - eerror " CONFIG_PREEMT_RCU=n" - eerror "in /usr/src/linux/.config or" - eerror " Processor type and features --->" - eerror " [ ] Preemptible RCU" - eerror "in the 'menuconfig'" - die "CONFIG_PREEMT_RCU enabled" - fi - - if kernel_is ge 2 6 29; then - ewarn "Kernels newer then 2.6.28 are heavily patched and might result in runtime failitures." - ewarn "Consider them as unsupported by us." - ewarn "All bug reports are needed to be tested with 2.6.28 kernel" - fi - - if ! linux_chkconfig_present MTRR; then - ewarn "You don't have MTRR support enabled in the kernel." - ewarn "Direct rendering will not work." - fi - - if linux_chkconfig_builtin DRM; then - ewarn "You have DRM support built in to the kernel" - ewarn "Direct rendering will not work." - fi - - if ! linux_chkconfig_present AGP && \ - ! linux_chkconfig_present PCIEPORTBUS; then - ewarn "You don't have AGP and/or PCIe support enabled in the kernel" - ewarn "Direct rendering will not work." - fi - - if linux_chkconfig_present PARAVIRT; then - eerror "Currently, ati-drivers don't compile with paravirtualization" - eerror "active in the kernel due to GPL symbol export restrictions." - eerror "Please disable it:" - eerror " CONFIG_PARAVIRT=n" - eerror "in /usr/src/linux/.config or" - eerror " Processor type and features -->" - eerror " [ ] Paravirtualization support (EXPERIMENTAL)" - eerror "in the 'menuconfig'" - die "CONFIG_PARAVIRT enabled" - fi - - if ! linux_chkconfig_present MAGIC_SYSRQ; then - eerror "${P} requires the magic SysRq keys in the kernel." - eerror "Please enable it:" - eerror " CONFIG_MAGIC_SYSRQ=y" - eerror "in /usr/src/linux/.config or" - eerror " Kernel hacking --->" - eerror " [*] Magic SysRq key" - eerror "in the 'menuconfig'" - fi - - if ! linux_chkconfig_present PCI_MSI; then - eerror "${P} requires MSI in the kernel." - eerror "Please enable it:" - eerror " CONFIG_PCI_MSI=y" - eerror "in /usr/src/linux/.config or" - eerror " Bus options (PCI etc.) --->" - eerror " [*] Message Signaled Interrupts (MSI and MSI-X)" - eerror "in the kernel config." - die "CONFIG_PCI_MSI disabled" + + if use modules ; then + if ! kernel_is 2 6; then + eerror "You need a 2.6 linux kernel to compile against!" + die "No 2.6 Kernel found" + fi + + if kernel_is ge 2 6 25 && linux_chkconfig_present PREEMPT_RCU; then + eerror "${P} is incompatible with RCU preemption (bug #223281)." + eerror "Please disable it:" + eerror " CONFIG_PREEMT_RCU=n" + eerror "in /usr/src/linux/.config or" + eerror " Processor type and features --->" + eerror " [ ] Preemptible RCU" + eerror "in the 'menuconfig'" + die "CONFIG_PREEMT_RCU enabled" + fi + + if kernel_is ge 2 6 29; then + ewarn "Kernels newer then 2.6.28 are heavily patched and might result in runtime failitures." + ewarn "Consider them as unsupported by us." + ewarn "All bug reports are needed to be tested with 2.6.28 kernel" + fi + + if ! linux_chkconfig_present MTRR; then + ewarn "You don't have MTRR support enabled in the kernel." + ewarn "Direct rendering will not work." + fi + + if linux_chkconfig_builtin DRM; then + ewarn "You have DRM support built in to the kernel" + ewarn "Direct rendering will not work." + fi + + if ! linux_chkconfig_present AGP && \ + ! linux_chkconfig_present PCIEPORTBUS; then + ewarn "You don't have AGP and/or PCIe support enabled in the kernel" + ewarn "Direct rendering will not work." + fi + + if linux_chkconfig_present PARAVIRT; then + eerror "Currently, ati-drivers don't compile with paravirtualization" + eerror "active in the kernel due to GPL symbol export restrictions." + eerror "Please disable it:" + eerror " CONFIG_PARAVIRT=n" + eerror "in /usr/src/linux/.config or" + eerror " Processor type and features -->" + eerror " [ ] Paravirtualization support (EXPERIMENTAL)" + eerror "in the 'menuconfig'" + die "CONFIG_PARAVIRT enabled" + fi + + if ! linux_chkconfig_present MAGIC_SYSRQ; then + eerror "${P} requires the magic SysRq keys in the kernel." + eerror "Please enable it:" + eerror " CONFIG_MAGIC_SYSRQ=y" + eerror "in /usr/src/linux/.config or" + eerror " Kernel hacking --->" + eerror " [*] Magic SysRq key" + eerror "in the 'menuconfig'" + fi + + if ! linux_chkconfig_present PCI_MSI; then + eerror "${P} requires MSI in the kernel." + eerror "Please enable it:" + eerror " CONFIG_PCI_MSI=y" + eerror "in /usr/src/linux/.config or" + eerror " Bus options (PCI etc.) --->" + eerror " [*] Message Signaled Interrupts (MSI and MSI-X)" + eerror "in the kernel config." + die "CONFIG_PCI_MSI disabled" + fi fi # This is used like $(get_libdir) for paths in ati's package. @@ -168,11 +172,13 @@ cd "${S}" epatch "${FILESDIR}"/ati-drivers-xen.patch || die "epatch failed" - if kernel_is ge 2 6 29; then - epatch "${FILESDIR}"/kernel/2.6.29*.patch - fi - if kernel_is ge 2 6 30; then - epatch "${FILESDIR}"/kernel/2.6.30*.patch + if use modules ; then + if kernel_is ge 2 6 29; then + epatch "${FILESDIR}"/kernel/2.6.29*.patch + fi + if kernel_is ge 2 6 30; then + epatch "${FILESDIR}"/kernel/2.6.30*.patch + fi fi # These are the userspace utilities that we also have source for. @@ -182,11 +188,13 @@ "${ARCH_DIR}"/usr/X11R6/${PKG_LIBDIR}/libfglrx_gamma* \ || die "bin rm failed" - if use debug; then - # Enable debug mode in the Source Code. - sed -i '/^#define DRM_DEBUG_CODE/s/0/1/' \ - "${MODULE_DIR}/firegl_public.c" \ - || die "Failed to enable debug output." + if use modules ; then + if use debug; then + # Enable debug mode in the Source Code. + sed -i '/^#define DRM_DEBUG_CODE/s/0/1/' \ + "${MODULE_DIR}/firegl_public.c" \ + || die "Failed to enable debug output." + fi fi if use acpi; then @@ -205,21 +213,23 @@ epatch "${FILESDIR}"/ati-powermode-opt-path-2.patch || die "Failed to epatch powermode-opt-path-2.patch" fi - pushd ${MODULE_DIR} >/dev/null - ln -s "${ARCH_DIR}"/lib/modules/fglrx/build_mod/libfglrx_ip.a.GCC$(gcc-major-version) \ - || die "symlinking precompiled core failed" - - convert_to_m 2.6.x/Makefile || die "convert_to_m failed" - - # When built with ati's make.sh it defines a bunch of macros if - # certain .config values are set, falling back to less reliable - # detection methods if linux/autoconf.h is not available. We - # simply use the linux/autoconf.h settings directly, bypassing the - # detection script. - sed -i -e 's/__SMP__/CONFIG_SMP/' *.c *h || die "SMP sed failed" - sed -i -e 's/ifdef MODVERSIONS/ifdef CONFIG_MODVERSIONS/' *.c *.h \ - || die "MODVERSIONS sed failed" - popd >/dev/null + if use modules ; then + pushd ${MODULE_DIR} >/dev/null + ln -s "${ARCH_DIR}"/lib/modules/fglrx/build_mod/libfglrx_ip.a.GCC$(gcc-major-version) \ + || die "symlinking precompiled core failed" + + convert_to_m 2.6.x/Makefile || die "convert_to_m failed" + + # When built with ati's make.sh it defines a bunch of macros if + # certain .config values are set, falling back to less reliable + # detection methods if linux/autoconf.h is not available. We + # simply use the linux/autoconf.h settings directly, bypassing the + # detection script. + sed -i -e 's/__SMP__/CONFIG_SMP/' *.c *h || die "SMP sed failed" + sed -i -e 's/ifdef MODVERSIONS/ifdef CONFIG_MODVERSIONS/' *.c *.h \ + || die "MODVERSIONS sed failed" + popd >/dev/null + fi mkdir extra || die "mkdir failed" cd extra @@ -231,7 +241,9 @@ } src_compile() { - linux-mod_src_compile + if use modules ; then + linux-mod_src_compile + fi einfo "Building fgl_glxgears" cd "${S}"/extra/fgl_glxgears @@ -263,7 +275,9 @@ } src_install() { - linux-mod_src_install + if use modules ; then + linux-mod_src_install + fi # We can do two things here, and neither of them is very nice. @@ -479,15 +493,21 @@ ewarn ' Option "XAANoOffscreenPixmaps" "true"' ewarn "in the Device Section of /etc/X11/xorg.conf." - linux-mod_pkg_postinst + if use modules ; then + linux-mod_pkg_postinst + fi } pkg_prerm() { - linux-mod_pkg_prerm + if use modules ; then + linux-mod_pkg_prerm + fi /usr/bin/eselect opengl set --use-old xorg-x11 } pkg_postrm() { - linux-mod_pkg_postrm + if use modules ; then + linux-mod_pkg_postrm + fi /usr/bin/eselect opengl set --use-old xorg-x11 }