diff options
-rw-r--r-- | mk/host-bottom.mk | 11 | ||||
-rw-r--r-- | mk/host.mk | 11 | ||||
-rw-r--r-- | mk/package.mk | 2 | ||||
-rw-r--r-- | package/bison/Makefile | 1 | ||||
-rw-r--r-- | package/ncurses/Makefile | 6 | ||||
-rw-r--r-- | package/scons/Makefile | 2 | ||||
-rw-r--r-- | rules.mk | 1 | ||||
-rw-r--r-- | target/arm/sys-available/cubox-i | 1 | ||||
-rw-r--r-- | target/arm/sys-available/qemu-arm | 1 | ||||
-rw-r--r-- | target/arm/sys-available/qemu-armhf | 1 | ||||
-rw-r--r-- | target/arm/sys-available/raspberry-pi | 1 | ||||
-rw-r--r-- | target/arm/sys-available/toolchain-arm | 1 | ||||
-rw-r--r-- | target/arm/sys-available/toolchain-armhf | 1 | ||||
-rw-r--r-- | target/config/Config.in | 11 | ||||
-rw-r--r-- | toolchain/gcc/Makefile | 28 | ||||
-rw-r--r-- | toolchain/glibc/Makefile | 7 | ||||
-rw-r--r-- | toolchain/musl/Makefile | 5 | ||||
-rw-r--r-- | toolchain/uClibc/Makefile | 5 | ||||
-rw-r--r-- | tools/adk/depmaker.c | 37 |
19 files changed, 84 insertions, 49 deletions
diff --git a/mk/host-bottom.mk b/mk/host-bottom.mk index 23d5652ba..43a622c0f 100644 --- a/mk/host-bottom.mk +++ b/mk/host-bottom.mk @@ -79,6 +79,7 @@ hpkg-install: ${ALL_HOSTINST} host-install: ${_HOST_FAKE_COOKIE}: ${_HOST_BUILD_COOKIE} @$(CMD_TRACE) "host installing... " + @mkdir -p ${HOST_WRKINST} ifneq (${HOST_STYLE},manual) ifeq ($(strip ${HOST_STYLE}),) cd ${WRKBUILD} && env ${HOST_MAKE_ENV} ${MAKE} -f ${MAKE_FILE} \ @@ -92,12 +93,6 @@ else env ${HOST_MAKE_ENV} ${MAKE} hpkg-install $(MAKE_TRACE) endif env ${HOST_MAKE_ENV} ${MAKE} hostpost-install $(MAKE_TRACE) - rm -rf ${WRKBUILD} ${WRKDIST} ${WRKSRC} - exec ${MAKE} host-extract $(MAKE_TRACE) - mkdir -p ${HOST_WRKINST} - # avoid rebuild - @touch ${_HOST_CONFIGURE_COOKIE} - @touch ${_HOST_BUILD_COOKIE} @touch $@ ${_HOST_COOKIE}: @@ -107,3 +102,7 @@ ifeq ($(HOST_LINUX_ONLY),) hostpackage: ${ALL_HOSTDIRS} @touch ${_HOST_COOKIE} endif + +hostclean: + @$(CMD_TRACE) "cleaning... " + rm -rf ${WRKDIR} ${STAGING_PKG_DIR}/stamps/${PKG_NAME}*-host diff --git a/mk/host.mk b/mk/host.mk index aa88bab44..5f9539aef 100644 --- a/mk/host.mk +++ b/mk/host.mk @@ -1,6 +1,11 @@ # This file is part of the OpenADK project. OpenADK is copyrighted # material, please see the LICENCE file in the top-level directory. +# This is where all package operation is done in +ifneq (,$(findstring host,$(MAKECMDGOALS))) +WRKDIR?= ${WRKDIR_BASE}/w-${PKG_NAME}-${PKG_VERSION}-${PKG_RELEASE}-host +endif + HOST_CONFIGURE_ENV+= AUTOM4TE=${STAGING_HOST_DIR}/usr/bin/autom4te \ CONFIG_SHELL='$(strip ${SHELL})' \ PKG_CONFIG_LIBDIR='${STAGING_HOST_DIR}/usr/lib/pkgconfig' \ @@ -30,7 +35,7 @@ HOST_MAKE_ENV+= PATH='${HOST_PATH}' \ HOST_MAKE_FLAGS+= ${HOST_XAKE_FLAGS} V=1 HOST_FAKE_FLAGS+= ${HOST_XAKE_FLAGS} -HOST_WRKINST= ${WRKDIR}/host +HOST_WRKINST= ${WRKDIR}/fake _HOST_EXTRACT_COOKIE= ${WRKDIST}/.extract_done _HOST_PATCH_COOKIE= ${WRKDIST}/.prepared @@ -54,7 +59,7 @@ hostfake: ${_HOST_FAKE_COOKIE} define HOST_template ALL_PKGOPTS+= $(1) PKGNAME_$(1)= $(2) -HOSTDIR_$(1)= $(WRKDIR)/host +HOSTDIR_$(1)= $(WRKDIR)/fake ALL_HOSTDIRS+= $${HOSTDIR_$(1)} ALL_HOSTINST+= $(2)-hostinstall @@ -63,4 +68,4 @@ $$(HOSTDIR_$(1)): ${_HOST_PATCH_COOKIE} ${_HOST_FAKE_COOKIE} endef .PHONY: all hostextract hostpatch hostconfigure \ - hostbuild hostpackage hostfake + hostbuild hostpackage hostfake hostclean diff --git a/mk/package.mk b/mk/package.mk index a70de9377..ed94e3539 100644 --- a/mk/package.mk +++ b/mk/package.mk @@ -314,7 +314,7 @@ clean-targets: clean: @$(CMD_TRACE) "cleaning... " @$(MAKE) clean-targets $(MAKE_TRACE) - rm -rf ${WRKDIR} ${ALL_IPKGS} ${STAGING_PKG_DIR}/stamps/${PKG_NAME}* + rm -rf ${WRKDIR} ${ALL_IPKGS} ${STAGING_PKG_DIR}/stamps/${PKG_NAME}${PKG_VERSION} distclean: clean rm -f ${FULLDISTFILES} diff --git a/package/bison/Makefile b/package/bison/Makefile index ee268b641..02c3ca31f 100644 --- a/package/bison/Makefile +++ b/package/bison/Makefile @@ -10,6 +10,7 @@ PKG_MD5SUM:= 032a7b7b9f1a6e278ccde73f82cec5c2 PKG_DESCR:= GNU parser generator PKG_SECTION:= lang PKG_BUILDDEP:= m4-host flex-host bison-host +HOST_BUILDDEP:= m4-host flex-host PKG_URL:= http://www.gnu.org/software/bison/ PKG_SITES:= ${MASTER_SITE_GNU:=${PKG_NAME}/} diff --git a/package/ncurses/Makefile b/package/ncurses/Makefile index 779ebfbdd..6b193dc12 100644 --- a/package/ncurses/Makefile +++ b/package/ncurses/Makefile @@ -5,7 +5,7 @@ include ${TOPDIR}/rules.mk PKG_NAME:= ncurses PKG_VERSION:= 5.9 -PKG_RELEASE:= 4 +PKG_RELEASE:= 5 PKG_MD5SUM:= 8cb9c412e5f2d96bc6f459aa8c6282a1 PKG_DESCR:= a terminal handling library PKG_SECTION:= libs @@ -50,6 +50,7 @@ CONFIGURE_ARGS+= --without-cxx \ ALL_TARGET:= libs INSTALL_TARGET:= install.libs install.data +HOST_STYLE:= auto # use sth which does not exist HOST_ALL_TARGET:= progs HOST_INSTALL_TARGET:= install.includes install.progs @@ -69,9 +70,6 @@ HOST_CONFIGURE_ARGS+= --without-shared \ --without-debug \ --without-profile -libncurses-hostinstall: - ${CP} ${HOST_WRKINST}/usr/bin/* ${STAGING_HOST_DIR}/usr/bin - libncurses-install: rm -rf ${WRKINST}/usr/lib/terminfo # this is installed as libncurses - make libcurses a "link" diff --git a/package/scons/Makefile b/package/scons/Makefile index 9e92c9917..d379eb8a4 100644 --- a/package/scons/Makefile +++ b/package/scons/Makefile @@ -9,7 +9,7 @@ PKG_RELEASE:= 1 PKG_MD5SUM:= 083ce5624d6adcbdaf2526623f456ca9 PKG_DESCR:= a software construction tool PKG_SECTION:= lang -PKG_BUILDDEP:= bzip2-host python2-host +HOST_BUILDDEP:= bzip2-host python2-host PKG_URL:= http://www.scons.org PKG_SITES:= ${MASTER_SITE_SOURCEFORGE:=scons/} @@ -32,6 +32,7 @@ ADK_TARGET_LIBC:= $(strip $(subst ",, $(ADK_TARGET_LIBC))) ADK_TARGET_LIBC_PATH:= $(strip $(subst ",, $(ADK_TARGET_LIBC_PATH))) ADK_TARGET_ENDIAN:= $(strip $(subst ",, $(ADK_TARGET_ENDIAN))) ADK_TARGET_FLOAT:= $(strip $(subst ",, $(ADK_TARGET_FLOAT))) +ADK_TARGET_FPU:= $(strip $(subst ",, $(ADK_TARGET_FPU))) ADK_TARGET_ARM_MODE:= $(strip $(subst ",, $(ADK_TARGET_ARM_MODE))) ADK_TARGET_CPU_ARCH:= $(strip $(subst ",, $(ADK_TARGET_CPU_ARCH))) ADK_TARGET_CFLAGS:= $(strip $(subst ",, $(ADK_TARGET_CFLAGS))) diff --git a/target/arm/sys-available/cubox-i b/target/arm/sys-available/cubox-i index 9a63c8350..97a9a84b4 100644 --- a/target/arm/sys-available/cubox-i +++ b/target/arm/sys-available/cubox-i @@ -4,6 +4,7 @@ config ADK_TARGET_SYSTEM_CUBOX_I select ADK_little select ADK_hard_float select ADK_eabihf + select ADK_fpu_neon select ADK_cubox_i select ADK_CPU_CORTEX_A9 select ADK_TARGET_WITH_MMC diff --git a/target/arm/sys-available/qemu-arm b/target/arm/sys-available/qemu-arm index 1fa057c4b..aeaa41d44 100644 --- a/target/arm/sys-available/qemu-arm +++ b/target/arm/sys-available/qemu-arm @@ -4,6 +4,7 @@ config ADK_TARGET_SYSTEM_QEMU_ARM select ADK_qemu_arm select ADK_little select ADK_soft_float + select ADK_fpu_vfp select ADK_eabi select ADK_HARDWARE_QEMU select ADK_TARGET_KERNEL_ZIMAGE diff --git a/target/arm/sys-available/qemu-armhf b/target/arm/sys-available/qemu-armhf index 85cc9c00f..dab039931 100644 --- a/target/arm/sys-available/qemu-armhf +++ b/target/arm/sys-available/qemu-armhf @@ -5,6 +5,7 @@ config ADK_TARGET_SYSTEM_QEMU_ARMHF select ADK_little select ADK_hard_float select ADK_eabihf + select ADK_fpu_vfp select ADK_HARDWARE_QEMU select ADK_TARGET_KERNEL_ZIMAGE help diff --git a/target/arm/sys-available/raspberry-pi b/target/arm/sys-available/raspberry-pi index 518b7b2a3..e91e0e4a1 100644 --- a/target/arm/sys-available/raspberry-pi +++ b/target/arm/sys-available/raspberry-pi @@ -4,6 +4,7 @@ config ADK_TARGET_SYSTEM_RASPBERRY_PI select ADK_little select ADK_hard_float select ADK_eabihf + select ADK_fpu_vfp select ADK_raspberry_pi select ADK_CPU_ARM1176JZF_S select ADK_TARGET_WITH_MMC diff --git a/target/arm/sys-available/toolchain-arm b/target/arm/sys-available/toolchain-arm index 23febc50e..3ad081933 100644 --- a/target/arm/sys-available/toolchain-arm +++ b/target/arm/sys-available/toolchain-arm @@ -4,6 +4,7 @@ config ADK_TARGET_SYSTEM_TOOLCHAIN_ARM select ADK_toolchain_arm select ADK_little select ADK_soft_float + select ADK_fpu_vfp select ADK_eabi select ADK_TOOLCHAIN select ADK_TARGET_PACKAGE_TGZ diff --git a/target/arm/sys-available/toolchain-armhf b/target/arm/sys-available/toolchain-armhf index bf671481c..8a2db49a8 100644 --- a/target/arm/sys-available/toolchain-armhf +++ b/target/arm/sys-available/toolchain-armhf @@ -4,6 +4,7 @@ config ADK_TARGET_SYSTEM_TOOLCHAIN_ARMHF select ADK_little select ADK_hard_float select ADK_eabihf + select ADK_fpu_vfp select ADK_toolchain_armhf select ADK_TOOLCHAIN select ADK_TARGET_PACKAGE_TGZ diff --git a/target/config/Config.in b/target/config/Config.in index 38004d7e3..05f495449 100644 --- a/target/config/Config.in +++ b/target/config/Config.in @@ -37,6 +37,12 @@ config ADK_soft_float config ADK_hard_float boolean +config ADK_fpu_neon + boolean + +config ADK_fpu_vfp + boolean + config ADK_mode_arm boolean @@ -48,6 +54,11 @@ config ADK_TARGET_FLOAT default "hard" if ADK_hard_float default "soft" if ADK_soft_float +config ADK_TARGET_FPU + string + default "vfp" if ADK_fpu_vfp + default "neon" if ADK_fpu_neon + config ADK_TARGET_ARM_MODE depends on ADK_LINUX_ARM string diff --git a/toolchain/gcc/Makefile b/toolchain/gcc/Makefile index 98e150f7a..6f70bfd12 100644 --- a/toolchain/gcc/Makefile +++ b/toolchain/gcc/Makefile @@ -80,6 +80,9 @@ endif ifeq ($(ARCH),arm) GCC_CONFOPTS+= --with-float=$(ADK_TARGET_FLOAT) GCC_CONFOPTS+= --with-mode=$(ADK_TARGET_ARM_MODE) +ifneq ($(ADK_TARGET_FPU),) +GCC_CONFOPTS+= --with-fpu=$(ADK_TARGET_FPU) +endif endif ifeq ($(ADK_CPU_ARM926EJ_S),y) @@ -87,11 +90,11 @@ GCC_CONFOPTS+= --with-arch=armv5te --with-tune=arm1176jzf-s endif ifeq ($(ADK_CPU_ARM1176JZF_S),y) -GCC_CONFOPTS+= --with-arch=armv6 --with-tune=arm1176jzf-s --with-fpu=vfp +GCC_CONFOPTS+= --with-arch=armv6 --with-tune=arm1176jzf-s endif ifeq ($(ADK_CPU_CORTEX_A9),y) -GCC_CONFOPTS+= --with-arch=armv7-a --with-tune=cortex-a9 --with-fpu=neon +GCC_CONFOPTS+= --with-arch=armv7-a --with-tune=cortex-a9 endif ifeq ($(ADK_CPU_SPARC_V9),y) @@ -120,11 +123,13 @@ GCC_BUILD_DIR_FINAL:= $(WRKBUILD)-final $(GCC_BUILD_DIR_MINIMAL)/.configured: mkdir -p $(GCC_BUILD_DIR_MINIMAL) # these symlinks are very important, do not remove - rm -rf $(TOOLCHAIN_DIR)/$(GNU_TARGET_NAME)/sys-include - ln -sf ${STAGING_TARGET_DIR}/usr/include \ - $(TOOLCHAIN_DIR)/usr/$(GNU_TARGET_NAME)/sys-include + rm -rf $(TOOLCHAIN_DIR)/usr/$(GNU_TARGET_NAME)/sys-include + mkdir -p $(TOOLCHAIN_DIR)/usr/$(GNU_TARGET_NAME) + (cd $(TOOLCHAIN_DIR)/usr/$(GNU_TARGET_NAME); \ + ln -s ../$(STAGING_HOST2TARGET)/usr/include sys-include) rm -rf ${TOOLCHAIN_DIR}/usr/$(GNU_TARGET_NAME)/lib - ln -sf ${STAGING_TARGET_DIR}/lib $(TOOLCHAIN_DIR)/usr/$(GNU_TARGET_NAME)/lib + (cd $(TOOLCHAIN_DIR)/usr/$(GNU_TARGET_NAME); \ + ln -s ../$(STAGING_HOST2TARGET)/lib lib) ifeq ($(ADK_LINUX_SH),y) (cd ${STAGING_TARGET_DIR}/ && ln -sf . m4 && ln -sf . m4-nofpu) endif @@ -202,16 +207,7 @@ $(WRKBUILD)/.installed: $(WRKBUILD)/.compiled done; (cd $(TOOLCHAIN_DIR)/usr/bin && \ ln -sf $(GNU_TARGET_NAME)-gcc $(GNU_TARGET_NAME)-gcc-${PKG_VERSION}) - @-test -d $(STAGING_TARGET_DIR)/lib32 && \ - cd $(STAGING_TARGET_DIR)/lib32 && \ - ln -sf libstdc++.so.6.0.18 libstdc++.so && \ - ln -sf libstdc++.so.6.0.18 libstdc++.so.6 - @-test -d $(STAGING_TARGET_DIR)/libx32 && \ - cd $(STAGING_TARGET_DIR)/libx32 && \ - ln -sf libstdc++.so.6.0.18 libstdc++.so && \ - ln -sf libstdc++.so.6.0.18 libstdc++.so.6 - @-test -d $(STAGING_TARGET_DIR)/lib64 && \ - cd $(STAGING_TARGET_DIR)/lib64 && \ + cd $(STAGING_TARGET_DIR)/lib && \ ln -sf libstdc++.so.6.0.18 libstdc++.so && \ ln -sf libstdc++.so.6.0.18 libstdc++.so.6 # cleanup unneeded docs diff --git a/toolchain/glibc/Makefile b/toolchain/glibc/Makefile index 996f9dd87..44f73c1ff 100644 --- a/toolchain/glibc/Makefile +++ b/toolchain/glibc/Makefile @@ -64,19 +64,18 @@ $(WRKBUILD)/.installed: ${GLIBC_ENV} $(MAKE) -C $(GLIBC_BUILD_DIR_FINAL) install_root=$(STAGING_TARGET_DIR) install mkdir -p ${STAGING_TARGET_DIR}/etc ${INSTALL_DATA} ${WRKBUILD}/posix/gai.conf ${STAGING_TARGET_DIR}/etc - ${INSTALL_DATA} ${WRKBUILD}/nscd/nscd.conf ${STAGING_TARGET_DIR}/etc ${INSTALL_DATA} ${WRKBUILD}/nss/nsswitch.conf ${STAGING_TARGET_DIR}/etc touch $@ $(WRKBUILD)/.fixup: -find $(STAGING_TARGET_DIR) $(STAGING_HOST_DIR) -name \*.la -delete - -find $(STAGING_TARGET_DIR) -type f -name \*_pic\* -delete rm -rf $(STAGING_TARGET_DIR)/usr/share/locale $(STAGING_TARGET_DIR)/usr/share/i18n rm -rf $(STAGING_TARGET_DIR)/usr/lib/gconv ifeq ($(ADK_TOOLCHAIN),y) # strip target libs and host tools for toolchain builds - PATH="$(TARGET_PATH)" debug='0' prefix='${TARGET_CROSS}' ${BASH} ${SCRIPT_DIR}/rstrip.sh $(STAGING_TARGET_DIR) - debug='0' prefix=' ' ${BASH} ${SCRIPT_DIR}/rstrip.sh $(TOOLCHAIN_DIR)/usr + PATH="$(TARGET_PATH)" debug='0' prefix='${TARGET_CROSS}' ${BASH} ${SCRIPT_DIR}/rstrip.sh \ + $(STAGING_TARGET_DIR) $(TOOLCHAIN_DIR)/usr/lib/gcc/$(GNU_TARGET_NAME) + debug='0' prefix=' ' ${BASH} ${SCRIPT_DIR}/rstrip.sh $(TOOLCHAIN_DIR)/usr/bin endif touch $@ diff --git a/toolchain/musl/Makefile b/toolchain/musl/Makefile index aa5e8845c..f13a2613d 100644 --- a/toolchain/musl/Makefile +++ b/toolchain/musl/Makefile @@ -55,8 +55,9 @@ $(WRKBUILD)/.fixup: -find $(STAGING_TARGET_DIR) $(STAGING_HOST_DIR) -name \*.la -delete ifeq ($(ADK_TOOLCHAIN),y) # strip target libs and host tools for toolchain builds - PATH="$(TARGET_PATH)" debug='0' prefix='${TARGET_CROSS}' ${BASH} ${SCRIPT_DIR}/rstrip.sh $(STAGING_TARGET_DIR) - debug='0' prefix=' ' ${BASH} ${SCRIPT_DIR}/rstrip.sh $(STAGING_HOST_DIR) + PATH="$(TARGET_PATH)" debug='0' prefix='${TARGET_CROSS}' ${BASH} ${SCRIPT_DIR}/rstrip.sh \ + $(STAGING_TARGET_DIR) $(TOOLCHAIN_DIR)/usr/lib/gcc/$(GNU_TARGET_NAME) + debug='0' prefix=' ' ${BASH} ${SCRIPT_DIR}/rstrip.sh $(TOOLCHAIN_DIR)/usr/bin endif touch $@ diff --git a/toolchain/uClibc/Makefile b/toolchain/uClibc/Makefile index 2488232c0..c691a8b2b 100644 --- a/toolchain/uClibc/Makefile +++ b/toolchain/uClibc/Makefile @@ -117,8 +117,9 @@ $(WRKBUILD)/.fixup: -find $(STAGING_TARGET_DIR) $(STAGING_HOST_DIR) -name \*.la -delete ifeq ($(ADK_TOOLCHAIN),y) # strip target libs and host tools for toolchain builds - PATH="$(TARGET_PATH)" debug='0' prefix='${TARGET_CROSS}' ${BASH} ${SCRIPT_DIR}/rstrip.sh $(STAGING_TARGET_DIR) - debug='0' prefix=' ' ${BASH} ${SCRIPT_DIR}/rstrip.sh $(STAGING_HOST_DIR) + PATH="$(TARGET_PATH)" debug='0' prefix='${TARGET_CROSS}' ${BASH} ${SCRIPT_DIR}/rstrip.sh \ + $(STAGING_TARGET_DIR) $(TOOLCHAIN_DIR)/usr/lib/gcc/$(GNU_TARGET_NAME) + debug='0' prefix=' ' ${BASH} ${SCRIPT_DIR}/rstrip.sh $(TOOLCHAIN_DIR)/usr/bin endif touch $@ diff --git a/tools/adk/depmaker.c b/tools/adk/depmaker.c index e5028003b..023e58504 100644 --- a/tools/adk/depmaker.c +++ b/tools/adk/depmaker.c @@ -28,6 +28,7 @@ #define MAXPATH 128 static int prefix = 0; +static int hprefix = 0; static int check_symbol(char *symbol) { @@ -64,7 +65,7 @@ static int check_symbol(char *symbol) { } /*@null@*/ -static char *parse_line(char *package, char *pkgvar, char *string, int checksym, int pprefix, int system) { +static char *parse_line(char *package, char *pkgvar, char *string, int checksym, int pprefix, int system, int *prefixp) { char *key, *value, *dep, *key_sym, *pkgdeps; char temp[MAXLINE]; @@ -114,8 +115,8 @@ static char *parse_line(char *package, char *pkgvar, char *string, int checksym, value = strtok(NULL, "=\t"); dep = strtok(value, " "); while (dep != NULL) { - if (prefix == 0) { - prefix = 1; + if (*prefixp == 0) { + *prefixp = 1; if (snprintf(temp, MAXLINE, "%s-compile: %s-compile", package, dep) < 0) perror("Can not create string variable."); } else { @@ -135,7 +136,7 @@ int main() { FILE *pkg; char buf[MAXLINE]; char path[MAXPATH]; - char *string, *pkgvar, *pkgdeps, *tmp, *fpkg, *cpkg, *spkg, *key, *check, *dpkg; + char *string, *pkgvar, *pkgdeps, *hpkgdeps = NULL, *tmp, *fpkg, *cpkg, *spkg, *key, *check, *dpkg; char *stringtmp; int i; @@ -182,6 +183,7 @@ int main() { exit(EXIT_FAILURE); } prefix = 0; + hprefix = 0; /* generate build dependencies */ while (fgets(buf, MAXLINE, pkg) != NULL) { @@ -197,7 +199,7 @@ int main() { string = strstr(buf, "PKG_BUILDDEP:="); if (string != NULL) { - tmp = parse_line(pkgdirp->d_name, pkgvar, string, 0, 0, 0); + tmp = parse_line(pkgdirp->d_name, pkgvar, string, 0, 0, 0, &prefix); if (tmp != NULL) { strncat(pkgdeps, tmp, strlen(tmp)); } @@ -205,7 +207,7 @@ int main() { string = strstr(buf, "PKG_BUILDDEP+="); if (string != NULL) { - tmp = parse_line(pkgdirp->d_name, pkgvar, string, 0, 0, 0); + tmp = parse_line(pkgdirp->d_name, pkgvar, string, 0, 0, 0, &prefix); if (tmp != NULL) strncat(pkgdeps, tmp, strlen(tmp)); } @@ -219,7 +221,7 @@ 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); + tmp = parse_line(pkgdirp->d_name, dpkg, stringtmp, 1, 0, 1, &prefix); if (tmp != NULL) strncat(pkgdeps, tmp, strlen(tmp)); } @@ -238,7 +240,7 @@ int main() { string = strstr(buf, "PKGFB_"); if (string != NULL) { - tmp = parse_line(pkgdirp->d_name, fpkg, string, 1, 0, 0); + tmp = parse_line(pkgdirp->d_name, fpkg, string, 1, 0, 0, &prefix); if (tmp != NULL) strncat(pkgdeps, tmp, strlen(tmp)); } @@ -255,7 +257,7 @@ int main() { } string = strstr(buf, "PKGCB_"); if (string != NULL) { - tmp = parse_line(pkgdirp->d_name, cpkg, string, 1, 0, 0); + tmp = parse_line(pkgdirp->d_name, cpkg, string, 1, 0, 0, &prefix); if (tmp != NULL) strncat(pkgdeps, tmp, strlen(tmp)); } @@ -273,16 +275,31 @@ int main() { string = strstr(buf, "PKGSB_"); if (string != NULL) { - tmp = parse_line(pkgdirp->d_name, spkg, string, 1, 1, 0); + tmp = parse_line(pkgdirp->d_name, spkg, string, 1, 1, 0, &prefix); if (tmp != NULL) { strncat(pkgdeps, tmp, strlen(tmp)); } } + } else if (strncmp(buf, "HOST_BUILDDEP", 13) == 0) { + asprintf(&string, "%s-host", pkgdirp->d_name); + // check retval; string for NULL + tmp = parse_line(string, NULL, buf, 0, 0, 0, &hprefix); + if (tmp && *tmp) { + asprintf(&string, "%s%s", + hpkgdeps ? hpkgdeps : "", + tmp); + free(hpkgdeps); + hpkgdeps = string; + } } free(tmp); } if (strlen(pkgdeps) != 0) printf("%s\n", pkgdeps); + if (hpkgdeps && *hpkgdeps) + printf("%s\n", hpkgdeps); + free(hpkgdeps); + hpkgdeps = NULL; free(pkgdeps); free(pkgvar); if (fclose(pkg) != 0) |