diff options
author | Waldemar Brodkorb <wbx@openadk.org> | 2009-08-09 14:24:08 +0200 |
---|---|---|
committer | Waldemar Brodkorb <wbx@openadk.org> | 2009-08-09 14:24:08 +0200 |
commit | aa36ba1bfedbec0a5a8682dd862697eb4c090a13 (patch) | |
tree | 2e178bb008ea0076185a841cc35cb6ceffe7a4fa /config/kconfig_load.c | |
parent | 1c47490f586071528b387edc46e531c88bd77dc7 (diff) | |
parent | cda64efca568ec61c064b44f494f58f7a08bd4e7 (diff) |
Merge branch 'master' of git+ssh://openadk.org/git/openadk
Diffstat (limited to 'config/kconfig_load.c')
-rw-r--r-- | config/kconfig_load.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/config/kconfig_load.c b/config/kconfig_load.c new file mode 100644 index 000000000..dbdcaad82 --- /dev/null +++ b/config/kconfig_load.c @@ -0,0 +1,35 @@ +#include <dlfcn.h> +#include <stdio.h> +#include <stdlib.h> + +#include "lkc.h" + +#define P(name,type,arg) type (*name ## _p) arg +#include "lkc_proto.h" +#undef P + +void kconfig_load(void) +{ + void *handle; + char *error; + + handle = dlopen("./libkconfig.so", RTLD_LAZY); + if (!handle) { + handle = dlopen("./scripts/kconfig/libkconfig.so", RTLD_LAZY); + if (!handle) { + fprintf(stderr, "%s\n", dlerror()); + exit(1); + } + } + +#define P(name,type,arg) \ +{ \ + name ## _p = dlsym(handle, #name); \ + if ((error = dlerror())) { \ + fprintf(stderr, "%s\n", error); \ + exit(1); \ + } \ +} +#include "lkc_proto.h" +#undef P +} |