aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac24
1 files changed, 17 insertions, 7 deletions
diff --git a/configure.ac b/configure.ac
index 69ca562..13ccb1a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -10,21 +10,31 @@ AC_CONFIG_FILES([Makefile])
SDL_VERSION=2.0
AC_ARG_WITH(sdl-prefix,[ --with-sdl-prefix=PFX Prefix where SDL is installed (optional)],
sdl_prefix="$withval", sdl_prefix="")
+
+DEPS_CFLAGS=""
+DEPS_LIBS=""
+
AS_IF([test "x$sdl_prefix" = x], [
- PKG_CHECK_MODULES([SDL], [sdl2 >= $SDL_VERSION], [sdl_loaded=yes])
+ PKG_CHECK_MODULES([SDL], [sdl2 >= $SDL_VERSION])
], [
sdl_config="$sdl_prefix/bin/sdl2-config"
SDL_CFLAGS=`"$sdl_config" --prefix="$sdl_prefix" --cflags`
SDL_LIBS=`"$sdl_config" --prefix="$sdl_prefix" --libs`
- sdl_loaded=yes # TODO: check if sdl is present, check version
+ # TODO: check if sdl is present, check version
])
-AS_IF([test "x$sdl_loaded" != xyes], [AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])])
-DEPS_CFLAGS="$SDL_CFLAGS"
-DEPS_LIBS="$SDL_LIBS"
+DEPS_CFLAGS="$SDL_CFLAGS $DEPS_CFLAGS"
+DEPS_LIBS="$SDL_LIBS $DEPS_LIBS"
+
+AC_CANONICAL_HOST
+AS_IF([test "$host_os" != mingw32], [
+ PKG_CHECK_MODULES([NCURSES], [ncurses])
+ DEPS_CFLAGS="$NCURSES_CFLAGS $DEPS_CFLAGS"
+ DEPS_LIBS="$NCURSES_LIBS $DEPS_LIBS"
+ AC_DEFINE([ENABLE_NCURSES], [], [Enable ncurses])
+])
+
AC_SUBST(DEPS_CFLAGS)
AC_SUBST(DEPS_LIBS)
-# AC_DEFINE([ENABLE_NCURSES], [], [Enable ncurses])
-# AC_CHECK_LIB([ncurses], [initscr])
AC_PROG_CXX
AC_TYPE_UINT32_T