1 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
2 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
3 m4_define([v_maj], [1])
4 m4_define([v_min], [6])
5 m4_define([v_mic], [0])
6 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']))
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
10 ##-- When doing snapshots - change soname. remove dnl on below line
11 dnl m4_define([relname], [ver-pre-svn-05])
12 dnl m4_define([v_rel], [-release relname])
13 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
14 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])])
15 m4_define([lt_cur], m4_eval(v_maj + v_min))
16 m4_define([lt_rev], v_mic)
17 m4_define([lt_age], v_min)
18 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
19 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
21 AC_INIT([eet], [v_ver], [enlightenment-devel@lists.sourceforge.net])
23 AC_CONFIG_SRCDIR([configure.ac])
24 AC_CONFIG_MACRO_DIR([m4])
26 AC_CONFIG_HEADERS([config.h])
28 #ifndef EFL_CONFIG_H__
29 #define EFL_CONFIG_H__
32 #endif /* EFL_CONFIG_H__ */
35 AM_INIT_AUTOMAKE([1.6 dist-bzip2])
36 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
39 define([AC_LIBTOOL_LANG_CXX_CONFIG], [:])dnl
40 define([AC_LIBTOOL_LANG_F77_CONFIG], [:])dnl
43 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
44 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
45 m4_ifdef([v_rev], , [m4_define([v_rev], [0])])
46 m4_ifdef([v_rel], , [m4_define([v_rel], [])])
47 AC_DEFINE_UNQUOTED(VMAJ, [v_maj], [Major version])
48 AC_DEFINE_UNQUOTED(VMIN, [v_min], [Minor version])
49 AC_DEFINE_UNQUOTED(VMIC, [v_mic], [Micro version])
50 AC_DEFINE_UNQUOTED(VREV, [v_rev], [Revison])
51 version_info="lt_cur:lt_rev:lt_age"
53 AC_SUBST(version_info)
54 AC_SUBST(release_info)
55 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
56 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
61 ### Needed information
66 ### Default options with respect to host
76 ### Additional options to configure
80 AC_ARG_ENABLE([amalgamation],
81 [AC_HELP_STRING([--enable-amalgamation], [enable generation of one single file with all source code in it, helps compiler optimizations.])],
82 [if test "x${enableval}" = "xyes"; then
88 [do_amalgamation="no"]
90 AM_CONDITIONAL(EET_AMALGAMATION, test "x${do_amalgamation}" = "xyes")
94 # Old eet file format support
96 old_eet_file_format="yes"
97 AC_ARG_ENABLE(old-eet-file-format,
99 [--disable-old-eet-file-format],
100 [disable old eet file format support. [[default=enabled]]]
102 [old_eet_file_format=$enableval]
104 AC_MSG_CHECKING([whether to support old eet file format])
105 AC_MSG_RESULT([${old_eet_file_format}])
107 if test "x${old_eet_file_format}" = "xyes" ; then
108 AC_DEFINE(EET_OLD_EET_FILE_FORMAT, 1, [support old eet file format])
110 AC_DEFINE(EET_OLD_EET_FILE_FORMAT, 0, [support old eet file format])
115 AC_ARG_ENABLE([openssl],
116 [AC_HELP_STRING([--disable-openssl], [disable openssl eet support])],
117 [want_openssl=$enableval]
119 AC_MSG_CHECKING([whether to use OpenSSL])
120 AC_MSG_RESULT([${want_openssl}])
122 # Cryptography support
124 AC_ARG_ENABLE([cipher],
125 [AC_HELP_STRING([--disable-cipher], [disable cipher support for eet API])],
126 [want_cipher=$enableval]
128 AC_MSG_CHECKING([whether to use cipher])
129 AC_MSG_RESULT([${want_cipher}])
131 AC_ARG_ENABLE([signature],
132 [AC_HELP_STRING([--disable-signature], [disable signature file support for eet])],
133 [want_signature=$enableval]
135 AC_MSG_CHECKING([whether to use signature])
136 AC_MSG_RESULT([${want_signature}])
140 AC_ARG_ENABLE([assert],
141 [AC_HELP_STRING([--enable-assert], [enable assert, [[default=disabled]]])],
142 [prefer_assert=$enableval]
147 AC_ARG_ENABLE([install-examples],
148 [AC_HELP_STRING([--disable-install-examples],
149 [disable installing examples (compiled or just source). @<:@default==enabled@:>@])],
151 if test "x${enableval}" = "xyes" ; then
152 install_examples="yes"
154 install_examples="no"
157 [install_examples="yes"])
158 AM_CONDITIONAL([INSTALL_EXAMPLES], [test "x${install_examples}" = "xyes"])
160 AC_ARG_ENABLE([build-examples],
161 [AC_HELP_STRING([--enable-build-examples],
162 [enable building examples. @<:@default==disabled@:>@])],
164 if test "x${enableval}" = "xyes" ; then
170 [build_examples="no"])
171 AM_CONDITIONAL([BUILD_EXAMPLES], [test "x${build_examples}" = "xyes"])
173 # Unit tests, coverage and benchmarking
175 EFL_CHECK_TESTS([enable_tests="yes"], [enable_tests="no"])
176 EFL_CHECK_COVERAGE([${enable_tests}], [enable_coverage="yes"], [enable_coverage="no"])
178 if test "x${prefer_assert}" = "xno"; then
179 DEBUG_CFLAGS="-DNDEBUG"
181 # use debug symbols and set DEBUG if coverage support is enabled
182 DEBUG_CFLAGS="${EFL_DEBUG_CFLAGS}"
184 AC_SUBST(DEBUG_CFLAGS)
187 ### Checks for programs
193 # Check whether pkg-config supports Requires.private
194 if $PKG_CONFIG --atleast-pkgconfig-version 0.22; then
195 pkgconfig_requires_private="Requires.private"
197 pkgconfig_requires_private="Requires"
199 AC_SUBST(pkgconfig_requires_private)
202 # doxygen program for documentation building
204 EFL_CHECK_DOXYGEN([build_doc="yes"], [build_doc="no"])
206 ### Checks for libraries
208 # Evil library for compilation on Windows
213 PKG_CHECK_MODULES([EVIL], [evil >= 1.0.0])
214 AC_DEFINE(HAVE_EVIL, 1, [Set to 1 if Evil library is installed])
215 requirement_eet="evil ${requirement_eet}"
216 EFL_EET_BUILD="-DEFL_EET_BUILD"
219 AC_SUBST(EFL_EET_BUILD)
234 PKG_CHECK_MODULES(EINA, [eina >= 1.2.0])
235 requirement_eet="eina >= 1.2.0 ${requirement_eet}"
237 ### Checks for portability layer
239 PKG_CHECK_MODULES([EXOTIC],
241 [enable_exotic="yes"],
242 [enable_exotic="no"])
244 if test "x${enable_exotic}" = "xyes"; then
245 requirement_eet="exotic ${requirement_eet}"
247 AC_DEFINE([HAVE_EXOTIC_H], [1], [Define to 1 if you have Exotic.])
252 AC_ARG_ENABLE([gnutls],
253 [AC_HELP_STRING([--disable-gnutls], [disable gnutls eet support])],
254 [want_gnutls=$enableval]
256 AC_MSG_CHECKING([whether to use Gnutls])
257 AC_MSG_RESULT([${want_gnutls}])
261 if test "x${want_gnutls}" = "xyes" || test "x${want_gnutls}" = "xauto" ; then
262 PKG_CHECK_MODULES(GNUTLS, [gnutls >= 1.7.6],
266 AC_DEFINE(HAVE_GNUTLS, 1, [Have Gnutls support])
267 requirement_eet="gnutls ${requirement_eet}"
270 if test "x${have_gnutls}" = "xyes" ; then
271 AC_PATH_GENERIC([libgcrypt], [], [have_gnutls="yes"], [have_gnutls="no"])
272 if test "x${have_gnutls}" = "xyes" ; then
273 GNUTLS_CFLAGS="${GNUTLS_CFLAGS} ${LIBGCRYPT_CFLAGS}"
274 GNUTLS_LIBS="${GNUTLS_LIBS} ${LIBGCRYPT_LIBS}"
279 # Specific GNUTLS improvement
282 AC_ARG_ENABLE(new-gnutls-api,
284 [--disable-new-gnutls-api],
285 [enable use of gnutls_x509_crt_verify_hash. [[default=enable]]]
287 [new_gnutls_api=$enableval]
289 AC_MSG_CHECKING([whether to use gnutls_x509_crt_verify_hash])
290 AC_MSG_RESULT([${new_gnutls_api}])
292 if test "x${new_gnutls_api}" = "xyes" ; then
293 tmp_CFLAGS="${CFLAGS}"
295 CFLAGS="${GNUTLS_CFLAGS}"
296 LIBS="${GNUTLS_LIBS}"
297 AC_CHECK_LIB(gnutls, gnutls_x509_crt_verify_hash,
298 [ new_gnutls_api="yes" ],
299 [ new_gnutls_api="no" ]
301 CFLAGS="${tmp_CFLAGS}"
304 if test "x${new_gnutls_api}" = "xyes"; then
305 AC_DEFINE(EET_USE_NEW_GNUTLS_API, 1, [use gnutls_x509_crt_verify_hash])
309 use_gnutls_privkey_sign_data="no"
310 if test "x${want_gnutls}" = "xyes" -o "x${want_gnutls}" = "xauto"; then
311 tmp_CFLAGS="${CFLAGS}"
313 CFLAGS="${GNUTLS_CFLAGS}"
314 LIBS="${GNUTLS_LIBS}"
315 AC_CHECK_LIB(gnutls, gnutls_privkey_sign_data,
316 [ use_gnutls_privkey_sign_data="yes" ],
317 [ use_gnutls_privkey_sign_data="no" ]
319 CFLAGS="${tmp_CFLAGS}"
322 if test "x${use_gnutls_privkey_sign_data}" = "xyes"; then
323 AC_DEFINE(EET_USE_NEW_PRIVKEY_SIGN_DATA, 1, [use gnutls_privkey_sign_data])
326 AC_MSG_CHECKING([whether to use gnutls_privkey_sign_data])
327 AC_MSG_RESULT([${use_gnutls_privkey_sign_data}])
329 use_gnutls_pubkey_verify_hash="no"
330 if test "x${want_gnutls}" = "xyes" -o "x${want_gnutls}" = "xauto"; then
331 tmp_CFLAGS="${CFLAGS}"
333 CFLAGS="${GNUTLS_CFLAGS}"
334 LIBS="${GNUTLS_LIBS}"
335 AC_CHECK_LIB(gnutls, gnutls_pubkey_verify_hash,
336 [ use_gnutls_pubkey_verify_hash="yes" ],
337 [ use_gnutls_pubkey_verify_hash="no" ]
339 CFLAGS="${tmp_CFLAGS}"
342 if test "x${use_gnutls_pubkey_verify_hash}" = "xyes"; then
343 AC_DEFINE(EET_USE_NEW_PUBKEY_VERIFY_HASH, 1, [use gnutls_pubkey_verify_hash])
346 AC_MSG_CHECKING([whether to use gnutls_pubkey_verify_hash])
347 AC_MSG_RESULT([${use_gnutls_pubkey_verify_hash}])
351 if test "x${want_openssl}" = "xyes" || test "x${want_openssl}" = "xauto" ; then
352 PKG_CHECK_MODULES(OPENSSL, openssl,
355 AC_DEFINE(HAVE_OPENSSL, 1, [Have Openssl support])
356 requirement_eet="openssl ${requirement_eet}"
361 if test "x${have_gnutls}" = "xyes" ; then
362 secure_layer="GnuTLS"
363 elif test "x${have_openssl}" = "xyes" ; then
364 secure_layer="OpenSSL"
370 if test "x${have_gnutls}" = "xyes" && test "x${want_cipher}" = "xyes" ; then
372 AC_DEFINE(HAVE_CIPHER, 1, [Have cipher support built in eet])
373 elif test "x${have_openssl}" = "xyes" && test "x${want_cipher}" = "xyes" ; then
375 AC_DEFINE(HAVE_CIPHER, 1, [Have cipher support built in eet])
378 AC_MSG_CHECKING(whether to activate cipher support in eet)
379 AC_MSG_RESULT(${have_cipher})
382 if test "x${have_gnutls}" = "xyes" && test "x${want_signature}" = "xyes" ; then
384 AC_DEFINE(HAVE_SIGNATURE, 1, [Have signature support for eet file])
385 elif test "x${have_openssl}" = "xyes" && test "x${want_signature}" = "xyes" ; then
387 AC_DEFINE(HAVE_SIGNATURE, 1, [Have signature support for eet file])
390 AC_MSG_CHECKING(whether to activate signature support in eet)
391 AC_MSG_RESULT(${have_signature})
393 ### Checks for header files
395 AC_CHECK_HEADER([zlib.h],
397 [AC_MSG_ERROR("Cannot find zlib.h. Make sure your CFLAGS environment variable contains include lines for the location of this file")])
399 AC_CHECK_HEADER([jpeglib.h],
401 [AC_MSG_ERROR("Cannot find jpeglib.h. Make sure your CFLAGS environment variable contains include lines for the location of this file")])
403 AC_CHECK_HEADERS(netinet/in.h unistd.h)
409 ### Checks for structures
412 ### Checks for compiler characteristics
419 # Check whether the null pointer is zero on this arch
423 #include <inttypes.h>
424 int main (int argc, char **argv) {
426 uintptr_t bar = (uintptr_t)foo;
427 return (uintptr_t)foo;
433 AC_MSG_WARN([Cannot check when cross-compiling -- assuming null is okay])
436 AC_MSG_CHECKING([value of the null pointer])
437 AC_MSG_RESULT([${have_null}])
439 if test ! "x${have_null}" = "xyes" ; then
440 AC_MSG_WARN([Your system is a bit too funny, eet might not work properly])
443 # These are needed for fmemopen/open_memstream
444 AC_DEFINE(_GNU_SOURCE, , [Enable GNU extensions])
450 EET_CPPFLAGS="-D_WIN32_WCE=0x0420"
453 EET_CPPFLAGS="-D_WIN32_WINNT=0x0501"
456 AC_SUBST(EET_CPPFLAGS)
460 ### Checks for linker characteristics
462 # use --enable-auto-import on Windows
464 lt_enable_auto_import=""
467 lt_enable_auto_import="-Wl,--enable-auto-import"
470 AC_SUBST(lt_enable_auto_import)
476 EFL_LINKER_FLAG([-Wl,--as-needed])
481 ### Checks for library functions
485 AC_CHECK_FUNCS(fmemopen open_memstream realpath)
487 EFL_CHECK_FNMATCH([], [AC_MSG_ERROR([Cannot find fnmatch()])])
490 AC_SUBST(requirement_eet)
502 src/examples/Makefile
507 #####################################################################
513 echo "------------------------------------------------------------------------"
514 echo "$PACKAGE_NAME $PACKAGE_VERSION"
515 echo "------------------------------------------------------------------------"
517 echo "Configuration Options Summary:"
519 echo " Amalgamation.........: ${do_amalgamation}"
520 echo " Secure layer.........: ${secure_layer}"
521 if test "x${have_gnutls}" = "xyes" || test "x${have_openssl}" = "xyes" ; then
522 echo " Cipher support.....: ${have_cipher}"
523 echo " Signature..........: ${have_signature}"
526 echo " Old eet file format..: ${old_eet_file_format}"
528 echo " Tests................: ${enable_tests}"
529 echo " Coverage.............: ${enable_coverage}"
531 echo " Build eet............: $have_eet"
533 echo " Documentation........: ${build_doc}"
534 if test "x${build_doc}" = "xyes" ; then
535 echo " Building...........: make doc"
537 echo " Examples.............: ${build_examples}"
538 if test "x${build_examples}" = "xyes" ; then
539 echo " Install............: ${install_examples}"
542 echo "Compilation............: make (or gmake)"
543 echo " CPPFLAGS.............: $CPPFLAGS"
544 echo " CFLAGS...............: $CFLAGS"
545 echo " LDFLAGS..............: $LDFLAGS"
547 echo "Installation...........: make install (as root if needed, with 'su' or 'sudo')"
548 echo " prefix...............: $prefix"