From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) by sourceware.org (Postfix) with ESMTP id 7581A3858014 for ; Fri, 19 Nov 2021 00:45:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7581A3858014 Received: by smtp.gentoo.org (Postfix, from userid 559) id 48683342AB9; Fri, 19 Nov 2021 00:45:44 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Subject: [PATCH 1/2] sim: avoid installing headers when there is no sim Date: Thu, 18 Nov 2021 19:45:35 -0500 Message-Id: <20211119004536.22734-1-vapier@gentoo.org> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Nov 2021 00:45:54 -0000 If we aren't building any sims, don't install the sim headers as they won't be useful to anyone. --- sim/Makefile.am | 5 ++- sim/Makefile.in | 96 +++++++++++++++++++++++++----------------------- sim/configure | 18 ++++++++- sim/configure.ac | 1 + 4 files changed, 72 insertions(+), 48 deletions(-) diff --git a/sim/Makefile.am b/sim/Makefile.am index fd4b76877434..4831fbc6d1e1 100644 --- a/sim/Makefile.am +++ b/sim/Makefile.am @@ -28,6 +28,7 @@ AM_MAKEFLAGS = SIM_PRIMARY_TARGET=$(SIM_PRIMARY_TARGET) # We don't set some of these vars here, but we need to define them so they may # be used consistently in local.mk files we include below. +pkginclude_HEADERS = check_PROGRAMS = noinst_LIBRARIES = EXTRA_PROGRAMS = @@ -58,9 +59,11 @@ SIM_ALL_RECURSIVE_DEPS = nltvals: $(srccom)/gennltvals.py --cpp "$(CPP)" -pkginclude_HEADERS = \ +if ENABLE_SIM +pkginclude_HEADERS += \ $(srcroot)/include/sim/callback.h \ $(srcroot)/include/sim/sim.h +endif include common/local.mk if SIM_ENABLE_IGEN diff --git a/sim/Makefile.in b/sim/Makefile.in index d33720b6bb8a..0ea9d746c88a 100644 --- a/sim/Makefile.in +++ b/sim/Makefile.in @@ -432,13 +432,17 @@ EXTRA_PROGRAMS = $(am__EXEEXT_2) testsuite/common/bits-gen$(EXEEXT) \ testsuite/common/fpu-tst$(EXEEXT) $(am__EXEEXT_3) \ $(am__EXEEXT_4) $(am__EXEEXT_5) $(am__EXEEXT_6) \ $(am__EXEEXT_7) +@ENABLE_SIM_TRUE@am__append_1 = \ +@ENABLE_SIM_TRUE@ $(srcroot)/include/sim/callback.h \ +@ENABLE_SIM_TRUE@ $(srcroot)/include/sim/sim.h + # This makes sure igen is available before building the arch-subdirs which # need to run the igen tool. -@SIM_ENABLE_IGEN_TRUE@am__append_1 = $(IGEN) -@SIM_ENABLE_IGEN_TRUE@am__append_2 = igen/libigen.a -@SIM_ENABLE_IGEN_TRUE@am__append_3 = $(igen_IGEN_TOOLS) +@SIM_ENABLE_IGEN_TRUE@am__append_2 = $(IGEN) +@SIM_ENABLE_IGEN_TRUE@am__append_3 = igen/libigen.a @SIM_ENABLE_IGEN_TRUE@am__append_4 = $(igen_IGEN_TOOLS) +@SIM_ENABLE_IGEN_TRUE@am__append_5 = $(igen_IGEN_TOOLS) TESTS = testsuite/common/bits32m0$(EXEEXT) \ testsuite/common/bits32m31$(EXEEXT) \ testsuite/common/bits64m0$(EXEEXT) \ @@ -446,69 +450,69 @@ TESTS = testsuite/common/bits32m0$(EXEEXT) \ testsuite/common/alu-tst$(EXEEXT) # This makes sure build tools are available before building the arch-subdirs. -@SIM_ENABLE_ARCH_bpf_TRUE@am__append_5 = $(bpf_BUILD_OUTPUTS) @SIM_ENABLE_ARCH_bpf_TRUE@am__append_6 = $(bpf_BUILD_OUTPUTS) +@SIM_ENABLE_ARCH_bpf_TRUE@am__append_7 = $(bpf_BUILD_OUTPUTS) # This makes sure build tools are available before building the arch-subdirs. -@SIM_ENABLE_ARCH_cr16_TRUE@am__append_7 = $(cr16_BUILD_OUTPUTS) -@SIM_ENABLE_ARCH_cr16_TRUE@am__append_8 = cr16/gencode -@SIM_ENABLE_ARCH_cr16_TRUE@am__append_9 = $(cr16_BUILD_OUTPUTS) +@SIM_ENABLE_ARCH_cr16_TRUE@am__append_8 = $(cr16_BUILD_OUTPUTS) +@SIM_ENABLE_ARCH_cr16_TRUE@am__append_9 = cr16/gencode +@SIM_ENABLE_ARCH_cr16_TRUE@am__append_10 = $(cr16_BUILD_OUTPUTS) # This makes sure build tools are available before building the arch-subdirs. -@SIM_ENABLE_ARCH_cris_TRUE@am__append_10 = $(cris_BUILD_OUTPUTS) @SIM_ENABLE_ARCH_cris_TRUE@am__append_11 = $(cris_BUILD_OUTPUTS) +@SIM_ENABLE_ARCH_cris_TRUE@am__append_12 = $(cris_BUILD_OUTPUTS) # This makes sure build tools are available before building the arch-subdirs. -@SIM_ENABLE_ARCH_d10v_TRUE@am__append_12 = $(d10v_BUILD_OUTPUTS) -@SIM_ENABLE_ARCH_d10v_TRUE@am__append_13 = d10v/gencode -@SIM_ENABLE_ARCH_d10v_TRUE@am__append_14 = $(d10v_BUILD_OUTPUTS) +@SIM_ENABLE_ARCH_d10v_TRUE@am__append_13 = $(d10v_BUILD_OUTPUTS) +@SIM_ENABLE_ARCH_d10v_TRUE@am__append_14 = d10v/gencode +@SIM_ENABLE_ARCH_d10v_TRUE@am__append_15 = $(d10v_BUILD_OUTPUTS) # This makes sure build tools are available before building the arch-subdirs. -@SIM_ENABLE_ARCH_frv_TRUE@am__append_15 = $(frv_BUILD_OUTPUTS) @SIM_ENABLE_ARCH_frv_TRUE@am__append_16 = $(frv_BUILD_OUTPUTS) +@SIM_ENABLE_ARCH_frv_TRUE@am__append_17 = $(frv_BUILD_OUTPUTS) # This makes sure build tools are available before building the arch-subdirs. -@SIM_ENABLE_ARCH_iq2000_TRUE@am__append_17 = $(iq2000_BUILD_OUTPUTS) @SIM_ENABLE_ARCH_iq2000_TRUE@am__append_18 = $(iq2000_BUILD_OUTPUTS) +@SIM_ENABLE_ARCH_iq2000_TRUE@am__append_19 = $(iq2000_BUILD_OUTPUTS) # This makes sure build tools are available before building the arch-subdirs. -@SIM_ENABLE_ARCH_lm32_TRUE@am__append_19 = $(lm32_BUILD_OUTPUTS) @SIM_ENABLE_ARCH_lm32_TRUE@am__append_20 = $(lm32_BUILD_OUTPUTS) +@SIM_ENABLE_ARCH_lm32_TRUE@am__append_21 = $(lm32_BUILD_OUTPUTS) # This makes sure build tools are available before building the arch-subdirs. -@SIM_ENABLE_ARCH_m32c_TRUE@am__append_21 = $(m32c_BUILD_OUTPUTS) -@SIM_ENABLE_ARCH_m32c_TRUE@am__append_22 = m32c/opc2c -@SIM_ENABLE_ARCH_m32c_TRUE@am__append_23 = \ +@SIM_ENABLE_ARCH_m32c_TRUE@am__append_22 = $(m32c_BUILD_OUTPUTS) +@SIM_ENABLE_ARCH_m32c_TRUE@am__append_23 = m32c/opc2c +@SIM_ENABLE_ARCH_m32c_TRUE@am__append_24 = \ @SIM_ENABLE_ARCH_m32c_TRUE@ $(m32c_BUILD_OUTPUTS) \ @SIM_ENABLE_ARCH_m32c_TRUE@ m32c/m32c.c.log \ @SIM_ENABLE_ARCH_m32c_TRUE@ m32c/r8c.c.log # This makes sure build tools are available before building the arch-subdirs. -@SIM_ENABLE_ARCH_m32r_TRUE@am__append_24 = $(m32r_BUILD_OUTPUTS) @SIM_ENABLE_ARCH_m32r_TRUE@am__append_25 = $(m32r_BUILD_OUTPUTS) +@SIM_ENABLE_ARCH_m32r_TRUE@am__append_26 = $(m32r_BUILD_OUTPUTS) # This makes sure build tools are available before building the arch-subdirs. -@SIM_ENABLE_ARCH_m68hc11_TRUE@am__append_26 = $(m68hc11_BUILD_OUTPUTS) -@SIM_ENABLE_ARCH_m68hc11_TRUE@am__append_27 = m68hc11/gencode -@SIM_ENABLE_ARCH_m68hc11_TRUE@am__append_28 = $(m68hc11_BUILD_OUTPUTS) +@SIM_ENABLE_ARCH_m68hc11_TRUE@am__append_27 = $(m68hc11_BUILD_OUTPUTS) +@SIM_ENABLE_ARCH_m68hc11_TRUE@am__append_28 = m68hc11/gencode +@SIM_ENABLE_ARCH_m68hc11_TRUE@am__append_29 = $(m68hc11_BUILD_OUTPUTS) # This makes sure build tools are available before building the arch-subdirs. -@SIM_ENABLE_ARCH_mn10300_TRUE@am__append_29 = $(mn10300_BUILD_OUTPUTS) @SIM_ENABLE_ARCH_mn10300_TRUE@am__append_30 = $(mn10300_BUILD_OUTPUTS) +@SIM_ENABLE_ARCH_mn10300_TRUE@am__append_31 = $(mn10300_BUILD_OUTPUTS) # This makes sure build tools are available before building the arch-subdirs. -@SIM_ENABLE_ARCH_or1k_TRUE@am__append_31 = $(or1k_BUILD_OUTPUTS) @SIM_ENABLE_ARCH_or1k_TRUE@am__append_32 = $(or1k_BUILD_OUTPUTS) +@SIM_ENABLE_ARCH_or1k_TRUE@am__append_33 = $(or1k_BUILD_OUTPUTS) # This makes sure build tools are available before building the arch-subdirs. -@SIM_ENABLE_ARCH_sh_TRUE@am__append_33 = $(sh_BUILD_OUTPUTS) -@SIM_ENABLE_ARCH_sh_TRUE@am__append_34 = sh/gencode -@SIM_ENABLE_ARCH_sh_TRUE@am__append_35 = $(sh_BUILD_OUTPUTS) +@SIM_ENABLE_ARCH_sh_TRUE@am__append_34 = $(sh_BUILD_OUTPUTS) +@SIM_ENABLE_ARCH_sh_TRUE@am__append_35 = sh/gencode +@SIM_ENABLE_ARCH_sh_TRUE@am__append_36 = $(sh_BUILD_OUTPUTS) # This makes sure build tools are available before building the arch-subdirs. -@SIM_ENABLE_ARCH_v850_TRUE@am__append_36 = $(v850_BUILD_OUTPUTS) @SIM_ENABLE_ARCH_v850_TRUE@am__append_37 = $(v850_BUILD_OUTPUTS) +@SIM_ENABLE_ARCH_v850_TRUE@am__append_38 = $(v850_BUILD_OUTPUTS) subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \ @@ -542,7 +546,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ - $(am__configure_deps) $(pkginclude_HEADERS) + $(am__configure_deps) $(am__pkginclude_HEADERS_DIST) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs @@ -747,6 +751,8 @@ am__can_run_installinfo = \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac +am__pkginclude_HEADERS_DIST = $(srcroot)/include/sim/callback.h \ + $(srcroot)/include/sim/sim.h am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ @@ -1159,20 +1165,24 @@ srcroot = $(srcdir)/.. SUBDIRS = @subdirs@ $(SIM_SUBDIRS) AM_MAKEFLAGS = SIM_PRIMARY_TARGET=$(SIM_PRIMARY_TARGET) +# We don't set some of these vars here, but we need to define them so they may +# be used consistently in local.mk files we include below. +pkginclude_HEADERS = $(am__append_1) + # NB: libcommon.a isn't used directly by ports. We need a target for common # objects to be a part of, and ports use the individual objects directly. -noinst_LIBRARIES = common/libcommon.a $(am__append_2) +noinst_LIBRARIES = common/libcommon.a $(am__append_3) CLEANFILES = common/version.c common/version.c-stamp \ testsuite/common/bits-gen testsuite/common/bits32m0.c \ testsuite/common/bits32m31.c testsuite/common/bits64m0.c \ testsuite/common/bits64m63.c DISTCLEANFILES = -MOSTLYCLEANFILES = core $(am__append_4) site-srcdir.exp testrun.log \ - testrun.sum $(am__append_6) $(am__append_9) $(am__append_11) \ - $(am__append_14) $(am__append_16) $(am__append_18) \ - $(am__append_20) $(am__append_23) $(am__append_25) \ - $(am__append_28) $(am__append_30) $(am__append_32) \ - $(am__append_35) $(am__append_37) +MOSTLYCLEANFILES = core $(am__append_5) site-srcdir.exp testrun.log \ + testrun.sum $(am__append_7) $(am__append_10) $(am__append_12) \ + $(am__append_15) $(am__append_17) $(am__append_19) \ + $(am__append_21) $(am__append_24) $(am__append_26) \ + $(am__append_29) $(am__append_31) $(am__append_33) \ + $(am__append_36) $(am__append_38) AM_CFLAGS = $(WERROR_CFLAGS) $(WARN_CFLAGS) AM_CPPFLAGS = -I$(srcroot)/include $(SIM_INLINE) -I$(srcdir)/common COMPILE_FOR_BUILD = $(CC_FOR_BUILD) $(AM_CPPFLAGS) $(CFLAGS_FOR_BUILD) @@ -1183,16 +1193,12 @@ LINK_FOR_BUILD = $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -o $@ # This makes sure common parts are available before building the arch-subdirs # which will refer to these. -SIM_ALL_RECURSIVE_DEPS = common/libcommon.a $(am__append_1) \ - $(am__append_5) $(am__append_7) $(am__append_10) \ - $(am__append_12) $(am__append_15) $(am__append_17) \ - $(am__append_19) $(am__append_21) $(am__append_24) \ - $(am__append_26) $(am__append_29) $(am__append_31) \ - $(am__append_33) $(am__append_36) -pkginclude_HEADERS = \ - $(srcroot)/include/sim/callback.h \ - $(srcroot)/include/sim/sim.h - +SIM_ALL_RECURSIVE_DEPS = common/libcommon.a $(am__append_2) \ + $(am__append_6) $(am__append_8) $(am__append_11) \ + $(am__append_13) $(am__append_16) $(am__append_18) \ + $(am__append_20) $(am__append_22) $(am__append_25) \ + $(am__append_27) $(am__append_30) $(am__append_32) \ + $(am__append_34) $(am__append_37) common_libcommon_a_CPPFLAGS = \ $(AM_CPPFLAGS) \ -DSIM_COMMON_BUILD \ diff --git a/sim/configure b/sim/configure index 3cd19e0648ae..4589362d36cd 100755 --- a/sim/configure +++ b/sim/configure @@ -650,6 +650,8 @@ SIM_ENABLE_HW_TRUE cgen cgendir CGEN_MAINT +ENABLE_SIM_FALSE +ENABLE_SIM_TRUE SIM_ENABLE_IGEN_FALSE SIM_ENABLE_IGEN_TRUE SIM_ENABLE_ARCH_v850_FALSE @@ -12245,7 +12247,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12248 "configure" +#line 12250 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -12351,7 +12353,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12354 "configure" +#line 12356 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -14860,6 +14862,14 @@ else SIM_ENABLE_IGEN_FALSE= fi + if test -n "$SIM_SUBDIRS"; then + ENABLE_SIM_TRUE= + ENABLE_SIM_FALSE='#' +else + ENABLE_SIM_TRUE='#' + ENABLE_SIM_FALSE= +fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to force sim alignment" >&5 $as_echo_n "checking whether to force sim alignment... " >&6; } @@ -15621,6 +15631,10 @@ if test -z "${SIM_ENABLE_IGEN_TRUE}" && test -z "${SIM_ENABLE_IGEN_FALSE}"; then as_fn_error $? "conditional \"SIM_ENABLE_IGEN\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${ENABLE_SIM_TRUE}" && test -z "${ENABLE_SIM_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_SIM\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${SIM_ENABLE_HW_TRUE}" && test -z "${SIM_ENABLE_HW_FALSE}"; then as_fn_error $? "conditional \"SIM_ENABLE_HW\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 diff --git a/sim/configure.ac b/sim/configure.ac index 00d1e8d4b91d..86a800b6d6b1 100644 --- a/sim/configure.ac +++ b/sim/configure.ac @@ -155,6 +155,7 @@ if test "${enable_sim}" != no; then fi fi AM_CONDITIONAL([SIM_ENABLE_IGEN], [test "$sim_igen" = "yes"]) +AM_CONDITIONAL([ENABLE_SIM], [test -n "$SIM_SUBDIRS"]) dnl Standard (and optional) simulator options. dnl Eventually all simulators will support these. -- 2.33.0