summaryrefslogtreecommitdiff
path: root/configure.ac
blob: 3702094d88e2e3aff9c0ab199ef135e02c495fe9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
dnl -*- Autoconf -*-

AC_INIT(chickadee, 0.9.0)
AC_CONFIG_SRCDIR(chickadee)
AC_CONFIG_AUX_DIR([build-aux])
AM_INIT_AUTOMAKE([color-tests -Wall -Wno-portability foreign])
AM_SILENT_RULES([yes])

AC_PATH_PROG([GUILE], [guile])
AC_CONFIG_FILES([Makefile])
AC_CONFIG_FILES([pre-inst-env], [chmod +x pre-inst-env])
AC_CONFIG_FILES([test-env], [chmod +x test-env])
AC_CONFIG_FILES([scripts/chickadee], [chmod +x scripts/chickadee])
AC_CONFIG_FILES([chickadee/config.scm])

# Prepare a version of $datadir that does not contain references to
# shell variables.
chickadee_prefix="`eval echo $prefix | sed -e"s|NONE|/usr/local|g"`"
chickadee_datadir="`eval eval echo $datadir | sed -e "s|NONE|$chickadee_prefix|g"`"
AC_SUBST([chickadee_datadir])

GUILE_PKG([3.0])
GUILE_PROGS

GUILE_MODULE_REQUIRED_EXPORT([(guile)], [mkdtemp])
GUILE_MODULE_REQUIRED([gl])
GUILE_MODULE_REQUIRED([sdl2])

AC_PATH_PROGS([PKG_CONFIG], [pkg-config])

PKG_CHECK_MODULES([PNG], [libpng])
PKG_CHECK_VAR([PNG_LIBDIR], [libpng], [libdir])
AC_MSG_CHECKING([libpng library path])
AS_IF([test "PNG_LIBDIR" = "x"], [
  AC_MSG_FAILURE([Unable to identify libpng lib path.])
], [
  AC_MSG_RESULT([$PNG_LIBDIR])
])
AC_SUBST([PNG_LIBDIR])
PNG_VERSION="`$PKG_CONFIG --modversion libpng`"
AC_SUBST([PNG_VERSION])

PKG_CHECK_MODULES([TURBOJPEG], [libturbojpeg])
PKG_CHECK_VAR([TURBOJPEG_LIBDIR], [libturbojpeg], [libdir])
AC_MSG_CHECKING([libturbojpeg library path])
AS_IF([test "TURBOJPEG_LIBDIR" = "x"], [
  AC_MSG_FAILURE([Unable to identify libturbojpeg lib path.])
], [
  AC_MSG_RESULT([$TURBOJPEG_LIBDIR])
])
AC_SUBST([TURBOJPEG_LIBDIR])

PKG_CHECK_MODULES([OpenAL], [openal])
PKG_CHECK_VAR([OPENAL_LIBDIR], [openal], [libdir])
AC_MSG_CHECKING([OpenAL library path])
AS_IF([test "x$OPENAL_LIBDIR" = "x"], [
  AC_MSG_FAILURE([Unable to identify OpenAL lib path.])
], [
  AC_MSG_RESULT([$OPENAL_LIBDIR])
])
AC_SUBST([OPENAL_LIBDIR])

PKG_CHECK_MODULES([Vorbis], [vorbis])
PKG_CHECK_VAR([VORBIS_LIBDIR], [vorbis], [libdir])
AC_MSG_CHECKING([Vorbis library path])
AS_IF([test "VORBIS_LIBDIR" = "x"], [
  AC_MSG_FAILURE([Unable to identify Vorbis lib path.])
], [
  AC_MSG_RESULT([$VORBIS_LIBDIR])
])
AC_SUBST([VORBIS_LIBDIR])

PKG_CHECK_MODULES([mpg123], [libmpg123])
PKG_CHECK_VAR([MPG123_LIBDIR], [libmpg123], [libdir])
AC_MSG_CHECKING([mpg123 library path])
AS_IF([test "MPG123_LIBDIR" = "x"], [
  AC_MSG_FAILURE([Unable to identify mpg123 lib path.])
], [
  AC_MSG_RESULT([$MPG123_LIBDIR])
])
AC_SUBST([MPG123_LIBDIR])

PKG_CHECK_MODULES([freetype], [freetype2])
PKG_CHECK_VAR([FREETYPE_LIBDIR], [freetype2], [libdir])
AC_MSG_CHECKING([freetype library path])
AS_IF([test "FREETYPE_LIBDIR" = "x"], [
  AC_MSG_FAILURE([Unable to identify freetype lib path.])
], [
  AC_MSG_RESULT([$FREETYPE_LIBDIR])
])
AC_SUBST([FREETYPE_LIBDIR])

PKG_CHECK_MODULES([readline], [readline])
PKG_CHECK_VAR([READLINE_LIBDIR], [readline], [libdir])
AC_MSG_CHECKING([readline library path])
AS_IF([test "x$READLINE_LIBDIR" = "x"], [
  AC_MSG_FAILURE([Unable to identify readline lib path.])
], [
  AC_MSG_RESULT([$READLINE_LIBDIR])
])
AC_SUBST([READLINE_LIBDIR])

AC_OUTPUT