dosbox-wii/configure.in
2009-05-02 21:35:44 +00:00

112 lines
2.8 KiB
Plaintext

dnl Init.
AC_INIT(dosbox,0.58)
AC_PREREQ(2.50)
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
dnl Checks for libraries.
#Check if the compiler support attributes
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))
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])
AC_ARG_ENABLE(debug,[ --enable-debug Enable debug mode],[
AC_CHECK_HEADER(curses.h,have_curses_h=yes,)
AC_CHECK_LIB(curses, initscr, have_curses_lib=yes, , )
if test x$have_curses_lib = xyes -a x$have_curses_h = xyes ; then
LIBS="$LIBS -lcurses"
AC_DEFINE(C_DEBUG,1)
else
AC_MSG_WARN([Can't enable debug mode without libcurses])
fi
],)
AH_TEMPLATE(C_SSHOT,[Define to 1 to enable screenshots, requires libpng])
AC_ARG_ENABLE(shots,[ --enable-shots Enable screenshot support],[
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 enable screenshots without libpng])
fi
],)
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
AC_OUTPUT([
Makefile
src/Makefile
src/cpu/Makefile
src/cpu/core_16/Makefile
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
docs/Makefile
])