Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot build 3.1.6 #35

Open
svaningelgem opened this issue Nov 4, 2023 · 4 comments
Open

Cannot build 3.1.6 #35

svaningelgem opened this issue Nov 4, 2023 · 4 comments

Comments

@svaningelgem
Copy link

TL;DR: I tried to build mailparse-3.1.6 however it fails with #error The mailparse extension requires the mbstring extension!

system: Debian GNU/Linux 12 (bookworm)
php: PHP 8.2.7 (cli) (built: Jun 9 2023 19:37:27) (NTS)

  • extraction: ok
  • phpize: ok
Configuring for:
PHP Api Version:         20220829
Zend Module Api No:      20220829
Zend Extension Api No:   420220829
configure.ac:165: warning: The macro `AC_PROG_LIBTOOL' is obsolete.
configure.ac:165: You should run autoupdate.
build/libtool.m4:100: AC_PROG_LIBTOOL is expanded from...
configure.ac:165: the top level
  • configure: ok
checking libmbfl headers... found in /usr/include/php/20220829/ext/mbstring
  • make: error

I think the issue is because "HAVE_MBSTRING" is not set.

Adding #define HAVE_MBSTRING 1 into the generated config.h file makes everything compile correctly.

@cmb69
Copy link
Member

cmb69 commented Aug 27, 2024

This is not something we can solve (except may add appropriate info to README.md). I suppose that happens because the mbstring extension on your system has also been built with phpize, so config.h.in (I think it's called so on non Windows systems) doesn't know about that. I think you can workaround with CFLAGS=-DHAVE_MBSTRING=1 phpize (or something like that).

But may @oerdnj knows a better way.

@svaningelgem
Copy link
Author

svaningelgem commented Aug 28, 2024

I had another look at it, and it seems a very easy fix like I did it. It does compile properly now with the proposed change.

@oerdnj
Copy link

oerdnj commented Aug 28, 2024

This is not something we can solve (except may add appropriate info to README.md). I suppose that happens because the mbstring extension on your system has also been built with phpize, so config.h.in (I think it's called so on non Windows systems) doesn't know about that. I think you can workaround with CFLAGS=-DHAVE_MBSTRING=1 phpize (or something like that).

But may @oerdnj knows a better way.

It’s might be possible to detect the runtime presence of mbstring, but that’s kind of moot.

I would suggest to remove the check for the mbstring completely instead. Or turn it into the warning (unless you need it at the compile time) and just document that mbstring needs to be loaded before mailparse.

The compilation of externally loadable shared libraries is a mess everywhere as you can’t resolve the symbols properly.

@cmb69
Copy link
Member

cmb69 commented Aug 28, 2024

The problem is that mailparse actually requires mbstring during compilation. But you are right that this can't be solved with code; as such I'm changing to documentation issue; the installation docs need to be updated, and linked from this repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants