فهرست منبع

add static application build

barely tested, but working for mksh package and google g1 target
Waldemar Brodkorb 16 سال پیش
والد
کامیت
2196fce0b2
3فایلهای تغییر یافته به همراه20 افزوده شده و 8 حذف شده
  1. 13 0
      Config.in
  2. 7 1
      mk/package.mk
  3. 0 7
      target/Config.in

+ 13 - 0
Config.in

@@ -53,6 +53,19 @@ config ADK_DEVELSYSTEM
 	  If you choose this option, all necessary software needed
 	  for native building will be selected.
 
+config ADK_DEBUG
+	bool "Enable debug support"
+	default n
+	help
+	  All packages and libc will be compiled and packaged with debug information.
+	  Mostly useful for NFS root or big USB/CF disk setups.
+
+config ADK_STATIC
+	bool "Link applications statically by default"
+	default n
+	help
+	  Useful for toolchain only target devices.
+
 config ADK_MAKE_JOBS
 	int
 	default 1 if ! ADK_MAKE_PARALLEL

+ 7 - 1
mk/package.mk

@@ -3,9 +3,15 @@
 
 all: build-all-ipkgs
 
+ifeq ($(ADK_STATIC),y)
+TCFLAGS:=		${TARGET_CFLAGS} -static
+TCXXFLAGS:=		${TARGET_CFLAGS} -static
+TCPPFLAGS:=		${TARGET_CPPFLAGS} -static
+else
 TCFLAGS:=		${TARGET_CFLAGS}
 TCXXFLAGS:=		${TARGET_CFLAGS}
 TCPPFLAGS:=		${TARGET_CPPFLAGS}
+endif
 ifeq ($(ADK_DEBUG),)
 TCPPFLAGS+=		-DNDEBUG
 endif
@@ -176,7 +182,7 @@ endif
 	@mkdir -p $${PACKAGE_DIR} '$${STAGING_PARENT}/pkg' \
 	    '$${STAGING_DIR}/scripts'
 ifeq (,$(filter noremove,$(7)))
-	if test -s '$${STAGING_PARENT}/pkg/$(1)'; then \
+	@if test -s '$${STAGING_PARENT}/pkg/$(1)'; then \
 		cd '$${STAGING_DIR}'; \
 		while read fn; do \
 			rm -f "$$$$fn"; \

+ 0 - 7
target/Config.in

@@ -655,13 +655,6 @@ config ADK_CXX
 	help
 	  Enable C++ Compiler and Libraries
 
-config ADK_DEBUG
-	bool "Enable debug support"
-	default n
-	help
-	  All packages and libc will be compiled and packaged with debug information.
-	  Mostly useful for NFS root or big USB/CF disk setups.
-
 config ADK_IPV6
 	bool "Enable IPv6 support"
 	default n