Complete merging pre-master-42 into bt_dev.

This commit is contained in:
Brian Taylor 2023-09-03 09:44:40 -07:00
parent 717cc075e8
commit dd9a2f8c8d
4 changed files with 22 additions and 56 deletions

View File

@ -293,20 +293,10 @@ ft_cpinit(void)
if ((fp = fopen(buf, "r")) != NULL) {
/* Set a variable to identify the loadable module directory.
* The standard spinit uses it to load XSPICE and OSDI files.
*/
#define VARNAME "_module_path_"
cp_vset(VARNAME, CP_STRING, Module_Path);
/* Run spinit */
cp_interactive = FALSE;
inp_spsource(fp, TRUE, buf, FALSE);
cp_interactive = TRUE;
found = TRUE;
cp_remvar(VARNAME);
break;
#if defined(HAS_WINGUI) || defined(__MINGW32__) || defined(_MSC_VER)

View File

@ -277,7 +277,6 @@ extern char *News_File;
extern char *Spice_Path;
extern char *Help_Path;
extern char *Lib_Path;
extern char *Module_Path;
extern char *Inp_Path;
extern char *Infile_Path;
extern char *Spice_Exec_Path;

View File

@ -10,7 +10,6 @@ char *Spice_Path;
char *News_File;
char *Help_Path;
char *Lib_Path;
char *Module_Path;
char *Inp_Path;
char *Spice_Exec_Path;
@ -50,39 +49,23 @@ mkvar(char **p, char *path_prefix, char *var_dir, char *env_var)
is given, to ../lib, set by src/makefile.am. With Visual C, it is set manually by
an entry to ngspice\visualc\src\include\ngspice\config.h.
For Windows GUI and Console the path is set relative to the executable.*/
void
ivars(char *argv0)
{
char *root, *temp=NULL;
char *temp=NULL;
#if defined (HAS_WINGUI) || defined (__MINGW32__) || defined (_MSC_VER)
char *ngpath;
#endif
root = getenv("SPICE_ROOT");
if (root) {
temp = tprintf("%s/share/ngspice", root);
mkvar(&Spice_Lib_Dir, root, "share/ngspice", "SPICE_LIB_DIR");
mkvar(&Module_Path, root, "lib/ngspice", "SPICE_MODULE_DIR");
} else {
#ifdef HAS_RELPATH
Spice_Lib_Dir = temp = copy("../share/ngspice");
#elif !defined SHARED_MODULE && \
(defined (HAS_WINGUI) || defined (__MINGW32__) || defined (_MSC_VER))
ngpath = ngdirname(argv0);
mkvar(&Spice_Lib_Dir, ngpath, "../share/ngspice", "SPICE_LIB_DIR");
mkvar(&Module_Path, ngpath, "../lib/ngspice", "SPICE_MODULE_DIR");
tfree(ngpath);
Spice_Lib_Dir = temp = copy("../share/ngspice");
#elif !defined SHARED_MODULE && (defined (HAS_WINGUI) || defined (__MINGW32__) || defined (_MSC_VER))
ngpath = ngdirname(argv0);
mkvar(&Spice_Lib_Dir, ngpath, "../share/ngspice", "SPICE_LIB_DIR");
tfree(ngpath);
#else
/* Trim "/share/ngspice" from configured Spice_Lib_Dir. */
temp = tprintf("%.*s", strlen(Spice_Lib_Dir) - 14, Spice_Lib_Dir);
mkvar(&Module_Path, temp, "lib/ngspice", "SPICE_MODULE_DIR");
env_overr(&Spice_Lib_Dir, "SPICE_LIB_DIR");
env_overr(&Spice_Lib_Dir, "SPICE_LIB_DIR");
#endif
}
tfree(temp);
/* for printing a news file */
mkvar(&News_File, Spice_Lib_Dir, "news", "SPICE_NEWS");
@ -92,16 +75,14 @@ ivars(char *argv0)
mkvar(&Lib_Path, Spice_Lib_Dir, "scripts", "SPICE_SCRIPTS");
/* used to call ngspice with aspice command, not used in Windows mode */
mkvar(&Spice_Path, Spice_Exec_Dir, "ngspice", "SPICE_PATH");
tfree(temp);
/* may be used to store input files (*.lib, *.include, ...) */
/* get directory where ngspice resides */
#if defined (HAS_WINGUI) || defined (__MINGW32__) || defined (_MSC_VER)
{
ngpath = ngdirname(argv0);
/* set path either to <ngspice-bin-directory>/input or,
if set, to environment variable NGSPICE_INPUT_DIR */
mkvar(&Inp_Path, ngpath, "input", "NGSPICE_INPUT_DIR");
tfree(ngpath);
}
@ -109,7 +90,6 @@ ivars(char *argv0)
NG_IGNORE(argv0);
/* set path either to environment variable NGSPICE_INPUT_DIR
(if given) or to NULL */
env_overr(&Inp_Path, "NGSPICE_INPUT_DIR");
Inp_Path = copy(Inp_Path); /* allow tfree */
#endif
@ -120,7 +100,6 @@ ivars(char *argv0)
/* Set raw file mode, 0 by default (binary) set in conf.c,
may be overridden by environmental
variable, not sure if acknowledged everywhere in ngspice */
env_overr(&temp, "SPICE_ASCIIRAWFILE");
if(temp)
AsciiRawFile = atoi(temp);

View File

@ -16,31 +16,29 @@ set x11lineararcs
* comment out if central osdi management is set up
unset osdi_enabled
* XSPICE and OSDI are loaded from a path provided in a variable.
* Load the codemodels
if $?xspice_enabled
@XSPICEINIT@ codemodel $_module_path_/spice2poly.cm
@XSPICEINIT@ codemodel $_module_path_/analog.cm
@XSPICEINIT@ codemodel $_module_path_/digital.cm
@XSPICEINIT@ codemodel $_module_path_/xtradev.cm
@XSPICEINIT@ codemodel $_module_path_/xtraevt.cm
@XSPICEINIT@ codemodel $_module_path_/table.cm
@XSPICEINIT@ codemodel @pkglibdir@/spice2poly.cm
@XSPICEINIT@ codemodel @pkglibdir@/analog.cm
@XSPICEINIT@ codemodel @pkglibdir@/digital.cm
@XSPICEINIT@ codemodel @pkglibdir@/xtradev.cm
@XSPICEINIT@ codemodel @pkglibdir@/xtraevt.cm
@XSPICEINIT@ codemodel @pkglibdir@/table.cm
end
* Load the OpenVAF/OSDI models
if $?osdi_enabled
osdi $_module_path_/asmhemt.osdi
osdi $_module_path_/bjt504t.osdi
osdi $_module_path_/BSIMBULK107.osdi
osdi $_module_path_/BSIMCMG.osdi
osdi $_module_path_/HICUMl0-2.0.osdi
osdi $_module_path_/psp103.osdi
osdi $_module_path_/r2_cmc.osdi
osdi $_module_path_/vbic_4T_et_cf.osdi
osdi @pkglibdir@/asmhemt.osdi
osdi @pkglibdir@/bjt504t.osdi
osdi @pkglibdir@/BSIMBULK107.osdi
osdi @pkglibdir@/BSIMCMG.osdi
osdi @pkglibdir@/HICUMl0-2.0.osdi
osdi @pkglibdir@/psp103.osdi
osdi @pkglibdir@/r2_cmc.osdi
osdi @pkglibdir@/vbic_4T_et_cf.osdi
end