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
149 # doxygen program for documentation building
151 EFL_CHECK_DOXYGEN([build_doc="yes"], [build_doc="no"])
154 ### Checks for libraries
156 # Evil library for compilation on Windows
161 PKG_CHECK_MODULES([EVIL], [evil])
162 AC_DEFINE(HAVE_EVIL, 1, [Set to 1 if Evil library is installed])
163 requirement_eet="evil ${requirement_eet}"
164 EFL_EET_BUILD="-DEFL_EET_BUILD"
167 AC_SUBST(EFL_EET_BUILD)
185 PKG_CHECK_MODULES(EINA, [eina-0])
186 requirement_eet="eina-0 ${requirement_eet}"
190 if test "x${want_gnutls}" = "xyes" -o "x${want_gnutls}" = "xauto" ; then
191 PKG_CHECK_MODULES(GNUTLS, [gnutls >= 1.7.6],
195 AC_DEFINE(HAVE_GNUTLS, 1, [Have Gnutls support])
196 requirement_eet="gnutls ${requirement_eet}"
205 if test "x${want_openssl}" = "xyes" -o "x${want_openssl}" = "xauto" ; then
206 PKG_CHECK_MODULES(OPENSSL, openssl,
209 AC_DEFINE(HAVE_OPENSSL, 1, [Have Openssl support])
210 requirement_eet="openssl ${requirement_eet}"
216 if test "x${have_gnutls}" = "xyes" -a "x${want_cipher}" = "xyes" ; then
218 AC_DEFINE(HAVE_CIPHER, 1, [Have cipher support built in eet])
219 elif test "x${have_openssl}" = "xyes" -a "x${want_cipher}" = "xyes" ; then
221 AC_DEFINE(HAVE_CIPHER, 1, [Have cipher support built in eet])
224 AC_MSG_CHECKING(whether to activate cipher support in eet)
225 AC_MSG_RESULT(${have_cipher})
228 if test "x${have_gnutls}" = "xyes" -a "x${want_signature}" = "xyes" ; then
230 AC_DEFINE(HAVE_SIGNATURE, 1, [Have signature support for eet file])
231 elif test "x${have_openssl}" = "xyes" -a "x${want_signature}" = "xyes" ; then
233 AC_DEFINE(HAVE_SIGNATURE, 1, [Have signature support for eet file])
236 AC_MSG_CHECKING(whether to activate signature support in eet)
237 AC_MSG_RESULT(${have_signature})
240 ### Checks for header files
242 AC_CHECK_HEADER([zlib.h],
244 [AC_MSG_ERROR("Cannot find zlib.h. Make sure your CFLAGS environment variable contains include lines for the location of this file")])
246 AC_CHECK_HEADER([jpeglib.h],
248 [AC_MSG_ERROR("Cannot find jpeglib.h. Make sure your CFLAGS environment variable contains include lines for the location of this file")])
250 AC_CHECK_HEADERS(netinet/in.h)
252 AC_CHECK_HEADER([fnmatch.h],
254 [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])])
260 ### Checks for structures
263 ### Checks for compiler characteristics
270 # Check whether the null pointer is zero on this arch
274 int main (int argc, char **argv) {
283 AC_MSG_WARN([Cannot check when cross-compiling -- assuming null is okay])
286 AC_MSG_CHECKING([value of the null pointer])
287 AC_MSG_RESULT([${have_null}])
289 if test ! "x${have_null}" = "xyes" ; then
290 AC_MSG_WARN([Your system is a bit too funny, eet might not work properly])
293 # These are needed for fmemopen/open_memstream
294 AC_DEFINE(_GNU_SOURCE, , [Enable GNU extensions])
300 EET_CPPFLAGS="-D_WIN32_WCE=0x0420"
303 EET_CPPFLAGS="-D_WIN32_WCE=0x0420"
307 AC_SUBST(EET_CPPFLAGS)
311 ### Checks for linker characteristics
313 # use --enable-auto-import on Windows
315 lt_enable_auto_import=""
318 lt_enable_auto_import="-Wl,--enable-auto-import"
321 AC_SUBST(lt_enable_auto_import)
323 # use --as-needed if supported
325 LDFLAGS_SAVE=${LDFLAGS}
326 LDFLAGS="${LDFLAGS} -Wl,--as-needed"
329 [AC_LANG_PROGRAM([[]], [])],
330 [ld_as_needed="-Wl,--as-needed"],
334 LDFLAGS=${LDFLAGS_SAVE}
335 AC_SUBST(ld_as_needed)
338 ### Checks for library functions
341 AC_CHECK_FUNCS(fmemopen open_memstream realpath)
344 AC_CHECK_FUNCS([fnmatch], [res="yes"], [res="no"])
345 if test "x$res" = "xno"; then
346 AC_SEARCH_LIBS([fnmatch],
347 [fnmatch evil iberty],
350 if test "x$res" = "xno"; then
351 AC_MSG_ERROR([Cannot find fnmatch() in neither libc nor libfnmatch, nor libiberty, nor libevil])
353 fnmatch_libs="${ac_cv_search_fnmatch}"
355 AC_SUBST(fnmatch_libs)
358 AC_SUBST(requirement_eet)
374 #####################################################################
380 echo "------------------------------------------------------------------------"
381 echo "$PACKAGE_NAME $PACKAGE_VERSION"
382 echo "------------------------------------------------------------------------"
384 echo "Configuration Options Summary:"
386 echo " Gnutls...............: ${have_gnutls}"
387 echo " Openssl..............: ${have_openssl}"
388 echo " Cipher support.....: ${have_cipher}"
389 echo " Signature..........: ${have_signature}"
391 echo " Documentation........: ${build_doc}"
392 echo " Tests................: ${enable_tests}"
393 echo " Coverage.............: ${enable_coverage}"
395 echo " Old eet file format..: ${old_eet_file_format}"
397 echo " Compilation..........: make"
399 echo " Installation.........: make install"
401 echo " prefix.............: $prefix"