Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/configure.in
blob: 991f7a0afa0d2071ad5f720d7961d1db15c35d46 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
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
228
229
230
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
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
dnl Process this file with autoconf to produce a configure script.

AC_INIT(src/gcompris/gcompris.c)
AM_INIT_AUTOMAKE(gcompris, 3.3)
AM_CONFIG_HEADER(config.h)
AM_MAINTAINER_MODE

AC_ISC_POSIX

LIBGNOME_REQUIRED=1.96.0
LIBGNOMEUI_REQUIRED=1.96.0
GDK_PIXBUF_REQUIRED=2.0.6
LIBGNOMECANVAS_REQUIRED=2.0.2

PKG_CHECK_MODULES(GCOMPRIS, libgnome-2.0 >= $LIBGNOME_REQUIRED libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED gdk-pixbuf-2.0 >= $GDK_PIXBUF_REQUIRED libgnomecanvas-2.0 >= $LIBGNOMECANVAS_REQUIRED gthread-2.0)
AC_SUBST(GCOMPRIS_CFLAGS)
AC_SUBST(GCOMPRIS_LIBS)

dnl For embedded ogg player
dnl FIXME XIPH prefix are the one needed on Mandrake ?
XIPH_PATH_OGG
XIPH_PATH_AO
XIPH_PATH_VORBIS

AC_HEADER_DIRENT

AC_PROG_CC
AM_PROG_CC_STDC
AC_HEADER_STDC

AC_PROG_INTLTOOL

AM_DISABLE_STATIC
AC_LIBTOOL_DLOPEN
AM_PROG_LIBTOOL

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 glib-genmarshal
AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)

AM_ICONV

dnl Add the languages which your application supports here.
ALL_LINGUAS="am ar az ca cs de el es fi fr he hi hu it lt mk ml ms nl no pt pt_BR ro ru sk sv tr"

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])

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 Set PACKAGE_LOCALE_DIR in config.h.
AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "${myprefix}/${DATADIRNAME}/locale", [Gcompris locale directory])

dnl Set PACKAGE_SOUNDS_DIR
PACKAGE_SOUNDS_DIR="sounds"
AC_SUBST(PACKAGE_SOUNDS_DIR)
AC_DEFINE_UNQUOTED(PACKAGE_SOUNDS_DIR, "${myprefix}/${DATADIRNAME}/${PACKAGE}/sounds", [Gcompris sounds directory])

dnl Set PACKAGE_DATA_DIR
PACKAGE_DATA_DIR="boards"
AC_SUBST(PACKAGE_DATA_DIR)
AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${myprefix}/${DATADIRNAME}/${PACKAGE}/boards", [Gcompris data directory])

dnl Set PACKAGE_HELP_DIR
AC_DEFINE_UNQUOTED(PACKAGE_HELP_DIR, "${myprefix}/${DATADIRNAME}/gnome/help/${PACKAGE}", [Gcompris help directory])
PACKAGE_HELP_DIR="${myprefix}/${DATADIRNAME}/gnome/help/${PACKAGE}"
AC_SUBST(PACKAGE_HELP_DIR)

dnl Plugin Directory
AC_DEFINE_UNQUOTED(PLUGIN_DIR, "${myprefix}/lib/gcompris", [Gcompris plugins directory])

AC_DEFINE_UNQUOTED(GNOME_ICONDIR, "${myprefix}/${DATADIRNAME}/pixmaps", [Gnome icons directory])

plugindir=$libdir/gcompris
AC_SUBST(plugindir)

dnl Test for gnuchess
AC_PATH_PROG(GNUCHESS, gnuchess,no,[/usr/bin:/usr/games:/usr/local/bin])

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_ERROR(Couldn't find texinfo, please install the texinfo package)
fi

AC_PATH_PROG(TETEX, texi2html,no)
if test x$TETEX = xno; then
  AC_MSG_ERROR(Couldn't find texi2html usualy in the tetex package, please install it)
fi

dnl Tests for the python plugin
PYTHON_CFLAGS=
PYTHON_LIBS=
dnl By default, dont build python until we have something usefull to show
PYTHON_PATH=no
build_python_plugin=yes
AC_ARG_WITH(python,
  AC_HELP_STRING(
    [--with-python=path],
    [Give the python interpreter (ex: /opt/python/bin/python2.2)]),
  [PYTHON_PATH=$withval] )

if test x$PYTHON_PATH = xno; then
  build_python_plugin=no
else
  dnl Find a python interpretter
  python_old_path=${PATH}
  if test x$PYTHON_PATH = xyes; then
    AC_PATH_PROG(python_exec, python, no)
    if test x$python_exec = xno; then
      build_python_plugin=no
      AC_MSG_WARN([Couldn't find python interpreter, python plugin disabled.])
    fi
  else
    if test -x "${PYTHON_PATH}"; then
      python_exec=${PYTHON_PATH}
    else
      build_python_plugin=no
      AC_MSG_WARN([Couldn't find python interpreter, python plugin disabled.])
    fi
  fi

  if test x$build_python_plugin = xyes; then
    python_version=`${python_exec} -c "import sys; print sys.version[[:3]]"`
    python_prefix=`${python_exec} -c "import sys; print sys.prefix"`
    python_exec_prefix=`${python_exec} -c "import sys; print sys.exec_prefix"`

    dnl Search for python's includes
    python_old_cppflags=${CPPFLAGS}
    CPPFLAGS="${CPPFLAGS} -I${python_prefix}/include/python${python_version}"
    AC_CHECK_HEADER(Python.h, 
                    PYTHON_CFLAGS="-I${python_prefix}/include/python${python_version}",
                    [ AC_MSG_WARN([Couldn't find python includes, python plugin disabled.])
                      build_python_plugin=no])
    CPPFLAGS=$python_old_cppflags
  fi
  if test x$build_python_plugin = xyes; then
    dnl Search for python's libs
    dnl Take the needed libraries into the lib/python/config/Makefile... (see dia config)
    python_makefile="${python_exec_prefix}/lib/python${python_version}/config/Makefile"
    if test -f "${python_makefile}"; then
    dnl extra required libs
      python_localmodlibs=`sed -n -e 's/^LOCALMODLIBS=\(.*\)/\1/p' $python_makefile`
      python_basemodlibs=`sed -n -e 's/^BASEMODLIBS=\(.*\)/\1/p' $python_makefile`
      python_other_libs=`sed -n -e 's/^LIBS=\(.*\)/\1/p' $python_makefile`
      python_libs_cflags=`sed -n -e 's/^LINKFORSHARED=\(.*\)/\1/p' $python_makefile`
      python_libs="${python_localmodlibs} ${python_basemodlibs} ${python_other_libs}"

      python_old_ldflags=${LDFLAGS}
      LDFLAGS="${LDFLAGS} ${python_libs_cflags} -L${python_exec_prefix}/lib/python${python_version}/config ${python_libs}"
      AC_CHECK_LIB(python${python_version}, 
                   Py_Initialize, 
                   PYTHON_LIBS="${python_libs_cflags} -L${python_exec_prefix}/lib/python${python_version}/config -lpython${python_version} ${python_libs}",
                   [ AC_MSG_WARN([Couldn't find python library, python plugin disabled.])
                     build_python_plugin=no ])  
      LDFLAGS=${python_old_ldflags}
    else
      AC_MSG_WARN([Couldn't find python library, python plugin disabled.])
      build_python_plugin=no
    fi
  fi
fi

dnl Finally output the required python variables and automake defines.
AM_CONDITIONAL(PYTHON_PLUGIN, test x$build_python_plugin = xyes)

AC_SUBST(PYTHON_CFLAGS)
AC_SUBST(PYTHON_LIBS)

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 and gnome-python
  PKG_CHECK_MODULES(PYGTK, pygtk-2.0 gnome-python-2.0)	
  AC_SUBST(PYGTK_CFLAGS)
  AC_SUBST(PYGTK_LIBS)
fi

dnl For libassetml
PKG_CHECK_MODULES(GOBJECT, gobject-2.0)
AC_SUBST(GOBJECT_CFLAGS)
AC_SUBST(GOBJECT_LIBS)

ASSETML_DIR=assetml
AC_SUBST(ASSETML_DIR)
AC_DEFINE_UNQUOTED(ASSETML_DIR, "${myprefix}/${DATADIRNAME}/assetml", [Global assetml directory])

dnl Autoconf output
AC_OUTPUT([ gcompris.spec
Makefile
src/Makefile
src/libassetml/Makefile
src/libassetml/libassetml.pc
src/libassetml/test/Makefile
src/libassetml/tools/Makefile
src/gcompris/Makefile
src/boards/Makefile
src/boards/python/Makefile
src/boards/python/gcompris/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
po/Makefile.in
docs/Makefile
docs/C/Makefile
docs/fr/Makefile
boards/Makefile
boards/advanced_colors/Makefile
boards/babymatch/Makefile
boards/babyshapes/Makefile
boards/doubleentry/Makefile
boards/flags/Makefile
boards/geography/Makefile
boards/imageid/Makefile
boards/imagename/Makefile
boards/missing_letter/Makefile
boards/paintings/Makefile
boards/read_colors/Makefile
boards/scales/Makefile
boards/sounds/Makefile
boards/sounds/de/Makefile
boards/sounds/de/alphabet/Makefile
boards/sounds/de/colors/Makefile
boards/sounds/de/geography/Makefile
boards/sounds/de/misc/Makefile
boards/sounds/en/Makefile
boards/sounds/en/alphabet/Makefile
boards/sounds/en/colors/Makefile
boards/sounds/en/geography/Makefile
boards/sounds/en/misc/Makefile
boards/sounds/es/Makefile
boards/sounds/es/alphabet/Makefile
boards/sounds/es/colors/Makefile
boards/sounds/es/geography/Makefile
boards/sounds/es/misc/Makefile
boards/sounds/fr/Makefile
boards/sounds/fr/alphabet/Makefile
boards/sounds/fr/colors/Makefile
boards/sounds/fr/geography/Makefile
boards/sounds/fr/misc/Makefile
boards/sounds/pt/Makefile
boards/sounds/pt/alphabet/Makefile
boards/sounds/pt/colors/Makefile
boards/sounds/pt/geography/Makefile
boards/sounds/pt/misc/Makefile
])

echo ""
echo "***************************************************"
echo ""
echo configure complete,
echo with options:
echo python plugins = $build_python_plugin
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