< prev index next >

common/autoconf/jdk-options.m4

Print this page

        

@@ -574,14 +574,95 @@
   AC_SUBST(SALIB_NAME)
 ])
 
 AC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_SYMBOLS],
 [
+  DEBUG_BINARIES=false
+  STRIP_POLICY=min_strip
+
+  #
+  # DEBUG_SYMBOLS
+  #
+  AC_MSG_CHECKING([what type of debug symbols to use])
+  AC_ARG_WITH([debug-symbols], [AS_HELP_STRING([--with-debug-symbols],
+      [set the debug symbol configuration (none, internal, external, zipped) @<:@zipped@:>@])],
+      [],
+      [with_debug_symbols="zipped"])
+  DEBUG_SYMBOLS=$with_debug_symbols
+  AC_MSG_RESULT([$DEBUG_SYMBOLS])
+
+  if test "x$DEBUG_SYMBOLS" = xzipped; then
+    ENABLE_DEBUG_SYMBOLS=true
+    ZIP_DEBUGINFO_FILES=true
+    DEBUG_BINARIES=true
+    STRIP_POLICY=min_strip
+    JAVAC_FLAGS="$JAVAC_FLAGS -g"
+  elif test "x$DEBUG_SYMBOLS" = xnone; then
+    ENABLE_DEBUG_SYMBOLS=false
+    ZIP_DEBUGINFO_FILES=false
+    DEBUG_BINARIES=false
+    STRIP_POLICY=min_strip
+  elif test "x$DEBUG_SYMBOLS" = xinternal; then
+    ENABLE_DEBUG_SYMBOLS=false  # -g option only
+    ZIP_DEBUGINFO_FILES=false
+    DEBUG_BINARIES=true
+    STRIP_POLICY=no_strip
+    STRIP=""
+    JAVAC_FLAGS="$JAVAC_FLAGS -g"
+  elif test "x$DEBUG_SYMBOLS" = xexternal; then
+    ENABLE_DEBUG_SYMBOLS=true
+    ZIP_DEBUGINFO_FILES=false
+    DEBUG_BINARIES=true
+    STRIP_POLICY=min_strip
+    JAVAC_FLAGS="$JAVAC_FLAGS -g"
+  else
+    AC_MSG_ERROR([Allowed debug symbols are: none, internal, external, zipped])
+  fi
+
+  #
+  # DEBUG_BINARIES
+  #
+  if test "x$DEBUG_BINARIES" = xtrue; then
+    enable_debug_binaries=yes
+  else
+    enable_debug_binaries=no
+  fi
+  AC_MSG_CHECKING([if we should generate debug information])
+  AC_ARG_ENABLE([debug-binaries],
+      [AS_HELP_STRING([--disable-debug-binaries],[disable generating debug information @<:@enabled@:>@])])
+  AC_MSG_RESULT([$enable_debug_binaries])
+  if test "x$enable_debug_binaries" = xyes; then
+    DEBUG_BINARIES=true
+  else
+    DEBUG_BINARIES=false
+  fi
+
+  #
+  # STRIP_POLICY
+  #
+  strip_policy=$STRIP_POLICY
+  AC_MSG_CHECKING([what policy of strip])
+  AC_ARG_WITH([strip-policy], [AS_HELP_STRING([--with-strip-policy],
+      [set the policy of strip (all_strip, min_strip, no_strip) @<:@min_strip@:>@])],
+      [STRIP_POLICY=$strip_policy])
+  AC_MSG_RESULT([$STRIP_POLICY])
+
+  if test "x$STRIP_POLICY" != xall_strip && \
+      test "x$STRIP_POLICY" != xmin_strip && \
+      test "x$STRIP_POLICY" != xno_strip; then
+    AC_MSG_ERROR([Allowed strip policies are: all_strip, min_strip, no_strip])
+  fi
+
   #
   # ENABLE_DEBUG_SYMBOLS
   # This must be done after the toolchain is setup, since we're looking at objcopy.
   #
+  if test "x$ENABLE_DEBUG_SYMBOLS" = xtrue; then
+    enable_debug_symbols=yes
+  else
+    enable_debug_symbols=no
+  fi
   AC_ARG_ENABLE([debug-symbols],
       [AS_HELP_STRING([--disable-debug-symbols],[disable generation of debug symbols @<:@enabled@:>@])])
 
   AC_MSG_CHECKING([if we should generate debug symbols])
 

@@ -610,22 +691,29 @@
   AC_MSG_RESULT([$ENABLE_DEBUG_SYMBOLS])
 
   #
   # ZIP_DEBUGINFO_FILES
   #
+  if test "x$ZIP_DEBUGINFO_FILES" = xtrue; then
+    enable_zip_debug_info=yes
+  else
+    enable_zip_debug_info=no
+  fi
   AC_MSG_CHECKING([if we should zip debug-info files])
   AC_ARG_ENABLE([zip-debug-info],
-      [AS_HELP_STRING([--disable-zip-debug-info],[disable zipping of debug-info files @<:@enabled@:>@])],
-      [enable_zip_debug_info="${enableval}"], [enable_zip_debug_info="yes"])
+      [AS_HELP_STRING([--disable-zip-debug-info],[disable zipping of debug-info files @<:@enabled@:>@])])
   AC_MSG_RESULT([${enable_zip_debug_info}])
 
   if test "x${enable_zip_debug_info}" = "xno"; then
     ZIP_DEBUGINFO_FILES=false
   else
     ZIP_DEBUGINFO_FILES=true
   fi
 
+  AC_SUBST(DEBUG_SYMBOLS)
+  AC_SUBST(DEBUG_BINARIES)
+  AC_SUBST(STRIP_POLICY)
   AC_SUBST(ENABLE_DEBUG_SYMBOLS)
   AC_SUBST(ZIP_DEBUGINFO_FILES)
 ])
 
 ################################################################################
< prev index next >