another case without a break
[framework/uifw/edje.git] / configure.ac
1 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
2 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
3 m4_define([v_maj], [0])
4 m4_define([v_min], [9])
5 m4_define([v_mic], [99])
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([edje], [v_ver], [enlightenment-devel@lists.sourceforge.net])
23 AC_PREREQ([2.52])
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 AC_DEFINE_UNQUOTED([SHARED_LIB_SUFFIX], ["$shrext_cmds"], [Suffix for shared objects])
57
58 EFL_CHECK_PATH_MAX
59
60 ### Default options with respect to host
61
62 case "$host_os" in
63    mingw32ce* | cegcc*)
64       install_vim="no"
65       have_edje_cc="no"
66       ;;
67    *)
68       install_vim="yes"
69       have_edje_cc="yes"
70       ;;
71 esac
72
73 requirement_edje=""
74
75
76 ### Additional options to configure
77
78 AC_ARG_ENABLE([amalgamation],
79    [AC_HELP_STRING([--enable-amalgamation], [enable generation of one single file with all source code in it, helps compiler optimizations.])],
80    [if test "x${enableval}" = "xyes"; then
81        do_amalgamation="yes"
82     else
83        do_amalgamation="no"
84     fi
85    ],
86    [do_amalgamation="no"]
87 )
88 AM_CONDITIONAL([EDJE_AMALGAMATION], [test "x${do_amalgamation}" = "xyes"])
89
90 EFL_ENABLE_BIN([edje-cc])
91 EFL_ENABLE_BIN([edje-decc])
92 EFL_ENABLE_BIN([edje-recc])
93 EFL_ENABLE_BIN([edje-player])
94
95 # Optional EDJE_PROGRAM_CACHE (use much more ram, but increase speed in some cases)
96 want_edje_program_cache="no"
97
98 AC_ARG_ENABLE([edje-program-cache],
99    [AC_HELP_STRING(
100        [--enable-edje-program-cache],
101        [enable EDJE_PROGRAM_CACHE support. [[default=disabled]]]
102     )],
103    [want_edje_program_cache=$enableval]
104 )
105 AM_CONDITIONAL([EDJE_PROGRAM_CACHE], [test "x${want_edje_program_cache}" = "xyes"])
106
107 if test "x${want_edje_program_cache}" = "xyes" ; then
108    AC_DEFINE([EDJE_PROGRAM_CACHE], [1], [Cache result of program glob matches - this uses up extra ram with the gain of faster program matching])
109 fi
110
111 # Optional EDJE_CALC_CACHE (use more ram, but increase speed by reducing the need to recalculate static stuff)
112 want_edje_calc_cache="yes"
113
114 AC_ARG_ENABLE([edje-calc-cache],
115    [AC_HELP_STRING(
116        [--enable-edje-calc-cache],
117        [enable EDJE_CALC_CACHE support. [[default=disabled]]]
118     )],
119    [want_edje_calc_cache=$enableval]
120 )
121 AM_CONDITIONAL([EDJE_CALC_CACHE], [test "x${want_edje_calc_cache}" = "xyes"])
122
123 if test "x${want_edje_calc_cache}" = "xyes" ; then
124    AC_DEFINE([EDJE_CALC_CACHE], [1], [Cache result of edje_part_recalc - this uses up extra ram with the gain of reducing CPU usage when edje object are not resized])
125 fi
126
127 # Enable Fixed Point use
128 want_fixed_point="no"
129
130 AC_ARG_ENABLE([fixed-point],
131    [AC_HELP_STRING(
132        [--enable-fixed-point],
133        [reduce use of FPU by using Fixed Point provided by Eina and Eet, [[default=disabled]]]
134     )],
135     [want_fixed_point=$enableval]
136 )
137 AM_CONDITIONAL([BUILD_EDJE_FP], [test "x${want_fixed_point}" = "xyes"])
138
139 if test "x${want_fixed_point}" = "xyes" ; then
140    AC_DEFINE([BUILD_EDJE_FP], [1], [Use Fixed Point instead of FPU])
141 fi
142
143 install_vim="yes"
144 AC_ARG_WITH([vim],
145     [AC_HELP_STRING([--with-vim=DIR], [Location of Vim data files [[autodetect]]])],
146     [
147      if test -d "${withval}"; then
148         vimdir="${withval}"
149      fi
150     ]
151 )
152
153 if test "x${vimdir}" = "x" ; then
154    if test -d "${prefix}/share/vim"; then
155       vimdir="${prefix}/share/vim"
156    elif test -d "/usr/share/vim"; then
157       vimdir="/usr/share/vim"
158    elif test -d "/usr/local/share/vim"; then
159       vimdir="/usr/local/share/vim"
160    elif test -d "/opt/share/vim"; then
161       vimdir="/opt/share/vim"
162    else
163       install_vim="no"
164    fi
165 fi
166
167 AC_MSG_CHECKING([for location of Vim data files])
168
169 if test "${install_vim}" = "yes"; then
170    AC_MSG_RESULT([$vimdir])
171 else
172    AC_MSG_RESULT([Not found, EDC syntax file will not be installed])
173 fi
174
175 AC_SUBST(vimdir)
176
177 ### Checks for programs
178 AC_PROG_CC
179
180 # doxygen program for documentation building
181
182 EFL_CHECK_DOXYGEN([build_doc="yes"], [build_doc="no"])
183
184 # python
185
186 AM_PATH_PYTHON([2.5], , [:])
187 AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != : ])
188
189 # pkg-config
190
191 PKG_PROG_PKG_CONFIG
192
193 # Check whether pkg-config supports Requires.private
194
195 if $PKG_CONFIG --atleast-pkgconfig-version 0.22; then
196    pkgconfig_requires_private="Requires.private"
197 else
198    pkgconfig_requires_private="Requires"
199 fi
200 AC_SUBST(pkgconfig_requires_private)
201
202
203 ### Checks for libraries
204
205 # Evil library for compilation on Windows
206
207 EFL_EDJE_BUILD=""
208 case "$host_os" in
209    mingw* | cegcc*)
210       PKG_CHECK_MODULES([EVIL], [evil])
211       AC_DEFINE([HAVE_EVIL], [1], [Set to 1 if Evil library is installed])
212       requirement_edje="evil ${requirement_edje}"
213       EFL_EDJE_BUILD="-DEFL_EDJE_BUILD"
214    ;;
215 esac
216 AC_SUBST(EFL_EDJE_BUILD)
217
218 # Dependencies for the library
219
220 # Lua pkg-config hack for different naming conventions
221 have_lua="yes"
222 requirement_lua=""
223 lua_libs=""
224 PKG_CHECK_MODULES([LUA], [lua >= 5.1.0], requirement_lua="lua",
225    [PKG_CHECK_MODULES([LUA], [lua5.1 >= 5.1.0], requirement_lua="lua5.1",
226       [PKG_CHECK_MODULES([LUA], [lua-5.1 >= 5.1.0], requirement_lua="lua-5.1",
227          [PKG_CHECK_MODULES([LUA], [lua51 >= 5.1.0], requirement_lua="lua51",
228             [have_lua="no"])])])])
229
230 if test "x${have_lua}" = "xno" ; then
231    AC_MSG_CHECKING([whether lua_newstate() is in liblua])
232    AC_CHECK_LIB([lua], [lua_newstate],
233       [
234        have_lua="yes"
235        lua_libs="-llua"
236       ],
237       [have_lua="no"])
238    AC_MSG_RESULT([${have_lua}])
239 fi
240 AC_SUBST(lua_libs)
241
242 if test "x${have_lua}" = "xno" ; then
243    AC_MSG_ERROR([Cannot find lua library. Be sure that you have installed it and set CFLAGS and LDFLAGS correctly])
244 fi
245
246 PKG_CHECK_MODULES([EDJE],
247    [
248     eina-0
249     eet >= 1.2.3
250     evas >= 0.9.9
251     ecore >= 0.9.9
252     ecore-file >= 0.9.9
253     embryo >= 0.9.1
254    ])
255
256 EDJE_LIBS="${EDJE_LIBS} ${LUA_LIBS} ${lua_libs}"
257 EDJE_CFLAGS="${EDJE_CFLAGS} ${LUA_CFLAGS}"
258
259 requirement_edje="embryo ecore evas eet eina-0 ${requirement_edje}"
260 requirement_edje="${requirement_lua} ${requirement_edje}"
261
262 have_ecore_imf="no"
263 PKG_CHECK_MODULES([ECORE_IMF],
264    [
265     ecore-imf >= 0.9.9
266     ecore-imf-evas >= 0.9.9
267    ],
268    [
269     AC_DEFINE([HAVE_ECORE_IMF], [1], [Input Method Support for Edje Entry])
270     have_ecore_imf="yes"
271     requirement_edje="ecore-imf-evas ecore-imf ${requirement_edje}"
272    ],
273    [have_ecore_imf="no"])
274
275 # Dependencies for the binaries
276
277 if test "x$have_edje_cc" = "xyes"; then
278    PKG_CHECK_MODULES([ECORE_FILE], [ecore-file >= 0.9.9])
279    PKG_CHECK_MODULES([ECORE_EVAS], [ecore-evas >= 0.9.9])
280 fi
281
282 if test "x$have_edje_player" = "xyes"; then
283    PKG_CHECK_MODULES([ECORE_EVAS], [ecore-evas >= 0.9.9])
284 fi
285
286
287 ### Checks for header files
288 AC_CHECK_HEADERS([locale.h])
289
290
291 ### Checks for types
292
293
294 ### Checks for structures
295
296
297 ### Checks for compiler characteristics
298 AM_PROG_CC_C_O
299 AC_C_CONST
300 AC_PROG_CC_STDC
301 AC_HEADER_STDC
302 AC_C___ATTRIBUTE__
303
304 case "$host_os" in
305    mingw32ce*)
306       EDJE_CFLAGS="${EDJE_CFLAGS} -D_WIN32_WCE=0x0420"
307       ;;
308    cegcc*)
309       EDJE_CFLAGS="${EDJE_CFLAGS} -mwin32 -D_WIN32_WCE=0x0420"
310       ;;
311 esac
312
313
314 ### Checks for linker characteristics
315
316 lt_enable_auto_import=""
317 case "$host_os" in
318    mingw* | cegcc*)
319       lt_enable_auto_import="-Wl,--enable-auto-import"
320       ;;
321 esac
322 AC_SUBST(lt_enable_auto_import)
323
324
325 ### Checks for library functions
326 AC_FUNC_ALLOCA
327
328 case "$host_os" in
329    mingw* | cegcc*)
330       AC_DEFINE([HAVE_REALPATH], [1], [Define to 1 if you have the `realpath' function.])
331       ;;
332    *)
333       AC_CHECK_FUNCS([realpath])
334       ;;
335 esac
336
337
338 AC_SUBST(requirement_edje)
339
340 AC_OUTPUT([
341 edje.pc
342 edje.spec
343 Makefile
344 data/Makefile
345 data/include/Makefile
346 doc/Makefile
347 doc/edje.dox
348 src/Makefile
349 src/lib/Makefile
350 src/bin/Makefile
351 utils/Makefile
352 ])
353
354
355 #####################################################################
356 ## Info
357
358 echo
359 echo
360 echo
361 echo "------------------------------------------------------------------------"
362 echo "$PACKAGE $VERSION"
363 echo "------------------------------------------------------------------------"
364 echo
365 echo "Configuration Options Summary:"
366 echo
367 echo "  Amalgamation.........: ${do_amalgamation}"
368 echo "  Ecore IMF............: $have_ecore_imf"
369 echo "  EDJE_PROGRAM_CACHE...: $want_edje_program_cache"
370 echo "  EDJE_CALC_CACHE......: $want_edje_calc_cache"
371 echo "  Fixed point..........: $want_fixed_point"
372 echo
373 echo "  Build edje_cc........: $have_edje_cc"
374 echo "  Build edje_decc......: $have_edje_decc"
375 echo "  Build edje_recc......: $have_edje_recc"
376 echo "  Build edje_player....: $have_edje_player"
377 echo
378 echo "  Documentation........: ${build_doc}"
379 echo
380 echo "Compilation............: make (or gmake)"
381 echo "  CPPFLAGS.............: $CPPFLAGS"
382 echo "  CFLAGS...............: $CFLAGS"
383 echo "  LDFLAGS..............: $LDFLAGS"
384 echo
385 echo "Installation...........: make install (as root if needed, with 'su' or 'sudo')"
386 echo "  prefix...............: $prefix"
387 echo