summaryrefslogtreecommitdiff
path: root/configure.in
blob: 67b5d42ba3014d702da8e2bda8856c9e8326fb22 (plain) (blame)
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
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)

dnl OpenGL GLEW
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" ]
)
AM_CONDITIONAL(BUILD_OPENGL_GLEW, test "x$have_opengl_glew" = "xyes")

dnl OpenGL X11
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" ]
)
AM_CONDITIONAL(BUILD_OPENGL_X11, test "x$have_opengl_x11" = "xyes")

dnl Software X11
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" ]
)
AM_CONDITIONAL(BUILD_SOFTWARE_X11, test "x$have_software_x11" = "xyes")

dnl XRender X11
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" ]
)
AM_CONDITIONAL(BUILD_XRENDER_X11, test "x$have_xrender_x11" = "xyes")

dnl Software 16bit X11
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" ]
)
AM_CONDITIONAL(BUILD_SOFTWARE_16_X11, test "x$have_software_16_x11" = "xyes")

dnl FB
PKG_CHECK_EXISTS(evas-framebuffer,
  [
    AC_DEFINE(HAVE_EVAS_FB, 1, [Evas FB Engine Support])
    have_fb="yes"
  ],
  [ have_fb="no" ]
)
AM_CONDITIONAL(BUILD_FB, test "x$have_fb" = "xyes")

# TODO: Check availability of libs
dnl DirectDraw
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" ]
)
AM_CONDITIONAL(BUILD_SOFTWARE_DDRAW, test "x$have_software_ddraw" = "xyes")

# TODO: Check availability of libs
dnl 16bit DirectDraw
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" ]
)
AM_CONDITIONAL(BUILD_SOFTWARE_16_DDRAW, test "x$have_software_16_ddraw" = "xyes")

# TODO: Check availability of libs
dnl Direct3D
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" ]
)
AM_CONDITIONAL(BUILD_DIRECT3D, test "x$have_direct3d" = "xyes")

dnl Software SDL
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" ]
)
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" ])
  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
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
echo "  Installation:"
echo "    prefix.......................: ${prefix}"
echo