1
0
Fork 0

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
This commit is contained in:
Peter Veenstra 2018-08-21 11:57:32 +00:00
parent dd304cbef1
commit 66fdd8f1de

View file

@ -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])