1
dnl Process this file with autoconf to produce a configure script.
3
AC_INIT(src/gcompris/gcompris.c)
5
AM_INIT_AUTOMAKE(gcompris, 8.4.12)
6
AM_CONFIG_HEADER(config.h)
9
dnl libtool versioning from libgnome
16
dnl Start of pkg-config checks
21
PKG_CHECK_MODULES(GCOMPRIS, dnl
22
[gtk+-2.0 >= $GTK_REQUIRED dnl
25
AC_SUBST(GCOMPRIS_CFLAGS)
26
AC_SUBST(GCOMPRIS_LIBS)
46
AC_MSG_CHECKING([for OSX])
50
OSX_CFLAGS="$CFLAGS -arch i386 -arch ppc "
57
AC_MSG_RESULT([$native_osx])
59
AM_CONDITIONAL(OS_MACOSX, test "$native_osx" = yes)
61
# nsbundle default is no even for osx
64
AC_ARG_ENABLE(nsbundle,
67
[Turn on nsbundle packaging (needs Cocoa/GNUstep)]),
68
nsbundle="$enableval", nsbundle="no")
74
#check header for nsbundle
75
if test "x$nsbundle" = "xyes"; then
79
if test "x$native_osx" = "xyes"; then
80
AC_LANG_PUSH([Objective C])
81
AC_CHECK_HEADER(Foundation/Foundation.h, NSFoundation="yes" , NSFoundation="no")
82
if test "x$NSFoundation" = "x$no"; then
83
AC_MSG_ERROR([You need development tools to use nsbundle. Make sure XCode is installed." ])
85
NSBUNDLE_GTK_DIR="/../GTK"
86
NSBUNDLE_LDFLAGS="-framework Cocoa "
87
OBJCFLAGS="$OBJCFLAGS $CFLAGS"
88
AC_LANG_POP([Objective C])
90
AC_LANG_PUSH([Objective C])
91
saved_CPPFLAGS="$CPPFLAGS"
92
if test "x$GNUSTEP_SYSTEM_ROOT" != "x"; then
93
CPPFLAGS="$CPPFLAGS -I$GNUSTEP_SYSTEM_ROOT/Library/Headers "
95
AC_CHECK_HEADER(Foundation/Foundation.h, NSFoundation="yes" , NSFoundation="no")
96
if test "x$NSFoundation" = "xno"; then
97
AC_MSG_ERROR([You need GNUstep dev to use nsbundle. Make sure GNUSTEP_SYSTEM_ROOT is set." ])
99
CPPFLAGS="$saved_CPPFLAGS"
100
OBJCFLAGS="$OBJCFLAGS $CFLAGS -DGNUSTEP -DGNUSTEP_BASE_LIBRARY=1 -DGNU_GUI_LIBRARY=1 -DGNU_RUNTIME=1 -DGNUSTEP_BASE_LIBRARY=1 -fconstant-string-class=NSConstantString -I$GNUSTEP_SYSTEM_ROOT/Library/Headers "
101
NSBUNDLE_GTK_DIR="/GTK"
102
NSBUNDLE_LDFLAGS="-rdynamic -fgnu-runtime -L$GNUSTEP_SYSTEM_ROOT/Library/Libraries -lgnustep-base -lgnustep-gui -Wl,-rpath=\\\$\$ORIGIN/$NSBUNDLE_GTK_DIR/lib "
103
AC_LANG_POP([Objective C])
105
AC_DEFINE_UNQUOTED(NSBUNDLE, 1, [ Define to 1 to use NSBundle for relocation (OSX/GNUstep) ])
106
AC_DEFINE_UNQUOTED(NSBUNDLE_GTK_DIR, "$NSBUNDLE_GTK_DIR", [ Define to 1 to use NSBundle for relocation (OSX/GNUstep) ])
112
_AM_DEPENDENCIES([OBJC])
114
AC_SUBST(NSBUNDLE_CPPFLAGS)
115
AC_SUBST(NSBUNDLE_LDFLAGS)
116
AC_SUBST(NSBUNDLE_GTK_DIR)
118
# Todo: add a AC_ARG_WITH to allow change.
122
nsbundledir=$(pwd)"/$bundlename.app"
123
BUNDLE_APPDIR="$nsbundledir"
124
BUNDLE_NAME="$bundlename"
125
AC_SUBST(BUNDLE_APPDIR)
126
AC_SUBST(BUNDLE_NAME)
128
AM_CONDITIONAL(WITH_NSBUNDLE, test "$nsbundle" = yes)
131
# Provide relocatable API from autopackage
132
# From http://autopackage.org/docs/binreloc/
134
if test x"$nsbundle" = "xyes" ; then
136
AC_MSG_NOTICE([binreloc disabled by nsbundle])
141
dnl GNOME2 GNOME_X_CHECKS
145
PKG_CHECK_MODULES(XML, libxml-2.0)
149
dnl Freetype2 flags (needed for libgnomecanvas)
150
PKG_CHECK_MODULES(FT2, freetype2)
154
AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
156
dnl XF86VidMode allows us to set the screen resolution dynamically
160
if test "x$x_libraries" != "x"; then
161
XLIBADD=" -L$x_libraries "
164
AC_ARG_ENABLE(xf86vidmode,
166
[--disable-xf86vidmode],
167
[Turn off xf86vidmode]),
168
USE_XF86VM="$enableval", USE_XF86VM="yes")
170
if test "x$USE_XF86VM" == "xyes" ; then
172
AC_CHECK_LIB(Xxf86vm, XF86VidModeQueryExtension,
173
[AC_CHECK_HEADER(X11/extensions/xf86vmode.h,
174
XF86VM_LIBS="$XLIBADD -lXxf86vm" found_xf86vidmode=yes,,
175
[#include <X11/Xlib.h>])],
176
, $XLIBADD $ALL_X_LIBS )
178
if test "x$found_xf86vidmode" = "xno"; then
179
AC_MSG_NOTICE(["Suitable XF86VidMode extension library not found - Will not use xf86vidmode for fullscreen."])
181
AC_DEFINE_UNQUOTED(XF86_VIDMODE, 1, [XF86VidMode Available])
185
AC_SUBST(XF86VM_LIBS)
187
dnl Add the languages which your application supports here.
188
ALL_LINGUAS="af am ar ar_TN az bg br ca cs da de dz el en_CA en_GB es et eu fa fi fr ga gl gu he hi hr hu id it ja ka ko lt mk ml mr ms nb ne nl nn oc pa pl pt pt_BR ro ru rw sk sl so sq sr sr@Latn sv ta th tr uk ur vi wa zh_CN zh_TW"
190
dnl GCompris needs to know which locale are supported
191
AC_SUBST(ALL_LINGUAS)
192
AC_DEFINE_UNQUOTED(ALL_LINGUAS, "${ALL_LINGUAS}", [Supported languages])
194
GETTEXT_PACKAGE=gcompris
195
AC_SUBST(GETTEXT_PACKAGE)
199
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package name])
201
BUILD_DATE=`date +%y%m`
202
AC_DEFINE_UNQUOTED(BUILD_DATE,"$BUILD_DATE", [Date at which GCompris has been built])
205
dnl Define myprefix depending on wether our user gives us one or not
206
if test "x${prefix}" = "xNONE"; then
207
myprefix=${ac_default_prefix}
212
dnl Define myprefix depending on wether our user gives us one or not
213
dnl This is needed for $libdir !
214
if test "x${exec_prefix}" = "xNONE"; then
215
exec_prefix=${myprefix}
220
dnl Some debug option
224
[Turn on debugging messages]),
225
USE_DEBUG="$enableval", USE_DEBUG="no")
226
if test "x$USE_DEBUG" == "xyes" ; then
227
AC_DEFINE_UNQUOTED(DEBUG, 1, "Enable debug messages.")
228
CFLAGS="$CFLAGS $OSX_CFLAGS -Wall -Werror -g"
230
CFLAGS="$CFLAGS $OSX_CFLAGS -Wall -Werror"
234
AC_MSG_CHECKING([for native Win32])
243
AC_MSG_RESULT([$native_win32])
244
AM_CONDITIONAL(OS_WIN32, test "$native_win32" = yes)
246
AC_MSG_CHECKING([for Win32 platform in general])
248
*-*-mingw*|*-*-cygwin*)
255
AC_MSG_RESULT($platform_win32)
256
AM_CONDITIONAL(PLATFORM_WIN32, test "$platform_win32" = yes)
258
# Ensure MSVC-compatible struct packing convention is used when
259
# compiling for Win32 with gcc. GTK+ uses this convention, so we must, too.
260
# What flag to depends on gcc version: gcc3 uses "-mms-bitfields", while
261
# gcc2 uses "-fnative-struct".
262
if test x"$native_win32" = xyes; then
263
if test x"$GCC" = xyes; then
265
AC_MSG_CHECKING([how to get MSVC-compatible struct packing])
266
if test -z "$ac_cv_prog_CC"; then
269
our_gcc="$ac_cv_prog_CC"
271
case `$our_gcc --version | sed -e 's,\..*,.,' -e q` in
273
if $our_gcc -v --help 2>/dev/null | grep fnative-struct >/dev/null; then
274
msnative_struct='-fnative-struct'
278
if $our_gcc -v --help 2>/dev/null | grep ms-bitfields >/dev/null; then
279
msnative_struct='-mms-bitfields'
283
if test x"$msnative_struct" = x ; then
284
AC_MSG_RESULT([no way])
285
AC_MSG_WARN([produced libraries will be incompatible with prebuilt GTK+ DLLs])
287
CFLAGS="$CFLAGS $msnative_struct"
288
AC_MSG_RESULT([${msnative_struct}])
294
dnl === DIRECTORY DEFINITIONS ===
297
if test "x$platform_win32" = "xno" ; then
299
dnl Set PACKAGE_LOCALE_DIR in config.h.
300
AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "${myprefix}/${DATADIRNAME}/locale", [GCompris locale directory])
302
dnl Set PACKAGE_DATA_DIR
303
PACKAGE_DATA_DIR="boards"
304
AC_SUBST(PACKAGE_DATA_DIR)
305
AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${myprefix}/${DATADIRNAME}", [GCompris data directory])
307
dnl Set PACKAGE_HELP_DIR
308
PACKAGE_HELP_DIR="${myprefix}/${DATADIRNAME}/${PACKAGE}/help"
309
AC_SUBST(PACKAGE_HELP_DIR)
312
my_libdir=`eval echo "${libdir}"`
313
AC_DEFINE_UNQUOTED(PACKAGE_CLIB_DIR, "${my_libdir}", [Gcompris plugins directory])
314
plugindir=$libdir/gcompris
317
dnl Python plugin Directory
318
PYTHON_PLUGIN_DIR="${myprefix}/${DATADIRNAME}/${PACKAGE}/python"
319
AC_SUBST(PYTHON_PLUGIN_DIR)
321
dnl System GCompris config directory
322
AC_DEFINE_UNQUOTED(SYSTEM_CONFIG_DIR, "/etc", [System GCompris config directory])
327
dnl Set PACKAGE_LOCALE_DIR in config.h for WINDOWS
328
AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "../${DATADIRNAME}/locale", [GCompris locale directory])
330
dnl Set PACKAGE_DATA_DIR
331
PACKAGE_DATA_DIR="boards"
332
AC_SUBST(PACKAGE_DATA_DIR)
333
AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "../${DATADIRNAME}", [GCompris data directory])
335
dnl Set PACKAGE_HELP_DIR
336
PACKAGE_HELP_DIR="${myprefix}/${DATADIRNAME}/gnome/help/gcompris"
337
AC_SUBST(PACKAGE_HELP_DIR)
340
AC_DEFINE_UNQUOTED(PACKAGE_CLIB_DIR, "../${DATADIRNAME}", [Gcompris plugins directory])
341
plugindir=${myprefix}/${DATADIRNAME}/gcompris
344
dnl Python plugin Directory
345
PYTHON_PLUGIN_DIR="${myprefix}/${DATADIRNAME}/gcompris/python"
346
AC_SUBST(PYTHON_PLUGIN_DIR)
350
dnl Test for gnuchess
351
AC_PATH_PROGS(GNUCHESS, gnuchess gnome-gnuchess, no, [/usr/bin:/usr/games:/usr/local/bin:$PATH])
353
if test x$GNUCHESS = xno; then
354
AC_MSG_ERROR(Couldn't find gnuchess, please install the gnuchess package version 5 or above)
356
AC_DEFINE_UNQUOTED(GNUCHESS, "$GNUCHESS", Defines where GNU Chess resides on the system)
358
AC_PATH_PROG(TEXINFO, makeinfo,no)
359
if test x$TEXINFO = xno; then
360
AC_MSG_WARN(Couldn't find texinfo, docs are not compiled. please install the texinfo package)
362
AM_CONDITIONAL(TEXINFO, test x$TEXINFO != xno)
364
AC_PATH_PROG(TETEX, texi2html,no)
365
if test x$TETEX = xno; then
366
AC_MSG_WARN(Couldn't find texi2html usualy in the tetex package, please install it)
371
AC_MSG_CHECKING([wether we build with GNET (if not, networking will be disabled)])
375
[Turn off gnet (will not let GCompris fetch content from a web server)]),
376
with_gnet="$enableval", with_gnet="yes")
377
AC_MSG_RESULT($with_gnet)
379
if test x$with_gnet = xyes; then
380
PKG_CHECK_MODULES(GNET, gnet-2.0,, AC_MSG_ERROR([*** GNET not found!]))
381
AC_DEFINE([USE_GNET], 1,[Networking is enabled])
385
AC_MSG_CHECKING([wether we build with SQLITE (if not profile will be disabled)])
386
AC_ARG_ENABLE(sqlite,
389
[Turn off sqlite (will disable profile)]),
390
with_sqlite="$enableval", with_sqlite="yes")
391
AC_MSG_RESULT($with_sqlite)
394
AC_ARG_WITH(python,AC_HELP_STRING(
395
[--with-python=path],
396
[set the path for python]), python_path=$withval, python_path=not)
397
if test x$python_path = xno ; then
398
build_python_plugin="no"
402
if test x$python_path != xnot ; then
407
AM_CHECK_PYTHON_HEADERS( [build_python_plugin="yes"], [build_python_plugin="no"] )
411
dnl Finally output the required python variables and automake defines.
412
AM_CONDITIONAL(PYTHON_PLUGIN, test x$build_python_plugin = xyes)
414
dnl build only support
415
AC_ARG_ENABLE(py-build-only,
417
[--enable-py-build-only],
418
[Skip python modules tests. (Useful if you just need build)]),
419
py_build_only="$enableval", py_build_only="no")
422
if test x$build_python_plugin = xno; then
423
AC_MSG_NOTICE([Python plugin is disabled.])
425
dnl Python interpreter is available so check for pygtk
426
PKG_CHECK_MODULES(PYGTK, pygtk-2.0)
428
AC_MSG_CHECKING([for pygtk defs])
429
PYGTK_DEFSDIR=`$PKG_CONFIG --variable=defsdir pygtk-2.0`
430
AC_MSG_RESULT([$PYGTK_DEFSDIR])
432
AC_MSG_CHECKING([for pygtk codegen])
433
PYGTK_CODEGEN="$PYTHON `$PKG_CONFIG --variable=codegendir pygtk-2.0`/codegen.py"
434
AC_MSG_RESULT([$PYGTK_CODEGEN])
436
AC_MSG_CHECKING([for pygtk h2def])
437
PYGTK_H2DEF="$PYTHON `$PKG_CONFIG --variable=codegendir pygtk-2.0`/h2def.py"
438
AC_MSG_RESULT([$PYGTK_H2DEF])
440
AC_SUBST([PYGTK_DEFSDIR])
441
AC_SUBST([PYGTK_CODEGEN])
442
AC_SUBST([PYGTK_H2DEF])
444
if test x$py_build_only = xno; then
445
AM_CHECK_PYMOD(gtk,,,AC_MSG_ERROR([*** pygtk installed but not visible from python ]))
446
dnl AM_CHECK_PYMOD(xml.dom.DOMImplementation,,,AC_MSG_WARN([*** pyxml missing ]))
448
dnl Set this variable for the .spec.in file
449
REQUIRE_PYTHON="python pygtk2.0"
451
dnl with gnome-python >= 2.10 gnome.canvas is obsolete. use gnomecanvas
452
dnl gnomecanvas not supported yet in gcompris
454
dnl AM_CHECK_PYMOD(gnome.canvas,,test_gnomecanvas="no",test_gnomevanvas="yes")
455
dnl if test x$test_gnomecanvas = xyes ; then
456
dnl AM_CHECK_PYMOD(gnomecanvas,,,AC_MSG_ERROR([*** gnome.canvas or gnomecanvas installed but not visible from python ]))
459
if test x$with_sqlite = xyes; then
460
AM_CHECK_PYMOD(pysqlite2,,,AC_MSG_ERROR([*** pysqlite2 missing ]))
461
REQUIRE_PYTHON="$REQUIRE_PYTHON python-sqlite2"
465
AC_MSG_WARN([py-build-only: Skipping python modules dependancies])
466
AC_MSG_WARN([py-build-only: Do not forget to install pygtk, pysqlite2])
471
if test x$with_sqlite = xyes; then
472
PKG_CHECK_MODULES(SQLITE3, sqlite3,, AC_MSG_ERROR([*** SQLITE3 not found!]))
473
AC_DEFINE([USE_SQLITE], 1,[SQLITE Database, Profiles are enabled])
476
AM_CONDITIONAL(USE_SQLITE, test x$with_sqlite = xyes)
477
AC_SUBST(SQLITE3_CFLAGS)
478
AC_SUBST(SQLITE3_LIBS)
480
AC_SUBST(REQUIRE_PYTHON)
482
dnl mingw32 specific stuff.
484
dnl define __GW32__ and WIN32
486
# Check platform - see if WinMain needed:
487
AC_MSG_CHECKING([for native Win32])
496
AC_MSG_RESULT([$native_win32])
498
AM_CONDITIONAL(BUILD_MINGW32, test "$native_win32" = yes)
499
if test "$native_win32" = yes; then
500
LIBS="$LIBS -luuid -lole32 -lwsock32 -mno-cygwin -mms-bitfields -mwindows -mconsole"
501
#CFLAGS="$CFLAGS -D__GW32__ -DWIN32 -I$CROSS_ROOT/include -I$CROSS_ROOT/include/glibc"
502
#CFLAGS="$CFLAGS -DWIN32"
508
dnl disable activation code
509
AC_ARG_ENABLE(activation-code,
511
[--disable-activation-code],
512
[For Windows version, disable the activation code]),
513
activation_code="$enableval", activation_code="yes")
515
if test x$activation_code = xno; then
516
AC_DEFINE([DISABLE_ACTIVATION_CODE], 1,[Activation code is disabled])
521
#PKG_CHECK_MODULES(MYPAINT,[
527
AC_OUTPUT([ Makefile.mingw
529
gcompris-installer.nsi
532
autopackage/default.apspec
534
src/gcompris/Makefile
536
src/boards/python/Makefile
537
src/boards/python/gcompris/Makefile
538
src/boards/python/gcompris/admin/Makefile
539
src/boards/python/gcompris/anim/Makefile
540
src/boards/python/gcompris/bonus/Makefile
541
src/boards/python/gcompris/score/Makefile
542
src/boards/python/gcompris/skin/Makefile
543
src/boards/python/gcompris/sound/Makefile
544
src/boards/python/gcompris/timer/Makefile
545
src/boards/python/gcompris/utils/Makefile
546
src/boards/python/connect4p/Makefile
547
src/boards/python/admin/Makefile
548
src/libart_lgpl/Makefile
549
src/libgnomecanvas/Makefile
556
boards/advanced_colors/Makefile
557
boards/babymatch/Makefile
558
boards/babyshapes/Makefile
559
boards/chronos/Makefile
560
boards/doubleentry/Makefile
561
boards/gcompris/Makefile
562
boards/gcompris/mimetypes/Makefile
563
boards/geography/Makefile
564
boards/geography_country/Makefile
565
boards/imageid/Makefile
566
boards/imagename/Makefile
567
boards/missing_letter/Makefile
568
boards/paintings/Makefile
569
boards/read_colors/Makefile
574
echo "***************************************************"
576
echo configure complete,
579
echo "Force python (--enable-py-build-only) = $py_build_only"
580
echo "Python plugin = $build_python_plugin"
582
echo "XF86VM option (--enable-xf86vidmode) = $found_xf86vidmode"
584
echo "SQLITE database (--enable-sqlite) = $with_sqlite (profiles depend on this)"
586
echo "GNET Networking (--enable-gnet) = $with_gnet (networking depends on this)"
587
echo "BINRELOC (--enable-binreloc) = $br_cv_binreloc"
588
echo "NSBundle (--enable-nsbundle) = $nsbundle"
592
echo gcompris will be installed in ${prefix}
593
echo to compile and install in in another directory
594
echo type sh configure --prefix=/usr
596
echo type \'make\' to compile gcompris
597
echo type \'make install\' to install it