php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #65016 configure can not find libxpm
Submitted: 2013-06-12 05:57 UTC Modified: 2018-03-10 14:19 UTC
Votes:5
Avg. Score:3.4 ± 1.0
Reproduced:4 of 4 (100.0%)
Same Version:2 (50.0%)
Same OS:2 (50.0%)
From: gunter at grodotzki dot co dot za Assigned: cmb (profile)
Status: Closed Package: Compile Failure
PHP Version: 5.4.16 OS: Debian Wheezy
Private report: No CVE-ID: None
 [2013-06-12 05:57 UTC] gunter at grodotzki dot co dot za
Description:
------------
What used to work perfectly in Debian Squeeze does not work anymore in Debian 
Wheezy.

# dpkg -L libxpm-dev
/.
/usr
/usr/share
/usr/share/doc
/usr/share/doc/libxpm-dev
/usr/share/doc/libxpm-dev/copyright
/usr/share/doc/libxpm-dev/xpm.PS.gz
/usr/share/doc/libxpm-dev/changelog.Debian.gz
/usr/share/doc/libxpm-dev/changelog.gz
/usr/include
/usr/include/X11
/usr/include/X11/xpm.h
/usr/lib
/usr/lib/x86_64-linux-gnu
/usr/lib/x86_64-linux-gnu/pkgconfig
/usr/lib/x86_64-linux-gnu/pkgconfig/xpm.pc
/usr/lib/x86_64-linux-gnu/libXpm.a
/usr/lib/x86_64-linux-gnu/libXpm.so


# ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-cgi 
--with-config-file-path=/etc/php5/cli --with-libxml-dir --with-openssl --with-
kerberos --with-pcre-regex --with-zlib --with-bz2 --enable-calendar --with-curl 
--enable-exif --enable-ftp --with-gd --with-vpx-dir --with-jpeg-dir --with-png-
dir --with-xpm-dir --with-freetype-dir --enable-gd-native-ttf --enable-gd-jis-
conv --with-gettext --with-imap --with-kerberos --with-imap-ssl --enable-intl --
enable-bcmath --with-icu-dir=/usr --enable-mbstring --with-mcrypt --with-mysql -
-with-mysqli --with-pdo-mysql --enable-shmop --enable-soap --enable-sockets --
with-xmlrpc --with-xsl --enable-zip --with-iconv-dir --with-pear --with-tidy --
enable-pcntl


Last lines of configure:
checking for GD support... yes
checking for the location of libvpx... yes
checking for the location of libjpeg... yes
checking for the location of libpng... yes
checking for the location of libXpm... yes
checking for FreeType 2... yes
checking for T1lib support... no
checking whether to enable truetype string function in GD... yes
checking whether to enable JIS-mapped Japanese font support in GD... yes
checking for fabsf... yes
checking for floorf... yes
checking for jpeg_read_header in -ljpeg... yes
checking for vpx_codec_destroy in -lvpx... yes
checking for png_write_image in -lpng... yes
configure: error: libXpm.(a|so) not found.



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-06-12 05:58 UTC] pajoye@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: ondrej
 [2013-06-12 05:58 UTC] pajoye@php.net
I don't have a weezy to test, Ondrej, can you take a look pls?
 [2013-06-12 06:43 UTC] ondrej@php.net
That's quite easy to answer.  Debian wheezy switched to Multi-Arch which puts 
the libraries into /usr/lib/<triplet>/ location.  E.g. libXpm.so now resides in:

$ ldconfig -p | grep Xpm
	libXpm.so.4 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libXpm.so.4
	libXpm.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libXpm.so

and ld.so is able to find it:

$ cat /etc/ld.so.conf.d/x86_64-linux-gnu.conf 
# Multiarch support
/lib/x86_64-linux-gnu
/usr/lib/x86_64-linux-gnu

That's why we carry patches such as:

http://anonscm.debian.org/gitweb/?p=pkg-
php/php.git;a=blob;f=debian/patches/temporary-path-fixes-for-
multiarch.patch;h=dcca64de3cb6cb3398fa70b5ed878685f66a7acf;hb=refs/heads/master-
wheezy

in our Debian package.

The problem with PHP autoconf script is that it expects to find the library at 
specific place (f.e. /usr/lib) and it should just try linking the library 
instead (e.g. AC_SEARCH_LIBS).  The "test -f" sort of mimick the ldconfig to 
"know" where the library should be.

Unfortunatelly it cannot be solved by simple --with-library=/usr/lib/<tripplet>, 
because that would usually break the header files location.

I think that correct way to fix this in vanilla PHP would be to switch to 
AC_SEARCH_LIBS when looking for the library.

I might prepare the patch, but I am quite afraid that it's post-5.5 material, 
because that might break on oh-so-many places.

O.
 [2013-06-13 04:13 UTC] rasmus@php.net
Doesn't --with-libdir=/usr/lib/x86_64-linux-gnu fix this?
 [2013-06-18 14:31 UTC] googleguy@php.net
In my experience --with-libdir=/usr/lib/x86_64-linux-gnu has never solved this 
problem for me on Debian based systems like Ubuntu.

I usually just end up creating a symlink to /usr/lib/libXpm.so from 
/usr/lib/x86_64-linux-gnu/libXpm.so where PHP was expecting to find it and 
normally it works out.
 [2014-07-16 22:03 UTC] tcotav at gmail dot com
Ran into this today.  Running a strace on ./configure, you'll see that configure is looking for libxpm in:

stat("/usr/lib/x86_64-linux-gnu/lib64/libXpm.so", 0x7fff2fb9bcc0) = -1 ENOENT (No such file or directory)
stat("/usr/lib/x86_64-linux-gnu/lib64/libXpm.a", 0x7fff2fb9bcc0) = -1 ENOENT (No such file or directory)
stat("/usr/local/lib64/libXpm.so", 0x7fff2fb9bcc0) = -1 ENOENT (No such file or directory)
stat("/usr/local/lib64/libXpm.a", 0x7fff2fb9bcc0) = -1 ENOENT (No such file or directory)
stat("/usr/X11R6/lib64/libXpm.so", 0x7fff2fb9bcc0) = -1 ENOENT (No such file or directory)
stat("/usr/X11R6/lib64/libXpm.a", 0x7fff2fb9bcc0) = -1 ENOENT (No such file or directory)
stat("/usr/lib64/libXpm.so", 0x7fff2fb9bcc0) = -1 ENOENT (No such file or directory)
stat("/usr/lib64/libXpm.a", 0x7fff2fb9bcc0) = -1 ENOENT (No such file or directory)


but apt installs it into:  /usr/lib/x86_64-linux-gnu/


workaround:  

mkdir -p /usr/lib/x86_64-linux-gnu/lib64/
sudo ln -s /usr/lib/x86_64-linux-gnu/libXpm.so /usr/lib/x86_64-linux-gnu/lib64/
 [2017-10-24 06:29 UTC] kalle@php.net
-Status: Assigned +Status: Open -Assigned To: ondrej +Assigned To:
 [2018-03-10 14:19 UTC] cmb@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: cmb
 [2018-03-10 14:19 UTC] cmb@php.net
This issue has been fixed in the meantime[1], i.e. as of PHP
5.5.3.

[1] <http://git.php.net/?p=php-src.git;a=commit;h=5e9c6c3b644b290255fb10c8eb34778665c2f8a3>
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 12:01:27 2024 UTC