How to detect GD in source code.

php.internals

D . Walsh

21 years ago
I've been writing a module, it is dependent on some GD functions, how can I detect that GD has been installed PHP native? I'm not talking about php code to see if the functions are available. Is there a macro or something that will detect if GD is installed native? If not,do you have code that detects if GD or a GD function is installed native? Anything I can add to aclocal.m4 and/or configure.ac would be greatly appreciated. -- Dale

Sara Golemon

21 years ago
> I've been writing a module, it is dependent on some GD functions, how > can I detect that GD has been installed PHP native? >
Taking a page out of Zend/zend_builtin_functions and the source code for the extension_loaded() userspace function: int gd_is_loaded = zend_hash_exists(&module_registry, "gd", sizeof("gd"));
> Anything I can add to aclocal.m4 and/or configure.ac would be greatly > appreciated. >
You could adapt the stuff in ext/gd/config.m4 to look for and link libgd yourself... -Sara