1 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
2 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
3 m4_define([v_maj], [1])
4 m4_define([v_min], [3])
5 m4_define([v_mic], [0])
6 m4_define([v_rev], m4_esyscmd([(svnversion . | grep -v exported || 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_rev], m4_eval(v_maj + v_min))
16 m4_define([lt_cur], 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])
29 AM_INIT_AUTOMAKE([1.6 dist-bzip2])
30 AM_CONFIG_HEADER([config.h])
31 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
34 define([AC_LIBTOOL_LANG_CXX_CONFIG], [:])dnl
35 define([AC_LIBTOOL_LANG_F77_CONFIG], [:])dnl
38 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
39 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
40 m4_ifdef([v_rev], , [m4_define([v_rev], [0])])
41 m4_ifdef([v_rel], , [m4_define([v_rel], [])])
42 AC_DEFINE_UNQUOTED(VMAJ, [v_maj], [Major version])
43 AC_DEFINE_UNQUOTED(VMIN, [v_min], [Minor version])
44 AC_DEFINE_UNQUOTED(VMIC, [v_mic], [Micro version])
45 AC_DEFINE_UNQUOTED(VREV, [v_rev], [Revison])
46 version_info="lt_rev:lt_cur:lt_age"
48 AC_SUBST(version_info)
49 AC_SUBST(release_info)
50 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
51 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
54 ### Default options with respect to host
74 ### Additional options to configure
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
86 [do_amalgamation="no"]
88 AM_CONDITIONAL(EET_AMALGAMATION, test "x${do_amalgamation}" = "xyes")
92 # Old eet file format support
94 old_eet_file_format="yes"
95 AC_ARG_ENABLE(old-eet-file-format,
97 [--disable-old-eet-file-format],
98 [disable old eet file format support. [[default=enabled]]]
100 [old_eet_file_format=$enableval]
102 AC_MSG_CHECKING([whether to support old eet file format])
103 AC_MSG_RESULT([${old_eet_file_format}])
105 if test "x${old_eet_file_format}" = "xyes" ; then
106 AC_DEFINE(EET_OLD_EET_FILE_FORMAT, 1, [support old eet file format])
108 AC_DEFINE(EET_OLD_EET_FILE_FORMAT, 0, [support old eet file format])
113 AC_ARG_ENABLE([gnutls],
114 [AC_HELP_STRING([--disable-gnutls], [disable gnutls eet support])],
115 [want_gnutls=$enableval]
117 AC_MSG_CHECKING([whether to use Gnutls])
118 AC_MSG_RESULT([${want_gnutls}])
120 # Specific GNUTLS improvement
123 AC_ARG_ENABLE(new-gnutls-api,
125 [--disable-new-gnutls-api],
126 [enable use of gnutls_x509_crt_verify_hash. [[default=enable]]]
128 [new_gnutls_api=$enableval]
130 AC_MSG_CHECKING([whether to use gnutls_x509_crt_verify_hash])
131 AC_MSG_RESULT([${new_gnutls_api}])
133 if test "x${new_gnutls_api}" = "xyes" ; then
134 AC_CHECK_LIB(gnutls, gnutls_x509_crt_verify_hash,
135 [ new_gnutls_api="yes" ],
136 [ new_gnutls_api="no" ]
139 if test "x${new_gnutls_api}" = "xyes"; then
140 AC_DEFINE(EET_USE_NEW_GNUTLS_API, 1, [use gnutls_x509_crt_verify_hash])
146 AC_ARG_ENABLE([openssl],
147 [AC_HELP_STRING([--disable-openssl], [disable openssl eet support])],
148 [want_openssl=$enableval]
150 AC_MSG_CHECKING([whether to use OpenSSL])
151 AC_MSG_RESULT([${want_openssl}])
153 # Cryptography support
155 AC_ARG_ENABLE([cipher],
156 [AC_HELP_STRING([--disable-cipher], [disable cipher support for eet API])],
157 [want_cipher=$enableval]
159 AC_MSG_CHECKING([whether to use cipher])
160 AC_MSG_RESULT([${want_cipher}])
162 AC_ARG_ENABLE([signature],
163 [AC_HELP_STRING([--disable-signature], [disable signature file support for eet])],
164 [want_signature=$enableval]
166 AC_MSG_CHECKING([whether to use signature])
167 AC_MSG_RESULT([${want_signature}])
171 AC_ARG_ENABLE([assert],
172 [AC_HELP_STRING([--enable-assert], [enable assert, [[default=disabled]]])],
173 [prefer_assert=$enableval]
178 AC_ARG_ENABLE([install-examples],
179 [AC_HELP_STRING([--disable-install-examples],
180 [disable installing examples (compiled or just source). @<:@default==enabled@:>@])],
182 if test "x${enableval}" = "xyes" ; then
183 install_examples="yes"
185 install_examples="no"
188 [install_examples="yes"])
189 AM_CONDITIONAL([INSTALL_EXAMPLES], [test "x${install_examples}" = "xyes"])
191 AC_ARG_ENABLE([build-examples],
192 [AC_HELP_STRING([--enable-build-examples],
193 [enable building examples. @<:@default==disabled@:>@])],
195 if test "x${enableval}" = "xyes" ; then
201 [build_examples="no"])
202 AM_CONDITIONAL([BUILD_EXAMPLES], [test "x${build_examples}" = "xyes"])
204 # Unit tests, coverage and benchmarking
206 EFL_CHECK_TESTS([enable_tests="yes"], [enable_tests="no"])
207 EFL_CHECK_COVERAGE([${enable_tests}], [enable_coverage="yes"], [enable_coverage="no"])
209 if test "x${prefer_assert}" = "xno"; then
210 DEBUG_CFLAGS="-DNDEBUG"
212 # use debug symbols and set DEBUG if coverage support is enabled
213 DEBUG_CFLAGS="${EFL_DEBUG_CFLAGS}"
215 AC_SUBST(DEBUG_CFLAGS)
218 ### Checks for programs
224 # Check whether pkg-config supports Requires.private
225 if $PKG_CONFIG --atleast-pkgconfig-version 0.22; then
226 pkgconfig_requires_private="Requires.private"
228 pkgconfig_requires_private="Requires"
230 AC_SUBST(pkgconfig_requires_private)
233 # doxygen program for documentation building
235 EFL_CHECK_DOXYGEN([build_doc="yes"], [build_doc="no"])
237 ### Checks for libraries
239 # Evil library for compilation on Windows
244 PKG_CHECK_MODULES([EVIL], [evil])
245 AC_DEFINE(HAVE_EVIL, 1, [Set to 1 if Evil library is installed])
246 requirement_eet="evil ${requirement_eet}"
247 EFL_EET_BUILD="-DEFL_EET_BUILD"
250 AC_SUBST(EFL_EET_BUILD)
265 PKG_CHECK_MODULES(EINA, [eina-0])
266 requirement_eet="eina-0 ${requirement_eet}"
270 if test "x${want_gnutls}" = "xyes" -o "x${want_gnutls}" = "xauto" ; then
271 PKG_CHECK_MODULES(GNUTLS, [gnutls >= 1.7.6],
275 AC_DEFINE(HAVE_GNUTLS, 1, [Have Gnutls support])
276 requirement_eet="gnutls ${requirement_eet}"
279 if test "x${have_gnutls}" = "xyes" ; then
280 AC_PATH_GENERIC([libgcrypt], [], [have_gnutls="yes"], [have_gnutls="no"])
281 if test "x${have_gnutls}" = "xyes" ; then
282 GNUTLS_CFLAGS="${GNUTLS_CFLAGS} ${LIBGCRYPT_CFLAGS}"
283 GNUTLS_LIBS="${GNUTLS_LIBS} ${LIBGCRYPT_LIBS}"
290 if test "x${want_openssl}" = "xyes" -o "x${want_openssl}" = "xauto" ; then
291 PKG_CHECK_MODULES(OPENSSL, openssl,
294 AC_DEFINE(HAVE_OPENSSL, 1, [Have Openssl support])
295 requirement_eet="openssl ${requirement_eet}"
301 if test "x${have_gnutls}" = "xyes" -a "x${want_cipher}" = "xyes" ; then
303 AC_DEFINE(HAVE_CIPHER, 1, [Have cipher support built in eet])
304 elif test "x${have_openssl}" = "xyes" -a "x${want_cipher}" = "xyes" ; then
306 AC_DEFINE(HAVE_CIPHER, 1, [Have cipher support built in eet])
309 AC_MSG_CHECKING(whether to activate cipher support in eet)
310 AC_MSG_RESULT(${have_cipher})
313 if test "x${have_gnutls}" = "xyes" -a "x${want_signature}" = "xyes" ; then
315 AC_DEFINE(HAVE_SIGNATURE, 1, [Have signature support for eet file])
316 elif test "x${have_openssl}" = "xyes" -a "x${want_signature}" = "xyes" ; then
318 AC_DEFINE(HAVE_SIGNATURE, 1, [Have signature support for eet file])
321 AC_MSG_CHECKING(whether to activate signature support in eet)
322 AC_MSG_RESULT(${have_signature})
326 EFL_CHECK_PTHREAD(["no"], [have_pthread="yes"], [have_pthread="no"])
329 ### Checks for header files
331 AC_CHECK_HEADER([zlib.h],
333 [AC_MSG_ERROR("Cannot find zlib.h. Make sure your CFLAGS environment variable contains include lines for the location of this file")])
335 AC_CHECK_HEADER([jpeglib.h],
337 [AC_MSG_ERROR("Cannot find jpeglib.h. Make sure your CFLAGS environment variable contains include lines for the location of this file")])
339 AC_CHECK_HEADERS(netinet/in.h)
345 ### Checks for structures
348 ### Checks for compiler characteristics
355 # Check whether the null pointer is zero on this arch
359 int main (int argc, char **argv) {
368 AC_MSG_WARN([Cannot check when cross-compiling -- assuming null is okay])
371 AC_MSG_CHECKING([value of the null pointer])
372 AC_MSG_RESULT([${have_null}])
374 if test ! "x${have_null}" = "xyes" ; then
375 AC_MSG_WARN([Your system is a bit too funny, eet might not work properly])
378 # These are needed for fmemopen/open_memstream
379 AC_DEFINE(_GNU_SOURCE, , [Enable GNU extensions])
385 EET_CPPFLAGS="-D_WIN32_WCE=0x0420"
388 EET_CPPFLAGS="-D_WIN32_WINNT=0x0501"
391 AC_SUBST(EET_CPPFLAGS)
395 ### Checks for linker characteristics
397 # use --enable-auto-import on Windows
399 lt_enable_auto_import=""
402 lt_enable_auto_import="-Wl,--enable-auto-import"
405 AC_SUBST(lt_enable_auto_import)
407 # use --as-needed if supported
409 LDFLAGS_SAVE=${LDFLAGS}
410 LDFLAGS="${LDFLAGS} -Wl,--as-needed"
413 [AC_LANG_PROGRAM([[]], [])],
414 [ld_as_needed="-Wl,--as-needed"],
418 LDFLAGS=${LDFLAGS_SAVE}
419 AC_SUBST(ld_as_needed)
422 ### Checks for library functions
425 AC_CHECK_FUNCS(fmemopen open_memstream realpath)
427 EFL_CHECK_FNMATCH([], [AC_MSG_ERROR([Cannot find fnmatch()])])
430 AC_SUBST(requirement_eet)
441 src/examples/Makefile
447 #####################################################################
453 echo "------------------------------------------------------------------------"
454 echo "$PACKAGE_NAME $PACKAGE_VERSION"
455 echo "------------------------------------------------------------------------"
457 echo "Configuration Options Summary:"
459 echo " Amalgamation.........: ${do_amalgamation}"
460 echo " Gnutls...............: ${have_gnutls}"
461 echo " Openssl..............: ${have_openssl}"
462 echo " Cipher support.....: ${have_cipher}"
463 echo " Signature..........: ${have_signature}"
464 echo " Thread Support.......: ${have_pthread}"
466 echo " Old eet file format..: ${old_eet_file_format}"
468 echo " Tests................: ${enable_tests}"
469 echo " Coverage.............: ${enable_coverage}"
471 echo " Build eet............: $have_eet"
473 echo " Documentation........: ${build_doc}"
474 if test "x${build_doc}" = "xyes" ; then
475 echo " Building...........: make doc"
477 echo " Examples.............: ${build_examples}"
478 if test "x${build_examples}" = "xyes" ; then
479 echo " Install............: ${install_examples}"
482 echo "Compilation............: make (or gmake)"
483 echo " CPPFLAGS.............: $CPPFLAGS"
484 echo " CFLAGS...............: $CFLAGS"
485 echo " LDFLAGS..............: $LDFLAGS"
487 echo "Installation...........: make install (as root if needed, with 'su' or 'sudo')"
488 echo " prefix...............: $prefix"