Skip to content

Linux build issues #7

@cmb69

Description

@cmb69

I tried to build the extension on Linux (actually WSL 2 with Debian bookworm), but that failed because I don't have md4c-dev installed:

checking whether to enable MD4C support... yes, shared
checking for md4c headers... not found
configure: error: Please install md4c

Since md4c-dev is not readily available on Debian bookworm, I tried building with the bundled md4c, and changed config.md4 to:

dnl config.m4 for php-md4c extension

PHP_ARG_WITH(md4c, [whether to enable MD4C support],
[  --with-md4c[[=DIR]]       Enable MD4C support.
                          DIR is the path to MD4C install prefix])

if test "$PHP_MD4C" != "no"; then
	PHP_SUBST(MD4C_SHARED_LIBADD)
	AC_DEFINE(HAVE_MD4C, 1, [ ])
	PHP_NEW_EXTENSION(md4c, md4c.c, $ext_shared)
fi

Afterwards the build succeeded:

$ phpize
$ ./configure --with-md4c
$ make
$ make test

Now I thought that the build probably cannot succeed with a system md4c library, since it is already contained in md4c.c. So either you can completely drop support for building against a system md4c, or would need to put the md4c amalgamation in a separate file, and only use this if the system library is not available. I assume that distro maintainers prefer the latter (to be able to build against system libraries). Maybe @remicollet can clarify?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions