From 66fdd8f1de2c135f3f2a90af01597a2d8223c6e4 Mon Sep 17 00:00:00 2001 From: Peter Veenstra Date: Tue, 21 Aug 2018 11:57:32 +0000 Subject: [PATCH] add a bit of hack to make building a 32 bit binary for Apple a bit easier Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4138 --- configure.ac | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/configure.ac b/configure.ac index 230114eb..09591039 100644 --- a/configure.ac +++ b/configure.ac @@ -302,6 +302,36 @@ case "$host_cpu" in ;; esac +dnl check for size of pointer being 4 +AC_COMPILE_IFELSE([AC_LANG_SOURCE([ +#if SIZEOF_INT_P != 4 +#error size intp is not 4, this not something to worry about +#endif +void blah() { +; +} +])],[c_sizep=4],[c_sizep=0]) + + +dnl automake 1.14 and upwards rewrite the host to have always 64 bit unless i386 as host is passed +dnl this can make building a 32 bit executable a bit tricky, as dosbox relies on the host to select the +dnl dynamic/dynrec core +AC_MSG_CHECKING([whether Apple user wants to override the build process to produce a 32 bit binary]) +case "$host" in + *-*-darwin*) + if test x$c_targetcpu = xx86_64 -a x$c_sizep = x4 ; then + AC_MSG_RESULT(yes) + AC_DEFINE(C_TARGETCPU,X86) + c_targetcpu="x86" + else + AC_MSG_RESULT(no) + fi + ;; + *) + AC_MSG_RESULT([no, not on Apple]) + ;; +esac + AC_ARG_ENABLE(dynamic-core,AC_HELP_STRING([--disable-dynamic-core],[Disable all dynamic cores]),,enable_dynamic_core=yes) AH_TEMPLATE(C_DYNAMIC_X86,[Define to 1 to use x86 dynamic cpu core])