make
static. This produced $MINGINST/libming.a and
some object files under $MINGINST/src. Next, still
following the README, I changed directory to
$MINGINST/php_ext and typed make.
Whew... lots of errors. I read the error messages and they were
about header files being not found. Maybe you think that it
shouldn't be a problem if we have apt-got (err... perfect form
of apt-get...) install php4-dev (for your
information, I'm using the stable version). The fact is: it is,
and it is because of the Debian directory layout that
"confuses" php-config --includes being used inside
Makefile. The same thing also applies for
php-config --extension-dir.With such a condition, in such a "quick and dirty" way, I modified Makefile so it became like this: (includes wrapped for formatting for this example)
prefix=`php-config --prefix`
includes=-I /usr/include/php4/main -I /usr/include/php4/Zend \
-I /usr/include/php4/ext/standard -I /usr/include/php4 \
-I /usr/include/php4/TSRM
extension=/usr/lib/php4/apache
DEFINES = -DHAVE_MING -DCOMPILE_DL_MING -DZEND_NEW_ERROR_HANDLING
CFILES = ming.c
php_ming.so: ming.o
${CC} -shared -fpic ming.o ../libming.a -o php_ming.so -lm
ming.o: ${CFILES}
${CC} ${DEFINES} -c ming.c -I. -I.. ${includes}
clean:
rm -f php_ming.so
install:
cp php_ming.so ${extension}
echo "Don't forget to add 'extension=php_ming.so' to php.ini!"