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}])
80 AC_ARG_ENABLE([openssl],
81 [AC_HELP_STRING([--disable-openssl], [disable openssl eet support])],
82 [want_openssl=$enableval]
84 AC_MSG_CHECKING([whether to use OpenSSL])
85 AC_MSG_RESULT([${want_openssl}])
87 # Cryptography support
89 AC_ARG_ENABLE([cipher],
90 [AC_HELP_STRING([--disable-cipher], [disable cipher support for eet API])],
91 [want_cipher=$enableval]
93 AC_MSG_CHECKING([whether to use cipher])
94 AC_MSG_RESULT([${want_cipher}])
96 AC_ARG_ENABLE([signature],
97 [AC_HELP_STRING([--disable-signature], [disable signature file support for eet])],
98 [want_signature=$enableval]
100 AC_MSG_CHECKING([whether to use signature])
101 AC_MSG_RESULT([${want_signature}])
105 AC_ARG_ENABLE([assert],
106 [AC_HELP_STRING([--enable-assert], [enable assert, [[default=disabled]]])],
107 [prefer_assert=$enableval]
110 # Unit tests, coverage and benchmarking
112 EFL_CHECK_TESTS([enable_tests="yes"], [enable_tests="no"])
113 EFL_CHECK_COVERAGE([${enable_tests}], [enable_coverage="yes"], [enable_coverage="no"])
115 if test "x${prefer_assert}" = "xno"; then
116 DEBUG_CFLAGS="-DNDEBUG"
118 # use debug symbols and set DEBUG if coverage support is enabled
119 DEBUG_CFLAGS="${EFL_DEBUG_CFLAGS}"
121 AC_SUBST(DEBUG_CFLAGS)
124 ### Checks for programs
127 # doxygen program for documentation building
129 EFL_CHECK_DOXYGEN([build_doc="yes"], [build_doc="no"])
132 ### Checks for libraries
134 # Evil library for compilation on Windows
139 PKG_CHECK_MODULES([EVIL], [evil])
140 AC_DEFINE(HAVE_EVIL, 1, [Set to 1 if Evil library is installed])
141 requirement_eet="evil ${requirement_eet}"
142 EFL_EET_BUILD="-DEFL_EET_BUILD"
145 AC_SUBST(EFL_EET_BUILD)
163 PKG_CHECK_MODULES(EINA, [eina-0])
164 requirement_eet="eina-0 ${requirement_eet}"
168 if test "x${want_gnutls}" = "xyes" -o "x${want_gnutls}" = "xauto" ; then
169 PKG_CHECK_MODULES(GNUTLS, [gnutls >= 1.7.6],
172 AC_DEFINE(HAVE_GNUTLS, 1, [Have Gnutls support])
173 requirement_eet="gnutls ${requirement_eet}"
182 if test "x${want_openssl}" = "xyes" -o "x${want_openssl}" = "xauto" ; then
183 PKG_CHECK_MODULES(OPENSSL, openssl,
186 AC_DEFINE(HAVE_OPENSSL, 1, [Have Openssl support])
187 requirement_eet="openssl ${requirement_eet}"
193 if test "x${have_gnutls}" = "xyes" -a "x${want_cipher}" = "xyes" ; then
195 AC_DEFINE(HAVE_CIPHER, 1, [Have cipher support built in eet])
196 elif test "x${have_openssl}" = "xyes" -a "x${want_cipher}" = "xyes" ; then
198 AC_DEFINE(HAVE_CIPHER, 1, [Have cipher support built in eet])
201 AC_MSG_CHECKING(whether to activate cipher support in eet)
202 AC_MSG_RESULT(${have_cipher})
205 if test "x${have_gnutls}" = "xyes" -a "x${want_signature}" = "xyes" ; then
207 AC_DEFINE(HAVE_SIGNATURE, 1, [Have signature support for eet file])
208 elif test "x${have_openssl}" = "xyes" -a "x${want_signature}" = "xyes" ; then
210 AC_DEFINE(HAVE_SIGNATURE, 1, [Have signature support for eet file])
213 AC_MSG_CHECKING(whether to activate signature support in eet)
214 AC_MSG_RESULT(${have_signature})
217 ### Checks for header files
219 AC_CHECK_HEADER([zlib.h],
221 [AC_MSG_ERROR("Cannot find zlib.h. Make sure your CFLAGS environment variable contains include lines for the location of this file")])
223 AC_CHECK_HEADER([jpeglib.h],
225 [AC_MSG_ERROR("Cannot find jpeglib.h. Make sure your CFLAGS environment variable contains include lines for the location of this file")])
227 AC_CHECK_HEADERS(netinet/in.h)
229 AC_CHECK_HEADER([fnmatch.h],
231 [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])])
237 ### Checks for structures
240 ### Checks for compiler characteristics
247 # Check whether the null pointer is zero on this arch
251 int main (int argc, char **argv) {
260 AC_MSG_WARN([Cannot check when cross-compiling -- assuming null is okay])
263 AC_MSG_CHECKING([value of the null pointer])
264 AC_MSG_RESULT([${have_null}])
266 if test ! "x${have_null}" = "xyes" ; then
267 AC_MSG_WARN([Your system is a bit too funny, eet might not work properly])
270 # These are needed for fmemopen/open_memstream
271 AC_DEFINE(_GNU_SOURCE, , [Enable GNU extensions])
277 EET_CPPFLAGS="-D_WIN32_WCE=0x0420"
280 EET_CPPFLAGS="-D_WIN32_WCE=0x0420"
284 AC_SUBST(EET_CPPFLAGS)
288 ### Checks for linker characteristics
290 lt_enable_auto_import=""
293 lt_enable_auto_import="-Wl,--enable-auto-import"
296 AC_SUBST(lt_enable_auto_import)
299 ### Checks for library functions
302 AC_CHECK_FUNCS(fmemopen open_memstream realpath)
305 AC_CHECK_FUNCS([fnmatch], [res="yes"], [res="no"])
306 if test "x$res" = "xno"; then
307 AC_SEARCH_LIBS([fnmatch],
308 [fnmatch evil iberty],
311 if test "x$res" = "xno"; then
312 AC_MSG_ERROR([Cannot find fnmatch() in neither libc nor libfnmatch, nor libiberty, nor libevil])
314 fnmatch_libs="${ac_cv_search_fnmatch}"
316 AC_SUBST(fnmatch_libs)
319 AC_SUBST(requirement_eet)
335 #####################################################################
341 echo "------------------------------------------------------------------------"
342 echo "$PACKAGE_NAME $PACKAGE_VERSION"
343 echo "------------------------------------------------------------------------"
345 echo "Configuration Options Summary:"
347 echo " Gnutls...............: ${have_gnutls}"
348 echo " Openssl..............: ${have_openssl}"
349 echo " Cipher support.....: ${have_cipher}"
350 echo " Signature..........: ${have_signature}"
352 echo " Documentation........: ${enable_doc}"
353 echo " Tests................: ${enable_tests}"
354 echo " Coverage.............: ${enable_coverage}"
356 echo " Old eet file format..: ${old_eet_file_format}"
358 echo " Compilation..........: make"
360 echo " Installation.........: make install"
362 echo " prefix.............: $prefix"