1# Process this file with autoconf to produce a configure script.
2AC_INIT([Tux Typing],[1.8.3],[tux4kids-tuxtype-dev@lists.alioth.debian.org],[tuxtype])
3AC_CONFIG_SRCDIR([src/playgame.c])
4
5AC_PREREQ(2.61)
6AC_CANONICAL_BUILD
7AC_CANONICAL_HOST
8AC_CANONICAL_TARGET
9
10
11# Tell Automake not to be as strict about packaging standards for tuxtype
12# as it would be for an official Gnu program:
13AM_INIT_AUTOMAKE(foreign)
14AC_CONFIG_SRCDIR([config.h.in])
15AC_CONFIG_HEADERS([config.h])
16
17NAME_VERSION=$PACKAGE-$VERSION
18
19AC_DEFINE_UNQUOTED([PROGRAM_NAME], "$PACKAGE", [Tux Typing])
20
21AC_SUBST(NAME_VERSION)
22
23# To link gettext library
24AC_GNU_SOURCE
25dnl NOTE - build using external intl lib:
26AM_GNU_GETTEXT([external])
27AM_GNU_GETTEXT_VERSION([0.18])
28
29# ----------------------------------------------------------------------
30# Checks for programs.
31# ----------------------------------------------------------------------
32
33AC_PROG_CC
34AC_PROG_INSTALL
35AC_PROG_MAKE_SET
36AC_PROG_AWK
37AC_PROG_CPP
38AC_PROG_MKDIR_P
39AC_PROG_RANLIB
40AC_PROG_YACC
41
42
43# -----------------------------------------------------------------------
44# Checks for libraries.
45# -----------------------------------------------------------------------
46
47
48dnl ---------------------------------------------------------------------------
49dnl In the following checks we attempt to use pkg-config if available, falling
50dnl back to standard autoconf macro as needed:
51dnl ---------------------------------------------------------------------------
52
53
54
55dnl Check for SDL
56PKG_CHECK_MODULES([SDL],
57	[sdl >= 1.2.0],
58	[],
59	[SDL_VERSION=1.2.0
60	 AM_PATH_SDL($SDL_VERSION, :,
61		AC_MSG_ERROR([SDL version $SDL_VERSION not found! http://www.libsdl.org]))])
62
63CFLAGS="$CFLAGS $SDL_CFLAGS"
64LIBS="$LIBS $SDL_LIBS"
65
66
67
68dnl Check for SDL_image: ------------------------------------------------------
69
70PKG_CHECK_MODULES([SDL_IMAGE],
71	[SDL_image],
72	[],
73	[AC_MSG_NOTICE([SDL_image not located by pkg-config, checking with AC CHECK LIB:])
74	 AC_CHECK_LIB([SDL_image],
75		[IMG_Load],
76		[],
77		[AC_MSG_ERROR([SDL_image not found! http://www.libsdl.org/projects/SDL_image])])])
78
79AC_DEFINE([HAVE_LIBSDL_IMAGE],[1],[Define to 1 if you have the 'SDL_image' library])
80CFLAGS="$CFLAGS $SDL_IMAGE"
81LIBS="$LIBS $SDL_IMAGE_LIBS"
82
83
84
85dnl Check for SDL_mixer: --------------------------------------------------------
86
87PKG_CHECK_MODULES([SDL_MIXER],
88	[SDL_mixer],
89	[],
90	[AC_MSG_NOTICE([SDL_mixer not located by pkg-config, checking with AC CHECK LIB:])
91	 AC_CHECK_LIB([SDL_mixer],
92		[Mix_OpenAudio],
93		[],
94		[AC_MSG_ERROR([SDL_mixer not found! http://www.libsdl.org/projects/SDL_mixer])])])
95
96AC_DEFINE([HAVE_LIBSDL_MIXER],[1],[Define to 1 if you have the 'SDL_mixer' library])
97CFLAGS="$CFLAGS $SDL_MIXER_CFLAGS"
98LIBS="$LIBS $SDL_MIXER_LIBS"
99
100
101
102dnl Check for SDL_Pango: --------------------------------------------------------
103
104dnl SDL_Pango is enabled by default.
105dnl If SDL_Pango disabled at configure time, or if we can't find it,
106dnl we look for SDL_ttf:
107
108AC_ARG_WITH([sdlpango],
109	[AS_HELP_STRING([--without-sdlpango],
110	[Do not use SDL_Pango even if available])],
111	[],
112	[with_sdlpango=yes])
113
114
115if test "x$with_sdlpango" != xno; then
116
117PKG_CHECK_MODULES([SDL_PANGO],
118	[SDL_Pango],
119	[],
120	[AC_MSG_NOTICE([SDL_Pango not located by pkg-config, checking with AC CHECK LIB:])
121	 AC_CHECK_LIB([SDL_Pango],
122		[SDLPango_Init],
123		[],
124		[AC_MSG_FAILURE([SDL_Pango test failed (--without-sdlpango to disable)])])])
125
126AC_DEFINE([HAVE_LIBSDL_PANGO],[1],[Define to 1 if you have the `SDL_Pango` library])
127CFLAGS="$CFLAGS $SDL_PANGO_CFLAGS"
128LIBS="$LIBS $SDL_PANGO_LIBS"
129
130fi
131
132
133
134dnl We only use SDL_ttf if SDL_Pango disabled: --------------------------------------
135
136if [test "x$with_sdlpango" = xno]; then
137dnl Add freetype link "by hand" until mingw-cross-env takes care
138dnl of this automatically
139LIBS="-lfreetype $LIBS"
140
141PKG_CHECK_MODULES([SDL_ttf],
142	[SDL_ttf],
143	[],
144	[AC_MSG_NOTICE([SDL_ttf not located by pkg-config, checking with AC CHECK LIB:])
145	 AC_CHECK_LIB([SDL_ttf],
146		[TTF_Init],
147		[],
148		[AC_MSG_ERROR([SDL_ttf not found! http://www.libsdl.org/projects/SDL_ttf])])])
149
150AC_DEFINE([HAVE_LIBSDL_TTF],[1],[Define to 1 if you have the `SDL_ttf` library])
151CFLAGS="$CFLAGS $SDL_TTF_CFLAGS"
152LIBS="$LIBS $SDL_TTF_LIBS"
153fi
154
155
156
157dnl Check for libRSVG and cairo. SVG support is enabled by default ----------------------
158
159AC_ARG_WITH([rsvg],
160	[AS_HELP_STRING([--without-rsvg],[do not use libRSVG even if available])],
161	[with_rsvg=no],
162	[with_rsvg=yes])
163
164if test "x$with_rsvg" = xyes; then
165PKG_CHECK_MODULES([RSVG],
166	[librsvg-2.0 >= 2.18],
167	[],
168	[AC_MSG_FAILURE([libRSVG test failed (--without-rsvg to disable svg support)])])
169
170CFLAGS="$CFLAGS $RSVG_CFLAGS"
171LIBS="$LIBS $RSVG_LIBS"
172fi
173
174if test "x$with_rsvg" = xyes; then
175PKG_CHECK_MODULES([CAIRO],
176	[cairo >= 1.4.10],
177	[],
178	[AC_MSG_FAILURE([cairo test failed (--without-rsvg to disable svg support)])])
179
180CFLAGS="$CFLAGS $CAIRO_CFLAGS"
181LIBS="$LIBS $CAIRO_LIBS"
182AC_DEFINE([HAVE_RSVG],[1],[Define to 1 if you have the `libRSVG` library])
183fi
184
185
186
187dnl Check for math functions - needed for SDL_extras: --------------------------------------------
188
189AC_CHECK_LIB([m],
190	[csin],
191	[],
192	[AC_MSG_ERROR([Math library not found - functions in <math.h> may not be available.])])
193
194
195
196
197dnl Check for SDL_net: --------------------------------------------------------
198
199dnl SDL_net is enabled by default.
200
201AC_ARG_WITH([sdlnet],
202	[AS_HELP_STRING([--without-sdlnet],
203	[Do not use SDL_net even if available])],
204	[],
205	[with_sdlnet=yes]
206)
207
208if test "x$with_sdlnet" != xno; then
209dnl We will need this for socket programming on Win32
210AC_CHECK_LIB([ws2_32],
211             [WSAStartup],
212	     []  ,
213	     [AC_MSG_NOTICE([Windows socket library ws2_32 not found - (only needed on win32)])])
214
215
216PKG_CHECK_MODULES([SDL_NET],
217	[SDL_net],
218	[],
219	[AC_MSG_NOTICE([SDL_net not located by pkg-config, checking with AC CHECK LIB:])
220	 AC_CHECK_LIB([SDL_net],
221		[SDLNet_Init],
222		[],
223		[AC_MSG_FAILURE([SDL_net test failed (--without-sdlnet to disable)])])])
224
225AC_DEFINE([HAVE_LIBSDL_NET],[1],[Define to 1 if you have the 'SDL_net' library])
226CFLAGS="$CFLAGS $SDL_NET_CFLAGS"
227LIBS="$LIBS $SDL_NET_LIBS"
228fi
229
230
231
232dnl Check for libxml2: --------------------------------------------------------
233
234PKG_CHECK_MODULES([XML2],
235	[libxml-2.0],
236	[],
237	[AC_MSG_NOTICE([libxml2 not located by pkg-config, checking with AC CHECK LIB:])
238	 AC_CHECK_LIB([xml2],
239		[xmlParseFile],
240		[],
241		[AC_MSG_ERROR([libxml-2.0 not found: http://www.xmlsoft.org])])])
242
243AC_DEFINE([HAVE_LIBXML2],[1],[Define to 1 if you have the `libxml-2.0` library])
244CFLAGS="$CFLAGS $XML2_CFLAGS"
245LIBS="$LIBS $XML2_LIBS"
246
247
248
249# --------------------------------------------------------------------------------------
250# Checks for header files.
251# --------------------------------------------------------------------------------------
252
253AC_FUNC_ALLOCA
254AC_HEADER_DIRENT
255AC_HEADER_STDC
256AC_CHECK_HEADERS([argz.h error.h errno.h fcntl.h float.h iconv.h inttypes.h langinfo.h libintl.h limits.h locale.h malloc.h stddef.h stdint.h stdio_ext.h stdlib.h string.h strings.h sys/param.h unistd.h wchar.h])
257
258
259# --------------------------------------------------------------------------------------------
260# Checks for typedefs, structures, and compiler characteristics.
261# --------------------------------------------------------------------------------------------
262
263AC_HEADER_STDBOOL
264AC_C_CONST
265AC_C_INLINE
266AC_TYPE_MODE_T
267AC_TYPE_SIZE_T
268AC_TYPE_UINT16_T
269AC_TYPE_UINT32_T
270AC_TYPE_UINT8_T
271AC_C_VOLATILE
272AC_CHECK_TYPES([ptrdiff_t])
273
274
275# -------------------------------------------------------------------------------------------
276# Checks for library functions.
277# -------------------------------------------------------------------------------------------
278
279
280AC_FUNC_CLOSEDIR_VOID
281AC_FUNC_ERROR_AT_LINE
282#AC_FUNC_MALLOC
283AC_FUNC_MMAP
284#AC_FUNC_REALLOC
285AC_FUNC_STAT
286AC_FUNC_STRCOLL
287AC_FUNC_STRTOD
288AC_FUNC_VPRINTF
289AC_CHECK_FUNCS([__argz_count __argz_next __argz_stringify atexit bcopy floor getcwd getenv localeconv localtime_r memmove mempcpy memset Mix_Init mkdir munmap nl_langinfo pow putenv scandir SDLPango_CreateContext_GivenFontDesc setenv setlocale stpcpy strcasecmp strchr strcspn strdup strncasecmp strndup strstr strtoul])
290
291
292
293
294dnl --------------------------------------------------------
295dnl
296dnl Remaining win32 conditional stuff:
297dnl
298dnl --------------------------------------------------------
299
300
301
302# Check platform - see if WinMain needed:
303AC_MSG_CHECKING([for native Win32])
304case "$host" in
305  *-*-mingw*)
306    native_win32=yes
307    ;;
308  *)
309    native_win32=no
310    ;;
311esac
312AC_MSG_RESULT([$native_win32])
313
314AM_CONDITIONAL(BUILD_MINGW32, test $native_win32 = yes)
315
316
317# If using Woe32, we will need to use non-unix locations for various things:
318# Where to keep bundled (fixed) data files:
319MINGW32_PACKAGE_DATA_DIR="data"
320AC_SUBST(MINGW32_PACKAGE_DATA_DIR)
321
322dnl FIXME this isn't a good place on a well-administered Windows system
323# Where to keep modifiable shared data files:
324MINGW32_PACKAGE_VAR_DIR="data"
325AC_SUBST(MINGW32_PACKAGE_VAR_DIR)
326
327dnl FIXME this isn't a good place on a well-administered Windows system
328# Where to keep machine-wide (i.e for all users) config files:
329MINGW32_PACKAGE_CONF_DIR="data"
330AC_SUBST(MINGW32_PACKAGE_CONF_DIR)
331
332# Location of input method files:
333MINGW32_PACKAGE_IM_DIR="data/input_methods"
334AC_SUBST(MINGW32_PACKAGE_IM_DIR)
335
336
337
338#AM_CONDITIONAL(BUILD_MINGW32, test "$native_win32" = yes)
339
340if test $native_win32 = yes; then
341   AC_DEFINE([BUILD_MINGW32], 1,[Native MinGW32 build])
342   CFLAGS="$CFLAGS -D__GW32__"
343   LIBS="$LIBS -luuid -lole32 -lwsock32 -mwindows"
344   CPPFLAGS="$CPPFLAGS -idirafter $prefix/include/glibc"
345   AC_PATH_PROG(WINDRES, "$target_alias-windres", no, [$PATH])
346fi
347
348
349# ------------------------------------------------------------
350# Support for building NSIS Win32 installer:
351# ------------------------------------------------------------
352
353NSI_INSTALL_DIR=mingw32
354AC_SUBST(NSI_INSTALL_DIR)
355
356dnl FIXME the following line is a non-portable hack:
357NSI_DLL_DIR=~/tuxtype_dll
358
359AC_ARG_WITH(dll-directory,AS_HELP_STRING([--with-dll-directory=path],[set the path where dll for TuxType are [$(NSI_DLL_DIR)]]), dll_path=$withval, dll_path=no)
360
361AM_CONDITIONAL(NSI_BUILD, test $dll_path = no)
362
363if test $dll_path != no; then
364NSI_DLL_DIR=$dll_path
365fi
366AC_SUBST(NSI_DLL_DIR)
367
368AC_PATH_PROG(NSIS, makensis, [], [$PATH])
369
370
371## Sam's Install Kludge-work
372#CPPFLAGS="$CPPFLAGS -DDATA_PREFIX=\\\"\$(prefix)\\\""
373
374# ---------------------------------------------------------------
375# Create Makefiles
376# ---------------------------------------------------------------
377
378AC_CONFIG_FILES([Makefile
379tuxtype.spec
380tuxtype_preview.spec
381data/Makefile
382data/fonts/Makefile
383data/im/Makefile
384data/images/Makefile
385data/images/backgrounds/Makefile
386data/images/cities/Makefile
387data/images/comets/Makefile
388data/images/hands/Makefile
389data/images/icons/Makefile
390data/images/keyboard/Makefile
391data/images/menu/Makefile
392data/images/status/Makefile
393data/images/tux/Makefile
394data/scripts/Makefile
395data/sounds/Makefile
396data/themes/Makefile
397data/themes/armenian/Makefile
398data/themes/armenian/images/Makefile
399data/themes/assamese/Makefile
400data/themes/assamese/words/Makefile
401data/themes/asturian/Makefile
402data/themes/asturian/images/Makefile
403data/themes/asturian/scripts/Makefile
404data/themes/asturian/words/Makefile
405data/themes/belarussian/Makefile
406data/themes/belarussian/words/Makefile
407data/themes/bokmal/Makefile
408data/themes/bokmal/words/Makefile
409data/themes/bokmal/images/Makefile
410data/themes/bokmal/images/status/Makefile
411data/themes/brazilian-portuguese/Makefile
412data/themes/brazilian-portuguese/images/Makefile
413data/themes/brazilian-portuguese/words/Makefile
414data/themes/bulgarian/Makefile
415data/themes/bulgarian/words/Makefile
416data/themes/bulgarian/scripts/Makefile
417data/themes/catalan/Makefile
418data/themes/catalan/words/Makefile
419data/themes/czech/Makefile
420data/themes/czech/words/Makefile
421data/themes/dansk/Makefile
422data/themes/dansk/sounds/Makefile
423data/themes/dansk/words/Makefile
424data/themes/deutsch/Makefile
425data/themes/deutsch/words/Makefile
426data/themes/espanol/Makefile
427data/themes/espanol/images/Makefile
428data/themes/espanol/words/Makefile
429data/themes/euskara/Makefile
430data/themes/euskara/images/Makefile
431data/themes/euskara/words/Makefile
432data/themes/french/Makefile
433data/themes/french/words/Makefile
434data/themes/french/scripts/Makefile
435data/themes/greek/Makefile
436data/themes/greek/words/Makefile
437data/themes/greek/scripts/Makefile
438data/themes/gujarati/Makefile
439data/themes/gujarati/words/Makefile
440data/themes/hebrew/Makefile
441data/themes/hebrew/words/Makefile
442data/themes/hindi/Makefile
443data/themes/hindi/words/Makefile
444data/themes/hungarian/Makefile
445data/themes/hungarian/images/Makefile
446data/themes/hungarian/scripts/Makefile
447data/themes/hungarian/words/Makefile
448data/themes/italian/Makefile
449data/themes/italian/images/Makefile
450data/themes/italian/words/Makefile
451data/themes/jamaican/Makefile
452data/themes/jamaican/images/Makefile
453data/themes/jamaican/words/Makefile
454data/themes/kannada/Makefile
455data/themes/kannada/words/Makefile
456data/themes/korean/Makefile
457data/themes/korean/images/Makefile
458data/themes/korean/words/Makefile
459data/themes/lithuanian/Makefile
460data/themes/lithuanian/images/Makefile
461data/themes/lithuanian/images/status/Makefile
462data/themes/lithuanian/sounds/Makefile
463data/themes/lithuanian/words/Makefile
464data/themes/malayalam/Makefile
465data/themes/malayalam/images/Makefile
466data/themes/malayalam/images/status/Makefile
467data/themes/malayalam/images/keyboard/Makefile
468data/themes/malayalam/scripts/Makefile
469data/themes/malayalam/words/Makefile
470data/themes/nederlands/Makefile
471data/themes/nederlands/words/Makefile
472data/themes/nepali/Makefile
473data/themes/nepali/words/Makefile
474data/themes/nynorsk/Makefile
475data/themes/nynorsk/images/Makefile
476data/themes/nynorsk/images/status/Makefile
477data/themes/nynorsk/words/Makefile
478data/themes/oriya/Makefile
479data/themes/oriya/words/Makefile
480data/themes/punjabi/Makefile
481data/themes/punjabi/words/Makefile
482data/themes/romanian/Makefile
483data/themes/romanian/words/Makefile
484data/themes/russian/Makefile
485data/themes/russian/images/Makefile
486data/themes/russian/images/status/Makefile
487data/themes/russian/words/Makefile
488data/themes/suomi/Makefile
489data/themes/suomi/words/Makefile
490data/themes/svenska/Makefile
491data/themes/svenska/words/Makefile
492data/themes/swahili/Makefile
493data/themes/swahili/words/Makefile
494data/themes/tamil/Makefile
495data/themes/tamil/words/Makefile
496data/themes/telugu/Makefile
497data/themes/telugu/words/Makefile
498data/themes/thai/Makefile
499data/themes/thai/words/Makefile
500data/themes/ukrainian/Makefile
501data/themes/ukrainian/words/Makefile
502data/themes/wolof/Makefile
503data/themes/wolof/images/Makefile
504data/themes/wolof/words/Makefile
505data/words/Makefile
506doc/Makefile
507doc/en/Makefile
508po/Makefile.in
509nsis/tuxtype.nsi
510src/Makefile])
511
512AC_OUTPUT
513