diff options
Diffstat (limited to 'tools/adk/pkgmaker.c')
-rw-r--r-- | tools/adk/pkgmaker.c | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/tools/adk/pkgmaker.c b/tools/adk/pkgmaker.c index eeba00304..dd4b90f46 100644 --- a/tools/adk/pkgmaker.c +++ b/tools/adk/pkgmaker.c @@ -37,10 +37,11 @@ static int nobinpkgs; -static void fatal_error(const char *message) { - - fprintf(stderr, "Fatal error. %s\n", message); - exit(1); +#define fatal_error(...) { \ + fprintf(stderr, "Fatal error. "); \ + fprintf(stderr, __VA_ARGS__); \ + fprintf(stderr, "\n"); \ + exit(1); \ } static int parse_var_hash(char *buf, const char *varname, StrMap *strmap) { @@ -304,7 +305,8 @@ int main() { fclose(section); } } else - fatal_error("Can not find section description for package."); + fatal_error("Can not find section description for package %s.", + pkgdirp->d_name); fclose(pkg); continue; @@ -501,15 +503,19 @@ int main() { fclose(section); } } else - fatal_error("Can not find section description for package"); + fatal_error("Can not find section description for package %s.", pkgdirp->d_name); unlink(path); cfg = fopen(path, "w"); if (cfg == NULL) perror("Can not open Config.in file"); + if (pkg_need_cxx != NULL) { + fprintf(cfg, "comment \"%s... %s (disabled, c++ missing)\"\n", token, pkg_descr); + fprintf(cfg, "depends on !ADK_TOOLCHAIN_GCC_CXX\n\n"); + } fprintf(cfg, "config ADK_PACKAGE_%s\n", toupperstr(token)); - fprintf(cfg, "\tprompt \"%s... %s\"\n", pseudo_name, pkg_descr); + fprintf(cfg, "\tprompt \"%s. %s\"\n", pseudo_name, pkg_descr); fprintf(cfg, "\ttristate\n"); if (pkg_multi != NULL) if (strncmp(pkg_multi, "1", 1) == 0) @@ -592,10 +598,11 @@ int main() { } if (pkg_need_cxx != NULL) { - fprintf(cfg, "\tdepends on ADK_TOOLCHAIN_GCC_CXX"); + fprintf(cfg, "\tdepends on ADK_TOOLCHAIN_GCC_CXX\n"); } if (pkg_need_java != NULL) { - fprintf(cfg, "\tdepends on ADK_TOOLCHAIN_GCC_JAVA"); + fprintf(cfg, "\tdepends on ADK_TOOLCHAIN_GCC_JAVA\n"); + pkg_need_java = NULL; } fprintf(cfg, "\tselect ADK_COMPILE_%s\n", toupperstr(pkgdirp->d_name)); @@ -712,6 +719,8 @@ int main() { free(packages); packages = NULL; + pkg_need_cxx = NULL; + pkg_need_java = NULL; /* reset flags, free memory */ free(pkg_name); free(pkg_descr); @@ -724,8 +733,6 @@ int main() { free(pkg_arch_depends); free(pkg_host_depends); free(pkg_cxx); - free(pkg_need_cxx); - free(pkg_need_java); free(pkg_dflt); free(pkg_cfline); free(pkg_multi); |