// In MSC VC6 default search path for exe's to path for this
-#if defined(_MSC_VER)
-
-char DefaultExePath[_MAX_PATH];
-
-#endif
+char DefaultExePath[128];
/* Far functions, far data */
#define OPTION_LARGE_MODEL "-model-large"
//char *try_dir[]= {SRCDIR "/bin",PREFIX "/bin", NULL};
char *try_dir[] =
-{NULL};
+{NULL, NULL}; /* First entry may be overwritten, so use two. */
#endif
buildCmdLine (buffer, port->linker.cmd, srcFileName, NULL, NULL, NULL);
if (my_system (buffer))
{
+ perror ("Cannot exec linker");
exit (1);
}
#else
buildCmdLine (buffer, port->assembler.cmd, srcFileName, NULL, NULL, asmOptions);
if (my_system (buffer))
{
+ perror ("Cannot exec assembler");
exit (1);
}
#else
preOutName, srcFileName, preArgv);
if (my_system (buffer))
{
+ perror ("Cannot exec Preprocessor");
exit (1);
}
#else
if (i == 0)
DefaultExePath[0] = '\0';
}
+#else
+
+ if (strchr(argv[0], '/'))
+ {
+ strcpy(DefaultExePath, argv[0]);
+ *(strrchr(DefaultExePath, '/')) = 0;
+ try_dir[0] = DefaultExePath;
+ }
#endif