Commit d9a6488d authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Make it possible to do

	import vmod from "/some/dir/"

and have the default vmod shlib filename appended.
parent 6564a0cf
...@@ -23,3 +23,11 @@ varnish v1 -cliok "param.set vmod_dir /nowhere:${topbuild}/lib/libvmod_std/.libs ...@@ -23,3 +23,11 @@ varnish v1 -cliok "param.set vmod_dir /nowhere:${topbuild}/lib/libvmod_std/.libs
varnish v1 -vcl+backend { varnish v1 -vcl+backend {
import std; import std;
} }
varnish v1 -cliok "param.set vcc_unsafe_path on"
varnish v1 -cliok "param.set vmod_dir /nowhere:/else"
varnish v1 -vcl+backend {
import std from "${topbuild}/lib/libvmod_std/.libs/";
}
...@@ -67,7 +67,7 @@ varnish v1 -errvcl {Found: 'zool' at} { ...@@ -67,7 +67,7 @@ varnish v1 -errvcl {Found: 'zool' at} {
shell "rm -f ${tmpdir}/a" shell "rm -f ${tmpdir}/a"
shell "rm -f ${tmpdir}/_start.vcl" shell "rm -f ${tmpdir}/_start.vcl"
varnish v1 -errvcl {only works in nested VCL include files} { varnish v1 -errvcl {needs absolute filename of including file.} {
include "./foobar"; include "./foobar";
} }
...@@ -511,8 +511,8 @@ vcc_resolve_includes(struct vcc *tl) ...@@ -511,8 +511,8 @@ vcc_resolve_includes(struct vcc *tl)
*/ */
if (t1->src->name[0] != '/') { if (t1->src->name[0] != '/') {
VSB_printf(tl->sb, VSB_printf(tl->sb,
"include \"./xxxxx\"; only works in " "include \"./xxxxx\"; needs absolute "
"nested VCL include files\n"); "filename of including file.\n");
vcc_ErrWhere(tl, t1); vcc_ErrWhere(tl, t1);
return; return;
} }
...@@ -784,14 +784,14 @@ VCC_Compile(const struct vcp *vcp, struct vsb *sb, ...@@ -784,14 +784,14 @@ VCC_Compile(const struct vcp *vcp, struct vsb *sb,
{ {
struct source *sp; struct source *sp;
char *r; char *r;
CHECK_OBJ_NOTNULL(vcp, VCP_MAGIC);
AN(sb);
AN(vclsrcfile);
if (vclsrc != NULL) { if (vclsrc != NULL)
AZ(vclsrcfile); sp = vcc_new_source(vclsrc, NULL, vclsrcfile);
sp = vcc_new_source(vclsrc, NULL, "<input>"); else
} else {
AN(vclsrcfile);
sp = vcc_file_source(vcp, sb, vclsrcfile); sp = vcc_file_source(vcp, sb, vclsrcfile);
}
if (sp == NULL) if (sp == NULL)
return (NULL); return (NULL);
r = vcc_CompileSource(vcp, sb, sp); r = vcc_CompileSource(vcp, sb, sp);
......
...@@ -117,7 +117,11 @@ vcc_ParseImport(struct vcc *tl) ...@@ -117,7 +117,11 @@ vcc_ParseImport(struct vcc *tl)
return; return;
} }
ExpectErr(tl, CSTR); ExpectErr(tl, CSTR);
bprintf(fn, "%s", tl->t->dec); p = strrchr(tl->t->dec, '/');
if (p != NULL && p[1] == '\0')
bprintf(fn, "%slibvmod_%.*s.so", tl->t->dec, PF(mod));
else
bprintf(fn, "%s", tl->t->dec);
vcc_NextToken(tl); vcc_NextToken(tl);
} else { } else {
bprintf(fn, "libvmod_%.*s.so", PF(mod)); bprintf(fn, "libvmod_%.*s.so", PF(mod));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment