From bf684d634ab8a4d0371f0d6053811f35e5927073 Mon Sep 17 00:00:00 2001
From: David Malcolm <dmalcolm@redhat.com>
Date: Thu, 3 Oct 2019 14:45:58 -0400
Subject: [PATCH 49/95] Autogenerated changes (configure/config.in)

---
 configure     |   6 ++
 gcc/config.in |   6 ++
 gcc/configure | 188 +++++++++++++++++++++++++++++++++++++++++++++++++++++++---
 3 files changed, 192 insertions(+), 8 deletions(-)

diff --git a/configure b/configure
index ce14659..5ecaaf9 100755
--- a/configure
+++ b/configure
@@ -6597,6 +6597,12 @@ Supported languages are: ${potential_languages}" "$LINENO" 5
   ac_configure_args=`echo " $ac_configure_args" | sed -e "s/ '--enable-languages=[^ ]*'//g" -e "s/$/ '--enable-languages="$enable_languages"'/" `
 fi
 
+# Look if the user specified --enable-plugins="..."
+if test -d ${srcdir}/gcc; then
+  enable_plugins=`echo "${enable_plugins}" | sed -e 's/[ 	,][ 	,]*/,/g' -e 's/,$//'`
+  ac_configure_args=`echo " $ac_configure_args" | sed -e "s/ '--enable-plugins=[^ ]*'//g" -e "s/$/ '--enable-plugins="$enable_plugins"'/" `
+fi
+
 # Handle --disable-<component> generically.
 for dir in $configdirs $build_configdirs $target_configdirs ; do
   dirname=`echo $dir | sed -e s/target-//g -e s/build-//g -e s/-/_/g`
diff --git a/gcc/config.in b/gcc/config.in
index e2542ad..2651753 100644
--- a/gcc/config.in
+++ b/gcc/config.in
@@ -76,6 +76,12 @@
 #endif
 
 
+/* Define to enable static analyzer. */
+#ifndef USED_FOR_TARGET
+#undef ENABLE_ANALYZER
+#endif
+
+
 /* Define if you want assertions enabled. This is a cheap check. */
 #ifndef USED_FOR_TARGET
 #undef ENABLE_ASSERT_CHECKING
diff --git a/gcc/configure b/gcc/configure
index c608a96..91b396d 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -665,6 +665,9 @@ out_file
 objc_boehm_gc
 md_file
 local_prefix
+plugin_tree_files
+plugin_specs_files
+plugin_opt_files
 lang_tree_files
 lang_specs_files
 lang_opt_files
@@ -690,6 +693,8 @@ TM_ENDIAN_CONFIG
 tmake_file
 xmake_file
 cpp_install_dir
+selftest_plugins
+check_plugins
 selftest_languages
 check_languages
 build_file_translate
@@ -698,7 +703,10 @@ build_xm_include_list
 build_xm_file_list
 build_install_headers_dir
 build_exeext
+all_selected_plugins
+all_plugins
 all_selected_languages
+all_plugin_makefrags
 all_languages
 all_lang_makefrags
 all_lang_configurefrags
@@ -708,6 +716,7 @@ srcdir
 subdirs
 dollar
 gcc_tooldir
+enable_analyzer
 enable_lto
 DO_LINK_MUTEX
 MAINT
@@ -925,7 +934,8 @@ PACKAGE_NAME
 PATH_SEPARATOR
 SHELL'
 ac_subst_files='option_includes
-language_hooks'
+language_hooks
+plugin_hooks'
 ac_user_opts='
 enable_option_checking
 with_build_libsubdir
@@ -18938,7 +18948,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 18941 "configure"
+#line 18951 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -19044,7 +19054,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 19047 "configure"
+#line 19057 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -29923,7 +29933,7 @@ all_selected_languages=
 # The other mechanism is a set of hooks for each of the main targets
 # like `clean', `install', etc.
 
-language_hooks="Make-hooks"
+language_hooks="Make-lang-hooks"
 
 for lang in ${srcdir}/*/config-lang.in
 do
@@ -30033,8 +30043,8 @@ done
 # We link each language in with a set of hooks, reached indirectly via
 # lang.${target}.  Only do so for selected languages.
 
-rm -f Make-hooks
-touch Make-hooks
+rm -f Make-lang-hooks
+touch Make-lang-hooks
 target_list="all.cross start.encap rest.encap tags \
 	install-common install-man install-info install-pdf install-html dvi \
 	pdf html uninstall info man srcextra srcman srcinfo \
@@ -30047,7 +30057,160 @@ do
 	do
 		x="$x $lang.$t"
 	done
-	echo "lang.$t: $x" >> Make-hooks
+	echo "lang.$t: $x" >> Make-lang-hooks
+done
+
+# --------------
+# Plugin hooks
+# --------------
+
+# Make empty files to contain the specs and options for each plugin.
+# Then add #include lines to for a compiler that has specs and/or options.
+
+plugin_opt_files=
+plugin_specs_files=
+plugin_tree_files=
+# These (without "all_") are set in each config-plugin.in.
+# `plugin' must be a single word so is spelled singularly.
+all_plugins=
+# List of plugin makefile fragments.
+all_plugin_makefrags=
+
+# These are the plugins that are set in --enable-plugins,
+# and are available in the GCC tree.
+all_selected_plugins=
+
+# Add the plugin fragments.
+# Plugins are added via two mechanisms.  Some information must be
+# recorded in makefile variables, these are defined in config-plugin.in.
+# We accumulate them and plug them into the main Makefile.
+# The other mechanism is a set of hooks for each of the main targets
+# like `clean', `install', etc.
+
+plugin_hooks="Make-plugin-hooks"
+
+for plugin in ${srcdir}/*/config-plugin.in
+do
+	test "$plugin" = "${srcdir}/*/config-plugin.in" && continue
+
+        plugin_alias=`sed -n -e 's,^plugin=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^plugin=\([^   ]*\).*$,\1,p' $plugin`
+        if test "x$plugin_alias" = x
+        then
+              echo "$plugin doesn't set \$plugin." 1>&2
+              exit 1
+        fi
+        subdir="`echo $plugin | sed -e 's,^.*/\([^/]*\)/config-plugin.in$,\1,'`"
+        subdirs="$subdirs $subdir"
+
+	# $gcc_subdir is where the gcc integration files are to be found
+	# for a plugin, both for internal compiler purposes (compiler
+	# sources implementing front-end to GCC tree converters), and for
+	# build infrastructure purposes (Make-plugin.in, etc.)
+	#
+	# This will be <subdir> (relative to $srcdir) if a line like
+	# gcc_subdir="<subdir>" or gcc_subdir=<subdir>
+	# is found in <plugindir>/config-plugin.in, and will remain <plugindir>
+	# otherwise.
+	#
+	# Except for the plugin alias (fetched above), the regular
+	# "config-plugin.in" contents are always retrieved from $gcc_subdir,
+	# so a <plugindir>/config-plugin.in setting gcc_subdir typically sets
+	# only this and the plugin alias.
+
+        gcc_subdir=`sed -n -e 's,^gcc_subdir=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^gcc_subdir=\([^   ]*\).*$,\1,p' $plugin`
+        if [ "$gcc_subdir" = "" ]; then
+           gcc_subdir="$subdir"
+        fi
+
+        case ",$enable_plugins," in
+        *,$plugin_alias,*)
+            all_selected_plugins="$all_selected_plugins $plugin_alias"
+            if test -f $srcdir/$gcc_subdir/plugin-specs.h; then
+                plugin_specs_files="$plugin_specs_files $srcdir/$gcc_subdir/plugin-specs.h"
+	    fi
+	    ;;
+        esac
+
+	plugin=
+	boot_plugin=
+	compilers=
+	outputs=
+	gtfiles=
+	subdir_requires=
+	. ${srcdir}/$gcc_subdir/config-plugin.in
+	if test "x$plugin" = x
+	then
+		echo "${srcdir}/$gcc_subdir/config-plugin.in doesn't set \$plugin." 1>&2
+		exit 1
+	fi
+
+	ok=:
+        case ",$enable_plugins," in
+        	*,$plugin_alias,*) ;;
+		*)
+			for i in $subdir_requires; do
+				test -f "${srcdir}/$i/config-plugin.in" && continue
+				ok=false
+				break
+			done
+		;;
+	esac
+	$ok || continue
+
+	all_plugin_makefrags="$all_plugin_makefrags \$(srcdir)/$gcc_subdir/Make-plugin.in"
+	if test -f $srcdir/$gcc_subdir/plugin.opt; then
+	    plugin_opt_files="$plugin_opt_files $srcdir/$gcc_subdir/plugin.opt"
+	    all_opt_files="$all_opt_files $srcdir/$gcc_subdir/plugin.opt"
+	fi
+	if test -f $srcdir/$gcc_subdir/$subdir-tree.def; then
+	    plugin_tree_files="$plugin_tree_files $srcdir/$gcc_subdir/$subdir-tree.def"
+	fi
+	all_plugins="$all_plugins $plugin"
+	all_compilers="$all_compilers $compilers"
+	all_outputs="$all_outputs $outputs"
+	all_gtfiles="$all_gtfiles [$subdir] $gtfiles"
+	case ",$enable_plugins," in
+		*,analyzer,*)
+
+$as_echo "#define ENABLE_ANALYZER 1" >>confdefs.h
+
+		    enable_analyzer=yes
+
+		    ;;
+		*) ;;
+	esac
+done
+
+check_plugins=
+for plugin in $all_selected_plugins
+do
+	check_plugins="$check_plugins check-$plugin"
+done
+
+selftest_plugins=
+for plugin in $all_selected_plugins
+do
+	selftest_plugins="$selftest_plugins selftest-$plugin"
+done
+
+# We link each plugin in with a set of hooks, reached indirectly via
+# plugin.${target}.  Only do so for selected plugins.
+
+rm -f Make-plugin-hooks
+touch Make-plugin-hooks
+target_list="all.cross start.encap rest.encap tags \
+	install-common install-man install-info install-pdf install-html dvi \
+	pdf html uninstall info man srcextra srcman srcinfo \
+	mostlyclean clean distclean maintainer-clean install-plugin"
+
+for t in $target_list
+do
+	x=
+	for plugin in $all_selected_plugins
+	do
+		x="$x $plugin.$t"
+	done
+	echo "plugin.$t: $x" >> Make-plugin-hooks
 done
 
 # --------
@@ -30167,6 +30330,15 @@ fi
 
 
 
+
+
+
+
+
+
+
+
+
 # Echo link setup.
 if test x${build} = x${host} ; then
   if test x${host} = x${target} ; then
@@ -30615,7 +30787,7 @@ $as_echo "$ld_pushpopstate_support" >&6; }
 # AC_CONFIG_SUBDIRS($subdirs)
 
 # Create the Makefile
-# and configure language subdirectories
+# and configure language and plugin subdirectories
 ac_config_files="$ac_config_files $all_outputs"
 
 
-- 
1.8.5.3

