File: configure.in

package info (click to toggle)
xpuyopuyo 0.9.8-3
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 4,716 kB
  • ctags: 1,024
  • sloc: sh: 9,317; ansic: 7,958; makefile: 239
file content (313 lines) | stat: -rw-r--r-- 8,666 bytes parent folder | download | duplicates (2)
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
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.12)
AC_INIT(xpuyopuyo.c)
AM_INIT_AUTOMAKE(xpuyopuyo, 0.9.8)
AM_CONFIG_HEADER(config.h)
AM_MAINTAINER_MODE


dnl Watch out for problems with prefix, datadir
dnl
test "x$prefix" = "xNONE" && prefix="$ac_default_prefix"
test "x$datadir" = 'x${prefix}/share' && datadir="${prefix}/share"
test "x$mandir" = 'x${prefix}/man' && mandir="${prefix}/man"


dnl Checks for programs.
test "x$CFLAGS" = "x" && CFLAGS="-O2 -fomit-frame-pointer -finline-functions -funroll-loops -fthread-jumps"
CFLAGS="$CFLAGS -Wall -Wpointer-arith"
AC_CANONICAL_HOST
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_LN_S
AM_PROG_LIBTOOL


dnl Which rotation style?
AC_MSG_CHECKING([for --enable-rotate-fixed flag])
AC_ARG_ENABLE(rotate-fixed, [  --enable-rotate-fixed   Fix position of one blob during rotation [no]], , enable_rotate_fixed=no)
if test "x$enable_rotate_fixed" != "xyes"; then
   AC_MSG_RESULT([using old style rotation behavior])
   USE_NEW_ROTATE=0
else
   AC_MSG_RESULT([using fixed blob rotation])
   USE_NEW_ROTATE=1
fi
AC_SUBST(USE_NEW_ROTATE)


dnl Use network support?
AC_MSG_CHECKING([for --enable-network flag])
AC_ARG_ENABLE(network, [  --enable-network        Enable network gameplay [yes]], , enable_network=yes)
if test "x$enable_network" != "xyes"; then
   AC_MSG_RESULT([Network play not enabled])
   USE_NETWORK=0
else
   AC_MSG_RESULT([Network enabled])
   USE_NETWORK=1
fi
AC_SUBST(USE_NETWORK)


dnl Check for --with-mikmod flags
AM_PATH_LIBMIKMOD(3.1.9, [MIKMOD=1; CFLAGS="$CFLAGS -DMIKMOD=1"], [MIKMOD=0; CFLAGS="$CFLAGS -DMIKMOD=0"])
AC_SUBST(MIKMOD)


dnl Check for AIBREED flag
AC_MSG_CHECKING([for --enable-aibreed flag])
AC_ARG_ENABLE(aibreed, [  --enable-aibreed        Allow AI breeding [no] (not recommended)], , enable_aibreed=no)
if test "x$enable_aibreed" != "xyes"; then 
   AC_MSG_RESULT([not enabled])
   USE_AIBREED=0
else 
   AC_MSG_RESULT([enabled (This option is not recommended however!)])
   USE_AIBREED=1
fi
AC_SUBST(USE_AIBREED)


dnl Which AI code?
AC_MSG_CHECKING([for --enable-lisp-ai flag])
AC_ARG_ENABLE(rotate-fixed, [  --enable-lisp-ai        Enable lisp-AI code (not currently recommended) [no]], , enable_lisp_ai=no)
if test "x$enable_lisp_ai" != "xyes"; then
   AC_MSG_RESULT([using old style AI code]) 
   USE_LISP_AI=0
else
   AC_MSG_RESULT([using newer lisp AI code (not currently recommended!)])
   USE_LISP_AI=1
fi
AC_SUBST(USE_LISP_AI)
AM_CONDITIONAL(USE_LISP_AI, test "x$USE_LISP_AI" != "x0")


dnl Check for profiling 
AC_MSG_CHECKING([for --enable-profiling flag])
AC_ARG_ENABLE(profiling, [  --enable-profiling      Enable profiling [no] (not recommended)], , enable_profiling=no)
if test "x$enable_profiling" != "xyes"; then
   AC_MSG_RESULT([not enabled])
else
   AC_MSG_RESULT([enabled (This option is not recommended however!)])
   CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage"
fi


dnl Check for --with-gtk flags
AC_MSG_CHECKING([for --with-gtk flag])
AC_ARG_WITH(gtk, [  --with-gtk[=prefix]     Use GTK [yes]], , with_gtk=yes)
if test "x$with_gtk" = "xno"; then
   AC_MSG_RESULT([without GTK])
   GTK_CONFIG=no
elif test "x$with_gtk" != "xyes"; then
   GTK_SEARCH_PATH="${with_gtk}:${with_gtk}/bin/:$PATH"
   AC_MSG_RESULT("$with_gtk")
   AC_PATH_PROG(GTK_CONFIG, gtk-config, no, "$GTK_SEARCH_PATH")
else
   dnl Check for GTK in default path to decide whether or not to build GTK frontend
   AC_MSG_RESULT([search for gtk-config])
   AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
fi


dnl Decide whether or not to build GTK
AM_CONDITIONAL(GTK, test "x$GTK_CONFIG" != "xno")
if test "x$GTK_CONFIG" = "xno"; then
   echo "gtk-config not found, disabling GTK frontend"
   GTK=0
   GTK_LIBS=""
   GTK_CFLAGS=""        
   CFLAGS="$CFLAGS -DGTK=0"
   AC_MSG_ERROR([GTK is required for this program])
else
   GTK=1
   GTK_VERSION=`$GTK_CONFIG --version`
   GTK_LIBS=`$GTK_CONFIG --libs`
   GTK_CFLAGS=`$GTK_CONFIG --cflags`
   echo "GTK frontend will be built, $GTK_CONFIG, version $GTK_VERSION"
   echo "GTK link flags: $GTK_LIBS"
   echo "GTK compile flags: $GTK_CFLAGS"
   CFLAGS="$CFLAGS -DGTK=1"
fi


AC_SUBST(GTK_VERSION)
AC_SUBST(GTK_LIBS)  
AC_SUBST(GTK_CFLAGS)        


dnl Check for --with-gnome flags
AC_MSG_CHECKING([for --with-gnome flag])
AC_ARG_WITH(gnome, [  --with-gnome[=prefix]   Use GNOME [yes]], , with_gnome=yes)
if test "x$with_gnome" = "xno"; then
   AC_MSG_RESULT([without GNOME])
   GNOME_CONFIG=no
elif test "x$with_gnome" != "xyes"; then
   GNOME_SEARCH_PATH="${with_gnome}:${with_gnome}/bin/:$PATH"
   AC_MSG_RESULT("$with_gnome")
   AC_PATH_PROG(GNOME_CONFIG, gnome-config, no, "$GNOME_SEARCH_PATH")
else
   dnl Check for GNOME in default path
   AC_MSG_RESULT([search for gnome-config])
   AC_PATH_PROG(GNOME_CONFIG, gnome-config, no)
fi


dnl Decide whether to implement GNOME-specific stuff
AM_CONDITIONAL(GNOME, test "x$GNOME_CONFIG" != "xno")
if test "x$GNOME_CONFIG" = "xno"; then
   echo "gnome-config not found, disabling GNOME-specific features"
   GNOME=0
   GNOME_DESKTOP=""        
   GNOME_PIXMAPS=""
else
   GNOME=1
   GNOME_DESKTOP=`$GNOME_CONFIG --datadir`/gnome/apps/Games/
   GNOME_PIXMAPS=`$GNOME_CONFIG --datadir`/pixmaps/
   echo "GNOME features enabled"
   echo "GNOME desktop directory:  $GNOME_DESKTOP"
   echo "GNOME pixmaps directory:  $GNOME_PIXMAPS"
   CFLAGS="$CFLAGS -DGTK=1"
fi


AC_SUBST(GNOME_DESKTOP)
AC_SUBST(GNOME_PIXMAPS)


dnl Check C structures
AC_C_CONST
AC_C_INLINE


dnl Check C headers
AC_HEADER_STDC
AC_CHECK_HEADERS(sys/time.h)
AC_HEADER_TIME
if test "$USE_NETWORK" = 1; then
   AC_CHECK_HEADERS(sys/types.h)
   AC_CHECK_HEADERS(sys/socket.h)
   AC_CHECK_HEADERS(netdb.h)
   AC_CHECK_HEADERS(netinet/in.h)
fi


dnl Checks for object sizes
AC_CHECK_SIZEOF(short, 2)
AC_CHECK_SIZEOF(int, 4)
AC_CHECK_SIZEOF(long, 4)
AC_CHECK_SIZEOF(int16_t, 0)
AC_CHECK_SIZEOF(int32_t, 0)

BYTE_TYPE=char

case 2 in
   $ac_cv_sizeof_short)    WORD_TYPE=short      ;;
   $ac_cv_sizeof_int)      WORD_TYPE=int        ;;
   $ac_cv_sizeof_int16_t)  WORD_TYPE=int16_t    ;;
   *)                      AC_MSG_ERROR([Cannot find a suitable 16-bit data type])
esac

case 4 in
   $ac_cv_sizeof_short)    DWORD_TYPE=short     ;;
   $ac_cv_sizeof_int)      DWORD_TYPE=int       ;;
   $ac_cv_sizeof_long)     DWORD_TYPE=long      ;;
   $ac_cv_sizeof_int32_t)  DWORD_TYPE=int32_t   ;;
   *)                      AC_MSG_ERROR([Cannot find a suitable 32-bit data type])
esac

AC_SUBST(BYTE_TYPE)
AC_SUBST(WORD_TYPE)
AC_SUBST(DWORD_TYPE)


dnl Checks for library functions.
AC_CHECK_FUNCS(gettimeofday)
AC_CHECK_FUNCS(snprintf)
AC_CHECK_FUNCS(getopt_long, 
               CFLAGS="$CFLAGS -DHAVE_GETOPT_H=1",
               CFLAGS="$CFLAGS -DHAVE_GETOPT_H=0")
NET_LIBS=""
AC_SUBST(NET_LIBS)
if test "$USE_NETWORK" = 1; then
   AC_CHECK_LIB(nsl, gethostbyname)
   AC_CHECK_LIB(socket, socket)
   if test "$ac_cv_lib_nsl_gethostbyname" = "yes"; then
      NET_LIBS="$NET_LIBS -lnsl"
   fi
   if test "$ac_cv_lib_socket_socket" = "yes"; then
      NET_LIBS="$NET_LIBS -lsocket"
   fi
fi


dnl A random check
AC_CHECK_LIB(reality, convolution, , , )


dnl Checks for X Windows
AC_PATH_XTRA
X_LIBS="$X_PRE_LIBS $X_LIBS $X_EXTRA_LIBS"
AC_CHECK_LIB(X11, XOpenDisplay, , , $X_LIBS)
AC_CHECK_LIB(Xpm, XpmCreateImageFromData, , , $X_LIBS)


AC_OUTPUT([ Makefile 
            xpuyopuyo.h 
            putil/Makefile
            pgame/Makefile 
            pai/Makefile 
            pai/lisp/Makefile 
            pai/orig/Makefile 
            pnet/Makefile 
            pgtk/Makefile 
            psound/Makefile
            doc/Makefile
          ])


echo ""
echo "$PACKAGE $VERSION Configuration:"
echo "   Prefix:        $prefix"
echo "   Datadir:       $datadir"
echo "   Mandir:        $mandir"
if test "$GTK" = 1; then
   echo "   GTK:           Yes"
else
   echo "   GTK:           NO"
fi
if test "$GNOME" = 1; then
   echo "   GNOME:         Yes"
else 
   echo "   GNOME:         NO"
fi
if test "$USE_NEW_ROTATE" = 1; then
   echo "   Rotation:      Fixed-blob rotation"
else
   echo "   Rotation:      Old-style rotation"
fi
if test "$USE_NETWORK" = 1; then
   echo "   Network:       Enabled"
else
   echo "   Network:       Disabled"
fi
if test "$MIKMOD" = 1; then
   echo "   Sound support: Enabled"
else
   echo "   Sound support: Disabled"
fi
if test "$USE_AIBREED" = 1; then
   echo "   AI Breeding:   Enabled"
else
   echo "   AI Breeding:   Disabled"
fi
if test "$USE_LISP_AI" = 1; then
   echo "   LISP-AI:       Enabled"
else
   echo "   LISP-AI:       Using old-style"
fi
echo ""

if test "$USE_LISP_AI" = 1; then
   echo "** The LISP AI code is currently unstable and not recommended! **"
   echo ""
fi