Browse Source

make compiling with debug information non-default behavior

As mentioned by Phil, a lot of disk space is needed nowadays
to build OpenADK. Switch to non debug builds as default to
save 2 GB for each default build.
Waldemar Brodkorb 9 years ago
parent
commit
f2721def05
3 changed files with 14 additions and 5 deletions
  1. 2 3
      adk/tools/pkgmaker.c
  2. 5 2
      mk/vars.mk
  3. 7 0
      target/config/Config.in.adk

+ 2 - 3
adk/tools/pkgmaker.c

@@ -955,9 +955,8 @@ int main() {
 
 				/* handle debug subpackages */
 				fprintf(cfg, "\nconfig ADK_PACKAGE_%s_DBG\n", toupperstr(pkg_debug));
-				fprintf(cfg, "\tprompt \"add debug symbols package\"\n");
-				fprintf(cfg, "\tboolean\n");
-				fprintf(cfg, "\tdepends on ADK_PACKAGE_GDB\n");
+				fprintf(cfg, "\tbool \"add debug symbols package\"\n");
+				fprintf(cfg, "\tdepends on ADK_PACKAGE_GDB && ADK_BUILD_WITH_DEBUG\n");
 				fprintf(cfg, "\tdepends on !ADK_DEBUG\n");
 				fprintf(cfg, "\tdepends on ADK_PACKAGE_%s\n", toupperstr(pkg_debug));
 				fprintf(cfg, "\tdefault n\n");

+ 5 - 2
mk/vars.mk

@@ -237,12 +237,15 @@ TARGET_CFLAGS+=		-mlongcalls -mtext-section-literals
 TARGET_CXXFLAGS+=	-mlongcalls -mtext-section-literals
 endif
 
-# add configured cflags for optimization
+# add configured compiler flags for optimization
 TARGET_CFLAGS+=		$(ADK_TARGET_CFLAGS_OPT)
 TARGET_CXXFLAGS+=	$(ADK_TARGET_CFLAGS_OPT)
-# always add debug information
+
+# add compiler flags for debug information
+ifeq ($(ADK_BUILD_WITH_DEBUG),y)
 TARGET_CFLAGS+=		-g3
 TARGET_CXXFLAGS+=	-g3
+endif
 
 ifneq ($(ADK_DEBUG),)
 TARGET_CFLAGS+=		-fno-omit-frame-pointer

+ 7 - 0
target/config/Config.in.adk

@@ -17,6 +17,13 @@ config ADK_DL_DIR
 	  Configure the download directory for all source packages.
 	  Use an absolute path.
 
+config ADK_BUILD_WITH_DEBUG
+	bool "Build everything with debug information and allow debug packages"
+	default n
+	help
+	  If you want to create debug packages, you should enable this option.
+	  WARNING: It will use a lot of aditional disk space on you build system!
+
 config ADK_DISABLE_HONOUR_CFLAGS
 	bool "Disable honour CFLAGS checks globally"
 	default n