Browse Source

add static application build

barely tested, but working for mksh package and google g1 target
Waldemar Brodkorb 16 years ago
parent
commit
2196fce0b2
3 changed files with 20 additions and 8 deletions
  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
 	  If you choose this option, all necessary software needed
 	  for native building will be selected.
 	  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
 config ADK_MAKE_JOBS
 	int
 	int
 	default 1 if ! ADK_MAKE_PARALLEL
 	default 1 if ! ADK_MAKE_PARALLEL

+ 7 - 1
mk/package.mk

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

+ 0 - 7
target/Config.in

@@ -655,13 +655,6 @@ config ADK_CXX
 	help
 	help
 	  Enable C++ Compiler and Libraries
 	  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
 config ADK_IPV6
 	bool "Enable IPv6 support"
 	bool "Enable IPv6 support"
 	default n
 	default n