File tree Expand file tree Collapse file tree 2 files changed +36
-0
lines changed Expand file tree Collapse file tree 2 files changed +36
-0
lines changed Original file line number Diff line number Diff line change 2020# cmake -B build
2121# cmake --build build
2222
23+ # Some useful tool versions to know about:
24+ # cmake 3.14.0 2019-03-14 Current minimum requirement
25+ # cmake 3.20.0 2021-03-23 Adds CMAKE_C_BYTE_ORDER
26+
2327cmake_minimum_required (VERSION 3.14)
2428project (avrdude VERSION 8.0 LANGUAGES C)
2529
@@ -51,6 +55,21 @@ include(GNUInstallDirs)
5155set (CONFIG_DIR "${CMAKE_INSTALL_FULL_SYSCONFDIR} " )
5256set (AVRDUDE_FULL_VERSION ${CMAKE_PROJECT_VERSION} )
5357
58+
59+ # =====================================================================
60+ # Abort the build for non-little endian targets
61+ #
62+ # Our minimum cmake requirement is 3.14, so we cannot use
63+ # CMAKE_C_BYTE_ORDER (cmake >= 3.20) to detect the byte order.
64+ # =====================================================================
65+
66+ include (TestBigEndian)
67+ test_big_endian(AVRDUDE_TARGET_IS_BIG_ENDIAN)
68+ if (AVRDUDE_TARGET_IS_BIG_ENDIAN)
69+ message (FATAL_ERROR "avrdude cannot be built for a Big Endian target at this time" )
70+ endif ()
71+
72+
5473# =====================================
5574# Get Git commit info
5675# =====================================
Original file line number Diff line number Diff line change 2424dnl 2019-03-14 cmake 3.13
2525dnl
2626dnl 2006-10-23 autoconf 2.60 used to be avrdude's requirement
27+ dnl 2012-04-24 autoconf 2.62 AC_C_BIGENDIAN
2728dnl 2012-04-24 autoconf 2.69
2829dnl 2021-01-28 autoconf 2.71
2930dnl
169170dnl Makefile.am:77: compiling `config_gram.c' with per-target flags requires `AM_PROG_CC_C_O' in `configure.ac'
170171AM_PROG_CC_C_O
171172
173+
174+ ad_target_is_little_endian=false
175+ AC_C_BIGENDIAN ( [ dnl
176+ ] , [ dnl
177+ dnl Target is Little Endian, which avrdude actually supports.
178+ ad_target_is_little_endian=:
179+ ] , [ dnl
180+ ] , [ dnl
181+ ] )
182+
183+ AS_IF ( [ $ad_target_is_little_endian] , [ dnl
184+ ] , [ dnl
185+ AC_MSG_ERROR ( [ avrdude only supports building for little endian targets at this time] )
186+ ] )
187+
188+
172189# Checks for libraries.
173190# For MinGW.
174191AC_CHECK_LIB ( [ ws2_32] , [ WSAStartup] )
You can’t perform that action at this time.
0 commit comments