aboutsummaryrefslogtreecommitdiff
path: root/sim/configure.ac
AgeCommit message (Collapse)AuthorFilesLines
2023-12-04sim: warnings: enable only for development buildsMike Frysinger1-0/+3
Reuse the bfd/development.sh script like most other project to determine whether the current source tree is a dev build (e.g. git) or a release build, and disable the warnings for releases.
2023-01-15sim: igen: simplify build logic a littleMike Frysinger1-7/+3
Now that all ports (that use igen) build in the top-level and depend on igen, we can move the conditional logic out of configure. We also switch from noinst_LIBRARIES to EXTRA_LIBRARIES so that the library is only built when needed (i.e. the igen tool is used).
2023-01-14sim: build: drop depdir subdir hackMike Frysinger1-4/+0
Now that all the ports compile some C files in their arch dirs, Automake guarantees creating the depdir for us, so we can drop our configure hack.
2023-01-13sim: build: delete Make-common.in logicMike Frysinger1-13/+0
Now that all (other than ppc) build in the top-level, this logic is unused, so punt it all.
2023-01-10sim: disable recursive make in (most) subdirsMike Frysinger1-21/+0
Now that all (other than ppc) build in the top-level, we can disable the recursive make calls to them. This speeds things up nicely.
2023-01-05sim: Move getopt checking inside SIM_AC_PLATFORMTsukasa OI1-10/+0
This commit moves getopt declaration checker originally in sim/ configure.ac; added in commit 340aa4f6872c ("sim: Check known getopt definition existence") to sim/m4/sim_ac_platform.m4 (inside the SIM_AC_PLATFORM macro). It also regenerates configuration files using the maintainer mode.
2023-01-02sim: build: add var for tracking sim enable directlyMike Frysinger1-1/+3
Rather than rely on SIM_SUBDIRS being set, add a dedicated variable to track whether to enable the sim. While the current code works fine, it won't work as we remove the recursive make logic (i.e. the SIM_SUBDIRS variable).
2023-01-02sim: build: use Automake include varsMike Frysinger1-5/+0
Rather than define our own hack for emitting an include statement, use the existing Automake include variables. These have the nice side-effect of being more portable.
2022-12-25sim: smp: make option available againMike Frysinger1-0/+1
At some point we want this to work, but it's not easy to test if the configure option isn't available. Restore it, but keep the default off.
2022-12-24sim: mips: clean up a bit after mips/configure removalMike Frysinger1-1/+1
Now that there is no subdir configure script, we can clean up some logic that was spread between the files.
2022-12-24sim: mips: move igen settings to top-level configureMike Frysinger1-1/+1
This is the last bit of logic that exists in the mips configure script, so move it to the top-level configure to kill it off. We still have to move the Makefile.in igen logic to local.mk, but this is a required first step for that.
2022-12-21sim: mips: move subtarget defines to top-level configureMike Frysinger1-0/+1
We want to kill off mips/configure entirely. Move this small part out now to get started.
2022-11-07sim: v850: drop subdir configure logicMike Frysinger1-1/+1
We've been using this only to set the default word size to 32. We can easily move this into the makefile via a -D compiler flag and clean up the build logic quite a bit.
2022-11-07sim: mn10300: drop subdir configure logicMike Frysinger1-1/+1
We've been using this only to set the default word size to 32. We can easily move this into the makefile via a -D compiler flag and clean up the build logic quite a bit.
2022-11-07sim: or1k: drop subdir configure logicMike Frysinger1-1/+1
We've been using this only to set the default word size to 32. We can easily move this into the makefile via a -D compiler flag and clean up the build logic quite a bit.
2022-11-07sim: bpf: drop subdir configure logicMike Frysinger1-1/+1
We've been using this only to set the default word size to 64. We can easily move this into the makefile via a -D compiler flag and clean up the build logic quite a bit.
2022-11-07sim: riscv: drop subdir configure logicMike Frysinger1-1/+2
We've been using this only to set the default word size to 32-vs-64 based on the $target. We can easily merge this with the top-level configure script to clean things up a bit.
2022-11-07sim: .gdbinit: generate for all arch subdirsMike Frysinger1-1/+1
This was being skipped for ports that had a recursive configure, but we want it for them too.
2022-11-07sim: build: add a proper var for enabled archesMike Frysinger1-0/+6
The install code was using $SUBDIRS to track all enabled arches. This works, but isn't great if we want to add a subdir that isn't an arch port, or as we merge the subdirs into the top-level. Create a new var explicitly to track the list of enabled arches instead.
2022-11-05sim: run: move linking into top-levelMike Frysinger1-0/+1
Automake will run each subdir individually before moving on to the next one. This means that the linking phase, a single threaded process, will not run in parallel with anything else. When we have to link ~32 ports, that's 32 link steps that don't take advantage of parallel systems. On my really old 4-core system, this cuts a multi-target build from ~60 sec to ~30 sec. We eventually want to move all compile+link steps to this common dir anyways, so might as well move linking now for a nice speedup. We use noinst_PROGRAMS instead of bin_PROGRAMS because we're taking care of the install ourselves rather than letting automake process it.
2022-11-03sim: merge gnulib logic into the top-levelMike Frysinger1-0/+5
We aren't using this just yet, but we will, so make it available to building of common sim files.
2022-10-11sim: Check known getopt definition existenceTsukasa OI1-0/+10
Clang generates a warning if there is a function declaration/definition with zero arguments. Such declarations/definitions without a prototype (an argument list) are deprecated forms of indefinite arguments ("-Wdeprecated-non-prototype"). On the default configuration, it causes a build failure (unless "--disable-werror" is specified). include/getopt.h defines some getopt function definitions but one of them has a form "extern int getopt ();". If this form is selected in include/getopt.h, Clang generates a warning and the build fails by default. In really old environments, this getopt definition with no arguments is necessary (because the definition may change between environments). However, this definition is now a cause of problems on modern environments. A good news is, this definition is not always selected (e.g. if used by binutils/*.c). This is because configuration scripts of binutils, gas, gprof and ld tries to find known definition of getopt function is used and defines HAVE_DECL_GETOPT macro. If this macro is defined when getopt.h is included, a good form of getopt is used and Clang won't generate warnings. This commit adds a modified portion of ld/configure.ac to find the known getopt definition. If we could find one (and we *will* in most modern environments), we don't need to rely on the deprecated definition.
2022-03-28sim: add arch/.gdbinit stub scriptsMike Frysinger1-0/+1
Make it easy to load the common gdbinit script even when running in the arch/ subdir instead of the top-level sim dir.
2022-02-21sim: gdbinit: hoist setup to common codeMike Frysinger1-1/+1
This was left in subdirs because of the dynamic cgen usage. However, we can move this breakpoint call to runtime and let gdb detect whether the symbol exists.
2021-11-28sim: testsuite: setup per-port toolchain settings for multitarget buildMike Frysinger1-0/+2
Gas does not support multitarget builds -- it still only supports a single input & output format. ld is a bit better, but requires manual flags to select the right output. This makes it impossible to run the complete testsuite in a multitarget build. To address this limitation, create a suite of FOR_TARGET variables so these can be set to precompiled as & ld programs. It requires a bit of setup ahead of time, but it's a one-time cost, and makes running the full testsuite at once much easier.
2021-11-18sim: avoid installing headers when there is no simMike Frysinger1-0/+1
If we aren't building any sims, don't install the sim headers as they won't be useful to anyone.
2021-10-31sim: add arch-specific conditional logicMike Frysinger1-0/+3
This will make it easy to include arch-specific logic (build files) as we migrate ports to the common top level build.
2021-09-08sim: update configure target listMike Frysinger1-4/+7
Fix sorting of the list, and update the globs to match the list used in gdb's configure script.
2021-07-01sim: unify reserved instruction bits settingsMike Frysinger1-1/+1
Move these options up to the common dir so we only test & export them once across all ports. The setting only affects igen based ports, and they were turning this on by default, so keep the default in place.
2021-07-01sim: m32r: merge with common configure scriptMike Frysinger1-1/+1
Now that the traps code has been unified, the configure script has no unique logic in it, so it can be merged into the single common one.
2021-06-30sim: cris/frv/iq2000/lm32: merge with common configure scriptMike Frysinger1-4/+5
Now that the scache logic has been migrated into the common code, there's nothing specific in these configure scripts, so merge them into the common one. The frv unique logic can be moved to a dedicated include and merged in the common configure since the flag has been scoped to the arch.
2021-06-30sim: unify scache settingsMike Frysinger1-1/+1
The cgen scache module is enabled by every cgen port, and with the same default value of 16k (which matches the common default value). Let's pull this option out of the individual ports (via CPPFLAGS) and into the common code (via config.h). The object itself is compiled only for cgen ports atm, so that part doesn't change. The scache code is initialized dynamically via the modules.c logic. That's why the profile code needs an additional CGEN_ARCH check. This will allow us to collapse arch configure files more. Merging the source files will require more future work, but integrating the cgen & non-cgen worlds itself will take a lot.
2021-06-30sim: bfin: merge with common configure scriptMike Frysinger1-1/+1
Now that the model logic has been migrated into the runtime, there's nothing specific in the bfin configure code, so merge it into the common one.
2021-06-30sim: move default model to the runtime sim stateMike Frysinger1-1/+0
This kills off another compile-time option by moving the setting to the individual arch runtimes. This will allow dynamic selection by the arch when doing a single build with multiple arches. The sim_model_init rework is a little funky. In the past it was disabled entirely if no default model was set. We maintain the spirit of the logic by gating the fallback logic on whether the port has defined any models.
2021-06-27sim: erc32: merge with common configure scriptMike Frysinger1-1/+1
Move the unique library tests to the common code so we can delete the erc32 configure logic entirely.
2021-06-23sim: switch common srcdir to abs_srcdirMike Frysinger1-1/+1
We rewrite srcdir in subdir Makefiles that we generate from the common parent dir since it points to the parent dir. Since @srcdir@ can be a variety of formats (relative & absolute), switch to @abs_srcdir@ which is a lot easier to adjust. Our use of srcdir in here should handle it.
2021-06-22sim: rx: merge with common configure scriptMike Frysinger1-1/+4
Move the unique configure flag to acinclude.m4 so the common code can include it, then delete the rx configure logic entirely.
2021-06-22sim: drop configure scripts for simple portsMike Frysinger1-19/+65
These ports only use the pieces that have been unified, so we can merge them into the common configure script and get rid of their unique one entirely. We still compile & link separate run programs, and have dedicated subdir Makefiles, but the configure script portion is merged.
2021-06-21sim: unify hardware settingsMike Frysinger1-0/+1
Move these options up to the common dir so we only test & export them once across all ports.
2021-06-20sim: unify cgen maintainer settingsMike Frysinger1-0/+1
Move these options up to the common dir so we only test & export them once across all ports. It makes it available to targets that aren't cgen-based, but those will just ignore the settings, so it shouldn't be an issue.
2021-06-20sim: move sim-inline to the common codeMike Frysinger1-0/+1
This will allow us to build the common code with the same inline settings as the arch subdirs, and only do the test once.
2021-06-19sim: unify toolchain dependency logicMike Frysinger1-3/+10
The common dir is already probing this info since it's using automake, so pass it down to the subdirs so they don't have to probe it at all.
2021-06-18sim: unify -Werror build settingsMike Frysinger1-0/+1
Move these options up to the common dir so we only test & export them once across all ports. It also enables -Werror usage on the common files we've been pulling out of arch subdirs.
2021-06-18sim: create a makefile fragment to pass common settings downMike Frysinger1-1/+1
As we merge settings from subdirs into the common configure, we sometimes need to keep the settings working in both dirs. Create a makefile fragment to pass them down so we don't have to run the checks twice. For now, the file is empty, but we'll start moving logic in shortly.
2021-06-17sim: overhaul & unify endian settings managementMike Frysinger1-0/+1
The m4 macro has 2 args: the "wire" settings (which represents the hardwired port behavior), and the default settings (which are used if nothing else is specified). If none are specified, the arch is expected to support both, and the value will be probed based on the user runtime options or the input program. Only two arches today set the default value (bpf & mips). We can probably let this go as it only shows up in one scenario: the sim is invoked, but with no inputs, and no user endian selection. This means bpf will not behave like the other arches: an error is shown and forces the user to make a choice. If an input program is used though, we'll still switch the default to that. This allows us to remove the WITH_DEFAULT_TARGET_BYTE_ORDER setting. For the ports that set a "wire" endian, move it to the runtime init of the respective sim_open calls. This allows us to change the WITH_TARGET_BYTE_ORDER to purely a user-selected configure setting if they want to force a specific endianness. With all the endian logic moved to runtime selection, we can move the configure call up to the common dir so we only process it once across all ports. The ppc arch was picking the wire endian based on the target used, but since we weren't doing that for other biendian arches, we can let this go too. We'll rely on the input selecting the endian, or make the user decide.
2021-06-14sim: enable silent rules in common buildsMike Frysinger1-0/+1
We only do the common code as automake simplifies the logic.
2021-06-12sim: overhaul alignment settings managementMike Frysinger1-0/+1
Currently, the sim-config module will abort if alignment settings haven't been specified by the port's configure.ac. This is a bit weird when we've allowed SIM_AC_OPTION_ALIGNMENT to seem like it's optional to use. Thus everyone invokes it. There are 4 alignment settings, but really only 2 matters: strict and nonstrict. The "mixed" setting is just the default ("unset"), and "forced" isn't used directly by anyone (it's available as a runtime option for some ports). The m4 macro has 2 args: the "wire" settings (which represents the hardwired port behavior), and the default settings (which are used if nothing else is specified). If none are specified, then the build won't work (see above as if SIM_AC_OPTION_ALIGNMENT wasn't called). If default settings are provided, then that is used, but we allow the user to override at runtime. Otherwise, the "wire" settings are used and user runtime options to change are ignored. Most ports specify a default, or set the "wire" to nonstrict. A few set "wire" to strict, but it's not clear that's necessary as it doesn't make the code behavior, by default, any different. It might make things a little faster, but we should provide the user the choice of the compromises to make: force a specific mode at compile time for faster runtime, or allow the choice at runtime. More likely it seems like an oversight when these ports were initially created, and/or copied & pasted from existing ports. With all that backstory, let's get to what this commit does. First kill off the idea of a compile-time default alignment and set it to nonstrict in the common code. For any ports that want strict alignment by default, that code is moved to sim_open while initializing the sim. That means WITH_DEFAULT_ALIGNMENT can be completely removed. Moving the default alignment to the runtime also allows removal of setting the "wire" settings at configure time. Which allows removing of all arguments to SIM_AC_OPTION_ALIGNMENT and moving that call to common code. The macro logic can be reworked to not pass WITH_ALIGNMENT as -D CPPFLAG and instead move it to config.h. All of these taken together mean we can hoist the macro up to the top level and share it among all sims so behavior is consistent among all the ports.
2021-06-12sim: unify bug & package settingsMike Frysinger1-0/+7
Move these options up to the common dir so we only test & export them once across all ports. The AC_INIT macro does a lot of the heavy lifting already which allows further simplification.
2021-06-12sim: unify debug/stdio/trace/profile build settingsMike Frysinger1-0/+6
Move these options up to the common dir so we only test & export them once across all ports. The ppc code needs a little extra care with its trace settings as it's not exactly the same API as the common code. The other knobs are the same though.
2021-06-12sim: unify environment build settingsMike Frysinger1-0/+1
Move the --sim-enable-environment option up to the common dir so we only test & export it once across all ports.