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])
14 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
17 define([AC_LIBTOOL_LANG_CXX_CONFIG], [:])dnl
18 define([AC_LIBTOOL_LANG_F77_CONFIG], [:])dnl
21 VMAJ=`echo $PACKAGE_VERSION | awk -F. '{printf("%s", $1);}'`
22 VMIN=`echo $PACKAGE_VERSION | awk -F. '{printf("%s", $2);}'`
23 VMIC=`echo $PACKAGE_VERSION | awk -F. '{printf("%s", $3);}'`
24 SNAP=`echo $PACKAGE_VERSION | awk -F. '{printf("%s", $4);}'`
25 version_info=`expr $VMAJ + $VMIN`":$VMIC:$VMIN"
26 #release="ver-pre-svn-00"
27 #release_info="-release $release"
29 AC_SUBST(version_info)
30 AC_SUBST(release_info)
32 ### Default options with respect to host
52 ### Additional options to configure
54 AC_ARG_ENABLE([amalgamation],
55 [AC_HELP_STRING([--enable-amalgamation], [enable generation of one single file with all source code in it, helps compiler optimizations.])],
56 [if test "x${enableval}" = "xyes"; then
62 [do_amalgamation="no"]
64 AM_CONDITIONAL(EET_AMALGAMATION, test "x${do_amalgamation}" = "xyes")
66 # Old eet file format support
68 old_eet_file_format="yes"
69 AC_ARG_ENABLE(old-eet-file-format,
71 [--disable-old-eet-file-format],
72 [disable old eet file format support. [[default=enabled]]]
74 [old_eet_file_format=$enableval]
76 AC_MSG_CHECKING([whether to support old eet file format])
77 AC_MSG_RESULT([${old_eet_file_format}])
79 if test "x${old_eet_file_format}" = "xyes" ; then
80 AC_DEFINE(EET_OLD_EET_FILE_FORMAT, 1, [support old eet file format])
82 AC_DEFINE(EET_OLD_EET_FILE_FORMAT, 0, [support old eet file format])
87 AC_ARG_ENABLE([gnutls],
88 [AC_HELP_STRING([--disable-gnutls], [disable gnutls eet support])],
89 [want_gnutls=$enableval]
91 AC_MSG_CHECKING([whether to use Gnutls])
92 AC_MSG_RESULT([${want_gnutls}])
94 # Specific GNUTLS improvement
97 AC_ARG_ENABLE(new-gnutls-api,
99 [--enable-new-gnutls-api],
100 [enable use of gnutls_x509_crt_verify_hash. [[default=disable]]]
102 [new_gnutls_api=$enableval]
104 AC_MSG_CHECKING([whether to use gnutls_x509_crt_verify_hash])
105 AC_MSG_RESULT([${new_gnutls_api}])
107 if test "x${new_gnutls_api}" = "xyes" ; then
108 AC_DEFINE(EET_USE_NEW_GNUTLS_API, 1, [use gnutls_x509_crt_verify_hash])
110 AC_DEFINE(EET_USE_NEW_GNUTLS_API, 0, [don't use gnutls_x509_crt_verify_hash])
115 AC_ARG_ENABLE([openssl],
116 [AC_HELP_STRING([--disable-openssl], [disable openssl eet support])],
117 [want_openssl=$enableval]
119 AC_MSG_CHECKING([whether to use OpenSSL])
120 AC_MSG_RESULT([${want_openssl}])
122 # Cryptography support
124 AC_ARG_ENABLE([cipher],
125 [AC_HELP_STRING([--disable-cipher], [disable cipher support for eet API])],
126 [want_cipher=$enableval]
128 AC_MSG_CHECKING([whether to use cipher])
129 AC_MSG_RESULT([${want_cipher}])
131 AC_ARG_ENABLE([signature],
132 [AC_HELP_STRING([--disable-signature], [disable signature file support for eet])],
133 [want_signature=$enableval]
135 AC_MSG_CHECKING([whether to use signature])
136 AC_MSG_RESULT([${want_signature}])
140 AC_ARG_ENABLE([assert],
141 [AC_HELP_STRING([--enable-assert], [enable assert, [[default=disabled]]])],
142 [prefer_assert=$enableval]
145 # Unit tests, coverage and benchmarking
147 EFL_CHECK_TESTS([enable_tests="yes"], [enable_tests="no"])
148 EFL_CHECK_COVERAGE([${enable_tests}], [enable_coverage="yes"], [enable_coverage="no"])
150 if test "x${prefer_assert}" = "xno"; then
151 DEBUG_CFLAGS="-DNDEBUG"
153 # use debug symbols and set DEBUG if coverage support is enabled
154 DEBUG_CFLAGS="${EFL_DEBUG_CFLAGS}"
156 AC_SUBST(DEBUG_CFLAGS)
159 ### Checks for programs
165 # Check whether pkg-config supports Requires.private
166 if $PKG_CONFIG --atleast-pkgconfig-version 0.22; then
167 pkgconfig_requires_private="Requires.private"
169 pkgconfig_requires_private="Requires"
171 AC_SUBST(pkgconfig_requires_private)
174 # doxygen program for documentation building
176 EFL_CHECK_DOXYGEN([build_doc="yes"], [build_doc="no"])
179 ### Checks for libraries
181 # Evil library for compilation on Windows
186 PKG_CHECK_MODULES([EVIL], [evil])
187 AC_DEFINE(HAVE_EVIL, 1, [Set to 1 if Evil library is installed])
188 requirement_eet="evil ${requirement_eet}"
189 EFL_EET_BUILD="-DEFL_EET_BUILD"
192 AC_SUBST(EFL_EET_BUILD)
210 PKG_CHECK_MODULES(EINA, [eina-0])
211 requirement_eet="eina-0 ${requirement_eet}"
215 if test "x${want_gnutls}" = "xyes" -o "x${want_gnutls}" = "xauto" ; then
216 PKG_CHECK_MODULES(GNUTLS, [gnutls >= 1.7.6],
220 AC_DEFINE(HAVE_GNUTLS, 1, [Have Gnutls support])
221 requirement_eet="gnutls ${requirement_eet}"
224 if test "x${have_gnutls}" = "xyes" ; then
225 AC_PATH_GENERIC([libgcrypt], [], [have_gnutls="yes"], [have_gnutls="no"])
226 if test "x${have_gnutls}" = "xyes" ; then
227 GNUTLS_CFLAGS="${GNUTLS_CFLAGS} ${LIBGCRYPT_CFLAGS}"
228 GNUTLS_LIBS="${GNUTLS_LIBS} ${LIBGCRYPT_LIBS}"
235 if test "x${want_openssl}" = "xyes" -o "x${want_openssl}" = "xauto" ; then
236 PKG_CHECK_MODULES(OPENSSL, openssl,
239 AC_DEFINE(HAVE_OPENSSL, 1, [Have Openssl support])
240 requirement_eet="openssl ${requirement_eet}"
246 if test "x${have_gnutls}" = "xyes" -a "x${want_cipher}" = "xyes" ; then
248 AC_DEFINE(HAVE_CIPHER, 1, [Have cipher support built in eet])
249 elif test "x${have_openssl}" = "xyes" -a "x${want_cipher}" = "xyes" ; then
251 AC_DEFINE(HAVE_CIPHER, 1, [Have cipher support built in eet])
254 AC_MSG_CHECKING(whether to activate cipher support in eet)
255 AC_MSG_RESULT(${have_cipher})
258 if test "x${have_gnutls}" = "xyes" -a "x${want_signature}" = "xyes" ; then
260 AC_DEFINE(HAVE_SIGNATURE, 1, [Have signature support for eet file])
261 elif test "x${have_openssl}" = "xyes" -a "x${want_signature}" = "xyes" ; then
263 AC_DEFINE(HAVE_SIGNATURE, 1, [Have signature support for eet file])
266 AC_MSG_CHECKING(whether to activate signature support in eet)
267 AC_MSG_RESULT(${have_signature})
270 ### Checks for header files
272 AC_CHECK_HEADER([zlib.h],
274 [AC_MSG_ERROR("Cannot find zlib.h. Make sure your CFLAGS environment variable contains include lines for the location of this file")])
276 AC_CHECK_HEADER([jpeglib.h],
278 [AC_MSG_ERROR("Cannot find jpeglib.h. Make sure your CFLAGS environment variable contains include lines for the location of this file")])
280 AC_CHECK_HEADERS(netinet/in.h)
282 AC_CHECK_HEADER([fnmatch.h],
284 [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])])
290 ### Checks for structures
293 ### Checks for compiler characteristics
300 # Check whether the null pointer is zero on this arch
304 int main (int argc, char **argv) {
313 AC_MSG_WARN([Cannot check when cross-compiling -- assuming null is okay])
316 AC_MSG_CHECKING([value of the null pointer])
317 AC_MSG_RESULT([${have_null}])
319 if test ! "x${have_null}" = "xyes" ; then
320 AC_MSG_WARN([Your system is a bit too funny, eet might not work properly])
323 # These are needed for fmemopen/open_memstream
324 AC_DEFINE(_GNU_SOURCE, , [Enable GNU extensions])
330 EET_CPPFLAGS="-D_WIN32_WCE=0x0420"
333 EET_CPPFLAGS="-D_WIN32_WCE=0x0420"
337 AC_SUBST(EET_CPPFLAGS)
341 ### Checks for linker characteristics
343 # use --enable-auto-import on Windows
345 lt_enable_auto_import=""
348 lt_enable_auto_import="-Wl,--enable-auto-import"
351 AC_SUBST(lt_enable_auto_import)
353 # use --as-needed if supported
355 LDFLAGS_SAVE=${LDFLAGS}
356 LDFLAGS="${LDFLAGS} -Wl,--as-needed"
359 [AC_LANG_PROGRAM([[]], [])],
360 [ld_as_needed="-Wl,--as-needed"],
364 LDFLAGS=${LDFLAGS_SAVE}
365 AC_SUBST(ld_as_needed)
368 ### Checks for library functions
371 AC_CHECK_FUNCS(fmemopen open_memstream realpath)
374 AC_CHECK_FUNCS([fnmatch], [res="yes"], [res="no"])
375 if test "x$res" = "xno"; then
376 AC_SEARCH_LIBS([fnmatch],
377 [fnmatch evil iberty],
380 if test "x$res" = "xno"; then
381 AC_MSG_ERROR([Cannot find fnmatch() in neither libc nor libfnmatch, nor libiberty, nor libevil])
383 fnmatch_libs="${ac_cv_search_fnmatch}"
385 AC_SUBST(fnmatch_libs)
388 AC_SUBST(requirement_eet)
404 #####################################################################
410 echo "------------------------------------------------------------------------"
411 echo "$PACKAGE_NAME $PACKAGE_VERSION"
412 echo "------------------------------------------------------------------------"
414 echo "Configuration Options Summary:"
416 echo " Gnutls...............: ${have_gnutls}"
417 echo " Openssl..............: ${have_openssl}"
418 echo " Cipher support.....: ${have_cipher}"
419 echo " Signature..........: ${have_signature}"
421 echo " Amalgamation.........: ${do_amalgamation}"
422 echo " Documentation........: ${build_doc}"
423 echo " Tests................: ${enable_tests}"
424 echo " Coverage.............: ${enable_coverage}"
426 echo " Old eet file format..: ${old_eet_file_format}"
428 echo " Compilation..........: make"
430 echo " Installation.........: make install"
432 echo " prefix.............: $prefix"