From 23251c0c6ee9f7c0d3c4b20a5db9f51b4a0cc361 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Thu, 30 Dec 2010 23:12:32 +0100 Subject: fix some bugs, when starting with fresh checkout --- .gitignore | 1 + Makefile | 1 + mk/build.mk | 6 +++--- scripts/create-pkg | 10 ++++++++++ scripts/create-sys | 3 ++- target/config/Config.in.system | 13 ------------- tools/adk/pkgmaker.c | 43 +++--------------------------------------- tools/adk/pkgrebuild.c | 2 ++ 8 files changed, 22 insertions(+), 57 deletions(-) create mode 100755 scripts/create-pkg delete mode 100644 target/config/Config.in.system diff --git a/.gitignore b/.gitignore index 70ec48aff..6aed8ed9e 100644 --- a/.gitignore +++ b/.gitignore @@ -49,3 +49,4 @@ target/*/sys-enabled target/packages/pkg-enabled target/packages/Config.in target/config/Config.in.system.default +target/config/Config.in.system diff --git a/Makefile b/Makefile index dda4236f6..d2dbfdbb9 100644 --- a/Makefile +++ b/Makefile @@ -222,6 +222,7 @@ NO_ERROR=0 bash scripts/scan-tools.sh @echo '===> Prerequisites checked successfully.' @bash scripts/create-sys + @bash scripts/create-pkg @touch .adkinit @touch $@ diff --git a/mk/build.mk b/mk/build.mk index 4c563a38c..4bc23cc32 100644 --- a/mk/build.mk +++ b/mk/build.mk @@ -539,15 +539,15 @@ bulkallmod: ${TOPDIR}/bin/tools/pkgmaker: @mkdir -p $(TOPDIR)/bin/tools - @$(HOSTCC) -g -o $@ tools/adk/pkgmaker.c tools/adk/sortfile.c tools/adk/strmap.c + @$(HOSTCC) -Wall -g -o $@ tools/adk/pkgmaker.c tools/adk/sortfile.c tools/adk/strmap.c ${TOPDIR}/bin/tools/pkgrebuild: @mkdir -p $(TOPDIR)/bin/tools - @$(HOSTCC) -g -o $@ tools/adk/pkgrebuild.c tools/adk/strmap.c + @$(HOSTCC) -Wall -g -o $@ tools/adk/pkgrebuild.c tools/adk/strmap.c package/Config.in.auto menu .menu: $(wildcard ${TOPDIR}/package/*/Makefile) ${TOPDIR}/bin/tools/pkgmaker ${TOPDIR}/bin/tools/pkgrebuild @echo "Generating menu structure ..." - @$(TOPDIR)/bin/tools/pkgmaker + $(TOPDIR)/bin/tools/pkgmaker @:>.menu $(TOPDIR)/bin/tools: diff --git a/scripts/create-pkg b/scripts/create-pkg new file mode 100755 index 000000000..b9b47ae2a --- /dev/null +++ b/scripts/create-pkg @@ -0,0 +1,10 @@ +#!/usr/bin/env bash +topdir=$(readlink -nf $(dirname $0)/.. 2>/dev/null || (cd $(dirname $0)/..; pwd -P)) + +mkdir -p $topdir/target/packages/pkg-enabled +count=1 +for i in $(ls $topdir/target/packages/pkg-available/);do + cd $topdir/target/packages/pkg-enabled && + ln -sf ../pkg-available/$i $count-$i + count=$((count+1)) +done diff --git a/scripts/create-sys b/scripts/create-sys index 7af098868..bf92870a1 100755 --- a/scripts/create-sys +++ b/scripts/create-sys @@ -4,7 +4,8 @@ systems=$(grep -h config target/*/sys-available/*|cut -d " " -f 2) while read arch; do count=1 - cd $topdir/target/$arch/sys-enabled/ && + mkdir -p $topdir/target/$arch/sys-enabled && + cd $topdir/target/$arch/sys-enabled && ln -sf ../sys-available/toolchain 0-toolchain for i in $(ls $topdir/target/$arch/sys-available/|grep -v toolchain);do cd $topdir/target/$arch/sys-enabled/ && diff --git a/target/config/Config.in.system b/target/config/Config.in.system deleted file mode 100644 index 7fa27a44b..000000000 --- a/target/config/Config.in.system +++ /dev/null @@ -1,13 +0,0 @@ -source "target/config/Config.in.system.default" -comment "Architecture: arm" -comment "System: toolchain" - -config ADK_TARGET_SYSTEM_TOOLCHAIN_ARM - boolean - select ADK_LINUX_ARM - select ADK_arm - select ADK_toolchain - select ADK_TOOLCHAIN_ONLY - select ADK_EABI - select ADK_TARGET_NO_FPU - default y diff --git a/tools/adk/pkgmaker.c b/tools/adk/pkgmaker.c index d59515a8d..abcfbfc20 100644 --- a/tools/adk/pkgmaker.c +++ b/tools/adk/pkgmaker.c @@ -171,29 +171,6 @@ static void iter(const char *key, const char *value, const void *obj) { fclose(config); } -static char *print_target_depline(char *value, int neg, char *sp, FILE *cfg) { - - char *val; - char *np; - char *sptr; - - sptr = NULL; - np = ""; - val = strdup(value); - /* strtok_r is required here */ - val = strtok_r(val, " ", &sptr); - while (val != NULL) { - if (neg == 1) np = "!"; - fprintf(cfg, "%s%s%s", sp, np, val); - val = strtok_r(NULL, " ", &sptr); - if (neg == 1) - sp = " && "; - else - sp = " || "; - } - return(val); -} - static char *tolowerstr(char *string) { int i; @@ -234,7 +211,7 @@ int main() { DIR *pkgdir, *pkglistdir; struct dirent *pkgdirp; - FILE *pkg, *cfg, *target, *menuglobal, *section; + FILE *pkg, *cfg, *menuglobal, *section; char hvalue[MAXVALUE]; char buf[MAXPATH]; char tbuf[MAXPATH]; @@ -248,8 +225,8 @@ int main() { char *pkg_host_depends, *pkg_arch_depends, *pkg_flavours, *pkg_choices, *pseudo_name; char *packages, *pkg_name_u, *pkgs; char *saveptr, *p_ptr, *s_ptr; - int result, neg; - StrMap *pkgmap, *targetmap, *sectionmap; + int result; + StrMap *pkgmap, *sectionmap; pkg_name = NULL; pkg_descr = NULL; @@ -288,19 +265,6 @@ int main() { } fclose(section); - /* read target list and create a hash table */ - //target = fopen("target/target.lst", "r"); - //if (target == NULL) - // fatal_error("target listfile is missing."); - - //targetmap = strmap_new(HASHSZ); - //while (fgets(tbuf, MAXPATH, target) != NULL) { - // key = strtok(tbuf, "\t"); - // value = strtok(NULL, "\t"); - // strmap_put(targetmap, key, value); - //} - //fclose(target); - if (mkdir("package/pkgconfigs.d", S_IRWXU) > 0) fatal_error("creation of package/pkgconfigs.d failed."); if (mkdir("package/pkglist.d", S_IRWXU) > 0) @@ -774,7 +738,6 @@ int main() { /* create Config.in.auto */ strmap_enum(sectionmap, iter, NULL); - strmap_delete(targetmap); strmap_delete(sectionmap); fclose(menuglobal); closedir(pkgdir); diff --git a/tools/adk/pkgrebuild.c b/tools/adk/pkgrebuild.c index 314025582..e6497b8c7 100644 --- a/tools/adk/pkgrebuild.c +++ b/tools/adk/pkgrebuild.c @@ -31,9 +31,11 @@ StrMap *configmap, *configoldmap, *pkgmap; +/* static void iter(const char *key, const char *value, const void *obj) { fprintf(stderr, "key: %s value: %s\n", key, value); } +*/ static void iter_disabled(const char *key, const char *value, const void *obj) { -- cgit v1.2.3