@@ -52,9 +52,16 @@ AC_SEARCH_LIBS([openpty], [util])
5252
5353AC_CHECK_HEADERS ( [ sys/socket.h] )
5454AC_CHECK_HEADERS ( [ elf.h] )
55- AC_EGREP_HEADER ( Elf64_Ehdr , [ elf.h] , [
56- AC_DEFINE ( [ HAVE_ELF64] , [ 1] , [ Define to 1 if the system has the type `Elf64_Ehdr'.] )
57- ] )
55+
56+ AC_CHECK_TYPE ( [ Elf64_Ehdr] ,
57+ AC_DEFINE ( [ HAVE_ELF64] , [ 1] , [ Define to 1 if the system has the type 'Elf64_Ehdr'.] ) ,
58+ [ ] , [ [ #include <elf.h>] ] )
59+
60+ AC_MSG_CHECKING ( [ for glibc] )
61+ AC_COMPILE_IFELSE ( [ AC_LANG_PROGRAM ( [ [ #include <features.h>] ] , [ [ int v = __GLIBC__;return 0;] ] ) ] ,
62+ [ have_glibc=yes] , [ have_glibc=no] )
63+ AC_MSG_RESULT ( $have_glibc )
64+
5865AC_CHECK_HEADERS ( [ fcntl.h] )
5966AC_CHECK_HEADERS ( [ malloc.h] )
6067AC_CHECK_HEADERS ( [ netdb.h] )
@@ -164,6 +171,9 @@ m4_define([PCIE_ADAPTERS],
164171m4_define ( [ SERIAL_PORT_ADAPTERS] ,
165172 [ [ [ buspirate] , [ Bus Pirate] , [ BUS_PIRATE] ] ] )
166173
174+ m4_define ( [ LINUXSPIDEV_ADAPTER] ,
175+ [ [ [ linuxspidev] , [ Linux spidev driver] , [ LINUXSPIDEV] ] ] )
176+
167177# The word 'Adapter' in "Dummy Adapter" below must begin with a capital letter
168178# because there is an M4 macro called 'adapter'.
169179m4_define ( [ DUMMY_ADAPTER] ,
@@ -258,7 +268,7 @@ AC_ARG_ENABLE([malloc_logging],
258268
259269AC_MSG_CHECKING ( [ whether to enable malloc free space logging] ) ;
260270AC_MSG_RESULT ( [ $debug_malloc] )
261- AS_IF ( [ test "x$debug_malloc" = "xyes"] , [
271+ AS_IF ( [ test "x$debug_malloc" = "xyes" -a "x$have_glibc" = "xyes" ] , [
262272 AC_DEFINE ( [ _DEBUG_FREE_SPACE_] ,[ 1] , [ Include malloc free space in logging] )
263273] )
264274
@@ -290,6 +300,7 @@ AC_ARG_ADAPTERS([
290300 LIBFTDI_ADAPTERS,
291301 LIBFTDI_USB1_ADAPTERS,
292302 LIBGPIOD_ADAPTERS,
303+ LINUXSPIDEV_ADAPTER,
293304 SERIAL_PORT_ADAPTERS,
294305 DUMMY_ADAPTER,
295306 PCIE_ADAPTERS,
@@ -389,8 +400,8 @@ AS_CASE([$host_os],
389400] )
390401
391402AC_ARG_ENABLE ( [ internal-jimtcl] ,
392- AS_HELP_STRING ( [ --disable -internal-jimtcl] , [ Disable building internal jimtcl] ) ,
393- [ use_internal_jimtcl=$enableval] , [ use_internal_jimtcl=yes ] )
403+ AS_HELP_STRING ( [ --enable -internal-jimtcl] , [ Enable building internal jimtcl (deprecated) ] ) ,
404+ [ use_internal_jimtcl=$enableval] , [ use_internal_jimtcl=no ] )
394405
395406AC_ARG_ENABLE ( [ jimtcl-maintainer] ,
396407 AS_HELP_STRING ( [ --enable-jimtcl-maintainer] , [ Enable maintainer mode when building internal jimtcl] ) ,
@@ -727,6 +738,7 @@ PROCESS_ADAPTERS([LIBJAYLINK_ADAPTERS], ["x$use_internal_libjaylink" = "xyes" -o
727738PROCESS_ADAPTERS([ PCIE_ADAPTERS] , [ "x$is_linux" = "xyes"] , [ Linux build] )
728739PROCESS_ADAPTERS([ SERIAL_PORT_ADAPTERS] , [ "x$can_build_buspirate" = "xyes"] ,
729740 [ internal error: validation should happen beforehand] )
741+ PROCESS_ADAPTERS([ LINUXSPIDEV_ADAPTER] , [ "x$is_linux" = "xyes"] , [ Linux spidev] )
730742PROCESS_ADAPTERS([ DUMMY_ADAPTER] , [ true] , [ unused] )
731743
732744AS_IF ( [ test "x$enable_linuxgpiod" != "xno"] , [
@@ -867,6 +879,10 @@ AS_IF([test "x$enable_jlink" != "xno"], [
867879 ] ])
868880)
869881
882+ AS_IF ( [ test "x$use_internal_jimtcl" = "xyes"] , [
883+ AC_MSG_WARN ( [ Using the internal jimtcl is deprecated and will not be possible in the future.] )
884+ ] )
885+
870886echo
871887echo
872888echo OpenOCD configuration summary
@@ -876,6 +892,7 @@ m4_foreach([adapter], [USB1_ADAPTERS,
876892 LIBFTDI_USB1_ADAPTERS,
877893 LIBGPIOD_ADAPTERS,
878894 LIBJAYLINK_ADAPTERS, PCIE_ADAPTERS, SERIAL_PORT_ADAPTERS,
895+ LINUXSPIDEV_ADAPTER,
879896 DUMMY_ADAPTER,
880897 OPTIONAL_LIBRARIES,
881898 COVERAGE] ,
0 commit comments