Menu

#72 Php does not build from SRPM

open
nobody
RPM (48)
5
2005-06-30
2001-11-26
Anonymous
No

I need to build php from SRPM to include more libraries in it.
I do it this way :
cd /opt/freeware/src/packages/SPECS
(I edit php.spec to change the configure options)
rpm -ba php.spec
Thois does the configuration and the make steps, but it
cannot install the package, because it does not create
the libphp4.so library during the make step.
The error log is :

+ cd -
/opt/freeware/src/packages/BUILD/php-4.0.6
+ mkdir -p /var/opt/freeware/tmp/php-root/opt/freeware/include/php/ext/xml/expat/xmltok
+ cd ext/xml/expat/xmltok
+ cp -p asciitab.h iasciitab.h latin1tab.h nametab.h utf8tab.h xmldef.h xmlrole.h xmltok.h xmltok_impl.h /var/opt/freeware/tmp/php-root/opt/freeware/include/php/ext/xml/expat/xmltok
+ cd -
/opt/freeware/src/packages/BUILD/php-4.0.6
+ cp -p acconfig.h php_version.h /var/opt/freeware/tmp/php-root/opt/freeware/include/php
+ mkdir -p /var/opt/freeware/tmp/php-root/opt/freeware/apache/libexec
+ cp .libs/libphp4.so.0 /var/opt/freeware/tmp/php-root/opt/freeware/apache/libexec/libphp4.so
cp: .libs/libphp4.so.0: No such file or directory
Bad exit status from /var/opt/freeware/tmp/rpm-tmp.30732 (%install)

this normally happens when make cannot find some
other piece of software (e.g. mysqlclient), so the
shared library is not created.
Any idea of what is wrong here ?

Discussion

  • Marc Stephenson

    Marc Stephenson - 2001-11-26

    What changes did you make to the configure options? When we build, we have /usr/linux/bin ahead of /usr/bin in the PATH to get the "Linux" versions of various utilities - sometimes that makes a difference (AIX make != GNU make, AIX m4 != GNU m4, etc....).

     
  • Nobody/Anonymous

    My PATH is this :
    root@trantor:/ # echo $PATH
    /opt/freeware/bin:/usr/ucb:/bin:/usr/bin:/etc:/usr/sbin:/usr/local/bin
    I'm shure I use the GNU set of tools (I checked them
    with which make ...)

    My changes in the php.spec file are these :
    ./configure
    --prefix=%{prefix}
    --disable-debug
    --enable-track-vars
    --enable-magic-quotes
    --with-apxs=/httpd/sbin/apxs
    --with-mysql=/opt/freeware
    --with-config-file-path=/etc/opt/freeware/apache
    --with-zlib
    --with-system-regex
    --enable-bcmath
    --with-gd=/opt/freeware
    --with-ttf=/opt/freeware
    --with-jpeg-dir=/opt/freeware
    --with-xpm-dir=/opt/freeware
    --with-imap=/usr1/src/imap
    --with-xml
    --with-ftp
    %if %{SSL} == 1
    --with-ssl
    %endif

    make

    The error is the same with basic configuration :
    # A basic configure and make
    ./configure --prefix=%{prefix} --with-apxs --with-mysql
    --with-config-file-path=/etc/opt/freeware/apache --with-ftp
    --with-zlib --with-system-regex
    --with-xml --with-ftp
    %if %{SSL} == 1
    --with-ssl
    %endif

    make

    The error about "libphp4.so not found" is shown in the php
    bugs database, but it is not clear if this bug is closed
    or not ... it seems to be somewhere about the dso support.

     
  • Nobody/Anonymous

    NOTE : in php-4.0.6/ltconfig I found :

    # See if GNU ld supports shared libraries.
    case "$host_os" in
    aix3* | aix4*)
    # On AIX, the GNU linker is very broken
    ld_shlibs=no
    cat <<EOF 1>&2
    *** Warning: the GNU linker, at least up to release 2.9.1, is reported
    *** to be unable to reliably create shared libraries on AIX.
    *** Therefore, libtool is disabling shared libraries support. If you
    *** really care for shared libraries, you may want to modify your PATH
    *** so that a non-GNU linker is found, and then restart.

    EOF
    ;;
    ----------------------------------------------------------
    Can this be the cause of the missing libphp4.so ?

     
  • Nobody/Anonymous

    Ah -ha! (Maybe).

    That looks like an old ltconfig (because it doesn't mention AIX). For whatever reason, the php spec file is not invoking libtoolize on ppc platforms (it does on IA64). Assuming that you have libtool installed from the Toolbox (install it if you do not), remove the %ifarch ia64 /%endif test around the libtoolize --force (should be on about line 99).

    I'll ask our php maintainer about the apparent discrepancy.

     
  • Nobody/Anonymous

    Removed %ifarch ia64 /%endif ... OK

    I had also to correct the following line :
    #install -m 644 *.gif $RPM_BUILD_ROOT%{contentdir}/icons/
    to
    ./build/shtool install -c -m 644 *.gif $RPM_BUILD_ROOT%{contentdir}/icons/

    because that syntax is not accepted from Aix install,
    but I can't complete the installation, because during
    the build phase, it complains about some missing library,
    but I can't know wich one: neither redirections or tee command work for this job (rpm -ba php.spec)

    I'm loosing my head ... how can I have the log of
    a rpm build? It seems to me that we had less problems
    compiling from tarball, but how can I do that ? I tried
    to install everything from sources but the configuration
    does not work with this new environment. Please help !

    I'm working from september to install a simple aix5
    to substitute a well working aix 4.3.3 whit apache+php+
    mysql +some minor libraries (gd,bcmath,png) I dont find
    into precompiled php. What is the correct whay to obtain this simple bunch of programs ?

     
  • Nobody/Anonymous

    New info this is the error :

    /opt/freeware/lib -R /usr1/src/imap/c-client -R /opt/freeware/lib/mysql stub.lo Zend/libZend.la sapi/ap
    ache/libsapi.la main/libmain.la regex/libregex.la ext/zlib/libzlib.la ext/gd/libgd.la ext/imap/libimap.la
    ext/mysql/libmysql.la ext/pcre/libpcre.la ext/posix/libposix.la ext/session/libsession.la ext/standard/l
    ibstandard.la ext/xml/libxml.la TSRM/libtsrm.la -lpam -lc-client -ldl -lmysqlclient -lz -lpam -lgd -lttf
    -lpng -lz -ljpeg -lz -lcrypt -lbind -ldl
    nm: ext/standard/.libs/libstandard.al[image.lo]: 0654-206 Cannot process the symbol table.

    But after this error, the job continues for two minutes,
    after that it terminate well, but without copying the
    module to apache/libexec. I can't copy it manually,
    because it erase quickly the working directory :

    + cd /opt/freeware/src/packages/BUILD
    + cd php-4.0.6
    + [ /var/opt/freeware/tmp/php-root != / ]
    + rm -rf /var/opt/freeware/tmp/php-root
    + exit 0

     
  • David Clissold

    David Clissold - 2001-11-28
    • assigned_to: nobody --> cliss
     
  • David Clissold

    David Clissold - 2001-11-28

    I built the php that is on the Toolbox site; I'll see if I can help you. Since it worked on our build system, using this same SRPM, there has got to be something different in our environments/system setup. One difference might be the compiler -- we are defaulting to the IBM xlc compiler (cc), not the gcc compiler (for performance reasons). But it should work with gcc too; which compiler are you using?
    Hmm.... I'm seeing a failure if I switch to gcc (encountered earlier in the build than what you are seeing).

    Something else that is different; it sounds like you may not have the "fileutils" RPM installed, since you are picking up the AIX 'install' command instead of the GNU version. Do you have /opt/freeware/bin/install ? If not, download the fileutils RPM, and you shouldn't get the install failure.
    Since this is dependent on the GNU install, I'll put fileutils into the SPEC file as a BuildPrereq.

    And another difference: I see from the "nm" error message in your last note that you are running the native AIX 'nm' command; do you have 'binutils' installed? If so, put /usr/linux/bin first in your path (the GNUPro binutils are symlinked to /opt/freeware/GNUPro/bin ; you could put that in your path instead if you like).
    Try it again with filutils and binutils installed, and /usr/linux/bin (instead of just /opt/freeware/bin).

    BTW, it wasn't doing a libtoolize because of the patch needed for the ltconfig script for --with-apxs. libtoolize would overwrite the patch.
    libtoolize is only needed to override the existing ltconfig/ltmain.sh if the existing ones don't work correctly (unless they've been customized; yuck.)

     
  • David Clissold

    David Clissold - 2001-11-28

    Also -- redirection definitely should work for you when you run the command. We run essentially:
    rpm -ba php.spec 2>&1 | tee /tmp/php.build
    (that should definitely be working; if not, what shell are you using?)

    If you can get that file, I'd like to see it; email it to cliss@austin.ibm.com.
    Let's see if we can get the basic php.spec from the SRPM to work first before adding your customized flags, since we know that built successfully here, and so I can compare apples to apples.

     
  • David Clissold

    David Clissold - 2001-11-28

    Also -- redirection definitely should work for you when you run the command. We run essentially:
    rpm -ba php.spec 2>&1 | tee /tmp/php.build
    (that should definitely be working; if not, what shell are you using?)

    If you can get that file, I'd like to see it; email it to cliss@austin.ibm.com.
    Let's see if we can get the basic php.spec from the SRPM to work first before adding your customized flags, since we know that built successfully here, and so I can compare apples to apples.

     
  • David Clissold

    David Clissold - 2001-11-29

    Update (summary) --
    Fulvio has now gotten it to build (problem had to do with the environment settings, from /etc/environment not set when in KDE, it seems). He sent me his build information. It builds fine, but httpd core dumps; this is the same thing I saw prompting the ltconfig patch and NOT running libtoolize.
    He also found a problem with libgd.a depending on libttf.a and finding the static version on the system instead of the toolbox version. He has worked around that problem for now, but I am looking into it some more.

     
  • Nobody/Anonymous

    I built PHP on AIX prior to installing linux toolbox...

    Date: Tue, 18 Sep 2001 00:01:02 -0500 (CDT)
    From: Jason Ellison
    To: php-install@lists.php.net
    Subject: Installing PHP-4.0.6 on AIX 4.3.3 using gcc

    Hello all,

    I recently installed php 4.0.6 on AIX 4.3.3.0 using Phill's document
    posted to this list on 05.08.2001 (life saver) and would like to repost it
    with some corrections. The corrections may be obvious to some but it kept
    me up for a *long* time. The problems i found were in step 6 and 7 .

    ${wl} -bI:/usr/local/apache/libexec/httpd.exp
    ^- there should be no space before "-bI:"

    obj=`$echo "X$oldobj" | $Xsed -e "lo2o"`
    lo2o is defined earlier in the script and needs to be "$lo2o"

    REF: Re: [PHP-INST] AIX 4.3.3 PHP 4.0.5 HowTo compile using xlC
    http://marc.theaimsgroup.com/?l=php-install&m=98932190132723&w=2

    Installing PHP-4.0.6 on AIX 4.3.3 using gcc

    1) Download PHP source.
    2) gunzip -> tar ....
    3) cd php-4.0.6
    4) ./configure --with-apxs=/usr/local/apache/bin/apxs
    --enable-trans-sid --disable-xml --disable-pear
    --with-mysql=/usr/local/mysql --with-oci8=/u01/app/oracle/product/8.1.6
    5) vi libtool
    6) Hack away at these lines:

    archive_cmds= .....
    add this:
    ${wl}-bI:/usr/local/apache/libexec/httpd.exp

    do the same for:
    archive_expsym_cmds= ......

    7) Search for the following:
    Do each command in the archive commands

    At the bottom of the loop that starts with the line:
    for oldobj in $oldobjs; do
    .
    .
    .
    .
    done

    insert this just before and after the "done" i.e.
    obj=`$echo "X$oldobj" | $Xsed -e "$lo2o"`
    eval "cp $oldobj $obj"
    done
    oldobjs=`$echo "X$oldobjs" | $Xsed -e 's/.lo/.o/g'`

    8) make
    9) make install

    http://www.phpbuilder.com/mail/php-install/2001092/0019.php

     
  • Nobody/Anonymous

    New infos :
    I tried to compile php 4.1.0 directly from tarball :
    it complains about libm.a missing, so I discovered that
    on my system bos.adt.libm was not installed !!
    After this pkg has been installed I was able to compile
    php from sources (not from SRPM) copying by hand libphp4.so.0 form .libs to /apache/libexec.
    The standard installation
    searches it in libs (not .libs) so it cannot install ..
    It's a bit tricky, but now I have php !
    Thanks to all, guys

     
  • David Clissold

    David Clissold - 2001-12-13

    Good to hear.
    Still, it should build from the SRPM.... While the SRPM itself builds fine for me, I think there are a couple things that ought to be cleaned up with it (e.g. added BuildRequires, plus I didn't know any better at the time but I created an import file to import the apache symbols, even though apache already provides an export file that can be used for importing).

    So let's leave the bug report open until I get back to this, though I can see that that won't be until January, as I will be out for two weeks.

     
  • David Clissold

    David Clissold - 2005-06-30
    • assigned_to: cliss --> nobody
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.