summaryrefslogtreecommitdiff
path: root/configure.in
blob: a4aee2aa877b516b68be9f538610706bc414abbc (plain)
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
dnl Process this file with autoconf to produce a configure script.

# get rid of that stupid cache mechanism
rm -f config.cache

AC_INIT(configure.in)
AM_INIT_AUTOMAKE(expedite, 0.6.0)
AM_CONFIG_HEADER(config.h)

AC_ISC_POSIX
AC_PROG_CC
AM_PROG_CC_STDC
AC_HEADER_STDC
AC_C_CONST
AM_ENABLE_SHARED
AM_PROG_LIBTOOL

if test "x${bindir}" = 'xNONE'; then
  if test "x${prefix}" = "xNONE"; then
    PACKAGE_BIN_DIR="${ac_default_prefix}/bin"
  else
    PACKAGE_BIN_DIR="${prefix}/bin"
  fi
else
  PACKAGE_BIN_DIR="${bindir}"
fi
AC_SUBST(PACKAGE_BIN_DIR)

if test "x${libdir}" = 'xNONE'; then
  if test "x${prefix}" = "xNONE"; then
    PACKAGE_LIB_DIR="${ac_default_prefix}/lib"
  else
    PACKAGE_LIB_DIR="${prefix}/lib"
  fi
else
  PACKAGE_LIB_DIR="${libdir}"
fi
AC_SUBST(PACKAGE_LIB_DIR)

if test "x${prefix}" = "xNONE"; then
  PACKAGE_DATA_DIR="${ac_default_prefix}/share/${PACKAGE}"
else
  PACKAGE_DATA_DIR="${prefix}/share/${PACKAGE}"
fi
AC_SUBST(PACKAGE_DATA_DIR)

PKG_CHECK_MODULES([EVAS], evas)

#######################################
## Simple X11 build/link

AC_ARG_ENABLE(simple-x11,
  AC_HELP_STRING([--enable-simple-x11], [enable simple x11 linking]),
  [ want_evas_simple_x11=$enableval ]
)

### OpenGL GLEW
want_opengl_glew="yes"
AC_MSG_CHECKING(whether OpenGL GLEW)
AC_ARG_ENABLE(opengl-glew,
  AC_HELP_STRING([--enable-opengl-glew], [enable OpenGL GLEW engine]),
  [ want_opengl_glew=$enableval ]
)
AC_MSG_RESULT($want_opengl_glew)
if test "x$want_opengl_glew" = "xyes"; then
  PKG_CHECK_EXISTS(evas-opengl-glew,
    [
      AC_DEFINE(HAVE_EVAS_OPENGL_GLEW, 1, [Evas GL Glew Engine Support])
      have_opengl_glew="yes"
      glew_libs="-lglew32 -lgdi32"
    ],
    [ have_opengl_glew="no" ]
  )
fi
AM_CONDITIONAL(BUILD_OPENGL_GLEW, test "x$have_opengl_glew" = "xyes")

### OpenGL X11
want_opengl_x11="yes"
AC_MSG_CHECKING(whether OpenGL X11)
AC_ARG_ENABLE(opengl-x11,
  AC_HELP_STRING([--enable-opengl-x11], [enable OpenGL X11 engine]),
  [ want_opengl_x11=$enableval ]
)
AC_MSG_RESULT($want_opengl_x11)
if test "x$want_opengl_x11" = "xyes"; then
  PKG_CHECK_EXISTS(evas-opengl-x11,
    [
      AC_DEFINE(HAVE_EVAS_OPENGL_X11, 1, [Evas GL X11 Engine Support])
      have_opengl_x11="yes"
    ],
    [ have_opengl_x11="no" ]
  )
fi
AM_CONDITIONAL(BUILD_OPENGL_X11, test "x$have_opengl_x11" = "xyes")

### Software X11
want_software_x11="yes"
AC_MSG_CHECKING(whether Software X11)
AC_ARG_ENABLE(software-x11,
  AC_HELP_STRING([--enable-software-x11], [enable Software X11 engine]),
  [ want_software_x11=$enableval ]
)
AC_MSG_RESULT($want_software_x11)
if test "x$want_software_x11" = "xyes"; then
  PKG_CHECK_EXISTS(evas-software-x11,
    [
      AC_DEFINE(HAVE_EVAS_SOFTWARE_X11, 1, [Evas Software X11 Engine Support])
      have_software_x11="yes"
    ],
    [ have_software_x11="no" ]
  )
fi
AM_CONDITIONAL(BUILD_SOFTWARE_X11, test "x$have_software_x11" = "xyes")

### XRender X11
want_xrender_x11="yes"
AC_MSG_CHECKING(whether XRender X11)
AC_ARG_ENABLE(xrender-x11,
  AC_HELP_STRING([--enable-xrender-x11], [enable XRender X11 engine]),
  [ want_xrender_x11=$enableval ]
)
AC_MSG_RESULT($want_xrender_x11)
if test "x$want_xrender_x11" = "xyes"; then
  PKG_CHECK_EXISTS(evas-xrender-x11,
    [
      AC_DEFINE(HAVE_EVAS_XRENDER_X11, 1, [Evas XRender X11 Engine Support])
      have_xrender_x11="yes"
    ],
    [ have_xrender_x11="no" ]
  )
fi
AM_CONDITIONAL(BUILD_XRENDER_X11, test "x$have_xrender_x11" = "xyes")

### Software 16bit X11
want_software_16_x11="yes"
AC_MSG_CHECKING(whether Software 16bit X11)
AC_ARG_ENABLE(software-16-x11,
  AC_HELP_STRING([--enable-software-16-x11], [enable Software 16bit X11 engine]),
  [ want_software_16_x11=$enableval ]
)
AC_MSG_RESULT($want_software_16_x11)
if test "x$want_software_16_x11" = "xyes"; then
  PKG_CHECK_EXISTS(evas-software-16-x11,
    [
      AC_DEFINE(HAVE_EVAS_SOFTWARE_16_X11, 1, [Evas Software 16bit X11 Engine Support])
      have_software_16_x11="yes"
    ],
    [ have_software_16_x11="no" ]
  )
fi
AM_CONDITIONAL(BUILD_SOFTWARE_16_X11, test "x$have_software_16_x11" = "xyes")

### FB
want_fb="yes"
AC_MSG_CHECKING(whether Framebuffer)
AC_ARG_ENABLE(fb,
  AC_HELP_STRING([--enable-fb], [enable Framebuffer engine]),
  [ want_fb=$enableval ]
)
AC_MSG_RESULT($want_fb)
if test "x$want_fb" = "xyes"; then
  PKG_CHECK_EXISTS(evas-framebuffer,
    [
      AC_DEFINE(HAVE_EVAS_FB, 1, [Evas FB Engine Support])
      have_fb="yes"
    ],
    [ have_fb="no" ]
  )
fi
AM_CONDITIONAL(BUILD_FB, test "x$have_fb" = "xyes")

### DIRECTFB
want_directfb="yes"
AC_MSG_CHECKING(whether DirectFB)
AC_ARG_ENABLE(directfb,
  AC_HELP_STRING([--enable-directfb], [enable DirectFB engine]),
  [ want_directfb=$enableval ]
)
AC_MSG_RESULT($want_directfb)
if test "x$want_directfb" = "xyes"; then
  PKG_CHECK_EXISTS(evas-directfb,
    [
      AC_DEFINE(HAVE_EVAS_DIRECTFB, 1, [Evas DirectFB Engine Support])
      have_evas_directfb="yes"
    ],
    [ have_evas_directfb="no" ]
  )
fi
if test "x$have_evas_directfb" = "xyes"; then
  PKG_CHECK_MODULES([DIRECTFB], directfb,
    [ have_directfb="yes" ],
    [ have_directfb="no" ])
else
    have_directfb="no"
fi
AM_CONDITIONAL(BUILD_DIRECTFB, test "x$have_directfb" = "xyes")

# TODO: Check availability of libs
### DirectDraw
want_software_ddraw="yes"
AC_MSG_CHECKING(whether Software DirectDraw)
AC_ARG_ENABLE(software-ddraw,
  AC_HELP_STRING([--enable-software-ddraw], [enable Software DirectDraw engine]),
  [ want_software_ddraw=$enableval ]
)
AC_MSG_RESULT($want_software_ddraw)
if test "x$want_software_ddraw" = "xyes"; then
  PKG_CHECK_EXISTS(evas-software-ddraw,
    [
      AC_DEFINE(HAVE_EVAS_SOFTWARE_DDRAW, 1, [Evas Software DirectDraw Engine Support])
      have_software_ddraw="yes"
      ddraw_libs="-lddraw -ldxguid"
    ],
    [ have_software_ddraw="no" ]
  )
fi
AM_CONDITIONAL(BUILD_SOFTWARE_DDRAW, test "x$have_software_ddraw" = "xyes")

# TODO: Check availability of libs
### 16bit DirectDraw
want_software_16_ddraw="yes"
AC_MSG_CHECKING(whether Software 16bit DirectDraw)
AC_ARG_ENABLE(software-16-ddraw,
  AC_HELP_STRING([--enable-software-16-ddraw], [enable Software 16bit DirectDraw engine]),
  [ want_software_16_ddraw=$enableval ]
)
AC_MSG_RESULT($want_software_16_ddraw)
if test "x$want_software_ddraw" = "xyes"; then
  PKG_CHECK_EXISTS(evas-software-16-ddraw,
    [
      AC_DEFINE(HAVE_EVAS_SOFTWARE_16_DDRAW, 1, [Evas Software 16bit DirectDraw Engine Support])
      have_software_16_ddraw="yes"
      ddraw_libs="-lddraw -ldxguid"
    ],
    [ have_software_16_ddraw="no" ]
  )
fi
AM_CONDITIONAL(BUILD_SOFTWARE_16_DDRAW, test "x$have_software_16_ddraw" = "xyes")

# TODO: Check availability of libs
### Direct3D
want_direct3d="yes"
AC_MSG_CHECKING(whether Direct3D)
AC_ARG_ENABLE(direct3d,
  AC_HELP_STRING([--enable-direct3d], [enable Direct3D engine]),
  [ want_direct3d=$enableval ]
)
AC_MSG_RESULT($want_direct3d)
if test "x$want_direct3d" = "xyes"; then
  PKG_CHECK_EXISTS(evas-direct3d,
    [
      AC_DEFINE(HAVE_EVAS_DIRECT3D, 1, [Evas Direct3D Engine Support])
      have_direct3d="yes"
      d3d_libs="-ld3d9 -ld3dx9d"
    ],
    [ have_direct3d="no" ]
  )
fi
AM_CONDITIONAL(BUILD_DIRECT3D, test "x$have_direct3d" = "xyes")

### Software SDL
want_software_sdl="yes"
AC_MSG_CHECKING(whether Software SDL)
AC_ARG_ENABLE(software-sdl,
  AC_HELP_STRING([--enable-software-sdl], [enable Software SDL engine]),
  [ want_software_sdl=$enableval ]
)
AC_MSG_RESULT($want_software_sdl)
if test "x$want_software_sdl" = "xyes"; then
  PKG_CHECK_EXISTS(evas-software-sdl,
    [
      AC_DEFINE(HAVE_EVAS_SOFTWARE_SDL, 1, [Evas Software SDL Engine Support])
      have_software_sdl="yes"
    ],
    [ have_software_sdl="no" ]
  )
fi
AM_CONDITIONAL(BUILD_SOFTWARE_SDL, test "x$have_software_sdl" = "xyes")

if test "x$have_software_x11" = "xyes" -o "x$have_software_16_x11" = "xyes" -o "x$have_xrender_x11" = "xyes" -o "x$have_opengl_x11" = "xyes"; then
  AC_PATH_XTRA
  AC_CHECK_HEADERS(X11/Xlib.h X11/Xutil.h,
    [ have_x11="yes" ],
    [ have_x11="no" ])
  if test "x$want_evas_simple_x11" = "xyes"; then
    x_libs="${x_libs} -lX11 -lXext"
  else
    x_dir=${x_dir:-/usr/X11R6}
    x_cflags=${x_cflags:--I${x_includes:-$x_dir/include}}
    x_libs="${x_libs:--L${x_libraries:-$x_dir/lib}} -lX11 -lXext"
  fi
fi
AM_CONDITIONAL(BUILD_X11, test "x$have_x11" = "xyes")

if test "x$have_software_sdl" = "xyes"; then
  PKG_CHECK_MODULES([SDL], sdl,
    [ have_sdl="yes" ],
    [ have_sdl="no" ])
fi
AM_CONDITIONAL(BUILD_SDL, test "x$have_sdl" = "xyes")

AC_SUBST(x_cflags)
AC_SUBST(x_libs)
AC_SUBST(ddraw_libs)
AC_SUBST(ddraw_16_libs)
AC_SUBST(d3d_libs)
AC_SUBST(glew_libs)

AC_OUTPUT([
Makefile
src/Makefile
src/bin/Makefile
data/Makefile
])

echo
echo "  $PACKAGE $VERSION"
echo
echo "  Engines:"
echo "    Software X11.................: ${have_software_x11}"
echo "    Software X11 16 bits.........: ${have_software_16_x11}"
echo "    X Render X11.................: ${have_xrender_x11}"
echo "    Open GL X11..................: ${have_opengl_x11}"
echo "    Open GL Glew.................: ${have_opengl_glew}"
echo "    Software DirectDraw..........: ${have_software_ddraw}"
echo "    Software DirectDraw 16 bits..: ${have_software_16_ddraw}"
echo "    Direct3D.....................: ${have_direct3d}"
echo "    Software SDL.................: ${have_software_sdl}"
echo "    FB...........................: ${have_fb}"
echo "    DirectFB.....................: ${have_directfb}"
echo
echo "  Installation:"
echo "    prefix.......................: ${prefix}"
echo