From 8b790439830e25b4896e36ad923ca8a254fa1bc9 Mon Sep 17 00:00:00 2001 From: Clifford Matthews Date: Sun, 21 Jun 2009 22:45:51 -0600 Subject: [PATCH] Intel Mac OS X version builds with GNU build system. --- src/Makefile.am | 30 ++++++++++++++++++++++++------ src/TODO | 2 -- src/configure.ac | 39 ++++++++++++++++++++++++--------------- 3 files changed, 48 insertions(+), 23 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index e0c6877..8b17cc9 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -158,11 +158,17 @@ src-blitters-stamp src-blitters.h src-blitters.s: \ $(RM) opfind touch src-blitters-stamp -arch_sources = config/arch/i386/x86patblt.S \ - config/arch/i386/x86srcblt.S \ - config/arch/i386/xdstubtables.c \ - config/arch/i386/sbstubtables.c \ - config/arch/i386/i386.c +arch_sources = config/arch/i386/i386.c + + +if !CONFIG_OS_MACOSX + +arch_sources += config/arch/i386/x86patblt.S \ + config/arch/i386/x86srcblt.S \ + config/arch/i386/xdstubtables.c \ + config/arch/i386/sbstubtables.c + +endif !CONFIG_OS_MACOSX endif CONFIG_ARCH_I386 @@ -246,9 +252,17 @@ front_end_sources = config/front-ends/sdl/SDL_bmp.c \ config/front-ends/sdl/sdlscrap.c \ config/front-ends/sdl/sdlwin.c \ config/front-ends/sdl/sdlwm.c \ - config/front-ends/sdl/sdlX.c \ config/front-ends/sdl/syswm_map.c \ config/front-ends/sdl/winmain.c + +if CONFIG_OS_LINUX +front_end_sources += config/front-ends/sdl/sdlX.c +endif CONFIG_OS_LINUX + +if CONFIG_OS_MACOSX +front_end_sources += config/front-ends/sdl/macosx_main.m +endif CONFIG_OS_MACOSX + endif CONFIG_FRONT_END_SDL if CONFIG_FRONT_END_SVGALIB @@ -317,6 +331,10 @@ os_sources = config/os/linux/linux.c \ config/os/linux/lowglobals-mem.c endif CONFIG_OS_LINUX +if CONFIG_OS_MACOSX +executor_LDFLAGS = -framework SDL -framework Cocoa +endif CONFIG_OS_MACOSX + if CONFIG_OS_MSDOS os_sources = config/os/msdos/msdos.c \ config/os/msdos/dpmimem.c \ diff --git a/src/TODO b/src/TODO index 39641a5..a4c3a6c 100644 --- a/src/TODO +++ b/src/TODO @@ -3,8 +3,6 @@ can clean up a bunch of repeated partial paths by making things like archdir=config/arch/$host_arch - figure out how to deal with -framework for mac os x port - See if there's a more elegant solution to the blitters code (can we nuke the config/arch/i386 prefixes in the dependencies? should we make it so both source and pattern diff --git a/src/configure.ac b/src/configure.ac index 96b3781..4bd6830 100644 --- a/src/configure.ac +++ b/src/configure.ac @@ -5,21 +5,6 @@ AM_INIT_AUTOMAKE([-Wall]) AC_CONFIG_SRCDIR([executor.c]) AC_CONFIG_HEADERS([config.h]) -# Checks for programs. -AM_PROG_AS -AC_PROG_CC -AM_PROG_CC_C_O -AC_PROG_RANLIB -AM_PROG_AS -AC_PROG_YACC - -AC_CHECK_PROG([PERL], [perl], [perl]) -AC_ARG_VAR([PERL], [perl for generating blitters]) - -AC_GNU_SOURCE - -AC_SYS_LARGEFILE - # Normalize to our old names case ${build_cpu} in @@ -52,6 +37,26 @@ case ${host_os} in ;; esac +# Checks for programs. +AM_PROG_AS +AC_PROG_CC +AM_PROG_CC_C_O +AC_PROG_RANLIB +AM_PROG_AS +AC_PROG_YACC + +if test x$host_os = xmacosx; then + AC_PROG_OBJC +fi + + +AC_CHECK_PROG([PERL], [perl], [perl]) +AC_ARG_VAR([PERL], [perl for generating blitters]) + +AC_GNU_SOURCE + +AC_SYS_LARGEFILE + # Check for libraries if test x$host_cpu != xm68k; then @@ -69,6 +74,8 @@ AC_ARG_WITH(front-end, front_end=sdl elif test x"$ac_cv_lib_X11_XInitThreads" = xyes; then front_end=x + elif test x$host_os = xmacosx; then + front_end=sdl else AC_MSG_ERROR([Must use --with-front-end=sdl or --with-front-end=x]) fi]) @@ -89,6 +96,8 @@ AC_ARG_WITH(sound, sound_config=sdl elif test x"$host_os" = xxlinux; then sound_config=linux + elif test x$host_os = xmacosx; then + sound_config=sdl else AC_MSG_ERROR([Must use --with-sound=sdl or --with-sound=x]) fi])