From 56da3859c770b83631ebae810dfb3024c1a9cbd2 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Wed, 31 Aug 2011 23:35:05 +0200 Subject: support: move kconfig stuff from package/config to support/kconfig Signed-off-by: Thomas Petazzoni Signed-off-by: Peter Korsgaard --- support/kconfig/kconfig_load.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 support/kconfig/kconfig_load.c (limited to 'support/kconfig/kconfig_load.c') diff --git a/support/kconfig/kconfig_load.c b/support/kconfig/kconfig_load.c new file mode 100644 index 000000000..dbdcaad82 --- /dev/null +++ b/support/kconfig/kconfig_load.c @@ -0,0 +1,35 @@ +#include +#include +#include + +#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 +} -- cgit v1.2.3-55-g7522