Allow building with Guile 2.2.
[guile-sdl2.git] / configure.ac
CommitLineData
9ce20c40
DT
1# -*- Autoconf -*-
2#
3# guile-sdl2 --- FFI bindings for SDL2
4# Copyright © 2015 David Thompson <davet@gnu.org>
5#
6# This file is part of guile-sdl2.
7#
8# Guile-sdl2 is free software; you can redistribute it and/or modify
9# it under the terms of the GNU Lesser General Public License as
10# published by the Free Software Foundation; either version 3 of the
11# License, or (at your option) any later version.
12#
13# Guile-sdl2 is distributed in the hope that it will be useful, but
14# WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16# General Public License for more details.
17#
18# You should have received a copy of the GNU Lesser General Public
19# License along with guile-sdl2. If not, see
20# <http://www.gnu.org/licenses/>.
21
2f64307d 22AC_INIT(guile-sdl2, 0.1.1)
9ce20c40
DT
23AC_CONFIG_SRCDIR(sdl2)
24AC_CONFIG_AUX_DIR([build-aux])
25AM_INIT_AUTOMAKE([color-tests -Wall -Wno-portability foreign])
26AM_SILENT_RULES([yes])
27
28AC_CONFIG_FILES([Makefile sdl2/config.scm])
29AC_CONFIG_FILES([pre-inst-env], [chmod +x pre-inst-env])
30
302753bf
DT
31GUILE_PKG([2.2 2.0])
32GUILE_PROGS
1de096a7
DT
33
34# Core SDL2
9ce20c40
DT
35PKG_CHECK_MODULES([SDL2], [sdl2])
36
37LIBSDL2="libSDL2"
38LIBSDL2_LIBDIR="no"
39LIBSDL2_PREFIX="no"
40
41AC_ARG_WITH([libsdl2-prefix],
42 [AS_HELP_STRING([--with-libsdl2-prefix=DIR], [search for SDL2 in DIR])],
43 [case "$withval" in
44 yes|no)
45 ;;
46 *)
47 LIBSDL2="$withval/lib/libSDL2"
48 LIBSDL2_PREFIX="$withval"
49 LIBSDL2_LIBDIR="$withval/lib"
50 ;;
51 esac])
52
53dnl Library name suitable for `dynamic-link'.
54AC_MSG_CHECKING([for libSDL2 shared library name])
55AC_MSG_RESULT([$LIBSDL2])
56AC_SUBST([LIBSDL2])
57AC_SUBST([LIBSDL2_PREFIX])
58AC_SUBST([LIBSDL2_LIBDIR])
59
1de096a7
DT
60# SDL2_image
61AC_ARG_WITH([libsdl2_image],
62 AS_HELP_STRING([--with-libsdl2-image],
63 [Build with the SDL2_image library]),
64 [], [with_libsdl2_image=yes])
65
66
67if test "x$with_libsdl2_image" = "xyes"; then
68 PKG_CHECK_MODULES([SDL2_image], [SDL2_image])
69fi
70
71LIBSDL2_IMAGE="libSDL2_image"
72LIBSDL2_IMAGE_LIBDIR="no"
73LIBSDL2_IMAGE_PREFIX="no"
74
75AC_ARG_WITH([libsdl2-image-prefix],
76 [AS_HELP_STRING([--with-libsdl2-image-prefix=DIR],
77 [search for SDL2_image in DIR])],
78 [case "$withval" in
79 yes|no)
80 ;;
81 *)
82 LIBSDL2_IMAGE="$withval/lib/libSDL2_image"
83 LIBSDL2_IMAGE_PREFIX="$withval"
84 LIBSDL2_IMAGE_LIBDIR="$withval/lib"
85 ;;
86 esac])
87
88AM_CONDITIONAL([WITH_LIBSDL2_IMAGE], [test "x$with_libsdl2_image" = "xyes"])
89
90if test "x$with_libsdl2_image" = "xyes"; then
91 AC_MSG_CHECKING([for libSDL2_image shared library name])
92 AC_MSG_RESULT([$LIBSDL2_IMAGE])
93fi
94
95AC_SUBST([LIBSDL2_IMAGE])
96AC_SUBST([LIBSDL2_IMAGE_PREFIX])
97AC_SUBST([LIBSDL2_IMAGE_LIBDIR])
98
1403e4a6
DT
99# SDL2_ttf
100AC_ARG_WITH([libsdl2_ttf],
101 AS_HELP_STRING([--with-libsdl2-ttf],
102 [Build with the SDL2_ttf library]),
103 [], [with_libsdl2_ttf=yes])
104
105if test "x$with_libsdl2_ttf" = "xyes"; then
106 PKG_CHECK_MODULES([SDL2_ttf], [SDL2_ttf])
107fi
108
109LIBSDL2_TTF="libSDL2_ttf"
110LIBSDL2_TTF_LIBDIR="no"
111LIBSDL2_TTF_PREFIX="no"
112
113AC_ARG_WITH([libsdl2-ttf-prefix],
114 [AS_HELP_STRING([--with-libsdl2-ttf-prefix=DIR],
115 [search for SDL2_ttf in DIR])],
116 [case "$withval" in
117 yes|no)
118 ;;
119 *)
120 LIBSDL2_TTF="$withval/lib/libSDL2_ttf"
121 LIBSDL2_TTF_PREFIX="$withval"
122 LIBSDL2_TTF_LIBDIR="$withval/lib"
123 ;;
124 esac])
125
126AM_CONDITIONAL([WITH_LIBSDL2_TTF], [test "x$with_libsdl2_ttf" = "xyes"])
127
128if test "x$with_libsdl2_ttf" = "xyes"; then
129 AC_MSG_CHECKING([for libSDL2_ttf shared library name])
130 AC_MSG_RESULT([$LIBSDL2_TTF])
131fi
132
133AC_SUBST([LIBSDL2_TTF])
134AC_SUBST([LIBSDL2_TTF_PREFIX])
135AC_SUBST([LIBSDL2_TTF_LIBDIR])
136
4129070b
DT
137# SDL2_mixer
138AC_ARG_WITH([libsdl2_mixer],
139 AS_HELP_STRING([--with-libsdl2-mixer],
140 [Build with the SDL2_mixer library]),
141 [], [with_libsdl2_mixer=yes])
142
143if test "x$with_libsdl2_mixer" = "xyes"; then
144 PKG_CHECK_MODULES([SDL2_mixer], [SDL2_mixer])
145fi
146
147LIBSDL2_MIXER="libSDL2_mixer"
148LIBSDL2_MIXER_LIBDIR="no"
149LIBSDL2_MIXER_PREFIX="no"
150
151AC_ARG_WITH([libsdl2-mixer-prefix],
152 [AS_HELP_STRING([--with-libsdl2-mixer-prefix=DIR],
153 [search for SDL2_mixer in DIR])],
154 [case "$withval" in
155 yes|no)
156 ;;
157 *)
158 LIBSDL2_MIXER="$withval/lib/libSDL2_mixer"
159 LIBSDL2_MIXER_PREFIX="$withval"
160 LIBSDL2_MIXER_LIBDIR="$withval/lib"
161 ;;
162 esac])
163
164AM_CONDITIONAL([WITH_LIBSDL2_MIXER], [test "x$with_libsdl2_mixer" = "xyes"])
165
166if test "x$with_libsdl2_mixer" = "xyes"; then
167 AC_MSG_CHECKING([for libSDL2_mixer shared library name])
168 AC_MSG_RESULT([$LIBSDL2_MIXER])
169fi
170
171AC_SUBST([LIBSDL2_MIXER])
172AC_SUBST([LIBSDL2_MIXER_PREFIX])
173AC_SUBST([LIBSDL2_MIXER_LIBDIR])
174
9ce20c40 175AC_OUTPUT