+
+#if defined(_MSC_VER)
+
+char *try_dir[]= {DefaultExePath, NULL}; // TODO : Fill in some default search list
+
+#else
+
+//char *try_dir[]= {SRCDIR "/bin",PREFIX "/bin", NULL};
+char *try_dir[]= {NULL};
+
+#endif
+
+#ifdef USE_SYSTEM_SYSTEM_CALLS
+int my_system (const char *cmd)
+{
+ int argsStart, e, i=0;
+ char *cmdLine=NULL;
+
+ argsStart=strstr(cmd, " ")-cmd;
+
+ // try to find the command in predefined path's
+ while (try_dir[i]) {
+ cmdLine = (char*)malloc(strlen(try_dir[i])+strlen(cmd)+10);
+ strcpy(cmdLine, try_dir[i]); // the path
+ strcat(cmdLine, "/");
+ strncat(cmdLine, cmd, argsStart); // the command
+#if NATIVE_WIN32
+ strcat(cmdLine, ".exe");
+ /* Mung slashes into backslashes to keep WIndoze happy. */
+ {
+ char *r=cmdLine;
+ while (*r) {
+ if (*r == '/') {
+ *r = '\\';
+ }
+ r++;
+ }
+ }
+#endif
+ if (access(cmdLine, X_OK) == 0) {
+ // the arguments
+ strcat(cmdLine, cmd+argsStart);
+ break;
+ }
+ free(cmdLine);
+ cmdLine=NULL;
+ i++;
+ }
+
+ if (verboseExec) {
+ printf ("+ %s\n", cmdLine ? cmdLine : cmd);
+ }
+
+ if (cmdLine) {
+ // command found in predefined path
+ e=system(cmdLine);
+ free(cmdLine);
+ } else {
+ // trust on $PATH
+ e=system(cmd);
+ }
+ return e;
+}
+
+#else
+