From 233b75f916c1fdece62bec8a75e7de66afebbe02 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Fri, 5 Aug 2011 20:11:43 +0200 Subject: add support for target system depends for packages --- tools/adk/pkgmaker.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/adk/pkgmaker.c b/tools/adk/pkgmaker.c index 7b79bfb72..77bc0d648 100644 --- a/tools/adk/pkgmaker.c +++ b/tools/adk/pkgmaker.c @@ -271,7 +271,7 @@ int main() { char *pkg_name, *pkg_depends, *pkg_section, *pkg_descr, *pkg_url; char *pkg_cxx, *pkg_subpkgs, *pkg_cfline, *pkg_dflt, *pkg_multi; char *pkg_need_cxx, *pkg_need_java, *pkgname; - char *pkg_host_depends, *pkg_arch_depends, *pkg_flavours, *pkg_flavours_string, *pkg_choices, *pseudo_name; + char *pkg_host_depends, *pkg_system_depends, *pkg_arch_depends, *pkg_flavours, *pkg_flavours_string, *pkg_choices, *pseudo_name; char *packages, *pkg_name_u, *pkgs; char *saveptr, *p_ptr, *s_ptr; int result; @@ -287,6 +287,7 @@ int main() { pkg_choices = NULL; pkg_subpkgs = NULL; pkg_arch_depends = NULL; + pkg_system_depends = NULL; pkg_host_depends = NULL; pkg_cxx = NULL; pkg_dflt = NULL; @@ -397,6 +398,8 @@ int main() { continue; if ((parse_var(buf, "PKG_ARCH_DEPENDS", NULL, &pkg_arch_depends)) == 0) continue; + if ((parse_var(buf, "PKG_SYSTEM_DEPENDS", NULL, &pkg_system_depends)) == 0) + continue; if ((parse_var(buf, "PKG_DESCR", NULL, &pkg_descr)) == 0) continue; if ((parse_var(buf, "PKG_SECTION", NULL, &pkg_section)) == 0) @@ -609,6 +612,23 @@ int main() { } memset(hkey, 0, MAXVAR); + /* create package target system dependency information */ + if (pkg_system_depends != NULL) { + token = strtok(pkg_system_depends, " "); + fprintf(cfg, "\tdepends on "); + sp = ""; + while (token != NULL) { + if(strncmp(token, "!", 1) == 0) { + fprintf(cfg, "%s!ADK_TARGET_SYSTEM%s", sp, toupperstr(token)); + sp = " && "; + } else { + fprintf(cfg, "%sADK_TARGET_SYSTEM_%s", sp, toupperstr(token)); + sp = " || "; + } + token = strtok(NULL, " "); + } + fprintf(cfg, "\n"); + } /* create package host dependency information */ if (pkg_host_depends != NULL) { token = strtok(pkg_host_depends, " "); @@ -880,6 +900,7 @@ int main() { free(pkg_choices); free(pkg_subpkgs); free(pkg_arch_depends); + free(pkg_system_depends); free(pkg_host_depends); free(pkg_cxx); free(pkg_dflt); @@ -895,6 +916,7 @@ int main() { pkg_choices = NULL; pkg_subpkgs = NULL; pkg_arch_depends = NULL; + pkg_system_depends = NULL; pkg_host_depends = NULL; pkg_cxx = NULL; pkg_dflt = NULL; -- cgit v1.2.3