1 # get rid of that stupid cache mechanism
4 AC_INIT([eet], [1.2.2], [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 #release="ver-pre-svn-00"
26 #release_info="-release $release"
28 AC_SUBST(version_info)
29 AC_SUBST(release_info)
31 ### Default options with respect to host
51 ### Additional options to configure
53 # Old eet file format support
55 old_eet_file_format="yes"
56 AC_ARG_ENABLE(old-eet-file-format,
58 [--disable-old-eet-file-format],
59 [disable old eet file format support. [[default=enabled]]]
61 [old_eet_file_format=$enableval]
63 AC_MSG_CHECKING([whether to support old eet file format])
64 AC_MSG_RESULT([${old_eet_file_format}])
66 if test "x${old_eet_file_format}" = "xyes" ; then
67 AC_DEFINE(EET_OLD_EET_FILE_FORMAT, 1, [support old eet file format])
69 AC_DEFINE(EET_OLD_EET_FILE_FORMAT, 0, [support old eet file format])
74 AC_ARG_ENABLE([gnutls],
75 [AC_HELP_STRING([--disable-gnutls], [disable gnutls eet support])],
76 [want_gnutls=$enableval]
78 AC_MSG_CHECKING([whether to use Gnutls])
79 AC_MSG_RESULT([${want_gnutls}])
81 # Specific GNUTLS improvement
84 AC_ARG_ENABLE(new-gnutls-api,
86 [--enable-new-gnutls-api],
87 [enable use of gnutls_x509_crt_verify_hash. [[default=disable]]]
89 [new_gnutls_api=$enableval]
91 AC_MSG_CHECKING([whether to use gnutls_x509_crt_verify_hash])
92 AC_MSG_RESULT([${new_gnutls_api}])
94 if test "x${new_gnutls_api}" = "xyes" ; then
95 AC_DEFINE(EET_USE_NEW_GNUTLS_API, 1, [use gnutls_x509_crt_verify_hash])
97 AC_DEFINE(EET_USE_NEW_GNUTLS_API, 0, [don't use gnutls_x509_crt_verify_hash])
102 AC_ARG_ENABLE([openssl],
103 [AC_HELP_STRING([--disable-openssl], [disable openssl eet support])],
104 [want_openssl=$enableval]
106 AC_MSG_CHECKING([whether to use OpenSSL])
107 AC_MSG_RESULT([${want_openssl}])
109 # Cryptography support
111 AC_ARG_ENABLE([cipher],
112 [AC_HELP_STRING([--disable-cipher], [disable cipher support for eet API])],
113 [want_cipher=$enableval]
115 AC_MSG_CHECKING([whether to use cipher])
116 AC_MSG_RESULT([${want_cipher}])
118 AC_ARG_ENABLE([signature],
119 [AC_HELP_STRING([--disable-signature], [disable signature file support for eet])],
120 [want_signature=$enableval]
122 AC_MSG_CHECKING([whether to use signature])
123 AC_MSG_RESULT([${want_signature}])
127 AC_ARG_ENABLE([assert],
128 [AC_HELP_STRING([--enable-assert], [enable assert, [[default=disabled]]])],
129 [prefer_assert=$enableval]
132 # Unit tests, coverage and benchmarking
134 EFL_CHECK_TESTS([enable_tests="yes"], [enable_tests="no"])
135 EFL_CHECK_COVERAGE([${enable_tests}], [enable_coverage="yes"], [enable_coverage="no"])
137 if test "x${prefer_assert}" = "xno"; then
138 DEBUG_CFLAGS="-DNDEBUG"
140 # use debug symbols and set DEBUG if coverage support is enabled
141 DEBUG_CFLAGS="${EFL_DEBUG_CFLAGS}"
143 AC_SUBST(DEBUG_CFLAGS)
146 ### Checks for programs
152 # Check whether pkg-config supports Requires.private
153 if $PKG_CONFIG --atleast-pkgconfig-version 0.22; then
154 pkgconfig_requires_private="Requires.private"
156 pkgconfig_requires_private="Requires"
158 AC_SUBST(pkgconfig_requires_private)
161 # doxygen program for documentation building
163 EFL_CHECK_DOXYGEN([build_doc="yes"], [build_doc="no"])
166 ### Checks for libraries
168 # Evil library for compilation on Windows
173 PKG_CHECK_MODULES([EVIL], [evil])
174 AC_DEFINE(HAVE_EVIL, 1, [Set to 1 if Evil library is installed])
175 requirement_eet="evil ${requirement_eet}"
176 EFL_EET_BUILD="-DEFL_EET_BUILD"
179 AC_SUBST(EFL_EET_BUILD)
197 PKG_CHECK_MODULES(EINA, [eina-0])
198 requirement_eet="eina-0 ${requirement_eet}"
202 if test "x${want_gnutls}" = "xyes" -o "x${want_gnutls}" = "xauto" ; then
203 PKG_CHECK_MODULES(GNUTLS, [gnutls >= 1.7.6],
207 AC_DEFINE(HAVE_GNUTLS, 1, [Have Gnutls support])
208 requirement_eet="gnutls ${requirement_eet}"
217 if test "x${want_openssl}" = "xyes" -o "x${want_openssl}" = "xauto" ; then
218 PKG_CHECK_MODULES(OPENSSL, openssl,
221 AC_DEFINE(HAVE_OPENSSL, 1, [Have Openssl support])
222 requirement_eet="openssl ${requirement_eet}"
228 if test "x${have_gnutls}" = "xyes" -a "x${want_cipher}" = "xyes" ; then
230 AC_DEFINE(HAVE_CIPHER, 1, [Have cipher support built in eet])
231 elif test "x${have_openssl}" = "xyes" -a "x${want_cipher}" = "xyes" ; then
233 AC_DEFINE(HAVE_CIPHER, 1, [Have cipher support built in eet])
236 AC_MSG_CHECKING(whether to activate cipher support in eet)
237 AC_MSG_RESULT(${have_cipher})
240 if test "x${have_gnutls}" = "xyes" -a "x${want_signature}" = "xyes" ; then
242 AC_DEFINE(HAVE_SIGNATURE, 1, [Have signature support for eet file])
243 elif test "x${have_openssl}" = "xyes" -a "x${want_signature}" = "xyes" ; then
245 AC_DEFINE(HAVE_SIGNATURE, 1, [Have signature support for eet file])
248 AC_MSG_CHECKING(whether to activate signature support in eet)
249 AC_MSG_RESULT(${have_signature})
252 ### Checks for header files
254 AC_CHECK_HEADER([zlib.h],
256 [AC_MSG_ERROR("Cannot find zlib.h. Make sure your CFLAGS environment variable contains include lines for the location of this file")])
258 AC_CHECK_HEADER([jpeglib.h],
260 [AC_MSG_ERROR("Cannot find jpeglib.h. Make sure your CFLAGS environment variable contains include lines for the location of this file")])
262 AC_CHECK_HEADERS(netinet/in.h)
264 AC_CHECK_HEADER([fnmatch.h],
266 [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])])
272 ### Checks for structures
275 ### Checks for compiler characteristics
282 # Check whether the null pointer is zero on this arch
286 int main (int argc, char **argv) {
295 AC_MSG_WARN([Cannot check when cross-compiling -- assuming null is okay])
298 AC_MSG_CHECKING([value of the null pointer])
299 AC_MSG_RESULT([${have_null}])
301 if test ! "x${have_null}" = "xyes" ; then
302 AC_MSG_WARN([Your system is a bit too funny, eet might not work properly])
305 # These are needed for fmemopen/open_memstream
306 AC_DEFINE(_GNU_SOURCE, , [Enable GNU extensions])
312 EET_CPPFLAGS="-D_WIN32_WCE=0x0420"
315 EET_CPPFLAGS="-D_WIN32_WCE=0x0420"
319 AC_SUBST(EET_CPPFLAGS)
323 ### Checks for linker characteristics
325 # use --enable-auto-import on Windows
327 lt_enable_auto_import=""
330 lt_enable_auto_import="-Wl,--enable-auto-import"
333 AC_SUBST(lt_enable_auto_import)
335 # use --as-needed if supported
337 LDFLAGS_SAVE=${LDFLAGS}
338 LDFLAGS="${LDFLAGS} -Wl,--as-needed"
341 [AC_LANG_PROGRAM([[]], [])],
342 [ld_as_needed="-Wl,--as-needed"],
346 LDFLAGS=${LDFLAGS_SAVE}
347 AC_SUBST(ld_as_needed)
350 ### Checks for library functions
353 AC_CHECK_FUNCS(fmemopen open_memstream realpath)
356 AC_CHECK_FUNCS([fnmatch], [res="yes"], [res="no"])
357 if test "x$res" = "xno"; then
358 AC_SEARCH_LIBS([fnmatch],
359 [fnmatch evil iberty],
362 if test "x$res" = "xno"; then
363 AC_MSG_ERROR([Cannot find fnmatch() in neither libc nor libfnmatch, nor libiberty, nor libevil])
365 fnmatch_libs="${ac_cv_search_fnmatch}"
367 AC_SUBST(fnmatch_libs)
370 AC_SUBST(requirement_eet)
386 #####################################################################
392 echo "------------------------------------------------------------------------"
393 echo "$PACKAGE_NAME $PACKAGE_VERSION"
394 echo "------------------------------------------------------------------------"
396 echo "Configuration Options Summary:"
398 echo " Gnutls...............: ${have_gnutls}"
399 echo " Openssl..............: ${have_openssl}"
400 echo " Cipher support.....: ${have_cipher}"
401 echo " Signature..........: ${have_signature}"
403 echo " Documentation........: ${build_doc}"
404 echo " Tests................: ${enable_tests}"
405 echo " Coverage.............: ${enable_coverage}"
407 echo " Old eet file format..: ${old_eet_file_format}"
409 echo " Compilation..........: make"
411 echo " Installation.........: make install"
413 echo " prefix.............: $prefix"