diff --git a/driver-vpi/main.c b/driver-vpi/main.c index 8e6a9eff2..bfd1ec77b 100644 --- a/driver-vpi/main.c +++ b/driver-vpi/main.c @@ -410,7 +410,7 @@ static int parse(int argc, char *argv[]) static void checkMingwDir(char *root) { - int irv, len; + int irv; struct _stat stat_buf; char *path, *comp, *cp; @@ -518,16 +518,16 @@ static void setup_ivl_environment() } /* Build up the CFLAGS option string */ - assign(&gstr.pCFLAGS,IVERILOG_VPI_CFLAGS " -I"); + assign(&gstr.pCFLAGS,IVERILOG_VPI_CFLAGS " -I\""); append(&gstr.pCFLAGS,gstr.pIVL); appendBackSlash(&gstr.pCFLAGS); - append(&gstr.pCFLAGS,"\\include\\\\iverilog" IVERILOG_SUFFIX); + append(&gstr.pCFLAGS,"\\include\\\\iverilog\"" IVERILOG_SUFFIX); /* Build up the LDFLAGS option string */ - assign(&gstr.pLDLIBS,"-L"); + assign(&gstr.pLDLIBS,"-L\""); append(&gstr.pLDLIBS,gstr.pIVL); appendBackSlash(&gstr.pLDLIBS); - append(&gstr.pLDLIBS,"\\lib " IVERILOG_VPI_LDLIBS); + append(&gstr.pLDLIBS,"\\lib\" " IVERILOG_VPI_LDLIBS); } /* compile source modules */ diff --git a/driver/main.c b/driver/main.c index c673a9a23..cca64dda0 100644 --- a/driver/main.c +++ b/driver/main.c @@ -704,8 +704,8 @@ int main(int argc, char **argv) #ifdef __MINGW32__ { char * s; - char basepath[1024]; - GetModuleFileName(NULL,basepath,1024); + char basepath[1024], tmp[1024]; + GetModuleFileName(NULL, tmp, sizeof(tmp)); /* Calculate the ivl_root from the path to the command. This is necessary because of the installation process in @@ -722,7 +722,9 @@ int main(int argc, char **argv) turning the last two \ characters to null. Then we append the lib\ivl to finish. */ - strncpy(ivl_root, basepath, MAXSIZE); + /* Convert to a short name to remove any embedded spaces. */ + GetShortPathName(tmp, basepath, sizeof(basepath)); + strncpy(ivl_root, basepath, MAXSIZE); s = strrchr(ivl_root, sep); if (s) *s = 0; s = strrchr(ivl_root, sep);