~ubuntu-branches/ubuntu/oneiric/gnome-games/oneiric-proposed

« back to all changes in this revision

Viewing changes to .pc/90_build_with_vala_0_12.patch/configure.in

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2011-07-26 20:15:18 UTC
  • mfrom: (1.1.94)
  • Revision ID: package-import@ubuntu.com-20110726201518-us7nz3rhk8o6pv3g
Tags: 1:3.1.4-0ubuntu1
* New upstream release
  - Fully removed network game support (LP: #565030)
* debian/control
  - Have gnome-sudoku explicitly depend on gir packages
* debian/rules
  - Add dh_python2 post-install rule to avoid shipping .pyo/.pyc files
* debian/patches/01_lpi.patch
  - Refreshed, restored Launchpad Integration to gnome-sudoku
* debian/patches/90_build_with_vala_0_12.patch
  - Build with Vala 0.12 since 0.13 hasn't been packaged yet

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#                                               -*- Autoconf -*-
 
2
# Process this file with autoconf to produce a configure script.
 
3
 
 
4
AC_PREREQ([2.53])
 
5
AC_INIT([GNOME Games], [3.1.4],
 
6
  [http://bugzilla.gnome.org/enter_bug.cgi?product=gnome-games],
 
7
  [gnome-games])
 
8
 
 
9
AC_CONFIG_MACRO_DIR([m4])
 
10
AC_CONFIG_SRCDIR([gnomine/gnomine.c])
 
11
AC_CONFIG_HEADERS([config.h])
 
12
 
 
13
AM_INIT_AUTOMAKE([1.11 tar-ustar no-dist-gzip dist-xz foreign])
 
14
 
 
15
AM_SILENT_RULES([yes])
 
16
 
 
17
if test -z "$enable_maintainer_mode"; then
 
18
  enable_maintainer_mode=yes
 
19
fi
 
20
AM_MAINTAINER_MODE([enable])
 
21
 
 
22
# First parse the list of enabled games, so we know which options
 
23
# we support and which features to check for
 
24
 
 
25
# This is the canonical list of all game subdirectories.
 
26
allgames="glchess glines gnect gnibbles gnobots2 gnomine gnotravex gnotski gtali iagno mahjongg quadrapassel gnome-sudoku"
 
27
AC_SUBST([allgames])
 
28
staginggames="lightsoff swell-foop"
 
29
AC_SUBST([staginggames])
 
30
 
 
31
gamelist=""
 
32
 
 
33
AC_MSG_CHECKING([which games to build])
 
34
 
 
35
AC_ARG_WITH([games],
 
36
  [--with-games=game1,game2,...],
 
37
  [],[with_games=all])
 
38
 
 
39
AC_ARG_ENABLE([games],
 
40
  [AS_HELP_STRING([--enable-games=list],[Enable the games in the comma separated list ("all" and "none" are valid)])],
 
41
  [with_games="$enableval"],[])
 
42
 
 
43
if test -n "$with_games"; then
 
44
  gamelist=""
 
45
  IFS="${IFS=   }"; gg_saved_ifs="$IFS"; IFS=","
 
46
  for item in $with_games; do
 
47
    case $item in
 
48
      all) gamelist="$allgames" ;;
 
49
      none) gamelist="" ;;
 
50
      *) if test -z "$gamelist"; then
 
51
           gamelist="$item"
 
52
         else
 
53
           gamelist="$gamelist $item"
 
54
         fi
 
55
         ;;
 
56
    esac
 
57
  done
 
58
  IFS="$gg_saved_ifs"
 
59
else
 
60
  gamelist="$allgames"   
 
61
fi
 
62
 
 
63
## This has a particularly silly name because autoconf doesn't allow 
 
64
## --disable-foo to have arguments so we have to use an --enable-fubar form.
 
65
AC_ARG_ENABLE(omitgames,
 
66
  AS_HELP_STRING([--enable-omitgames=list],
 
67
    [Don't compile games in the comma separated list. ("all" and "none" are valid)]))
 
68
if test -n "$enable_omitgames"; then
 
69
   enable_omitgames=`echo ,"${enable_omitgames}", | sed -e 's/[[        ,]][[   ,]]*/ /g' -e 's/,$//'`
 
70
   omittedgames=""
 
71
   gamelist=""
 
72
   for item in ${enable_omitgames}; do
 
73
     for game in ${allgames}; do
 
74
       case ${item} in
 
75
          all) omittedgames=${allgames};;
 
76
          none) omittedgames="";;
 
77
          ${game}) omittedgames="${game} ${omittedgames}";;
 
78
          *) ;; 
 
79
        esac
 
80
     done
 
81
   done
 
82
   for game in ${allgames}; do
 
83
     case ${omittedgames} in
 
84
       *${game}*) ;;
 
85
       *) gamelist="${gamelist} ${game}";;
 
86
     esac
 
87
   done
 
88
elif test -z "$gamelist"; then
 
89
   # Everything on by default
 
90
   gamelist=${allgames}
 
91
fi
 
92
 
 
93
## This is the staging area
 
94
## These games aren't quite ready for prime-time
 
95
 
 
96
AC_MSG_CHECKING([whether to enable staging games])
 
97
AC_ARG_ENABLE([staging],
 
98
  [AS_HELP_STRING([--enable-staging],[whether to enable beta game support (default: disabled)])],[],[])
 
99
AC_MSG_RESULT([$enable_staging])
 
100
 
 
101
if test "$enable_staging" = "yes"; then
 
102
        gamelist="${gamelist} ${staginggames}"
 
103
fi
 
104
 
 
105
AC_MSG_RESULT([$gamelist])
 
106
 
 
107
AC_SUBST([gamelist])
 
108
 
 
109
# Feature matrix
 
110
 
 
111
need_cxx=no
 
112
need_vala=no
 
113
need_rsvg=no
 
114
need_sqlite=no
 
115
need_opengl=no
 
116
need_glx=no
 
117
need_python=no
 
118
need_clutter=no
 
119
want_sound=no
 
120
allow_gnuchess=no
 
121
allow_smclient=no
 
122
require_cairo_1_10=no
 
123
 
 
124
for game in $gamelist; do
 
125
  case $game in
 
126
    quadrapassel) need_cxx=yes ;;
 
127
    *) ;;
 
128
  esac
 
129
  case $game in
 
130
    glchess) need_vala=yes ;;
 
131
    *) ;;
 
132
  esac
 
133
  case $game in
 
134
    glchess) need_opengl=yes ;;
 
135
    *) ;;
 
136
  esac
 
137
  case $game in
 
138
    glchess) need_glx=yes ;;
 
139
    *) ;;
 
140
  esac
 
141
  case $game in
 
142
    glchess) allow_gnuchess=yes ;;
 
143
    *) ;;
 
144
  esac
 
145
  case $game in
 
146
    gnome-sudoku) need_python=yes ;;
 
147
    *) ;;
 
148
  esac
 
149
  case $game in
 
150
    gnect|gnibbles|gnobots2|quadrapassel|iagno) want_sound=yes ;;
 
151
    *) ;;
 
152
  esac
 
153
  case $game in
 
154
    glchess) ;;
 
155
    *) need_rsvg=yes ;;
 
156
  esac
 
157
  case $game in
 
158
    glchess) need_sqlite=yes ;;
 
159
    *) ;;
 
160
  esac
 
161
  case $game in
 
162
    glines|gnobots2|gnomine|gnotravex|gnotski|iagno) allow_smclient=yes ;;
 
163
    *) ;;
 
164
  esac
 
165
  case $game in
 
166
    quadrapassel|lightsoff|swell-foop|gnibbles) need_clutter=yes ;;
 
167
    *) ;;
 
168
  esac
 
169
done
 
170
 
 
171
# Set a conditional for each game to build
 
172
 
 
173
for game in $allgames $staginggames; do
 
174
  eval AS_TR_SH([build_$game])=no
 
175
done
 
176
for game in $gamelist; do
 
177
  eval AS_TR_SH([build_$game])=yes
 
178
done
 
179
 
 
180
AM_CONDITIONAL([BUILD_GLCHESS],[test "$build_glchess" = "yes"])
 
181
AM_CONDITIONAL([BUILD_GLINES],[test "$build_glines" = "yes"])
 
182
AM_CONDITIONAL([BUILD_GNECT],[test "$build_gnect" = "yes"])
 
183
AM_CONDITIONAL([BUILD_GNIBBLES],[test "$build_gnibbles" = "yes"])
 
184
AM_CONDITIONAL([BUILD_GNOBOTS2],[test "$build_gnobots2" = "yes"])
 
185
AM_CONDITIONAL([BUILD_GNOME_SUDOKU],[test "$build_gnome_sudoku" = "yes"])
 
186
AM_CONDITIONAL([BUILD_QUADRAPASSEL],[test "$build_quadrapassel" = "yes"])
 
187
AM_CONDITIONAL([BUILD_GNOMINE],[test "$build_gnomine" = "yes"])
 
188
AM_CONDITIONAL([BUILD_GNOTRAVEX],[test "$build_gnotravex" = "yes"])
 
189
AM_CONDITIONAL([BUILD_GNOTSKI],[test "$build_gnotski" = "yes"])
 
190
AM_CONDITIONAL([BUILD_GTALI],[test "$build_gtali" = "yes"])
 
191
AM_CONDITIONAL([BUILD_IAGNO],[test "$build_iagno" = "yes"])
 
192
AM_CONDITIONAL([BUILD_LIGHTSOFF],[test "$build_lightsoff" = "yes"])
 
193
AM_CONDITIONAL([BUILD_MAHJONGG],[test "$build_mahjongg" = "yes"])
 
194
AM_CONDITIONAL([BUILD_SWELL_FOOP],[test "$build_swell_foop" = "yes"])
 
195
 
 
196
# Locate various programs
 
197
 
 
198
PKG_PROG_PKG_CONFIG([0.15])
 
199
 
 
200
AC_PROG_CC
 
201
AC_PROG_CPP
 
202
AC_PROG_LN_S
 
203
AC_PROG_SED
 
204
 
 
205
if test "$need_vala" = "yes"; then
 
206
  AM_PROG_VALAC([0.13.0])
 
207
fi
 
208
 
 
209
if test "$need_cxx" = "yes"; then
 
210
  AC_PROG_CXX
 
211
 
 
212
  # Check whether a C++ was found (AC_PROG_CXX sets $CXX to "g++" even when it
 
213
  # doesn't exist)
 
214
  AC_LANG_PUSH([C++])
 
215
  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],[],[AC_MSG_ERROR([No C++ compiler found])])
 
216
  AC_LANG_POP([C++])
 
217
fi
 
218
 
 
219
AM_PROG_CC_C_O
 
220
 
 
221
LT_INIT
 
222
 
 
223
GNOME_COMMON_INIT
 
224
GNOME_DEBUG_CHECK
 
225
GNOME_COMPILE_WARNINGS([maximum])
 
226
GNOME_CXX_WARNINGS([yes])
 
227
GNOME_MAINTAINER_MODE_DEFINES
 
228
 
 
229
dnl ****************************************************************************
 
230
dnl * Python 2.4
 
231
dnl ****************************************************************************
 
232
 
 
233
AM_PATH_PYTHON([2.4],[have_python=yes],[have_python=no])
 
234
 
 
235
# ************
 
236
# Dependencies
 
237
# ************
 
238
 
 
239
# Check which platform to use
 
240
 
 
241
AC_MSG_CHECKING([for which platform to build])
 
242
AC_ARG_WITH([platform],
 
243
  [AS_HELP_STRING([--with-platform=gnome|gtk-only (default: gnome)])],
 
244
  [case "$withval" in
 
245
    gnome|gtk-only) ;;
 
246
    *) AC_MSG_ERROR([invalid argument "$withval" for --with-platform]) ;;
 
247
   esac],
 
248
  [with_platform=gnome])
 
249
AC_MSG_RESULT([$with_platform])
 
250
 
 
251
AM_CONDITIONAL([HAVE_GNOME],[test "$with_platform" = "gnome"])
 
252
 
 
253
if test "$with_platform" = "gnome"; then
 
254
  AC_DEFINE([HAVE_GNOME],[1],[Define if GNOME support is enabled])
 
255
fi
 
256
 
 
257
# Check which gtk+ major version to use
 
258
 
 
259
AC_MSG_CHECKING([which gtk+ version to compile against])
 
260
AC_ARG_WITH([gtk],
 
261
  [AS_HELP_STRING([--with-gtk=3.0],[which gtk+ version to compile against (default: 3.0)])],
 
262
  [case "$with_gtk" in
 
263
     3.0) ;;
 
264
     [0-9].0) AC_MSG_ERROR([unsupported gtk version $with_gtk specified]) ;;
 
265
     *) AC_MSG_ERROR([invalid gtk version specified]) ;;
 
266
   esac],
 
267
  [with_gtk=3.0])
 
268
AC_MSG_RESULT([$with_gtk])
 
269
 
 
270
case "$with_gtk" in
 
271
  3.0) GTK_API_VERSION=3.0
 
272
       GTK_API_MAJOR_VERSION=3
 
273
       ;;
 
274
esac
 
275
 
 
276
AC_SUBST([GTK_API_VERSION])
 
277
AC_SUBST([GTK_API_MAJOR_VERSION])
 
278
 
 
279
# Win32 platform
 
280
 
 
281
AC_CANONICAL_HOST
 
282
 
 
283
AC_MSG_CHECKING([for some Win32 platform])
 
284
case "$host" in
 
285
  *-*-cygwin*|*-*-mingw*)
 
286
    platform_win32=yes
 
287
    ;;
 
288
  *)
 
289
    platform_win32=no
 
290
    ;;
 
291
esac
 
292
AC_MSG_RESULT([$platform_win32])
 
293
AM_CONDITIONAL([PLATFORM_WIN32],[test "$platform_win32" = "yes"])
 
294
 
 
295
AC_MSG_CHECKING([for native Win32])
 
296
case "$host" in
 
297
  *-*-mingw*)
 
298
    os_win32=yes
 
299
    ;;
 
300
  *)
 
301
    os_win32=no
 
302
    ;;
 
303
esac
 
304
AC_MSG_RESULT([$os_win32])
 
305
AM_CONDITIONAL([PLATFORM_WIN32_NATIVE],[test "$os_win32" = "yes"])
 
306
 
 
307
# ********
 
308
# Features
 
309
# ********
 
310
 
 
311
# *****
 
312
# Sound
 
313
# *****
 
314
 
 
315
if test "$want_sound" = "yes"; then
 
316
  AC_MSG_CHECKING([whether to enable sound support])
 
317
  AC_ARG_ENABLE([sound],
 
318
    [AS_HELP_STRING([--enable-sound],[Enable sound using libcanberra])],
 
319
    [],[enable_sound=yes])
 
320
  AC_MSG_RESULT([$enable_sound])
 
321
else
 
322
  enable_sound=no
 
323
fi
 
324
 
 
325
# ********************
 
326
# Checks for libraries
 
327
# ********************
 
328
 
 
329
PYGOBJECT_REQUIRED=2.28.3
 
330
 
 
331
case "$with_gtk" in
 
332
  3.0) GTK_REQUIRED=2.91.7
 
333
       RSVG_REQUIRED=2.32.0
 
334
       LIBCANBERRA_GTK_REQUIRED=0.26
 
335
       LIBCANBERRA_GTK_PKGS="libcanberra-gtk3 >= $LIBCANBERRA_GTK_REQUIRED"
 
336
       ;;
 
337
esac
 
338
 
 
339
GCONF_REQUIRED=2.0
 
340
GIO_REQUIRED=2.25.7
 
341
GSTREAMER_REQUIRED=0.10.11
 
342
 
 
343
# Check for common modules
 
344
 
 
345
need_gthread=no
 
346
PKG_CHECK_MODULES([GTHREAD],[gthread-2.0])
 
347
AC_SUBST([GTHREAD_CFLAGS])
 
348
AC_SUBST([GTHREAD_LIBS])
 
349
 
 
350
PKG_CHECK_MODULES([GMODULE],[gmodule-2.0])
 
351
AC_SUBST([GMODULE_CFLAGS])
 
352
AC_SUBST([GMODULE_LIBS])
 
353
 
 
354
PKG_CHECK_MODULES([GOBJECT],[gobject-2.0])
 
355
AC_SUBST([GOBJECT_CFLAGS])
 
356
AC_SUBST([GOBJECT_LIBS])
 
357
 
 
358
PKG_CHECK_MODULES([GTK],[gtk+-$GTK_API_VERSION >= $GTK_REQUIRED launchpad-integration-3.0])
 
359
AC_SUBST([GTK_CFLAGS])
 
360
AC_SUBST([GTK_LIBS])
 
361
 
 
362
# GDBus
 
363
 
 
364
PKG_CHECK_MODULES([GIO],[gio-2.0 >= $GIO_REQUIRED],[have_gio_2_26=yes],[have_gio_2_26=no])
 
365
 
 
366
# GSettings
 
367
 
 
368
AM_CONDITIONAL([HAVE_GIO_2_26],[test "$have_gio_2_26" = "yes"])
 
369
 
 
370
m4_ifdef([GLIB_GSETTINGS],[GLIB_GSETTINGS([],[:])])
 
371
 
 
372
# Check for GNOME modules
 
373
 
 
374
AM_GCONF_SOURCE_2
 
375
AC_PATH_PROG([GCONFTOOL],[gconftool-2])
 
376
 
 
377
if test "$with_platform" = "gnome"; then
 
378
  PKG_CHECK_MODULES([GNOME],[gconf-2.0 >= $GCONF_REQUIRED])
 
379
  AC_SUBST([GNOME_CFLAGS])
 
380
  AC_SUBST([GNOME_LIBS])
 
381
 
 
382
  need_gthread=yes
 
383
fi
 
384
 
 
385
# Check for librsvg
 
386
 
 
387
have_rsvg=no
 
388
if test "$need_rsvg" = "yes"; then
 
389
  have_rsvg=yes
 
390
 
 
391
  if test "$require_cairo_1_10" = "yes"; then
 
392
    CAIRO_REQUIRED=1.10.0
 
393
  else
 
394
    CAIRO_REQUIRED=1.0
 
395
  fi
 
396
 
 
397
  # Errors out if rsvg is not found
 
398
  PKG_CHECK_MODULES([RSVG],[
 
399
    librsvg-2.0 >= $RSVG_REQUIRED
 
400
    cairo >= $CAIRO_REQUIRED])
 
401
 
 
402
  AC_SUBST([RSVG_CFLAGS])
 
403
  AC_SUBST([RSVG_LIBS])
 
404
 
 
405
  AC_DEFINE([HAVE_RSVG],[1],[Refine if librsvg is available])
 
406
fi
 
407
 
 
408
AM_CONDITIONAL([HAVE_RSVG],[test "$have_rsvg" = "yes"])
 
409
 
 
410
# Check for SQLite
 
411
 
 
412
have_sqlite=no
 
413
if test "$need_sqlite" = "yes"; then
 
414
  have_sqlite=yes
 
415
 
 
416
  # Errors out if sqlite is not found
 
417
  PKG_CHECK_MODULES([SQLITE],[sqlite3])
 
418
 
 
419
  AC_SUBST([SQLITE_CFLAGS])
 
420
  AC_SUBST([SQLITE_LIBS])
 
421
 
 
422
  AC_DEFINE([HAVE_SQLITE],[1],[Refine if sqlite is available])
 
423
fi
 
424
 
 
425
AM_CONDITIONAL([HAVE_SQLITE],[test "$have_sqlite" = "yes"])
 
426
 
 
427
# Check for OpenGL
 
428
 
 
429
have_opengl=no
 
430
if test "$need_opengl" = "yes"; then
 
431
  have_opengl=yes
 
432
 
 
433
  # Errors out if OpenGL is not found
 
434
  PKG_CHECK_MODULES([OPENGL],[
 
435
    gl glu])
 
436
 
 
437
  AC_SUBST([OPENGL_CFLAGS])
 
438
  AC_SUBST([OPENGL_LIBS])
 
439
 
 
440
  AC_DEFINE([HAVE_OPENGL],[1],[Define if OpenGL is available])
 
441
fi
 
442
 
 
443
AM_CONDITIONAL([HAVE_OPENGL],[test "$have_opengl" = "yes"])
 
444
 
 
445
# Check for GLX
 
446
 
 
447
have_glx=no
 
448
if test "$need_glx" = "yes"; then
 
449
  have_glx=yes
 
450
 
 
451
  # Errors out if GLX is not found
 
452
  PKG_CHECK_MODULES([GLX],[
 
453
    gl x11])
 
454
 
 
455
  AC_SUBST([GLX_CFLAGS])
 
456
  AC_SUBST([GLX_LIBS])
 
457
 
 
458
  AC_DEFINE([HAVE_GLX],[1],[Define if GLX is available])
 
459
fi
 
460
 
 
461
AM_CONDITIONAL([HAVE_GLX],[test "$have_glx" = "yes"])
 
462
 
 
463
# Check for Clutter
 
464
 
 
465
if test "$need_clutter" = "yes"; then
 
466
  CLUTTER_REQUIRED=1.0.0
 
467
 
 
468
  PKG_CHECK_MODULES([CLUTTER],[clutter-1.0 >= $CLUTTER_REQUIRED])
 
469
  AC_SUBST([CLUTTER_CFLAGS])
 
470
  AC_SUBST([CLUTTER_LIBS])
 
471
 
 
472
  case "$with_gtk" in
 
473
    3.0) CLUTTER_GTK_API_VERSION=1.0
 
474
         CLUTTER_GTK_REQUIRED=0.91.6
 
475
         ;;
 
476
  esac
 
477
 
 
478
  PKG_CHECK_MODULES([CLUTTER_GTK],[clutter-gtk-$CLUTTER_GTK_API_VERSION >= $CLUTTER_GTK_REQUIRED])
 
479
  AC_SUBST([CLUTTER_GTK_CFLAGS])
 
480
  AC_SUBST([CLUTTER_GTK_LIBS])
 
481
fi
 
482
 
 
483
AM_CONDITIONAL([HAVE_CLUTTER],[test "$need_clutter" = "yes"])
 
484
 
 
485
# Check for PyGObject
 
486
 
 
487
if test "$have_python" = "yes"; then
 
488
  PKG_CHECK_MODULES([PYGOBJECT],[
 
489
    pygobject-2.0 >= $PYGOBJECT_REQUIRED],
 
490
    [have_pygtk=yes],[have_pygtk=no])
 
491
fi
 
492
 
 
493
enable_python=no
 
494
if test "$have_python" = "yes" -a "$have_pygtk" = "yes"; then
 
495
  enable_python=yes
 
496
fi
 
497
 
 
498
if test "$enable_python" = "no" -a "$need_python" = "yes"; then
 
499
  AC_MSG_ERROR([Some games need python, but pygobject packages were not found.])
 
500
fi
 
501
 
 
502
AM_CONDITIONAL([HAVE_PYTHON],[test "$enable_python" = "yes"])
 
503
 
 
504
# GThread
 
505
 
 
506
AM_CONDITIONAL([WITH_GTHREAD],[test "$need_gthread" = "yes"])
 
507
 
 
508
# libcanberra
 
509
 
 
510
if test "$enable_sound" = "yes"; then
 
511
  PKG_CHECK_MODULES([CANBERRA_GTK],[$LIBCANBERRA_GTK_PKGS],[],
 
512
    [AC_MSG_ERROR([Sound support was requested, but libcanberra-gtk not found.])])
 
513
 
 
514
  AC_DEFINE([ENABLE_SOUND],[1],[Define if sound support is enabled])
 
515
fi
 
516
 
 
517
AM_CONDITIONAL([ENABLE_SOUND],[test "$enable_sound" = "yes"])
 
518
 
 
519
# SMClient
 
520
 
 
521
SMCLIENT_PKGS=
 
522
if test "$allow_smclient" = "yes"; then
 
523
  AC_MSG_CHECKING([for GDK target])
 
524
  case "$with_gtk" in
 
525
    3.0) for target in $($PKG_CONFIG --variable targets gdk-$GTK_API_VERSION); do
 
526
           GDK_TARGET="$target"
 
527
           break
 
528
         done
 
529
         ;;
 
530
  esac
 
531
  AC_MSG_RESULT([$GDK_TARGET])
 
532
 
 
533
  case "$GDK_TARGET" in
 
534
    x11|win32|quartz) ;;
 
535
    *) AC_MSG_ERROR([unknown GDK target])
 
536
  esac
 
537
 
 
538
  AC_MSG_CHECKING([which smclient backend to use])
 
539
  AC_ARG_WITH([smclient],
 
540
    [AS_HELP_STRING([--with-smclient],[which smclient backend to use (xsmp|win32|quartz|no)])],
 
541
    [],
 
542
    [case "$with_platform" in
 
543
       gnome|gtk-only) case "$GDK_TARGET" in
 
544
                         x11) with_smclient=xsmp SMCLIENT_PKGS="sm ice" ;;
 
545
                         win32|quartz) with_smclient=$GDK_TARGET ;;
 
546
                         *) with_smclient=no ;;
 
547
                       esac
 
548
                       ;;
 
549
     esac])
 
550
  AC_MSG_RESULT([$with_smclient])
 
551
 
 
552
  if test "$with_smclient" != "no"; then
 
553
    if test -n "$SMCLIENT_PKGS"; then
 
554
      PKG_CHECK_MODULES([SMCLIENT],[$SMCLIENT_PKGS])
 
555
    fi
 
556
 
 
557
    AC_DEFINE([WITH_SMCLIENT],[1],[Define if smclient is enabled])
 
558
  fi
 
559
 
 
560
else
 
561
  with_smclient=no
 
562
fi
 
563
 
 
564
AM_CONDITIONAL([WITH_SMCLIENT],[test "$with_smclient" != "no"])
 
565
AM_CONDITIONAL([WITH_SMCLIENT_XSMP],[test "$with_smclient" = "xsmp"])
 
566
AM_CONDITIONAL([WITH_SMCLIENT_WIN32],[test "$with_smclient" = "win32"])
 
567
AM_CONDITIONAL([WITH_SMCLIENT_QUARTZ],[test "$with_smclient" = "quartz"])
 
568
 
 
569
# *****************
 
570
# Extra build tools
 
571
# *****************
 
572
 
 
573
AC_PATH_PROG([GLIB_GENMARSHAL],[glib-genmarshal])
 
574
 
 
575
# glib-genmarshal --internal only exists since 2.14
 
576
if $PKG_CONFIG --exists "glib-2.0 >= 2.14.0" ; then
 
577
  GLIB_GENMARSHAL_INTERNAL="--internal"
 
578
else
 
579
  GLIB_GENMARSHAL_INTERNAL=
 
580
fi
 
581
AC_SUBST([GLIB_GENMARSHAL_INTERNAL])
 
582
 
 
583
if test "$platform_win32" = "yes" -a "$os_win32" = "yes"; then
 
584
  AC_CHECK_TOOL([WINDRES],[windres],[no])
 
585
  if test "$WINDRES" = "no"; then
 
586
    AC_MSG_ERROR([windres is required for native win32])
 
587
  fi
 
588
fi
 
589
 
 
590
# ********
 
591
# Binreloc
 
592
# ********
 
593
 
 
594
AC_MSG_CHECKING([whether to enable binary relocation support])
 
595
AC_ARG_ENABLE([binreloc],
 
596
  [AS_HELP_STRING([--enable-binreloc],[enable binary relocation support (default: disabled)])],
 
597
  [],
 
598
  [enable_binreloc="$platform_win32"])
 
599
AC_MSG_RESULT([$enable_binreloc])
 
600
 
 
601
if test "$enable_binreloc" = "yes"; then
 
602
 
 
603
  # Check that all variables use the same prefix
 
604
  # Note: datarootdir exists only since autoconf 2.60, so we have to
 
605
  # check for the old and the new form of datadir.
 
606
  if test "$exec_prefix" != '${prefix}' -o \
 
607
          "$bindir" != '${exec_prefix}/bin' -o \
 
608
          "$sbindir" != '${exec_prefix}/sbin' -o \
 
609
          "$libdir" != '${exec_prefix}/lib' -o \
 
610
          "$libexecdir" != '${exec_prefix}/libexec' -o \
 
611
          "$sysconfdir" != '${prefix}/etc' -o \
 
612
          "$localstatedir" != '${prefix}/var' -o \
 
613
          \( -n "$datarootdir" -a "$datarootdir" != '${prefix}/share' \) -o \
 
614
          \( "$datadir" != '${datarootdir}' -a "$datadir" != '${prefix}/share' \) -o \
 
615
          \( "$localedir" != '${datarootdir}/locale' -a "$localedir" != '${datadir}/locale' \) -o \
 
616
          \( "$mandir" != '${datarootdir}/man' -a "$mandir" != '${datadir}/man' \); then
 
617
    AC_MSG_ERROR([cannot use binary relocation with different prefixes])
 
618
  fi
 
619
 
 
620
  AC_DEFINE([ENABLE_BINRELOC],[1],[Define for binary relocation support])
 
621
fi
 
622
 
 
623
# ********
 
624
 
 
625
AM_CFLAGS="$AM_CFLAGS $WARN_CFLAGS"
 
626
AM_CXXFLAGS="$AM_CXXFLAGS $WARN_CXXFLAGS"
 
627
 
 
628
# ****
 
629
# i18n
 
630
# ****
 
631
 
 
632
GETTEXT_PACKAGE=gnome-games
 
633
AC_SUBST(GETTEXT_PACKAGE)
 
634
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [The gettext package name])
 
635
AM_GLIB_GNU_GETTEXT
 
636
 
 
637
IT_PROG_INTLTOOL([0.35.0])
 
638
 
 
639
# ********************
 
640
# Game specific checks
 
641
# ********************
 
642
 
 
643
if test "$allow_gnuchess" = "yes"; then
 
644
  AC_ARG_ENABLE([gnuchess],
 
645
  [AS_HELP_STRING([--disable-gnuchess],[Disable included gnuchess for glChess])],
 
646
  [],[enable_gnuchess=yes])
 
647
 
 
648
  if test "$enable_gnuchess" = "yes"; then
 
649
    AC_DEFINE([ENABLE_GNUCHESS],[1],[Enable compilation of included GNU Chess as AI chess engine for glChess])
 
650
    AC_CHECK_HEADER(pthread.h, [],
 
651
                  AC_MSG_ERROR([*** Cannot find pthread.h header]))
 
652
    AC_CHECK_LIB(pthread, pthread_create,
 
653
                 [PTHREAD_LDFLAGS="$PTHREAD_LDFLAGS -lpthread"
 
654
                  PTHREAD_CFLAGS="$PTHREAD_CFLAGS -D_REENTRANT"],
 
655
                 [AC_CHECK_LIB(c_r, pthread_create,
 
656
                               [PTHREAD_LDFLAGS="$PTHREAD_LDFLAGS -pthread"
 
657
                                PTHREAD_CFLAGS="$PTHREAD_CFLAGS -D_THREAD_SAFE"],
 
658
                 AC_MSG_ERROR([*** Cannot find pthread library]))])
 
659
    AC_SUBST(PTHREAD_CFLAGS)
 
660
    AC_SUBST(PTHREAD_LDFLAGS)
 
661
  fi
 
662
fi
 
663
 
 
664
AM_CONDITIONAL([WITH_INCLUDED_GNUCHESS],[test "$enable_gnuchess" = "yes"])
 
665
 
 
666
# Check for library functions
 
667
# ===========================
 
668
 
 
669
AC_CHECK_FUNCS([dup2 strcasecmp strchr strerror \
 
670
                malloc vprintf], [],
 
671
               [AC_MSG_ERROR([cannot find required function])])
 
672
AC_CHECK_FUNCS([fork select]) 
 
673
AC_CHECK_FUNCS([alarm getpwuid getenv setenv close hstrerror kill socketpair])
 
674
 
 
675
AC_HEADER_STDC
 
676
 
 
677
AC_FUNC_FORK
 
678
 
 
679
# Check for PF_LOCAL/PF_UNIX
 
680
# ==========================
 
681
# There should be an autoconf macro to check this???
 
682
#
 
683
# Not having this is not necessarily a fatal error.  It should mean that
 
684
# the WinAPI interface is used instead.
 
685
AC_MSG_CHECKING([for PF_LOCAL])
 
686
AC_EGREP_CPP(PF_LOCAL,
 
687
             [#include <sys/types.h>
 
688
              #include <sys/socket.h>
 
689
              PF_LOCAL ],
 
690
             [AC_MSG_RESULT(no)
 
691
              AC_MSG_CHECKING([for PF_UNIX])
 
692
              AC_EGREP_CPP(PF_UNIX, [ #include <sys/types.h>
 
693
                                      #include <sys/socket.h>
 
694
                                      PF_UNIX ],
 
695
                           [AC_MSG_RESULT(no)],
 
696
                           [AC_MSG_RESULT(yes)
 
697
                            AC_DEFINE([PF_LOCAL], PF_UNIX,
 
698
                                      [PF_UNIX is available])
 
699
                            AC_DEFINE([AF_LOCAL], AF_UNIX,
 
700
                                      [AF_UNIX is available])])], 
 
701
             AC_MSG_RESULT(yes))
 
702
 
 
703
# Check for header files
 
704
# ======================
 
705
AC_CHECK_HEADERS([fcntl.h libintl.h limits.h locale.h sys/time.h time.h \
 
706
                  unistd.h], [],
 
707
                 [AC_MSG_ERROR([cannot find required header file])])
 
708
AC_HEADER_SYS_WAIT
 
709
 
 
710
 
 
711
# Checks for typedefs, structures, and compiler characteristics
 
712
AC_FUNC_REALLOC
 
713
AC_HEADER_STDBOOL
 
714
AC_C_INLINE
 
715
AC_TYPE_SIZE_T
 
716
AC_HEADER_TIME
 
717
 
 
718
# *************
 
719
# Documentation
 
720
# *************
 
721
 
 
722
# We support various ways to present help to the user:
 
723
# ghelp: using the ghelp: protocol, most likely displaying in Yelp
 
724
# file: showing html or xhtml files in the web browser
 
725
# library: in the web browser loaded remotedly from library.gnome.org
 
726
#
 
727
# Note that for help using [x]html files, we can't use gnome-doc-utils.make
 
728
# since it doesn't currently support this. The packager will have to use
 
729
# gnome-doc-tool directly to build the documentation in the right format.
 
730
# The help files must be installed in $(pkgdatadir)/$(DOC_MODULE)/$(LOCALE) .
 
731
 
 
732
AC_MSG_CHECKING([which help method to use])
 
733
AC_ARG_WITH([help-method],
 
734
  [AS_HELP_STRING([--with-help-method],[which help method to use (ghelp|file|library; default: ghelp)])],
 
735
  [],
 
736
  [case "$with_platform" in
 
737
     *) if test "$platform_win32" = "yes"; then
 
738
           with_help_method=file
 
739
         else
 
740
           with_help_method=ghelp
 
741
         fi ;;
 
742
   esac])
 
743
AC_MSG_RESULT([$with_help_method])
 
744
 
 
745
case "$with_help_method" in
 
746
  ghelp) AC_DEFINE([WITH_HELP_METHOD_GHELP],[1],[Define to use help using ghelp]) ;;
 
747
  file) AC_DEFINE([WITH_HELP_METHOD_FILE],[1],[Define to use help using file]) ;;
 
748
  library) AC_DEFINE([WITH_HELP_METHOD_LIBRARY],[1],[Define to use help using library.gnome.org]) ;;
 
749
  *) AC_MSG_ERROR([unknown help method "$with_help_method"]) ;;
 
750
esac
 
751
 
 
752
if test "$with_help_method" = "file"; then
 
753
  AC_MSG_CHECKING([for help file format])
 
754
  AC_ARG_WITH([help-file-format],
 
755
    [AS_HELP_STRING([--with-help-file-format],[which file format to use for help (html|xhtml; default: html)])],
 
756
    [case "$with_help_file_format" in
 
757
       html|xhtml) ;;
 
758
       *) AC_MSG_ERROR([unknown help file format "$with_help_file_format"]) ;;
 
759
     esac],
 
760
    [with_help_file_format=html])
 
761
  AC_MSG_RESULT([$with_help_file_format])
 
762
 
 
763
  AC_DEFINE_UNQUOTED([HELP_FILE_FORMAT],["$with_help_file_format"],[The help file format])
 
764
fi
 
765
 
 
766
GNOME_DOC_INIT([0.10.0],
 
767
  [have_gdu=yes],
 
768
  [have_gdu=no
 
769
   if test "$with_help_method" = "ghelp"; then
 
770
     AC_MSG_ERROR([ghelp requested, but gnome-doc-utils not found!])
 
771
   fi])
 
772
 
 
773
AM_CONDITIONAL([BUILD_HELP],[test "$with_help_method" = "ghelp"])
 
774
 
 
775
# *************
 
776
# setgid checks
 
777
# *************
 
778
 
 
779
AC_ARG_ENABLE([setgid],
 
780
  [AS_HELP_STRING([--disable-setgid],
 
781
    [Disable the use of setgid binaries])],
 
782
  [case "${enableval}" in
 
783
    yes) setgid=true ;;
 
784
    no)  setgid=false ;;
 
785
    *) AC_MSG_ERROR([bad value ${enableval} for --disable-setgid]) ;;
 
786
   esac],
 
787
  [if test "$platform_win32" = "yes"; then
 
788
     enable_setgid=no
 
789
     setgid=false
 
790
   else
 
791
     enable_setgid=yes
 
792
     setgid=true
 
793
   fi])
 
794
 
 
795
scoredir='${localstatedir}/games'
 
796
scores_group=games
 
797
scores_user=games
 
798
 
 
799
if test "$enable_setgid" = "yes"; then
 
800
  AC_DEFINE([ENABLE_SETGID],[1],[Define if use of setgid binaries is enabled])
 
801
 
 
802
  AC_ARG_WITH(scores-group,
 
803
    AS_HELP_STRING([--with-scores-group=group],
 
804
      [Group for the high score tables and binaries]),
 
805
    scores_group="$withval",scores_group="games")
 
806
  AC_ARG_WITH(scores-user,
 
807
    AS_HELP_STRING([--with-scores-user=user],
 
808
      [User for the high score tables]),
 
809
    scores_user="$withval",scores_user="games")
 
810
fi
 
811
 
 
812
AM_CONDITIONAL([ENABLE_SETGID],[test "$enable_setgid" = "yes"])
 
813
 
 
814
AC_SUBST(setgid)
 
815
AC_SUBST(scores_group)
 
816
AC_SUBST(scores_user)
 
817
AC_SUBST(scoredir)
 
818
 
 
819
# *********************
 
820
# GObject Introspection
 
821
# *********************
 
822
 
 
823
GOBJECT_INTROSPECTION_CHECK([0.6.3])
 
824
 
 
825
##############################################
 
826
 
 
827
AC_SUBST([AM_CPPFLAGS])
 
828
AC_SUBST([AM_CFLAGS])
 
829
AC_SUBST([AM_CXXFLAGS])
 
830
AC_SUBST([AM_LDFLAGS])
 
831
 
 
832
##############################################
 
833
##############################################
 
834
 
 
835
AC_CONFIG_FILES([
 
836
Makefile
 
837
po/Makefile.in
 
838
icons/Makefile
 
839
sounds/Makefile
 
840
libgames-support/Makefile
 
841
gnect/Makefile
 
842
gnect/src/Makefile
 
843
gnect/data/Makefile
 
844
gnect/pixmaps/Makefile
 
845
gnect/help/Makefile
 
846
gnomine/Makefile
 
847
gnomine/icons/Makefile
 
848
gnomine/help/Makefile
 
849
swell-foop/Makefile
 
850
swell-foop/help/Makefile
 
851
mahjongg/Makefile
 
852
mahjongg/help/Makefile
 
853
gtali/Makefile
 
854
gtali/pix/Makefile
 
855
gtali/help/Makefile
 
856
iagno/Makefile
 
857
iagno/help/Makefile
 
858
gnotravex/Makefile
 
859
gnotravex/gnotravex.desktop.in
 
860
gnotravex/help/Makefile
 
861
gnotravex/pixmaps/Makefile
 
862
gnotski/Makefile
 
863
gnotski/help/Makefile
 
864
glines/Makefile
 
865
glines/glines.desktop.in
 
866
glines/help/Makefile
 
867
quadrapassel/Makefile
 
868
quadrapassel/pix/Makefile
 
869
quadrapassel/help/Makefile
 
870
gnobots2/Makefile
 
871
gnobots2/help/Makefile
 
872
gnibbles/Makefile
 
873
gnibbles/help/Makefile
 
874
gnibbles/pix/Makefile
 
875
glchess/Makefile
 
876
glchess/data/Makefile
 
877
glchess/data/pieces/Makefile
 
878
glchess/data/pieces/3d/Makefile
 
879
glchess/data/pieces/fancy/Makefile
 
880
glchess/data/pieces/simple/Makefile
 
881
glchess/data/textures/Makefile
 
882
glchess/gnuchess/Makefile
 
883
glchess/help/Makefile
 
884
glchess/src/Makefile
 
885
gnome-sudoku/Makefile
 
886
gnome-sudoku/src/Makefile
 
887
gnome-sudoku/src/lib/Makefile
 
888
gnome-sudoku/src/lib/defs.py
 
889
gnome-sudoku/src/lib/gtk_goodies/Makefile
 
890
gnome-sudoku/data/Makefile
 
891
gnome-sudoku/images/Makefile
 
892
gnome-sudoku/help/Makefile
 
893
swell-foop/data/themes/Makefile
 
894
swell-foop/data/themes/colors/Makefile
 
895
swell-foop/data/themes/shapesandcolors/Makefile
 
896
swell-foop/swell-foop.desktop.in
 
897
swell-foop/src/Makefile
 
898
quadrapassel/quadrapassel.desktop.in
 
899
gnobots2/gnobots2.desktop.in
 
900
gnibbles/gnibbles.desktop.in
 
901
gnotski/gnotski.desktop.in
 
902
glchess/glchess.desktop.in
 
903
mahjongg/mahjongg.desktop.in
 
904
gtali/gtali.desktop.in
 
905
gnome-sudoku/gnome-sudoku.desktop.in
 
906
iagno/iagno.desktop.in
 
907
gnect/data/gnect.desktop.in
 
908
gnomine/gnomine.desktop.in
 
909
lightsoff/Makefile
 
910
lightsoff/help/Makefile
 
911
lightsoff/lightsoff.desktop.in
 
912
lightsoff/data/themes/Makefile
 
913
lightsoff/data/themes/tango/Makefile
 
914
lightsoff/data/themes/up/Makefile
 
915
lightsoff/src/Makefile
 
916
])
 
917
AC_OUTPUT
 
918
 
 
919
echo "
 
920
Configuration:
 
921
 
 
922
    Source code location:  ${srcdir}
 
923
    Compiler:              ${CC}
 
924
 
 
925
    Platform:              ${with_platform}"
 
926
 
 
927
if test -n "$with_platform_variant"; then
 
928
  echo "
 
929
    Platform variant:      ${with_platform_variant}"
 
930
fi
 
931
 
 
932
echo "
 
933
    Games to be compiled:  ${gamelist}
 
934
 
 
935
    GTK+ API version:      ${GTK_API_VERSION}
 
936
    Help method:           ${with_help_method} ${with_help_file_format}
 
937
    Using SM Client:       ${with_smclient}
 
938
    Using RSVG:            ${have_rsvg}
 
939
    Using SQLite:          ${have_sqlite}
 
940
    Card theme formats:    ${with_card_theme_formats}
 
941
    Default theme format:  ${with_default_card_theme_format}
 
942
    Default theme:         ${with_default_card_theme}
 
943
    Sound support:         ${with_sound}
 
944
    Use setgid binaries:   ${enable_setgid}
 
945
    Scores user:           ${scores_user}
 
946
    Scores & setgid group: ${scores_group}
 
947
    Binreloc:              ${enable_binreloc}
 
948
    Introspection data:    ${enable_introspection}
 
949
"
 
950
 
 
951
if grep "$scores_group:" /etc/group > /dev/null; then
 
952
:;
 
953
else
 
954
echo
 
955
echo "Warning: The $scores_group group does not exist. Installation will"
 
956
echo "         succeed, but high score logging will not work. To specify a"
 
957
echo "         different group use the --with-scores-group option."
 
958
echo
 
959
fi
 
960