dnl Process this file with autoconf to produce a configure script.
dnl
-dnl Copyright (C) 2012-2021 Free Software Foundation, Inc.
+dnl Copyright (C) 2012-2023 Free Software Foundation, Inc.
dnl
dnl This file is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE
+AM_SILENT_RULES([yes])
AC_PROG_CC
AC_GNU_SOURCE
[Have readelf and objdump follow debug links by default])
+
+
+AC_ARG_ENABLE(colored-disassembly,
+[AS_HELP_STRING([--enable-colored-disassembly],
+ [Have objdump use colors in its disassembly by default])], [
+if test "${enableval}" = no; then
+ default_for_colored_disassembly=0
+else
+ default_for_colored_disassembly=1
+fi], [default_for_colored_disassembly=0])
+
+AC_DEFINE_UNQUOTED(DEFAULT_FOR_COLORED_DISASSEMBLY, $default_for_colored_disassembly,
+ [Have objdump use colors in its disassembly by default])
+
+
AC_DEBUGINFOD
GCC_ENABLE([libctf], [yes], [], [Handle .ctf type-info sections])
esac
AC_SUBST(DEMANGLER_NAME)
-AC_CHECK_SIZEOF([long])
-AC_CHECK_SIZEOF([long long])
-
# We use headers from include/ that check various HAVE_*_H macros, thus
# should ensure they are set by configure. This is true even when C99
# guarantees they are available.
# plugin-api.h tests HAVE_STDINT_H and HAVE_INTTYPES_H
# Besides those, we need to check anything used in binutils/ not in C99.
AC_CHECK_HEADERS(fcntl.h inttypes.h stdint.h sys/file.h \
- sys/stat.h sys/types.h unistd.h)
+ sys/stat.h sys/time.h sys/types.h unistd.h)
AC_HEADER_SYS_WAIT
AC_FUNC_MMAP
-AC_CHECK_FUNCS(getc_unlocked sbrk utimes)
-AC_CHECK_FUNC([mkstemp],
- AC_DEFINE([HAVE_MKSTEMP], 1,
- [Define to 1 if you have the `mkstemp' function.]))
-AC_CHECK_FUNC([mkdtemp],
- AC_DEFINE([HAVE_MKDTEMP], 1,
- [Define to 1 if you have the `mkdtemp' function.]))
- AC_MSG_CHECKING([for mbstate_t])
- AC_TRY_COMPILE([#include <wchar.h>],
- [mbstate_t teststate;],
- have_mbstate_t=yes, have_mbstate_t=no)
- AC_MSG_RESULT($have_mbstate_t)
- if test x"$have_mbstate_t" = xyes; then
- AC_DEFINE(HAVE_MBSTATE_T,1,[Define if mbstate_t exists in wchar.h.])
- fi
+AC_CHECK_FUNCS(fseeko fseeko64 getc_unlocked mkdtemp mkstemp utimensat utimes)
+
+AC_MSG_CHECKING([for mbstate_t])
+AC_TRY_COMPILE([#include <wchar.h>],
+[mbstate_t teststate;],
+have_mbstate_t=yes, have_mbstate_t=no)
+AC_MSG_RESULT($have_mbstate_t)
+if test x"$have_mbstate_t" = xyes; then
+ AC_DEFINE(HAVE_MBSTATE_T,1,[Define if mbstate_t exists in wchar.h.])
+fi
+
+# Copied from gnulib stat-time.m4.
+# We should just switch over to using gnulib.
+AC_CHECK_MEMBERS([struct stat.st_atim.tv_nsec],
+ [AC_CACHE_CHECK([whether struct stat.st_atim is of type struct timespec],
+ [ac_cv_typeof_struct_stat_st_atim_is_struct_timespec],
+ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+ [[
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #if HAVE_SYS_TIME_H
+ # include <sys/time.h>
+ #endif
+ #include <time.h>
+ struct timespec ts;
+ struct stat st;
+ ]],
+ [[
+ st.st_atim = ts;
+ ]])],
+ [ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=yes],
+ [ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=no])])
+ if test $ac_cv_typeof_struct_stat_st_atim_is_struct_timespec = yes; then
+ AC_DEFINE([TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC], [1],
+ [Define to 1 if the type of the st_atim member of a struct stat is
+ struct timespec.])
+ fi],
+ [AC_CHECK_MEMBERS([struct stat.st_atimespec.tv_nsec], [],
+ [AC_CHECK_MEMBERS([struct stat.st_atimensec], [],
+ [AC_CHECK_MEMBERS([struct stat.st_atim.st__tim.tv_nsec], [], [],
+ [#include <sys/types.h>
+ #include <sys/stat.h>])],
+ [#include <sys/types.h>
+ #include <sys/stat.h>])],
+ [#include <sys/types.h>
+ #include <sys/stat.h>])],
+ [#include <sys/types.h>
+ #include <sys/stat.h>])
# Some systems have frexp only in -lm, not in -lc.
AC_SEARCH_LIBS(frexp, m)
AC_DEFINE(HAVE_GOOD_UTIME_H, 1, [Does <utime.h> define struct utimbuf?])
fi
-AC_CHECK_DECLS([asprintf, environ, getc_unlocked, sbrk, stpcpy])
+AC_CHECK_DECLS([asprintf, environ, getc_unlocked, stpcpy, strnlen])
-# Link in zlib if we can. This allows us to read compressed debug
+# Link in zlib/zstd if we can. This allows us to read compressed debug
# sections. This is used only by readelf.c (objdump uses bfd for
# reading compressed sections).
AM_ZLIB
+AC_ZSTD
BFD_BINARY_FOPEN
+# Support for the msgpack C library.
+AC_ARG_WITH([msgpack],
+ AC_HELP_STRING([--with-msgpack], [Enable msgpack support (auto/yes/no)]),
+ [],
+ [with_msgpack=auto])
+
+AS_IF([test "$with_msgpack" != no],
+ [PKG_CHECK_MODULES(MSGPACK, msgpack,
+ [AC_DEFINE([HAVE_MSGPACK], [1], [Define to 1 if msgpack is available.])],
+ [AS_IF([test "$with_msgpack" = yes],
+ [AC_MSG_ERROR([--with-msgpack was given, but msgpack is missing or unusable.])])])])
+
# target-specific stuff:
# Canonicalize the secondary target names.
fi
DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
- od_vectors="$od_vectors objdump_private_desc_xcoff"
+ od_vectors="$od_vectors objdump_private_desc_xcoff objdump_private_desc_pe"
else
case $targ in
*-*-hms*) BUILD_SRCONV='$(SRCONV_PROG)' ;;
esac
case $targ in
+ aarch64-*-mingw*)
+ BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
+ if test -z "$DLLTOOL_DEFAULT"; then
+ DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_AARCH64"
+ fi
+ DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_AARCH64"
+ BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
+ BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
+ BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
+ ;;
arm-wince-pe* | arm-*-wince | arm*-*-cegcc* | arm*-*-mingw32ce*)
BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
if test -z "$DLLTOOL_DEFAULT"; then
BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
;;
changequote(,)dnl
- i[3-7]86-*-pe* | i[3-7]86-*-cygwin* | i[3-7]86-*-mingw32** | i[3-7]86-*-netbsdpe*)
+ i[3-7]86-*-pe* | i[3-7]86-*-cygwin* | i[3-7]86-*-mingw32**)
changequote([,])dnl
BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
if test -z "$DLLTOOL_DEFAULT"; then
spu-*-*)
BUILD_MISC="${BUILD_MISC} "'bin2c$(EXEEXT_FOR_BUILD)'
;;
- mips*-*-pe)
- BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
- if test -z "$DLLTOOL_DEFAULT"; then
- DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MIPS"
- fi
- DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MIPS"
- BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
- BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
- ;;
mcore-*-pe)
BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
if test -z "$DLLTOOL_DEFAULT"; then
powerpc*-*-aix* | rs6000-*-aix*)
od_vectors="$od_vectors objdump_private_desc_xcoff"
;;
+ *-*-pe* | *-*-cygwin* | *-*-mingw*)
+ od_vectors="$od_vectors objdump_private_desc_pe"
+ ;;
*-*-darwin*)
od_vectors="$od_vectors objdump_private_desc_mach_o"
;;
od_files="$od_files od-elf32_avr" ;;
objdump_private_desc_xcoff)
od_files="$od_files od-xcoff" ;;
+ objdump_private_desc_pe)
+ od_files="$od_files od-pe" ;;
objdump_private_desc_mach_o)
od_files="$od_files od-macho" ;;
*) AC_MSG_ERROR(*** unknown private vector $i) ;;
AC_SUBST(htmldir)
AC_SUBST(pdfdir)
-AC_CONFIG_FILES(Makefile doc/Makefile po/Makefile.in:po/Make-in)
+AC_CONFIG_FILES(Makefile po/Makefile.in:po/Make-in)
AC_OUTPUT
GNU_MAKE_JOBSERVER