add operators library to contain operator-overloads of +/-/*/div/>/>= etc
[riscv-isa-sim.git] / configure.ac
1 #=========================================================================
2 # Toplevel configure.ac for the Modular C++ Build System
3 #=========================================================================
4 # Please read the documenation in 'mcppbs-doc.txt' for more details on
5 # how the Modular C++ Build System works. For most new projects, a
6 # developer will only need to make the following changes:
7 #
8 # - change the project metadata listed right below
9 # - update the list of subprojects via the 'MCPPBS_SUBPROJECTS' macro
10 # - possibly add subproject groups if needed to ease configuration
11 # - add more configure checks for platform specific configuration
12 #
13
14 #-------------------------------------------------------------------------
15 # Project metadata
16 #-------------------------------------------------------------------------
17
18 m4_define( proj_name, [RISC-V ISA Simulator])
19 m4_define( proj_maintainer, [Andrew Waterman])
20 m4_define( proj_abbreviation, [spike])
21
22 #-------------------------------------------------------------------------
23 # Project version information
24 #-------------------------------------------------------------------------
25 # Version information is meant to be managed through a version control
26 # system's tags and revision numbers. In a working copy the version will
27 # not be defined here (you should just use the version control system's
28 # mechanisms). When we make a distribution then we can set the version
29 # here as formed by the scripts/vcs-version.sh script so that the
30 # distribution knows what version it came from. If you are not using
31 # version control then it is fine to set this directly.
32
33 m4_define( proj_version, [?])
34
35 #-------------------------------------------------------------------------
36 # Setup
37 #-------------------------------------------------------------------------
38
39 AC_INIT(proj_name,proj_version,proj_maintainer,proj_abbreviation)
40 AC_LANG_CPLUSPLUS
41 AC_CONFIG_SRCDIR([riscv/common.h])
42 AC_CONFIG_AUX_DIR([scripts])
43 AC_CANONICAL_BUILD
44 AC_CANONICAL_HOST
45
46 #-------------------------------------------------------------------------
47 # Checks for programs
48 #-------------------------------------------------------------------------
49
50 AC_PROG_CC
51 AC_PROG_CXX
52 AC_CHECK_TOOL([AR],[ar])
53 AC_CHECK_TOOL([RANLIB],[ranlib])
54 AC_PATH_PROG([DTC],[dtc],[no])
55 AS_IF([test x"$DTC" == xno],AC_MSG_ERROR([device-tree-compiler not found]))
56 AC_DEFINE_UNQUOTED(DTC, ["$DTC"], [Path to the device-tree-compiler])
57
58 AC_C_BIGENDIAN(AC_MSG_ERROR([Spike requires a little-endian host]))
59
60 #-------------------------------------------------------------------------
61 # MCPPBS specific program checks
62 #-------------------------------------------------------------------------
63 # These macros check to see if we can do a stow-based install and also
64 # check for an isa simulator suitable for running the unit test programs
65 # via the makefile.
66
67 MCPPBS_PROG_INSTALL
68
69 #-------------------------------------------------------------------------
70 # Checks for header files
71 #-------------------------------------------------------------------------
72
73 AC_HEADER_STDC
74
75 #-------------------------------------------------------------------------
76 # Default compiler flags
77 #-------------------------------------------------------------------------
78
79 AC_SUBST([CFLAGS], ["-Wall -Wno-unused -g -O2"])
80 AC_SUBST([CXXFLAGS],["-Wall -Wno-unused -g -O2 -std=c++11"])
81
82 #-------------------------------------------------------------------------
83 # Enable Simple-V
84 #-------------------------------------------------------------------------
85
86 simplev="no"
87
88 AC_ARG_ENABLE([simplev],
89 [AC_HELP_STRING([--disable-simplev],[Support for SimpleV (default enabled)])],
90 [simplev=$enableval],
91 [simplev=yes]
92 )
93 if test "x$simplev" = xyes; then
94 AC_DEFINE([SPIKE_SIMPLEV], [1], [Defined to 1 if SimpleV support is wanted])
95 fi
96
97 #-------------------------------------------------------------------------
98 # MCPPBS subproject list
99 #-------------------------------------------------------------------------
100 # Order list so that subprojects only depend on those listed earlier.
101 # The '*' suffix indicates an optional subproject. The '**' suffix
102 # indicates an optional subproject which is also the name of a group.
103
104 MCPPBS_SUBPROJECTS([ riscv, dummy_rocc, softfloat, operators, spike_main ])
105
106 #-------------------------------------------------------------------------
107 # MCPPBS subproject groups
108 #-------------------------------------------------------------------------
109 # If a group has the same name as a subproject then you must add the
110 # '**' suffix in the subproject list above. The list of subprojects in a
111 # group should be ordered so that subprojets only depend on those listed
112 # earlier. Here is an example:
113 #
114 # MCPPBS_GROUP( [group-name], [sproja,sprojb,...] )
115 #
116
117 #-------------------------------------------------------------------------
118 # Output
119 #-------------------------------------------------------------------------
120
121 AC_CONFIG_HEADERS([config.h])
122 AC_CONFIG_FILES([Makefile])
123 AC_CONFIG_FILES([riscv-spike.pc])
124 AC_CONFIG_FILES([riscv-riscv.pc])
125 AC_CONFIG_FILES([riscv-softfloat.pc])
126 AC_CONFIG_FILES([riscv-operators.pc])
127 AC_CONFIG_FILES([riscv-dummy_rocc.pc])
128 AC_CONFIG_FILES([riscv-spike_main.pc])
129 AC_OUTPUT