From fd4b84909103a62d18f96e2bb7615a7c6e885103 Mon Sep 17 00:00:00 2001 From: Cary R Date: Mon, 12 Oct 2009 19:30:01 -0700 Subject: [PATCH] In driver-vpi only look at the first CC word when checking compiler path. In the MinGW version of iverilog-vpi (C version located in driver-vpi) we must only look at the first word of the IVERILOG_VPI_CC definition. A recent change to the configuration process made this equal to "gcc -std=gnu99" which will not be found when looking for the gcc executable. We nee to look for "\\bin\\gcc.exe". This patch modifies the driver to only use the first word when looking for the compiler, but uses the full value when compiling. (cherry picked from commit d9d8d4b0935bdf63b38010e4a4d35b9f3a4295c6) --- driver-vpi/main.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/driver-vpi/main.c b/driver-vpi/main.c index 54b05c5b4..8e6a9eff2 100644 --- a/driver-vpi/main.c +++ b/driver-vpi/main.c @@ -410,14 +410,21 @@ static int parse(int argc, char *argv[]) static void checkMingwDir(char *root) { - int irv; + int irv, len; struct _stat stat_buf; - char *path; + char *path, *comp, *cp; initDynString(&path); assign(&path,gstr.pMINGW); appendBackSlash(&path); - append(&path,"bin\\" IVERILOG_VPI_CC ".exe"); + append(&path,"bin\\"); + /* Get just the compiler name (the first word) */ + comp = strdup(IVERILOG_VPI_CC); + cp = strchr(comp, ' '); + if (cp != NULL) *cp = '\0'; + append(&path, comp); + append(&path,".exe"); + free(comp); irv = _stat(path,&stat_buf); deInitDynString(path);