# -*- Autoconf -*- # # guile-sdl2 --- FFI bindings for SDL2 # Copyright © 2015 David Thompson # # This file is part of guile-sdl2. # # Guile-sdl2 is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as # published by the Free Software Foundation; either version 3 of the # License, or (at your option) any later version. # # Guile-sdl2 is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with guile-sdl2. If not, see # . AC_INIT(guile-sdl2, 0.2.0) AC_CONFIG_SRCDIR(sdl2) AC_CONFIG_AUX_DIR([build-aux]) AM_INIT_AUTOMAKE([color-tests -Wall -Wno-portability foreign]) AM_SILENT_RULES([yes]) AC_CONFIG_FILES([Makefile sdl2/config.scm]) AC_CONFIG_FILES([pre-inst-env], [chmod +x pre-inst-env]) GUILE_PKG([2.2 2.0]) GUILE_PROGS # Core SDL2 PKG_CHECK_MODULES([SDL2], [sdl2]) LIBSDL2="libSDL2" LIBSDL2_LIBDIR="no" LIBSDL2_PREFIX="no" AC_ARG_WITH([libsdl2-prefix], [AS_HELP_STRING([--with-libsdl2-prefix=DIR], [search for SDL2 in DIR])], [case "$withval" in yes|no) ;; *) LIBSDL2="$withval/lib/libSDL2" LIBSDL2_PREFIX="$withval" LIBSDL2_LIBDIR="$withval/lib" ;; esac]) dnl Library name suitable for `dynamic-link'. AC_MSG_CHECKING([for libSDL2 shared library name]) AC_MSG_RESULT([$LIBSDL2]) AC_SUBST([LIBSDL2]) AC_SUBST([LIBSDL2_PREFIX]) AC_SUBST([LIBSDL2_LIBDIR]) # SDL2_image AC_ARG_WITH([libsdl2_image], AS_HELP_STRING([--with-libsdl2-image], [Build with the SDL2_image library]), [], [with_libsdl2_image=yes]) if test "x$with_libsdl2_image" = "xyes"; then PKG_CHECK_MODULES([SDL2_image], [SDL2_image]) fi LIBSDL2_IMAGE="libSDL2_image" LIBSDL2_IMAGE_LIBDIR="no" LIBSDL2_IMAGE_PREFIX="no" AC_ARG_WITH([libsdl2-image-prefix], [AS_HELP_STRING([--with-libsdl2-image-prefix=DIR], [search for SDL2_image in DIR])], [case "$withval" in yes|no) ;; *) LIBSDL2_IMAGE="$withval/lib/libSDL2_image" LIBSDL2_IMAGE_PREFIX="$withval" LIBSDL2_IMAGE_LIBDIR="$withval/lib" ;; esac]) AM_CONDITIONAL([WITH_LIBSDL2_IMAGE], [test "x$with_libsdl2_image" = "xyes"]) if test "x$with_libsdl2_image" = "xyes"; then AC_MSG_CHECKING([for libSDL2_image shared library name]) AC_MSG_RESULT([$LIBSDL2_IMAGE]) fi AC_SUBST([LIBSDL2_IMAGE]) AC_SUBST([LIBSDL2_IMAGE_PREFIX]) AC_SUBST([LIBSDL2_IMAGE_LIBDIR]) # SDL2_ttf AC_ARG_WITH([libsdl2_ttf], AS_HELP_STRING([--with-libsdl2-ttf], [Build with the SDL2_ttf library]), [], [with_libsdl2_ttf=yes]) if test "x$with_libsdl2_ttf" = "xyes"; then PKG_CHECK_MODULES([SDL2_ttf], [SDL2_ttf]) fi LIBSDL2_TTF="libSDL2_ttf" LIBSDL2_TTF_LIBDIR="no" LIBSDL2_TTF_PREFIX="no" AC_ARG_WITH([libsdl2-ttf-prefix], [AS_HELP_STRING([--with-libsdl2-ttf-prefix=DIR], [search for SDL2_ttf in DIR])], [case "$withval" in yes|no) ;; *) LIBSDL2_TTF="$withval/lib/libSDL2_ttf" LIBSDL2_TTF_PREFIX="$withval" LIBSDL2_TTF_LIBDIR="$withval/lib" ;; esac]) AM_CONDITIONAL([WITH_LIBSDL2_TTF], [test "x$with_libsdl2_ttf" = "xyes"]) if test "x$with_libsdl2_ttf" = "xyes"; then AC_MSG_CHECKING([for libSDL2_ttf shared library name]) AC_MSG_RESULT([$LIBSDL2_TTF]) fi AC_SUBST([LIBSDL2_TTF]) AC_SUBST([LIBSDL2_TTF_PREFIX]) AC_SUBST([LIBSDL2_TTF_LIBDIR]) # SDL2_mixer AC_ARG_WITH([libsdl2_mixer], AS_HELP_STRING([--with-libsdl2-mixer], [Build with the SDL2_mixer library]), [], [with_libsdl2_mixer=yes]) if test "x$with_libsdl2_mixer" = "xyes"; then PKG_CHECK_MODULES([SDL2_mixer], [SDL2_mixer]) fi LIBSDL2_MIXER="libSDL2_mixer" LIBSDL2_MIXER_LIBDIR="no" LIBSDL2_MIXER_PREFIX="no" AC_ARG_WITH([libsdl2-mixer-prefix], [AS_HELP_STRING([--with-libsdl2-mixer-prefix=DIR], [search for SDL2_mixer in DIR])], [case "$withval" in yes|no) ;; *) LIBSDL2_MIXER="$withval/lib/libSDL2_mixer" LIBSDL2_MIXER_PREFIX="$withval" LIBSDL2_MIXER_LIBDIR="$withval/lib" ;; esac]) AM_CONDITIONAL([WITH_LIBSDL2_MIXER], [test "x$with_libsdl2_mixer" = "xyes"]) if test "x$with_libsdl2_mixer" = "xyes"; then AC_MSG_CHECKING([for libSDL2_mixer shared library name]) AC_MSG_RESULT([$LIBSDL2_MIXER]) fi AC_SUBST([LIBSDL2_MIXER]) AC_SUBST([LIBSDL2_MIXER_PREFIX]) AC_SUBST([LIBSDL2_MIXER_LIBDIR]) AC_OUTPUT