diff --git a/driver/iverilog.man.in b/driver/iverilog.man.in index 190142d96..a4e09ed9b 100644 --- a/driver/iverilog.man.in +++ b/driver/iverilog.man.in @@ -502,7 +502,7 @@ Variables in the \fIincludedir\fP are substituted. .TP 8 .B +libext+\fIext\fP -The \fB+libext\fP token in command files fives file extensions to try +The \fB+libext\fP token in command files lists file extensions to try when looking for a library file. This is useful in conjunction with \fB\-y\fP flags to list suffixes to try in each directory before moving on to the next library directory. diff --git a/main.cc b/main.cc index 7f2c8ac40..45b626f77 100644 --- a/main.cc +++ b/main.cc @@ -598,6 +598,7 @@ bool had_timescale = false; static void read_iconfig_file(const char*ipath) { char buf[8*1024]; + vector > to_build_library_index; FILE*ifile = fopen(ipath, "r"); if (ifile == 0) { @@ -756,10 +757,10 @@ static void read_iconfig_file(const char*ipath) ignore_missing_modules = true; } else if (strcmp(buf, "-y") == 0) { - build_library_index(cp, CASE_SENSITIVE); + to_build_library_index.push_back(make_pair(strdup(cp), CASE_SENSITIVE)); } else if (strcmp(buf, "-yl") == 0) { - build_library_index(cp, false); + to_build_library_index.push_back(make_pair(strdup(cp), false)); } else if (strcmp(buf, "-Y") == 0) { library_suff.push_back(strdup(cp)); @@ -798,6 +799,11 @@ static void read_iconfig_file(const char*ipath) } } fclose(ifile); + for (vector >::iterator it = to_build_library_index.begin() ; + it != to_build_library_index.end() ; ++ it ) { + build_library_index(it->first, it->second); + free(it->first); + } } /*