diff options
author | Phil Sutter <phil@nwl.cc> | 2009-08-02 13:31:02 +0200 |
---|---|---|
committer | Phil Sutter <phil@nwl.cc> | 2009-08-02 15:46:19 +0200 |
commit | 3a85fc1dd1b1b56049f8ab3ee1773da2d37bf72d (patch) | |
tree | 761b15b65c46d92bdef7ee2f463556699fd4e34d /config/kconfig_load.c | |
parent | f03bc8974965da8f30d81412014a49b6c161a58a (diff) |
take over linux-2.6 mconf at state 2.6.31-rc5
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 +} |