From c91ef547bd7912c618da62854416348a8f0d8eb2 Mon Sep 17 00:00:00 2001 From: Dave Vasilevsky Date: Mon, 28 Dec 2015 23:26:19 -0500 Subject: [PATCH 01/59] Allow building with GCC 5 * Disable -freorder-blocks-and-partition, since it can override -fno-reorder-blocks * Disable look-header copying, since it tends to cause early returns * Disable argument pushing, we don't want to change esp --- SheepShaver/src/Unix/configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SheepShaver/src/Unix/configure.ac b/SheepShaver/src/Unix/configure.ac index 11e4c10a..31b6341c 100644 --- a/SheepShaver/src/Unix/configure.ac +++ b/SheepShaver/src/Unix/configure.ac @@ -1575,7 +1575,7 @@ if [[ "x$EMULATED_PPC" = "xyes" ]]; then fi DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -finline-functions -finline-limit=10000 -fno-exceptions -g0" if [[ "x$have_dyngen_gcc3" = "xyes" ]]; then - DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -fno-reorder-blocks -fno-optimize-sibling-calls" + DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -fno-reorder-blocks -fno-optimize-sibling-calls -fno-reorder-blocks-and-partition -fno-tree-ch -mno-push-args" fi if [[ "x$DYNGEN_CC" != "x$CXX" ]]; then DYNGEN_CFLAGS="-O2 $CFLAGS" From f64b888f788278bd703f568fa01185cce7615818 Mon Sep 17 00:00:00 2001 From: Dave Vasilevsky Date: Mon, 28 Dec 2015 23:28:17 -0500 Subject: [PATCH 02/59] Make dyngen_barrier() stronger on x86 GCC 5 will optimize out an empty 'asm volatile' in op_sraw_T0_T1, and then give us multiple return points. Add a nop so it doesn't do this, at the cost of lower code density. --- SheepShaver/src/kpx_cpu/src/cpu/jit/dyngen-exec.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/SheepShaver/src/kpx_cpu/src/cpu/jit/dyngen-exec.h b/SheepShaver/src/kpx_cpu/src/cpu/jit/dyngen-exec.h index 8c12fe6b..bf772a58 100644 --- a/SheepShaver/src/kpx_cpu/src/cpu/jit/dyngen-exec.h +++ b/SheepShaver/src/kpx_cpu/src/cpu/jit/dyngen-exec.h @@ -61,7 +61,11 @@ #endif // Force only one return point +#if defined(__i386__) || defined(__x86_64__) +#define dyngen_barrier() asm volatile ("nop") +#else #define dyngen_barrier() asm volatile ("") +#endif #ifndef OPPROTO #define OPPROTO From b74ae092c942fbe0fd55a6c082b62487f901fda9 Mon Sep 17 00:00:00 2001 From: Andrew Tonner Date: Wed, 18 Jan 2017 04:41:40 -0800 Subject: [PATCH 03/59] builds on mingw32 without jit, still untested --- .gitignore | 134 +++++ BasiliskII/src/include/debug.h | 2 + SheepShaver/Makefile | 3 +- SheepShaver/src/BeOS/SheepDriver | 1 - SheepShaver/src/BeOS/SheepNet | 1 - SheepShaver/src/BeOS/audio_beos.cpp | 1 - SheepShaver/src/BeOS/extfs_beos.cpp | 1 - SheepShaver/src/BeOS/scsi_beos.cpp | 1 - SheepShaver/src/BeOS/serial_beos.cpp | 1 - SheepShaver/src/BeOS/sys_beos.cpp | 1 - SheepShaver/src/BeOS/timer_beos.cpp | 1 - SheepShaver/src/BeOS/xpram_beos.cpp | 1 - SheepShaver/src/CrossPlatform/sigsegv.cpp | 1 - SheepShaver/src/CrossPlatform/sigsegv.h | 1 - SheepShaver/src/CrossPlatform/video_blit.cpp | 1 - SheepShaver/src/CrossPlatform/video_blit.h | 1 - SheepShaver/src/CrossPlatform/video_vosf.h | 1 - SheepShaver/src/CrossPlatform/vm_alloc.cpp | 1 - SheepShaver/src/CrossPlatform/vm_alloc.h | 1 - SheepShaver/src/MacOSX/AudioBackEnd.cpp | 1 - SheepShaver/src/MacOSX/AudioBackEnd.h | 1 - SheepShaver/src/MacOSX/AudioDevice.cpp | 1 - SheepShaver/src/MacOSX/AudioDevice.h | 1 - SheepShaver/src/MacOSX/MacOSX_sound_if.cpp | 1 - SheepShaver/src/MacOSX/MacOSX_sound_if.h | 1 - SheepShaver/src/MacOSX/audio_macosx.cpp | 1 - SheepShaver/src/MacOSX/clip_macosx.cpp | 1 - SheepShaver/src/MacOSX/clip_macosx64.mm | 1 - SheepShaver/src/MacOSX/extfs_macosx.cpp | 1 - SheepShaver/src/MacOSX/macos_util_macosx.h | 1 - SheepShaver/src/MacOSX/sys_darwin.cpp | 1 - SheepShaver/src/MacOSX/utils_macosx.h | 1 - SheepShaver/src/MacOSX/utils_macosx.mm | 1 - SheepShaver/src/SDL | 1 - SheepShaver/src/Unix/Darwin/lowmem.c | 1 - SheepShaver/src/Unix/Darwin/mkstandalone | 1 - SheepShaver/src/Unix/Darwin/pagezero.c | 1 - SheepShaver/src/Unix/Darwin/testlmem.sh | 1 - SheepShaver/src/Unix/Irix/audio_irix.cpp | 1 - SheepShaver/src/Unix/Linux/NetDriver | 1 - SheepShaver/src/Unix/Linux/scsi_linux.cpp | 1 - SheepShaver/src/Unix/audio_oss_esd.cpp | 1 - SheepShaver/src/Unix/bincue_unix.cpp | 1 - SheepShaver/src/Unix/bincue_unix.h | 1 - SheepShaver/src/Unix/clip_unix.cpp | 1 - SheepShaver/src/Unix/config.guess | 1 - SheepShaver/src/Unix/config.sub | 1 - SheepShaver/src/Unix/cpr.sh | 1 - SheepShaver/src/Unix/disk_sparsebundle.cpp | 1 - SheepShaver/src/Unix/disk_unix.h | 1 - SheepShaver/src/Unix/ether_unix.cpp | 1 - SheepShaver/src/Unix/extfs_unix.cpp | 1 - SheepShaver/src/Unix/keycodes | 1 - SheepShaver/src/Unix/ldscripts | 1 - SheepShaver/src/Unix/m4 | 1 - SheepShaver/src/Unix/posix_sem.cpp | 1 - SheepShaver/src/Unix/rpc.h | 1 - SheepShaver/src/Unix/rpc_unix.cpp | 1 - SheepShaver/src/Unix/semaphore.h | 1 - SheepShaver/src/Unix/serial_unix.cpp | 1 - SheepShaver/src/Unix/sshpty.c | 1 - SheepShaver/src/Unix/sshpty.h | 1 - SheepShaver/src/Unix/strlcpy.c | 1 - SheepShaver/src/Unix/strlcpy.h | 1 - SheepShaver/src/Unix/sys_unix.cpp | 1 - SheepShaver/src/Unix/timer_unix.cpp | 1 - SheepShaver/src/Unix/tinyxml2.cpp | 1 - SheepShaver/src/Unix/tinyxml2.h | 1 - SheepShaver/src/Unix/tunconfig | 1 - SheepShaver/src/Unix/vhd_unix.cpp | 1 - SheepShaver/src/Unix/xpram_unix.cpp | 1 - SheepShaver/src/Windows/Makefile.in | 14 +- SheepShaver/src/Windows/b2ether | 1 - SheepShaver/src/Windows/build_on_msys.py | 550 ++++++++++++++++++ SheepShaver/src/Windows/cd_defs.h | 1 - SheepShaver/src/Windows/cdenable | 1 - SheepShaver/src/Windows/clip_windows.cpp | 1 - SheepShaver/src/Windows/configure.ac | 12 +- SheepShaver/src/Windows/ether_windows.cpp | 1 - SheepShaver/src/Windows/ether_windows.h | 1 - SheepShaver/src/Windows/extfs_windows.cpp | 1 - SheepShaver/src/Windows/kernel_windows.cpp | 1 - SheepShaver/src/Windows/kernel_windows.h | 1 - SheepShaver/src/Windows/main_windows.cpp | 10 +- SheepShaver/src/Windows/posix_emu.cpp | 1 - SheepShaver/src/Windows/posix_emu.h | 1 - SheepShaver/src/Windows/prefs_editor_gtk.cpp | 1 - SheepShaver/src/Windows/router | 1 - SheepShaver/src/Windows/sdl_fix.patch | 12 + SheepShaver/src/Windows/serial_windows.cpp | 1 - SheepShaver/src/Windows/sys_windows.cpp | 1 - SheepShaver/src/Windows/sysdeps.h | 24 +- SheepShaver/src/Windows/timer_windows.cpp | 1 - SheepShaver/src/Windows/util_windows.cpp | 1 - SheepShaver/src/Windows/util_windows.h | 1 - SheepShaver/src/Windows/xpram_windows.cpp | 1 - SheepShaver/src/adb.cpp | 1 - SheepShaver/src/audio.cpp | 1 - SheepShaver/src/cdrom.cpp | 1 - SheepShaver/src/disk.cpp | 1 - SheepShaver/src/dummy/audio_dummy.cpp | 1 - SheepShaver/src/dummy/clip_dummy.cpp | 1 - SheepShaver/src/dummy/prefs_editor_dummy.cpp | 1 - SheepShaver/src/dummy/scsi_dummy.cpp | 1 - SheepShaver/src/dummy/serial_dummy.cpp | 1 - SheepShaver/src/ether.cpp | 2 + SheepShaver/src/extfs.cpp | 1 - SheepShaver/src/gfxaccel.cpp | 2 + SheepShaver/src/include/adb.h | 1 - SheepShaver/src/include/audio.h | 1 - SheepShaver/src/include/audio_defs.h | 1 - SheepShaver/src/include/cdrom.h | 1 - SheepShaver/src/include/clip.h | 1 - SheepShaver/src/include/debug.h | 1 - SheepShaver/src/include/disk.h | 1 - SheepShaver/src/include/extfs.h | 1 - SheepShaver/src/include/extfs_defs.h | 1 - SheepShaver/src/include/main.h | 11 + SheepShaver/src/include/pict.h | 1 - SheepShaver/src/include/prefs.h | 1 - SheepShaver/src/include/scsi.h | 1 - SheepShaver/src/include/serial.h | 1 - SheepShaver/src/include/serial_defs.h | 1 - SheepShaver/src/include/sony.h | 1 - SheepShaver/src/include/sys.h | 1 - SheepShaver/src/include/timer.h | 1 - SheepShaver/src/include/xpram.h | 1 - .../src/kpx_cpu/src/cpu/jit/x86/codegen_x86.h | 1 - SheepShaver/src/pict.c | 1 - SheepShaver/src/prefs.cpp | 1 - SheepShaver/src/scsi.cpp | 1 - SheepShaver/src/slirp | 1 - SheepShaver/src/sony.cpp | 1 - SheepShaver/src/xpram.cpp | 1 - 134 files changed, 754 insertions(+), 144 deletions(-) delete mode 120000 SheepShaver/src/BeOS/SheepDriver delete mode 120000 SheepShaver/src/BeOS/SheepNet delete mode 120000 SheepShaver/src/BeOS/audio_beos.cpp delete mode 120000 SheepShaver/src/BeOS/extfs_beos.cpp delete mode 120000 SheepShaver/src/BeOS/scsi_beos.cpp delete mode 120000 SheepShaver/src/BeOS/serial_beos.cpp delete mode 120000 SheepShaver/src/BeOS/sys_beos.cpp delete mode 120000 SheepShaver/src/BeOS/timer_beos.cpp delete mode 120000 SheepShaver/src/BeOS/xpram_beos.cpp delete mode 120000 SheepShaver/src/CrossPlatform/sigsegv.cpp delete mode 120000 SheepShaver/src/CrossPlatform/sigsegv.h delete mode 120000 SheepShaver/src/CrossPlatform/video_blit.cpp delete mode 120000 SheepShaver/src/CrossPlatform/video_blit.h delete mode 120000 SheepShaver/src/CrossPlatform/video_vosf.h delete mode 120000 SheepShaver/src/CrossPlatform/vm_alloc.cpp delete mode 120000 SheepShaver/src/CrossPlatform/vm_alloc.h delete mode 120000 SheepShaver/src/MacOSX/AudioBackEnd.cpp delete mode 120000 SheepShaver/src/MacOSX/AudioBackEnd.h delete mode 120000 SheepShaver/src/MacOSX/AudioDevice.cpp delete mode 120000 SheepShaver/src/MacOSX/AudioDevice.h delete mode 120000 SheepShaver/src/MacOSX/MacOSX_sound_if.cpp delete mode 120000 SheepShaver/src/MacOSX/MacOSX_sound_if.h delete mode 120000 SheepShaver/src/MacOSX/audio_macosx.cpp delete mode 120000 SheepShaver/src/MacOSX/clip_macosx.cpp delete mode 120000 SheepShaver/src/MacOSX/clip_macosx64.mm delete mode 120000 SheepShaver/src/MacOSX/extfs_macosx.cpp delete mode 120000 SheepShaver/src/MacOSX/macos_util_macosx.h delete mode 120000 SheepShaver/src/MacOSX/sys_darwin.cpp delete mode 120000 SheepShaver/src/MacOSX/utils_macosx.h delete mode 120000 SheepShaver/src/MacOSX/utils_macosx.mm delete mode 120000 SheepShaver/src/SDL delete mode 120000 SheepShaver/src/Unix/Darwin/lowmem.c delete mode 120000 SheepShaver/src/Unix/Darwin/mkstandalone delete mode 120000 SheepShaver/src/Unix/Darwin/pagezero.c delete mode 120000 SheepShaver/src/Unix/Darwin/testlmem.sh delete mode 120000 SheepShaver/src/Unix/Irix/audio_irix.cpp delete mode 120000 SheepShaver/src/Unix/Linux/NetDriver delete mode 120000 SheepShaver/src/Unix/Linux/scsi_linux.cpp delete mode 120000 SheepShaver/src/Unix/audio_oss_esd.cpp delete mode 120000 SheepShaver/src/Unix/bincue_unix.cpp delete mode 120000 SheepShaver/src/Unix/bincue_unix.h delete mode 120000 SheepShaver/src/Unix/clip_unix.cpp delete mode 120000 SheepShaver/src/Unix/config.guess delete mode 120000 SheepShaver/src/Unix/config.sub delete mode 120000 SheepShaver/src/Unix/cpr.sh delete mode 120000 SheepShaver/src/Unix/disk_sparsebundle.cpp delete mode 120000 SheepShaver/src/Unix/disk_unix.h delete mode 120000 SheepShaver/src/Unix/ether_unix.cpp delete mode 120000 SheepShaver/src/Unix/extfs_unix.cpp delete mode 120000 SheepShaver/src/Unix/keycodes delete mode 120000 SheepShaver/src/Unix/ldscripts delete mode 120000 SheepShaver/src/Unix/m4 delete mode 120000 SheepShaver/src/Unix/posix_sem.cpp delete mode 120000 SheepShaver/src/Unix/rpc.h delete mode 120000 SheepShaver/src/Unix/rpc_unix.cpp delete mode 120000 SheepShaver/src/Unix/semaphore.h delete mode 120000 SheepShaver/src/Unix/serial_unix.cpp delete mode 120000 SheepShaver/src/Unix/sshpty.c delete mode 120000 SheepShaver/src/Unix/sshpty.h delete mode 120000 SheepShaver/src/Unix/strlcpy.c delete mode 120000 SheepShaver/src/Unix/strlcpy.h delete mode 120000 SheepShaver/src/Unix/sys_unix.cpp delete mode 120000 SheepShaver/src/Unix/timer_unix.cpp delete mode 120000 SheepShaver/src/Unix/tinyxml2.cpp delete mode 120000 SheepShaver/src/Unix/tinyxml2.h delete mode 120000 SheepShaver/src/Unix/tunconfig delete mode 120000 SheepShaver/src/Unix/vhd_unix.cpp delete mode 120000 SheepShaver/src/Unix/xpram_unix.cpp delete mode 120000 SheepShaver/src/Windows/b2ether create mode 100644 SheepShaver/src/Windows/build_on_msys.py delete mode 120000 SheepShaver/src/Windows/cd_defs.h delete mode 120000 SheepShaver/src/Windows/cdenable delete mode 120000 SheepShaver/src/Windows/clip_windows.cpp delete mode 120000 SheepShaver/src/Windows/ether_windows.cpp delete mode 120000 SheepShaver/src/Windows/ether_windows.h delete mode 120000 SheepShaver/src/Windows/extfs_windows.cpp delete mode 120000 SheepShaver/src/Windows/kernel_windows.cpp delete mode 120000 SheepShaver/src/Windows/kernel_windows.h delete mode 120000 SheepShaver/src/Windows/posix_emu.cpp delete mode 120000 SheepShaver/src/Windows/posix_emu.h delete mode 120000 SheepShaver/src/Windows/prefs_editor_gtk.cpp delete mode 120000 SheepShaver/src/Windows/router create mode 100644 SheepShaver/src/Windows/sdl_fix.patch delete mode 120000 SheepShaver/src/Windows/serial_windows.cpp delete mode 120000 SheepShaver/src/Windows/sys_windows.cpp delete mode 120000 SheepShaver/src/Windows/timer_windows.cpp delete mode 120000 SheepShaver/src/Windows/util_windows.cpp delete mode 120000 SheepShaver/src/Windows/util_windows.h delete mode 120000 SheepShaver/src/Windows/xpram_windows.cpp delete mode 120000 SheepShaver/src/adb.cpp delete mode 120000 SheepShaver/src/audio.cpp delete mode 120000 SheepShaver/src/cdrom.cpp delete mode 120000 SheepShaver/src/disk.cpp delete mode 120000 SheepShaver/src/dummy/audio_dummy.cpp delete mode 120000 SheepShaver/src/dummy/clip_dummy.cpp delete mode 120000 SheepShaver/src/dummy/prefs_editor_dummy.cpp delete mode 120000 SheepShaver/src/dummy/scsi_dummy.cpp delete mode 120000 SheepShaver/src/dummy/serial_dummy.cpp delete mode 120000 SheepShaver/src/extfs.cpp delete mode 120000 SheepShaver/src/include/adb.h delete mode 120000 SheepShaver/src/include/audio.h delete mode 120000 SheepShaver/src/include/audio_defs.h delete mode 120000 SheepShaver/src/include/cdrom.h delete mode 120000 SheepShaver/src/include/clip.h delete mode 120000 SheepShaver/src/include/debug.h delete mode 120000 SheepShaver/src/include/disk.h delete mode 120000 SheepShaver/src/include/extfs.h delete mode 120000 SheepShaver/src/include/extfs_defs.h delete mode 120000 SheepShaver/src/include/pict.h delete mode 120000 SheepShaver/src/include/prefs.h delete mode 120000 SheepShaver/src/include/scsi.h delete mode 120000 SheepShaver/src/include/serial.h delete mode 120000 SheepShaver/src/include/serial_defs.h delete mode 120000 SheepShaver/src/include/sony.h delete mode 120000 SheepShaver/src/include/sys.h delete mode 120000 SheepShaver/src/include/timer.h delete mode 120000 SheepShaver/src/include/xpram.h delete mode 120000 SheepShaver/src/kpx_cpu/src/cpu/jit/x86/codegen_x86.h delete mode 120000 SheepShaver/src/pict.c delete mode 120000 SheepShaver/src/prefs.cpp delete mode 120000 SheepShaver/src/scsi.cpp delete mode 120000 SheepShaver/src/slirp delete mode 120000 SheepShaver/src/sony.cpp delete mode 120000 SheepShaver/src/xpram.cpp diff --git a/.gitignore b/.gitignore index 2a6e2f0c..3e80b800 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,137 @@ # Mac OS X metadata *.DS_Store +SheepShaver/src/Windows/downloads/ +.idea/ +SheepShaver/src/adb.cpp +SheepShaver/src/audio.cpp +SheepShaver/src/cdrom.cpp +SheepShaver/src/disk.cpp +SheepShaver/src/extfs.cpp +SheepShaver/src/pict.c +SheepShaver/src/prefs.cpp +SheepShaver/src/scsi.cpp +SheepShaver/src/sony.cpp +SheepShaver/src/xpram.cpp +SheepShaver/src/include/adb.h +SheepShaver/src/include/audio.h +SheepShaver/src/include/audio_defs.h +SheepShaver/src/include/cdrom.h +SheepShaver/src/include/clip.h +SheepShaver/src/include/debug.h +SheepShaver/src/include/disk.h +SheepShaver/src/include/extfs.h +SheepShaver/src/include/extfs_defs.h +SheepShaver/src/include/pict.h +SheepShaver/src/include/prefs.h +SheepShaver/src/include/scsi.h +SheepShaver/src/include/serial.h +SheepShaver/src/include/serial_defs.h +SheepShaver/src/include/sony.h +SheepShaver/src/include/sys.h +SheepShaver/src/include/timer.h +SheepShaver/src/include/xpram.h +SheepShaver/src/BeOS/audio_beos.cpp +SheepShaver/src/BeOS/extfs_beos.cpp +SheepShaver/src/BeOS/scsi_beos.cpp +SheepShaver/src/BeOS/serial_beos.cpp +SheepShaver/src/BeOS/sys_beos.cpp +SheepShaver/src/BeOS/timer_beos.cpp +SheepShaver/src/BeOS/xpram_beos.cpp +SheepShaver/src/BeOS/SheepDriver +SheepShaver/src/BeOS/SheepNet +SheepShaver/src/CrossPlatform/sigsegv.h +SheepShaver/src/CrossPlatform/sigsegv.cpp +SheepShaver/src/CrossPlatform/vm_alloc.h +SheepShaver/src/CrossPlatform/vm_alloc.cpp +SheepShaver/src/CrossPlatform/video_vosf.h +SheepShaver/src/CrossPlatform/video_blit.h +SheepShaver/src/CrossPlatform/video_blit.cpp +SheepShaver/src/Unix/audio_oss_esd.cpp +SheepShaver/src/Unix/bincue_unix.cpp +SheepShaver/src/Unix/bincue_unix.h +SheepShaver/src/Unix/vhd_unix.cpp +SheepShaver/src/Unix/extfs_unix.cpp +SheepShaver/src/Unix/serial_unix.cpp +SheepShaver/src/Unix/sshpty.h +SheepShaver/src/Unix/sshpty.c +SheepShaver/src/Unix/strlcpy.h +SheepShaver/src/Unix/strlcpy.c +SheepShaver/src/Unix/sys_unix.cpp +SheepShaver/src/Unix/timer_unix.cpp +SheepShaver/src/Unix/xpram_unix.cpp +SheepShaver/src/Unix/semaphore.h +SheepShaver/src/Unix/posix_sem.cpp +SheepShaver/src/Unix/config.sub +SheepShaver/src/Unix/config.guess +SheepShaver/src/Unix/m4 +SheepShaver/src/Unix/keycodes +SheepShaver/src/Unix/tunconfig +SheepShaver/src/Unix/clip_unix.cpp +SheepShaver/src/Unix/Irix/audio_irix.cpp +SheepShaver/src/Unix/Linux/scsi_linux.cpp +SheepShaver/src/Unix/Linux/NetDriver +SheepShaver/src/Unix/ether_unix.cpp +SheepShaver/src/Unix/rpc.h +SheepShaver/src/Unix/rpc_unix.cpp +SheepShaver/src/Unix/ldscripts +SheepShaver/src/Unix/tinyxml2.h +SheepShaver/src/Unix/tinyxml2.cpp +SheepShaver/src/Unix/disk_unix.h +SheepShaver/src/Unix/disk_sparsebundle.cpp +SheepShaver/src/Unix/Darwin/mkstandalone +SheepShaver/src/Unix/Darwin/lowmem.c +SheepShaver/src/Unix/Darwin/pagezero.c +SheepShaver/src/Unix/Darwin/testlmem.sh +SheepShaver/src/dummy/audio_dummy.cpp +SheepShaver/src/dummy/clip_dummy.cpp +SheepShaver/src/dummy/serial_dummy.cpp +SheepShaver/src/dummy/prefs_editor_dummy.cpp +SheepShaver/src/dummy/scsi_dummy.cpp +SheepShaver/src/SDL +SheepShaver/src/slirp +SheepShaver/src/MacOSX/sys_darwin.cpp +SheepShaver/src/MacOSX/clip_macosx.cpp +SheepShaver/src/MacOSX/clip_macosx64.mm +SheepShaver/src/MacOSX/macos_util_macosx.h +SheepShaver/src/Unix/cpr.sh +SheepShaver/src/MacOSX/extfs_macosx.cpp +SheepShaver/src/Windows/clip_windows.cpp +SheepShaver/src/MacOSX/MacOSX_sound_if.cpp +SheepShaver/src/MacOSX/MacOSX_sound_if.h +SheepShaver/src/MacOSX/AudioBackEnd.cpp +SheepShaver/src/MacOSX/AudioBackEnd.h +SheepShaver/src/MacOSX/AudioDevice.cpp +SheepShaver/src/MacOSX/AudioDevice.h +SheepShaver/src/MacOSX/audio_macosx.cpp +SheepShaver/src/MacOSX/utils_macosx.mm +SheepShaver/src/MacOSX/utils_macosx.h +SheepShaver/src/Windows/cd_defs.h +SheepShaver/src/Windows/cdenable +SheepShaver/src/Windows/extfs_windows.cpp +SheepShaver/src/Windows/posix_emu.cpp +SheepShaver/src/Windows/posix_emu.h +SheepShaver/src/Windows/sys_windows.cpp +SheepShaver/src/Windows/timer_windows.cpp +SheepShaver/src/Windows/util_windows.cpp +SheepShaver/src/Windows/util_windows.h +SheepShaver/src/Windows/xpram_windows.cpp +SheepShaver/src/Windows/kernel_windows.h +SheepShaver/src/Windows/kernel_windows.cpp +SheepShaver/src/Windows/serial_windows.cpp +SheepShaver/src/Windows/router +SheepShaver/src/Windows/b2ether +SheepShaver/src/Windows/ether_windows.h +SheepShaver/src/Windows/ether_windows.cpp +SheepShaver/src/Windows/serial_windows.cpp +SheepShaver/src/Windows/prefs_editor_gtk.cpp +SheepShaver/src/uae_cpu/compiler/codegen_x86.h +SheepShaver/src/Windows/autom4te.cache/ +SheepShaver/src/Windows/m4/ +SheepShaver/src/Windows/aclocal.m4 +SheepShaver/src/Windows/config.h.in +SheepShaver/src/Windows/configure +SheepShaver/src/Windows/config.log +SheepShaver/src/kpx_cpu/src/cpu/jit/x86/codegen_x86.h +BasiliskII/src/Windows/x64/ +SheepShaver/src/Windows/config.status diff --git a/BasiliskII/src/include/debug.h b/BasiliskII/src/include/debug.h index 414ad324..5200ba01 100644 --- a/BasiliskII/src/include/debug.h +++ b/BasiliskII/src/include/debug.h @@ -30,6 +30,8 @@ #include #include +#include "main.h" + static inline void _cdecl vwinbug(const char *s, va_list vargs) { char msg[1024], date[50], hours[50]; diff --git a/SheepShaver/Makefile b/SheepShaver/Makefile index 2fec37a1..bf61fa9a 100644 --- a/SheepShaver/Makefile +++ b/SheepShaver/Makefile @@ -87,10 +87,9 @@ links: Windows/posix_emu.cpp Windows/posix_emu.h Windows/sys_windows.cpp \ Windows/timer_windows.cpp Windows/util_windows.cpp \ Windows/util_windows.h Windows/xpram_windows.cpp \ - Windows/kernel_windows.h Windows/kernel_windows.cpp \ Windows/serial_windows.cpp Windows/router Windows/b2ether \ Windows/ether_windows.h Windows/ether_windows.cpp \ - Windows/serial_windows.cpp Windows/prefs_editor_gtk.cpp \ + Windows/prefs_editor_gtk.cpp \ uae_cpu/compiler/codegen_x86.h'; \ PREFIX="../"; case $(B2_TOPDIR) in /*) PREFIX="";; esac; \ for i in $$list; do \ diff --git a/SheepShaver/src/BeOS/SheepDriver b/SheepShaver/src/BeOS/SheepDriver deleted file mode 120000 index 9e581b7f..00000000 --- a/SheepShaver/src/BeOS/SheepDriver +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/BeOS/SheepDriver \ No newline at end of file diff --git a/SheepShaver/src/BeOS/SheepNet b/SheepShaver/src/BeOS/SheepNet deleted file mode 120000 index 7d7d7257..00000000 --- a/SheepShaver/src/BeOS/SheepNet +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/BeOS/SheepNet \ No newline at end of file diff --git a/SheepShaver/src/BeOS/audio_beos.cpp b/SheepShaver/src/BeOS/audio_beos.cpp deleted file mode 120000 index ce433abb..00000000 --- a/SheepShaver/src/BeOS/audio_beos.cpp +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/BeOS/audio_beos.cpp \ No newline at end of file diff --git a/SheepShaver/src/BeOS/extfs_beos.cpp b/SheepShaver/src/BeOS/extfs_beos.cpp deleted file mode 120000 index e7cec3dc..00000000 --- a/SheepShaver/src/BeOS/extfs_beos.cpp +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/BeOS/extfs_beos.cpp \ No newline at end of file diff --git a/SheepShaver/src/BeOS/scsi_beos.cpp b/SheepShaver/src/BeOS/scsi_beos.cpp deleted file mode 120000 index c495dce0..00000000 --- a/SheepShaver/src/BeOS/scsi_beos.cpp +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/BeOS/scsi_beos.cpp \ No newline at end of file diff --git a/SheepShaver/src/BeOS/serial_beos.cpp b/SheepShaver/src/BeOS/serial_beos.cpp deleted file mode 120000 index 2231c6d0..00000000 --- a/SheepShaver/src/BeOS/serial_beos.cpp +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/BeOS/serial_beos.cpp \ No newline at end of file diff --git a/SheepShaver/src/BeOS/sys_beos.cpp b/SheepShaver/src/BeOS/sys_beos.cpp deleted file mode 120000 index 4e238dac..00000000 --- a/SheepShaver/src/BeOS/sys_beos.cpp +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/BeOS/sys_beos.cpp \ No newline at end of file diff --git a/SheepShaver/src/BeOS/timer_beos.cpp b/SheepShaver/src/BeOS/timer_beos.cpp deleted file mode 120000 index 0d9e8014..00000000 --- a/SheepShaver/src/BeOS/timer_beos.cpp +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/BeOS/timer_beos.cpp \ No newline at end of file diff --git a/SheepShaver/src/BeOS/xpram_beos.cpp b/SheepShaver/src/BeOS/xpram_beos.cpp deleted file mode 120000 index e5d7f965..00000000 --- a/SheepShaver/src/BeOS/xpram_beos.cpp +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/BeOS/xpram_beos.cpp \ No newline at end of file diff --git a/SheepShaver/src/CrossPlatform/sigsegv.cpp b/SheepShaver/src/CrossPlatform/sigsegv.cpp deleted file mode 120000 index a41f4a06..00000000 --- a/SheepShaver/src/CrossPlatform/sigsegv.cpp +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/CrossPlatform/sigsegv.cpp \ No newline at end of file diff --git a/SheepShaver/src/CrossPlatform/sigsegv.h b/SheepShaver/src/CrossPlatform/sigsegv.h deleted file mode 120000 index 213fb61d..00000000 --- a/SheepShaver/src/CrossPlatform/sigsegv.h +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/CrossPlatform/sigsegv.h \ No newline at end of file diff --git a/SheepShaver/src/CrossPlatform/video_blit.cpp b/SheepShaver/src/CrossPlatform/video_blit.cpp deleted file mode 120000 index 15297235..00000000 --- a/SheepShaver/src/CrossPlatform/video_blit.cpp +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/CrossPlatform/video_blit.cpp \ No newline at end of file diff --git a/SheepShaver/src/CrossPlatform/video_blit.h b/SheepShaver/src/CrossPlatform/video_blit.h deleted file mode 120000 index 7fe63598..00000000 --- a/SheepShaver/src/CrossPlatform/video_blit.h +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/CrossPlatform/video_blit.h \ No newline at end of file diff --git a/SheepShaver/src/CrossPlatform/video_vosf.h b/SheepShaver/src/CrossPlatform/video_vosf.h deleted file mode 120000 index 4c552311..00000000 --- a/SheepShaver/src/CrossPlatform/video_vosf.h +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/CrossPlatform/video_vosf.h \ No newline at end of file diff --git a/SheepShaver/src/CrossPlatform/vm_alloc.cpp b/SheepShaver/src/CrossPlatform/vm_alloc.cpp deleted file mode 120000 index cc80e1bc..00000000 --- a/SheepShaver/src/CrossPlatform/vm_alloc.cpp +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/CrossPlatform/vm_alloc.cpp \ No newline at end of file diff --git a/SheepShaver/src/CrossPlatform/vm_alloc.h b/SheepShaver/src/CrossPlatform/vm_alloc.h deleted file mode 120000 index ef65a561..00000000 --- a/SheepShaver/src/CrossPlatform/vm_alloc.h +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/CrossPlatform/vm_alloc.h \ No newline at end of file diff --git a/SheepShaver/src/MacOSX/AudioBackEnd.cpp b/SheepShaver/src/MacOSX/AudioBackEnd.cpp deleted file mode 120000 index d0d8a5ca..00000000 --- a/SheepShaver/src/MacOSX/AudioBackEnd.cpp +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/MacOSX/AudioBackEnd.cpp \ No newline at end of file diff --git a/SheepShaver/src/MacOSX/AudioBackEnd.h b/SheepShaver/src/MacOSX/AudioBackEnd.h deleted file mode 120000 index e4f493db..00000000 --- a/SheepShaver/src/MacOSX/AudioBackEnd.h +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/MacOSX/AudioBackEnd.h \ No newline at end of file diff --git a/SheepShaver/src/MacOSX/AudioDevice.cpp b/SheepShaver/src/MacOSX/AudioDevice.cpp deleted file mode 120000 index b56f3a4c..00000000 --- a/SheepShaver/src/MacOSX/AudioDevice.cpp +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/MacOSX/AudioDevice.cpp \ No newline at end of file diff --git a/SheepShaver/src/MacOSX/AudioDevice.h b/SheepShaver/src/MacOSX/AudioDevice.h deleted file mode 120000 index 7892391b..00000000 --- a/SheepShaver/src/MacOSX/AudioDevice.h +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/MacOSX/AudioDevice.h \ No newline at end of file diff --git a/SheepShaver/src/MacOSX/MacOSX_sound_if.cpp b/SheepShaver/src/MacOSX/MacOSX_sound_if.cpp deleted file mode 120000 index da209f87..00000000 --- a/SheepShaver/src/MacOSX/MacOSX_sound_if.cpp +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/MacOSX/MacOSX_sound_if.cpp \ No newline at end of file diff --git a/SheepShaver/src/MacOSX/MacOSX_sound_if.h b/SheepShaver/src/MacOSX/MacOSX_sound_if.h deleted file mode 120000 index 63bcdb27..00000000 --- a/SheepShaver/src/MacOSX/MacOSX_sound_if.h +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/MacOSX/MacOSX_sound_if.h \ No newline at end of file diff --git a/SheepShaver/src/MacOSX/audio_macosx.cpp b/SheepShaver/src/MacOSX/audio_macosx.cpp deleted file mode 120000 index 418b23c5..00000000 --- a/SheepShaver/src/MacOSX/audio_macosx.cpp +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/MacOSX/audio_macosx.cpp \ No newline at end of file diff --git a/SheepShaver/src/MacOSX/clip_macosx.cpp b/SheepShaver/src/MacOSX/clip_macosx.cpp deleted file mode 120000 index 7f731e4d..00000000 --- a/SheepShaver/src/MacOSX/clip_macosx.cpp +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/MacOSX/clip_macosx.cpp \ No newline at end of file diff --git a/SheepShaver/src/MacOSX/clip_macosx64.mm b/SheepShaver/src/MacOSX/clip_macosx64.mm deleted file mode 120000 index 18640812..00000000 --- a/SheepShaver/src/MacOSX/clip_macosx64.mm +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/MacOSX/clip_macosx64.mm \ No newline at end of file diff --git a/SheepShaver/src/MacOSX/extfs_macosx.cpp b/SheepShaver/src/MacOSX/extfs_macosx.cpp deleted file mode 120000 index 1afcd4b1..00000000 --- a/SheepShaver/src/MacOSX/extfs_macosx.cpp +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/MacOSX/extfs_macosx.cpp \ No newline at end of file diff --git a/SheepShaver/src/MacOSX/macos_util_macosx.h b/SheepShaver/src/MacOSX/macos_util_macosx.h deleted file mode 120000 index cef14874..00000000 --- a/SheepShaver/src/MacOSX/macos_util_macosx.h +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/MacOSX/macos_util_macosx.h \ No newline at end of file diff --git a/SheepShaver/src/MacOSX/sys_darwin.cpp b/SheepShaver/src/MacOSX/sys_darwin.cpp deleted file mode 120000 index 28b80318..00000000 --- a/SheepShaver/src/MacOSX/sys_darwin.cpp +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/MacOSX/sys_darwin.cpp \ No newline at end of file diff --git a/SheepShaver/src/MacOSX/utils_macosx.h b/SheepShaver/src/MacOSX/utils_macosx.h deleted file mode 120000 index c8777733..00000000 --- a/SheepShaver/src/MacOSX/utils_macosx.h +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/MacOSX/utils_macosx.h \ No newline at end of file diff --git a/SheepShaver/src/MacOSX/utils_macosx.mm b/SheepShaver/src/MacOSX/utils_macosx.mm deleted file mode 120000 index 19064958..00000000 --- a/SheepShaver/src/MacOSX/utils_macosx.mm +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/MacOSX/utils_macosx.mm \ No newline at end of file diff --git a/SheepShaver/src/SDL b/SheepShaver/src/SDL deleted file mode 120000 index 48cb61eb..00000000 --- a/SheepShaver/src/SDL +++ /dev/null @@ -1 +0,0 @@ -../../BasiliskII/src/SDL \ No newline at end of file diff --git a/SheepShaver/src/Unix/Darwin/lowmem.c b/SheepShaver/src/Unix/Darwin/lowmem.c deleted file mode 120000 index 7e0a359c..00000000 --- a/SheepShaver/src/Unix/Darwin/lowmem.c +++ /dev/null @@ -1 +0,0 @@ -../../../../BasiliskII/src/Unix/Darwin/lowmem.c \ No newline at end of file diff --git a/SheepShaver/src/Unix/Darwin/mkstandalone b/SheepShaver/src/Unix/Darwin/mkstandalone deleted file mode 120000 index acfe13f6..00000000 --- a/SheepShaver/src/Unix/Darwin/mkstandalone +++ /dev/null @@ -1 +0,0 @@ -../../../../BasiliskII/src/Unix/Darwin/mkstandalone \ No newline at end of file diff --git a/SheepShaver/src/Unix/Darwin/pagezero.c b/SheepShaver/src/Unix/Darwin/pagezero.c deleted file mode 120000 index ae53c815..00000000 --- a/SheepShaver/src/Unix/Darwin/pagezero.c +++ /dev/null @@ -1 +0,0 @@ -../../../../BasiliskII/src/Unix/Darwin/pagezero.c \ No newline at end of file diff --git a/SheepShaver/src/Unix/Darwin/testlmem.sh b/SheepShaver/src/Unix/Darwin/testlmem.sh deleted file mode 120000 index 1137ef89..00000000 --- a/SheepShaver/src/Unix/Darwin/testlmem.sh +++ /dev/null @@ -1 +0,0 @@ -../../../../BasiliskII/src/Unix/Darwin/testlmem.sh \ No newline at end of file diff --git a/SheepShaver/src/Unix/Irix/audio_irix.cpp b/SheepShaver/src/Unix/Irix/audio_irix.cpp deleted file mode 120000 index 2e7ef88f..00000000 --- a/SheepShaver/src/Unix/Irix/audio_irix.cpp +++ /dev/null @@ -1 +0,0 @@ -../../../../BasiliskII/src/Unix/Irix/audio_irix.cpp \ No newline at end of file diff --git a/SheepShaver/src/Unix/Linux/NetDriver b/SheepShaver/src/Unix/Linux/NetDriver deleted file mode 120000 index 6e756eb3..00000000 --- a/SheepShaver/src/Unix/Linux/NetDriver +++ /dev/null @@ -1 +0,0 @@ -../../../../BasiliskII/src/Unix/Linux/NetDriver \ No newline at end of file diff --git a/SheepShaver/src/Unix/Linux/scsi_linux.cpp b/SheepShaver/src/Unix/Linux/scsi_linux.cpp deleted file mode 120000 index 9ebba5fd..00000000 --- a/SheepShaver/src/Unix/Linux/scsi_linux.cpp +++ /dev/null @@ -1 +0,0 @@ -../../../../BasiliskII/src/Unix/Linux/scsi_linux.cpp \ No newline at end of file diff --git a/SheepShaver/src/Unix/audio_oss_esd.cpp b/SheepShaver/src/Unix/audio_oss_esd.cpp deleted file mode 120000 index acf070c1..00000000 --- a/SheepShaver/src/Unix/audio_oss_esd.cpp +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/Unix/audio_oss_esd.cpp \ No newline at end of file diff --git a/SheepShaver/src/Unix/bincue_unix.cpp b/SheepShaver/src/Unix/bincue_unix.cpp deleted file mode 120000 index f9ed574d..00000000 --- a/SheepShaver/src/Unix/bincue_unix.cpp +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/Unix/bincue_unix.cpp \ No newline at end of file diff --git a/SheepShaver/src/Unix/bincue_unix.h b/SheepShaver/src/Unix/bincue_unix.h deleted file mode 120000 index 9c7e8c5c..00000000 --- a/SheepShaver/src/Unix/bincue_unix.h +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/Unix/bincue_unix.h \ No newline at end of file diff --git a/SheepShaver/src/Unix/clip_unix.cpp b/SheepShaver/src/Unix/clip_unix.cpp deleted file mode 120000 index bd5316ec..00000000 --- a/SheepShaver/src/Unix/clip_unix.cpp +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/Unix/clip_unix.cpp \ No newline at end of file diff --git a/SheepShaver/src/Unix/config.guess b/SheepShaver/src/Unix/config.guess deleted file mode 120000 index d7e5917c..00000000 --- a/SheepShaver/src/Unix/config.guess +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/Unix/config.guess \ No newline at end of file diff --git a/SheepShaver/src/Unix/config.sub b/SheepShaver/src/Unix/config.sub deleted file mode 120000 index 5458c713..00000000 --- a/SheepShaver/src/Unix/config.sub +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/Unix/config.sub \ No newline at end of file diff --git a/SheepShaver/src/Unix/cpr.sh b/SheepShaver/src/Unix/cpr.sh deleted file mode 120000 index 29f13000..00000000 --- a/SheepShaver/src/Unix/cpr.sh +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/Unix/cpr.sh \ No newline at end of file diff --git a/SheepShaver/src/Unix/disk_sparsebundle.cpp b/SheepShaver/src/Unix/disk_sparsebundle.cpp deleted file mode 120000 index 7e368ca7..00000000 --- a/SheepShaver/src/Unix/disk_sparsebundle.cpp +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/Unix/disk_sparsebundle.cpp \ No newline at end of file diff --git a/SheepShaver/src/Unix/disk_unix.h b/SheepShaver/src/Unix/disk_unix.h deleted file mode 120000 index 87d10dfd..00000000 --- a/SheepShaver/src/Unix/disk_unix.h +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/Unix/disk_unix.h \ No newline at end of file diff --git a/SheepShaver/src/Unix/ether_unix.cpp b/SheepShaver/src/Unix/ether_unix.cpp deleted file mode 120000 index b2a75d72..00000000 --- a/SheepShaver/src/Unix/ether_unix.cpp +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/Unix/ether_unix.cpp \ No newline at end of file diff --git a/SheepShaver/src/Unix/extfs_unix.cpp b/SheepShaver/src/Unix/extfs_unix.cpp deleted file mode 120000 index 6a67ad61..00000000 --- a/SheepShaver/src/Unix/extfs_unix.cpp +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/Unix/extfs_unix.cpp \ No newline at end of file diff --git a/SheepShaver/src/Unix/keycodes b/SheepShaver/src/Unix/keycodes deleted file mode 120000 index da89edcf..00000000 --- a/SheepShaver/src/Unix/keycodes +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/Unix/keycodes \ No newline at end of file diff --git a/SheepShaver/src/Unix/ldscripts b/SheepShaver/src/Unix/ldscripts deleted file mode 120000 index 39626083..00000000 --- a/SheepShaver/src/Unix/ldscripts +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/Unix/ldscripts \ No newline at end of file diff --git a/SheepShaver/src/Unix/m4 b/SheepShaver/src/Unix/m4 deleted file mode 120000 index a20fe840..00000000 --- a/SheepShaver/src/Unix/m4 +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/Unix/m4 \ No newline at end of file diff --git a/SheepShaver/src/Unix/posix_sem.cpp b/SheepShaver/src/Unix/posix_sem.cpp deleted file mode 120000 index f530e6db..00000000 --- a/SheepShaver/src/Unix/posix_sem.cpp +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/Unix/posix_sem.cpp \ No newline at end of file diff --git a/SheepShaver/src/Unix/rpc.h b/SheepShaver/src/Unix/rpc.h deleted file mode 120000 index 98cf8a08..00000000 --- a/SheepShaver/src/Unix/rpc.h +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/Unix/rpc.h \ No newline at end of file diff --git a/SheepShaver/src/Unix/rpc_unix.cpp b/SheepShaver/src/Unix/rpc_unix.cpp deleted file mode 120000 index a960f0b7..00000000 --- a/SheepShaver/src/Unix/rpc_unix.cpp +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/Unix/rpc_unix.cpp \ No newline at end of file diff --git a/SheepShaver/src/Unix/semaphore.h b/SheepShaver/src/Unix/semaphore.h deleted file mode 120000 index 9e87a545..00000000 --- a/SheepShaver/src/Unix/semaphore.h +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/Unix/semaphore.h \ No newline at end of file diff --git a/SheepShaver/src/Unix/serial_unix.cpp b/SheepShaver/src/Unix/serial_unix.cpp deleted file mode 120000 index ccda34be..00000000 --- a/SheepShaver/src/Unix/serial_unix.cpp +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/Unix/serial_unix.cpp \ No newline at end of file diff --git a/SheepShaver/src/Unix/sshpty.c b/SheepShaver/src/Unix/sshpty.c deleted file mode 120000 index ffaa2bfc..00000000 --- a/SheepShaver/src/Unix/sshpty.c +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/Unix/sshpty.c \ No newline at end of file diff --git a/SheepShaver/src/Unix/sshpty.h b/SheepShaver/src/Unix/sshpty.h deleted file mode 120000 index 9132736a..00000000 --- a/SheepShaver/src/Unix/sshpty.h +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/Unix/sshpty.h \ No newline at end of file diff --git a/SheepShaver/src/Unix/strlcpy.c b/SheepShaver/src/Unix/strlcpy.c deleted file mode 120000 index 59e61670..00000000 --- a/SheepShaver/src/Unix/strlcpy.c +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/Unix/strlcpy.c \ No newline at end of file diff --git a/SheepShaver/src/Unix/strlcpy.h b/SheepShaver/src/Unix/strlcpy.h deleted file mode 120000 index 1c551aac..00000000 --- a/SheepShaver/src/Unix/strlcpy.h +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/Unix/strlcpy.h \ No newline at end of file diff --git a/SheepShaver/src/Unix/sys_unix.cpp b/SheepShaver/src/Unix/sys_unix.cpp deleted file mode 120000 index e5769e8d..00000000 --- a/SheepShaver/src/Unix/sys_unix.cpp +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/Unix/sys_unix.cpp \ No newline at end of file diff --git a/SheepShaver/src/Unix/timer_unix.cpp b/SheepShaver/src/Unix/timer_unix.cpp deleted file mode 120000 index db93bbd3..00000000 --- a/SheepShaver/src/Unix/timer_unix.cpp +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/Unix/timer_unix.cpp \ No newline at end of file diff --git a/SheepShaver/src/Unix/tinyxml2.cpp b/SheepShaver/src/Unix/tinyxml2.cpp deleted file mode 120000 index 0609bdc8..00000000 --- a/SheepShaver/src/Unix/tinyxml2.cpp +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/Unix/tinyxml2.cpp \ No newline at end of file diff --git a/SheepShaver/src/Unix/tinyxml2.h b/SheepShaver/src/Unix/tinyxml2.h deleted file mode 120000 index d90c30e2..00000000 --- a/SheepShaver/src/Unix/tinyxml2.h +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/Unix/tinyxml2.h \ No newline at end of file diff --git a/SheepShaver/src/Unix/tunconfig b/SheepShaver/src/Unix/tunconfig deleted file mode 120000 index 615f7fe9..00000000 --- a/SheepShaver/src/Unix/tunconfig +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/Unix/tunconfig \ No newline at end of file diff --git a/SheepShaver/src/Unix/vhd_unix.cpp b/SheepShaver/src/Unix/vhd_unix.cpp deleted file mode 120000 index a0c73d90..00000000 --- a/SheepShaver/src/Unix/vhd_unix.cpp +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/Unix/vhd_unix.cpp \ No newline at end of file diff --git a/SheepShaver/src/Unix/xpram_unix.cpp b/SheepShaver/src/Unix/xpram_unix.cpp deleted file mode 120000 index 12e37c98..00000000 --- a/SheepShaver/src/Unix/xpram_unix.cpp +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/Unix/xpram_unix.cpp \ No newline at end of file diff --git a/SheepShaver/src/Windows/Makefile.in b/SheepShaver/src/Windows/Makefile.in index edd28f59..1da802c7 100755 --- a/SheepShaver/src/Windows/Makefile.in +++ b/SheepShaver/src/Windows/Makefile.in @@ -38,7 +38,7 @@ CXXFLAGS = @CXXFLAGS@ $(SDL_CFLAGS) CPPFLAGS = @CPPFLAGS@ -I../include -I. -I../slirp DEFS = @DEFS@ LDFLAGS = @LDFLAGS@ -LIBS = @LIBS@ -lwsock32 -liphlpapi +LIBS = @LIBS@ -lws2_32 -lwsock32 -liphlpapi CPUSRCS = @CPUSRCS@ PERL = @PERL@ @@ -54,7 +54,7 @@ HOST_CXXFLAGS = -O2 HOST_LDFLAGS = ## Files -UNIXSRCS = vm_alloc.cpp vm_alloc.h sigsegv.cpp sigsegv.h video_vosf.h video_blit.cpp video_blit.h +XPLATSRCS = vm_alloc.cpp vm_alloc.h sigsegv.cpp sigsegv.h video_vosf.h video_blit.cpp video_blit.h ROUTERSRCS = router/arp.cpp router/dump.cpp router/dynsockets.cpp router/ftp.cpp \ router/icmp.cpp router/mib/interfaces.cpp router/iphelp.cpp router/ipsocket.cpp \ @@ -69,7 +69,7 @@ SRCS = ../main.cpp main_windows.cpp ../prefs.cpp ../prefs_items.cpp prefs_window ../audio.cpp ../SDL/audio_sdl.cpp ../ether.cpp ether_windows.cpp \ ../thunks.cpp ../serial.cpp serial_windows.cpp ../extfs.cpp extfs_windows.cpp \ about_window_windows.cpp ../user_strings.cpp user_strings_windows.cpp \ - ../dummy/prefs_editor_dummy.cpp clip_windows.cpp util_windows.cpp kernel_windows.cpp \ + ../dummy/prefs_editor_dummy.cpp clip_windows.cpp util_windows.cpp \ vm_alloc.cpp sigsegv.cpp posix_emu.cpp SheepShaver.rc \ $(CPUSRCS) $(ROUTERSRCS) $(SLIRP_OBJS) @@ -94,7 +94,7 @@ endif all: $(PROGS) -$(UNIXSRCS): %: ../Unix/% +$(XPLATSRCS): %: ../CrossPlatform/% $(LN_S) $< $@ OBJ_DIR = obj @@ -123,17 +123,17 @@ SRC_PATHS += $(sort $(foreach file, $(SRCS), $(dir $(file)))) VPATH := VPATH += $(addprefix :, $(subst ,:, $(filter-out $($(subst, :, ,$(VPATH))), $(SRC_PATHS)))) -$(APP): $(UNIXSRCS) $(OBJ_DIR) $(OBJS) +$(APP): $(XPLATSRCS) $(OBJ_DIR) $(OBJS) $(CXX) -o $(APP) $(LDFLAGS) $(OBJS) $(LIBS) $(SDL_LIBS) -$(UI_APP): $(UNIXSRCS) $(OBJ_DIR) $(UI_OBJS) +$(UI_APP): $(XPLATSRCS) $(OBJ_DIR) $(UI_OBJS) $(CXX) -o $@ $(LDFLAGS) $(UI_OBJS) $(LIBS) $(GTK_LIBS) -mwindows -mno-cygwin mostlyclean: rm -f $(APP) $(UI_APP) $(OBJ_DIR)/* core* *.core *~ *.bak clean: mostlyclean - rm -f $(UNIXSRCS) + rm -f $(XPLATSRCS) rm -f dyngen basic-dyngen-ops.hpp ppc-dyngen-ops.hpp ppc-execute-impl.cpp distclean: clean diff --git a/SheepShaver/src/Windows/b2ether b/SheepShaver/src/Windows/b2ether deleted file mode 120000 index cf8fd89b..00000000 --- a/SheepShaver/src/Windows/b2ether +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/Windows/b2ether \ No newline at end of file diff --git a/SheepShaver/src/Windows/build_on_msys.py b/SheepShaver/src/Windows/build_on_msys.py new file mode 100644 index 00000000..fd46ea84 --- /dev/null +++ b/SheepShaver/src/Windows/build_on_msys.py @@ -0,0 +1,550 @@ +# +# A python 2.7 script to fetch all dependencies and build Sheepshaver using MSYS +# +import argparse +import glob +import json +import os +import subprocess +import urllib +import xml.dom.minidom +import zipfile +import sys +from contextlib import contextmanager +import datetime + +MACEMU_CFLAGS = "-mwin32" +MACEMU_CXXFLAGS = "-mwin32 -std=gnu++11 -U__STRICT_ANSI__" + +script_path = os.path.dirname(os.path.abspath(__file__)) + + +MINGW_EXTRACT_PATH = r"c:\mingw-sheep" + + +def parse_args(): + parser = argparse.ArgumentParser() + parser.add_argument("--uninstall-packages", "-u", + help="Uninstall all the msys/mingw packages", + default=False, + action="store_true", + ) + parser.add_argument("--run-shell", "-s", + help="Run a quick bash session with the paths set", + default=False, + action="store_true", + ) + parser.add_argument("--make-threads", "-j", + default=1, + type=int, + ) + parser.add_argument("--gitignore-link-outputs", + help="Add the symlinks that 'make links' creates to .gitignore and stop tracking them", + default=False, + action="store_true", + ) + parser.add_argument("--show-build-environment", + default=False, + action="store_true", + ) + return parser.parse_args() + + +def get_download_dir(): + download_dir = os.path.join(script_path, "downloads") + if not os.path.isdir(download_dir): + os.mkdir(download_dir) + return download_dir + + +def download(url, local_filename_proper=None): + if local_filename_proper is None: + up_to_path = url.rsplit("?", 1)[0] + local_filename_proper = up_to_path.rsplit("/", 1)[-1] + local_filename = os.path.join(get_download_dir(), local_filename_proper) + if not os.path.exists(local_filename): + try: + urllib.urlretrieve(url, local_filename) + except IOError: + if os.path.exists(local_filename): + os.remove(local_filename) + raise + return local_filename + + +def extract_zip(zip_filename, target_dir): + if not os.path.isdir(target_dir): + os.mkdir(target_dir) + zf = zipfile.ZipFile(zip_filename) + try: + zf.extractall(target_dir) + finally: + zf.close() + + +def env_augmented_with_paths(*path_dirs_to_add): + env_copy = dict(os.environ) + path_dirs = env_copy["PATH"].split(os.pathsep) + for d in path_dirs_to_add: + if d not in path_dirs: + path_dirs.append(d) + env_copy["PATH"] = os.pathsep.join(path_dirs) + return env_copy + + +def display_dir(path): + windows_dir = os.path.join(script_path) + if path.startswith(windows_dir): + return "Windows" + path[len(windows_dir):] + return path + + +def cc(cmd_args, *args, **kwargs): + print "%s (cwd=%s)" % (" ".join(cmd_args), kwargs.get("cwd")) + sys.stdout.flush() + subprocess.check_call(cmd_args, *args, **kwargs) + + +def log(msg): + print msg + sys.stdout.flush() + + +def install(make_args, show_build_environment): + + root_dir = os.path.abspath(os.path.join(script_path, "..", "..", "..")) + dep_tracker = BuildDepTracker(root_dir) + + # just ham in the working directory for consistency + os.chdir(script_path) + + # get msys / mingw tools we need to build + + mingw_get_zip = download("https://downloads.sourceforge.net/project/mingw/Installer/mingw-get/" + "mingw-get-0.6.2-beta-20131004-1/mingw-get-0.6.2-mingw32-beta-20131004-1-bin.zip") + mingw_get_dir = MINGW_EXTRACT_PATH + extract_zip(mingw_get_zip, mingw_get_dir) + + mingw_get_filename = os.path.join(mingw_get_dir, "bin", "mingw-get.exe") + assert os.path.isfile(mingw_get_filename) + + msys_packages = ["bash", "autogen", "m4", "make", "patch"] + mingw_packages = ["autoconf", "autoconf2.5", "automake", "automake1.11", "binutils", "base", "autotools", "libtool", + "gcc", "gcc-g++"] + + all_packages_to_install = ["mingw32-%s" % x for x in mingw_packages] + ["msys-%s" % x for x in msys_packages] + + installed_packages = get_installed_packages(quiet=True) + + if any(package not in installed_packages for package in all_packages_to_install): + cc([mingw_get_filename, "install"] + all_packages_to_install) + else: + log("All required packages installed") + + mingw_get_bin_dir = os.path.join(mingw_get_dir, "bin") + msys_bin_dir = os.path.join(mingw_get_dir, "msys", "1.0", "bin") + mingw_bin_dir = os.path.join(mingw_get_dir, "mingw32", "bin") + + our_env = env_augmented_with_paths(mingw_get_bin_dir, msys_bin_dir, mingw_bin_dir) + + # ditch any outer make flags from cmake or similar due to compatibility problems + for var in ["MAKEFLAGS", "MAKELEVEL", "MFLAGS"]: + our_env.pop(var, None) + + if show_build_environment: + print "ENVIRONMENT FOR BUILD" + show_env_dict(our_env) + print "" + + # build SDL + + sdl_zip_filename = download("http://www.libsdl.org/release/SDL-1.2.15.zip") + sdl_dir = os.path.join(get_download_dir(), "SDL-1.2.15") + with dep_tracker.rebuilding_if_needed("sdl_extract_zip", sdl_zip_filename) as needs_rebuild: + if needs_rebuild: + extract_zip(sdl_zip_filename, get_download_dir()) + + patch_filename = os.path.join(script_path, "sdl_fix.patch") + sdl_patched_files = ["build-scripts/ltmain.sh"] + with dep_tracker.rebuilding_if_needed("sdl_patch", patch_filename) as needs_rebuild: + if needs_rebuild: + # apply patch for building in msys/mingw + patch_exe = os.path.join(msys_bin_dir, "patch.exe") + cc([patch_exe, "-p2", "-i", patch_filename], cwd=sdl_dir, env=our_env) + dep_tracker.done("sdl_patch") + + msys_bash = os.path.join(msys_bin_dir, "bash.exe") + + make_bin = os.path.join(msys_bin_dir, "make.exe") + # our_env["MAKE"] = make_bin + + with dep_tracker.rebuilding_if_needed("sdl_autogen", + ["configure.in"] + sdl_patched_files, base_dir=sdl_dir) as needs_rebuild: + if needs_rebuild: + cc([msys_bash, "./autogen.sh"], cwd=sdl_dir, env=our_env) + with dep_tracker.rebuilding_if_needed("sdl_configure", "configure", base_dir=sdl_dir) as needs_rebuild: + if needs_rebuild: + cc([msys_bash, "./configure", "--disable-shared", "--prefix=/usr"], cwd=sdl_dir, env=our_env) + cc([make_bin] + make_args + ["clean"], cwd=sdl_dir, env=our_env) + + cc([make_bin] + make_args, cwd=sdl_dir, env=our_env) + + # TODO track all the files tht this could install + sdl_headers = "SDL.h SDL_active.h SDL_audio.h SDL_byteorder.h SDL_cdrom.h SDL_cpuinfo.h SDL_endian.h " \ + "SDL_error.h SDL_events.h SDL_getenv.h SDL_joystick.h SDL_keyboard.h SDL_keysym.h SDL_loadso.h " \ + "SDL_main.h SDL_mouse.h SDL_mutex.h SDL_name.h SDL_opengl.h SDL_platform.h SDL_quit.h SDL_rwops.h " \ + "SDL_stdinc.h SDL_syswm.h SDL_thread.h SDL_timer.h SDL_types.h SDL_version.h SDL_video.h " \ + "begin_code.h close_code.h" + sdl_headers = ["include/" + x for x in sdl_headers.split(" ")] + sdl_files_being_installed = ["sdl-config", "build/libSDL.la"] + sdl_headers + + with dep_tracker.rebuilding_if_needed("sdl_install", sdl_files_being_installed, base_dir=sdl_dir) as needs_rebuild: + if needs_rebuild: + cc([make_bin, "install"], cwd=sdl_dir, env=our_env) + + # build sheepshaver + + sheepshaver_dir = os.path.abspath(os.path.join(script_path, "..", "..")) + print "SHEEPSHAVER_DIR: %s" % sheepshaver_dir + + link_inputs = get_symlink_filenames(prefix="BasiliskII/src/") + + print "Tracking %d link inputs" % len(link_inputs) + sys.stdout.flush() + + # TODO: fix make links step rather than just eating the exception + with dep_tracker.rebuilding_if_needed("sheepshaver_top_makefile", ["SheepShaver/Makefile"] + link_inputs, + base_dir=root_dir) as needs_rebuild: + if needs_rebuild: + try: + cc([make_bin, "links"], cwd=sheepshaver_dir, env=our_env) + except subprocess.CalledProcessError: + pass + + autogen_env = dict(our_env, NO_CONFIGURE="1") + + unix_dir = os.path.join(sheepshaver_dir, "src", "Unix") + + with dep_tracker.rebuilding_if_needed("sheepshaver_autogen", ["configure.ac"], + base_dir=script_path) as needs_rebuild: + if needs_rebuild: + cc([msys_bash, os.path.join(unix_dir, "autogen.sh")], cwd=script_path, env=autogen_env) + + ln_cmd = os.path.join(msys_bin_dir, "ln.exe") + + windows_m4_dir = os.path.join(script_path, "m4") + if not os.path.exists(windows_m4_dir): + cc([ln_cmd, "-sf", os.path.join(unix_dir, "m4"), windows_m4_dir], + cwd=script_path, env=autogen_env) + + configure_macemu_env = dict(our_env) + configure_macemu_env["CC"] = "gcc %s" % MACEMU_CFLAGS + configure_macemu_env["CXX"] = "g++ %s" % MACEMU_CXXFLAGS + + with dep_tracker.rebuilding_if_needed("sheepshaver_configure", ["configure", "Makefile.in"], + base_dir=script_path) as needs_rebuild: + if needs_rebuild: + # TODO FIX JIT + cc([msys_bash, "./configure", "--with-gtk=no", "--enable-jit=no"], + cwd=script_path, env=configure_macemu_env) + + cc([make_bin] + make_args, cwd=script_path, env=our_env) + + +def show_env_dict(d): + keys = d.keys() + keys.sort() + for key in keys: + value = d[key] + print "\t%20s\t%s" % (key, value) + + +def xml_element_helper(filename, tag_name): + dom = xml.dom.minidom.parse(filename) + for element in dom.getElementsByTagName(tag_name): + assert isinstance(element, xml.dom.minidom.Element) + yield element + + +def xml_read_helper(filename, tag_name, attribute): + """In the named XML file, get the values for an attribute on all the tags with the given tag name, + and return them as a list""" + values = [] + for element in xml_element_helper(filename, tag_name): + value = element.getAttribute(attribute) + values.append(value) + return values + + +def get_installed_packages(quiet=False): + data_path = os.path.join(MINGW_EXTRACT_PATH, "var", "lib", "mingw-get", "data") + + # msys tracks installed packages by installed tarnames in the sysroot file. + + # first, get the mapping from tarnames to package names for all available packages + package_list_filename = os.path.join(data_path, "package-list.xml") + catalogues = xml_read_helper(package_list_filename, "package-list", "catalogue") + + packages_by_tarname = {} + + for catalogue in catalogues: + catalog_filename = os.path.join(data_path, catalogue + ".xml") + package_catalogues = xml_read_helper(catalog_filename, "package-list", "catalogue") + + for package_catalogue in package_catalogues: + package_catalogue_filename = os.path.join(data_path, package_catalogue + ".xml") + for package_element in xml_element_helper(package_catalogue_filename, "package"): + assert isinstance(package_element, xml.dom.minidom.Element) + package_name = package_element.getAttribute("name") + releases = package_element.getElementsByTagName("release") + for release in releases: + assert isinstance(release, xml.dom.minidom.Element) + tarname = release.getAttribute("tarname") + skip_set = False + if tarname in packages_by_tarname: + old_package_name = packages_by_tarname[tarname] + if old_package_name != package_name: + if package_name.endswith("-old"): + skip_set = True + else: + assert False, "duplicate packages for %r; old: %r, " \ + "new %r" % (tarname, packages_by_tarname[tarname], package_name) + if not skip_set: + packages_by_tarname[tarname] = package_name + + # for tarname, package_name in packages_by_tarname.iteritems(): + # print "%s -> %s" % (tarname, package_name) + + # next, get the list of all the installed tarnames, and build the list of installed packages for them + installed_packages = set() + for match_proper in glob.glob1(data_path, "sysroot-*.xml"): + match_filename = os.path.join(data_path, match_proper) + + for tarname in xml_read_helper(match_filename, "installed", "tarname"): + package_catalogue = packages_by_tarname[tarname] + if not quiet: + print "%s - %s" % (tarname, package_catalogue) + sys.stdout.flush() + installed_packages.add(package_catalogue) + + return list(installed_packages) + + +def uninstall_packages(): + mingw_get_filename = os.path.join(MINGW_EXTRACT_PATH, "bin", "mingw-get.exe") + # output = subprocess.check_output([mingw_get_filename, "list"]) + + installed_packages = get_installed_packages() + + # uninstall them + for package_name in installed_packages: + cc([mingw_get_filename, "remove", package_name]) + + +def run_shell(): + mingw_get_dir = MINGW_EXTRACT_PATH + + msys_bin_dir = os.path.join(mingw_get_dir, "msys", "1.0", "bin") + mingw_bin_dir = os.path.join(mingw_get_dir, "mingw32", "bin") + mingw_get_bin_dir = os.path.join(mingw_get_dir, "bin") + + msys_bash = os.path.join(msys_bin_dir, "bash.exe") + + our_env = env_augmented_with_paths(mingw_get_bin_dir, msys_bin_dir, mingw_bin_dir) + + cc([msys_bash], env=our_env) + + +def get_symlink_filenames(prefix="SheepShaver/src/"): + """ Get a list of files that 'make links' in the top Makefile makes symlinks for """ + sheepshaver_dir = os.path.abspath(os.path.join(script_path, "..", "..")) + top_makefile = os.path.join(sheepshaver_dir, "Makefile") + + with open(top_makefile, "r") as handle: + while not handle.readline().startswith("links:"): + pass + first_line = handle.readline() + links_list_prefix = " @list='" + assert first_line.startswith(links_list_prefix) + lines = [first_line[len(links_list_prefix):]] + while True: + line = handle.readline() + end_pos = line.find("'") + if end_pos == -1: + lines.append(line) + else: + lines.append(line[:end_pos]) + break + + links_list_text = "".join(lines) + return [prefix + x for x in links_list_text.split() if x != "\\"] + + +def gitignore_patterns(patterns): + """ Add the given patterns to the .gitignore file so they don't show up in git diff output """ + + root_dir = os.path.abspath(os.path.join(script_path, "..", "..", "..")) + gitignore_file = os.path.join(root_dir, ".gitignore") + + with open(gitignore_file, "a") as handle: + for pattern in patterns: + print >> handle, pattern + + +def get_tracked_files(): + root_dir = os.path.abspath(os.path.join(script_path, "..", "..", "..")) + lines = subprocess.check_output(["git", "ls-tree", "--full-tree", "-r", + "--name-only", "HEAD"], cwd=root_dir).split("\n") + lines = [line.strip() for line in lines] + return [line for line in lines if line != ""] + + +def get_staged_deletes(): + staged_deletes = [] + root_dir = os.path.abspath(os.path.join(script_path, "..", "..", "..")) + lines = subprocess.check_output(["git", "diff", "--name-status", "--cached"], cwd=root_dir).split("\n") + for line in lines: + if line.strip() == "": + continue + flags, filename = line.split(None, 1) + # print repr((flags, filename)) + if flags == "D": + staged_deletes.append(filename) + return staged_deletes + + +class BuildDepTracker(object): + def __init__(self, root_path): + assert os.path.isdir(root_path) + self.root_path = root_path + self.filename = os.path.join(script_path, "build_on_msys.cache.json") + self.cache = None + self.step_input_files = {} + self.load() + self.debug_output = True + + def load(self): + if os.path.exists(self.filename): + with open(self.filename, "r") as handle: + self.cache = json.load(handle) + else: + self.cache = {"steps": {}} + + def save(self): + with open(self.filename, "w") as handle: + json.dump(self.cache, handle, sort_keys=True, indent=4, separators=(',', ': ')) + + def _rel_path_for(self, filename): + assert os.path.commonprefix(filename, self.root_path) == self.root_path + return os.path.relpath(filename, start=self.root_path) + + @contextmanager + def rebuilding_if_needed(self, step_name, input_filenames, base_dir=None): + """ + @type step_name: unicode or str + @type input_filenames: str or list of str + @param base_dir: if provided, all input_filenames are relative to this""" + needs_rebuild = self.check_needs_rebuild(step_name, input_filenames, base_dir) + yield needs_rebuild + if needs_rebuild: + self.done(step_name) + + def check_needs_rebuild(self, step_name, input_filenames, base_dir=None): + """ Check if the given step build name needs a rebuild based on our records and + the ages of the input files. + @type step_name: unicode or str + @type input_filenames: list of str + @param base_dir: if provided, all input_filenames are relative to this + """ + if type(input_filenames) in (unicode, str): + input_filenames = [input_filenames] + if base_dir is not None: + input_filenames = [os.path.join(base_dir, x) for x in input_filenames] + step_entries = self.cache["steps"] + if len(input_filenames) == 0: + assert False, "At least one input file is required in step '%s'" % step_name + + entry = step_entries.get(step_name) + + input_modified_time = self.get_inputs_modified_time(input_filenames) + + self.step_input_files[step_name] = input_filenames + + rebuild_required = entry is None or entry < input_modified_time + + if self.debug_output: + if entry is None: + desc = "not previously built; building" + else: + desc = "rebuild required: %s; last build %s;" \ + "input files changed %s; " % (rebuild_required, + datetime.datetime.fromtimestamp(entry), + datetime.datetime.fromtimestamp(input_modified_time), + ) + print "REBUILD(%s): %s" % (step_name, desc) + sys.stdout.flush() + + return rebuild_required + + @staticmethod + def get_inputs_modified_time(input_filenames): + input_file_mtimes = [] + for input_filename in input_filenames: + stat = os.stat(input_filename) + if stat is None: + assert False, "Missing input file %s" % input_filename + input_file_mtimes.append(stat.st_mtime) + input_modified_time = max(input_file_mtimes) + return input_modified_time + + def done(self, step_name): + print "DONE_REBUILD(%s)" % step_name + input_filenames = self.step_input_files.get(step_name) + if input_filenames is None: + assert False, "No needs_rebuild check was done for step '%s' so we don't know its input files" % step_name + + step_entries = self.cache["steps"] + input_modified_time = self.get_inputs_modified_time(input_filenames) + + # save a new entry for the build that happened + # build is good up for the current file modified times + step_entries[step_name] = input_modified_time + self.save() + + +def main(): + options = parse_args() + + if options.run_shell: + run_shell() + elif options.uninstall_packages: + uninstall_packages() + elif options.gitignore_link_outputs: + link_output_files = get_symlink_filenames() + # add to gitignore + gitignore_patterns(link_output_files) + + # stop tracking if tracked + tracked_files = get_tracked_files() + + staged_deletes = get_staged_deletes() + + root_dir = os.path.abspath(os.path.join(script_path, "..", "..", "..")) + for filename_relative in link_output_files: + # filename = os.path.join(root_dir, filename_relative.replace("/", "\\")) + file_is_tracked = filename_relative in tracked_files or \ + any(filename.startswith(filename_relative + "/") for filename in tracked_files) + if file_is_tracked and not filename_relative in staged_deletes: + subprocess.check_call(["git", "rm", "--cached", filename_relative], cwd=root_dir) + + else: + make_args = [] + num_threads = options.make_threads + if num_threads > 1: + make_args.append("-j%d" % num_threads) + + install(make_args, options.show_build_environment) + + +if __name__ == "__main__": + main() diff --git a/SheepShaver/src/Windows/cd_defs.h b/SheepShaver/src/Windows/cd_defs.h deleted file mode 120000 index fdaec5bd..00000000 --- a/SheepShaver/src/Windows/cd_defs.h +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/Windows/cd_defs.h \ No newline at end of file diff --git a/SheepShaver/src/Windows/cdenable b/SheepShaver/src/Windows/cdenable deleted file mode 120000 index 3b36f98c..00000000 --- a/SheepShaver/src/Windows/cdenable +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/Windows/cdenable \ No newline at end of file diff --git a/SheepShaver/src/Windows/clip_windows.cpp b/SheepShaver/src/Windows/clip_windows.cpp deleted file mode 120000 index 2669ccc9..00000000 --- a/SheepShaver/src/Windows/clip_windows.cpp +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/Windows/clip_windows.cpp \ No newline at end of file diff --git a/SheepShaver/src/Windows/configure.ac b/SheepShaver/src/Windows/configure.ac index dcb4bfe0..e9b4f57c 100755 --- a/SheepShaver/src/Windows/configure.ac +++ b/SheepShaver/src/Windows/configure.ac @@ -84,7 +84,7 @@ AC_CACHE_CHECK([whether VirtualProtect works], #define HAVE_WIN32_VM 1 #define CONFIGURE_TEST_VM_MAP #define TEST_VM_PROT_$test_def - #include "../Unix/vm_alloc.cpp" + #include "../CrossPlatform/vm_alloc.cpp" ], ac_cv_VirtualProtect_works=no, rm -f core, dnl When cross-compiling, assume it works ac_cv_VirtualProtect_works="yes" @@ -94,7 +94,7 @@ AC_CACHE_CHECK([whether VirtualProtect works], #define HAVE_WIN32_VM 1 #define CONFIGURE_TEST_VM_MAP #define TEST_VM_PROT_RDWR_WRITE - #include "../Unix/vm_alloc.cpp" + #include "../CrossPlatform/vm_alloc.cpp" ], , ac_cv_VirtualProtect_works=no, dnl When cross-compiling, assume it works ac_cv_VirtualProtect_works="yes" @@ -116,8 +116,8 @@ AC_CACHE_CHECK([whether your system supports Windows exceptions], AC_TRY_RUN([ #define HAVE_WIN32_EXCEPTIONS 1 #define CONFIGURE_TEST_SIGSEGV_RECOVERY - #include "../Unix/vm_alloc.cpp" - #include "../Unix/sigsegv.cpp" + #include "../CrossPlatform/vm_alloc.cpp" + #include "../CrossPlatform/sigsegv.cpp" ], ac_cv_have_win32_exceptions=yes, ac_cv_have_win32_exceptions=no, @@ -141,8 +141,8 @@ AC_CACHE_CHECK([whether we can skip instruction in SIGSEGV handler], AC_TRY_RUN([ #define HAVE_SIGSEGV_SKIP_INSTRUCTION 1 #define CONFIGURE_TEST_SIGSEGV_RECOVERY - #include "../Unix/vm_alloc.cpp" - #include "../Unix/sigsegv.cpp" + #include "../CrossPlatform/vm_alloc.cpp" + #include "../CrossPlatform/sigsegv.cpp" ], ac_cv_have_skip_instruction=yes, ac_cv_have_skip_instruction=no, dnl When cross-compiling, assume it works ac_cv_have_skip_instruction="yes" diff --git a/SheepShaver/src/Windows/ether_windows.cpp b/SheepShaver/src/Windows/ether_windows.cpp deleted file mode 120000 index 44595188..00000000 --- a/SheepShaver/src/Windows/ether_windows.cpp +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/Windows/ether_windows.cpp \ No newline at end of file diff --git a/SheepShaver/src/Windows/ether_windows.h b/SheepShaver/src/Windows/ether_windows.h deleted file mode 120000 index 6659d3c9..00000000 --- a/SheepShaver/src/Windows/ether_windows.h +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/Windows/ether_windows.h \ No newline at end of file diff --git a/SheepShaver/src/Windows/extfs_windows.cpp b/SheepShaver/src/Windows/extfs_windows.cpp deleted file mode 120000 index 26d851b3..00000000 --- a/SheepShaver/src/Windows/extfs_windows.cpp +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/Windows/extfs_windows.cpp \ No newline at end of file diff --git a/SheepShaver/src/Windows/kernel_windows.cpp b/SheepShaver/src/Windows/kernel_windows.cpp deleted file mode 120000 index d9c12cdc..00000000 --- a/SheepShaver/src/Windows/kernel_windows.cpp +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/Windows/kernel_windows.cpp \ No newline at end of file diff --git a/SheepShaver/src/Windows/kernel_windows.h b/SheepShaver/src/Windows/kernel_windows.h deleted file mode 120000 index 10e68ceb..00000000 --- a/SheepShaver/src/Windows/kernel_windows.h +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/Windows/kernel_windows.h \ No newline at end of file diff --git a/SheepShaver/src/Windows/main_windows.cpp b/SheepShaver/src/Windows/main_windows.cpp index 2d63d76b..6efc0111 100755 --- a/SheepShaver/src/Windows/main_windows.cpp +++ b/SheepShaver/src/Windows/main_windows.cpp @@ -44,7 +44,7 @@ #include "vm_alloc.h" #include "sigsegv.h" #include "util_windows.h" -#include "kernel_windows.h" +//#include "kernel_windows.h" #define DEBUG 0 #include "debug.h" @@ -207,8 +207,8 @@ int main(int argc, char **argv) if (!check_drivers()) QuitEmulator(); - // Load win32 libraries - KernelInit(); +// // Load win32 libraries +// KernelInit(); // FIXME: default to DIB driver if (getenv("SDL_VIDEODRIVER") == NULL) @@ -446,8 +446,8 @@ static void Quit(void) // Exit preferences PrefsExit(); - // Release win32 libraries - KernelExit(); +// // Release win32 libraries +// KernelExit(); #ifdef ENABLE_MON // Exit mon diff --git a/SheepShaver/src/Windows/posix_emu.cpp b/SheepShaver/src/Windows/posix_emu.cpp deleted file mode 120000 index 336f134f..00000000 --- a/SheepShaver/src/Windows/posix_emu.cpp +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/Windows/posix_emu.cpp \ No newline at end of file diff --git a/SheepShaver/src/Windows/posix_emu.h b/SheepShaver/src/Windows/posix_emu.h deleted file mode 120000 index 6fd82b8b..00000000 --- a/SheepShaver/src/Windows/posix_emu.h +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/Windows/posix_emu.h \ No newline at end of file diff --git a/SheepShaver/src/Windows/prefs_editor_gtk.cpp b/SheepShaver/src/Windows/prefs_editor_gtk.cpp deleted file mode 120000 index b94e7615..00000000 --- a/SheepShaver/src/Windows/prefs_editor_gtk.cpp +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/Windows/prefs_editor_gtk.cpp \ No newline at end of file diff --git a/SheepShaver/src/Windows/router b/SheepShaver/src/Windows/router deleted file mode 120000 index e8619d55..00000000 --- a/SheepShaver/src/Windows/router +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/Windows/router \ No newline at end of file diff --git a/SheepShaver/src/Windows/sdl_fix.patch b/SheepShaver/src/Windows/sdl_fix.patch new file mode 100644 index 00000000..d4c38a19 --- /dev/null +++ b/SheepShaver/src/Windows/sdl_fix.patch @@ -0,0 +1,12 @@ +diff -ur downloads/SDL-1.2.15-orig/build-scripts/ltmain.sh downloads/SDL-1.2.15/build-scripts/ltmain.sh +--- downloads/SDL-1.2.15-orig/build-scripts/ltmain.sh 2017-01-15 20:57:25 -0800 ++++ downloads/SDL-1.2.15/build-scripts/ltmain.sh 2017-01-15 21:00:16 -0800 +@@ -2274,7 +2274,7 @@ + if test -n "$current_libdirs"; then + # Maybe just do a dry run. + $opt_dry_run && current_libdirs=" -n$current_libdirs" +- exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' ++ exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs' + else + exit $EXIT_SUCCESS + fi diff --git a/SheepShaver/src/Windows/serial_windows.cpp b/SheepShaver/src/Windows/serial_windows.cpp deleted file mode 120000 index 88454f92..00000000 --- a/SheepShaver/src/Windows/serial_windows.cpp +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/Windows/serial_windows.cpp \ No newline at end of file diff --git a/SheepShaver/src/Windows/sys_windows.cpp b/SheepShaver/src/Windows/sys_windows.cpp deleted file mode 120000 index 3eacbe88..00000000 --- a/SheepShaver/src/Windows/sys_windows.cpp +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/Windows/sys_windows.cpp \ No newline at end of file diff --git a/SheepShaver/src/Windows/sysdeps.h b/SheepShaver/src/Windows/sysdeps.h index f5aaee12..0236d74e 100755 --- a/SheepShaver/src/Windows/sysdeps.h +++ b/SheepShaver/src/Windows/sysdeps.h @@ -25,6 +25,8 @@ #error "Your compiler is not ANSI. Get a real one." #endif +#define min(x,y) ((x) < (y) ? (x) : (y)) + #include "config.h" #include "user_strings_windows.h" @@ -32,11 +34,17 @@ #error "You don't have ANSI C header files." #endif +#ifndef PASCAL +#define PASCAL +#endif + #include #include #include #include #include +#include +#undef _TEXT #include #ifdef __WIN32__ #include @@ -225,6 +233,7 @@ static inline uint64 tswap64(uint64 x) { return bswap_64(x); } (((x) & 0x0000ff00) << 8) | (((x) & 0x000000ff) << 24)) #if defined(__GNUC__) +#if 0 #define do_byteswap_16(x) \ (__extension__ \ ({ register uint16 __v, __x = (x); \ @@ -243,8 +252,19 @@ static inline uint64 tswap64(uint64 x) { return bswap_64(x); } __v = do_byteswap_32_g(__x); \ __v; })) #else -#define do_byteswap_16(x) do_byteswap_16_g(x) -#define do_byteswap_32(x) do_byteswap_32_g(x) + +inline uint16 funyun_bswap_16(uint16 x) +{ + return ((x & 0xff) << 8) | ((x >> 8) & 0xff); +} + +#define do_byteswap_16(x) (funyun_bswap_16(x)) +#define do_byteswap_32(x) (do_byteswap_32_g(x)) + +#endif +#else +#define do_byteswap_16(x) (do_byteswap_16_g((uint16)(x))) +#define do_byteswap_32(x) (do_byteswap_32_g(x)) #endif #if defined(__i386__) || defined(__x86_64__) diff --git a/SheepShaver/src/Windows/timer_windows.cpp b/SheepShaver/src/Windows/timer_windows.cpp deleted file mode 120000 index b43201a9..00000000 --- a/SheepShaver/src/Windows/timer_windows.cpp +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/Windows/timer_windows.cpp \ No newline at end of file diff --git a/SheepShaver/src/Windows/util_windows.cpp b/SheepShaver/src/Windows/util_windows.cpp deleted file mode 120000 index 74810981..00000000 --- a/SheepShaver/src/Windows/util_windows.cpp +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/Windows/util_windows.cpp \ No newline at end of file diff --git a/SheepShaver/src/Windows/util_windows.h b/SheepShaver/src/Windows/util_windows.h deleted file mode 120000 index f875032d..00000000 --- a/SheepShaver/src/Windows/util_windows.h +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/Windows/util_windows.h \ No newline at end of file diff --git a/SheepShaver/src/Windows/xpram_windows.cpp b/SheepShaver/src/Windows/xpram_windows.cpp deleted file mode 120000 index 4c317a37..00000000 --- a/SheepShaver/src/Windows/xpram_windows.cpp +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/Windows/xpram_windows.cpp \ No newline at end of file diff --git a/SheepShaver/src/adb.cpp b/SheepShaver/src/adb.cpp deleted file mode 120000 index 1cc36b98..00000000 --- a/SheepShaver/src/adb.cpp +++ /dev/null @@ -1 +0,0 @@ -../../BasiliskII/src/adb.cpp \ No newline at end of file diff --git a/SheepShaver/src/audio.cpp b/SheepShaver/src/audio.cpp deleted file mode 120000 index 3cc4fd95..00000000 --- a/SheepShaver/src/audio.cpp +++ /dev/null @@ -1 +0,0 @@ -../../BasiliskII/src/audio.cpp \ No newline at end of file diff --git a/SheepShaver/src/cdrom.cpp b/SheepShaver/src/cdrom.cpp deleted file mode 120000 index d97cd44d..00000000 --- a/SheepShaver/src/cdrom.cpp +++ /dev/null @@ -1 +0,0 @@ -../../BasiliskII/src/cdrom.cpp \ No newline at end of file diff --git a/SheepShaver/src/disk.cpp b/SheepShaver/src/disk.cpp deleted file mode 120000 index f994afaa..00000000 --- a/SheepShaver/src/disk.cpp +++ /dev/null @@ -1 +0,0 @@ -../../BasiliskII/src/disk.cpp \ No newline at end of file diff --git a/SheepShaver/src/dummy/audio_dummy.cpp b/SheepShaver/src/dummy/audio_dummy.cpp deleted file mode 120000 index 6c3904ce..00000000 --- a/SheepShaver/src/dummy/audio_dummy.cpp +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/dummy/audio_dummy.cpp \ No newline at end of file diff --git a/SheepShaver/src/dummy/clip_dummy.cpp b/SheepShaver/src/dummy/clip_dummy.cpp deleted file mode 120000 index d5f48422..00000000 --- a/SheepShaver/src/dummy/clip_dummy.cpp +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/dummy/clip_dummy.cpp \ No newline at end of file diff --git a/SheepShaver/src/dummy/prefs_editor_dummy.cpp b/SheepShaver/src/dummy/prefs_editor_dummy.cpp deleted file mode 120000 index 66b5d559..00000000 --- a/SheepShaver/src/dummy/prefs_editor_dummy.cpp +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/dummy/prefs_editor_dummy.cpp \ No newline at end of file diff --git a/SheepShaver/src/dummy/scsi_dummy.cpp b/SheepShaver/src/dummy/scsi_dummy.cpp deleted file mode 120000 index ae968210..00000000 --- a/SheepShaver/src/dummy/scsi_dummy.cpp +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/dummy/scsi_dummy.cpp \ No newline at end of file diff --git a/SheepShaver/src/dummy/serial_dummy.cpp b/SheepShaver/src/dummy/serial_dummy.cpp deleted file mode 120000 index 26af78ab..00000000 --- a/SheepShaver/src/dummy/serial_dummy.cpp +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/dummy/serial_dummy.cpp \ No newline at end of file diff --git a/SheepShaver/src/ether.cpp b/SheepShaver/src/ether.cpp index 2a1e53c7..05335cf8 100644 --- a/SheepShaver/src/ether.cpp +++ b/SheepShaver/src/ether.cpp @@ -32,6 +32,8 @@ #include "ether_defs.h" #include "macos_util.h" +#include "main.h" + #define DEBUG 0 #include "debug.h" diff --git a/SheepShaver/src/extfs.cpp b/SheepShaver/src/extfs.cpp deleted file mode 120000 index 62314724..00000000 --- a/SheepShaver/src/extfs.cpp +++ /dev/null @@ -1 +0,0 @@ -../../BasiliskII/src/extfs.cpp \ No newline at end of file diff --git a/SheepShaver/src/gfxaccel.cpp b/SheepShaver/src/gfxaccel.cpp index ed65e5d8..6f385ba0 100644 --- a/SheepShaver/src/gfxaccel.cpp +++ b/SheepShaver/src/gfxaccel.cpp @@ -24,6 +24,8 @@ #include "video.h" #include "video_defs.h" +#include "main.h" + #define DEBUG 0 #include "debug.h" diff --git a/SheepShaver/src/include/adb.h b/SheepShaver/src/include/adb.h deleted file mode 120000 index e65ef4a4..00000000 --- a/SheepShaver/src/include/adb.h +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/include/adb.h \ No newline at end of file diff --git a/SheepShaver/src/include/audio.h b/SheepShaver/src/include/audio.h deleted file mode 120000 index 73ebba7e..00000000 --- a/SheepShaver/src/include/audio.h +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/include/audio.h \ No newline at end of file diff --git a/SheepShaver/src/include/audio_defs.h b/SheepShaver/src/include/audio_defs.h deleted file mode 120000 index 04523f25..00000000 --- a/SheepShaver/src/include/audio_defs.h +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/include/audio_defs.h \ No newline at end of file diff --git a/SheepShaver/src/include/cdrom.h b/SheepShaver/src/include/cdrom.h deleted file mode 120000 index d7300f7a..00000000 --- a/SheepShaver/src/include/cdrom.h +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/include/cdrom.h \ No newline at end of file diff --git a/SheepShaver/src/include/clip.h b/SheepShaver/src/include/clip.h deleted file mode 120000 index 23f10c02..00000000 --- a/SheepShaver/src/include/clip.h +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/include/clip.h \ No newline at end of file diff --git a/SheepShaver/src/include/debug.h b/SheepShaver/src/include/debug.h deleted file mode 120000 index 6a0dd40c..00000000 --- a/SheepShaver/src/include/debug.h +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/include/debug.h \ No newline at end of file diff --git a/SheepShaver/src/include/disk.h b/SheepShaver/src/include/disk.h deleted file mode 120000 index d785c55d..00000000 --- a/SheepShaver/src/include/disk.h +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/include/disk.h \ No newline at end of file diff --git a/SheepShaver/src/include/extfs.h b/SheepShaver/src/include/extfs.h deleted file mode 120000 index a86e2538..00000000 --- a/SheepShaver/src/include/extfs.h +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/include/extfs.h \ No newline at end of file diff --git a/SheepShaver/src/include/extfs_defs.h b/SheepShaver/src/include/extfs_defs.h deleted file mode 120000 index 0970ce1f..00000000 --- a/SheepShaver/src/include/extfs_defs.h +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/include/extfs_defs.h \ No newline at end of file diff --git a/SheepShaver/src/include/main.h b/SheepShaver/src/include/main.h index e595c04a..787832da 100644 --- a/SheepShaver/src/include/main.h +++ b/SheepShaver/src/include/main.h @@ -77,4 +77,15 @@ extern void TriggerInterrupt(void); // Trigger SIGUSR1 interrupt in emulat extern void DisableInterrupt(void); // Disable SIGUSR1 interrupt (can be nested) extern void EnableInterrupt(void); // Enable SIGUSR1 interrupt (can be nested) +// Array length +#if __cplusplus >= 201103L || (_MSC_VER >= 1900 && defined __cplusplus) +template +constexpr size_t lengthof(T (& a)[size]) +{ + return size; +} +#else +#define lengthof(a) (sizeof(a) / sizeof(a[0])) +#endif + #endif diff --git a/SheepShaver/src/include/pict.h b/SheepShaver/src/include/pict.h deleted file mode 120000 index 6e5a0b71..00000000 --- a/SheepShaver/src/include/pict.h +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/include/pict.h \ No newline at end of file diff --git a/SheepShaver/src/include/prefs.h b/SheepShaver/src/include/prefs.h deleted file mode 120000 index 64a7ae51..00000000 --- a/SheepShaver/src/include/prefs.h +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/include/prefs.h \ No newline at end of file diff --git a/SheepShaver/src/include/scsi.h b/SheepShaver/src/include/scsi.h deleted file mode 120000 index b5aa39cc..00000000 --- a/SheepShaver/src/include/scsi.h +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/include/scsi.h \ No newline at end of file diff --git a/SheepShaver/src/include/serial.h b/SheepShaver/src/include/serial.h deleted file mode 120000 index 42183f36..00000000 --- a/SheepShaver/src/include/serial.h +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/include/serial.h \ No newline at end of file diff --git a/SheepShaver/src/include/serial_defs.h b/SheepShaver/src/include/serial_defs.h deleted file mode 120000 index 1765fd10..00000000 --- a/SheepShaver/src/include/serial_defs.h +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/include/serial_defs.h \ No newline at end of file diff --git a/SheepShaver/src/include/sony.h b/SheepShaver/src/include/sony.h deleted file mode 120000 index d9eb3144..00000000 --- a/SheepShaver/src/include/sony.h +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/include/sony.h \ No newline at end of file diff --git a/SheepShaver/src/include/sys.h b/SheepShaver/src/include/sys.h deleted file mode 120000 index 5581536a..00000000 --- a/SheepShaver/src/include/sys.h +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/include/sys.h \ No newline at end of file diff --git a/SheepShaver/src/include/timer.h b/SheepShaver/src/include/timer.h deleted file mode 120000 index a7ee23e9..00000000 --- a/SheepShaver/src/include/timer.h +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/include/timer.h \ No newline at end of file diff --git a/SheepShaver/src/include/xpram.h b/SheepShaver/src/include/xpram.h deleted file mode 120000 index 382aa791..00000000 --- a/SheepShaver/src/include/xpram.h +++ /dev/null @@ -1 +0,0 @@ -../../../BasiliskII/src/include/xpram.h \ No newline at end of file diff --git a/SheepShaver/src/kpx_cpu/src/cpu/jit/x86/codegen_x86.h b/SheepShaver/src/kpx_cpu/src/cpu/jit/x86/codegen_x86.h deleted file mode 120000 index 110f4bd0..00000000 --- a/SheepShaver/src/kpx_cpu/src/cpu/jit/x86/codegen_x86.h +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../BasiliskII/src/uae_cpu/compiler/codegen_x86.h \ No newline at end of file diff --git a/SheepShaver/src/pict.c b/SheepShaver/src/pict.c deleted file mode 120000 index bcbd7ff4..00000000 --- a/SheepShaver/src/pict.c +++ /dev/null @@ -1 +0,0 @@ -../../BasiliskII/src/pict.c \ No newline at end of file diff --git a/SheepShaver/src/prefs.cpp b/SheepShaver/src/prefs.cpp deleted file mode 120000 index 6559f3b1..00000000 --- a/SheepShaver/src/prefs.cpp +++ /dev/null @@ -1 +0,0 @@ -../../BasiliskII/src/prefs.cpp \ No newline at end of file diff --git a/SheepShaver/src/scsi.cpp b/SheepShaver/src/scsi.cpp deleted file mode 120000 index 1e1a7e34..00000000 --- a/SheepShaver/src/scsi.cpp +++ /dev/null @@ -1 +0,0 @@ -../../BasiliskII/src/scsi.cpp \ No newline at end of file diff --git a/SheepShaver/src/slirp b/SheepShaver/src/slirp deleted file mode 120000 index 4e6fe8f5..00000000 --- a/SheepShaver/src/slirp +++ /dev/null @@ -1 +0,0 @@ -../../BasiliskII/src/slirp \ No newline at end of file diff --git a/SheepShaver/src/sony.cpp b/SheepShaver/src/sony.cpp deleted file mode 120000 index 42aaabb7..00000000 --- a/SheepShaver/src/sony.cpp +++ /dev/null @@ -1 +0,0 @@ -../../BasiliskII/src/sony.cpp \ No newline at end of file diff --git a/SheepShaver/src/xpram.cpp b/SheepShaver/src/xpram.cpp deleted file mode 120000 index 17fe090f..00000000 --- a/SheepShaver/src/xpram.cpp +++ /dev/null @@ -1 +0,0 @@ -../../BasiliskII/src/xpram.cpp \ No newline at end of file From dc54a5eceb0c570a49393c7812c6a3f384518a08 Mon Sep 17 00:00:00 2001 From: Andrew Tonner Date: Wed, 18 Jan 2017 04:51:34 -0800 Subject: [PATCH 04/59] missed commits --- .gitignore | 2 ++ BasiliskII/src/Windows/ether_windows.cpp | 2 ++ BasiliskII/src/Windows/serial_windows.cpp | 10 ++++++---- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 3e80b800..e6b6772b 100644 --- a/.gitignore +++ b/.gitignore @@ -140,3 +140,5 @@ SheepShaver/src/Windows/config.log SheepShaver/src/kpx_cpu/src/cpu/jit/x86/codegen_x86.h BasiliskII/src/Windows/x64/ SheepShaver/src/Windows/config.status +SheepShaver/src/Windows/obj/ +SheepShaver/src/Windows/build_on_msys.cache.json diff --git a/BasiliskII/src/Windows/ether_windows.cpp b/BasiliskII/src/Windows/ether_windows.cpp index 1f59d830..4ff27f62 100755 --- a/BasiliskII/src/Windows/ether_windows.cpp +++ b/BasiliskII/src/Windows/ether_windows.cpp @@ -39,6 +39,8 @@ #include "ether_windows.h" #include "router/router.h" #include "util_windows.h" +// somehow util_windows undefines min +#define min(x,y) ((x) < (y) ? (x) : (y)) #include "libslirp.h" // Define to let the slirp library determine the right timeout for select() diff --git a/BasiliskII/src/Windows/serial_windows.cpp b/BasiliskII/src/Windows/serial_windows.cpp index 5a062b32..194bf838 100755 --- a/BasiliskII/src/Windows/serial_windows.cpp +++ b/BasiliskII/src/Windows/serial_windows.cpp @@ -28,6 +28,8 @@ #include "main.h" #include "util_windows.h" +// somehow util_windows undefines min +#define min(x,y) ((x) < (y) ? (x) : (y)) #include "macos_util.h" #include "prefs.h" #include "serial.h" @@ -310,12 +312,12 @@ open_error: if (input_thread_active) { TerminateThread(input_thread_active,0); CloseHandle(input_signal); - input_thread_active = false; + input_thread_active = 0; } if (output_thread_active) { TerminateThread(output_thread_active,0); CloseHandle(output_signal); - output_thread_active = false; + output_thread_active = 0; } if(fd != INVALID_HANDLE_VALUE) { CloseHandle(fd); @@ -674,13 +676,13 @@ int16 XSERDPort::close() if (input_thread_active) { quitting = true; ReleaseSemaphore(input_signal,1,NULL); - input_thread_active = false; + input_thread_active = 0; CloseHandle(input_signal); } if (output_thread_active) { quitting = true; ReleaseSemaphore(output_signal,1,NULL); - output_thread_active = false; + output_thread_active = 0; // bugfix: was: CloseHandle(&output_signal); CloseHandle(output_signal); } From daac4f58ecd3407f2e544e7ffc4cb22c8df79364 Mon Sep 17 00:00:00 2001 From: Andrew Tonner Date: Wed, 18 Jan 2017 04:52:19 -0800 Subject: [PATCH 05/59] reverse serial_windows.cpp symlink removal --- SheepShaver/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SheepShaver/Makefile b/SheepShaver/Makefile index bf61fa9a..53ecae21 100644 --- a/SheepShaver/Makefile +++ b/SheepShaver/Makefile @@ -89,7 +89,7 @@ links: Windows/util_windows.h Windows/xpram_windows.cpp \ Windows/serial_windows.cpp Windows/router Windows/b2ether \ Windows/ether_windows.h Windows/ether_windows.cpp \ - Windows/prefs_editor_gtk.cpp \ + Windows/serial_windows.cpp Windows/prefs_editor_gtk.cpp \ uae_cpu/compiler/codegen_x86.h'; \ PREFIX="../"; case $(B2_TOPDIR) in /*) PREFIX="";; esac; \ for i in $$list; do \ From 0ffa196f29dafa43481690e695b9469c728fd953 Mon Sep 17 00:00:00 2001 From: Andrew Tonner Date: Wed, 18 Jan 2017 14:44:33 -0800 Subject: [PATCH 06/59] remove PASCAL undef --- SheepShaver/src/Windows/sysdeps.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/SheepShaver/src/Windows/sysdeps.h b/SheepShaver/src/Windows/sysdeps.h index 0236d74e..04dcff68 100755 --- a/SheepShaver/src/Windows/sysdeps.h +++ b/SheepShaver/src/Windows/sysdeps.h @@ -34,10 +34,6 @@ #error "You don't have ANSI C header files." #endif -#ifndef PASCAL -#define PASCAL -#endif - #include #include #include From fa8c87acffa36b950ad688138cdb1db87910da20 Mon Sep 17 00:00:00 2001 From: Andrew Tonner Date: Wed, 18 Jan 2017 14:46:55 -0800 Subject: [PATCH 07/59] add LDFLAGS for static libgcc and stdc++ so we don't need dlls for those --- SheepShaver/src/Windows/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SheepShaver/src/Windows/Makefile.in b/SheepShaver/src/Windows/Makefile.in index 1da802c7..7dcabb1f 100755 --- a/SheepShaver/src/Windows/Makefile.in +++ b/SheepShaver/src/Windows/Makefile.in @@ -37,7 +37,7 @@ CFLAGS = @CFLAGS@ $(SDL_CFLAGS) CXXFLAGS = @CXXFLAGS@ $(SDL_CFLAGS) CPPFLAGS = @CPPFLAGS@ -I../include -I. -I../slirp DEFS = @DEFS@ -LDFLAGS = @LDFLAGS@ +LDFLAGS = @LDFLAGS@ -static-libgcc -static-libstdc++ -Wl,-Bstatic -lstdc++ -lpthread -Wl,-Bdynamic LIBS = @LIBS@ -lws2_32 -lwsock32 -liphlpapi CPUSRCS = @CPUSRCS@ PERL = @PERL@ From e0783e5c2099592e6c7a5f6d2722cb0f30e9526d Mon Sep 17 00:00:00 2001 From: Andrew Tonner Date: Wed, 18 Jan 2017 14:47:21 -0800 Subject: [PATCH 08/59] add option to copy sheepshaver exe after build --- SheepShaver/src/Windows/build_on_msys.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/SheepShaver/src/Windows/build_on_msys.py b/SheepShaver/src/Windows/build_on_msys.py index fd46ea84..cb81756e 100644 --- a/SheepShaver/src/Windows/build_on_msys.py +++ b/SheepShaver/src/Windows/build_on_msys.py @@ -13,6 +13,8 @@ import sys from contextlib import contextmanager import datetime +import shutil + MACEMU_CFLAGS = "-mwin32" MACEMU_CXXFLAGS = "-mwin32 -std=gnu++11 -U__STRICT_ANSI__" @@ -47,6 +49,9 @@ def parse_args(): default=False, action="store_true", ) + parser.add_argument("--install-to-dir", + default=None, + help="Copy the resulting exe to the given directory after building") return parser.parse_args() @@ -110,7 +115,7 @@ def log(msg): sys.stdout.flush() -def install(make_args, show_build_environment): +def install(make_args, show_build_environment, install_to_dir=None): root_dir = os.path.abspath(os.path.join(script_path, "..", "..", "..")) dep_tracker = BuildDepTracker(root_dir) @@ -250,6 +255,13 @@ def install(make_args, show_build_environment): cc([make_bin] + make_args, cwd=script_path, env=our_env) + if install_to_dir is not None: + assert os.path.isdir(install_to_dir) + binary_name = "SheepShaver.exe" + dest_filename = os.path.join(install_to_dir, binary_name) + log("Creating %s" % dest_filename) + shutil.copy(os.path.join(script_path, binary_name), dest_filename) + def show_env_dict(d): keys = d.keys() @@ -543,7 +555,8 @@ def main(): if num_threads > 1: make_args.append("-j%d" % num_threads) - install(make_args, options.show_build_environment) + log("Install to %s" % options.install_to_dir) + install(make_args, options.show_build_environment, install_to_dir=options.install_to_dir) if __name__ == "__main__": From 17b977b6ad82463ae7248a271cae04ec0f5d737b Mon Sep 17 00:00:00 2001 From: Andrew Tonner Date: Wed, 18 Jan 2017 14:48:02 -0800 Subject: [PATCH 09/59] fix silly name of inline bswap 16 --- SheepShaver/src/Windows/sysdeps.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SheepShaver/src/Windows/sysdeps.h b/SheepShaver/src/Windows/sysdeps.h index 04dcff68..942b0890 100755 --- a/SheepShaver/src/Windows/sysdeps.h +++ b/SheepShaver/src/Windows/sysdeps.h @@ -249,12 +249,12 @@ static inline uint64 tswap64(uint64 x) { return bswap_64(x); } __v; })) #else -inline uint16 funyun_bswap_16(uint16 x) +inline uint16 sysdeps_inline_bswap_16(uint16 x) { return ((x & 0xff) << 8) | ((x >> 8) & 0xff); } -#define do_byteswap_16(x) (funyun_bswap_16(x)) +#define do_byteswap_16(x) (sysdeps_inline_bswap_16(x)) #define do_byteswap_32(x) (do_byteswap_32_g(x)) #endif From aabd23408d08df395f03c86573b314a87211c4e2 Mon Sep 17 00:00:00 2001 From: Andrew Tonner Date: Wed, 18 Jan 2017 15:02:20 -0800 Subject: [PATCH 10/59] option to run a shell command --- SheepShaver/src/Windows/build_on_msys.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/SheepShaver/src/Windows/build_on_msys.py b/SheepShaver/src/Windows/build_on_msys.py index cb81756e..437e6c73 100644 --- a/SheepShaver/src/Windows/build_on_msys.py +++ b/SheepShaver/src/Windows/build_on_msys.py @@ -52,6 +52,8 @@ def parse_args(): parser.add_argument("--install-to-dir", default=None, help="Copy the resulting exe to the given directory after building") + parser.add_argument("--run-shell-command", "-c", + help="Run a command in the mingw shell") return parser.parse_args() @@ -353,7 +355,7 @@ def uninstall_packages(): cc([mingw_get_filename, "remove", package_name]) -def run_shell(): +def run_shell(command=None): mingw_get_dir = MINGW_EXTRACT_PATH msys_bin_dir = os.path.join(mingw_get_dir, "msys", "1.0", "bin") @@ -364,7 +366,10 @@ def run_shell(): our_env = env_augmented_with_paths(mingw_get_bin_dir, msys_bin_dir, mingw_bin_dir) - cc([msys_bash], env=our_env) + args = [msys_bash] + if command is not None: + args += ["-c", command] + cc(args, env=our_env) def get_symlink_filenames(prefix="SheepShaver/src/"): @@ -529,6 +534,8 @@ def main(): if options.run_shell: run_shell() + elif options.run_shell_command is not None: + run_shell(options.run_shell_command) elif options.uninstall_packages: uninstall_packages() elif options.gitignore_link_outputs: From 5c264434e75c3c322422d781e68f9c81237ca4f9 Mon Sep 17 00:00:00 2001 From: Andrew Tonner Date: Wed, 18 Jan 2017 15:57:36 -0800 Subject: [PATCH 11/59] disable obsolete cd driver warning --- BasiliskII/src/Windows/util_windows.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BasiliskII/src/Windows/util_windows.cpp b/BasiliskII/src/Windows/util_windows.cpp index ef29a06b..35ee128a 100755 --- a/BasiliskII/src/Windows/util_windows.cpp +++ b/BasiliskII/src/Windows/util_windows.cpp @@ -271,7 +271,7 @@ bool check_drivers(void) else { TCHAR str[256]; _sntprintf(str, lengthof(str), TEXT("The CD-ROM driver file \"%s\" is missing."), path); - WarningAlert(str); + //WarningAlert(str); } return true; From b90b67971ca6c3c79c22f1048dc16ef1cd36a433 Mon Sep 17 00:00:00 2001 From: Andrew Tonner Date: Wed, 18 Jan 2017 16:01:52 -0800 Subject: [PATCH 12/59] fpclassify return type may vary --- SheepShaver/src/kpx_cpu/src/cpu/ppc/ppc-execute.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/SheepShaver/src/kpx_cpu/src/cpu/ppc/ppc-execute.cpp b/SheepShaver/src/kpx_cpu/src/cpu/ppc/ppc-execute.cpp index 26e98533..ce9c580e 100644 --- a/SheepShaver/src/kpx_cpu/src/cpu/ppc/ppc-execute.cpp +++ b/SheepShaver/src/kpx_cpu/src/cpu/ppc/ppc-execute.cpp @@ -904,11 +904,19 @@ void powerpc_cpu::execute_fp_int_convert(uint32 opcode) * Rc Predicate to record CR1 **/ +#ifndef FPCLASSIFY_RETURN_T +#ifdef __MINGW32__ +#define FPCLASSIFY_RETURN_T int +#else +#define FPCLASSIFY_RETURN_T uint8 +#endif +#endif + template< class FP > void powerpc_cpu::fp_classify(FP x) { uint32 c = fpscr() & ~FPSCR_FPRF_field::mask(); - uint8 fc = fpclassify(x); + FPCLASSIFY_RETURN_T fc = fpclassify(x); switch (fc) { case FP_NAN: c |= FPSCR_FPRF_FU_field::mask() | FPSCR_FPRF_C_field::mask(); From 7ef9f10712168394b887d0a37b5128e007536555 Mon Sep 17 00:00:00 2001 From: Andrew Tonner Date: Wed, 18 Jan 2017 19:00:42 -0800 Subject: [PATCH 13/59] don't undef __STRICT_ANSI__ since it's not necessary with gnu++11 --- SheepShaver/src/Windows/build_on_msys.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SheepShaver/src/Windows/build_on_msys.py b/SheepShaver/src/Windows/build_on_msys.py index 437e6c73..57e89b94 100644 --- a/SheepShaver/src/Windows/build_on_msys.py +++ b/SheepShaver/src/Windows/build_on_msys.py @@ -16,7 +16,8 @@ import datetime import shutil MACEMU_CFLAGS = "-mwin32" -MACEMU_CXXFLAGS = "-mwin32 -std=gnu++11 -U__STRICT_ANSI__" +# TODO check if __STRICT_ANSI__ is still required since we switched to gnu++11 +MACEMU_CXXFLAGS = "-mwin32 -std=gnu++11" script_path = os.path.dirname(os.path.abspath(__file__)) From ffd629494382c365f2f252286bf463589089a827 Mon Sep 17 00:00:00 2001 From: Andrew Tonner Date: Wed, 18 Jan 2017 19:01:49 -0800 Subject: [PATCH 14/59] build script comments & todos & cleanup --- SheepShaver/src/Windows/Makefile.in | 1 + SheepShaver/src/Windows/build_on_msys.py | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/SheepShaver/src/Windows/Makefile.in b/SheepShaver/src/Windows/Makefile.in index 7dcabb1f..fed312d8 100755 --- a/SheepShaver/src/Windows/Makefile.in +++ b/SheepShaver/src/Windows/Makefile.in @@ -38,6 +38,7 @@ CXXFLAGS = @CXXFLAGS@ $(SDL_CFLAGS) CPPFLAGS = @CPPFLAGS@ -I../include -I. -I../slirp DEFS = @DEFS@ LDFLAGS = @LDFLAGS@ -static-libgcc -static-libstdc++ -Wl,-Bstatic -lstdc++ -lpthread -Wl,-Bdynamic +#TODO remove pthread part of that if irrelevant LIBS = @LIBS@ -lws2_32 -lwsock32 -liphlpapi CPUSRCS = @CPUSRCS@ PERL = @PERL@ diff --git a/SheepShaver/src/Windows/build_on_msys.py b/SheepShaver/src/Windows/build_on_msys.py index 57e89b94..08933a54 100644 --- a/SheepShaver/src/Windows/build_on_msys.py +++ b/SheepShaver/src/Windows/build_on_msys.py @@ -1,5 +1,5 @@ # -# A python 2.7 script to fetch all dependencies and build Sheepshaver using MSYS +# A python 2.7 script to fetch all dependencies and build Sheepshaver using MSYS / mingw # import argparse import glob @@ -12,9 +12,11 @@ import zipfile import sys from contextlib import contextmanager import datetime - import shutil +# TODO keep track of the values for these flags used for the previous compile and +# redo the macemu configures if they change + MACEMU_CFLAGS = "-mwin32" # TODO check if __STRICT_ANSI__ is still required since we switched to gnu++11 MACEMU_CXXFLAGS = "-mwin32 -std=gnu++11" @@ -563,7 +565,7 @@ def main(): if num_threads > 1: make_args.append("-j%d" % num_threads) - log("Install to %s" % options.install_to_dir) + log("Will install to %s" % options.install_to_dir) install(make_args, options.show_build_environment, install_to_dir=options.install_to_dir) From e303e314f51aeb524e4c093da0eba50e3ab8170e Mon Sep 17 00:00:00 2001 From: Andrew Tonner Date: Wed, 18 Jan 2017 19:11:19 -0800 Subject: [PATCH 15/59] use explicit __thiscall calling convention for member function casts on mingw32 --- SheepShaver/src/kpx_cpu/include/nvmemfun.hpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/SheepShaver/src/kpx_cpu/include/nvmemfun.hpp b/SheepShaver/src/kpx_cpu/include/nvmemfun.hpp index efad01ff..830b8ecd 100644 --- a/SheepShaver/src/kpx_cpu/include/nvmemfun.hpp +++ b/SheepShaver/src/kpx_cpu/include/nvmemfun.hpp @@ -47,8 +47,17 @@ #if HAVE_FAST_NV_MEM_FUN +#ifdef __MINGW32__ +#define PF_CONVENTION __thiscall +#else +// TODO set a calling convention on other platforms/compilers where the default cc does not pass obj as first param +#define PF_CONVENTION +#endif + template< class PMF, class PF > inline PF nv_mem_fun_of(PMF pmf) { + /** Convert member function pointer to a regular function pointer that takes the object as first parameter + */ if (pmf == 0) return 0; union { PMF pmf; uintptr p[MEM_FUN_WORDS]; } x; @@ -59,7 +68,7 @@ inline PF nv_mem_fun_of(PMF pmf) { template< class R, class T > class nv_mem_fun_t : public std::unary_function { typedef R (T::*pmf_t)(); - typedef R (*pf_t)(T *); + typedef R (* PF_CONVENTION pf_t)(T *); pf_t pf; public: nv_mem_fun_t(pmf_t pmf) : pf(nv_mem_fun_of(pmf)) {} @@ -70,7 +79,7 @@ public: template< class R, class T > class const_nv_mem_fun_t : public std::unary_function { typedef R (T::*pmf_t)(); - typedef R (*pf_t)(T *); + typedef R (* PF_CONVENTION pf_t)(T *); pf_t const pf; public: const_nv_mem_fun_t(pmf_t const pmf) : pf(nv_mem_fun_of(pmf)) {} @@ -81,7 +90,7 @@ public: template< class R, class T, class A > class nv_mem_fun1_t : public std::binary_function { typedef R (T::*pmf_t)(A); - typedef R (*pf_t)(T *, A x); + typedef R (* PF_CONVENTION pf_t)(T *, A x); pf_t pf; public: nv_mem_fun1_t(pmf_t pmf) : pf(nv_mem_fun_of(pmf)) {} @@ -92,7 +101,7 @@ public: template< class R, class T, class A > class const_nv_mem_fun1_t : public std::binary_function { typedef R (T::*pmf_t)(A); - typedef R (*pf_t)(T *, A x); + typedef R (* PF_CONVENTION pf_t)(T *, A x); pf_t const pf; public: const_nv_mem_fun1_t(pmf_t const pmf) : pf(nv_mem_fun_of(pmf)) {} From bd3fecc7803215d24df1c325a30e345560d82eab Mon Sep 17 00:00:00 2001 From: Andrew Tonner Date: Wed, 18 Jan 2017 19:29:13 -0800 Subject: [PATCH 16/59] build script cleanup & renames & updating TODOs; cleanup gitignore --- .gitignore | 33 +++++++++++++++++---- SheepShaver/src/Windows/build_on_msys.py | 37 ++++++++++++------------ 2 files changed, 46 insertions(+), 24 deletions(-) diff --git a/.gitignore b/.gitignore index e6b6772b..02e459be 100644 --- a/.gitignore +++ b/.gitignore @@ -6,8 +6,19 @@ # Mac OS X metadata *.DS_Store -SheepShaver/src/Windows/downloads/ + +# IDE project and intermeidate files .idea/ +BasiliskII/src/Windows/x64/ +SheepShaver/src/Windows/x64/ +CMakeLists.txt +cmake-build-debug/ + +# Python build script files +SheepShaver/src/Windows/downloads/ +SheepShaver/src/Windows/build_on_msys.cache.json + +# Symlinks/copies created by make links SheepShaver/src/adb.cpp SheepShaver/src/audio.cpp SheepShaver/src/cdrom.cpp @@ -131,14 +142,26 @@ SheepShaver/src/Windows/ether_windows.cpp SheepShaver/src/Windows/serial_windows.cpp SheepShaver/src/Windows/prefs_editor_gtk.cpp SheepShaver/src/uae_cpu/compiler/codegen_x86.h -SheepShaver/src/Windows/autom4te.cache/ +SheepShaver/src/kpx_cpu/src/cpu/jit/x86/codegen_x86.h +SheepShaver/src/Windows/video_blit.cpp +SheepShaver/src/Windows/video_blit.h +SheepShaver/src/Windows/video_vosf.h +SheepShaver/src/Windows/sigsegv.cpp +SheepShaver/src/Windows/sigsegv.h +SheepShaver/src/Windows/vm_alloc.cpp +SheepShaver/src/Windows/vm_alloc.h SheepShaver/src/Windows/m4/ + +# Makefile intermediate and output files SheepShaver/src/Windows/aclocal.m4 +SheepShaver/src/Windows/autom4te.cache/ SheepShaver/src/Windows/config.h.in SheepShaver/src/Windows/configure SheepShaver/src/Windows/config.log -SheepShaver/src/kpx_cpu/src/cpu/jit/x86/codegen_x86.h -BasiliskII/src/Windows/x64/ SheepShaver/src/Windows/config.status +SheepShaver/src/Windows/config.h +SheepShaver/src/Windows/Makefile SheepShaver/src/Windows/obj/ -SheepShaver/src/Windows/build_on_msys.cache.json +SheepShaver/src/Windows/SheepShaver.exe + +# additions below \ No newline at end of file diff --git a/SheepShaver/src/Windows/build_on_msys.py b/SheepShaver/src/Windows/build_on_msys.py index 08933a54..42e6bb84 100644 --- a/SheepShaver/src/Windows/build_on_msys.py +++ b/SheepShaver/src/Windows/build_on_msys.py @@ -18,7 +18,6 @@ import shutil # redo the macemu configures if they change MACEMU_CFLAGS = "-mwin32" -# TODO check if __STRICT_ANSI__ is still required since we switched to gnu++11 MACEMU_CXXFLAGS = "-mwin32 -std=gnu++11" script_path = os.path.dirname(os.path.abspath(__file__)) @@ -109,7 +108,7 @@ def display_dir(path): return path -def cc(cmd_args, *args, **kwargs): +def run(cmd_args, *args, **kwargs): print "%s (cwd=%s)" % (" ".join(cmd_args), kwargs.get("cwd")) sys.stdout.flush() subprocess.check_call(cmd_args, *args, **kwargs) @@ -147,7 +146,7 @@ def install(make_args, show_build_environment, install_to_dir=None): installed_packages = get_installed_packages(quiet=True) if any(package not in installed_packages for package in all_packages_to_install): - cc([mingw_get_filename, "install"] + all_packages_to_install) + run([mingw_get_filename, "install"] + all_packages_to_install) else: log("All required packages installed") @@ -180,7 +179,7 @@ def install(make_args, show_build_environment, install_to_dir=None): if needs_rebuild: # apply patch for building in msys/mingw patch_exe = os.path.join(msys_bin_dir, "patch.exe") - cc([patch_exe, "-p2", "-i", patch_filename], cwd=sdl_dir, env=our_env) + run([patch_exe, "-p2", "-i", patch_filename], cwd=sdl_dir, env=our_env) dep_tracker.done("sdl_patch") msys_bash = os.path.join(msys_bin_dir, "bash.exe") @@ -191,15 +190,15 @@ def install(make_args, show_build_environment, install_to_dir=None): with dep_tracker.rebuilding_if_needed("sdl_autogen", ["configure.in"] + sdl_patched_files, base_dir=sdl_dir) as needs_rebuild: if needs_rebuild: - cc([msys_bash, "./autogen.sh"], cwd=sdl_dir, env=our_env) + run([msys_bash, "./autogen.sh"], cwd=sdl_dir, env=our_env) with dep_tracker.rebuilding_if_needed("sdl_configure", "configure", base_dir=sdl_dir) as needs_rebuild: if needs_rebuild: - cc([msys_bash, "./configure", "--disable-shared", "--prefix=/usr"], cwd=sdl_dir, env=our_env) - cc([make_bin] + make_args + ["clean"], cwd=sdl_dir, env=our_env) + run([msys_bash, "./configure", "--disable-shared", "--prefix=/usr"], cwd=sdl_dir, env=our_env) + run([make_bin] + make_args + ["clean"], cwd=sdl_dir, env=our_env) - cc([make_bin] + make_args, cwd=sdl_dir, env=our_env) + run([make_bin] + make_args, cwd=sdl_dir, env=our_env) - # TODO track all the files tht this could install + # TODO track all the files that this could install sdl_headers = "SDL.h SDL_active.h SDL_audio.h SDL_byteorder.h SDL_cdrom.h SDL_cpuinfo.h SDL_endian.h " \ "SDL_error.h SDL_events.h SDL_getenv.h SDL_joystick.h SDL_keyboard.h SDL_keysym.h SDL_loadso.h " \ "SDL_main.h SDL_mouse.h SDL_mutex.h SDL_name.h SDL_opengl.h SDL_platform.h SDL_quit.h SDL_rwops.h " \ @@ -210,7 +209,7 @@ def install(make_args, show_build_environment, install_to_dir=None): with dep_tracker.rebuilding_if_needed("sdl_install", sdl_files_being_installed, base_dir=sdl_dir) as needs_rebuild: if needs_rebuild: - cc([make_bin, "install"], cwd=sdl_dir, env=our_env) + run([make_bin, "install"], cwd=sdl_dir, env=our_env) # build sheepshaver @@ -227,7 +226,7 @@ def install(make_args, show_build_environment, install_to_dir=None): base_dir=root_dir) as needs_rebuild: if needs_rebuild: try: - cc([make_bin, "links"], cwd=sheepshaver_dir, env=our_env) + run([make_bin, "links"], cwd=sheepshaver_dir, env=our_env) except subprocess.CalledProcessError: pass @@ -238,14 +237,14 @@ def install(make_args, show_build_environment, install_to_dir=None): with dep_tracker.rebuilding_if_needed("sheepshaver_autogen", ["configure.ac"], base_dir=script_path) as needs_rebuild: if needs_rebuild: - cc([msys_bash, os.path.join(unix_dir, "autogen.sh")], cwd=script_path, env=autogen_env) + run([msys_bash, os.path.join(unix_dir, "autogen.sh")], cwd=script_path, env=autogen_env) ln_cmd = os.path.join(msys_bin_dir, "ln.exe") windows_m4_dir = os.path.join(script_path, "m4") if not os.path.exists(windows_m4_dir): - cc([ln_cmd, "-sf", os.path.join(unix_dir, "m4"), windows_m4_dir], - cwd=script_path, env=autogen_env) + run([ln_cmd, "-sf", os.path.join(unix_dir, "m4"), windows_m4_dir], + cwd=script_path, env=autogen_env) configure_macemu_env = dict(our_env) configure_macemu_env["CC"] = "gcc %s" % MACEMU_CFLAGS @@ -255,10 +254,10 @@ def install(make_args, show_build_environment, install_to_dir=None): base_dir=script_path) as needs_rebuild: if needs_rebuild: # TODO FIX JIT - cc([msys_bash, "./configure", "--with-gtk=no", "--enable-jit=no"], - cwd=script_path, env=configure_macemu_env) + run([msys_bash, "./configure", "--with-gtk=no", "--enable-jit=no"], + cwd=script_path, env=configure_macemu_env) - cc([make_bin] + make_args, cwd=script_path, env=our_env) + run([make_bin] + make_args, cwd=script_path, env=our_env) if install_to_dir is not None: assert os.path.isdir(install_to_dir) @@ -355,7 +354,7 @@ def uninstall_packages(): # uninstall them for package_name in installed_packages: - cc([mingw_get_filename, "remove", package_name]) + run([mingw_get_filename, "remove", package_name]) def run_shell(command=None): @@ -372,7 +371,7 @@ def run_shell(command=None): args = [msys_bash] if command is not None: args += ["-c", command] - cc(args, env=our_env) + run(args, env=our_env) def get_symlink_filenames(prefix="SheepShaver/src/"): From 9efd46d396460c8d88056f43e9fcbcbd2c5fad44 Mon Sep 17 00:00:00 2001 From: Andrew Tonner Date: Wed, 18 Jan 2017 19:31:27 -0800 Subject: [PATCH 17/59] build script pep-8 --- SheepShaver/src/Windows/build_on_msys.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SheepShaver/src/Windows/build_on_msys.py b/SheepShaver/src/Windows/build_on_msys.py index 42e6bb84..6b0107c2 100644 --- a/SheepShaver/src/Windows/build_on_msys.py +++ b/SheepShaver/src/Windows/build_on_msys.py @@ -555,7 +555,7 @@ def main(): # filename = os.path.join(root_dir, filename_relative.replace("/", "\\")) file_is_tracked = filename_relative in tracked_files or \ any(filename.startswith(filename_relative + "/") for filename in tracked_files) - if file_is_tracked and not filename_relative in staged_deletes: + if file_is_tracked and filename_relative not in staged_deletes: subprocess.check_call(["git", "rm", "--cached", filename_relative], cwd=root_dir) else: From 8259c00929fa22d0e475c7364cf75741ec0c701d Mon Sep 17 00:00:00 2001 From: Andrew Tonner Date: Wed, 18 Jan 2017 19:34:33 -0800 Subject: [PATCH 18/59] gitignore cleanup --- .gitignore | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 02e459be..839d1240 100644 --- a/.gitignore +++ b/.gitignore @@ -7,7 +7,7 @@ # Mac OS X metadata *.DS_Store -# IDE project and intermeidate files +# IDE project and intermediate files .idea/ BasiliskII/src/Windows/x64/ SheepShaver/src/Windows/x64/ @@ -152,7 +152,7 @@ SheepShaver/src/Windows/vm_alloc.cpp SheepShaver/src/Windows/vm_alloc.h SheepShaver/src/Windows/m4/ -# Makefile intermediate and output files +# autotools & make intermediate and output files SheepShaver/src/Windows/aclocal.m4 SheepShaver/src/Windows/autom4te.cache/ SheepShaver/src/Windows/config.h.in From 1af0c4685a4b34147e457e49518110035338aa54 Mon Sep 17 00:00:00 2001 From: Andrew Tonner Date: Wed, 18 Jan 2017 19:57:34 -0800 Subject: [PATCH 19/59] python build script: give a better error message when there is a syntax error in the JSON cache file --- SheepShaver/src/Windows/build_on_msys.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/SheepShaver/src/Windows/build_on_msys.py b/SheepShaver/src/Windows/build_on_msys.py index 6b0107c2..7e9e0cc5 100644 --- a/SheepShaver/src/Windows/build_on_msys.py +++ b/SheepShaver/src/Windows/build_on_msys.py @@ -253,8 +253,7 @@ def install(make_args, show_build_environment, install_to_dir=None): with dep_tracker.rebuilding_if_needed("sheepshaver_configure", ["configure", "Makefile.in"], base_dir=script_path) as needs_rebuild: if needs_rebuild: - # TODO FIX JIT - run([msys_bash, "./configure", "--with-gtk=no", "--enable-jit=no"], + run([msys_bash, "./configure", "--with-gtk=no"], cwd=script_path, env=configure_macemu_env) run([make_bin] + make_args, cwd=script_path, env=our_env) @@ -445,7 +444,14 @@ class BuildDepTracker(object): def load(self): if os.path.exists(self.filename): with open(self.filename, "r") as handle: - self.cache = json.load(handle) + try: + self.cache = json.load(handle) + except ValueError: + msg = "ERROR: There was a problem loading the JSON cache file %s. " \ + "Maybe check the file for a syntax error?" % self.filename + print >> sys.stderr, msg + sys.stderr.flush() + raise Exception(msg) else: self.cache = {"steps": {}} From dae89116e754a5d9ae8f1aa500ec63ae1cc2d534 Mon Sep 17 00:00:00 2001 From: Andrew Tonner Date: Wed, 18 Jan 2017 21:11:21 -0800 Subject: [PATCH 20/59] python build script: option to copy the supplied precompiled dyngen output files instead of running dyngen --- SheepShaver/src/Windows/build_on_msys.py | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/SheepShaver/src/Windows/build_on_msys.py b/SheepShaver/src/Windows/build_on_msys.py index 7e9e0cc5..75822ce8 100644 --- a/SheepShaver/src/Windows/build_on_msys.py +++ b/SheepShaver/src/Windows/build_on_msys.py @@ -56,6 +56,9 @@ def parse_args(): help="Copy the resulting exe to the given directory after building") parser.add_argument("--run-shell-command", "-c", help="Run a command in the mingw shell") + parser.add_argument("--use-precompiled-dyngen", + default=False, + action="store_true") return parser.parse_args() @@ -119,7 +122,7 @@ def log(msg): sys.stdout.flush() -def install(make_args, show_build_environment, install_to_dir=None): +def install(make_args, show_build_environment, use_precompiled_dyngen, install_to_dir=None): root_dir = os.path.abspath(os.path.join(script_path, "..", "..", "..")) dep_tracker = BuildDepTracker(root_dir) @@ -256,7 +259,21 @@ def install(make_args, show_build_environment, install_to_dir=None): run([msys_bash, "./configure", "--with-gtk=no"], cwd=script_path, env=configure_macemu_env) - run([make_bin] + make_args, cwd=script_path, env=our_env) + sheepshaver_make_args = list(make_args) + + if use_precompiled_dyngen: + for precompiled_dyngen_file, target_dir, target_dyngen_file in ( + ("dyngen_precompiled/ppc-execute-impl.cpp", ".", "ppc-execute-impl.cpp"), + ("dyngen_precompiled/basic-dyngen-ops-x86_32.hpp", "../Unix", "basic-dyngen-ops.hpp"), + ("dyngen_precompiled/ppc-dyngen-ops-x86_32.hpp", "../kpx_cpu", "ppc-dyngen-ops.hpp"), + ): + log("Copying %s to %s" % (precompiled_dyngen_file, target_dyngen_file)) + shutil.copy(os.path.join(script_path, "..", "Unix", precompiled_dyngen_file), + os.path.join(script_path, target_dyngen_file) + ) + sheepshaver_make_args.append("USE_DYNGEN=no") + + run([make_bin] + sheepshaver_make_args, cwd=script_path, env=our_env) if install_to_dir is not None: assert os.path.isdir(install_to_dir) @@ -571,7 +588,8 @@ def main(): make_args.append("-j%d" % num_threads) log("Will install to %s" % options.install_to_dir) - install(make_args, options.show_build_environment, install_to_dir=options.install_to_dir) + install(make_args, options.show_build_environment, options.use_precompiled_dyngen, + install_to_dir=options.install_to_dir) if __name__ == "__main__": From 8c3f1fa0c377e7a82bf09c3f43ee64e58cb9fce9 Mon Sep 17 00:00:00 2001 From: Andrew Tonner Date: Wed, 18 Jan 2017 21:14:02 -0800 Subject: [PATCH 21/59] gitignore dyngen and output files --- .gitignore | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 839d1240..e6bcf9ee 100644 --- a/.gitignore +++ b/.gitignore @@ -161,7 +161,11 @@ SheepShaver/src/Windows/config.log SheepShaver/src/Windows/config.status SheepShaver/src/Windows/config.h SheepShaver/src/Windows/Makefile +SheepShaver/src/Windows/dyngen.exe +SheepShaver/src/Windows/basic-dyngen-ops.hpp +SheepShaver/src/Windows/ppc-dyngen-ops.hpp +SheepShaver/src/Windows/ppc-execute-impl.cpp SheepShaver/src/Windows/obj/ SheepShaver/src/Windows/SheepShaver.exe -# additions below \ No newline at end of file +# additions below From 21a6d39d4b165084c0641e5f36c0b7ecee886273 Mon Sep 17 00:00:00 2001 From: Andrew Tonner Date: Thu, 19 Jan 2017 05:12:03 -0800 Subject: [PATCH 22/59] python build script: jit option --- SheepShaver/src/Windows/build_on_msys.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/SheepShaver/src/Windows/build_on_msys.py b/SheepShaver/src/Windows/build_on_msys.py index 75822ce8..86610642 100644 --- a/SheepShaver/src/Windows/build_on_msys.py +++ b/SheepShaver/src/Windows/build_on_msys.py @@ -59,6 +59,9 @@ def parse_args(): parser.add_argument("--use-precompiled-dyngen", default=False, action="store_true") + parser.add_argument("--build-jit", + default=False, + action="store_true") return parser.parse_args() @@ -122,7 +125,7 @@ def log(msg): sys.stdout.flush() -def install(make_args, show_build_environment, use_precompiled_dyngen, install_to_dir=None): +def install(make_args, show_build_environment, use_precompiled_dyngen, build_jit, install_to_dir=None): root_dir = os.path.abspath(os.path.join(script_path, "..", "..", "..")) dep_tracker = BuildDepTracker(root_dir) @@ -256,12 +259,15 @@ def install(make_args, show_build_environment, use_precompiled_dyngen, install_t with dep_tracker.rebuilding_if_needed("sheepshaver_configure", ["configure", "Makefile.in"], base_dir=script_path) as needs_rebuild: if needs_rebuild: - run([msys_bash, "./configure", "--with-gtk=no"], + sheepshaver_configure_options = [] + if not build_jit: + sheepshaver_configure_options.append("--enable-jit=no") + run([msys_bash, "./configure", "--with-gtk=no"] + sheepshaver_configure_options, cwd=script_path, env=configure_macemu_env) sheepshaver_make_args = list(make_args) - if use_precompiled_dyngen: + if use_precompiled_dyngen and build_jit: for precompiled_dyngen_file, target_dir, target_dyngen_file in ( ("dyngen_precompiled/ppc-execute-impl.cpp", ".", "ppc-execute-impl.cpp"), ("dyngen_precompiled/basic-dyngen-ops-x86_32.hpp", "../Unix", "basic-dyngen-ops.hpp"), @@ -588,7 +594,7 @@ def main(): make_args.append("-j%d" % num_threads) log("Will install to %s" % options.install_to_dir) - install(make_args, options.show_build_environment, options.use_precompiled_dyngen, + install(make_args, options.show_build_environment, options.use_precompiled_dyngen, options.build_jit, install_to_dir=options.install_to_dir) From d8f5d43a9c58113f128b7e6adeefbba555b8aedb Mon Sep 17 00:00:00 2001 From: Andrew Tonner Date: Thu, 19 Jan 2017 05:13:01 -0800 Subject: [PATCH 23/59] python build script: when getting modified time for a directory, also check contents' times --- SheepShaver/src/Windows/build_on_msys.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/SheepShaver/src/Windows/build_on_msys.py b/SheepShaver/src/Windows/build_on_msys.py index 86610642..48308cbf 100644 --- a/SheepShaver/src/Windows/build_on_msys.py +++ b/SheepShaver/src/Windows/build_on_msys.py @@ -534,14 +534,20 @@ class BuildDepTracker(object): return rebuild_required - @staticmethod - def get_inputs_modified_time(input_filenames): + @classmethod + def get_inputs_modified_time(cls, input_filenames): input_file_mtimes = [] for input_filename in input_filenames: + if os.path.isdir(input_filename): + subtime = cls.get_inputs_modified_time(os.path.join(input_filename, s) for s in os.listdir(input_filename)) + if subtime is not None: + input_file_mtimes.append(subtime) stat = os.stat(input_filename) if stat is None: assert False, "Missing input file %s" % input_filename input_file_mtimes.append(stat.st_mtime) + if not input_file_mtimes: + return None input_modified_time = max(input_file_mtimes) return input_modified_time From d3b56d8e326e7a08e4b4e72bd372cbd85b96cef3 Mon Sep 17 00:00:00 2001 From: Andrew Tonner Date: Thu, 19 Jan 2017 05:14:20 -0800 Subject: [PATCH 24/59] Fix for intermittent cursor snapping: don't attempt to warp the cursor when it's not in the window --- BasiliskII/src/SDL/video_sdl.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/BasiliskII/src/SDL/video_sdl.cpp b/BasiliskII/src/SDL/video_sdl.cpp index 77c102bc..9ab036cb 100644 --- a/BasiliskII/src/SDL/video_sdl.cpp +++ b/BasiliskII/src/SDL/video_sdl.cpp @@ -1493,6 +1493,14 @@ void video_set_cursor(void) #elif defined(__APPLE__) move = mouse_grabbed; #endif + if (move) { + // when the cursor is not in the window, the cursor position from GetMouseState is not the actual + // cursor position, so do not warp the cursor as we don't want to actually move it. + if (!(SDL_GetAppState() & SDL_APPMOUSEFOCUS)) { + move = false; + } + } + if (move) { int visible = SDL_ShowCursor(-1); if (visible) { From 2f9bc272beb019dd7574285689273eb3015215ef Mon Sep 17 00:00:00 2001 From: Andrew Tonner Date: Thu, 19 Jan 2017 21:12:35 -0800 Subject: [PATCH 25/59] ws2 defines and missing prototypes for building withmingw32 --- BasiliskII/src/slirp/libslirp.h | 9 +++++++++ BasiliskII/src/slirp/slirp.h | 22 ++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/BasiliskII/src/slirp/libslirp.h b/BasiliskII/src/slirp/libslirp.h index 8a1aa31e..c955a28c 100644 --- a/BasiliskII/src/slirp/libslirp.h +++ b/BasiliskII/src/slirp/libslirp.h @@ -2,7 +2,16 @@ #define _LIBSLIRP_H #ifdef _WIN32 +#ifdef __MINGW32__ +#if _WIN32_WINNT < 0x501 +#undef _WIN32_WINNT +#define _WIN32_WINNT 0x501 +#endif +#endif #include +#ifdef __MINGW32__ +#include +#endif int inet_aton(const char *cp, struct in_addr *ia); #else #include diff --git a/BasiliskII/src/slirp/slirp.h b/BasiliskII/src/slirp/slirp.h index b845caa7..81a49dd2 100644 --- a/BasiliskII/src/slirp/slirp.h +++ b/BasiliskII/src/slirp/slirp.h @@ -22,8 +22,30 @@ typedef char *caddr_t; typedef int socklen_t; typedef unsigned long ioctlsockopt_t; +#ifdef __MINGW32__ +#if _WIN32_WINNT < 0x501 +#undef _WIN32_WINNT +#define _WIN32_WINNT 0x501 +#endif +#endif # include # include + +#ifdef __MINGW32__ +char * WSAAPI inet_ntop( + INT Family, + PVOID pAddr, + PTSTR pStringBuf, + size_t StringBufSize +); + +INT WSAAPI inet_pton( + INT Family, + const char * pszAddrString, + PVOID pAddrBuf +); +#endif + # include # include From 1229eb0ea9a45b399609d05f1958384fd0f9a535 Mon Sep 17 00:00:00 2001 From: Andrew Tonner Date: Thu, 19 Jan 2017 21:14:46 -0800 Subject: [PATCH 26/59] if the originals for any symlinked dirs (which are just copies under msys/mingw) have been updated, delete the copies and make links again --- SheepShaver/src/Windows/build_on_msys.py | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/SheepShaver/src/Windows/build_on_msys.py b/SheepShaver/src/Windows/build_on_msys.py index 48308cbf..87ef7fee 100644 --- a/SheepShaver/src/Windows/build_on_msys.py +++ b/SheepShaver/src/Windows/build_on_msys.py @@ -222,15 +222,33 @@ def install(make_args, show_build_environment, use_precompiled_dyngen, build_jit sheepshaver_dir = os.path.abspath(os.path.join(script_path, "..", "..")) print "SHEEPSHAVER_DIR: %s" % sheepshaver_dir - link_inputs = get_symlink_filenames(prefix="BasiliskII/src/") + link_input_prefix = "BasiliskII/src/" + link_output_prefix = "SheepShaver/src/" + link_inputs = get_symlink_filenames(prefix=link_input_prefix) print "Tracking %d link inputs" % len(link_inputs) sys.stdout.flush() + stale_or_missing_dir_contents_files = False + for link_input_proper in link_inputs: + link_input = os.path.join(root_dir, link_input_proper) + if os.path.isdir(link_input): + assert link_input_proper.startswith(link_input_prefix) + link_output_proper = link_output_prefix + link_input_proper[len(link_input_prefix):] + link_input_mtime = dep_tracker.get_inputs_modified_time([link_input]) + link_output = os.path.join(root_dir, link_output_proper) + if os.path.isdir(link_output): + link_output_mtime = dep_tracker.get_inputs_modified_time([link_output]) + if link_output_mtime is None or link_output_mtime < link_input_mtime: + shutil.rmtree(link_output) + stale_or_missing_dir_contents_files = True + else: + stale_or_missing_dir_contents_files = True + # TODO: fix make links step rather than just eating the exception with dep_tracker.rebuilding_if_needed("sheepshaver_top_makefile", ["SheepShaver/Makefile"] + link_inputs, base_dir=root_dir) as needs_rebuild: - if needs_rebuild: + if needs_rebuild or stale_or_missing_dir_contents_files: try: run([make_bin, "links"], cwd=sheepshaver_dir, env=our_env) except subprocess.CalledProcessError: From 69a3c31fff16e5c08d5767a2b07b98674783fd33 Mon Sep 17 00:00:00 2001 From: Andrew Tonner Date: Thu, 19 Jan 2017 21:38:21 -0800 Subject: [PATCH 27/59] Add configure option to disable VOSF; add it to python build script --- SheepShaver/src/Windows/build_on_msys.py | 10 ++++++++-- SheepShaver/src/Windows/configure.ac | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/SheepShaver/src/Windows/build_on_msys.py b/SheepShaver/src/Windows/build_on_msys.py index 87ef7fee..1a9a8523 100644 --- a/SheepShaver/src/Windows/build_on_msys.py +++ b/SheepShaver/src/Windows/build_on_msys.py @@ -62,6 +62,10 @@ def parse_args(): parser.add_argument("--build-jit", default=False, action="store_true") + parser.add_argument("--debug-build", + default=False, + action="store_true", + help="disable things in the build that are a problem for debugging") return parser.parse_args() @@ -125,7 +129,7 @@ def log(msg): sys.stdout.flush() -def install(make_args, show_build_environment, use_precompiled_dyngen, build_jit, install_to_dir=None): +def install(make_args, show_build_environment, use_precompiled_dyngen, build_jit, debug_build, install_to_dir=None): root_dir = os.path.abspath(os.path.join(script_path, "..", "..", "..")) dep_tracker = BuildDepTracker(root_dir) @@ -280,6 +284,8 @@ def install(make_args, show_build_environment, use_precompiled_dyngen, build_jit sheepshaver_configure_options = [] if not build_jit: sheepshaver_configure_options.append("--enable-jit=no") + if debug_build: + sheepshaver_configure_options.append("--enable-vosf=no") run([msys_bash, "./configure", "--with-gtk=no"] + sheepshaver_configure_options, cwd=script_path, env=configure_macemu_env) @@ -619,7 +625,7 @@ def main(): log("Will install to %s" % options.install_to_dir) install(make_args, options.show_build_environment, options.use_precompiled_dyngen, options.build_jit, - install_to_dir=options.install_to_dir) + options.debug_build, install_to_dir=options.install_to_dir) if __name__ == "__main__": diff --git a/SheepShaver/src/Windows/configure.ac b/SheepShaver/src/Windows/configure.ac index e9b4f57c..64fa9612 100755 --- a/SheepShaver/src/Windows/configure.ac +++ b/SheepShaver/src/Windows/configure.ac @@ -14,6 +14,7 @@ AC_CANONICAL_TARGET dnl Options. AC_ARG_ENABLE(jit, [ --enable-jit enable JIT compiler [default=yes]], [WANT_JIT=$enableval], [WANT_JIT=yes]) AC_ARG_WITH(gtk, [ --with-gtk use GTK user interface [default=yes]], [WANT_GTK=$withval], [WANT_GTK=yes]) +AC_ARG_ENABLE(vosf, [ --enable-vosf enable video on SEGV signals [default=yes]], [WANT_VOSF=$enableval], [WANT_VOSF=yes]) dnl Checks for programs. AC_PROG_CC @@ -153,8 +154,12 @@ AC_CACHE_CHECK([whether we can skip instruction in SIGSEGV handler], AC_TRANSLATE_DEFINE(HAVE_SIGSEGV_SKIP_INSTRUCTION, "$ac_cv_have_skip_instruction", [Define if we can ignore the fault (instruction skipping in SIGSEGV handler).]) -dnl We really want VOSF (Video on SEGV Signals) screen updates acceleration -AC_DEFINE(ENABLE_VOSF, 1, [Define if using video enabled on SEGV signals.]) +dnl Enable VOSF screen updates with this feature is requested +if [[ "x$WANT_VOSF" = "xyes" ]]; then + AC_DEFINE(ENABLE_VOSF, 1, [Define if using video enabled on SEGV signals.]) +else + WANT_VOSF=no +fi dnl Check for GCC 2.7 or higher. HAVE_GCC27=no @@ -262,5 +267,6 @@ echo SheepShaver configuration summary: echo echo Enable JIT compiler .............. : $WANT_JIT echo GTK user interface ............... : $WANT_GTK +echo Enable VOSF ...................... : $WANT_VOSF echo echo "Configuration done. Now type \"make\"." From bdd2ee1190622873f2a8494ed3cb959a1122d9a8 Mon Sep 17 00:00:00 2001 From: Andrew Tonner Date: Thu, 19 Jan 2017 21:38:37 -0800 Subject: [PATCH 28/59] python build script: do make clean if we reconfigured --- SheepShaver/src/Windows/build_on_msys.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/SheepShaver/src/Windows/build_on_msys.py b/SheepShaver/src/Windows/build_on_msys.py index 1a9a8523..f913b47d 100644 --- a/SheepShaver/src/Windows/build_on_msys.py +++ b/SheepShaver/src/Windows/build_on_msys.py @@ -278,6 +278,7 @@ def install(make_args, show_build_environment, use_precompiled_dyngen, build_jit configure_macemu_env["CC"] = "gcc %s" % MACEMU_CFLAGS configure_macemu_env["CXX"] = "g++ %s" % MACEMU_CXXFLAGS + did_configure = False with dep_tracker.rebuilding_if_needed("sheepshaver_configure", ["configure", "Makefile.in"], base_dir=script_path) as needs_rebuild: if needs_rebuild: @@ -288,6 +289,10 @@ def install(make_args, show_build_environment, use_precompiled_dyngen, build_jit sheepshaver_configure_options.append("--enable-vosf=no") run([msys_bash, "./configure", "--with-gtk=no"] + sheepshaver_configure_options, cwd=script_path, env=configure_macemu_env) + did_configure = True + + if did_configure: + run([make_bin, "clean"], cwd=script_path, env=our_env) sheepshaver_make_args = list(make_args) From 52a36f24bbf1c4ea66cfeb98d730c671be674755 Mon Sep 17 00:00:00 2001 From: Andrew Tonner Date: Fri, 20 Jan 2017 01:33:20 -0800 Subject: [PATCH 29/59] guard against the slirp queues null deref on dequeues I've seen in the debugger --- BasiliskII/src/slirp/misc.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/BasiliskII/src/slirp/misc.c b/BasiliskII/src/slirp/misc.c index b80caf66..308c507b 100644 --- a/BasiliskII/src/slirp/misc.c +++ b/BasiliskII/src/slirp/misc.c @@ -112,7 +112,10 @@ inline void remque_32(void *a) { register struct quehead_32 *element = (struct quehead_32 *) a; ((struct quehead_32 *)(element->qh_link))->qh_rlink = element->qh_rlink; - ((struct quehead_32 *)(element->qh_rlink))->qh_link = element->qh_link; + struct quehead_32 * prev = element->qh_rlink; + if (prev != 0) { + prev->qh_link = element->qh_link; + } element->qh_rlink = 0; } @@ -138,7 +141,10 @@ void remque(void *a) { register struct quehead *element = (struct quehead *) a; ((struct quehead *)(element->qh_link))->qh_rlink = element->qh_rlink; - ((struct quehead *)(element->qh_rlink))->qh_link = element->qh_link; + struct quehead * prev = element->qh_rlink; + if (prev != NULL) { + prev->qh_link = element->qh_link; + } element->qh_rlink = NULL; /* element->qh_link = NULL; TCP FIN1 crashes if you do this. Why ? */ } From 68353ca6b195e353870ce490d969da3b29771344 Mon Sep 17 00:00:00 2001 From: Andrew Tonner Date: Fri, 20 Jan 2017 02:05:55 -0800 Subject: [PATCH 30/59] fix for null deref in slirp soread when the so doesn't have a tcpcb yet --- BasiliskII/src/slirp/socket.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/BasiliskII/src/slirp/socket.c b/BasiliskII/src/slirp/socket.c index 42ba31b2..5572a196 100644 --- a/BasiliskII/src/slirp/socket.c +++ b/BasiliskII/src/slirp/socket.c @@ -108,6 +108,10 @@ soread(so) struct sbuf *sb = &so->so_snd; u_int len = sb->sb_datalen - sb->sb_cc; struct iovec iov[2]; + + if (!so->so_tcpcb) { + so->so_tcpcb = tcp_newtcpcb(so); // but how did we get in this state? should we just default mss for it? + } u_int mss = so->so_tcpcb->t_maxseg; DEBUG_CALL("soread"); From bab9820231fcc398904d5292c924183f778fe70b Mon Sep 17 00:00:00 2001 From: Andrew Tonner Date: Fri, 20 Jan 2017 13:27:00 -0800 Subject: [PATCH 31/59] slirp: more changes to prevent a crash in the soread without so_tcpcb case --- BasiliskII/src/slirp/slirp.c | 2 +- BasiliskII/src/slirp/socket.c | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/BasiliskII/src/slirp/slirp.c b/BasiliskII/src/slirp/slirp.c index dc2fdc65..5f7617ba 100644 --- a/BasiliskII/src/slirp/slirp.c +++ b/BasiliskII/src/slirp/slirp.c @@ -219,7 +219,7 @@ int slirp_select_fill(int *pnfds, /* * See if we need a tcp_fasttimo */ - if (time_fasttimo == 0 && so->so_tcpcb->t_flags & TF_DELACK) + if (time_fasttimo == 0 && so->so_tcpcb && so->so_tcpcb->t_flags & TF_DELACK) time_fasttimo = curtime; /* Flag when we want a fasttimo */ /* diff --git a/BasiliskII/src/slirp/socket.c b/BasiliskII/src/slirp/socket.c index 5572a196..bc14852a 100644 --- a/BasiliskII/src/slirp/socket.c +++ b/BasiliskII/src/slirp/socket.c @@ -110,7 +110,10 @@ soread(so) struct iovec iov[2]; if (!so->so_tcpcb) { - so->so_tcpcb = tcp_newtcpcb(so); // but how did we get in this state? should we just default mss for it? + // how did we get in this state? + tcp_newtcpcb(so); + // from what I've seen while debugging, the socket struct is about to get freed, so consider it closed. + return -1; } u_int mss = so->so_tcpcb->t_maxseg; From fa9b42554125ca3282e90751aba07484237dc820 Mon Sep 17 00:00:00 2001 From: Andrew Tonner Date: Fri, 20 Jan 2017 13:27:25 -0800 Subject: [PATCH 32/59] python build script: remove old config.status before rebuilding --- SheepShaver/src/Windows/build_on_msys.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/SheepShaver/src/Windows/build_on_msys.py b/SheepShaver/src/Windows/build_on_msys.py index f913b47d..fa0973f5 100644 --- a/SheepShaver/src/Windows/build_on_msys.py +++ b/SheepShaver/src/Windows/build_on_msys.py @@ -282,6 +282,10 @@ def install(make_args, show_build_environment, use_precompiled_dyngen, build_jit with dep_tracker.rebuilding_if_needed("sheepshaver_configure", ["configure", "Makefile.in"], base_dir=script_path) as needs_rebuild: if needs_rebuild: + config_status_filename = os.path.join(script_path, "config.status") + if os.path.exists(config_status_filename): + log("removing existing config.status") + os.remove(config_status_filename) sheepshaver_configure_options = [] if not build_jit: sheepshaver_configure_options.append("--enable-jit=no") From 4715db8f28943ad8ec352cc791c407a46e495110 Mon Sep 17 00:00:00 2001 From: Andrew Tonner Date: Sun, 22 Jan 2017 00:58:09 -0800 Subject: [PATCH 33/59] top level script should make sure directories it wants to put symlinks in exist --- SheepShaver/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/SheepShaver/Makefile b/SheepShaver/Makefile index 53ecae21..f6f9dc08 100644 --- a/SheepShaver/Makefile +++ b/SheepShaver/Makefile @@ -49,6 +49,8 @@ $(SRCARCHIVE): $(SRCS) $(DOCS) # Links to Basilisk II sources # links: + mkdir -p src/CrossPlatform + mkdir -p src/Unix/Irix @list='adb.cpp audio.cpp cdrom.cpp disk.cpp extfs.cpp pict.c \ prefs.cpp scsi.cpp sony.cpp xpram.cpp \ include/adb.h include/audio.h include/audio_defs.h \ From cc0c1686854fe45963899113eee5f10a1c851ac6 Mon Sep 17 00:00:00 2001 From: Andrew Tonner Date: Sun, 22 Jan 2017 15:07:47 -0800 Subject: [PATCH 34/59] when making links, if the link already exists as a directory, remove the directory first --- SheepShaver/Makefile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/SheepShaver/Makefile b/SheepShaver/Makefile index f6f9dc08..c9914745 100644 --- a/SheepShaver/Makefile +++ b/SheepShaver/Makefile @@ -99,7 +99,8 @@ links: echo $$i; o=$$i; \ case $$i in *codegen_x86.h) o=kpx_cpu/src/cpu/jit/x86/codegen_x86.h;; esac; \ SUB=`echo $$o | sed 's;[^/]*/;../;g' | sed 's;[^/]*$$;;'` ;\ - ln -sf "$$PREFIX$$SUB$(B2_TOPDIR)/src/$$i" src/$$o; \ + cur_link=src/$$o ;\ + if [ -d "$$cur_link" ]; then rm -rf "$$cur_link"; fi ;\ + ln -sf "$$PREFIX$$SUB$(B2_TOPDIR)/src/$$i" $$cur_link; \ fi; \ - done; \ - ln -sf ../../../../../SheepShaver/src/Unix/config.h $(B2_TOPDIR)/src/Unix/Linux/NetDriver/config.h + done; From 4326182b027e815bd184d40b9583f71c4eff0aa5 Mon Sep 17 00:00:00 2001 From: Andrew Tonner Date: Sun, 22 Jan 2017 15:08:33 -0800 Subject: [PATCH 35/59] python build script: fix for fresh install --- SheepShaver/src/Windows/build_on_msys.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/SheepShaver/src/Windows/build_on_msys.py b/SheepShaver/src/Windows/build_on_msys.py index fa0973f5..55f62054 100644 --- a/SheepShaver/src/Windows/build_on_msys.py +++ b/SheepShaver/src/Windows/build_on_msys.py @@ -354,6 +354,8 @@ def get_installed_packages(quiet=False): # first, get the mapping from tarnames to package names for all available packages package_list_filename = os.path.join(data_path, "package-list.xml") + if not os.path.exists(package_list_filename): + return [] catalogues = xml_read_helper(package_list_filename, "package-list", "catalogue") packages_by_tarname = {} From bab9a35ff2ebc8fe522f3324fdf62711891ec8ab Mon Sep 17 00:00:00 2001 From: Andrew Tonner Date: Sun, 22 Jan 2017 15:25:02 -0800 Subject: [PATCH 36/59] python build script: fix for top Makefile changes --- SheepShaver/src/Windows/build_on_msys.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/SheepShaver/src/Windows/build_on_msys.py b/SheepShaver/src/Windows/build_on_msys.py index 55f62054..e6e3e546 100644 --- a/SheepShaver/src/Windows/build_on_msys.py +++ b/SheepShaver/src/Windows/build_on_msys.py @@ -439,8 +439,11 @@ def get_symlink_filenames(prefix="SheepShaver/src/"): with open(top_makefile, "r") as handle: while not handle.readline().startswith("links:"): pass - first_line = handle.readline() links_list_prefix = " @list='" + while True: + first_line = handle.readline() + if first_line.startswith(links_list_prefix): + break assert first_line.startswith(links_list_prefix) lines = [first_line[len(links_list_prefix):]] while True: From 7c01c27e029cc41fdcd8ea61412077d6e0f898bf Mon Sep 17 00:00:00 2001 From: Andrew Tonner Date: Sun, 22 Jan 2017 16:08:03 -0800 Subject: [PATCH 37/59] python build script: option to add an additional PATH entry with highest priority for building --- SheepShaver/src/Windows/build_on_msys.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/SheepShaver/src/Windows/build_on_msys.py b/SheepShaver/src/Windows/build_on_msys.py index e6e3e546..d168baba 100644 --- a/SheepShaver/src/Windows/build_on_msys.py +++ b/SheepShaver/src/Windows/build_on_msys.py @@ -66,6 +66,9 @@ def parse_args(): default=False, action="store_true", help="disable things in the build that are a problem for debugging") + parser.add_argument("--add-path", + default=None, + help="Add something to the PATH used for builds, with highest priority") return parser.parse_args() @@ -129,7 +132,8 @@ def log(msg): sys.stdout.flush() -def install(make_args, show_build_environment, use_precompiled_dyngen, build_jit, debug_build, install_to_dir=None): +def install(make_args, show_build_environment, use_precompiled_dyngen, build_jit, debug_build, + install_to_dir=None, add_path=None): root_dir = os.path.abspath(os.path.join(script_path, "..", "..", "..")) dep_tracker = BuildDepTracker(root_dir) @@ -163,8 +167,11 @@ def install(make_args, show_build_environment, use_precompiled_dyngen, build_jit mingw_get_bin_dir = os.path.join(mingw_get_dir, "bin") msys_bin_dir = os.path.join(mingw_get_dir, "msys", "1.0", "bin") mingw_bin_dir = os.path.join(mingw_get_dir, "mingw32", "bin") - - our_env = env_augmented_with_paths(mingw_get_bin_dir, msys_bin_dir, mingw_bin_dir) + + paths_to_add = [mingw_get_bin_dir, msys_bin_dir, mingw_bin_dir] + if add_path is not None: + paths_to_add.insert(0, add_path) + our_env = env_augmented_with_paths(*paths_to_add) # ditch any outer make flags from cmake or similar due to compatibility problems for var in ["MAKEFLAGS", "MAKELEVEL", "MFLAGS"]: @@ -639,7 +646,7 @@ def main(): log("Will install to %s" % options.install_to_dir) install(make_args, options.show_build_environment, options.use_precompiled_dyngen, options.build_jit, - options.debug_build, install_to_dir=options.install_to_dir) + options.debug_build, install_to_dir=options.install_to_dir, add_path=options.add_path) if __name__ == "__main__": From c4903326ab0d8672aa57837bef007b4017a525a9 Mon Sep 17 00:00:00 2001 From: Andrew Tonner Date: Sun, 22 Jan 2017 16:27:03 -0800 Subject: [PATCH 38/59] appveyor CI build script first cut --- appveyor.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 appveyor.yml diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 00000000..6e61d3f5 --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,21 @@ +version: 1.0.{build} +platform: x64 +clone_folder: c:\project\src\github.com\rakslice\macemu +clone_depth: 5 + +environment: + matrix: + - PYTHON: "C:\\Python27" + PYTHON_VERSION: "2.7.x" # currently 2.7.9? + PYTHON_ARCH: "32" + +build_script: +- cmd: >- + %PYTHON%\python.exe c:\project\src\github.com\rakslice\macemu\SheepShaver\src\Windows\build_on_msys.py + +after_build: + - 7z a sheepshaver.zip c:\project\src\github.com\rakslice\macemu\SheepShaver\SheepShaver.exe + +artifacts: + - path: sheepshaver.zip + name: sheepshaver non-jit build From 8548644595bb6d43fd0069556263bb29a610f3cc Mon Sep 17 00:00:00 2001 From: Andrew Tonner Date: Sun, 22 Jan 2017 16:28:32 -0800 Subject: [PATCH 39/59] don't show "Will install to" output if that is disabled --- SheepShaver/src/Windows/build_on_msys.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SheepShaver/src/Windows/build_on_msys.py b/SheepShaver/src/Windows/build_on_msys.py index d168baba..a5a48920 100644 --- a/SheepShaver/src/Windows/build_on_msys.py +++ b/SheepShaver/src/Windows/build_on_msys.py @@ -644,7 +644,8 @@ def main(): if num_threads > 1: make_args.append("-j%d" % num_threads) - log("Will install to %s" % options.install_to_dir) + if options.install_to_dir is not None: + log("Will install to %s" % options.install_to_dir) install(make_args, options.show_build_environment, options.use_precompiled_dyngen, options.build_jit, options.debug_build, install_to_dir=options.install_to_dir, add_path=options.add_path) From e3fe441709fea56190c8d4a9fa66fb0041af53f2 Mon Sep 17 00:00:00 2001 From: Andrew Tonner Date: Sun, 22 Jan 2017 16:49:23 -0800 Subject: [PATCH 40/59] python build script: build arg for passing --build to configure scripts --- SheepShaver/src/Windows/build_on_msys.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/SheepShaver/src/Windows/build_on_msys.py b/SheepShaver/src/Windows/build_on_msys.py index a5a48920..592f523b 100644 --- a/SheepShaver/src/Windows/build_on_msys.py +++ b/SheepShaver/src/Windows/build_on_msys.py @@ -69,6 +69,9 @@ def parse_args(): parser.add_argument("--add-path", default=None, help="Add something to the PATH used for builds, with highest priority") + parser.add_argument("--build", + default=None, + help="Build platform to pass to configure scripts") return parser.parse_args() @@ -133,7 +136,7 @@ def log(msg): def install(make_args, show_build_environment, use_precompiled_dyngen, build_jit, debug_build, - install_to_dir=None, add_path=None): + install_to_dir=None, add_path=None, build=None): root_dir = os.path.abspath(os.path.join(script_path, "..", "..", "..")) dep_tracker = BuildDepTracker(root_dir) @@ -210,7 +213,10 @@ def install(make_args, show_build_environment, use_precompiled_dyngen, build_jit run([msys_bash, "./autogen.sh"], cwd=sdl_dir, env=our_env) with dep_tracker.rebuilding_if_needed("sdl_configure", "configure", base_dir=sdl_dir) as needs_rebuild: if needs_rebuild: - run([msys_bash, "./configure", "--disable-shared", "--prefix=/usr"], cwd=sdl_dir, env=our_env) + sdl_configure_args = [msys_bash, "./configure", "--disable-shared", "--prefix=/usr"] + if build is not None: + sdl_configure_args += ["--build", build] + run(sdl_configure_args, cwd=sdl_dir, env=our_env) run([make_bin] + make_args + ["clean"], cwd=sdl_dir, env=our_env) run([make_bin] + make_args, cwd=sdl_dir, env=our_env) @@ -647,7 +653,8 @@ def main(): if options.install_to_dir is not None: log("Will install to %s" % options.install_to_dir) install(make_args, options.show_build_environment, options.use_precompiled_dyngen, options.build_jit, - options.debug_build, install_to_dir=options.install_to_dir, add_path=options.add_path) + options.debug_build, install_to_dir=options.install_to_dir, add_path=options.add_path, + build=options.build) if __name__ == "__main__": From 65da666052c2769dace50d415d6dcc8326cb46a7 Mon Sep 17 00:00:00 2001 From: Andrew Tonner Date: Sun, 22 Jan 2017 16:50:34 -0800 Subject: [PATCH 41/59] add explicit --build option for appveyor CI because config.guess is failing there --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 6e61d3f5..c9ef43e4 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -11,7 +11,7 @@ environment: build_script: - cmd: >- - %PYTHON%\python.exe c:\project\src\github.com\rakslice\macemu\SheepShaver\src\Windows\build_on_msys.py + %PYTHON%\python.exe c:\project\src\github.com\rakslice\macemu\SheepShaver\src\Windows\build_on_msys.py --build i686-pc-mingw32 after_build: - 7z a sheepshaver.zip c:\project\src\github.com\rakslice\macemu\SheepShaver\SheepShaver.exe From f2238fe3e7acfdf4f2f8d26d2fd4c25038a1f622 Mon Sep 17 00:00:00 2001 From: Andrew Tonner Date: Sun, 22 Jan 2017 17:48:56 -0800 Subject: [PATCH 42/59] python build script: option to use a specific mingw path --- SheepShaver/src/Windows/build_on_msys.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/SheepShaver/src/Windows/build_on_msys.py b/SheepShaver/src/Windows/build_on_msys.py index 592f523b..72bef3c3 100644 --- a/SheepShaver/src/Windows/build_on_msys.py +++ b/SheepShaver/src/Windows/build_on_msys.py @@ -72,6 +72,10 @@ def parse_args(): parser.add_argument("--build", default=None, help="Build platform to pass to configure scripts") + parser.add_argument("--alt-mingw-path", + dest="alt_mingw_path", + default=None, + help="Path to use for mingw install") return parser.parse_args() @@ -618,8 +622,12 @@ class BuildDepTracker(object): def main(): + global MINGW_EXTRACT_PATH options = parse_args() + if options.alt_mingw_path: + MINGW_EXTRACT_PATH = options.alt_mingw_path + if options.run_shell: run_shell() elif options.run_shell_command is not None: From 9a5b6ae3b3eaf520090ea98280daabf158903ac0 Mon Sep 17 00:00:00 2001 From: Andrew Tonner Date: Sun, 22 Jan 2017 18:00:02 -0800 Subject: [PATCH 43/59] appveyor CI: use default mingw path to hopefully save us some downloads every run --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index c9ef43e4..851e4f34 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -11,7 +11,7 @@ environment: build_script: - cmd: >- - %PYTHON%\python.exe c:\project\src\github.com\rakslice\macemu\SheepShaver\src\Windows\build_on_msys.py --build i686-pc-mingw32 + %PYTHON%\python.exe c:\project\src\github.com\rakslice\macemu\SheepShaver\src\Windows\build_on_msys.py --build i686-pc-mingw32 --alt-mingw-path c:\mingw after_build: - 7z a sheepshaver.zip c:\project\src\github.com\rakslice\macemu\SheepShaver\SheepShaver.exe From eab21be5e31288481afc28c8e783b92d100ee7d0 Mon Sep 17 00:00:00 2001 From: Andrew Tonner Date: Sun, 22 Jan 2017 18:02:45 -0800 Subject: [PATCH 44/59] Revert "appveyor CI: use default mingw path to hopefully save us some downloads every run" This reverts commit 9a5b6ae3b3eaf520090ea98280daabf158903ac0. --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 851e4f34..c9ef43e4 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -11,7 +11,7 @@ environment: build_script: - cmd: >- - %PYTHON%\python.exe c:\project\src\github.com\rakslice\macemu\SheepShaver\src\Windows\build_on_msys.py --build i686-pc-mingw32 --alt-mingw-path c:\mingw + %PYTHON%\python.exe c:\project\src\github.com\rakslice\macemu\SheepShaver\src\Windows\build_on_msys.py --build i686-pc-mingw32 after_build: - 7z a sheepshaver.zip c:\project\src\github.com\rakslice\macemu\SheepShaver\SheepShaver.exe From 58114327c9c8101c9337c999544fc9fae5a590f4 Mon Sep 17 00:00:00 2001 From: Andrew Tonner Date: Sun, 22 Jan 2017 18:24:39 -0800 Subject: [PATCH 45/59] appveyor CI: save mingw-get cache between builds --- appveyor.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/appveyor.yml b/appveyor.yml index c9ef43e4..ca7e600b 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -16,6 +16,9 @@ build_script: after_build: - 7z a sheepshaver.zip c:\project\src\github.com\rakslice\macemu\SheepShaver\SheepShaver.exe +cache: + - C:\mingw-sheep\var -> appveyor.yml + artifacts: - path: sheepshaver.zip name: sheepshaver non-jit build From c4c61cec6447e66f12d02f43e43f6c99e0109204 Mon Sep 17 00:00:00 2001 From: Andrew Tonner Date: Sun, 22 Jan 2017 18:48:39 -0800 Subject: [PATCH 46/59] python build script: adding sed and grep I'm using from msys to packages list --- SheepShaver/src/Windows/build_on_msys.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SheepShaver/src/Windows/build_on_msys.py b/SheepShaver/src/Windows/build_on_msys.py index 72bef3c3..de343777 100644 --- a/SheepShaver/src/Windows/build_on_msys.py +++ b/SheepShaver/src/Windows/build_on_msys.py @@ -158,7 +158,7 @@ def install(make_args, show_build_environment, use_precompiled_dyngen, build_jit mingw_get_filename = os.path.join(mingw_get_dir, "bin", "mingw-get.exe") assert os.path.isfile(mingw_get_filename) - msys_packages = ["bash", "autogen", "m4", "make", "patch"] + msys_packages = ["bash", "autogen", "m4", "make", "patch", "grep", "sed"] mingw_packages = ["autoconf", "autoconf2.5", "automake", "automake1.11", "binutils", "base", "autotools", "libtool", "gcc", "gcc-g++"] From 0df6ef8d28633605ecc10c5fe2a9434629e56fe2 Mon Sep 17 00:00:00 2001 From: Andrew Tonner Date: Sun, 22 Jan 2017 19:16:08 -0800 Subject: [PATCH 47/59] appveyor CI: show build environment in this build --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index ca7e600b..6991a6cf 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -11,7 +11,7 @@ environment: build_script: - cmd: >- - %PYTHON%\python.exe c:\project\src\github.com\rakslice\macemu\SheepShaver\src\Windows\build_on_msys.py --build i686-pc-mingw32 + %PYTHON%\python.exe c:\project\src\github.com\rakslice\macemu\SheepShaver\src\Windows\build_on_msys.py --build i686-pc-mingw32 --show-build-environment after_build: - 7z a sheepshaver.zip c:\project\src\github.com\rakslice\macemu\SheepShaver\SheepShaver.exe From d2e8b4283f2e9d927aebb6c8fdb3e2de3ee5b191 Mon Sep 17 00:00:00 2001 From: Andrew Tonner Date: Sun, 22 Jan 2017 19:39:16 -0800 Subject: [PATCH 48/59] put build tools first in the path rather than last --- SheepShaver/src/Windows/build_on_msys.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/SheepShaver/src/Windows/build_on_msys.py b/SheepShaver/src/Windows/build_on_msys.py index de343777..19ca81c0 100644 --- a/SheepShaver/src/Windows/build_on_msys.py +++ b/SheepShaver/src/Windows/build_on_msys.py @@ -114,9 +114,14 @@ def extract_zip(zip_filename, target_dir): def env_augmented_with_paths(*path_dirs_to_add): env_copy = dict(os.environ) path_dirs = env_copy["PATH"].split(os.pathsep) + + paths_adding = [] for d in path_dirs_to_add: if d not in path_dirs: - path_dirs.append(d) + paths_adding.append(d) + + path_dirs = paths_adding + path_dirs + env_copy["PATH"] = os.pathsep.join(path_dirs) return env_copy From cc7a0df0c5976b2353affea3da90b1f81d1830a8 Mon Sep 17 00:00:00 2001 From: Andrew Tonner Date: Sun, 22 Jan 2017 21:08:55 -0800 Subject: [PATCH 49/59] python build scripts: URLs cleanup --- SheepShaver/src/Windows/build_on_msys.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/SheepShaver/src/Windows/build_on_msys.py b/SheepShaver/src/Windows/build_on_msys.py index 19ca81c0..ad65a3a5 100644 --- a/SheepShaver/src/Windows/build_on_msys.py +++ b/SheepShaver/src/Windows/build_on_msys.py @@ -20,6 +20,10 @@ import shutil MACEMU_CFLAGS = "-mwin32" MACEMU_CXXFLAGS = "-mwin32 -std=gnu++11" +MINGW_GET_URL = "https://downloads.sourceforge.net/project/mingw/Installer/mingw-get/" \ + "mingw-get-0.6.2-beta-20131004-1/mingw-get-0.6.2-mingw32-beta-20131004-1-bin.zip" +SDL_ZIP_URL = "http://www.libsdl.org/release/SDL-1.2.15.zip" + script_path = os.path.dirname(os.path.abspath(__file__)) @@ -155,8 +159,7 @@ def install(make_args, show_build_environment, use_precompiled_dyngen, build_jit # get msys / mingw tools we need to build - mingw_get_zip = download("https://downloads.sourceforge.net/project/mingw/Installer/mingw-get/" - "mingw-get-0.6.2-beta-20131004-1/mingw-get-0.6.2-mingw32-beta-20131004-1-bin.zip") + mingw_get_zip = download(MINGW_GET_URL) mingw_get_dir = MINGW_EXTRACT_PATH extract_zip(mingw_get_zip, mingw_get_dir) @@ -196,7 +199,7 @@ def install(make_args, show_build_environment, use_precompiled_dyngen, build_jit # build SDL - sdl_zip_filename = download("http://www.libsdl.org/release/SDL-1.2.15.zip") + sdl_zip_filename = download(SDL_ZIP_URL) sdl_dir = os.path.join(get_download_dir(), "SDL-1.2.15") with dep_tracker.rebuilding_if_needed("sdl_extract_zip", sdl_zip_filename) as needs_rebuild: if needs_rebuild: From b8b7b96a1c933fc5232178e924ef387aee855db2 Mon Sep 17 00:00:00 2001 From: Andrew Tonner Date: Sun, 22 Jan 2017 19:39:16 -0800 Subject: [PATCH 50/59] put build tools first in the path rather than last --- SheepShaver/src/Windows/build_on_msys.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/SheepShaver/src/Windows/build_on_msys.py b/SheepShaver/src/Windows/build_on_msys.py index de343777..19ca81c0 100644 --- a/SheepShaver/src/Windows/build_on_msys.py +++ b/SheepShaver/src/Windows/build_on_msys.py @@ -114,9 +114,14 @@ def extract_zip(zip_filename, target_dir): def env_augmented_with_paths(*path_dirs_to_add): env_copy = dict(os.environ) path_dirs = env_copy["PATH"].split(os.pathsep) + + paths_adding = [] for d in path_dirs_to_add: if d not in path_dirs: - path_dirs.append(d) + paths_adding.append(d) + + path_dirs = paths_adding + path_dirs + env_copy["PATH"] = os.pathsep.join(path_dirs) return env_copy From fcfa19ca27f0599f66d48a7553ec0efb00135919 Mon Sep 17 00:00:00 2001 From: Andrew Tonner Date: Sun, 22 Jan 2017 21:08:55 -0800 Subject: [PATCH 51/59] python build scripts: URLs cleanup --- SheepShaver/src/Windows/build_on_msys.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/SheepShaver/src/Windows/build_on_msys.py b/SheepShaver/src/Windows/build_on_msys.py index 19ca81c0..ad65a3a5 100644 --- a/SheepShaver/src/Windows/build_on_msys.py +++ b/SheepShaver/src/Windows/build_on_msys.py @@ -20,6 +20,10 @@ import shutil MACEMU_CFLAGS = "-mwin32" MACEMU_CXXFLAGS = "-mwin32 -std=gnu++11" +MINGW_GET_URL = "https://downloads.sourceforge.net/project/mingw/Installer/mingw-get/" \ + "mingw-get-0.6.2-beta-20131004-1/mingw-get-0.6.2-mingw32-beta-20131004-1-bin.zip" +SDL_ZIP_URL = "http://www.libsdl.org/release/SDL-1.2.15.zip" + script_path = os.path.dirname(os.path.abspath(__file__)) @@ -155,8 +159,7 @@ def install(make_args, show_build_environment, use_precompiled_dyngen, build_jit # get msys / mingw tools we need to build - mingw_get_zip = download("https://downloads.sourceforge.net/project/mingw/Installer/mingw-get/" - "mingw-get-0.6.2-beta-20131004-1/mingw-get-0.6.2-mingw32-beta-20131004-1-bin.zip") + mingw_get_zip = download(MINGW_GET_URL) mingw_get_dir = MINGW_EXTRACT_PATH extract_zip(mingw_get_zip, mingw_get_dir) @@ -196,7 +199,7 @@ def install(make_args, show_build_environment, use_precompiled_dyngen, build_jit # build SDL - sdl_zip_filename = download("http://www.libsdl.org/release/SDL-1.2.15.zip") + sdl_zip_filename = download(SDL_ZIP_URL) sdl_dir = os.path.join(get_download_dir(), "SDL-1.2.15") with dep_tracker.rebuilding_if_needed("sdl_extract_zip", sdl_zip_filename) as needs_rebuild: if needs_rebuild: From 519276d788de225d2636e3b3ce29be998f1a6eb8 Mon Sep 17 00:00:00 2001 From: Andrew Tonner Date: Sun, 22 Jan 2017 21:11:01 -0800 Subject: [PATCH 52/59] python build script: added gtk donwload/install --- SheepShaver/src/Windows/build_on_msys.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/SheepShaver/src/Windows/build_on_msys.py b/SheepShaver/src/Windows/build_on_msys.py index ad65a3a5..48eafff8 100644 --- a/SheepShaver/src/Windows/build_on_msys.py +++ b/SheepShaver/src/Windows/build_on_msys.py @@ -20,6 +20,8 @@ import shutil MACEMU_CFLAGS = "-mwin32" MACEMU_CXXFLAGS = "-mwin32 -std=gnu++11" +GTK_INSTALL_URL = "https://downloads.sourceforge.net/project/gladewin32/gtk%2B-win32-devel/2.12.9/" \ + "gtk-dev-2.12.9-win32-2.exe" MINGW_GET_URL = "https://downloads.sourceforge.net/project/mingw/Installer/mingw-get/" \ "mingw-get-0.6.2-beta-20131004-1/mingw-get-0.6.2-mingw32-beta-20131004-1-bin.zip" SDL_ZIP_URL = "http://www.libsdl.org/release/SDL-1.2.15.zip" @@ -28,6 +30,7 @@ script_path = os.path.dirname(os.path.abspath(__file__)) MINGW_EXTRACT_PATH = r"c:\mingw-sheep" +GTK_INSTALL_DIR = r"C:\GTK_DIR" def parse_args(): @@ -197,6 +200,16 @@ def install(make_args, show_build_environment, use_precompiled_dyngen, build_jit show_env_dict(our_env) print "" + # download & install GTK + + gtk_install_filename = download(GTK_INSTALL_URL) + with dep_tracker.rebuilding_if_needed("gtk_install", gtk_install_filename) as needs_rebuild: + if needs_rebuild: + run([gtk_install_filename, "/S", "/D=" + GTK_INSTALL_DIR], shell=True) + + gtk_pkg_config_path = os.path.join(GTK_INSTALL_DIR, "lib", "pkgconfig") + our_env["PKG_CONFIG_PATH"] = gtk_pkg_config_path + # build SDL sdl_zip_filename = download(SDL_ZIP_URL) From 2f8c7f441cce3ea51a5cc5b85c0b428028a80adc Mon Sep 17 00:00:00 2001 From: Andrew Tonner Date: Sun, 22 Jan 2017 22:15:29 -0800 Subject: [PATCH 53/59] python build script: set ACLOCAL_PATH for gtk --- SheepShaver/src/Windows/build_on_msys.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/SheepShaver/src/Windows/build_on_msys.py b/SheepShaver/src/Windows/build_on_msys.py index 48eafff8..95bdc06c 100644 --- a/SheepShaver/src/Windows/build_on_msys.py +++ b/SheepShaver/src/Windows/build_on_msys.py @@ -208,7 +208,9 @@ def install(make_args, show_build_environment, use_precompiled_dyngen, build_jit run([gtk_install_filename, "/S", "/D=" + GTK_INSTALL_DIR], shell=True) gtk_pkg_config_path = os.path.join(GTK_INSTALL_DIR, "lib", "pkgconfig") + gtk_aclocal_path = os.path.join(GTK_INSTALL_DIR, "share", "aclocal") our_env["PKG_CONFIG_PATH"] = gtk_pkg_config_path + our_env["ACLOCAL_PATH"] = gtk_aclocal_path # build SDL From 2e7771a4aea2b5f6a484384efc257e912afd4015 Mon Sep 17 00:00:00 2001 From: Andrew Tonner Date: Sun, 22 Jan 2017 23:01:08 -0800 Subject: [PATCH 54/59] python build script: put showing environment after the GTK install so we can double check the paths --- SheepShaver/src/Windows/build_on_msys.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/SheepShaver/src/Windows/build_on_msys.py b/SheepShaver/src/Windows/build_on_msys.py index 95bdc06c..70e55969 100644 --- a/SheepShaver/src/Windows/build_on_msys.py +++ b/SheepShaver/src/Windows/build_on_msys.py @@ -195,11 +195,6 @@ def install(make_args, show_build_environment, use_precompiled_dyngen, build_jit for var in ["MAKEFLAGS", "MAKELEVEL", "MFLAGS"]: our_env.pop(var, None) - if show_build_environment: - print "ENVIRONMENT FOR BUILD" - show_env_dict(our_env) - print "" - # download & install GTK gtk_install_filename = download(GTK_INSTALL_URL) @@ -212,6 +207,13 @@ def install(make_args, show_build_environment, use_precompiled_dyngen, build_jit our_env["PKG_CONFIG_PATH"] = gtk_pkg_config_path our_env["ACLOCAL_PATH"] = gtk_aclocal_path + # show build environment + + if show_build_environment: + print "ENVIRONMENT FOR BUILD" + show_env_dict(our_env) + print "" + # build SDL sdl_zip_filename = download(SDL_ZIP_URL) From 3a742ae3f2ff50ff92e3a16beb899846eb11790c Mon Sep 17 00:00:00 2001 From: Andrew Tonner Date: Sun, 22 Jan 2017 23:26:36 -0800 Subject: [PATCH 55/59] python build script: symlink m4 dir before autogen that requires it --- SheepShaver/src/Windows/build_on_msys.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/SheepShaver/src/Windows/build_on_msys.py b/SheepShaver/src/Windows/build_on_msys.py index 70e55969..dda9e1e5 100644 --- a/SheepShaver/src/Windows/build_on_msys.py +++ b/SheepShaver/src/Windows/build_on_msys.py @@ -304,11 +304,6 @@ def install(make_args, show_build_environment, use_precompiled_dyngen, build_jit unix_dir = os.path.join(sheepshaver_dir, "src", "Unix") - with dep_tracker.rebuilding_if_needed("sheepshaver_autogen", ["configure.ac"], - base_dir=script_path) as needs_rebuild: - if needs_rebuild: - run([msys_bash, os.path.join(unix_dir, "autogen.sh")], cwd=script_path, env=autogen_env) - ln_cmd = os.path.join(msys_bin_dir, "ln.exe") windows_m4_dir = os.path.join(script_path, "m4") @@ -316,6 +311,11 @@ def install(make_args, show_build_environment, use_precompiled_dyngen, build_jit run([ln_cmd, "-sf", os.path.join(unix_dir, "m4"), windows_m4_dir], cwd=script_path, env=autogen_env) + with dep_tracker.rebuilding_if_needed("sheepshaver_autogen", ["configure.ac"], + base_dir=script_path) as needs_rebuild: + if needs_rebuild: + run([msys_bash, os.path.join(unix_dir, "autogen.sh")], cwd=script_path, env=autogen_env) + configure_macemu_env = dict(our_env) configure_macemu_env["CC"] = "gcc %s" % MACEMU_CFLAGS configure_macemu_env["CXX"] = "g++ %s" % MACEMU_CXXFLAGS From 8bfa98f97278e74ba70ba1a82dcec81f3d813bd3 Mon Sep 17 00:00:00 2001 From: Andrew Tonner Date: Mon, 23 Jan 2017 00:02:30 -0800 Subject: [PATCH 56/59] appveyor CI: fix build output path for archiving --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 6991a6cf..93250ab7 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -14,7 +14,7 @@ build_script: %PYTHON%\python.exe c:\project\src\github.com\rakslice\macemu\SheepShaver\src\Windows\build_on_msys.py --build i686-pc-mingw32 --show-build-environment after_build: - - 7z a sheepshaver.zip c:\project\src\github.com\rakslice\macemu\SheepShaver\SheepShaver.exe + - 7z a sheepshaver.zip c:\project\src\github.com\rakslice\macemu\SheepShaver\src\Windows\SheepShaver.exe cache: - C:\mingw-sheep\var -> appveyor.yml From 9a76eace57b6bf679ecbfc25ed2195f677b14b38 Mon Sep 17 00:00:00 2001 From: Andrew Tonner Date: Mon, 23 Jan 2017 00:40:54 -0800 Subject: [PATCH 57/59] appveyor CI: don't cache mingw metadata as this includes package installation status; only cache package files proper --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 93250ab7..7e0d22a1 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -17,7 +17,7 @@ after_build: - 7z a sheepshaver.zip c:\project\src\github.com\rakslice\macemu\SheepShaver\src\Windows\SheepShaver.exe cache: - - C:\mingw-sheep\var -> appveyor.yml + - C:\mingw-sheep\var\cache -> appveyor.yml artifacts: - path: sheepshaver.zip From 6c8c55c5e2f2b298f0b16f61cc4309e2c9c69f00 Mon Sep 17 00:00:00 2001 From: Andrew Tonner Date: Mon, 23 Jan 2017 00:43:14 -0800 Subject: [PATCH 58/59] bump build version names --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 7e0d22a1..c3b9d894 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -version: 1.0.{build} +version: 1.0.{build}a platform: x64 clone_folder: c:\project\src\github.com\rakslice\macemu clone_depth: 5 From da46a07b7c25996aeda2cf8b49d3b9bf2e08c46f Mon Sep 17 00:00:00 2001 From: Andrew Tonner Date: Mon, 23 Jan 2017 00:46:19 -0800 Subject: [PATCH 59/59] appveyor CI: Try build number with git commit --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index c3b9d894..fd4cfb37 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -version: 1.0.{build}a +version: 1.0.{build}-{commit} platform: x64 clone_folder: c:\project\src\github.com\rakslice\macemu clone_depth: 5