From be3bba2a1cf9551778683e25f61bffc7c187f93c Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Mon, 7 Sep 2009 19:43:04 +0000 Subject: Fix compilation under MacOS X. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1659 --- configure.in | 52 +++++++++++++++++++++++++++++++++------------------- 1 file changed, 33 insertions(+), 19 deletions(-) (limited to 'configure.in') diff --git a/configure.in b/configure.in index 4b29cee5..f77d6ebd 100644 --- a/configure.in +++ b/configure.in @@ -39,20 +39,42 @@ AM_PATH_SDL(1.1.3) CFLAGS="$CFLAGS $SDL_CFLAGS" LDFLAGS="$LDFLAGS $SDL_LIBS" -AC_CHECK_LIB(SDL_mixer,Mix_LoadMUS,[ - SDLMIXER_LIBS="$SDLMIXER_LIBS -lSDL_mixer" -],[ - echo "*** Could not find SDL_mixer. Please install it." - exit -1 -]) +# On some platforms, SDL renames main() to SDL_main() using a #define, +# so that its own main, stored in the SDLmain library, can be run first. +# Unfortunately, this causes problems for autoconf, which builds +# test programs to probe the system. All library/header/symbol checks +# must be run in this block, that performs a workaround for the problem. + +AC_SDL_MAIN_WORKAROUND([ + + # Check for SDL_mixer. + + AC_CHECK_LIB(SDL_mixer,Mix_LoadMUS,[ + SDLMIXER_LIBS="$SDLMIXER_LIBS -lSDL_mixer" + ],[ + echo "*** Could not find SDL_mixer. Please install it." + exit -1 + ]) + + # Check for SDL_net. + + AC_CHECK_LIB(SDL_net,SDLNet_UDP_Send,[ + SDLNET_LIBS="$SDLNET_LIBS -lSDL_net" + ],[ + echo "*** Could not find SDL_net. Please install it." + exit -1 + ]) + + # Check for libsamplerate. -AC_CHECK_LIB(SDL_net,SDLNet_UDP_Send,[ - SDLNET_LIBS="$SDLNET_LIBS -lSDL_net" -],[ - echo "*** Could not find SDL_net. Please install it." - exit -1 + AC_CHECK_LIB(samplerate, src_new) + + AC_CHECK_HEADERS([linux/kd.h dev/isa/spkrio.h dev/speaker/speaker.h]) + AC_CHECK_FUNCS(mmap sched_setaffinity) ]) +AC_CHECK_TOOL(WINDRES, windres, ) + # Windows CE build? WINDOWS_CE=false @@ -66,14 +88,6 @@ case "$host" in ;; esac -AC_CHECK_HEADERS([linux/kd.h dev/isa/spkrio.h dev/speaker/speaker.h]) -AC_CHECK_FUNCS(mmap sched_setaffinity) - -# DWF 2008-02-10: FIXME -AC_CHECK_LIB(samplerate, src_new) - -AC_CHECK_TOOL(WINDRES, windres, ) - AM_CONDITIONAL(WINDOWS_CE, $WINDOWS_CE) AM_CONDITIONAL(HAVE_WINDRES, test "$WINDRES" != "") AM_CONDITIONAL(HAVE_PYTHON, $HAVE_PYTHON) -- cgit v1.2.3