php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #74686 ./configure does not respect --prefix for libxml2 (specifically xml2-config)
Submitted: 2017-06-01 09:48 UTC Modified: 2017-06-02 08:41 UTC
From: jonas at ogaard dot no Assigned:
Status: Not a bug Package: Compile Failure
PHP Version: 7.1.5 OS: Red Hat 4.4.7-17
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: jonas at ogaard dot no
New email:
PHP Version: OS:

 

 [2017-06-01 09:48 UTC] jonas at ogaard dot no
Description:
------------
If libxml2 lies in an unconventional prefix-path $PREFIX, running ./configure --prefix=$PREFIX does not make the build script search $PREFIX/usr/local/bin or $PREFIX/usr/bin for xml2-config, but instead it defaults to /usr/local/bin and /usr/bin . Luckily --with-libxml-dir=$PREFIX resolves this, but this can't possibly be intended functionality

Test script:
---------------
./configure --prefix=$PREFIX

Expected result:
----------------
Configuration halts due to missing xml2-config file


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-06-01 09:58 UTC] danack@php.net
-Status: Open +Status: Feedback
 [2017-06-01 09:58 UTC] danack@php.net
> but this can't possibly be intended functionality

.....why not?

PHP uses lots of libraries. Each of them need to have a flag that says which directory they are in, which is why you can specify the library location per extension (i.e. --with-libxml-dir, --with-imagick)

I'm pretty sure that prefix is to tell the compilation process where to build files to, not to read them from: "--prefix=PREFIX install architecture-independent files in PREFIX [/usr/local]"

Feel free to explain further if you think this is a bug, or just allow it to close if that's enough explanation.
 [2017-06-01 14:54 UTC] jonas at ogaard dot no
-Status: Feedback +Status: Open
 [2017-06-01 14:54 UTC] jonas at ogaard dot no
I wholeheartedly agree, I was a bit fast when writing the ticket. And of course I agree $PREFIX has nothing to do where the compilation scripts looks for deps - my bad.

Is there a reason why it doesn't look in $PATH at all though?
 [2017-06-01 15:34 UTC] spam2 at rhsoft dot net
because libraries have no business with PATH at all
 [2017-06-01 17:53 UTC] danack@php.net
-Status: Open +Status: Not a bug
 [2017-06-01 17:53 UTC] danack@php.net
I believe the ENV settings for the locations of libraries like `LDFLAGS='-L/home/foo/lib/'` are completely separate from users' PATH setting.

Closing as not a bug then.
 [2017-06-02 08:41 UTC] jonas at ogaard dot no
I understand. What put me off is that the script calls the binary supplied by libxml2 (xml2-config) which, of course, will not be affected by library paths or include dirs.

In other configuration files I've encounter (e.g. ImageMagick) it does check the PATH for the executable, instead of the hardcoded /usr/local/bin and /usr/bin. To me, checking for the hardcoded paths instead of $PATH seemed less intuitive.

This is the reason I filed the ticket, but if most build systems benefit from hardcoded paths all is good.

Thanks for good responses and all your help!
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 08:01:30 2024 UTC