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

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
#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.


AC_PREREQ([2.53])
AC_INIT([gnome-games], [2.13.3],
        [http://bugzilla.gnome.org/enter_bug.cgi?product=gnome-games])
AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR([gnomine/gnomine.c])
AC_CONFIG_HEADERS([config.h])
AM_MAINTAINER_MODE

# Locate various programs
AC_PROG_CC
AC_PROG_CPP
AC_PROG_CXX
AC_PROG_INTLTOOL([0.29])
AC_PROG_LIBTOOL
AC_PROG_LN_S

dnl make sure we keep ACLOCAL_FLAGS around for maintainer builds to work
AC_SUBST(ACLOCAL_AMFLAGS, "$ACLOCAL_FLAGS")

# See if C++ support is actually there and tell automake about it
# so we can conditionally compile.
AC_CHECK_PROG(CXX_PRESENT, $CXX, yes, no)
AM_CONDITIONAL([HAVE_CXX], [test "x$CXX_PRESENT" = xyes])

dnl Checking for the header file is basically the only way to find
dnl out if the _development_ files are present. guile-config returns
dnl a value regardless of what is actually installed. The problem
dnl with this is if the header ever gets moved to a non-default location.
AC_CHECK_HEADER([libguile.h], [GUILE_PRESENT=yes], [GUILE_PRESENT=no])
if test "$GUILE_PRESENT" = "yes" ; then
  GUILE_CFLAGS=`guile-config compile`
  GUILE_LDFLAGS=`guile-config link`
  AC_SUBST(GUILE_CFLAGS)
  AC_SUBST(GUILE_LDFLAGS)
  dnl On 64-bit machines guile < 1.6.5 causes a crash in aisleriot.
  dnl But since 1.6.5 is only a few months old as I write this we 
  dnl will be more lenient with 32-bit machines.
  if uname -m | grep -q 64 ; then
     GUILE_TARGET="1.6.5"
  else 
     GUILE_TARGET="1.6.0"
  fi
  if test `guile -c '(if (string<? (version) (cadr (command-line))) (display "no") (display "yes")) (newline)' $GUILE_TARGET` != yes ; then 
    GUILE_PRESENT="no"
    AC_MSG_WARN([Your version of guile is too old, please install a recent guile package (>= $GUILE_TARGET)])
  fi
fi
AM_CONDITIONAL([HAVE_GUILE], [test "x$GUILE_PRESENT" = xyes])

GNOME_COMPILE_WARNINGS(yes)
GNOME_CXX_WARNINGS(yes)

# If gob2 is absent or an inappropriate version, then GOB2 will be
# set to the empty string.
GOB2_CHECK(2.0.0) 
   

AM_GCONF_SOURCE_2
AC_PATH_PROG(GCONFTOOL, gconftool-2)


## Begin tests for scrollkeeper
# SCROLLKEEPER_REQUIRED is never used?
SCROLLKEEPER_REQUIRED=0.3.8
AC_SUBST(SCROLLKEEPER_REQUIRED)


AC_PATH_PROG(SCROLLKEEPER_CONFIG, scrollkeeper-config,no)
if test x$SCROLLKEEPER_CONFIG = xno; then
  AC_MSG_ERROR([Couldn't find scrollkeeper-config, please install the scrollkeeper package])
fi

# Checks for libraries.
LIBGNOMEUI_REQUIRED=1.105.0
LIBGNOME_REQUIRED=1.105.0
GTK_REQUIRED=2.8.0
GCONF_REQUIRED=2.0
LIBRSVG_REQUIRED=2.0
CAIRO_REQUIRED=1.0

## Common flags for libraries that all games use.
PKG_CHECK_MODULES(GNOME_GAMES, libgnome-2.0 >= $LIBGNOME_REQUIRED gconf-2.0 >= $GCONF_REQUIRED libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED gtk+-2.0 >= $GTK_REQUIRED librsvg-2.0 >= $LIBRSVG_REQUIRED)
AC_SUBST(GNOME_GAMES_CFLAGS)
AC_SUBST(GNOME_GAMES_LIBS)

## Flags for Cairo
PKG_CHECK_MODULES(CAIRO, cairo)
AC_SUBST(CAIRO_CFLAGS)
AC_SUBST(CAIRO_LIBS)

## Flags for glade
## We need gmodule to ensure --export-dynamic is used and
##  glade_xml_signal_autoconnect works.
PKG_CHECK_MODULES(GLADE, libglade-2.0 gmodule-2.0)
AC_SUBST(GLADE_CFLAGS)
AC_SUBST(GLADE_LIBS)

## Flags for Howl. Use of this library is optional.
AC_ARG_ENABLE(howl, [  --disable-howl          build without howl support])
if test "x$enable_howl" != "xno"; then
	PKG_CHECK_MODULES(HOWL, howl >= 0.9.6, [ HOWL_EXTRA_CFLAGS="-DHAVE_ZEROCONF -DHAVE_HOWL" msg_zeroconf="howl" ],
			  [ msg_zeroconf="none" ])
        HOWL_CFLAGS="${HOWL_CFLAGS} ${HOWL_EXTRA_CFLAGS}"
	AC_SUBST(HOWL_CFLAGS)
	AC_SUBST(HOWL_LIBS)
else
	msg_zeroconf="none"
fi

## Flags for Bonjour. Use of this library is optional and mutually exclusive with Howl.
AC_ARG_ENABLE(bonjour, [  --enable-bonjour        build with bonjour support])
if test "x$enable_bonjour" = "xyes"; then
	if test "x${HOWL_LIBS}" != "x"; then
		echo "WARNING: Bonjour and Howl are mutually exclusive. Using Bonjour."
		HOWL_CFLAGS=""
		HOWL_LIBS=""
	fi
	CPPFLAGS_save="$CPPFLAGS"
	LDFLAGS_save="$LDFLAGS"
	AC_ARG_WITH(bonjour-includes, [  --with-bonjour-includes=PREFIX     Location of Bonjour includes.],  with_bonjour_includes="$withval", with_bonjour_includes="/usr/include")

	CPPFLAGS="$CPPFLAGS -I$with_bonjour_includes"
	AC_CHECK_HEADER(dns_sd.h, , AC_MSG_ERROR([Unable to find Bonjour includes]))
	CPPFLAGS="$CPPFLAGS_save"

	if test x$with_bonjour_includes != x/usr/include; then
		BONJOUR_CFLAGS="-I$with_bonjour_includes -DHAVE_ZEROCONF -DHAVE_BONJOUR"
	else
		BONJOUR_CFLAGS="-DHAVE_ZEROCONF -DHAVE_BONJOUR"
	fi

	AC_ARG_WITH(bonjour-libs, [  --with-bonjour-libs=PREFIX     	Location of Bonjour libs.],
				  with_bonjour_libs="$withval", with_bonjour_libs="/usr/lib")

	LDFLAGS="$LDFLAGS -L$with_bonjour_libs -ldns_sd"
	AC_TRY_LINK_FUNC(DNSServiceResolve, , AC_MSG_ERROR([Unable to find Bonjour libs]))
	LDFLAGS="$LDFLAGS_save"

	if test x$with_bonjour_libs != x/usr/lib; then
		BONJOUR_LIBS="-L$with_bonjour_libs -ldns_sd"
	else
		BONJOUR_LIBS="-ldns_sd"
	fi

	msg_zeroconf="bonjour"
	AC_DEFINE(HAVE_BONJOUR, 1, [Define to 1 if Bonjour is available and desired])

	AC_SUBST(BONJOUR_CFLAGS)
	AC_SUBST(BONJOUR_LIBS)
fi

GNOME_GAMES_CXXFLAGS="$GNOME_GAMES_CFLAGS -I\$(top_srcdir)/libgames-support $WARN_CXXFLAGS"
GNOME_GAMES_CFLAGS="$GNOME_GAMES_CFLAGS -I\$(top_srcdir)/libgames-support $WARN_CFLAGS"

## Use a separate set of flags for C++ (so we can exclude -std=gnu89 for
## example, it doesn't make sense under C++).
GNOME_GAMES_CXXFLAGS="$GNOME_GAMES_CXXFLAGS"
AC_SUBST(GNOME_GAMES_CXXFLAGS)

## This should make sure that developers using gcc 3.x will write something
## that compiles using gcc 2.9x. Straight -ansi is a little tough given the
## current code base, although what breaks is probably not that portable.
if test x$CC=xgcc ; then
  GNOME_GAMES_CFLAGS="-std=gnu89 $GNOME_GAMES_CFLAGS"
fi

## Check for some special cases
OS_FLAGS=""
case "$ac_cv_build" in
     *-*-osf1-* ) OS_FLAGS="-D_POSIX_PII_SOCKET" ;;
esac
GNOME_GAMES_CFLAGS="$OS_FLAGS $GNOME_GAMES_CFLAGS"

PKG_CHECK_MODULES(ESD, esound, , [
  GNOME_GAMES_CFLAGS="$GNOME_GAMES_CFLAGS -DNO_ESD"
  GNOME_GAMES_CXXFLAGS="$GNOME_GAMES_CXXFLAGS -DNO_ESD" ])
AC_SUBST(ESD_CFLAGS)
AC_SUBST(ESD_LIBS)

GETTEXT_PACKAGE=gnome-games
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [The gettext package name])
ALL_LINGUAS="am ar az be bg bn ca cs cy da de el en_CA en_GB es et eu fa fi fr ga gl gu he hi hr hu id is it ja ko ku lt lv mk ml mn ms nb ne nl nn no pa pl pt pt_BR ro ru rw sk sl sq sr sr@Latn sv ta th tr uk vi wa xh zh_CN zh_TW"
AM_GLIB_GNU_GETTEXT
# Since there is controversy over using it, we will check for it.
AC_CHECK_FUNCS(ngettext getpwuid)

# Check for header files
AC_HEADER_STDC


# Checks for typedefs, structures, and compiler characteristics
AC_HEADER_STDBOOL
AC_C_CONST
AC_C_INLINE

if test "x${prefix}" = "xNONE"; then
   AC_DEFINE_UNQUOTED(GNOME_ICONDIR, "${ac_default_prefix}/share/pixmaps", [Pix
map directory])
else
   AC_DEFINE_UNQUOTED(GNOME_ICONDIR, "${prefix}/share/pixmaps", [Pixmap directo
ry])
fi

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(OS_WIN32, test "$os_win32" = "yes")

AC_ARG_ENABLE(setgid,
  [  --disable-setgid           Disable the use of setgid binaries],
  [case "${enableval}" in
    yes) setgid=true ;;
    no)  setgid=false ;;
    *) AC_MSG_ERROR(bad value ${enableval} for --disable-setgid) ;;
   esac],[setgid=true])
AC_SUBST(setgid)

AC_ARG_WITH(scores-group,
[  --with-scores-group=group    Group for the high score tables and binaries],
scores_group="$withval",scores_group="games")
AC_SUBST(scores_group)
AC_ARG_WITH(scores-user,
[  --with-scores-user=user    User for the high score tables],
scores_user="$withval",scores_user="games")
AC_SUBST(scores_user)

scoredir='${localstatedir}/games'
AC_SUBST(scoredir)

BUILD_BREAKER_BASIC="-Werror -Wextra -Wfloat-equal -Wmissing-declarations -Wredundant-decls -Wold-style-definition -Wmissing-noreturn -Wdeclaration-after-statement -Wshadow -Wendif-labels -Wlarger-than-4000 -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wundef -Wunreachable-code -fdata-sections"
MEGA_BUILD_BREAKER="-DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGNOME_DISABLE_DEPRECATED -Wstrict-prototypes -Wbad-function-cast"

AC_ARG_ENABLE(build-breaker,
  [  --enable-build-breaker      Enable extra compiler warnings],
  [GNOME_GAMES_CFLAGS="$GNOME_GAMES_CFLAGS $BUILD_BREAKER_BASIC"
   GNOME_GAMES_CXXFLAGS="$GNOME_GAMES_CXXFLAGS $BUILD_BREAKER_BASIC"])
AC_ARG_ENABLE(mega-build-breaker,
  [  --enable-mega-build-breaker Enable extra compiler options that are 
			      almost guaranteed to stop compilation.],
  [GNOME_GAMES_CFLAGS="$GNOME_GAMES_CFLAGS $BUILD_BREAKER_BASIC $MEGA_BUILD_BREAKER"
   GNOME_GAMES_CXXFLAGS="$GNOME_GAMES_CXXFLAGS $BUILD_BREAKER_BASIC $MEGA_BUILD_BREAKER"])  


## Handle the disabling and enabling of games

# This is the canonical list of all game subdirectories.
allgames="aisleriot blackjack gnometris gnect gnomine same-gnome mahjongg gtali gataxx gnotravex gnotski glines iagno gnobots2 gnibbles"

gamelist=""

## This has a particularly silly name because autoconf doesn't allow 
## --disable-foo to have arguments so we have to use an --enable-fubar form.
AC_ARG_ENABLE(omitgames, [  --enable-omitgames=list     Don't compile games in the comma separated list.
                              ("all" and "none" are valid)])
if test "x${enable_omitgames}" != "x"; then
   enable_omitgames=`echo ,"${enable_omitgames}", | sed -e 's/[[	,]][[	,]]*/ /g' -e 's/,$//'`
   omittedgames=""
   gamelist=""
   for item in ${enable_omitgames}; do
     for game in ${allgames}; do
       case ${item} in
	  all) omittedgames=${allgames};;
	  none) omittedgames="";;
          ${game}) omittedgames="${game} ${omittedgames}";;
	  *) ;; 
        esac
     done
   done
   echo ${omittedgames}
   for game in ${allgames}; do
     case ${omittedgames} in
       *${game}*) ;;
       *) gamelist="${gamelist} ${game}";;
     esac
   done
else
   gamelist=${allgames} # Everything on by default
fi

AC_ARG_ENABLE(games, [  --enable-games=list         Enable the games in the comma separated list
			      ("all" and "none" are valid)])
if test "x${enable_games}" != "x"; then
   enable_games=`echo ,"${enable_games}", | sed -e 's/[[	,]][[	,]]*/ /g' -e 's/,$//'`
   for item in ${enable_games}; do
     for game in ${allgames}; do
       case ${item} in
	  all) gamelist=${allgames};;
	  none) gamelist="";;
          ${game}) gamelist="${gamelist} ${game}";;
	  *) ;; 
        esac
     done
   done
fi

AC_SUBST(gamelist)
AC_SUBST(allgames)

AC_CONFIG_FILES([
gnome-games.spec
Makefile
po/Makefile.in
libgames-support/Makefile
blackjack/Makefile
blackjack/data/Makefile
blackjack/help/Makefile
blackjack/help/C/Makefile
blackjack/pixmaps/Makefile
blackjack/src/Makefile
gnect/Makefile
gnect/src/Makefile
gnect/data/Makefile
gnect/pixmaps/Makefile
gnect/help/Makefile
gnect/help/C/Makefile
gnomine/Makefile
gnomine/help/Makefile
gnomine/help/C/Makefile
same-gnome/Makefile
same-gnome/help/Makefile
same-gnome/help/C/Makefile
mahjongg/Makefile
mahjongg/help/Makefile
mahjongg/help/C/Makefile
gtali/Makefile
gtali/pix/Makefile
gtali/help/Makefile
gtali/help/C/Makefile
gtali/help/da/Makefile
iagno/Makefile
iagno/sounds/Makefile
iagno/help/Makefile
iagno/help/C/Makefile
gataxx/Makefile
gataxx/help/Makefile
gataxx/help/C/Makefile
gnotravex/Makefile
gnotravex/help/Makefile
gnotravex/help/C/Makefile
gnotski/Makefile
gnotski/help/Makefile
gnotski/help/C/Makefile
glines/Makefile
glines/help/Makefile
glines/help/C/Makefile
gnometris/Makefile
gnometris/pix/Makefile
gnometris/sounds/Makefile
gnometris/help/Makefile
gnometris/help/C/Makefile
gnobots2/Makefile
gnobots2/help/Makefile
gnobots2/help/C/Makefile
gnobots2/help/da/Makefile
gnobots2/help/es/Makefile
gnobots2/help/it/Makefile
gnibbles/Makefile
gnibbles/help/Makefile
gnibbles/help/C/Makefile
gnibbles/pix/Makefile
gnibbles/sounds/Makefile
aisleriot/Makefile
aisleriot/rules/Makefile
aisleriot/help/Makefile
aisleriot/help/C/Makefile
aisleriot/help/fr/Makefile
])
AC_OUTPUT

echo "
Configuration:

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

	Games to be compiled:		  ${gamelist}

	C++ compiler found	
	(Gnometris and Blackjack):	   ${CXX_PRESENT}
	Guile found (Aisleriot):	   ${GUILE_PRESENT}

        Use setgid binaries                ${setgid}
        Scores user                        ${scores_user}
        Scores & setgid group              ${scores_group}

        Zeroconf support:                  ${msg_zeroconf}
"

if grep -q "$scores_group:" /etc/group ; then
:;
else
echo
echo "Warning: The $scores_group group does not exist. Installation will"
echo "         succeed, but high score logging will not work. To specify a"
echo "         different group use the --with-scores-group option."
echo
fi

libgnomeprefix=`pkg-config libgnome-2.0 --variable=prefix`
if test x$libgnomeprefix = x$prefix -o x$libgnomeprefix = x$prefix/ ; then
:;
else
echo "Warning: This package is not being installed with the same prefix"
echo "         as libgnome. This may lead to problems with the high"
echo "         score tables not being found correctly. The solution"
echo "         is to use the --localstatedir option. For example,"
echo "         Red Hat 9 and Fedora need --localstatedir=/var/lib if you"
echo "         are using the default libgnome package since scores are"
echo "         stored in /var/lib/games/."
echo
fi

if echo foo | xgettext --from-code=UTF-8 -LC -o - - 2>/dev/null ; then 
:; 
else 
echo "Warning: Your version of gettext does not support --from-code."
echo "         This will cause translation of some strings in non US-English"
echo "         locales to fail. For full support please upgrade to GNU"
echo "         gettext 0.12 or later."
echo
fi