dnl Process this file with autoconf to produce a configure script. AC_INIT(src/gcompris/gcompris.c) AC_CANONICAL_HOST AM_INIT_AUTOMAKE(gcompris, 8.4.13) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE dnl libtool versioning from libgnome AC_ISC_POSIX GTK_REQUIRED=2.4.0 dnl dnl Start of pkg-config checks dnl PKG_PROG_PKG_CONFIG() PKG_CHECK_MODULES(GCOMPRIS, dnl [gtk+-2.0 >= $GTK_REQUIRED]) AC_SUBST(GCOMPRIS_CFLAGS) AC_SUBST(GCOMPRIS_LIBS) AC_HEADER_DIRENT AC_PROG_CC AM_PROG_CC_STDC AM_PROG_CC_C_O AC_HEADER_STDC AC_PROG_INTLTOOL AM_DISABLE_STATIC AC_LIBTOOL_WIN32_DLL AM_PROG_LIBTOOL dnl for libart_lgpl AC_FUNC_ALLOCA AC_C_BIGENDIAN dnl OSX Specifics AC_MSG_CHECKING([for OSX]) case "$host" in *-apple-darwin*) native_osx=yes OSX_CFLAGS="$CFLAGS -arch i386 -arch ppc " ;; *) native_osx=no OSX_CFLAGS="" ;; esac AC_MSG_RESULT([$native_osx]) AM_CONDITIONAL(OS_MACOSX, test "$native_osx" = yes) # nsbundle default is no even for osx nsbundle="no" AC_ARG_ENABLE(nsbundle, AC_HELP_STRING( [--enable-nsbundle], [Turn on nsbundle packaging (needs Cocoa/GNUstep)]), nsbundle="$enableval", nsbundle="no") NSBUNDLE_CPPFLAGS= NSBUNDLE_LDFLAGS= NSBUNDLE_GTK_DIR= #check header for nsbundle if test "x$nsbundle" = "xyes"; then AC_PROG_OBJC([gcc]) AC_PROG_OBJCPP([gcc]) if test "x$native_osx" = "xyes"; then AC_LANG_PUSH([Objective C]) AC_CHECK_HEADER(Foundation/Foundation.h, NSFoundation="yes" , NSFoundation="no") if test "x$NSFoundation" = "x$no"; then AC_MSG_ERROR([You need development tools to use nsbundle. Make sure XCode is installed." ]) fi NSBUNDLE_GTK_DIR="/../GTK" NSBUNDLE_LDFLAGS="-framework Cocoa " OBJCFLAGS="$OBJCFLAGS $CFLAGS" AC_LANG_POP([Objective C]) else AC_LANG_PUSH([Objective C]) saved_CPPFLAGS="$CPPFLAGS" if test "x$GNUSTEP_SYSTEM_ROOT" != "x"; then CPPFLAGS="$CPPFLAGS -I$GNUSTEP_SYSTEM_ROOT/Library/Headers " fi AC_CHECK_HEADER(Foundation/Foundation.h, NSFoundation="yes" , NSFoundation="no") if test "x$NSFoundation" = "xno"; then AC_MSG_ERROR([You need GNUstep dev to use nsbundle. Make sure GNUSTEP_SYSTEM_ROOT is set." ]) fi CPPFLAGS="$saved_CPPFLAGS" 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 " NSBUNDLE_GTK_DIR="/GTK" NSBUNDLE_LDFLAGS="-rdynamic -fgnu-runtime -L$GNUSTEP_SYSTEM_ROOT/Library/Libraries -lgnustep-base -lgnustep-gui -Wl,-rpath=\\\$\$ORIGIN/$NSBUNDLE_GTK_DIR/lib " AC_LANG_POP([Objective C]) fi AC_DEFINE_UNQUOTED(NSBUNDLE, 1, [ Define to 1 to use NSBundle for relocation (OSX/GNUstep) ]) AC_DEFINE_UNQUOTED(NSBUNDLE_GTK_DIR, "$NSBUNDLE_GTK_DIR", [ Define to 1 to use NSBundle for relocation (OSX/GNUstep) ]) else OBJC=$CC AC_SUBST(OBJC) fi _AM_DEPENDENCIES([OBJC]) AC_SUBST(NSBUNDLE_CPPFLAGS) AC_SUBST(NSBUNDLE_LDFLAGS) AC_SUBST(NSBUNDLE_GTK_DIR) # Todo: add a AC_ARG_WITH to allow change. bundlename=GCompris nsbundledir=$(pwd)"/$bundlename.app" BUNDLE_APPDIR="$nsbundledir" BUNDLE_NAME="$bundlename" AC_SUBST(BUNDLE_APPDIR) AC_SUBST(BUNDLE_NAME) AM_CONDITIONAL(WITH_NSBUNDLE, test "$nsbundle" = yes) # Provide relocatable API from autopackage # From http://autopackage.org/docs/binreloc/ enable_binreloc=auto if test x"$nsbundle" = "xyes" ; then enable_binreloc=no AC_MSG_NOTICE([binreloc disabled by nsbundle]) fi AM_BINRELOC dnl GNOME2 GNOME_X_CHECKS AM_PATH_GLIB_2_0 dnl libxml-2 Checks PKG_CHECK_MODULES(XML, libxml-2.0) AC_SUBST(XML_CFLAGS) AC_SUBST(XML_LIBS) dnl Freetype2 flags (needed for libgnomecanvas) PKG_CHECK_MODULES(FT2, freetype2) AC_SUBST(FT2_CFLAGS) dnl glib-genmarshal AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal) dnl XF86VidMode allows us to set the screen resolution dynamically AC_PATH_X XLIBADD= if test "x$x_libraries" != "x"; then XLIBADD=" -L$x_libraries " fi AC_ARG_ENABLE(xf86vidmode, AC_HELP_STRING( [--disable-xf86vidmode], [Turn off xf86vidmode]), USE_XF86VM="$enableval", USE_XF86VM="yes") found_xf86vidmode=no if test "x$USE_XF86VM" == "xyes" ; then XF86VM_LIBS= AC_CHECK_LIB(Xxf86vm, XF86VidModeQueryExtension, [AC_CHECK_HEADER(X11/extensions/xf86vmode.h, XF86VM_LIBS="$XLIBADD -lXxf86vm" found_xf86vidmode=yes,, [#include ])], , $XLIBADD $ALL_X_LIBS ) if test "x$found_xf86vidmode" = "xno"; then AC_MSG_NOTICE(["Suitable XF86VidMode extension library not found - Will not use xf86vidmode for fullscreen."]) else AC_DEFINE_UNQUOTED(XF86_VIDMODE, 1, [XF86VidMode Available]) fi fi AC_SUBST(XF86VM_LIBS) dnl Add the languages which your application supports here. ALL_LINGUAS="af am ar az bg br ca cs da de dz el en_CA en_GB eo 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" dnl GCompris needs to know which locale are supported AC_SUBST(ALL_LINGUAS) AC_DEFINE_UNQUOTED(ALL_LINGUAS, "${ALL_LINGUAS}", [Supported languages]) GETTEXT_PACKAGE=gcompris AC_SUBST(GETTEXT_PACKAGE) AM_GLIB_GNU_GETTEXT AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package name]) BUILD_DATE=`date +%y%m` AC_DEFINE_UNQUOTED(BUILD_DATE,"$BUILD_DATE", [Date at which GCompris has been built]) AC_SUBST(BUILD_DATE) dnl Define myprefix depending on wether our user gives us one or not if test "x${prefix}" = "xNONE"; then myprefix=${ac_default_prefix} else myprefix=${prefix} fi dnl Define myprefix depending on wether our user gives us one or not dnl This is needed for $libdir ! if test "x${exec_prefix}" = "xNONE"; then exec_prefix=${myprefix} fi dnl Some debug option AC_ARG_ENABLE(debug, AC_HELP_STRING( [--enable-debug], [Turn on debugging messages]), USE_DEBUG="$enableval", USE_DEBUG="no") if test "x$USE_DEBUG" == "xyes" ; then AC_DEFINE_UNQUOTED(DEBUG, 1, "Enable debug messages.") CFLAGS="$CFLAGS $OSX_CFLAGS -Wall -Werror -g" else CFLAGS="$CFLAGS $OSX_CFLAGS -Wall -Werror" fi dnl WIN32 Specifics AC_MSG_CHECKING([for Win32 platform in general]) case "$host" in *-*-mingw*|*-*-cygwin*) platform_win32=yes ;; *) platform_win32=no ;; esac AC_MSG_RESULT($platform_win32) AM_CONDITIONAL(PLATFORM_WIN32, test "$platform_win32" = yes) AM_CONDITIONAL(BUILD_MINGW32, test "$platform_win32" = yes) if test x"$platform_win32" = xyes; then LIBS="$LIBS -luuid -lole32 -lwsock32 -mno-cygwin -mms-bitfields -mwindows -mconsole" #CFLAGS="$CFLAGS -D__GW32__ -DWIN32 -I$CROSS_ROOT/include -I$CROSS_ROOT/include/glibc" #CFLAGS="$CFLAGS -DWIN32" fi # Ensure MSVC-compatible struct packing convention is used when # compiling for Win32 with gcc. GTK+ uses this convention, so we must, too. # What flag to depends on gcc version: gcc3 uses "-mms-bitfields", while # gcc2 uses "-fnative-struct". if test x"$native_win32" = xyes; then if test x"$GCC" = xyes; then msnative_struct='' AC_MSG_CHECKING([how to get MSVC-compatible struct packing]) if test -z "$ac_cv_prog_CC"; then our_gcc="$CC" else our_gcc="$ac_cv_prog_CC" fi case `$our_gcc --version | sed -e 's,\..*,.,' -e q` in 2.) if $our_gcc -v --help 2>/dev/null | grep fnative-struct >/dev/null; then msnative_struct='-fnative-struct' fi ;; *) if $our_gcc -v --help 2>/dev/null | grep ms-bitfields >/dev/null; then msnative_struct='-mms-bitfields' fi ;; esac if test x"$msnative_struct" = x ; then AC_MSG_RESULT([no way]) AC_MSG_WARN([produced libraries will be incompatible with prebuilt GTK+ DLLs]) else CFLAGS="$CFLAGS $msnative_struct" AC_MSG_RESULT([${msnative_struct}]) fi fi fi dnl dnl === DIRECTORY DEFINITIONS === dnl if test "x$platform_win32" = "xno" ; then dnl Set PACKAGE_LOCALE_DIR in config.h. AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "${myprefix}/${DATADIRNAME}/locale", [GCompris locale directory]) dnl Set PACKAGE_DATA_DIR PACKAGE_DATA_DIR="boards" AC_SUBST(PACKAGE_DATA_DIR) AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${myprefix}/${DATADIRNAME}", [GCompris data directory]) dnl Set PACKAGE_HELP_DIR PACKAGE_HELP_DIR="${myprefix}/${DATADIRNAME}/${PACKAGE}/help" AC_SUBST(PACKAGE_HELP_DIR) dnl Plugin Directory my_libdir=`eval echo "${libdir}"` AC_DEFINE_UNQUOTED(PACKAGE_CLIB_DIR, "${my_libdir}", [Gcompris plugins directory]) plugindir=$libdir/gcompris AC_SUBST(plugindir) dnl Python plugin Directory PYTHON_PLUGIN_DIR="${myprefix}/${DATADIRNAME}/${PACKAGE}/python" AC_SUBST(PYTHON_PLUGIN_DIR) dnl System GCompris config directory AC_DEFINE_UNQUOTED(SYSTEM_CONFIG_DIR, "/etc", [System GCompris config directory]) else DATADIRNAME="share" dnl Set PACKAGE_LOCALE_DIR in config.h for WINDOWS AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "../${DATADIRNAME}/locale", [GCompris locale directory]) dnl Set PACKAGE_DATA_DIR PACKAGE_DATA_DIR="boards" AC_SUBST(PACKAGE_DATA_DIR) AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "../${DATADIRNAME}", [GCompris data directory]) dnl Set PACKAGE_HELP_DIR PACKAGE_HELP_DIR="${myprefix}/${DATADIRNAME}/gnome/help/gcompris" AC_SUBST(PACKAGE_HELP_DIR) dnl Plugin Directory AC_DEFINE_UNQUOTED(PACKAGE_CLIB_DIR, "../${DATADIRNAME}", [Gcompris plugins directory]) plugindir=${myprefix}/${DATADIRNAME}/gcompris AC_SUBST(plugindir) dnl Python plugin Directory PYTHON_PLUGIN_DIR="${myprefix}/${DATADIRNAME}/gcompris/python" AC_SUBST(PYTHON_PLUGIN_DIR) fi dnl Test for gnuchess AC_PATH_PROGS(GNUCHESS, gnuchess gnome-gnuchess, no, [/usr/bin:/usr/games:/usr/local/bin:$PATH]) if test x$GNUCHESS = xno; then AC_MSG_ERROR(Couldn't find gnuchess, please install the gnuchess package version 5 or above) fi AC_DEFINE_UNQUOTED(GNUCHESS, "$GNUCHESS", Defines where GNU Chess resides on the system) AC_PATH_PROG(TEXINFO, makeinfo,no) if test x$TEXINFO = xno; then AC_MSG_WARN(Couldn't find texinfo, docs are not compiled. please install the texinfo package) fi AM_CONDITIONAL(TEXINFO, test x$TEXINFO != xno) AC_PATH_PROG(TETEX, texi2html,no) if test x$TETEX = xno; then AC_MSG_WARN(Couldn't find texi2html usualy in the tetex package, please install it) fi dnl SDLMixer support AC_MSG_CHECKING([wether we build with SDLMixer (will replace gstreamer by sdl mixer if enabled)]) AC_ARG_ENABLE(sdlmixer, AC_HELP_STRING( [--enable-sdlmixer], [Turn on sdl mixer (will replace gstreamer by sdl mixer)]), with_sdlmixer="$enableval", with_sdlmixer="no") AC_MSG_RESULT($with_sdlmixer) if test x$with_sdlmixer = xyes; then PKG_CHECK_MODULES(AUDIO, sdl,, AC_MSG_ERROR([*** SDL Mixer not found!])) AC_DEFINE([USE_SDLMIXER], 1,[sdl mixer is enabled]) AUDIO_LIBS="$AUDIO_LIBS -lSDL_mixer" else dnl Default is gstreamer PKG_CHECK_MODULES(AUDIO, gstreamer-0.10,, AC_MSG_ERROR([*** GSTREAMER not found!])) AC_DEFINE([USE_GSTREAMER], 1,[gstreamer is enabled]) fi AC_SUBST(AUDIO_CFLAGS) AC_SUBST(AUDIO_LIBS) dnl GNET support AC_MSG_CHECKING([wether we build with GNET (if not, networking will be disabled)]) AC_ARG_ENABLE(gnet, AC_HELP_STRING( [--disable-gnet], [Turn off gnet (will not let GCompris fetch content from a web server)]), with_gnet="$enableval", with_gnet="yes") AC_MSG_RESULT($with_gnet) if test x$with_gnet = xyes; then PKG_CHECK_MODULES(GNET, gnet-2.0,, AC_MSG_ERROR([*** GNET not found!])) AC_DEFINE([USE_GNET], 1,[Networking is enabled]) fi dnl SQLITE support AC_MSG_CHECKING([wether we build with SQLITE (if not profile will be disabled)]) AC_ARG_ENABLE(sqlite, AC_HELP_STRING( [--disable-sqlite], [Turn off sqlite (will disable profile)]), with_sqlite="$enableval", with_sqlite="yes") AC_MSG_RESULT($with_sqlite) dnl check for python AC_ARG_WITH(python,AC_HELP_STRING( [--with-python=path], [set the path for python]), python_path=$withval, python_path=not) if test x$python_path = xno ; then build_python_plugin="no" else if test x$python_path != xnot ; then PYTHON=$python_path fi AM_PATH_PYTHON(2.2) AM_CHECK_PYTHON_HEADERS( [build_python_plugin="yes"], [build_python_plugin="no"] ) fi dnl Finally output the required python variables and automake defines. AM_CONDITIONAL(PYTHON_PLUGIN, test x$build_python_plugin = xyes) dnl build only support AC_ARG_ENABLE(py-build-only, AC_HELP_STRING( [--enable-py-build-only], [Skip python modules tests. (Useful if you just need build)]), py_build_only="$enableval", py_build_only="no") REQUIRE_PYTHON="" if test x$build_python_plugin = xno; then AC_MSG_NOTICE([Python plugin is disabled.]) else dnl Python interpreter is available so check for pygtk PKG_CHECK_MODULES(PYGTK, pygtk-2.0) AC_MSG_CHECKING([for pygtk defs]) PYGTK_DEFSDIR=`$PKG_CONFIG --variable=defsdir pygtk-2.0` AC_MSG_RESULT([$PYGTK_DEFSDIR]) AC_MSG_CHECKING([for pygtk codegen]) PYGTK_CODEGEN="$PYTHON `$PKG_CONFIG --variable=codegendir pygtk-2.0`/codegen.py" AC_MSG_RESULT([$PYGTK_CODEGEN]) AC_MSG_CHECKING([for pygtk h2def]) PYGTK_H2DEF="$PYTHON `$PKG_CONFIG --variable=codegendir pygtk-2.0`/h2def.py" AC_MSG_RESULT([$PYGTK_H2DEF]) AC_SUBST([PYGTK_DEFSDIR]) AC_SUBST([PYGTK_CODEGEN]) AC_SUBST([PYGTK_H2DEF]) if test x$py_build_only = xno; then AM_CHECK_PYMOD(gtk,,,AC_MSG_ERROR([*** pygtk installed but not visible from python ])) dnl Set this variable for the .spec.in file REQUIRE_PYTHON="python pygtk2.0" if test x$with_sqlite = xyes; then AM_CHECK_PYMOD(pysqlite2,,,AC_MSG_ERROR([*** pysqlite2 missing ])) REQUIRE_PYTHON="$REQUIRE_PYTHON python-sqlite2" fi else AC_MSG_WARN([py-build-only: Skipping python modules dependancies]) AC_MSG_WARN([py-build-only: Do not forget to install pygtk, pysqlite2]) fi fi if test x$with_sqlite = xyes; then PKG_CHECK_MODULES(SQLITE3, sqlite3,, AC_MSG_ERROR([*** SQLITE3 not found!])) AC_DEFINE([USE_SQLITE], 1,[SQLITE Database, Profiles are enabled]) fi AM_CONDITIONAL(USE_SQLITE, test x$with_sqlite = xyes) AC_SUBST(SQLITE3_CFLAGS) AC_SUBST(SQLITE3_LIBS) AC_SUBST(REQUIRE_PYTHON) dnl mingw32 specific stuff. dnl use libgw32c dnl define __GW32__ and WIN32 # Check platform - see if WinMain needed: AC_SUBST(CFLAGS) AC_SUBST(LIBS) dnl disable activation code AC_ARG_ENABLE(activation-code, AC_HELP_STRING( [--disable-activation-code], [For Windows version, disable the activation code]), activation_code="$enableval", activation_code="yes") if test x$activation_code = xno; then AC_DEFINE([DISABLE_ACTIVATION_CODE], 1,[Activation code is disabled]) fi #mypaint #PKG_CHECK_MODULES(MYPAINT,[ # glib-2.0 >= 2.6.0 # gtk+-2.0 >= 2.6.0 # ]) dnl Autoconf output AC_OUTPUT([ Makefile.mingw config.h.mingw gcompris-installer.nsi Makefile autopackage/Makefile autopackage/default.apspec src/Makefile src/gcompris/Makefile src/boards/Makefile src/boards/python/Makefile src/boards/python/gcompris/Makefile src/boards/python/gcompris/admin/Makefile src/boards/python/gcompris/anim/Makefile src/boards/python/gcompris/bonus/Makefile src/boards/python/gcompris/score/Makefile src/boards/python/gcompris/skin/Makefile src/boards/python/gcompris/sound/Makefile src/boards/python/gcompris/timer/Makefile src/boards/python/gcompris/utils/Makefile src/boards/python/connect4p/Makefile src/boards/python/admin/Makefile src/libart_lgpl/Makefile src/libgnomecanvas/Makefile po/Makefile.in docs/Makefile docs/C/Makefile docs/fr/Makefile docs/eu/Makefile boards/Makefile boards/advanced_colors/Makefile boards/babymatch/Makefile boards/babyshapes/Makefile boards/chronos/Makefile boards/doubleentry/Makefile boards/gcompris/Makefile boards/gcompris/mimetypes/Makefile boards/geography/Makefile boards/geography_country/Makefile boards/imageid/Makefile boards/imagename/Makefile boards/missing_letter/Makefile boards/paintings/Makefile boards/read_colors/Makefile macosx/Makefile ]) echo "" echo "***************************************************" echo "" echo configure complete, echo with options: echo "Force python (--enable-py-build-only) = $py_build_only" echo "Python plugin = $build_python_plugin" echo "XF86VM option (--enable-xf86vidmode) = $found_xf86vidmode" echo "SQLITE database (--enable-sqlite) = $with_sqlite (profiles depend on this)" echo "GNET Networking (--enable-gnet) = $with_gnet (networking depends on this)" echo "BINRELOC (--enable-binreloc) = $br_cv_binreloc" echo "NSBundle (--enable-nsbundle) = $nsbundle" echo "SDL Mixer (--enable-sdlmixer) = $with_sdlmixer (default is gstreamer)" echo echo gcompris will be installed in ${prefix} echo to compile and install in in another directory echo type sh configure --prefix=/usr echo echo type \'make\' to compile gcompris echo type \'make install\' to install it