aboutsummaryrefslogblamecommitdiffstats
path: root/community/zsnes/zsnes-1.51-depbuild.patch
blob: e2cc0d86f64c806923d4c017c11c1470687dd6f5 (plain) (tree)

































                                                                        
--- a/src/tools/depbuild.cpp	Fri Nov 13 18:41:24 2009
+++ b/src/tools/depbuild.cpp	Fri Nov 13 19:04:09 2009
@@ -24,6 +24,9 @@
 #include <iostream>
 #include <string>
 #include <cstdio>
+#include <cstdlib>
+#include <unistd.h>
+
 using namespace std;
 
 #include "fileutil.h"
@@ -130,7 +133,20 @@
 void dependency_calculate_asm(const char *filename)
 {
   string command = nasm + " " + nflags + " -M " + filename;
-  system(command.c_str());
+  FILE *fp = popen(command.c_str(), "r");
+  if (fp)
+  {
+    char line[256];
+    while (fgets(line, sizeof(line), fp)) //Process all lines of output
+    {
+      cout << line;
+    }
+    pclose(fp);
+  }
+  else
+  {
+    cerr << "Failed on: " << filename << "\n";
+  }
 }
 
 void dependency_calculate_psr(const char *filename)