Commits

Anonymous committed 1cd3b23

ENH: merges from main tree

Comments (0)

Files changed (3)

GCC_XML/KWSys/ProcessUNIX.c

     /* Kill any children already started.  */
     if(cp->ForkPIDs)
       {
+      int status;
       for(i=0; i < cp->NumberOfCommands; ++i)
         {
         if(cp->ForkPIDs[i])
           {
+          /* Kill the child.  */
           kwsysProcessKill(cp->ForkPIDs[i]);
+          /* Reap the child.  Keep trying until the call is not
+             interrupted.  */
+          while((waitpid(cp->ForkPIDs[i], &status, 0) < 0) &&
+                (errno == EINTR));
           }
         }
       }

GCC_XML/KWSys/SystemTools.cxx

   return "";
 }
 
+kwsys_stl::string SystemTools::FindProgram(
+  const kwsys_stl::vector<kwsys_stl::string>& names,
+  const kwsys_stl::vector<kwsys_stl::string>& path,
+  bool noSystemPath)
+{
+  for(kwsys_stl::vector<kwsys_stl::string>::const_iterator it = names.begin();
+      it != names.end() ; ++it)
+    {
+    // Try to find the program.
+    kwsys_stl::string result = SystemTools::FindProgram(it->c_str(), 
+                                                  path, 
+                                                  noSystemPath);
+    if ( !result.empty() )
+      {
+      return result;
+      }
+    }
+  return "";
+}
 
 /**
  * Find the library with the given name.  Searches the given path and then
   for(kwsys_stl::vector<kwsys_stl::string>::const_iterator p = path.begin();
       p != path.end(); ++p)
     {
+#if defined(__APPLE__)
+    tryPath = *p;
+    tryPath += "/";
+    tryPath += name;
+    tryPath += ".framework";
+    if(SystemTools::FileExists(tryPath.c_str())
+       && SystemTools::FileIsDirectory(tryPath.c_str()))
+      {
+      return SystemTools::CollapseFullPath(tryPath.c_str());
+      }
+#endif
 #if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__MINGW32__)
     tryPath = *p;
     tryPath += "/";

GCC_XML/KWSys/SystemTools.hxx.in

     const kwsys_stl::vector<kwsys_stl::string>& path = 
     kwsys_stl::vector<kwsys_stl::string>(),
     bool no_system_path = false);
+  static kwsys_stl::string FindProgram(
+    const kwsys_stl::vector<kwsys_stl::string>& names,
+    const kwsys_stl::vector<kwsys_stl::string>& path = 
+    kwsys_stl::vector<kwsys_stl::string>(),
+    bool no_system_path = false);
 
   /**
    * Find a library in the system PATH, with optional extra paths