1d531ccf9216d01444eb75ba679d61b571feb102
[framework/uifw/emotion.git] / configure.ac
1 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
2 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
3 m4_define([v_maj], [0])
4 m4_define([v_min], [2])
5 m4_define([v_mic], [0])
6 m4_define([v_rev], m4_esyscmd([(svnversion "${SVN_REPO_PATH:-.}" | grep -v export || echo 0) | awk -F : '{printf("%s\n", $1);}' | tr -d ' :MSP\n']))
7 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']))])
8 ##--   When released, remove the dnl on the below line
9 dnl m4_undefine([v_rev])
10 ##--   When doing snapshots - change soname. remove dnl on below line
11 m4_define([relname], [ver-pre-svn-07])
12 m4_define([v_rel], [-release relname])
13 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
14 m4_ifdef([v_rev], [m4_define([v_ver], [v_maj.v_min.v_mic.v_rev])],
15 [m4_define([v_ver], [v_maj.v_min.v_mic])])
16 m4_define([lt_rev], m4_eval(v_maj + v_min))
17 m4_define([lt_cur], v_mic)
18 m4_define([lt_age], v_min)
19 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
20 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
21
22 AC_INIT([emotion], [v_ver], [enlightenment-devel@lists.sourceforge.net])
23 AC_PREREQ([2.60])
24 AC_CONFIG_SRCDIR([configure.ac])
25 AC_CONFIG_MACRO_DIR([m4])
26 AC_CANONICAL_BUILD
27 AC_CANONICAL_HOST
28 AC_ISC_POSIX
29
30 AM_INIT_AUTOMAKE([1.6 dist-bzip2])
31 AM_CONFIG_HEADER([config.h])
32 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
33
34 AC_LIBTOOL_WIN32_DLL
35 define([AC_LIBTOOL_LANG_CXX_CONFIG], [:])dnl
36 define([AC_LIBTOOL_LANG_F77_CONFIG], [:])dnl
37 AC_PROG_LIBTOOL
38
39 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
40 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
41 m4_ifdef([v_rev], , [m4_define([v_rev], [0])])
42 m4_ifdef([v_rel], , [m4_define([v_rel], [])])
43 AC_DEFINE_UNQUOTED(VMAJ, [v_maj], [Major version])
44 AC_DEFINE_UNQUOTED(VMIN, [v_min], [Minor version])
45 AC_DEFINE_UNQUOTED(VMIC, [v_mic], [Micro version])
46 AC_DEFINE_UNQUOTED(VREV, [v_rev], [Revison])
47 version_info="lt_rev:lt_cur:lt_age"
48 release_info="v_rel"
49 AC_SUBST(version_info)
50 AC_SUBST(release_info)
51 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
52 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
53 VMAJ=v_maj
54 AC_SUBST(VMAJ)
55
56 want_vlc="no"
57 case "$host_os" in
58    mingw* | cegcc*)
59       want_xine="no"
60       want_gstreamer="yes"
61       ;;
62    *)
63       want_xine="yes"
64       want_gstreamer="yes"
65       ;;
66 esac
67
68 requirement_emotion=""
69
70 ### Additional options to configure
71
72 EFL_ENABLE_BIN([emotion-test])
73
74 # edje_cc
75
76 AC_ARG_WITH([edje-cc],
77    [AC_HELP_STRING([--with-edje-cc=PATH], [specify a specific path to edje_cc])],
78    [
79     v=$withval;
80     edje_cc=$v
81     echo "  Enlightenment edje_cc explicitly set to "$edje_cc;
82    ],
83    [edje_cc=$(pkg-config --variable=prefix edje)/bin/edje_cc])
84 AC_SUBST(edje_cc)
85
86
87 ### Checks for programs
88 AC_PROG_CC
89
90 # pkg-config
91 PKG_PROG_PKG_CONFIG
92
93 # Check whether pkg-config supports Requires.private
94 if $PKG_CONFIG --atleast-pkgconfig-version 0.22; then
95    pkgconfig_requires_private="Requires.private"
96 else
97    pkgconfig_requires_private="Requires"
98 fi
99 AC_SUBST(pkgconfig_requires_private)
100
101 # doxygen program for documentation building
102
103 EFL_CHECK_DOXYGEN([build_doc="yes"], [build_doc="no"])
104
105
106 ### Checks for libraries
107
108 PKG_CHECK_MODULES(EMOTION, [eina >= 1.0.0 evas >= 1.0.0 ecore >= 1.0.0])
109 requirement_emotion="ecore >= 1.0.0 evas >= 1.0.0 eina >= 1.0.0"
110
111 if test "x${have_emotion_test}" = "xyes" ; then
112    PKG_CHECK_MODULES(EMOTION_BIN, [eina >= 1.0.0 evas >= 1.0.0 ecore >= 1.0.0 ecore-evas >= 1.0.0 edje >= 1.0.0])
113 fi
114
115 PKG_CHECK_MODULES(ECORE_X, [ecore-x >= 1.0.0], [have_ecore_x="yes"], [have_ecore_x="no"])
116
117 PKG_CHECK_MODULES(ECORE_FB, [ecore-fb >= 1.0.0], [have_ecore_fb="yes"], [have_ecore_fb="no"])
118
119 if test "x${have_ecore_x}" = "xyes" ; then
120    AC_DEFINE(EMOTION_HAVE_ECORE_X, 1, [Define to 1 if Ecore_X is enabled])  
121 fi
122
123 if test "x${have_ecore_fb}" = "xyes" ; then
124    AC_DEFINE(EMOTION_HAVE_ECORE_FB, 1, [Define to 1 if Ecore_Fb is enabled])  
125 fi
126
127 PKG_CHECK_EXISTS([evas-software-x11 >= 1.0.0], [AC_DEFINE(HAVE_EVAS_SOFWARE_X11, 1, [Evas Software Xlib Engine Support])])
128
129 PKG_CHECK_EXISTS([evas-xrender-x11 >= 1.0.0], [AC_DEFINE(HAVE_EVAS_XRENDER_X11, 1, [Evas Software Xlib Engine Support])])
130
131 PKG_CHECK_EXISTS([evas-opengl-x11 >= 1.0.0], [AC_DEFINE(HAVE_EVAS_OPENGL_X11, 1, [Evas OpenGL Xlib Engine Support])])
132
133 PKG_CHECK_EXISTS([evas-fb >= 1.0.0], [AC_DEFINE(HAVE_EVAS_FB, 1, [Evas Framebuffer Engine Support])])
134
135 EFL_EDJE_EXTERNAL([have_edje_external="yes"], [have_edje_external="no"])
136
137 PKG_CHECK_MODULES(EEZE, [eeze >= 1.0.99], [have_eeze="yes"], [have_eeze="no"])
138
139 if test "x${have_eeze}" = "xyes"; then
140    AC_DEFINE(EMOTION_HAVE_EEZE, 1, [Define to 1 if Eeze is available])
141 fi
142
143 ### Checks for header files
144 AC_HEADER_STDC
145
146 ### Checks for types
147
148
149 ### Checks for structures
150
151
152 ### Checks for compiler characteristics
153 AC_C_CONST
154 AC_C_BIGENDIAN
155 AM_PROG_CC_STDC
156 AC_C___ATTRIBUTE__
157
158 EFL_EMOTION_BUILD=""
159 case "$host_os" in
160    mingw32ce* | cegcc*)
161       EMOTION_CPPFLAGS="-D_WIN32_WCE=0x0420"
162       EFL_EMOTION_BUILD="-DEFL_EMOTION_BUILD"
163       ;;
164    mingw*)
165       EMOTION_CPPFLAGS="-D_WIN32_WINNT=0x0501"
166       EFL_EMOTION_BUILD="-DEFL_EMOTION_BUILD"
167       ;;
168 esac
169 AC_SUBST(EFL_EMOTION_BUILD)
170 AC_SUBST(EMOTION_CPPFLAGS)
171
172
173 ### Checks for linker characteristics
174
175 # use --enable-auto-import on Windows
176
177 lt_enable_auto_import=""
178 case "$host_os" in
179    mingw* | cegcc*)
180       lt_enable_auto_import="-Wl,--enable-auto-import"
181       ;;
182 esac
183 AC_SUBST(lt_enable_auto_import)
184
185 ### Check for extended attribute
186
187 AC_COMPILE_IFELSE(
188    [AC_LANG_PROGRAM(
189        [[
190 #include <stdlib.h>
191 #include <sys/types.h>
192 #include <sys/xattr.h>
193        ]],
194        [[
195 size_t tmp = listxattr("/", NULL, 0);
196 tmp = getxattr("/", "user.ethumb.md5", NULL, 0);
197 setxattr("/", "user.ethumb.md5", NULL, 0, 0);
198        ]])],
199     [
200       AC_DEFINE(HAVE_XATTR, 1, [Define to 1 if you have 'listxattr', 'setxattr' and 'getxattr'])
201       have_xattr="yes"
202     ],
203     [have_xattr="no"])
204
205 AC_MSG_CHECKING([for Xattr])
206 AC_MSG_RESULT([${have_xattr}])
207
208 ### Modules
209
210 EMOTION_CHECK_MODULE([Xine], [${want_xine}])
211 EMOTION_CHECK_MODULE([Gstreamer], [${want_gstreamer}])
212 EMOTION_CHECK_MODULE([VLC], [${want_vlc}])
213
214 #disabled vlc
215 #if test "x${enable_xine}" = "xno" && test "x${enable_gstreamer}" = "xno" && test "x${enable_vlc}" = "xno" ; then
216 if test "x${enable_xine}" = "xno" && test "x${enable_gstreamer}" = "xno"; then
217 #disabled vlc
218 #   AC_MSG_ERROR([Xine, Gstreamer or VLC backends must be selected to build Emotion])
219    AC_MSG_ERROR([Xine or Gstreamer backends must be selected to build Emotion])
220 fi
221
222 PKG_CHECK_MODULES([EIO],
223         [eio],
224         [
225          have_eio="yes"
226          AC_DEFINE(HAVE_EIO, 1, [Use EIO for asynchronous file access])
227          requirement_emotion="eio ${requirement_emotion}"
228         ],
229         [have_eio="no"])
230
231 AM_CONDITIONAL([HAVE_EIO], [test "x${have_eio}" = "xyes"])
232
233 ### install and build examples
234
235 EFL_CHECK_BUILD_EXAMPLES([enable_build_examples="yes"], [enable_build_examples="no"])
236 EFL_CHECK_INSTALL_EXAMPLES([enable_install_examples="yes"], [enable_install_examples="no"])
237
238 AC_SUBST(requirement_emotion)
239
240 #disabled vlc
241 #src/modules/vlc/Makefile
242
243 AC_OUTPUT([
244 Makefile
245 emotion.pc
246 emotion.spec
247 src/Makefile
248 src/lib/Makefile
249 src/modules/Makefile
250 src/modules/xine/Makefile
251 src/modules/gstreamer/Makefile
252 src/edje_external/Makefile
253 src/bin/Makefile
254 src/examples/Makefile
255 doc/Makefile
256 doc/Doxyfile
257 doc/emotion.dox
258 data/Makefile
259 ])
260
261
262 #####################################################################
263 ## Info
264
265 echo
266 echo
267 echo
268 echo "------------------------------------------------------------------------"
269 echo "$PACKAGE $VERSION"
270 echo "------------------------------------------------------------------------"
271 echo
272 echo "Configuration Options Summary:"
273 echo
274 echo "  Modules:"
275 echo "    Xine...............: ${enable_xine}"
276 #echo "    Vlc................: ${enable_vlc}"
277 echo "    Gstreamer..........: ${enable_gstreamer}"
278 echo
279 echo "  Build emotion_test...: $have_emotion_test"
280 echo "  edje_cc..............: ${edje_cc}"
281 echo
282 echo "  Edje EXTERNAL support: ${have_edje_external}"
283 echo
284 echo "  Xattr................: ${have_xattr}"
285 echo "  Eio..................: ${have_eio}"
286 echo
287 echo "Documentation..........: ${build_doc}"
288 echo "Examples.............: ${enable_build_examples}"
289 echo "Examples installed...: ${enable_install_examples}"
290 echo
291 echo "Compilation............: make (or gmake)"
292 echo "  CPPFLAGS.............: $CPPFLAGS"
293 echo "  CFLAGS...............: $CFLAGS"
294 echo "  LDFLAGS..............: $LDFLAGS"
295 echo
296 echo "Installation...........: make install (as root if needed, with 'su' or 'sudo')"
297 echo "  prefix...............: $prefix"
298 echo
299 if test "x${have_static_module}" = "xyes" ; then
300 echo -e "\0033\01331;31mWarning\0033\01331;0m: You are trying to link statically one or more modules to Emotion."
301 echo "         You must know what you are doing, or else you will have a lot of problems."
302 echo "         And asparagus will disappear from the earth."
303 echo "         Think about that."
304 echo
305 fi