X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=configure.ac;h=cd0867dd76d7c1b21de783b744ef4eb2a99a13c4;hb=0fdeaa807462b404aa5b18926cb58a9a1130746f;hp=c205698cd6be55f2a08a8cf7f3298e177930b660;hpb=90bd54236cb8b1c31c3662977159be971044c20d;p=deliverable%2Fbinutils-gdb.git diff --git a/configure.ac b/configure.ac index c205698cd6..cd0867dd76 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, # 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, -# 2014, 2015, 2016 Free Software Foundation, Inc. +# 2014, 2015, 2016, 2019 Free Software Foundation, Inc. # # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -33,6 +33,23 @@ m4_include([config/isl.m4]) AC_INIT(move-if-change) AC_DISABLE_OPTION_CHECKING +if test x"${enable_gdb}" != x"no" -a x"${enable_src_release_build}" != x"yes"; then + # For this branch, we do not support building GDB in-tree. + # Try to detect whether we are in this situation or not by + # searching for a couple of known files in the source directory. + if test -f gnulib/update-gnulib.sh -a -f gdb/ChangeLog; then + AC_MSG_ERROR([GDB must be configured and built in a directory separate from its sources. + +To do so, create a dedicated directory for your GDB build and invoke +the configure script from that directory: + + $ mkdir build + $ cd build + $ /gdb-VERSION/configure [[etc...]] + $ make]) + fi +fi + progname=$0 # if PWD already has a value, it is probably wrong. if test -n "$PWD" ; then PWD=`${PWDCMD-pwd}`; fi @@ -901,22 +918,6 @@ case "${target}" in ;; esac -# Targets that do not use the ELF file format cannot support libctf. -case "${target}" in - *-*-pe | *-*-*vms* | *-*-darwin | *-*-*coff* | *-*-wince | *-*-mingw*) - noconfigdirs="$noconfigdirs libctf" - ;; - *-*-aout | *-*-osf* | *-*-go32 | *-*-macos* | *-*-rhapsody*) - noconfigdirs="$noconfigdirs libctf" - ;; - *-*-netbsdpe | *-*-cygwin* | *-*-pep | *-*-msdos | *-*-winnt) - noconfigdirs="$noconfigdirs libctf" - ;; - ns32k-*-* | pdp11-*-* | *-*-aix* | *-*-netbsdaout) - noconfigdirs="$noconfigdirs libctf" - ;; -esac - case "${target}" in *-*-chorusos) ;; @@ -1618,6 +1619,19 @@ AC_ARG_WITH(stage1-libs, [stage1_libs=]) AC_SUBST(stage1_libs) +# Whether or not to use -static-libstdc++ and -static-libgcc. The +# default is yes if gcc is being built; no otherwise. The reason for +# this default is that gdb is sometimes linked against GNU Source +# Highlight, which is a shared library that uses C++ exceptions. In +# this case, -static-libstdc++ will cause crashes. +AC_ARG_WITH(static-standard-libraries, +[AS_HELP_STRING([--with-static-standard-libraries], + [use -static-libstdc++ and -static-libgcc (default=auto)])], +[], [with_static_standard_libraries=auto]) +if test "$with_static_standard_libraries" = auto; then + with_static_standard_libraries=$have_compiler +fi + # Linker flags to use for stage1 or when not bootstrapping. AC_ARG_WITH(stage1-ldflags, [AS_HELP_STRING([--with-stage1-ldflags=FLAGS], [linker flags for stage1])], @@ -1630,7 +1644,8 @@ AC_ARG_WITH(stage1-ldflags, # In stage 1, default to linking libstdc++ and libgcc statically with GCC # if supported. But if the user explicitly specified the libraries to use, # trust that they are doing what they want. - if test "$stage1_libs" = "" -a "$have_static_libs" = yes; then + if test "$with_static_standard_libraries" = yes -a "$stage1_libs" = "" \ + -a "$have_static_libs" = yes; then stage1_ldflags="-static-libstdc++ -static-libgcc" fi]) AC_SUBST(stage1_ldflags) @@ -2728,6 +2743,14 @@ esac CONFIGURE_GDB_TK=`echo ${GDB_TK} | sed s/-all-/-configure-/g` INSTALL_GDB_TK=`echo ${GDB_TK} | sed s/-all-/-install-/g` +# gdb depends on gnulib, but as nothing else does, only include it if +# gdb is built. +if echo " ${configdirs} " | grep " gdb " > /dev/null 2>&1 ; then + # The Makefile provides the ordering, so it's enough here to add + # gnulib to the list. + configdirs="${configdirs} gnulib" +fi + # Strip out unwanted targets. # While at that, we remove Makefiles if we were started for recursive