Commit ffc288fb authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

compel: piegen -- Add @uapi-dir option

We will need it to include types once compel
gets into own directory.
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent 3da3d818
......@@ -158,7 +158,7 @@ int handle_elf(void *mem, size_t size)
}
pr_out("/* Autogenerated from %s */\n", opts.input_filename);
pr_out("#include \"piegen/uapi/types.h\"\n");
pr_out("#include \"%s/types.h\"\n", opts.uapi_dir);
for (i = 0; i < symtab_hdr->sh_size / symtab_hdr->sh_entsize; i++) {
Sym_t *sym = &symbols[i];
......
......@@ -19,6 +19,7 @@
piegen_opt_t opts = {
.input_filename = NULL,
.uapi_dir = "piegen/uapi",
.stream_name = "stream",
.prefix_name = "__",
.var_name = "elf_relocs",
......@@ -75,11 +76,12 @@ int main(int argc, char *argv[])
void *mem;
int fd;
static const char short_opts[] = "f:o:s:p:v:r:h";
static const char short_opts[] = "f:o:s:p:v:r:u:h";
static struct option long_opts[] = {
{ "file", required_argument, 0, 'f' },
{ "output", required_argument, 0, 'o' },
{ "stream", required_argument, 0, 's' },
{ "uapi-dir", required_argument, 0, 'u' },
{ "sym-prefix", required_argument, 0, 'p' },
{ "variable", required_argument, 0, 'v' },
{ "pcrelocs", required_argument, 0, 'r' },
......@@ -102,6 +104,9 @@ int main(int argc, char *argv[])
case 'o':
opts.output_filename = optarg;
break;
case 'u':
opts.uapi_dir = optarg;
break;
case 's':
opts.stream_name = optarg;
break;
......
......@@ -7,6 +7,7 @@
typedef struct {
char *input_filename;
char *output_filename;
char *uapi_dir;
char *stream_name;
char *prefix_name;
char *var_name;
......
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