Browse Source

add support for target system depends for packages

Waldemar Brodkorb 12 years ago
parent
commit
233b75f916
3 changed files with 27 additions and 4 deletions
  1. 3 3
      mk/build.mk
  2. 1 0
      package/firefox/Makefile
  3. 23 1
      tools/adk/pkgmaker.c

+ 3 - 3
mk/build.mk

@@ -14,7 +14,7 @@ DEFCONFIG=		ADK_DEBUG=n \
 			ADK_STATIC=n \
 			ADK_LOCALES=n \
 			ADK_MAKE_PARALLEL=y \
-			ADK_MAKE_JOBS=1 \
+			ADK_MAKE_JOBS=4 \
 			ADK_USE_CCACHE=n \
 			ADK_PACKAGE_ALSA_UTILS_WITH_ALSAMIXER=n \
 			ADK_PACKAGE_GRUB=n \
@@ -555,11 +555,11 @@ bulkallmod:
 		echo === building $$arch $$system $$libc on $$(date); \
 		$(GMAKE) prereq && \
 		$(GMAKE) ARCH=$$arch SYSTEM=$$system LIBC=$$libc FS=archive allmodconfig; \
-		$(GMAKE) VERBOSE=1 all; if [ $$? -ne 0 ]; then touch .exit;fi; \
+		$(GMAKE) VERBOSE=1 all; if [ $$? -ne 0 ]; then echo $$system >.exit; exit 1;fi; \
 		rm .config; \
             ) 2>&1 | tee $(TOPDIR)/bin/$${system}_$${arch}_$$libc/build.log; \
 	      done; \
-	    if [ -f .exit ];then echo "Bulk build failed!"; rm .exit; exit 1;fi \
+	    if [ -f .exit ];then echo "Bulk build failed!"; cat .exit;rm .exit; exit 1;fi \
 	  done <${TOPDIR}/target/arch.lst ;\
 	done
 

+ 1 - 0
package/firefox/Makefile

@@ -21,6 +21,7 @@ PKG_NEED_CXX:=		1
 
 PKG_ARCH_DEPENDS:=	x86 x86_64 native
 PKG_HOST_DEPENDS:=	!netbsd !freebsd !openbsd !cygwin
+PKG_SYSTEM_DEPENDS:=	ibm-x40
 
 DISTFILES:=             ${PKG_NAME}-${PKG_VERSION}.source.tar.bz2
 WRKDIST=		${WRKDIR}/mozilla-release

+ 23 - 1
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;