configure.ac 14.9 KB
Newer Older
1
# Process this file with autoconf to produce a configure script.
2
AC_INIT([Tux Typing],[1.8.3],[tux4kids-tuxtype-dev@lists.alioth.debian.org],[tuxtype])
3
AC_CONFIG_SRCDIR([src/playgame.c])
4

5
AC_PREREQ(2.61)
6 7 8 9 10 11 12 13
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
AC_CANONICAL_TARGET


# Tell Automake not to be as strict about packaging standards for tuxtype
# as it would be for an official Gnu program:
AM_INIT_AUTOMAKE(foreign)
14
AC_CONFIG_SRCDIR([config.h.in])
15 16
AC_CONFIG_HEADERS([config.h])

17 18 19 20 21 22
NAME_VERSION=$PACKAGE-$VERSION

AC_DEFINE_UNQUOTED([PROGRAM_NAME], "$PACKAGE", [Tux Typing])

AC_SUBST(NAME_VERSION)

23
# To link gettext library
24
AC_GNU_SOURCE
25
dnl NOTE - build using external intl lib:
David Bruce's avatar
David Bruce committed
26
AM_GNU_GETTEXT([external])
27
AM_GNU_GETTEXT_VERSION([0.18])
28

29
# ----------------------------------------------------------------------
30
# Checks for programs.
31 32
# ----------------------------------------------------------------------

33 34 35
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_MAKE_SET
36 37 38 39 40
AC_PROG_AWK
AC_PROG_CPP
AC_PROG_MKDIR_P
AC_PROG_RANLIB
AC_PROG_YACC
41 42


43
# -----------------------------------------------------------------------
44
# Checks for libraries.
45 46 47
# -----------------------------------------------------------------------


48 49 50 51
dnl ---------------------------------------------------------------------------
dnl In the following checks we attempt to use pkg-config if available, falling
dnl back to standard autoconf macro as needed:
dnl ---------------------------------------------------------------------------
David Bruce's avatar
David Bruce committed
52 53


David Bruce's avatar
David Bruce committed
54

55 56
dnl Check for SDL
PKG_CHECK_MODULES([SDL],
57 58 59 60 61
	[sdl >= 1.2.0],
	[],
	[SDL_VERSION=1.2.0
	 AM_PATH_SDL($SDL_VERSION, :,
		AC_MSG_ERROR([SDL version $SDL_VERSION not found! http://www.libsdl.org]))])
62

63 64
CFLAGS="$CFLAGS $SDL_CFLAGS" 
LIBS="$LIBS $SDL_LIBS"
David Bruce's avatar
David Bruce committed
65

66

67

David Bruce's avatar
David Bruce committed
68
dnl Check for SDL_image: ------------------------------------------------------
69

70
PKG_CHECK_MODULES([SDL_IMAGE],
71 72 73 74 75 76 77 78 79 80
	[SDL_image],
	[],
	[AC_MSG_NOTICE([SDL_image not located by pkg-config, checking with AC CHECK LIB:])
	 AC_CHECK_LIB([SDL_image],
		[IMG_Load],
		[],
		[AC_MSG_ERROR([SDL_image not found! http://www.libsdl.org/projects/SDL_image])])])

AC_DEFINE([HAVE_LIBSDL_IMAGE],[1],[Define to 1 if you have the 'SDL_image' library])
CFLAGS="$CFLAGS $SDL_IMAGE"
81
LIBS="$LIBS $SDL_IMAGE_LIBS"
82 83


84

David Bruce's avatar
David Bruce committed
85
dnl Check for SDL_mixer: --------------------------------------------------------
86

87
PKG_CHECK_MODULES([SDL_MIXER],
88 89 90 91 92 93 94 95 96
	[SDL_mixer],
	[],
	[AC_MSG_NOTICE([SDL_mixer not located by pkg-config, checking with AC CHECK LIB:])
	 AC_CHECK_LIB([SDL_mixer],
		[Mix_OpenAudio],
		[],
		[AC_MSG_ERROR([SDL_mixer not found! http://www.libsdl.org/projects/SDL_mixer])])])

AC_DEFINE([HAVE_LIBSDL_MIXER],[1],[Define to 1 if you have the 'SDL_mixer' library])
97 98 99 100
CFLAGS="$CFLAGS $SDL_MIXER_CFLAGS"
LIBS="$LIBS $SDL_MIXER_LIBS"


101

David Bruce's avatar
David Bruce committed
102 103 104 105 106 107 108
dnl Check for SDL_Pango: --------------------------------------------------------

dnl SDL_Pango is enabled by default.
dnl If SDL_Pango disabled at configure time, or if we can't find it,
dnl we look for SDL_ttf:

AC_ARG_WITH([sdlpango],
109 110 111 112 113
	[AS_HELP_STRING([--without-sdlpango],
	[Do not use SDL_Pango even if available])],
	[],
	[with_sdlpango=yes])

David Bruce's avatar
David Bruce committed
114 115

if test "x$with_sdlpango" != xno; then
116

117 118 119 120 121 122 123 124 125 126 127 128 129
PKG_CHECK_MODULES([SDL_PANGO],
	[SDL_Pango],
	[],
	[AC_MSG_NOTICE([SDL_Pango not located by pkg-config, checking with AC CHECK LIB:])
	 AC_CHECK_LIB([SDL_Pango],
		[SDLPango_Init],
		[],
		[AC_MSG_FAILURE([SDL_Pango test failed (--without-sdlpango to disable)])])])

AC_DEFINE([HAVE_LIBSDL_PANGO],[1],[Define to 1 if you have the `SDL_Pango` library])
CFLAGS="$CFLAGS $SDL_PANGO_CFLAGS"
LIBS="$LIBS $SDL_PANGO_LIBS"

130
fi
131 132 133



134
dnl We only use SDL_ttf if SDL_Pango disabled: --------------------------------------
135

136
if [test "x$with_sdlpango" = xno]; then
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152
dnl Add freetype link "by hand" until mingw-cross-env takes care
dnl of this automatically
LIBS="-lfreetype $LIBS"

PKG_CHECK_MODULES([SDL_ttf],
	[SDL_ttf],
	[],
	[AC_MSG_NOTICE([SDL_ttf not located by pkg-config, checking with AC CHECK LIB:])
	 AC_CHECK_LIB([SDL_ttf],
		[TTF_Init],
		[],
		[AC_MSG_ERROR([SDL_ttf not found! http://www.libsdl.org/projects/SDL_ttf])])])

AC_DEFINE([HAVE_LIBSDL_TTF],[1],[Define to 1 if you have the `SDL_ttf` library])
CFLAGS="$CFLAGS $SDL_TTF_CFLAGS"
LIBS="$LIBS $SDL_TTF_LIBS"
153 154 155
fi


156

157
dnl Check for libRSVG and cairo. SVG support is enabled by default ----------------------
158 159

AC_ARG_WITH([rsvg],
160 161 162
	[AS_HELP_STRING([--without-rsvg],[do not use libRSVG even if available])],
	[with_rsvg=no],
	[with_rsvg=yes])
163 164

if test "x$with_rsvg" = xyes; then
165 166 167 168 169 170 171
PKG_CHECK_MODULES([RSVG],
	[librsvg-2.0 >= 2.18],
	[],
	[AC_MSG_FAILURE([libRSVG test failed (--without-rsvg to disable svg support)])])

CFLAGS="$CFLAGS $RSVG_CFLAGS"
LIBS="$LIBS $RSVG_LIBS"
172 173 174
fi

if test "x$with_rsvg" = xyes; then
175 176 177 178 179 180 181 182
PKG_CHECK_MODULES([CAIRO],
	[cairo >= 1.4.10],
	[],
	[AC_MSG_FAILURE([cairo test failed (--without-rsvg to disable svg support)])])

CFLAGS="$CFLAGS $CAIRO_CFLAGS"
LIBS="$LIBS $CAIRO_LIBS"
AC_DEFINE([HAVE_RSVG],[1],[Define to 1 if you have the `libRSVG` library])
183
fi
184

David Bruce's avatar
David Bruce committed
185

186

187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227
dnl Check for math functions - needed for SDL_extras: --------------------------------------------

AC_CHECK_LIB([m],
	[csin],
	[],
	[AC_MSG_ERROR([Math library not found - functions in <math.h> may not be available.])])




dnl Check for SDL_net: --------------------------------------------------------

dnl SDL_net is enabled by default.

AC_ARG_WITH([sdlnet],
	[AS_HELP_STRING([--without-sdlnet],
	[Do not use SDL_net even if available])],
	[],
	[with_sdlnet=yes]
)

if test "x$with_sdlnet" != xno; then
dnl We will need this for socket programming on Win32
AC_CHECK_LIB([ws2_32],
             [WSAStartup],
	     []  ,
	     [AC_MSG_NOTICE([Windows socket library ws2_32 not found - (only needed on win32)])])


PKG_CHECK_MODULES([SDL_NET],
	[SDL_net],
	[],
	[AC_MSG_NOTICE([SDL_net not located by pkg-config, checking with AC CHECK LIB:])
	 AC_CHECK_LIB([SDL_net],
		[SDLNet_Init],
		[],
		[AC_MSG_FAILURE([SDL_net test failed (--without-sdlnet to disable)])])])

AC_DEFINE([HAVE_LIBSDL_NET],[1],[Define to 1 if you have the 'SDL_net' library])
CFLAGS="$CFLAGS $SDL_NET_CFLAGS"
LIBS="$LIBS $SDL_NET_LIBS"
228 229 230
fi


David Bruce's avatar
David Bruce committed
231

232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258
dnl Check for libxml2: --------------------------------------------------------

PKG_CHECK_MODULES([XML2],
	[libxml-2.0],
	[],
	[AC_MSG_NOTICE([libxml2 not located by pkg-config, checking with AC CHECK LIB:])
	 AC_CHECK_LIB([xml2],
		[xmlParseFile],
		[],
		[AC_MSG_ERROR([libxml-2.0 not found: http://www.xmlsoft.org])])])

AC_DEFINE([HAVE_LIBXML2],[1],[Define to 1 if you have the `libxml-2.0` library])
CFLAGS="$CFLAGS $XML2_CFLAGS"
LIBS="$LIBS $XML2_LIBS"



dnl libt4kcommon is now required: --------------------------------------------

PKG_CHECK_MODULES([T4K_COMMON],
	[t4k_common],
	[],
	[AC_MSG_NOTICE([t4k_common not located by pkg-config, checking with AC CHECK LIB:])
	 AC_CHECK_LIB([t4k_common],
		[InitT4KCommon],
		[],
		[AC_MSG_ERROR([libt4k_common is required: git://git.debian.org/tux4kids/t4kcommon.git])])])
David Bruce's avatar
David Bruce committed
259

260 261 262
AC_DEFINE([HAVE_LIBT4K_COMMON],[1],[Define to 1 if you have the `t4k_common` library])
CFLAGS="$CFLAGS $T4K_COMMON_CFLAGS"
LIBS="$LIBS $T4K_COMMON_LIBS"
David Bruce's avatar
David Bruce committed
263

264 265


266 267 268 269 270 271 272 273
# --------------------------------------------------------------------------------------
# Checks for header files.
# --------------------------------------------------------------------------------------

AC_FUNC_ALLOCA
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_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])
274 275


276 277 278 279 280 281 282 283 284
# --------------------------------------------------------------------------------------------
# Checks for typedefs, structures, and compiler characteristics.
# --------------------------------------------------------------------------------------------

AC_HEADER_STDBOOL
AC_C_CONST
AC_C_INLINE
AC_TYPE_MODE_T
AC_TYPE_SIZE_T
285 286 287
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT8_T
288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305
AC_C_VOLATILE
AC_CHECK_TYPES([ptrdiff_t])


# -------------------------------------------------------------------------------------------
# Checks for library functions.
# -------------------------------------------------------------------------------------------


AC_FUNC_CLOSEDIR_VOID
AC_FUNC_ERROR_AT_LINE
#AC_FUNC_MALLOC
AC_FUNC_MMAP
#AC_FUNC_REALLOC
AC_FUNC_STAT
AC_FUNC_STRCOLL
AC_FUNC_STRTOD
AC_FUNC_VPRINTF
306
AC_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])
307

308 309 310



311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333
dnl --------------------------------------------------------
dnl
dnl Remaining win32 conditional stuff:
dnl
dnl --------------------------------------------------------



# Check platform - see if WinMain needed:
AC_MSG_CHECKING([for native Win32])
case "$host" in
  *-*-mingw*)
    native_win32=yes
    ;;
  *)
    native_win32=no
    ;;
esac
AC_MSG_RESULT([$native_win32])

AM_CONDITIONAL(BUILD_MINGW32, test $native_win32 = yes)


334 335
# If using Woe32, we will need to use non-unix locations for various things:
# Where to keep bundled (fixed) data files:
336 337
MINGW32_PACKAGE_DATA_DIR="data"
AC_SUBST(MINGW32_PACKAGE_DATA_DIR)
338

339
dnl FIXME this isn't a good place on a well-administered Windows system
340 341 342 343
# Where to keep modifiable shared data files:
MINGW32_PACKAGE_VAR_DIR="data"
AC_SUBST(MINGW32_PACKAGE_VAR_DIR)

344
dnl FIXME this isn't a good place on a well-administered Windows system
345 346 347 348
# Where to keep machine-wide (i.e for all users) config files:
MINGW32_PACKAGE_CONF_DIR="data"
AC_SUBST(MINGW32_PACKAGE_CONF_DIR)

349 350 351
# Location of input method files: 
MINGW32_PACKAGE_IM_DIR="data/input_methods"
AC_SUBST(MINGW32_PACKAGE_IM_DIR)
352 353 354



355
#AM_CONDITIONAL(BUILD_MINGW32, test "$native_win32" = yes)
356

357
if test $native_win32 = yes; then
358 359
   AC_DEFINE([BUILD_MINGW32], 1,[Native MinGW32 build])
   CFLAGS="$CFLAGS -D__GW32__"
360
   LIBS="$LIBS -luuid -lole32 -lwsock32 -mwindows"
361 362 363 364 365
   CPPFLAGS="$CPPFLAGS -idirafter $prefix/include/glibc"
   AC_PATH_PROG(WINDRES, "$target_alias-windres", no, [$PATH])
fi


366 367 368
# ------------------------------------------------------------
# Support for building NSIS Win32 installer:
# ------------------------------------------------------------
369

370 371
NSI_INSTALL_DIR=mingw32
AC_SUBST(NSI_INSTALL_DIR)
372

373
dnl FIXME the following line is a non-portable hack: 
374
NSI_DLL_DIR=~/tuxtype_dll
375

376
AC_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)
377

378
AM_CONDITIONAL(NSI_BUILD, test $dll_path = no)
379

380 381 382 383 384 385
if test $dll_path != no; then
NSI_DLL_DIR=$dll_path
fi
AC_SUBST(NSI_DLL_DIR)

AC_PATH_PROG(NSIS, makensis, [], [$PATH])
386 387


388 389
## Sam's Install Kludge-work
#CPPFLAGS="$CPPFLAGS -DDATA_PREFIX=\\\"\$(prefix)\\\""
390

391 392 393
# ---------------------------------------------------------------
# Create Makefiles
# ---------------------------------------------------------------
394

395 396
AC_CONFIG_FILES([Makefile
tuxtype.spec
397
tuxtype_preview.spec
398 399
data/Makefile
data/fonts/Makefile
400
data/im/Makefile
401 402 403 404 405 406 407 408 409 410 411 412 413 414 415
data/images/Makefile
data/images/backgrounds/Makefile
data/images/cities/Makefile
data/images/comets/Makefile
data/images/hands/Makefile
data/images/icons/Makefile
data/images/keyboard/Makefile
data/images/menu/Makefile
data/images/status/Makefile
data/images/tux/Makefile
data/scripts/Makefile
data/sounds/Makefile
data/themes/Makefile
data/themes/armenian/Makefile
data/themes/armenian/images/Makefile
416 417
data/themes/assamese/Makefile
data/themes/assamese/words/Makefile
Seungwon Jeong's avatar
Seungwon Jeong committed
418 419 420 421
data/themes/asturian/Makefile
data/themes/asturian/images/Makefile
data/themes/asturian/scripts/Makefile
data/themes/asturian/words/Makefile
422 423
data/themes/belarussian/Makefile
data/themes/belarussian/words/Makefile
424 425 426 427 428 429 430
data/themes/bokmal/Makefile
data/themes/bokmal/words/Makefile
data/themes/bokmal/images/Makefile
data/themes/bokmal/images/status/Makefile
data/themes/brazilian-portuguese/Makefile
data/themes/brazilian-portuguese/images/Makefile
data/themes/brazilian-portuguese/words/Makefile
David Bruce's avatar
David Bruce committed
431 432 433
data/themes/bulgarian/Makefile
data/themes/bulgarian/words/Makefile
data/themes/bulgarian/scripts/Makefile
434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450
data/themes/catalan/Makefile
data/themes/catalan/words/Makefile
data/themes/czech/Makefile
data/themes/czech/words/Makefile
data/themes/dansk/Makefile
data/themes/dansk/sounds/Makefile
data/themes/dansk/words/Makefile
data/themes/deutsch/Makefile
data/themes/deutsch/words/Makefile
data/themes/espanol/Makefile
data/themes/espanol/images/Makefile
data/themes/espanol/words/Makefile
data/themes/euskara/Makefile
data/themes/euskara/images/Makefile
data/themes/euskara/words/Makefile
data/themes/french/Makefile
data/themes/french/words/Makefile
451
data/themes/french/scripts/Makefile
452 453
data/themes/greek/Makefile
data/themes/greek/words/Makefile
454
data/themes/greek/scripts/Makefile
455 456
data/themes/gujarati/Makefile
data/themes/gujarati/words/Makefile
David Bruce's avatar
David Bruce committed
457 458
data/themes/hebrew/Makefile
data/themes/hebrew/words/Makefile
459 460
data/themes/hindi/Makefile
data/themes/hindi/words/Makefile
461 462 463 464
data/themes/hungarian/Makefile
data/themes/hungarian/images/Makefile
data/themes/hungarian/scripts/Makefile
data/themes/hungarian/words/Makefile
465 466 467 468 469 470
data/themes/italian/Makefile
data/themes/italian/images/Makefile
data/themes/italian/words/Makefile
data/themes/jamaican/Makefile
data/themes/jamaican/images/Makefile
data/themes/jamaican/words/Makefile
471 472
data/themes/kannada/Makefile
data/themes/kannada/words/Makefile
Seungwon Jeong's avatar
Seungwon Jeong committed
473
data/themes/korean/Makefile
Seungwon Jeong's avatar
Seungwon Jeong committed
474
data/themes/korean/images/Makefile
Seungwon Jeong's avatar
Seungwon Jeong committed
475
data/themes/korean/words/Makefile
476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494
data/themes/lithuanian/Makefile
data/themes/lithuanian/images/Makefile
data/themes/lithuanian/images/status/Makefile
data/themes/lithuanian/sounds/Makefile
data/themes/lithuanian/words/Makefile
data/themes/malayalam/Makefile
data/themes/malayalam/images/Makefile
data/themes/malayalam/images/status/Makefile
data/themes/malayalam/images/keyboard/Makefile
data/themes/malayalam/scripts/Makefile
data/themes/malayalam/words/Makefile
data/themes/nederlands/Makefile
data/themes/nederlands/words/Makefile
data/themes/nepali/Makefile
data/themes/nepali/words/Makefile
data/themes/nynorsk/Makefile
data/themes/nynorsk/images/Makefile
data/themes/nynorsk/images/status/Makefile
data/themes/nynorsk/words/Makefile
495 496
data/themes/oriya/Makefile
data/themes/oriya/words/Makefile
David Bruce's avatar
David Bruce committed
497 498
data/themes/punjabi/Makefile
data/themes/punjabi/words/Makefile
David Bruce's avatar
David Bruce committed
499 500
data/themes/romanian/Makefile
data/themes/romanian/words/Makefile
501 502 503 504
data/themes/russian/Makefile
data/themes/russian/images/Makefile
data/themes/russian/images/status/Makefile
data/themes/russian/words/Makefile
dbruce-guest's avatar
dbruce-guest committed
505 506
data/themes/suomi/Makefile
data/themes/suomi/words/Makefile
507 508 509 510
data/themes/svenska/Makefile
data/themes/svenska/words/Makefile
data/themes/swahili/Makefile
data/themes/swahili/words/Makefile
511 512 513 514
data/themes/tamil/Makefile
data/themes/tamil/words/Makefile
data/themes/telugu/Makefile
data/themes/telugu/words/Makefile
515 516
data/themes/thai/Makefile
data/themes/thai/words/Makefile
David Bruce's avatar
David Bruce committed
517 518
data/themes/ukrainian/Makefile
data/themes/ukrainian/words/Makefile
519 520 521 522 523 524
data/themes/wolof/Makefile
data/themes/wolof/images/Makefile
data/themes/wolof/words/Makefile
data/words/Makefile
doc/Makefile
doc/en/Makefile
525 526
po/Makefile.in
nsis/tuxtype.nsi
527
src/Makefile])
528 529

AC_OUTPUT