+function check_for_main_ext(ext, header)
+{
+ if (!header) {
+ header = "php_"+ ext +".h";
+ }
+
+ /* When in configure, we're always in the root of PHP source */
+ var ext_path = "ext\\" + ext;
+
+ STDOUT.Write("Checking for ext/"+ ext +" ... ");
+
+ if (FSO.FileExists(ext_path + "\\" + header)) {
+ STDOUT.WriteLine(ext_path);
+ return ext_path;
+ }
+
+ STDOUT.WriteLine("<not found>");
+ return false;
+}
+
+function check_for_pecl_ext(ext, header)
+{
+ if (!header) {
+ header = "php_"+ ext +".h";
+ }
+
+ var g;
+ var s = ext +"\\"+ header;
+
+ STDOUT.Write("Checking for pecl/"+ ext +" ... ");
+ if ( (g = glob(configure_module_dirname +"\\..\\"+ s)) ||
+ (g = glob(configure_module_dirname +"\\..\\..\\..\\pecl\\"+ s))) {
+ var f = g[0].substr(0, g[0].length - header.length - 1);
+ STDOUT.WriteLine(f);
+ return f;
+ }
+ STDOUT.WriteLine("<not found>");
+ return false;
+}
+