Skip to content

Conversation

@petk
Copy link
Member

@petk petk commented Jul 10, 2024

This enables cross-compiling simplifications when using external GD library as requested in GH-14443 using cache variables:

  • php_cv_lib_gd_gdImageCreateFromPng
  • php_cv_lib_gd_gdImageCreateFromAvif
  • php_cv_lib_gd_gdImageCreateFromWebp
  • php_cv_lib_gd_gdImageCreateFromJpeg
  • php_cv_lib_gd_gdImageCreateFromXpm
  • php_cv_lib_gd_gdImageCreateFromBmp
  • php_cv_lib_gd_gdImageCreateFromTga

For example:

./configure --host=... --build=... --enable-gd --with-external-gd \
    php_cv_lib_gd_gdImageCreateFromPng=yes

Note that this has already been implemented in master branch (PHP-8.4-dev) and this one is targeting PHP-8.2.

This enables cross-compiling simplifications when using external GD
library as requested in phpGH-14443 using cache variables:

* php_cv_lib_gd_gdImageCreateFromPng
* php_cv_lib_gd_gdImageCreateFromAvif
* php_cv_lib_gd_gdImageCreateFromWebp
* php_cv_lib_gd_gdImageCreateFromJpeg
* php_cv_lib_gd_gdImageCreateFromXpm
* php_cv_lib_gd_gdImageCreateFromBmp
* php_cv_lib_gd_gdImageCreateFromTga

For example:

    ./configure --host=... --build=... --enable-gd --with-external-gd \
        php_cv_lib_gd_gdImageCreateFromPng=yes
@petk petk marked this pull request as draft July 10, 2024 17:29
@petk
Copy link
Member Author

petk commented Jul 10, 2024

I'll also adjust these help texts because they are not what they say at the moment. They are actually if the libgd is built with support for certain library...

@petk
Copy link
Member Author

petk commented Jul 10, 2024

I've just found that libgd uses pkg-config's Requires.private which can be an option to simplify the cross-compilation completely without using these cache variables but the macro will become a bit more complex...

cc @orlitzky I'll append one possible solution here.

@petk
Copy link
Member Author

petk commented Jul 13, 2025

I'll just close this as it's quite a while since I was checking this and according to current understanding cross-compilation can't be simplified without running a test program. Current master (PHP-8.5) branch and even PHP-8.4 have this mostly resolved and cache variables can be set in edge cases where cross-compiling and wanting to use external libgd.

@petk petk closed this Jul 13, 2025
@petk petk deleted the patch-14443-gd-cross-compiling branch July 13, 2025 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant