diff options
author | Waldemar Brodkorb <wbx@openadk.org> | 2014-06-16 18:00:57 +0200 |
---|---|---|
committer | Waldemar Brodkorb <wbx@openadk.org> | 2014-06-16 18:02:33 +0200 |
commit | 3d31baf4a109a7a7b2626449e8327286963c15cd (patch) | |
tree | bf486bd4a18cee45c5ef2de1aff1973e19bb989b /adk/tools | |
parent | 0f1ef5c7850016d526422ab3bb1368e5d30d0cbe (diff) |
add support for libc dependent dependencies
Diffstat (limited to 'adk/tools')
-rw-r--r-- | adk/tools/depmaker.c | 36 | ||||
-rw-r--r-- | adk/tools/pkgmaker.c | 15 |
2 files changed, 37 insertions, 14 deletions
diff --git a/adk/tools/depmaker.c b/adk/tools/depmaker.c index 9682fb969..af26a63b5 100644 --- a/adk/tools/depmaker.c +++ b/adk/tools/depmaker.c @@ -84,20 +84,26 @@ static char *parse_line(char *package, char *pkgvar, char *string, int checksym, perror("Can not allocate memory."); exit(EXIT_FAILURE); } - if (system == 0) { - if (pprefix == 0) { - if (snprintf(key_sym, MAXLINE, "ADK_PACKAGE_%s_", pkgvar) < 0) + switch(system) { + case 0: + if (pprefix == 0) { + if (snprintf(key_sym, MAXLINE, "ADK_PACKAGE_%s_", pkgvar) < 0) + perror("Can not create string variable."); + } else { + if (snprintf(key_sym, MAXLINE, "ADK_PACKAGE_") < 0) + perror("Can not create string variable."); + } + strncat(key_sym, key+6, strlen(key)-6); + break; + case 1: + if (snprintf(key_sym, MAXLINE, "ADK_TARGET_SYSTEM_%s", pkgvar) < 0) perror("Can not create string variable."); - } else { - if (snprintf(key_sym, MAXLINE, "ADK_PACKAGE_") < 0) - perror("Can not create string variable."); - } - strncat(key_sym, key+6, strlen(key)-6); - } else { - if (snprintf(key_sym, MAXLINE, "ADK_TARGET_SYSTEM_%s", pkgvar) < 0) + break; + case 2: + if (snprintf(key_sym, MAXLINE, "ADK_TARGET_LIB_%s", pkgvar) < 0) perror("Can not create string variable."); + break; } - if (check_symbol(key_sym) != 0) { free(key_sym); return(NULL); @@ -213,7 +219,7 @@ int main() { strncat(pkgdeps, tmp, strlen(tmp)); } - // We need to find the system name here + // We need to find the system or libc name here string = strstr(buf, "PKG_BUILDDEP_"); if (string != NULL) { check = strstr(buf, ":="); @@ -222,7 +228,11 @@ int main() { string[strlen(string)-1] = '\0'; key = strtok(string, ":="); dpkg = strdup(key+13); - tmp = parse_line(pkgdirp->d_name, dpkg, stringtmp, 1, 0, 1, &prefix); + if (strncmp("UCLIBC", dpkg, 6) == 0) { + tmp = parse_line(pkgdirp->d_name, dpkg, stringtmp, 1, 0, 2, &prefix); + } else { + tmp = parse_line(pkgdirp->d_name, dpkg, stringtmp, 1, 0, 1, &prefix); + } if (tmp != NULL) strncat(pkgdeps, tmp, strlen(tmp)); } diff --git a/adk/tools/pkgmaker.c b/adk/tools/pkgmaker.c index 1e87536d5..02e561aa0 100644 --- a/adk/tools/pkgmaker.c +++ b/adk/tools/pkgmaker.c @@ -327,7 +327,7 @@ int main() { char dir[MAXPATH]; char variable[2*MAXVAR]; char *key, *value, *token, *cftoken, *sp, *hkey, *val, *pkg_fd; - char *pkg_name, *pkg_depends, *pkg_depends_system, *pkg_section, *pkg_descr, *pkg_url; + char *pkg_name, *pkg_depends, *pkg_depends_system, *pkg_depends_libc, *pkg_section, *pkg_descr, *pkg_url; char *pkg_cxx, *pkg_subpkgs, *pkg_cfline, *pkg_dflt; char *pkgname, *sysname, *pkg_debug, *pkg_bb; char *pkg_libc_depends, *pkg_host_depends, *pkg_system_depends, *pkg_arch_depends, *pkg_flavours, *pkg_flavours_string, *pkg_choices, *pseudo_name; @@ -343,6 +343,7 @@ int main() { pkg_url = NULL; pkg_depends = NULL; pkg_depends_system = NULL; + pkg_depends_libc = NULL; pkg_opts = NULL; pkg_libname = NULL; pkg_flavours = NULL; @@ -567,6 +568,8 @@ int main() { continue; if ((parse_var_with_system(buf, "PKG_DEPENDS_", pkg_depends_system, &pkg_depends_system, &sysname, 12)) == 0) continue; + if ((parse_var_with_system(buf, "PKG_DEPENDS_", pkg_depends_libc, &pkg_depends_libc, &sysname, 12)) == 0) + continue; if ((parse_var(buf, "PKG_LIBNAME", pkg_libname, &pkg_libname)) == 0) continue; if ((parse_var(buf, "PKG_OPTS", pkg_opts, &pkg_opts)) == 0) @@ -897,6 +900,16 @@ int main() { free(pkg_depends_system); pkg_depends_system = NULL; } + /* create libc specific package dependency information */ + if (pkg_depends_libc != NULL) { + token = strtok(pkg_depends_libc, " "); + while (token != NULL) { + fprintf(cfg, "\tselect ADK_PACKAGE_%s if ADK_TARGET_LIB_%s\n", toupperstr(token), sysname); + token = strtok(NULL, " "); + } + free(pkg_depends_libc); + pkg_depends_libc = NULL; + } if (pkg_bb != NULL) { fprintf(cfg, "\tdepends on !ADK_PACKAGE_BUSYBOX_HIDE\n"); |