]> Dogcows Code - chaz/yoink/blob - configure.ac
c5104297add457585353f72bdd3c8eff261c732c
[chaz/yoink] / configure.ac
1
2 #
3 # Yoink
4 # Process this file with autoconf to produce a configure script.
5 #
6
7 AC_PREREQ([2.60])
8
9 AC_INIT([Yoink], [0.1], [chaz@dogcows.com], [yoink])
10
11 AC_CANONICAL_TARGET
12
13 AC_CONFIG_SRCDIR([src/YoinkApp.cc])
14 AC_CONFIG_MACRO_DIR([m4])
15
16 AM_INIT_AUTOMAKE
17
18
19 #
20 # Checks for programs.
21 #
22
23 AC_PROG_CXX
24 #AC_PROG_AWK
25 AC_PROG_CC
26 AC_PROG_CPP
27 AC_PROG_INSTALL
28 #AC_PROG_LN_S
29 #AC_PROG_MAKE_SET
30 AC_PROG_LIBTOOL
31
32
33 #
34 # Checks for configuration arguments.
35 #
36
37 AC_ARG_ENABLE([debug],
38 [ --enable-debug include debugging symbols and features],
39 [debug=$enableval
40 if test x$debug = xyes
41 then
42 CFLAGS="-O0 -DDEBUG"
43 CXXFLAGS="-O0 -DDEBUG"
44 else
45 CFLAGS="-O2 -DNDEBUG"
46 CXXFLAGS="-O2 -DNDEBUG"
47 fi],
48 [CFLAGS="-O2 -DNDEBUG"
49 CXXFLAGS="-O2 -DNDEBUG"])
50
51 AC_ARG_ENABLE([profile],
52 [ --enable-profile make a binary for use with gprof],
53 [profile=$enableval
54 if test x$profile = xyes
55 then
56 CFLAGS="$CFLAGS -pg"
57 CXXFLAGS="$CXXFLAGS -pg"
58 fi])
59
60
61 if test x$prefix = xNONE
62 then
63 prefix="$ac_default_prefix"
64 fi
65
66 AC_ARG_WITH([assetdir],
67 [AS_HELP_STRING([--with-assetdir=DIR],
68 [real path to game assets (default: $datarootdir/yoink)])],
69 [DATADIR="$withval"],
70 [eval DATADIR="$datarootdir/yoink"])
71
72 case "${host}" in
73 *mingw32*)
74 DATADIR="data"
75 esac
76
77 AC_SUBST([DATADIR])
78 AC_DEFINE_UNQUOTED([YOINK_DATADIR], ["$DATADIR"],
79 [Define to path of game asset directory.])
80
81 CONFIGFILES="\$HOME/.yoinkrc:/etc/yoinkrc"
82
83 AC_DEFINE_UNQUOTED([YOINK_CONFIGFILES], ["$CONFIGFILES"],
84 [Define to colon-delimited configuration file paths.])
85
86
87 #
88 # Checks for libraries.
89 #
90
91 AM_PATH_SDL([1.2.10],
92 [CFLAGS="$CFLAGS $SDL_CFLAGS"
93 CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
94 LIBS="$LIBS $SDL_LIBS"])
95
96 #BOOST_REQUIRE([1.35])
97 #CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
98 BOOST_SMART_PTR
99 BOOST_STRING_ALGO
100 BOOST_BIND
101 BOOST_FUNCTION
102
103 AC_SEARCH_LIBS([IMG_Load], [SDL_image],,
104 [AC_MSG_ERROR([SDL_image is required])])
105
106 AC_SEARCH_LIBS([Sound_Init], [SDL_sound],,
107 [AC_MSG_ERROR([SDL_sound is required])])
108
109 AC_SEARCH_LIBS([glBegin], [GL opengl32],,
110 [AC_MSG_ERROR([OpenGL is required])])
111
112 AC_SEARCH_LIBS([gluPerspective], [GLU MesaGLU glu32],,
113 [AC_MSG_ERROR([GLU is required])])
114
115 AC_SEARCH_LIBS([alGenBuffers], [openal openal32],,
116 [AC_MSG_ERROR([OpenAL is required])])
117
118 AC_SEARCH_LIBS([alutInit], [alut],,
119 [AC_MSG_ERROR([alut is required])])
120
121 AC_SEARCH_LIBS([clock_gettime], [rt],
122 [AC_DEFINE([HAVE_CLOCK_GETTIME], 1,
123 [Define to 1 if you have the 'clock_gettime' function.])])
124
125
126 #
127 # Checks for header files.
128 #
129
130 AC_HEADER_STDBOOL
131 AC_HEADER_STDC
132 AC_CHECK_HEADERS([stddef.h stdint.h stdlib.h string.h unistd.h])
133
134
135 #
136 # Checks for typedefs, structures, and compiler characteristics.
137 #
138
139 AC_C_STRINGIZE
140 AC_C_INLINE
141
142 AC_TYPE_UINT8_T
143 AC_TYPE_UINT16_T
144 AC_TYPE_UINT32_T
145 AC_TYPE_SIZE_T
146 AC_TYPE_SSIZE_T
147
148
149 #
150 # Checks for library functions.
151 #
152
153 AC_FUNC_ERROR_AT_LINE
154 AC_FUNC_STRTOD
155 AC_CHECK_FUNCS([nanosleep strchr strcspn strrchr strstr])
156
157
158 #
159 # Find the data files to install.
160 #
161
162 DATA_FILES=$(echo $(cd data; \
163 find . -name "*.json" \
164 -o -name "*.ogg" \
165 -o -name "*.png" \
166 -o -name "*.xm" \
167 -o -name "yoinkrc"))
168 AC_SUBST([DATA_FILES])
169
170
171 #
172 # Create the build files.
173 #
174
175 AC_CONFIG_FILES([Makefile
176 data/Makefile
177 doc/Makefile
178 doc/yoink.6
179 extra/yoink.spec
180 src/Makefile
181 yajl/Makefile])
182
183 AC_CONFIG_HEADERS([src/config.h])
184
185 AC_OUTPUT
186
187
188 #
189 # Print a friendly little message.
190 #
191
192 echo "======================================"
193 echo " Configuration complete!"
194 echo ""
195
196 echo " Prefix: $prefix"
197 echo " Data: $DATADIR"
198 echo ""
199
200 if test x$debug = xyes
201 then
202 echo " * Debugging enabled."
203 echo ""
204 fi
205
206 if test x$profile = xyes
207 then
208 echo " * Profiling enabled."
209 echo ""
210 fi
211
212 echo " To finish the installation, execute:"
213 echo " make"
214 echo " make install"
215 echo "======================================"
216
This page took 0.04264 seconds and 4 git commands to generate.