1 # get rid of that stupid cache mechanism
4 AC_INIT([eet], [1.1.0], [enlightenment-devel@lists.sourceforge.net])
6 AC_CONFIG_SRCDIR([configure.ac])
7 AC_CONFIG_MACRO_DIR([m4])
12 AM_INIT_AUTOMAKE(1.6 dist-bzip2)
13 AM_CONFIG_HEADER(config.h)
16 define([AC_LIBTOOL_LANG_CXX_CONFIG], [:])dnl
17 define([AC_LIBTOOL_LANG_F77_CONFIG], [:])dnl
20 VMAJ=`echo $PACKAGE_VERSION | awk -F. '{printf("%s", $1);}'`
21 VMIN=`echo $PACKAGE_VERSION | awk -F. '{printf("%s", $2);}'`
22 VMIC=`echo $PACKAGE_VERSION | awk -F. '{printf("%s", $3);}'`
23 SNAP=`echo $PACKAGE_VERSION | awk -F. '{printf("%s", $4);}'`
24 version_info=`expr $VMAJ + $VMIN`":$VMIC:$VMIN"
25 AC_SUBST(version_info)
28 ### Default options with respect to host
48 ### Additional options to configure
50 # Old eet file format support
52 old_eet_file_format="yes"
53 AC_ARG_ENABLE(old-eet-file-format,
55 [--disable-old-eet-file-format],
56 [disable old eet file format support. [[default=enabled]]]
58 [old_eet_file_format=$enableval]
60 AC_MSG_CHECKING([whether to support old eet file format])
61 AC_MSG_RESULT([${old_eet_file_format}])
63 if test "x${old_eet_file_format}" = "xyes" ; then
64 AC_DEFINE(EET_OLD_EET_FILE_FORMAT, 1, [support old eet file format])
66 AC_DEFINE(EET_OLD_EET_FILE_FORMAT, 0, [support old eet file format])
71 AC_ARG_ENABLE([gnutls],
72 [AC_HELP_STRING([--disable-gnutls], [disable gnutls eet support])],
73 [want_gnutls=$enableval]
75 AC_MSG_CHECKING([whether to use Gnutls])
76 AC_MSG_RESULT([${want_gnutls}])
78 # Specific GNUTLS improvement
81 AC_ARG_ENABLE(new-gnutls-api,
83 [--enable-new-gnutls-api],
84 [enable use of gnutls_x509_crt_verify_hash. [[default=disable]]]
86 [new_gnutls_api=$enableval]
88 AC_MSG_CHECKING([whether to use gnutls_x509_crt_verify_hash])
89 AC_MSG_RESULT([${new_gnutls_api}])
91 if test "x${new_gnutls_api}" = "xyes" ; then
92 AC_DEFINE(EET_USE_NEW_GNUTLS_API, 1, [use gnutls_x509_crt_verify_hash])
94 AC_DEFINE(EET_USE_NEW_GNUTLS_API, 0, [don't use gnutls_x509_crt_verify_hash])
99 AC_ARG_ENABLE([openssl],
100 [AC_HELP_STRING([--disable-openssl], [disable openssl eet support])],
101 [want_openssl=$enableval]
103 AC_MSG_CHECKING([whether to use OpenSSL])
104 AC_MSG_RESULT([${want_openssl}])
106 # Cryptography support
108 AC_ARG_ENABLE([cipher],
109 [AC_HELP_STRING([--disable-cipher], [disable cipher support for eet API])],
110 [want_cipher=$enableval]
112 AC_MSG_CHECKING([whether to use cipher])
113 AC_MSG_RESULT([${want_cipher}])
115 AC_ARG_ENABLE([signature],
116 [AC_HELP_STRING([--disable-signature], [disable signature file support for eet])],
117 [want_signature=$enableval]
119 AC_MSG_CHECKING([whether to use signature])
120 AC_MSG_RESULT([${want_signature}])
124 AC_ARG_ENABLE([assert],
125 [AC_HELP_STRING([--enable-assert], [enable assert, [[default=disabled]]])],
126 [prefer_assert=$enableval]
129 # Unit tests, coverage and benchmarking
131 EFL_CHECK_TESTS([enable_tests="yes"], [enable_tests="no"])
132 EFL_CHECK_COVERAGE([${enable_tests}], [enable_coverage="yes"], [enable_coverage="no"])
134 if test "x${prefer_assert}" = "xno"; then
135 DEBUG_CFLAGS="-DNDEBUG"
137 # use debug symbols and set DEBUG if coverage support is enabled
138 DEBUG_CFLAGS="${EFL_DEBUG_CFLAGS}"
140 AC_SUBST(DEBUG_CFLAGS)
143 ### Checks for programs
146 # doxygen program for documentation building
148 EFL_CHECK_DOXYGEN([build_doc="yes"], [build_doc="no"])
151 ### Checks for libraries
153 # Evil library for compilation on Windows
158 PKG_CHECK_MODULES([EVIL], [evil])
159 AC_DEFINE(HAVE_EVIL, 1, [Set to 1 if Evil library is installed])
160 requirement_eet="evil ${requirement_eet}"
161 EFL_EET_BUILD="-DEFL_EET_BUILD"
164 AC_SUBST(EFL_EET_BUILD)
182 PKG_CHECK_MODULES(EINA, [eina-0])
183 requirement_eet="eina-0 ${requirement_eet}"
187 if test "x${want_gnutls}" = "xyes" -o "x${want_gnutls}" = "xauto" ; then
188 PKG_CHECK_MODULES(GNUTLS, [gnutls >= 1.7.6],
192 AC_DEFINE(HAVE_GNUTLS, 1, [Have Gnutls support])
193 requirement_eet="gnutls ${requirement_eet}"
202 if test "x${want_openssl}" = "xyes" -o "x${want_openssl}" = "xauto" ; then
203 PKG_CHECK_MODULES(OPENSSL, openssl,
206 AC_DEFINE(HAVE_OPENSSL, 1, [Have Openssl support])
207 requirement_eet="openssl ${requirement_eet}"
213 if test "x${have_gnutls}" = "xyes" -a "x${want_cipher}" = "xyes" ; then
215 AC_DEFINE(HAVE_CIPHER, 1, [Have cipher support built in eet])
216 elif test "x${have_openssl}" = "xyes" -a "x${want_cipher}" = "xyes" ; then
218 AC_DEFINE(HAVE_CIPHER, 1, [Have cipher support built in eet])
221 AC_MSG_CHECKING(whether to activate cipher support in eet)
222 AC_MSG_RESULT(${have_cipher})
225 if test "x${have_gnutls}" = "xyes" -a "x${want_signature}" = "xyes" ; then
227 AC_DEFINE(HAVE_SIGNATURE, 1, [Have signature support for eet file])
228 elif test "x${have_openssl}" = "xyes" -a "x${want_signature}" = "xyes" ; then
230 AC_DEFINE(HAVE_SIGNATURE, 1, [Have signature support for eet file])
233 AC_MSG_CHECKING(whether to activate signature support in eet)
234 AC_MSG_RESULT(${have_signature})
237 ### Checks for header files
239 AC_CHECK_HEADER([zlib.h],
241 [AC_MSG_ERROR("Cannot find zlib.h. Make sure your CFLAGS environment variable contains include lines for the location of this file")])
243 AC_CHECK_HEADER([jpeglib.h],
245 [AC_MSG_ERROR("Cannot find jpeglib.h. Make sure your CFLAGS environment variable contains include lines for the location of this file")])
247 AC_CHECK_HEADERS(netinet/in.h)
249 AC_CHECK_HEADER([fnmatch.h],
251 [AC_MSG_ERROR([Cannot find fnmatch.h. Make sure your CFLAGS environment variable contains include lines for the location of this file. MinGW users: see the INSTALL file])])
257 ### Checks for structures
260 ### Checks for compiler characteristics
267 # Check whether the null pointer is zero on this arch
271 int main (int argc, char **argv) {
280 AC_MSG_WARN([Cannot check when cross-compiling -- assuming null is okay])
283 AC_MSG_CHECKING([value of the null pointer])
284 AC_MSG_RESULT([${have_null}])
286 if test ! "x${have_null}" = "xyes" ; then
287 AC_MSG_WARN([Your system is a bit too funny, eet might not work properly])
290 # These are needed for fmemopen/open_memstream
291 AC_DEFINE(_GNU_SOURCE, , [Enable GNU extensions])
297 EET_CPPFLAGS="-D_WIN32_WCE=0x0420"
300 EET_CPPFLAGS="-D_WIN32_WCE=0x0420"
304 AC_SUBST(EET_CPPFLAGS)
308 ### Checks for linker characteristics
310 # use --enable-auto-import on Windows
312 lt_enable_auto_import=""
315 lt_enable_auto_import="-Wl,--enable-auto-import"
318 AC_SUBST(lt_enable_auto_import)
320 # use --as-needed if supported
322 LDFLAGS_SAVE=${LDFLAGS}
323 LDFLAGS="${LDFLAGS} -Wl,--as-needed"
326 [AC_LANG_PROGRAM([[]], [])],
327 [ld_as_needed="-Wl,--as-needed"],
331 LDFLAGS=${LDFLAGS_SAVE}
332 AC_SUBST(ld_as_needed)
335 ### Checks for library functions
338 AC_CHECK_FUNCS(fmemopen open_memstream realpath)
341 AC_CHECK_FUNCS([fnmatch], [res="yes"], [res="no"])
342 if test "x$res" = "xno"; then
343 AC_SEARCH_LIBS([fnmatch],
344 [fnmatch evil iberty],
347 if test "x$res" = "xno"; then
348 AC_MSG_ERROR([Cannot find fnmatch() in neither libc nor libfnmatch, nor libiberty, nor libevil])
350 fnmatch_libs="${ac_cv_search_fnmatch}"
352 AC_SUBST(fnmatch_libs)
355 AC_SUBST(requirement_eet)
371 #####################################################################
377 echo "------------------------------------------------------------------------"
378 echo "$PACKAGE_NAME $PACKAGE_VERSION"
379 echo "------------------------------------------------------------------------"
381 echo "Configuration Options Summary:"
383 echo " Gnutls...............: ${have_gnutls}"
384 echo " Openssl..............: ${have_openssl}"
385 echo " Cipher support.....: ${have_cipher}"
386 echo " Signature..........: ${have_signature}"
388 echo " Documentation........: ${build_doc}"
389 echo " Tests................: ${enable_tests}"
390 echo " Coverage.............: ${enable_coverage}"
392 echo " Old eet file format..: ${old_eet_file_format}"
394 echo " Compilation..........: make"
396 echo " Installation.........: make install"
398 echo " prefix.............: $prefix"