In the short term, this info should be added to the php5 info file.
See if someone can come up with a way of installing it when using microcore, but not when using Tiny Core. It actually only needs to be installed when microcore is installed but not Xlibs.
If you include other similar situations, that is, install something in one situation and not in another, it is not easy, as there are many different things to take into consideration.
In the long term, that would be a good solution. But it is not straight forward.