Index: trunk/src_plugins/ar_extern/ar_extern.conf =================================================================== --- trunk/src_plugins/ar_extern/ar_extern.conf (revision 35621) +++ trunk/src_plugins/ar_extern/ar_extern.conf (revision 35622) @@ -7,11 +7,13 @@ debug = 0 } ha:freerouting_cli { - exe = freerouting.cli + installation = /opt/freerouting.cli + exe = bin/Freerouting debug = 0 } ha:freerouting_net { - exe = freerouting.net + installation = /opt/freerouting.net + exe = bin/Freerouting debug = 0 } } Index: trunk/src_plugins/ar_extern/ar_extern_conf.h =================================================================== --- trunk/src_plugins/ar_extern/ar_extern_conf.h (revision 35621) +++ trunk/src_plugins/ar_extern/ar_extern_conf.h (revision 35622) @@ -11,11 +11,13 @@ RND_CFT_BOOLEAN debug; } route_rnd; const struct freerouting_cli { - RND_CFT_STRING exe; + RND_CFT_STRING installation; /* path to the installation directory (normally has bin/ and lib/) */ + RND_CFT_STRING exe; /* relative path from the installation dir to the Freerouting executable */ RND_CFT_BOOLEAN debug; } freerouting_cli; const struct freerouting_net { - RND_CFT_STRING exe; + RND_CFT_STRING installation; /* path to the installation directory (normally has bin/ and lib/) */ + RND_CFT_STRING exe; /* relative path from the installation dir to the Freerouting executable */ RND_CFT_BOOLEAN debug; } freerouting_net; } ar_extern; Index: trunk/src_plugins/ar_extern/e_freerouting.c =================================================================== --- trunk/src_plugins/ar_extern/e_freerouting.c (revision 35621) +++ trunk/src_plugins/ar_extern/e_freerouting.c (revision 35622) @@ -31,8 +31,9 @@ const char *route_req = "freert.dsn", *route_res = "freert.ses"; rnd_hidlib_t *hl = &pcb->hidlib; char *cmd; - int n, r, sargc, rv = 1, mp = 12; + int n, r, sargc, rv = 1, mp = 12, debug; fgw_arg_t sres = {0}, *sargv; + const char *exe, *installation; sargc = argc + 3; sargv = calloc(sizeof(fgw_arg_t), sargc); @@ -45,11 +46,19 @@ sargv[n+3].type &= ~FGW_DYN; } + exe = conf_ar_extern.plugins.ar_extern.freerouting_cli.exe; + installation = conf_ar_extern.plugins.ar_extern.freerouting_cli.installation; + debug = conf_ar_extern.plugins.ar_extern.freerouting_cli.debug; + /* export */ TODO("call the exporter"); /* run the router */ - cmd = rnd_strdup_printf("%s -cli -de '%s' -do '%s' -mp %d", conf_ar_extern.plugins.ar_extern.freerouting_cli.exe, route_req, route_res, mp); + if ((installation != NULL) && (*installation != '\0')) + cmd = rnd_strdup_printf("cd \"%s\"; %s -cli -de '%s' -do '%s' -mp %d", installation, exe, route_req, route_res, mp); + else + cmd = rnd_strdup_printf("%s -cli -de '%s' -do '%s' -mp %d", exe, route_req, route_res, mp); + r = rnd_system(hl, cmd); if (r != 0) { rnd_message(RND_MSG_ERROR, "freerouting.cli: failed to execute the router: '%s'\n", cmd); @@ -68,7 +77,7 @@ rv = 0; /* success! */ exit:; - if (!conf_ar_extern.plugins.ar_extern.freerouting_cli.debug) { + if (!debug) { rnd_unlink(hl, route_req); rnd_unlink(hl, route_res); }