dosbox-wii/configure.in

161 lines
4.7 KiB
Plaintext
Raw Normal View History

2009-05-02 23:03:37 +02:00
dnl Init.
2009-05-02 23:43:00 +02:00
AC_INIT(dosbox,0.60)
2009-05-02 23:35:44 +02:00
AC_PREREQ(2.50)
2009-05-02 23:03:37 +02:00
AC_CONFIG_SRCDIR(README)
dnl Detect the canonical host and target build environment
AC_CANONICAL_HOST
AC_CANONICAL_TARGET
dnl Setup for automake
AM_INIT_AUTOMAKE
AM_CONFIG_HEADER(config.h)
dnl Checks for programs.
AC_PROG_MAKE_SET
AC_PROG_CC
AC_PROG_CPP
AC_PROG_CXX
AC_PROG_INSTALL
AC_PROG_RANLIB
dnl Check for SDL
SDL_VERSION=1.2.0
AM_PATH_SDL($SDL_VERSION,
:,
AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
)
LIBS="$LIBS $SDL_LIBS"
CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
dnl Checks for header files.
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
AC_STRUCT_TM
2009-05-02 23:43:00 +02:00
AC_MSG_CHECKING(if environ can be included)
AC_TRY_LINK([#include <unistd.h>
#include <stdlib.h>],[*environ;],
[AC_MSG_RESULT(yes);AC_DEFINE(ENVIRON_INCLUDED,1,[environ can be included])],AC_MSG_RESULT(no))
AC_MSG_CHECKING(if environ can be linked)
AC_TRY_LINK([extern char ** environ;],[*environ;],
[AC_MSG_RESULT(yes);AC_DEFINE(ENVIRON_LINKED,1,[environ can be linked])],AC_MSG_RESULT(no))
2009-05-02 23:20:05 +02:00
dnl Checks for libraries.
2009-05-02 23:12:18 +02:00
#Check if the compiler support attributes
2009-05-02 23:43:00 +02:00
AH_TEMPLATE([C_HAS_ATTRIBUTE],[Determines if the compilers supports attributes for structures.])
2009-05-02 23:12:18 +02:00
AC_MSG_CHECKING(if compiler allows __attribute__)
AC_TRY_COMPILE([], [typedef struct { } __attribute__ ((packed)) junk;],
[ AC_MSG_RESULT(yes);AC_DEFINE(C_HAS_ATTRIBUTE)],AC_MSG_RESULT(no))
2009-05-02 23:03:37 +02:00
2009-05-02 23:35:44 +02:00
AM_PATH_ALSA(0.9.0, AC_DEFINE(HAVE_ALSA,1,[Define to 1 to use ALSA for MIDI]) , : )
#Check for big endian machine, should #define WORD_BIGENDIAN if so
AC_C_BIGENDIAN
#Features to enable/disable
AH_TEMPLATE(C_DEBUG,[Define to 1 to enable internal debugger, requires libcurses])
2009-05-02 23:43:00 +02:00
AH_TEMPLATE(C_HEAVY_DEBUG,[Define to 1 to enable heavy debugging, also have to enable C_DEBUG])
AC_ARG_ENABLE(debug,AC_HELP_STRING([--enable-debug],[Enable debug mode]),[
2009-05-02 23:35:44 +02:00
AC_CHECK_HEADER(curses.h,have_curses_h=yes,)
AC_CHECK_LIB(curses, initscr, have_curses_lib=yes, , )
2009-05-02 23:43:00 +02:00
AC_CHECK_LIB(pdcurses, initscr, have_pdcurses_lib=yes, , )
2009-05-02 23:35:44 +02:00
if test x$have_curses_lib = xyes -a x$have_curses_h = xyes ; then
2009-05-02 23:43:00 +02:00
LIBS="$LIBS -lcurses"
2009-05-02 23:35:44 +02:00
AC_DEFINE(C_DEBUG,1)
2009-05-02 23:43:00 +02:00
if test x$enable_debug = xheavy ; then
AC_DEFINE(C_HEAVY_DEBUG,1)
fi
elif test x$have_pdcurses_lib = xyes -a x$have_curses_h = xyes ; then
LIBS="$LIBS -lpdcurses"
AC_DEFINE(C_DEBUG,1)
if test x$enable_debug = xheavy ; then
AC_DEFINE(C_HEAVY_DEBUG,1)
fi
2009-05-02 23:35:44 +02:00
else
2009-05-02 23:43:00 +02:00
AC_MSG_WARN([Can't find curses, debug mode disabled])
2009-05-02 23:35:44 +02:00
fi
],)
2009-05-02 23:43:00 +02:00
AH_TEMPLATE(C_CORE_INLINE,[Define to 1 to use inlined memory functions in cpu core])
AC_ARG_ENABLE(core-inline,AC_HELP_STRING([--enable-core-inline],[Enable inlined memory handling in CPU Core]),[
if test x$enable_core_inline = xyes ; then
AC_MSG_RESULT([enabling inlined memory handling in CPU Core]),
AC_DEFINE(C_CORE_INLINE,1)
2009-05-02 23:35:44 +02:00
fi
],)
2009-05-02 23:43:00 +02:00
AH_TEMPLATE(C_FPU,[Define to 1 to enable floating point emulation])
AC_ARG_ENABLE(fpu,AC_HELP_STRING([--disable-fpu],[Disable FPU support]),[
if test x$enable_fpu = xno ; then
AC_MSG_RESULT([disabling FPU supportd])
else
AC_DEFINE(C_FPU,1)
fi
],AC_DEFINE(C_FPU,1))
AH_TEMPLATE(C_SSHOT,[Define to 1 to enable screenshots, requires libpng])
AC_CHECK_HEADER(png.h,have_png_h=yes,)
AC_CHECK_LIB(png, png_check_sig, have_png_lib=yes, ,-lz)
if test x$have_png_lib = xyes -a x$have_png_h = xyes ; then
LIBS="$LIBS -lpng -lz"
AC_DEFINE(C_SSHOT,1)
else
AC_MSG_WARN([Can't find libpng, screenshot support disabled])
fi
AH_TEMPLATE(C_MODEM,[Define to 1 to enable internal modem support, requires SDL_net])
AC_CHECK_HEADER(SDL/SDL_net.h,have_sdl_net_h=yes,)
AC_CHECK_LIB(SDL_net, SDLNet_Init, have_sdl_net_lib=yes, , )
if test x$have_sdl_net_lib = xyes -a x$have_sdl_net_h = xyes ; then
LIBS="$LIBS -lSDL_net"
AC_DEFINE(C_MODEM,1)
else
AC_MSG_WARN([Can't find SDL_net, internal modem disabled])
fi
2009-05-02 23:35:44 +02:00
dnl Some host detection and actions for them
case "$target" in
*-*-cygwin* | *-*-mingw32*)
LIBS="$LIBS -lwinmm"
;;
*-*-darwin*)
dnl We have a problem here: both MacOS X and Darwin report
dnl the same signature "powerpc-apple-darwin*" - so we have
dnl to do more to distinguish them.
dnl For now I am lazy and do not add proper detection code.
AC_DEFINE(MACOSX, 1, [Compiling on Mac OS X])
LIBS="$LIBS -framework AudioUnit"
;;
esac
2009-05-02 23:03:37 +02:00
AC_OUTPUT([
Makefile
src/Makefile
src/cpu/Makefile
src/cpu/core_16/Makefile
2009-05-02 23:43:00 +02:00
src/cpu/core_full/Makefile
src/cpu/core_normal/Makefile
2009-05-02 23:03:37 +02:00
src/debug/Makefile
src/dos/Makefile
src/fpu/Makefile
src/gui/Makefile
src/hardware/Makefile
src/ints/Makefile
src/misc/Makefile
src/shell/Makefile
src/platform/Makefile
src/platform/visualc/Makefile
visualc/Makefile
include/Makefile
2009-05-02 23:35:44 +02:00
docs/Makefile
2009-05-02 23:03:37 +02:00
])