Christian Seiler: PHP unter Gentoo mit gd2 kompilieren

Beitrag lesen

Hallo Fabian,

Für's Archiv: Ausser "gd" muss auch "gd-external" im USE-Flag stehen, damit PHP mit gd kompiliert wird, zumindest ist es auf meinem Gentoo(x86)-System so.

Nein, das stimmt so nicht.

qpkg -i -v mod_php

dev-php/mod_php-4.3.8 *
        Apache module for PHP [  ]
Compiled with USE Flags: -debug -X crypt -curl -firebird -flash -freetds gd -gd-external gdbm imap -informix -ipv6 -java jpeg -ldap -mcal memlimit mysql -nls -oci8 -odbc pam -pdflib png postgres -qt -snmp -spell ssl tiff truetype xml2 -yaz -fdftk -doc -gmp -kerberos -hardenedphp -mssql berkdb -debug

Wie Du siehst, habe ich bei mir gd-external extra mit - versehen. Desweiteren steht in /usr/portage/eclass/php-sapi.eclass folgendes:

if use gd-external; then
                myconf="${myconf} --with-gd=/usr"
                REQUIREPNG=1
                if has_version '>=media-libs/gd-2.0.17'; then
                        einfo "Fixing PHP for gd function name changes"
                        sed -i 's:gdFreeFontCache:gdFontCacheShutdown:' ${S}/ext/gd/gd.c
                fi
        elif use gd; then
                myconf="${myconf} --with-gd"
                REQUIREPNG=1 REQUIREJPG=1
        else
                myconf="${myconf} --without-gd"
        fi

Das zeigt eindeutig, dass USE="gd -gd-external" reicht, damit PHP mit der gebündelten GD-Library kompiliert wird. Ich weiß nicht, was bei Deinem Gentoo-System schiefgelaufen ist.

Viele Grüße,
Christian