]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - sim/m4/sim_ac_option_endian.m4
sim: overhaul & unify endian settings management
[thirdparty/binutils-gdb.git] / sim / m4 / sim_ac_option_endian.m4
CommitLineData
760b3e8b
MF
1dnl Copyright (C) 1997-2021 Free Software Foundation, Inc.
2dnl
3dnl This program is free software; you can redistribute it and/or modify
4dnl it under the terms of the GNU General Public License as published by
5dnl the Free Software Foundation; either version 3 of the License, or
6dnl (at your option) any later version.
7dnl
8dnl This program is distributed in the hope that it will be useful,
9dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
10dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11dnl GNU General Public License for more details.
12dnl
13dnl You should have received a copy of the GNU General Public License
14dnl along with this program. If not, see <http://www.gnu.org/licenses/>.
15dnl
16dnl --enable-sim-endian={yes,no,big,little} is for simulators
17dnl that support both big and little endian targets.
760b3e8b 18AC_DEFUN([SIM_AC_OPTION_ENDIAN],
f9a4d543
MF
19[dnl
20AC_MSG_CHECKING([whether to force sim endianness])
21sim_endian=
760b3e8b
MF
22AC_ARG_ENABLE(sim-endian,
23[AS_HELP_STRING([--enable-sim-endian=endian],
24 [Specify target byte endian orientation])],
25[case "${enableval}" in
f9a4d543
MF
26 b*|B*) sim_endian="BFD_ENDIAN_BIG";;
27 l*|L*) sim_endian="BFD_ENDIAN_LITTLE";;
28 yes | no) ;;
29 *) AC_MSG_ERROR("Unknown value $enableval for --enable-sim-endian");;
30esac])dnl
31AC_DEFINE_UNQUOTED([WITH_TARGET_BYTE_ORDER],
32 [${sim_endian:-BFD_ENDIAN_UNKNOWN}], [Sim endian settings])
33AC_MSG_RESULT([${sim_alignment:-no}])
34])dnl