~ubuntu-branches/ubuntu/maverick/crossfire-client/maverick

« back to all changes in this revision

Viewing changes to configure.in

  • Committer: Bazaar Package Importer
  • Author(s): Kari Pahula
  • Date: 2007-04-13 21:15:44 UTC
  • mfrom: (1.2.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20070413211544-vjo6zesj6g0wgmwf
Tags: 1.10.0-1
* New upstream release
* Install the README, README-dev and TODO files specific to the GTK2
  client to the corresponding package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
dnl deprecated form
4
4
dnl AC_INIT(crossfire-client.spec)
5
5
 
6
 
AC_INIT(crossfire-client, 1.9.1)
 
6
AC_INIT(crossfire-client, 1.10.0)
7
7
AC_CONFIG_SRCDIR(crossfire-client.spec)
8
8
 
9
9
AC_CONFIG_AUX_DIR(utils/)
19
19
dnl AM_ACLOCAL_INCLUDE(macros)
20
20
 
21
21
dnl these are subdirectories that have make files in them
22
 
CF_SUBDIRS="common x11 pixmaps utils help"
 
22
CF_SUBDIRS="common pixmaps utils help"
23
23
 
24
24
dnl Check for some neeed programs
25
25
AC_PATH_PROG(MKDIR, mkdir)
29
29
AC_PATH_PROG(RM, rm)
30
30
AC_PATH_PROG(PERL, perl)
31
31
AC_PATH_PROG(AR, ar)
 
32
AC_PATH_PROG(PKG_CONFIG, pkg-config)
 
33
 
 
34
dnl Check if svnversion is avaliable to get the rev number
 
35
AC_PATH_PROG(SVNVERSION, svnversion)
32
36
 
33
37
dnl Put this early on, since gtk may rely on it.
34
38
AC_PATH_XTRA
35
39
 
36
 
dnl for gtk-v2 client
37
 
pkg_modules="gtk+-2.0 >= 2.0.0"
38
 
PKG_CHECK_MODULES(PACKAGE, [$pkg_modules], CF_SUBDIRS="$CF_SUBDIRS gtk-v2", 
39
 
    AC_MSG_WARN(GTK v2 libraries not found - will not build gtkv2 client) )
40
 
 
41
 
AM_MAINTAINER_MODE
42
 
AC_SUBST(PACKAGE_LIBS)
43
 
AC_SUBST(INTLLIBS)
44
 
 
45
 
AC_CHECK_LIB(glut, main, OPENGL_LIBS="-lglut")
46
 
AC_SUBST(OPENGL_LIBS)
47
 
if eval "test x$OPENGL_LIBS != x"; then
48
 
    AC_DEFINE(HAVE_OPENGL)
49
 
fi
50
 
dnl end of gtk-v2 stuff
51
 
 
52
 
 
53
 
 
54
40
SOUNDDIR="${datadir}/crossfire-client/sounds"
55
41
 
56
42
dnl Add some options to 'configure'.
74
60
AC_ARG_ENABLE(alsa, [  --disable-alsa          disable ALSA sound support [default=use alsa sound support if alsa libraries exist]],
75
61
                alsa=$enableval, alsa=yes )
76
62
 
77
 
AC_ARG_WITH(sound-dir, [  --with-sound-dir=dir    Directory where the sounds are located (default=/usr/local/lib/sounds)        ],
 
63
AC_ARG_WITH(sound-dir, [  --with-sound-dir=dir    directory where the sounds are located (default=/usr/local/lib/sounds)        ],
78
64
                SOUNDDIR="$withval")
79
65
 
80
66
 
89
75
                EXTRA_INC="$withval")
90
76
 
91
77
 
92
 
AC_ARG_ENABLE(gtk, [  --disable-gtk           make x11 client [default=make gtk client if available]],
93
 
                gtk=$enableval, gtk=yes )
94
 
 
95
 
AC_ARG_ENABLE(sdl, [  --disable-sdl              Disable linking with the SDL library, default is to use it if available ],
 
78
AC_ARG_WITH(loglevel, [  --with-logevel=level    sets default loglevel ],
 
79
                MINLOGLEVEL="$withval", MINLOGLEVEL=0)
 
80
 
 
81
 
 
82
AC_ARG_ENABLE(gtkv1, [  --disable-gtkv1         do not make original gtk client [default=make it if available]],
 
83
                gtkv1=$enableval, gtkv1=yes )
 
84
 
 
85
AC_ARG_ENABLE(gtkv2, [  --disable-gtkv2         do not make gtk-v2 client [default=make it if available]],
 
86
                gtkv2=$enableval, gtkv2=yes )
 
87
 
 
88
AC_ARG_ENABLE(cfgtk2, [  --enable-cfgtk2         enable building the original gtkv1 client with GTK+ 2],
 
89
                cfgtk2=$enableval, cfgtk2=no)
 
90
 
 
91
AC_ARG_ENABLE(sdl, [  --disable-sdl           disable linking with the SDL library, default is to use it if available ],
96
92
                use_sdl=$enableval, use_sdl=yes)
97
93
 
98
 
AC_ARG_ENABLE(dmalloc, [  --enable-dmalloc          Enable checking for dmalloc library, default is to use it if available ],
 
94
AC_ARG_ENABLE(dmalloc, [  --enable-dmalloc        enable checking for dmalloc library, default is to use it if available ],
99
95
                use_dmalloc=$enableval, use_dmalloc=no)
100
96
 
101
97
 
125
121
  *-*-solaris2*)
126
122
        need_r_flag="yes"
127
123
        ;;
 
124
  *-*-mingw32*)
 
125
    win32="yes"
 
126
    # -mms-bitfields is needed for GTK+ in windows.  It is set automatically
 
127
    # by pkg-config, but it's also needed in common, so we explicitely set it
 
128
    CFLAGS="$CFLAGS -mms-bitfields"
 
129
    WIN32_LIBS="-lwsock32 -lwinmm"
 
130
    AC_SUBST(WIN32_LIBS)
 
131
    ;;
128
132
  *)
129
133
    ;;
130
134
esac
131
135
 
 
136
dnl Check for what clients we are going to build in order of x, gtk-v1, gtk-v2
 
137
 
 
138
dnl Check to see if X client will be built - no_x is set by AC_CHECK_XTRA if
 
139
dnl X11 isn't found on the machine
 
140
if eval "test x$no_x = xyes" ; then
 
141
    AC_MSG_WARN(X11 not found - will not build X client)
 
142
    X_LIBS=""
 
143
else
 
144
    AC_MSG_NOTICE(X11 found - will build X client)
 
145
    X_LIBS="$X_LIBS -lX11"
 
146
    CF_SUBDIRS="$CF_SUBDIRS x11"
 
147
    echo Xlibs: $X_LIBS
 
148
    echo Extras: $X_EXTRA_LIBS
 
149
    echo Xpre: $X_PRE_LIBS
 
150
fi    
 
151
dnl End of X client check
 
152
 
 
153
dnl Check to see if gtk-v1 client will be built
 
154
if eval "test x$gtkv1 = xyes" ; then
 
155
if eval "test x$cfgtk2 = xyes" ; then
 
156
        PKG_CHECK_MODULES(GTK2, gtk+-2.0 >= 2.0.0, [HAVE_GTK2=yes], [HAVE_GTK2=no]) 
 
157
        if eval "test x$HAVE_GTK2 = xyes" ; then
 
158
        GTK_CFLAGS="`$PKG_CONFIG --cflags gtk+-2.0` -DCFGTK2 -DGTK_ENABLE_BROKEN -DGTK_WINDOW_DIALOG=GTK_WINDOW_TOPLEVEL"
 
159
        GTK_LIBS=`$PKG_CONFIG --libs gtk+-2.0`
 
160
        CF_SUBDIRS="$CF_SUBDIRS gtk"
 
161
        CFGTK="no"
 
162
            AC_MSG_NOTICE(GTK+ 2 found - building original gtk-v1 client with GTK+ 2.0.0)
 
163
else
 
164
            AC_MSG_WARN(GTK2 not found and --enable-cfgtk2 is set - cannot original gtk-v1 client)
 
165
fi
 
166
    else
 
167
        AM_PATH_GTK(1.0.0,CFGTK="yes",CFGTK="no")
 
168
if eval "test x$CFGTK = xyes"; then
 
169
            AC_MSG_NOTICE(GTK 1 found - building gtk client)
 
170
        GTK_LIBS=$GTK_LIBS
 
171
        GTK_CFLAGS="$GTK_CFLAGS"
 
172
        AC_SUBST(GTK_LIBS)
 
173
        AC_SUBST(GTK_CFLAGS)
 
174
        CF_SUBDIRS="$CF_SUBDIRS gtk"
 
175
        dnl AC_DEFINE(GTK_CLIENT)
 
176
else
 
177
            AC_MSG_WARN(GTK 1 not found - not building building gtk-v1 client)
 
178
        fi
 
179
    fi
 
180
else
 
181
    AC_MSG_NOTICE(gtkv1 client build disabled)
 
182
fi
 
183
AC_SUBST(CFGTK)
 
184
dnl End of gtk-v1 client check
 
185
 
 
186
dnl Check to see if gtk-v2 client will be built
 
187
if eval "test x$gtkv2 = xyes" ; then
 
188
    PKG_CHECK_MODULES(GTK2, [gtk+-2.0 >= 2.0.0], [CF_SUBDIRS="$CF_SUBDIRS gtk-v2"], [gtkv2="no"])
 
189
    dnl Check if gtkv2 is still "yes" as is cleaner than putting all the messages in the PKG_CHECK
 
190
    if eval "test x$gtkv2 = xyes" ; then
 
191
      AC_MSG_NOTICE(GTK+ 2 found - will build gtk-v2 client)
 
192
    else
 
193
      AC_MSG_WARN(GTK+ 2 libraries not found - will not build gtk-v2 client)
 
194
fi
 
195
else
 
196
    AC_MSG_NOTICE(gtkv2 client disabled)
 
197
fi
 
198
dnl End of gtk-v2 client check
 
199
 
 
200
dnl Future check for Gnome client
 
201
dnl AC_PATH_PROG(GNOMECONFIG, gnome-config)
 
202
dnl 
 
203
dnl if test -z "$GNOMECONFIG" ; then
 
204
dnl     gnome=no
 
205
dnl     echo "Can't find gnome-config, not building Gnome client."
 
206
dnl fi
 
207
dnl 
 
208
dnl if eval "test x$gnome = xyes"; then
 
209
dnl     GNOME_INIT
 
210
dnl     GNOME_COMPILE_WARNINGS
 
211
dnl     GNOME_X_CHECKS
 
212
dnl     AM_PATH_GDK_PIXBUF(0.11.0, , echo "gdk-pixbuf 0.11.0 or higher is needed for the Gnome client so I'm not building it." ; gnome=no)
 
213
dnl     if eval "test x$gnome = xyes"; then
 
214
dnl             CF_SUBDIRS="$CF_SUBDIRS gnome"
 
215
dnl     fi
 
216
dnl fi
 
217
dnl End of future check for Gnome client
 
218
 
 
219
dnl End of client checks
 
220
 
 
221
AM_MAINTAINER_MODE
 
222
AC_SUBST(PACKAGE_LIBS)
 
223
AC_SUBST(INTLLIBS)
 
224
 
 
225
dnl Check for OpenGL
 
226
AC_CHECK_LIB(GL, main)
 
227
AC_CHECK_LIB(GLU, main)
 
228
AC_CHECK_LIB(opengl32, main)
 
229
AC_CHECK_LIB(glu32, main)
 
230
AC_CHECK_LIB(glut, main, opengl="yes"; AC_DEFINE(HAVE_OPENGL))
 
231
if eval "test x$opengl = xyes" ; then
 
232
    if eval "test x$win32 = xyes" ; then
 
233
        OPENGL_LIBS="-lopengl32 -lglu32 -lglut"
 
234
    else
 
235
        OPENGL_LIBS="-lGL -lGLU -lglut"
 
236
    fi
 
237
    AC_SUBST(OPENGL_LIBS)
 
238
fi
 
239
dnl End of OpenGL checks
132
240
 
133
241
dnl Checks for programs.
134
242
AC_PROG_INSTALL
137
245
AC_PROG_CPP
138
246
AC_PROG_RANLIB
139
247
 
140
 
dnl Check for GTK >= 1.0.0.
141
 
dnl The XLib client (without GTK) should use AC_PATH_X instead of this.
142
 
 
143
 
dnl Simple hack - if we want standard x11 client, don't check for the gtk
144
 
dnl libraries.  Then we fall through below
145
 
 
146
 
if eval "test x$gtk = xyes"; then
147
 
AM_PATH_GTK(1.0.0,CFGTK="yes",CFGTK="no")
148
 
fi
149
 
 
150
 
 
151
 
AC_SUBST(CFGTK)
152
 
 
153
 
if eval "test x$CFGTK = xyes"; then
154
 
        AC_MSG_RESULT(GTK found - building both gtk and x11 client)
155
 
        GTK_LIBS=$GTK_LIBS
156
 
        GTK_CFLAGS="$GTK_CFLAGS"
157
 
        AC_SUBST(GTK_LIBS)
158
 
        AC_SUBST(GTK_CFLAGS)
159
 
        CF_SUBDIRS="$CF_SUBDIRS gtk"
160
 
        dnl AC_DEFINE(GTK_CLIENT)
161
 
else
162
 
        AC_MSG_RESULT(GTK not found - building xlib client)
163
 
fi
164
 
dnl common to everything 
165
 
 
166
 
X_LIBS="$X_LIBS -lX11"
167
248
AC_SUBST(X_LIBS)
168
249
AC_SUBST(X_CFLAGS)
169
 
echo Xlibs: $X_LIBS
170
 
echo Extras: $X_EXTRA_LIBS
171
 
echo Xpre: $X_PRE_LIBS
172
250
 
173
251
CPPFLAGS="$CPPFLAGS $EXTRA_INC"
174
252
LDFLAGS="$LDFLAGS $EXTRA_LIB"
244
322
    CF_SUBDIRS="$CF_SUBDIRS $SOUND_SRC";
245
323
fi
246
324
 
247
 
dnl AC_PATH_PROG(GNOMECONFIG, gnome-config)
248
 
dnl 
249
 
dnl if test -z "$GNOMECONFIG" ; then
250
 
dnl     gnome=no
251
 
dnl     echo "Can't find gnome-config, not building Gnome client."
252
 
dnl fi
253
 
dnl 
254
 
dnl if eval "test x$gnome = xyes"; then
255
 
dnl     GNOME_INIT
256
 
dnl     GNOME_COMPILE_WARNINGS
257
 
dnl     GNOME_X_CHECKS
258
 
dnl     AM_PATH_GDK_PIXBUF(0.11.0, , echo "gdk-pixbuf 0.11.0 or higher is needed for the Gnome client so I'm not building it." ; gnome=no)
259
 
dnl     if eval "test x$gnome = xyes"; then
260
 
dnl             CF_SUBDIRS="$CF_SUBDIRS gnome"
261
 
dnl     fi
262
 
dnl fi
263
 
 
264
325
AC_SUBST(GUI_OBJS)
265
326
AC_SUBST(GUI_SRCS)
266
327
AC_SUBST(SND_LIBS)
278
339
 
279
340
if eval "test x$no_sdl = x"; then
280
341
     AC_CHECK_LIB( SDL_image, IMG_LoadPNG_RW, 
281
 
                   have_sdlimage="yes", have_sdlimage="no", $SDL_CFLAGS) 
 
342
                   have_sdlimage="yes", have_sdlimage="no", $SDL_CFLAGS $SDL_LIBS) 
282
343
     if eval "test x$have_sdlimage = xyes"; then
283
344
         SDL_LIBS="$SDL_LIBS -lSDL_image"
284
345
     fi
381
442
dnl Checks for library functions.
382
443
AC_PROG_GCC_TRADITIONAL
383
444
AC_FUNC_VPRINTF
384
 
AC_CHECK_FUNCS(mkdir socket strcspn sysconf)
 
445
AC_CHECK_FUNCS(mkdir socket strcspn sysconf getaddrinfo)
385
446
 
386
447
AC_SUBST(XPM)
387
448
AC_SUBST(SOUNDDIR)
400
461
nbindir=`eval echo ${bindir}`
401
462
nbindir=`eval echo ${nbindir}`
402
463
 
 
464
dnl Datadir should be working directory in Windows, as there is no set
 
465
dnl installation directory (choosable at installation time)
 
466
if eval "test x$win32 = xyes" ; then
 
467
    AC_DEFINE_UNQUOTED(DATADIR, ".")
 
468
else
403
469
AC_DEFINE_UNQUOTED(DATADIR, "${ndatadir}/crossfire-client")
 
470
fi
404
471
AC_DEFINE_UNQUOTED(BINDIR, "${nbindir}")
 
472
AC_DEFINE_UNQUOTED(MINLOGLEVEL, ${MINLOGLEVEL})
405
473
 
406
474
AC_SUBST(DATADIR)
407
475