~taylorp36/ubuntu/wily/aisleriot/bug-1490189

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
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
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
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ([2.53])
AC_INIT([GNOME Patience], [3.14.2],
  [http://bugzilla.gnome.org/enter_bug.cgi?product=aisleriot],
  [aisleriot])

# Must run under bash; see bug 726780
if test -z "$BASH_VERSION"; then
  AC_MSG_ERROR([Set CONFIG_SHELL to bash and try again.])
fi

AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_SRCDIR([src/sol.c])
AC_CONFIG_HEADERS([config.h])

AM_INIT_AUTOMAKE([1.9 no-dist-gzip dist-bzip2 foreign -Wno-portability])

m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])

if test -z "$enable_maintainer_mode"; then
  enable_maintainer_mode=yes
fi
AM_MAINTAINER_MODE([enable])

# *****************************************************************************

PKG_PROG_PKG_CONFIG([0.15])
PKGS=

AC_PROG_CC
AC_PROG_CPP
AC_PROG_LN_S
AC_PROG_MKDIR_P
AC_PROG_SED
AM_PROG_CC_C_O

AC_PROG_LIBTOOL

GNOME_DEBUG_CHECK

# ************
# Dependencies
# ************

# Check which platform to use

AC_MSG_CHECKING([for which platform to build])
AC_ARG_WITH([platform],
  [AS_HELP_STRING([--with-platform=gnome|gtk-only (default: gnome)])],
  [case "$withval" in
    gnome|gtk-only) ;;
    *) AC_MSG_ERROR([invalid argument "$withval" for --with-platform]) ;;
   esac],
  [with_platform=gnome])
AC_MSG_RESULT([$with_platform])

AM_CONDITIONAL([HAVE_GNOME],[test "$with_platform" = "gnome"])

if test "$with_platform" = "gnome"; then
  AC_DEFINE([HAVE_GNOME],[1],[Define if GNOME support is enabled])
fi

# Check which gtk+ major version to use

AC_MSG_CHECKING([which gtk+ version to compile against])
AC_ARG_WITH([gtk],
  [AS_HELP_STRING([--with-gtk=3.0],[which gtk+ version to compile against (default: 3.0)])],
  [case "$with_gtk" in
     3.0) ;;
     [0-9].0) AC_MSG_ERROR([unsupported gtk version $with_gtk specified]) ;;
     *) AC_MSG_ERROR([invalid gtk version specified]) ;;
   esac],
  [with_gtk=3.0])
AC_MSG_RESULT([$with_gtk])

case "$with_gtk" in
  3.0) GTK_API_VERSION=3.0
       GTK_API_MAJOR_VERSION=3
       ;;
esac

AC_SUBST([GTK_API_VERSION])
AC_SUBST([GTK_API_MAJOR_VERSION])

# **************
# Win32 platform
# **************

AC_CANONICAL_HOST

AC_MSG_CHECKING([for some Win32 platform])
case "$host" in
  *-*-cygwin*|*-*-mingw*)
    platform_win32=yes
    ;;
  *)
    platform_win32=no
    ;;
esac
AC_MSG_RESULT([$platform_win32])
AM_CONDITIONAL([PLATFORM_WIN32],[test "$platform_win32" = "yes"])

AC_MSG_CHECKING([for native Win32])
case "$host" in
  *-*-mingw*)
    os_win32=yes
    ;;
  *)
    os_win32=no
    ;;
esac
AC_MSG_RESULT([$os_win32])
AM_CONDITIONAL([PLATFORM_WIN32_NATIVE],[test "$os_win32" = "yes"])

# *******
# Clutter
# *******

AC_MSG_CHECKING([whether to enable clutter])
AC_ARG_WITH([clutter],
  [AS_HELP_STRING([--with-clutter],[Enable the clutter version of aisleriot (default: disabled)])],
  [],[with_clutter=no])
AC_MSG_RESULT([$with_clutter])

if test "$with_clutter" = "yes"; then
  # Distro packagers: DO NOT ENABLE AISLERIOT/CLUTTER IN YOUR DISTRO PACKAGES, OR ELSE!
  AC_MSG_NOTICE([Aisleriot/Clutter is experimental; do not enable this for distribution packages!])
fi

# ******************
# Card theme formats
# ******************

AC_MSG_CHECKING([for requested card theme formats])
AC_ARG_WITH([card-theme-formats],
  [AS_HELP_STRING([--with-card-theme-formats],[which card theme formats to support (svg,fixed,kde,pysol|default|all)])],
  [],[with_card_theme_formats=default])

case "$with_card_theme_formats" in
  default) with_card_theme_formats="svg,pysol" ;;
  all) with_card_theme_formats="svg,kde,fixed,sliced,pysol" ;;
esac

enable_card_theme_format_svg=no
enable_card_theme_format_kde=no
enable_card_theme_format_fixed=no
enable_card_theme_format_sliced=no
enable_card_theme_format_pysol=no
need_rsvg=no

IFS="${IFS=	}"; gg_saved_ifs="$IFS"; IFS=","
for format in $with_card_theme_formats; do
  case "$format" in
    svg) enable_card_theme_format_svg=yes ;;
    kde) enable_card_theme_format_kde=yes ;;
    fixed) enable_card_theme_format_fixed=yes ;;
    sliced) enable_card_theme_format_svg=yes ;;
    pysol) enable_card_theme_format_pysol=yes ;;
    *) IFS="$gg_saved_ifs" AC_MSG_ERROR([unknown card theme format $format requested]) ;;
  esac
done
IFS="$gg_saved_ifs"

AC_MSG_RESULT([$with_card_theme_formats])

if test "$enable_card_theme_format_svg" = "yes"; then
  AC_DEFINE([ENABLE_CARD_THEME_FORMAT_SVG],[1],[Define to enable SVG card theme format support])
  need_rsvg=yes
fi
if test "$enable_card_theme_format_kde" = "yes"; then
  AC_DEFINE([ENABLE_CARD_THEME_FORMAT_KDE],[1],[Define to enable KDE card theme format support])
  need_rsvg=yes
fi
if test "$enable_card_theme_format_fixed" = "yes"; then
  AC_DEFINE([ENABLE_CARD_THEME_FORMAT_FIXED],[1],[Define to enable prerendered card theme format support])
fi
if test "$enable_card_theme_format_sliced" = "yes"; then
  AC_DEFINE([ENABLE_CARD_THEME_FORMAT_SLICED],[1],[Define to enable pre-2.19 card theme format support])
fi
if test "$enable_card_theme_format_pysol" = "yes"; then
  AC_DEFINE([ENABLE_CARD_THEME_FORMAT_PYSOL],[1],[Define to enable PySol card theme format support])
fi

AM_CONDITIONAL([ENABLE_CARD_THEME_FORMAT_SVG],[test "$enable_card_theme_format_svg" = "yes"])
AM_CONDITIONAL([ENABLE_CARD_THEME_FORMAT_KDE],[test "$enable_card_theme_format_kde" = "yes"])
AM_CONDITIONAL([ENABLE_CARD_THEME_FORMAT_FIXED],[test "$enable_card_theme_format_fixed" = "yes"])
AM_CONDITIONAL([ENABLE_CARD_THEME_FORMAT_SLICED],[test "$enable_card_theme_format_sliced" = "yes"])
AM_CONDITIONAL([ENABLE_CARD_THEME_FORMAT_PYSOL],[test "$enable_card_theme_format_pysol" = "yes"])

# Card theme paths

if test -f /etc/os-release; then
  DISTRO="$(source /etc/os-release && echo $ID)"
else
  DISTRO="unknown"
fi

if test "$enable_card_theme_format_kde" = "yes"; then
  AC_MSG_CHECKING([for KDE card themes base path])
  AC_ARG_WITH([kde-card-theme-path],
    [AS_HELP_STRING([--with-kde-card-theme-path],[The base path to the KDE card themes])],
    [],[case "$DISTRO" in
          debian|fedora|rhel|centos|opensuse|ubuntu) with_kde_card_theme_path="/usr/share/kde4/apps/carddecks" ;;
          *) AC_MSG_ERROR([When enabling the KDE card theme format, you must specify the KDE card themes base path.]) ;;
        esac])
  AC_MSG_RESULT([$with_kde_card_theme_path])

  AC_DEFINE_UNQUOTED([KDE_CARD_THEME_PATH],["$with_kde_card_theme_path"],[The base path to the KDE card themes])
fi

if test "$enable_card_theme_format_pysol" = "yes"; then
  AC_MSG_CHECKING([for PySol card themes base path])
  AC_ARG_WITH([pysol-card-theme-path],
    [AS_HELP_STRING([--with-pysol-card-theme-path],[The base path to the PySol card themes])],
    [],[case "$DISTRO" in
          debian|ubuntu) with_pysol_card_theme_path="/usr/share/games/pysol" ;;
          fedora|rhel|centos) with_pysol_card_theme_path="/usr/share/PySolFC" ;;
          opensuse) with_pysol_card_theme_path="/usr/share/games/pysol/data" ;;
          *) AC_MSG_ERROR([When enabling the PySol card theme format, you must specify the PySol card themes base path.]) ;;
        esac])
  AC_MSG_RESULT([$with_pysol_card_theme_path])

  AC_DEFINE_UNQUOTED([PYSOL_CARD_THEME_PATH],["$with_pysol_card_theme_path"],[The base path to the PySol card themes])
fi

# Default card theme

AC_MSG_CHECKING([which card theme to use by default])
AC_ARG_WITH([default-card-theme],
  [AS_HELP_STRING([--with-default-card-theme=NAME],[Which card theme to use by default (default: gnomangelo_bitmap.svgz)])],
  [],[with_default_card_theme="gnomangelo_bitmap.svgz"])
AC_MSG_RESULT([$with_default_card_theme])

AC_DEFINE_UNQUOTED([AR_CARD_THEME_DEFAULT],["$with_default_card_theme"],[The default card theme])

AC_MSG_CHECKING([which card theme format to use by default])
AC_ARG_WITH([default-card-theme-format],
  [AS_HELP_STRING([--with-default-card-theme-format=NAME],[Which card theme format to use by default (default: platform dependent)])],
  [],[with_default_card_theme_format=svg])
AC_MSG_RESULT([$with_default_card_theme_format])

case "$with_default_card_theme_format" in
  svg|kde|fixed|sliced|pysol) ;;
  *) AC_MSG_ERROR([card theme format $with_default_card_theme_format unknown])
esac

AC_DEFINE_UNQUOTED([AR_CARD_THEME_DEFAULT_FORMAT_STRING],["$with_default_card_theme_format"],[The default card theme format type string])

# ******************
# Extra Debugging UI
# ******************

AC_MSG_CHECKING([whether extra debugging UI in Aisleriot is requested])
AC_ARG_ENABLE([debug-ui],
  [AS_HELP_STRING([--debug-ui],[Enable extra debugging UI in Aisleriot (default: disabled)])],
  [],[enable_debug_ui=no])
AC_MSG_RESULT([$enable_debug_ui])

if test "$enable_debug_ui" = "yes"; then
  AC_DEFINE([ENABLE_DEBUG_UI],[1],[Define extra debugging UI in Aisleriot is enabled])
fi

AM_CONDITIONAL([ENABLE_DEBUG_UI],[test "$enable_debug_ui" = "yes"])

# ********************
# Checks for libraries
# ********************

case "$with_gtk" in
  3.0) GTK_REQUIRED=3.4.0
       RSVG_REQUIRED=2.32.0
       LIBCANBERRA_GTK_REQUIRED=0.26
       LIBCANBERRA_GTK_PKGS="libcanberra-gtk3 >= $LIBCANBERRA_GTK_REQUIRED"
       ;;
esac

GCONF_REQUIRED=2.0
GLIB_REQUIRED=2.32.0
GIO_REQUIRED=2.32.0

# Check for common modules

PKGS="$PKGS gtk+-$GTK_API_VERSION >= $GTK_REQUIRED"

# *****
# Sound
# *****

AC_MSG_CHECKING([whether to enable sound support])
AC_ARG_ENABLE([sound],
  [AS_HELP_STRING([--enable-sound],[Enable sound using libcanberra])],
  [],[enable_sound=yes])
AC_MSG_RESULT([$enable_sound])

if test "$enable_sound" = "yes"; then
  PKGS="$PKGS $LIBCANBERRA_GTK_PKGS"

  AC_DEFINE([ENABLE_SOUND],[1],[Define if sound support is enabled])
fi

AM_CONDITIONAL([ENABLE_SOUND],[test "$enable_sound" = "yes"])

# *********
# GSettings
# *********

GLIB_GSETTINGS

# Check for GNOME modules

AM_GCONF_SOURCE_2
AC_PATH_PROG([GCONFTOOL],[gconftool-2])

if test "$with_platform" = "gnome"; then
  PKGS="$PKGS gconf-2.0 >= $GCONF_REQUIRED"
fi

# Check for librsvg

have_rsvg=no
if test "$need_rsvg" = "yes"; then
  have_rsvg=yes

  CAIRO_REQUIRED=1.10.0

  PKGS="$PKGS librsvg-2.0 >= $RSVG_REQUIRED cairo >= $CAIRO_REQUIRED"

  AC_DEFINE([HAVE_RSVG],[1],[Refine if librsvg is available])
fi

AM_CONDITIONAL([HAVE_RSVG],[test "$have_rsvg" = "yes"])

# Check for Clutter

if test "$with_clutter" = "yes"; then
  CLUTTER_REQUIRED=1.0.0

  PKG_CHECK_MODULES([CLUTTER],[clutter-1.0 >= $CLUTTER_REQUIRED])
  AC_SUBST([CLUTTER_CFLAGS])
  AC_SUBST([CLUTTER_LIBS])

  case "$with_gtk" in
    3.0) CLUTTER_GTK_API_VERSION=1.0
         CLUTTER_GTK_REQUIRED=0.91.6
         ;;
  esac

  PKG_CHECK_MODULES([CLUTTER_GTK],[clutter-gtk-$CLUTTER_GTK_API_VERSION >= $CLUTTER_GTK_REQUIRED])
  AC_SUBST([CLUTTER_GTK_CFLAGS])
  AC_SUBST([CLUTTER_GTK_LIBS])
fi

AM_CONDITIONAL([HAVE_CLUTTER],[test "$with_clutter" = "yes"])

# *****************
# Extra build tools
# *****************

AC_ARG_VAR([GLIB_GENMARSHAL],[the glib-genmarshal programme])
AC_PATH_PROG([GLIB_GENMARSHAL],[glib-genmarshal],[])
if test -z "$GLIB_GENMARSHAL"; then
  AC_MSG_ERROR([glib-genmarshal not found])
fi

AC_ARG_VAR([GLIB_COMPILE_RESOURCES],[the glib-compile-resources programme])
AC_PATH_PROG([GLIB_COMPILE_RESOURCES],[glib-compile-resources],[])
if test -z "$GLIB_COMPILE_RESOURCES"; then
  AC_MSG_ERROR([glib-compile-resources not found])
fi

AC_ARG_VAR([GZIP],[the gzip programme])
AC_PATH_PROG([GZIP],[gzip],[])
if test -z "$GZIP"; then
  AC_MSG_ERROR([gzip not found])
fi

AC_ARG_VAR([XMLLINT],[the xmllint programme])
AC_PATH_PROG([XMLLINT],[xmllint],[])
if test -z "$XMLLINT"; then
  AC_MSG_ERROR([xmllint not found])
fi

AC_ARG_VAR([DESKTOP_FILE_VALIDATE],[the desktop-file-validate programme])
AC_PATH_PROG([DESKTOP_FILE_VALIDATE],[desktop-file-validate],[])
if test -z "$DESKTOP_FILE_VALIDATE"; then
  AC_MSG_ERROR([desktop-file-validate not found])
fi

AC_ARG_VAR([APPDATA_VALIDATE],[the appdata-validate programme])
AC_PATH_PROG([APPDATA_VALIDATE],[appdata-validate],[])
if test -z "$APPDATA_VALIDATE"; then
  AC_MSG_ERROR([appdata-validate not found])
fi

if test "$platform_win32" = "yes" -a "$os_win32" = "yes"; then
  AC_CHECK_TOOL([WINDRES],[windres],[no])
  if test "$WINDRES" = "no"; then
    AC_MSG_ERROR([windres is required for native win32])
  fi
fi

# ********
# Binreloc
# ********

AC_MSG_CHECKING([whether to enable binary relocation support])
AC_ARG_ENABLE([binreloc],
  [AS_HELP_STRING([--enable-binreloc],[enable binary relocation support (default: disabled)])],
  [],
  [enable_binreloc="$platform_win32"])
AC_MSG_RESULT([$enable_binreloc])

if test "$enable_binreloc" = "yes"; then

  # Check that all variables use the same prefix
  # Note: datarootdir exists only since autoconf 2.60, so we have to
  # check for the old and the new form of datadir.
  if test "$exec_prefix" != '${prefix}' -o \
          "$bindir" != '${exec_prefix}/bin' -o \
          "$sbindir" != '${exec_prefix}/sbin' -o \
          "$libdir" != '${exec_prefix}/lib' -o \
          "$libexecdir" != '${exec_prefix}/libexec' -o \
          "$sysconfdir" != '${prefix}/etc' -o \
          "$localstatedir" != '${prefix}/var' -o \
          \( -n "$datarootdir" -a "$datarootdir" != '${prefix}/share' \) -o \
          \( "$datadir" != '${datarootdir}' -a "$datadir" != '${prefix}/share' \) -o \
          \( "$localedir" != '${datarootdir}/locale' -a "$localedir" != '${datadir}/locale' \) -o \
          \( "$mandir" != '${datarootdir}/man' -a "$mandir" != '${datadir}/man' \); then
    AC_MSG_ERROR([cannot use binary relocation with different prefixes])
  fi

  AC_DEFINE([ENABLE_BINRELOC],[1],[Define for binary relocation support])
fi

# ***********
# Compilation
# ***********

save_CFLAGS="$CFLAGS"
CFLAGS=
CC_CHECK_CFLAGS_APPEND([ \
  -Wall -Wextra \
  -Wformat-nonliteral -Werror=format-security \
  -Wsign-compare -Werror=implicit-function-declaration \
  -Wpointer-arith -Wwrite-strings -Wstrict-prototypes \
  -Waggregate-return -Wcast-align -Wimplicit -Wuninitialized \
  -Wmissing-prototypes -Wmissing-declarations -Wnested-externs \
  -Wpacked -Wmissing-format-attribute -Wshadow -Wlogical-op \
  -Wstrict-aliasing=2 -Winit-self -Wunsafe-loop-optimizations \
  -Wdeclaration-after-statement -Wold-style-definition \
  -Wno-missing-field-initializers -Wno-unused-parameter \
  -Wempty-body \
  -fno-common -Wno-switch-enum])
AM_CFLAGS="$AM_CFLAGS $CFLAGS"
CFLAGS="$save_CFLAGS"

# ****
# i18n
# ****

GETTEXT_PACKAGE=aisleriot
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [The gettext package name])
AM_GLIB_GNU_GETTEXT

IT_PROG_INTLTOOL([0.35.0])

# *****
# Guile
# *****

GUILE_2_0_REQUIRED=2.0.0
GUILE_2_2_REQUIRED=2.1.0

GUILE_PKGS=

AC_MSG_CHECKING([which guile version to use])
AC_ARG_WITH([guile],
  [AS_HELP_STRING([--with-guile=2.0|2.2|auto],[Which guile version to use (default: 2.0)])],
  [case "$with_guile" in
     1.8) AC_MSG_ERROR([unsupported guile version $with_guile requested]) ;;
     2.0|2.2|auto) ;;
     *) AC_MSG_ERROR([unsupported guile version $with_guile requested]) ;;
    esac],
   [with_guile=2.0])

if test "$with_guile" = "auto"; then
  with_guile=
  for version in 2.2 2.0; do
    GUILE_REQUIRED=AS_TR_SH([GUILE_${version}_REQUIRED])
    GUILE_PKGS="guile-$version >= ${!GUILE_REQUIRED}"
    if $PKG_CONFIG --exists $GUILE_PKGS; then
      with_guile=$version
      break
    fi
  done

  if test -z "$with_guile"; then
    AC_MSG_ERROR([no supported guile version found])
  fi

  with_guile_result="$with_guile (auto)"
else
  GUILE_REQUIRED=AS_TR_SH([GUILE_${with_guile}_REQUIRED])
  GUILE_PKGS="guile-$with_guile >= ${!GUILE_REQUIRED}"
  with_guile_result="$with_guile"
fi

AC_MSG_RESULT([$with_guile_result])

PKGS="$PKGS $GUILE_PKGS"

AC_SUBST([GUILE_EFFECTIVE_VERSION],[$with_guile])

AC_ARG_VAR([GUILE],[the guile programme])
AC_PATH_PROG([GUILE],[guile],[false])
if test "$GUILE" = "false"; then
  AC_MSG_ERROR([guile not found])
fi

# ************
# Dependencies
# ************

PKG_CHECK_MODULES([AISLERIOT],[$PKGS])
AC_SUBST([AISLERIOT_CFLAGS])
AC_SUBST([AISLERIOT_LIBS])

# *************
# Documentation
# *************

# We support various ways to present help to the user:
# ghelp: using the ghelp: protocol, most likely displaying in Yelp
# file: showing html or xhtml files in the web browser
# library: in the web browser loaded remotedly from library.gnome.org
#
# Note that for help using [x]html files, we can't use gnome-doc-utils.make
# since it doesn't currently support this. The packager will have to use
# gnome-doc-tool directly to build the documentation in the right format.
# The help files must be installed in $(pkgdatadir)/$(DOC_MODULE)/$(LOCALE) .

AC_MSG_CHECKING([which help method to use])
AC_ARG_WITH([help-method],
  [AS_HELP_STRING([--with-help-method],[which help method to use (ghelp|file|library; default: ghelp)])],
  [],
  [if test "$platform_win32" = "yes"; then
     with_help_method=file
   else
     with_help_method=ghelp
   fi])
AC_MSG_RESULT([$with_help_method])

case "$with_help_method" in
  ghelp) AC_DEFINE([WITH_HELP_METHOD_GHELP],[1],[Define to use help using ghelp]) ;;
  file) AC_DEFINE([WITH_HELP_METHOD_FILE],[1],[Define to use help using file]) ;;
  library) AC_DEFINE([WITH_HELP_METHOD_LIBRARY],[1],[Define to use help using library.gnome.org]) ;;
  *) AC_MSG_ERROR([unknown help method "$with_help_method"]) ;;
esac

if test "$with_help_method" = "file"; then
  AC_MSG_CHECKING([for help file format])
  AC_ARG_WITH([help-file-format],
    [AS_HELP_STRING([--with-help-file-format],[which file format to use for help (html|xhtml; default: html)])],
    [case "$with_help_file_format" in
       html|xhtml) ;;
       *) AC_MSG_ERROR([unknown help file format "$with_help_file_format"]) ;;
     esac],
    [with_help_file_format=html])
  AC_MSG_RESULT([$with_help_file_format])

  AC_DEFINE_UNQUOTED([HELP_FILE_FORMAT],["$with_help_file_format"],[The help file format])
fi

YELP_HELP_INIT([no-lc-media-links no-lc-dist])

AM_CONDITIONAL([BUILD_HELP],[test "$with_help_method" = "ghelp"])

# ********
# Valgrind
# ********

AC_ARG_WITH([valgrind-dir],
  [AC_HELP_STRING([--with-valgrind-dir=PATH],[directory to install Valgrind suppressions to])],
  [],[with_valgrind_dir='${libdir}/valgrind'])
AC_SUBST([valgrinddir],[$with_valgrind_dir])

##############################################

AC_SUBST([AM_CPPFLAGS])
AC_SUBST([AM_CFLAGS])
AC_SUBST([AM_CXXFLAGS])
AC_SUBST([AM_LDFLAGS])

##############################################
##############################################

AC_CONFIG_FILES([
Makefile
cards/Makefile
data/Makefile
data/icons/Makefile
data/sounds/Makefile
data/sol.desktop.in
games/Makefile
help/Makefile
po/Makefile.in
src/Makefile
src/lib/Makefile
src/aisleriot.gresource.xml
])
AC_OUTPUT

echo "
Configuration:

    Source code location:  ${srcdir}
    Compiler:              ${CC}

    Guile version:         ${with_guile_result}
    GTK+ API version:      ${GTK_API_VERSION}
    Platform:              ${with_platform}
    Help method:           ${with_help_method} ${with_help_file_format}
    Using RSVG:            ${have_rsvg}
    Card theme formats:    ${with_card_theme_formats}
    Default theme format:  ${with_default_card_theme_format}
    Default theme:         ${with_default_card_theme}
    Sound support:         ${with_sound}
    Binreloc:              ${enable_binreloc}
"