From patchwork Tue Jul 27 20:25:30 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Add --enable-default-dwarf=N configury Date: Tue, 27 Jul 2010 10:25:30 -0000 From: Roland McGrath X-Patchwork-Id: 60046 Message-Id: <20100727202530.D7BAF400DD@magilla.sf.frob.com> To: "Joseph S. Myers" Cc: gcc-patches@gcc.gnu.org I've updated the patch to document the configure option, and so update_web_docs_svn should work (didn't test that). The built documentation says what the configured default is but the web docs won't. Any more general changes to option documentation are beyond the scope of this change. If you do something like that, this case will fit into that scheme easily. Thanks, Roland --- gcc/ 2010-07-27 Roland McGrath * configure.ac: Handle --enable-default-dwarf=N. Generate gcc-config.texi with @set for default_dwarf. * configure: Regenerated. * config.in: Regenerated. * common.opt (gdwarf-): Use DEFAULT_DWARF_VERSION macro as default. * doc/include/gcc-common.texi: @include gcc-config.texi here. * doc/invoke.texi (-gdwarf-@var{version}): Use @value{default_dwarf}. * doc/install.texi (Configuration): Document --enable-default-dwarf=N. maintainer-scripts/ 2010-07-27 Roland McGrath * update_web_docs_svn: Create empty gcc-config.texi file. diff --git a/gcc/common.opt b/gcc/common.opt index 41a9838..f6e3f4a 100644 --- a/gcc/common.opt +++ b/gcc/common.opt @@ -1540,7 +1540,7 @@ Common JoinedOrMissing Negative(gdwarf-) Generate debug information in COFF format gdwarf- -Common Joined UInteger Var(dwarf_version) Init(2) Negative(gstabs) +Common Joined UInteger Var(dwarf_version) Init(DEFAULT_DWARF_VERSION) Negative(gstabs) Generate debug information in DWARF v2 (or later) format ggdb diff --git a/gcc/config.in b/gcc/config.in index c451c53..9d229f3 100644 --- a/gcc/config.in +++ b/gcc/config.in @@ -24,6 +24,12 @@ #endif +/* Default DWARF version with no -gdwarf-N switch. */ +#ifndef USED_FOR_TARGET +#undef DEFAULT_DWARF_VERSION +#endif + + /* Define to enable the use of a default linker. */ #ifndef USED_FOR_TARGET #undef DEFAULT_LINKER diff --git a/gcc/configure b/gcc/configure index aa61cd6..41bca0f 100755 --- a/gcc/configure +++ b/gcc/configure @@ -890,6 +890,7 @@ with_pkgversion with_bugurl enable_languages with_multilib_list +enable_default_dwarf enable_rpath with_libiconv_prefix enable_initfini_array @@ -1589,6 +1590,8 @@ Optional Features: --disable-shared don't provide a shared libgcc --enable-intermodule build the compiler in one step --enable-languages=LIST specify which front-ends to build + --enable-default-dwarf=VERSION + -g defaults to -gdwarf-VERSION --disable-rpath do not hardcode runtime library paths --enable-initfini-array use .init_array/.fini_array sections --enable-sjlj-exceptions @@ -6968,6 +6971,37 @@ else fi +# Check whether --enable-default-dwarf was given. +if test "${enable_default_dwarf+set}" = set; then : + enableval=$enable_default_dwarf; default_dwarf=$enableval +else + default_dwarf=2 +fi + +case "$default_dwarf" in +[2-9]) ;; +*) as_fn_error "--enable-default-dwarf requires a DWARF version number" "$LINENO" 5 ;; +esac + + +cat >>confdefs.h <<_ACEOF +#define DEFAULT_DWARF_VERSION $default_dwarf +_ACEOF + +doc_config_vars="$doc_config_vars default_dwarf" + +# ---------------------------------------------------------------- +# Generate gcc-config.texi to pass along vars in $doc_config_vars. +# ---------------------------------------------------------------- +doc_config= +for var in $doc_config_vars; do + eval val=\$$var + doc_config="$doc_config +@set $var $val" +done +ac_config_commands="$ac_config_commands gcc-config.texi" + + # ------------------------- # Checks for other programs # ------------------------- @@ -17109,7 +17143,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 17112 "configure" +#line 17146 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -17215,7 +17249,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 17218 "configure" +#line 17252 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -26466,6 +26500,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # +doc_config="$doc_config" subdirs='$subdirs' _ACEOF @@ -26477,6 +26512,7 @@ for ac_config_target in $ac_config_targets do case $ac_config_target in "auto-host.h") CONFIG_HEADERS="$CONFIG_HEADERS auto-host.h:config.in" ;; + "gcc-config.texi") CONFIG_COMMANDS="$CONFIG_COMMANDS gcc-config.texi" ;; "as") CONFIG_FILES="$CONFIG_FILES as:exec-tool.in" ;; "collect-ld") CONFIG_FILES="$CONFIG_FILES collect-ld:exec-tool.in" ;; "nm") CONFIG_FILES="$CONFIG_FILES nm:exec-tool.in" ;; @@ -27060,6 +27096,13 @@ $as_echo "$as_me: executing $ac_file commands" >&6;} case $ac_file$ac_mode in + "gcc-config.texi":C) + rm -f gcc-config.texi + cat > gcc-config.texi <@) ;; +*) AC_MSG_ERROR([--enable-default-dwarf requires a DWARF version number]) ;; +esac + +AC_DEFINE_UNQUOTED([DEFAULT_DWARF_VERSION], $default_dwarf, + [Default DWARF version with no -gdwarf-N switch.]) +doc_config_vars="$doc_config_vars default_dwarf" + +# ---------------------------------------------------------------- +# Generate gcc-config.texi to pass along vars in $doc_config_vars. +# ---------------------------------------------------------------- +doc_config= +for var in $doc_config_vars; do + eval val=\$$var + doc_config="$doc_config +@set $var $val" +done +AC_CONFIG_COMMANDS([gcc-config.texi], [ + rm -f gcc-config.texi + cat > gcc-config.texi < $includedir/gcc-vers.texi +# Empty config is default config. +> $includedir/gcc-config.texi + # Now convert the relevant files from texi to HTML, PDF and PostScript. for file in $MANUALS; do filename=`find . -name ${file}.texi`