Index: config.auto.h.in =================================================================== --- config.auto.h.in (revision 290) +++ config.auto.h.in (revision 291) @@ -282,16 +282,10 @@ #define PCB_PREFIX "@/local/prefix@" #define PCBLIBDIR PCB_PREFIX "/share/pcb" -#define PCBTREEPATH \ +#define PCB_LIBRARY_SHELL NULL +#define PCB_LIBRARY_SEARCH_PATHS \ "." \ ":" \ - PCB_PREFIX "/share/pcb/newlib"\ - ":"\ - PCB_PREFIX "/share/pcb/pcblib-newlib" - -#define PCB_FP_PATH \ - "." \ - ":" \ "./pcblib"\ ":" \ "./footprints"\ Index: src/buffer.c =================================================================== --- src/buffer.c (revision 290) +++ src/buffer.c (revision 291) @@ -738,8 +738,7 @@ #ifdef DEBUG { int j; - printf("Library path: %s\n", Settings.LibraryPath); - printf("Library tree: %s\n", Settings.LibraryTree); + printf("Library search paths: %s\n", Settings.LibrarySearchPaths); printf("Library:\n"); for (i=0; inext) { - str = Settings.LibraryTree; + str = Settings.LibrarySearchPaths; dir = expand_dir ((gchar *) list->data); - Settings.LibraryTree = g_strconcat (str, PCB_PATH_DELIMETER, dir, NULL); + Settings.LibrarySearchPaths = g_strconcat (str, PCB_PATH_DELIMETER, dir, NULL); g_free (dir); g_free (str); } Index: src/main.c =================================================================== --- src/main.c (revision 290) +++ src/main.c (revision 291) @@ -1089,18 +1089,6 @@ /* %start-doc options "6 Commands" @ftable @code -@item --element-command -Command to read a footprint. @* -Defaults to @code{"M4PATH='%p';export M4PATH;echo 'include(%f)' | m4"} -@end ftable -%end-doc -*/ - SSET (ElementCommand, - "M4PATH='%p';export M4PATH;echo 'include(%f)' | " GNUM4, - "element-command", "Command to read a footprint"), - -/* %start-doc options "6 Commands" -@ftable @code @item --print-file Command to print to a file. @end ftable @@ -1108,56 +1096,30 @@ */ SSET (PrintFile, "%f.output", "print-file", "Command to print to a file"), -/* %start-doc options "6 Commands" +/* %start-doc options "5 Paths" @ftable @code -@item --lib-command-dir -Path to the command that queries the library. +@item --lib-search-paths +A list of (footprint) library search paths, separated by colons. @end ftable %end-doc */ - SSET (LibraryCommandDir, PCBLIBDIR, "lib-command-dir", - "Path to the command that queries the library"), + SSET (LibrarySearchPaths, PCB_LIBRARY_SEARCH_PATHS, "lib-newlib", + "A list of paths to be searched for footprints."), /* %start-doc options "6 Commands" @ftable @code -@item --lib-command -Command to query the library. @* -Defaults to @code{"QueryLibrary.sh '%p' '%f' %a"} +@item --lib-shell +A shell command that should be used as a prefix before executing +parametric library commands. On UNIX it is safe to leave this empty, +on windows a POSIX shell should be specified with -c (e.g. "bash.exe -c"). @end ftable %end-doc */ - SSET (LibraryCommand, "QueryLibrary.sh '%p' '%f' %a", - "lib-command", "Command to query the library"), + SSET (LibraryShell, PCB_LIBRARY_SHELL, "lib-shell", + "Optional shell command to be used for running parametric footprint generators"), /* %start-doc options "6 Commands" @ftable @code -@item --lib-contents-command -Command to query the contents of the library. @* -Defaults to @code{"ListLibraryContents.sh %p %f"} or, -on Windows builds, an empty string (to disable this feature). -@end ftable -%end-doc -*/ - SSET (LibraryContentsCommand, -#ifdef __WIN32__ - "", -#else - "ListLibraryContents.sh '%p' '%f'", -#endif - "lib-contents-command", "Command to query the contents of the library"), - -/* %start-doc options "5 Paths" -@ftable @code -@item --lib-newlib -Top level directory for the newlib style library. -@end ftable -%end-doc -*/ - SSET (LibraryTree, PCBTREEPATH, "lib-newlib", - "Top level directory for the newlib style library"), - -/* %start-doc options "6 Commands" -@ftable @code @item --save-command Command to save to a file. @end ftable @@ -1240,17 +1202,6 @@ SSET(ElementPath, PCBLIBPATH, "element-path", "A colon separated list of directories or commands (starts with '|')"), -/* %start-doc options "5 Paths" -@ftable @code -@item --lib-path -A colon separated list of directories that will be passed to the commands specified -by @option{--element-command} and @option{--element-contents-command}. -@end ftable -%end-doc -*/ - SSET (LibraryPath, PCBLIBPATH, "lib-path", - "A colon separated list of directories"), - /* %start-doc options "1 General Options" @ftable @code @item --action-script @@ -1453,28 +1404,6 @@ { char *tmps; - if (Settings.LibraryCommand != NULL && - Settings.LibraryCommand[0] != '\0' && - Settings.LibraryCommand[0] != PCB_DIR_SEPARATOR_C && - Settings.LibraryCommand[0] != '.') - { - Settings.LibraryCommand - = - Concat (Settings.LibraryCommandDir, PCB_DIR_SEPARATOR_S, - Settings.LibraryCommand, - NULL); - } - if (Settings.LibraryContentsCommand != NULL && - Settings.LibraryContentsCommand[0] != '\0' && - Settings.LibraryContentsCommand[0] != PCB_DIR_SEPARATOR_C && - Settings.LibraryContentsCommand[0] != '.') - { - Settings.LibraryContentsCommand - = - Concat (Settings.LibraryCommandDir, PCB_DIR_SEPARATOR_S, - Settings.LibraryContentsCommand, NULL); - } - if (Settings.LineThickness > MAX_LINESIZE || Settings.LineThickness < MIN_LINESIZE) Settings.LineThickness = MIL_TO_COORD(10); @@ -1965,16 +1894,14 @@ EnableAutosave (); #ifdef DEBUG - printf ("Settings.LibraryCommandDir = \"%s\"\n", - Settings.LibraryCommandDir); - printf ("Settings.FontPath = \"%s\"\n", + printf ("Settings.FontPath = \"%s\"\n", Settings.FontPath); - printf ("Settings.ElementPath = \"%s\"\n", + printf ("Settings.ElementPath = \"%s\"\n", Settings.ElementPath); - printf ("Settings.LibraryPath = \"%s\"\n", - Settings.LibraryPath); - printf ("Settings.LibraryTree = \"%s\"\n", - Settings.LibraryTree); + printf ("Settings.LibrarySearchPaths = \"%s\"\n", + Settings.LibrarySearchPaths); + printf ("Settings.LibraryShell = \"%s\"\n", + Settings.LibraryShell); printf ("Settings.MakeProgram = \"%s\"\n", UNKNOWN (Settings.MakeProgram)); printf ("Settings.GnetlistProgram = \"%s\"\n", Index: src/parse_l.c =================================================================== --- src/parse_l.c (revision 290) +++ src/parse_l.c (revision 291) @@ -2401,7 +2401,7 @@ yyFont = &PCB->Font; yyElement = NULL; - f = pcb_fp_fopen(Settings.LibraryCommand, Settings.LibraryPath, name, &st); + f = pcb_fp_fopen(Settings.LibraryShell, Settings.LibrarySearchPaths, name, &st); if (f == NULL) return -1; Index: src/parse_l.l =================================================================== --- src/parse_l.l (revision 290) +++ src/parse_l.l (revision 291) @@ -317,7 +317,7 @@ yyFont = &PCB->Font; yyElement = NULL; - f = pcb_fp_fopen(Settings.LibraryCommand, Settings.LibraryPath, name, &st); + f = pcb_fp_fopen(Settings.LibraryShell, Settings.LibraryPath, name, &st); if (f == NULL) return -1;