diff --git a/config.h.in b/config.h.in index 5d8a520..301aa5e 100644 --- a/config.h.in +++ b/config.h.in @@ -165,9 +165,15 @@ /* Define to 1 if you have the header file. */ #undef HAVE_MACHINE_RELOC_H +/* Define to 1 if you have the header file. */ +#undef HAVE_MACH_O_ARM64_RELOC_H + /* Define to 1 if you have the header file. */ #undef HAVE_MACH_O_RELOC_H +/* Define to 1 if you have the header file. */ +#undef HAVE_MACH_O_X86_64_RELOC_H + /* Define to 1 if you have the header file. */ #undef HAVE_MALLOC_H diff --git a/configure b/configure index dee7330..d934d82 100755 --- a/configure +++ b/configure @@ -18822,6 +18822,19 @@ fi done +for ac_header in mach-o/x86_64/reloc.h mach-o/arm64/reloc.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + for ac_header in windows.h tchar.h semaphore.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` diff --git a/configure.ac b/configure.ac index 9f93a95..a282259 100644 --- a/configure.ac +++ b/configure.ac @@ -111,6 +111,7 @@ AC_CHECK_HEADERS([stdarg.h sys/errno.h sys/filio.h sys/mman.h sys/resource.h]) AC_CHECK_HEADERS([sys/sockio.h sys/stat.h termios.h sys/times.h]) AC_CHECK_HEADERS([sys/types.h sys/uio.h sys/un.h sys/utsname.h sys/select.h sys/sysctl.h]) AC_CHECK_HEADERS([sys/elf_SPARC.h sys/elf_386.h sys/elf_amd64.h asm/elf.h machine/reloc.h i386/elf_machdep.h]) +AC_CHECK_HEADERS([mach-o/x86_64/reloc.h mach-o/arm64/reloc.h]) AC_CHECK_HEADERS([windows.h tchar.h semaphore.h]) AC_CHECK_HEADERS([stdint.h inttypes.h]) diff --git a/libpolyml/machoexport.cpp b/libpolyml/machoexport.cpp index 1fcb020..4b18b4e 100644 --- a/libpolyml/machoexport.cpp +++ b/libpolyml/machoexport.cpp @@ -55,9 +55,15 @@ #include #include #include + +#ifdef HAVE_MACH_O_X86_64_RELOC_H #include -#include +#endif +// Older versions of Mac OS didn't have this. +#ifdef HAVE_MACH_O_ARM64_RELOC_H +#include +#endif #ifdef HAVE_STRING_H #include #endif