summaryrefslogtreecommitdiff
path: root/legacy/emotion/configure.ac
blob: 4442a6135c11cdb34ef045b2cb47683082b2997f (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
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
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
m4_define([v_maj], [1])
m4_define([v_min], [6])
m4_define([v_mic], [99])
m4_define([v_rev], m4_esyscmd([(svnversion "${SVN_REPO_PATH:-.}" | grep -v '\(export\|Unversioned directory\)' || echo 0) | awk -F : '{printf("%s\n", $1);}' | tr -d ' :MSP\n']))
m4_if(v_rev, [0], [m4_define([v_rev], m4_esyscmd([git log 2> /dev/null | (grep -m1 git-svn-id || echo 0) | sed -e 's/.*@\([0-9]*\).*/\1/' | tr -d '\n']))])
##--   When released, remove the dnl on the below line
m4_undefine([v_rev])
##--   When doing snapshots - change soname. remove dnl on below line
m4_define([relname], [ver-pre-svn-07])
m4_define([v_rel], [-release relname])
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
m4_ifdef([v_rev], [m4_define([v_ver], [v_maj.v_min.v_mic.v_rev])],
[m4_define([v_ver], [v_maj.v_min.v_mic])])
m4_define([lt_rev], m4_eval(v_maj + v_min))
m4_define([lt_cur], v_mic)
m4_define([lt_age], v_min)
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##

AC_INIT([emotion], [v_ver-alpha], [enlightenment-devel@lists.sourceforge.net])
AC_PREREQ([2.60])
AC_CONFIG_SRCDIR([configure.ac])
AC_CONFIG_MACRO_DIR([m4])
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
AC_ISC_POSIX

AM_INIT_AUTOMAKE([1.6 dist-bzip2])
AM_CONFIG_HEADER([config.h])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])

AC_LIBTOOL_WIN32_DLL
define([AC_LIBTOOL_LANG_CXX_CONFIG], [:])dnl
define([AC_LIBTOOL_LANG_F77_CONFIG], [:])dnl
AC_PROG_LIBTOOL

##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
m4_ifdef([v_rev], , [m4_define([v_rev], [0])])
m4_ifdef([v_rel], , [m4_define([v_rel], [])])
AC_DEFINE_UNQUOTED(VMAJ, [v_maj], [Major version])
AC_DEFINE_UNQUOTED(VMIN, [v_min], [Minor version])
AC_DEFINE_UNQUOTED(VMIC, [v_mic], [Micro version])
AC_DEFINE_UNQUOTED(VREV, [v_rev], [Revison])
version_info="lt_rev:lt_cur:lt_age"
release_info="v_rel"
AC_SUBST(version_info)
AC_SUBST(release_info)
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
VMAJ=v_maj
AC_SUBST(VMAJ)

want_generic="yes"
case "$host_os" in
   mingw*)
      want_xine="no"
      want_gstreamer="yes"
      want_generic="no"
      want_generic_vlc="no"
      ;;
   *)
      want_xine="yes"
      want_gstreamer="yes"
      want_generic_vlc="yes"
      ;;
esac

requirement_emotion=""

### Additional options to configure

EFL_ENABLE_BIN([emotion-test])

# edje_cc

AC_ARG_WITH([edje-cc],
   [AC_HELP_STRING([--with-edje-cc=PATH], [specify a specific path to edje_cc])],
   [
    v=$withval;
    edje_cc=$v
    echo "  Enlightenment edje_cc explicitly set to "$edje_cc;
   ],
   [edje_cc=$(pkg-config --variable=prefix edje)/bin/edje_cc])
AC_SUBST(edje_cc)


### Checks for programs
AC_PROG_CC

# pkg-config
PKG_PROG_PKG_CONFIG

# Check whether pkg-config supports Requires.private
if $PKG_CONFIG --atleast-pkgconfig-version 0.22; then
   pkgconfig_requires_private="Requires.private"
else
   pkgconfig_requires_private="Requires"
fi
AC_SUBST(pkgconfig_requires_private)

# doxygen program for documentation building

EFL_CHECK_DOXYGEN([build_doc="yes"], [build_doc="no"])


### Checks for libraries

requirement_emotion="ecore >= 1.6.99 evas >= 1.6.99 eet >= 1.6.99 eina >= 1.6.99"
PKG_CHECK_MODULES(EMOTION, [${requirement_emotion}])


if test "x${have_emotion_test}" = "xyes" ; then
   PKG_CHECK_MODULES(EMOTION_BIN, [eina >= 1.6.99 evas >= 1.6.99 ecore >= 1.6.99 ecore-evas >= 1.6.99 edje >= 1.6.99])
fi

PKG_CHECK_MODULES(ECORE_X, [ecore-x >= 1.6.99 ecore-evas >= 1.6.99], [have_ecore_x="yes"], [have_ecore_x="no"])

PKG_CHECK_MODULES(ECORE_FB, [ecore-fb >= 1.6.99], [have_ecore_fb="yes"], [have_ecore_fb="no"])

if test "x${have_ecore_x}" = "xyes" ; then
   AC_DEFINE(EMOTION_HAVE_ECORE_X, 1, [Define to 1 if Ecore_X is enabled])
fi

if test "x${have_ecore_fb}" = "xyes" ; then
   AC_DEFINE(EMOTION_HAVE_ECORE_FB, 1, [Define to 1 if Ecore_Fb is enabled])
fi

PKG_CHECK_EXISTS([evas-software-x11 >= 1.6.99], [AC_DEFINE(HAVE_EVAS_SOFWARE_X11, 1, [Evas Software Xlib Engine Support])])

PKG_CHECK_EXISTS([evas-xrender-x11 >= 1.6.99], [AC_DEFINE(HAVE_EVAS_XRENDER_X11, 1, [Evas Software Xlib Engine Support])])

PKG_CHECK_EXISTS([evas-opengl-x11 >= 1.6.99], [AC_DEFINE(HAVE_EVAS_OPENGL_X11, 1, [Evas OpenGL Xlib Engine Support])])

PKG_CHECK_EXISTS([evas-fb >= 1.6.99], [AC_DEFINE(HAVE_EVAS_FB, 1, [Evas Framebuffer Engine Support])])

EFL_EDJE_EXTERNAL([have_edje_external="yes"], [have_edje_external="no"])

PKG_CHECK_MODULES(EEZE, [eeze >= 1.6.99], [have_eeze="yes"], [have_eeze="no"])

if test "x${have_eeze}" = "xyes"; then
   AC_DEFINE(EMOTION_HAVE_EEZE, 1, [Define to 1 if Eeze is available])
   requirement_emotion="${requirement_emotion} eeze >= 1.6.99"
fi

PKG_CHECK_MODULES([EIO], [eio >= 1.6.99], [have_eio="yes"], [have_eio="no"])
if test "x${have_eio}" = "xyes"; then
   AC_DEFINE(HAVE_EIO, 1, [Use EIO for asynchronous file access])
   requirement_emotion="eio >= 1.6.99 ${requirement_emotion}"
fi

AM_CONDITIONAL([HAVE_EIO], [test "x${have_eio}" = "xyes"])

# ecore-x availability, used for XV, VAAPI, VDPAU output.

have_ecore_x="no"
AC_ARG_ENABLE([ecore-x],
   [AC_HELP_STRING([--disable-ecore-x], [disable ecore-x support. @<:@default=detect@:>@])],
   [
    if test "x${enableval}" = "xyes" || test "x${enableval}" = "xauto" ; then
       want_ecore_x=${enableval}
    else
       want_ecore_x="no"
    fi
   ],
   [want_ecore_x="auto"])

if ! test "x$want_ecore_x" = "xno" ; then
   PKG_CHECK_MODULES([ECORE_X],
      [ecore-x >= 1.6.99],
      [
       AC_DEFINE(HAVE_ECORE_X, 1, [X11 support for Ecore])
       have_ecore_x="yes"
       requirement_elm="ecore-x >= 1.6.99 ${requirement_elm}"
      ],
      [have_ecore_x="no"]
   )
else
    have_ecore_x="no"
fi

if test "x$want_ecore_x" = "xyes" && test "x$have_ecore_x" = "xno" ; then
    AC_MSG_ERROR([ecore-x support requested, but not found by pkg-config.])
fi

### Checks for header files

AC_CHECK_HEADERS([unistd.h])

# Check for video4linux

AC_MSG_CHECKING([for V4L2])
AC_COMPILE_IFELSE(
   [AC_LANG_PROGRAM(
       [[
#include <stdio.h>
#include <linux/videodev2.h>
       ]],
       [[
fprintf(stdout, "%i\n", V4L2_CAP_VIDEO_CAPTURE);
       ]])],
   [
    AC_DEFINE(HAVE_V4L2, 1, [Define to 1 if you have Video4Linux 2 available])
    have_v4l2="yes"
   ],
   [have_v4l2="no"])
AC_MSG_RESULT([${have_v4l2}])

### Checks for types


### Checks for structures


### Checks for compiler characteristics
AC_C_BIGENDIAN
AC_C___ATTRIBUTE__

EFL_EMOTION_BUILD=""
case "$host_os" in
   mingw32ce*)
      EMOTION_CPPFLAGS="-D_WIN32_WCE=0x0420"
      EFL_EMOTION_BUILD="-DEFL_EMOTION_BUILD"
      ;;
   mingw*)
      EMOTION_CPPFLAGS="-D_WIN32_WINNT=0x0501"
      EFL_EMOTION_BUILD="-DEFL_EMOTION_BUILD"
      ;;
esac
AC_SUBST(EFL_EMOTION_BUILD)
AC_SUBST(EMOTION_CPPFLAGS)


### Checks for linker characteristics

# use --enable-auto-import on Windows

lt_enable_auto_import=""
case "$host_os" in
   mingw*)
      lt_enable_auto_import="-Wl,--enable-auto-import"
      ;;
esac
AC_SUBST(lt_enable_auto_import)


### Checks for library functions
AC_FUNC_ALLOCA


### Modules

EMOTION_CHECK_MODULE([Xine], [${want_xine}])
EMOTION_CHECK_MODULE([Gstreamer], [${want_gstreamer}])
EMOTION_CHECK_MODULE([Generic], [${want_generic}])

EMOTION_CHECK_GENERIC_PLAYER([VLC], [${want_generic_vlc}])

if test "x${enable_xine}" = "xno" && test "x${enable_gstreamer}" = "xno" && test "x${enable_generic}" = "xno" ; then
   AC_MSG_ERROR([Xine, Gstreamer or Generic backends must be selected to build Emotion])
fi

# Check if gstreamer X Overlay is available
build_xoverlay="no"
if test "x${enable_gstreamer}" = "xyes" ; then
   PKG_CHECK_MODULES([GSTREAMER_INTERFACE],
      [gstreamer-interfaces-0.10 >= 0.10.34],
      [build_xoverlay="yes"],
      [build_xoverlay="no"])
   if test "x${build_xoverlay}" = "xyes" ; then
      save_CPPFLAGS=$CPPFLAGS
      CPPFLAGS="$CPPFLAGS ${GSTREAMER_CFLAGS} ${GSTREAMER_INTERFACE_CFLAGS}"
      AC_CHECK_HEADER([gst/interfaces/xoverlay.h],
         [
          AC_DEFINE(HAVE_XOVERLAY_H, 1, [Build with Gstreamer Xoverlay support])
          build_xoverlay="yes"
         ],
         [build_xoverlay="no"])
      CPPFLAGS=$save_CPPFLAGS

      save_LDFLAGS=${LDFLAGS}
      LDFLAGS="${LDFLAGS} ${GSTREAMER_INTERFACES}"
      AC_CHECK_LIB([gstinterfaces-0.10],
         [gst_x_overlay_set_window_handle],
         [AC_DEFINE([HAVE_X_OVERLAY_SET], [1], [Use gst_x_overlay_set_window_handle instead of old deprecated gst_x_overlay_set_xwindow_id])])
      LDFLAGS=$sava_LDFLAGS
   fi
fi

### install and build examples

EFL_CHECK_BUILD_EXAMPLES([enable_build_examples="yes"], [enable_build_examples="no"])
EFL_CHECK_INSTALL_EXAMPLES([enable_install_examples="yes"], [enable_install_examples="no"])

AC_SUBST(requirement_emotion)

AC_OUTPUT([
Makefile
emotion.pc
emotion.spec
src/Makefile
src/lib/Makefile
src/modules/Makefile
src/modules/xine/Makefile
src/modules/gstreamer/Makefile
src/modules/generic/Makefile
src/edje_external/Makefile
src/generic_players/Makefile
src/generic_players/vlc/Makefile
src/bin/Makefile
src/examples/Makefile
doc/Makefile
doc/Doxyfile
data/Makefile
])


#####################################################################
## Info

echo
echo
echo
echo "------------------------------------------------------------------------"
echo "$PACKAGE $VERSION"
echo "------------------------------------------------------------------------"
echo
echo "Configuration Options Summary:"
echo
echo "  Modules:"
echo "    Xine...............: ${enable_xine}"
echo "    Gstreamer..........: ${enable_gstreamer} (X: ${have_ecore_x}/${build_xoverlay})"
echo "    Generic............: ${enable_generic}"

if test "x${enable_generic}" = "xyes" || test "x${enable_generic}" = "xstatic"; then
echo
echo "  Generic Players:"
echo "    VLC................: ${enable_generic_vlc}"
fi

echo
echo "  Build emotion_test...: $have_emotion_test"
echo "  edje_cc..............: ${edje_cc}"
echo
echo "  Edje EXTERNAL support: ${have_edje_external}"
echo
echo "  Eio..................: ${have_eio}"
echo "  V4L2.................: ${have_v4l2}"
echo
echo "Documentation..........: ${build_doc}"
echo "Examples.............: ${enable_build_examples}"
echo "Examples installed...: ${enable_install_examples}"
echo
echo "Compilation............: make (or gmake)"
echo "  CPPFLAGS.............: $CPPFLAGS"
echo "  CFLAGS...............: $CFLAGS"
echo "  LDFLAGS..............: $LDFLAGS"
echo
echo "Installation...........: make install (as root if needed, with 'su' or 'sudo')"
echo "  prefix...............: $prefix"
echo
if test "x${have_static_module}" = "xyes" ; then
echo -e "\0033\01331;31mWarning\0033\01331;0m: You are trying to link statically one or more modules to Emotion."
echo "         You must know what you are doing, or else you will have a lot of problems."
echo "         And asparagus will disappear from the earth."
echo "         Think about that."
echo
fi