1 # get rid of that stupid cache mechanism
4 AC_INIT([eet], [1.2.3], [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
56 AC_ARG_ENABLE([amalgamation],
57 [AC_HELP_STRING([--enable-amalgamation], [enable generation of one single file with all source code in it, helps compiler optimizations.])],
58 [if test "x${enableval}" = "xyes"; then
64 [do_amalgamation="no"]
66 AM_CONDITIONAL(EET_AMALGAMATION, test "x${do_amalgamation}" = "xyes")
68 # Old eet file format support
70 old_eet_file_format="yes"
71 AC_ARG_ENABLE(old-eet-file-format,
73 [--disable-old-eet-file-format],
74 [disable old eet file format support. [[default=enabled]]]
76 [old_eet_file_format=$enableval]
78 AC_MSG_CHECKING([whether to support old eet file format])
79 AC_MSG_RESULT([${old_eet_file_format}])
81 if test "x${old_eet_file_format}" = "xyes" ; then
82 AC_DEFINE(EET_OLD_EET_FILE_FORMAT, 1, [support old eet file format])
84 AC_DEFINE(EET_OLD_EET_FILE_FORMAT, 0, [support old eet file format])
89 AC_ARG_ENABLE([gnutls],
90 [AC_HELP_STRING([--disable-gnutls], [disable gnutls eet support])],
91 [want_gnutls=$enableval]
93 AC_MSG_CHECKING([whether to use Gnutls])
94 AC_MSG_RESULT([${want_gnutls}])
96 # Specific GNUTLS improvement
99 AC_ARG_ENABLE(new-gnutls-api,
101 [--enable-new-gnutls-api],
102 [enable use of gnutls_x509_crt_verify_hash. [[default=disable]]]
104 [new_gnutls_api=$enableval]
106 AC_MSG_CHECKING([whether to use gnutls_x509_crt_verify_hash])
107 AC_MSG_RESULT([${new_gnutls_api}])
109 if test "x${new_gnutls_api}" = "xyes" ; then
110 AC_DEFINE(EET_USE_NEW_GNUTLS_API, 1, [use gnutls_x509_crt_verify_hash])
112 AC_DEFINE(EET_USE_NEW_GNUTLS_API, 0, [don't use gnutls_x509_crt_verify_hash])
117 AC_ARG_ENABLE([openssl],
118 [AC_HELP_STRING([--disable-openssl], [disable openssl eet support])],
119 [want_openssl=$enableval]
121 AC_MSG_CHECKING([whether to use OpenSSL])
122 AC_MSG_RESULT([${want_openssl}])
124 # Cryptography support
126 AC_ARG_ENABLE([cipher],
127 [AC_HELP_STRING([--disable-cipher], [disable cipher support for eet API])],
128 [want_cipher=$enableval]
130 AC_MSG_CHECKING([whether to use cipher])
131 AC_MSG_RESULT([${want_cipher}])
133 AC_ARG_ENABLE([signature],
134 [AC_HELP_STRING([--disable-signature], [disable signature file support for eet])],
135 [want_signature=$enableval]
137 AC_MSG_CHECKING([whether to use signature])
138 AC_MSG_RESULT([${want_signature}])
142 AC_ARG_ENABLE([assert],
143 [AC_HELP_STRING([--enable-assert], [enable assert, [[default=disabled]]])],
144 [prefer_assert=$enableval]
147 # Unit tests, coverage and benchmarking
149 EFL_CHECK_TESTS([enable_tests="yes"], [enable_tests="no"])
150 EFL_CHECK_COVERAGE([${enable_tests}], [enable_coverage="yes"], [enable_coverage="no"])
152 if test "x${prefer_assert}" = "xno"; then
153 DEBUG_CFLAGS="-DNDEBUG"
155 # use debug symbols and set DEBUG if coverage support is enabled
156 DEBUG_CFLAGS="${EFL_DEBUG_CFLAGS}"
158 AC_SUBST(DEBUG_CFLAGS)
161 ### Checks for programs
167 # Check whether pkg-config supports Requires.private
168 if $PKG_CONFIG --atleast-pkgconfig-version 0.22; then
169 pkgconfig_requires_private="Requires.private"
171 pkgconfig_requires_private="Requires"
173 AC_SUBST(pkgconfig_requires_private)
176 # doxygen program for documentation building
178 EFL_CHECK_DOXYGEN([build_doc="yes"], [build_doc="no"])
180 ### Checks for libraries
182 # Evil library for compilation on Windows
187 PKG_CHECK_MODULES([EVIL], [evil])
188 AC_DEFINE(HAVE_EVIL, 1, [Set to 1 if Evil library is installed])
189 requirement_eet="evil ${requirement_eet}"
190 EFL_EET_BUILD="-DEFL_EET_BUILD"
193 AC_SUBST(EFL_EET_BUILD)
211 PKG_CHECK_MODULES(EINA, [eina-0])
212 requirement_eet="eina-0 ${requirement_eet}"
216 if test "x${want_gnutls}" = "xyes" -o "x${want_gnutls}" = "xauto" ; then
217 PKG_CHECK_MODULES(GNUTLS, [gnutls >= 1.7.6],
221 AC_DEFINE(HAVE_GNUTLS, 1, [Have Gnutls support])
222 requirement_eet="gnutls ${requirement_eet}"
225 if test "x${have_gnutls}" = "xyes" ; then
226 AC_PATH_GENERIC([libgcrypt], [], [have_gnutls="yes"], [have_gnutls="no"])
227 if test "x${have_gnutls}" = "xyes" ; then
228 GNUTLS_CFLAGS="${GNUTLS_CFLAGS} ${LIBGCRYPT_CFLAGS}"
229 GNUTLS_LIBS="${GNUTLS_LIBS} ${LIBGCRYPT_LIBS}"
236 if test "x${want_openssl}" = "xyes" -o "x${want_openssl}" = "xauto" ; then
237 PKG_CHECK_MODULES(OPENSSL, openssl,
240 AC_DEFINE(HAVE_OPENSSL, 1, [Have Openssl support])
241 requirement_eet="openssl ${requirement_eet}"
247 if test "x${have_gnutls}" = "xyes" -a "x${want_cipher}" = "xyes" ; then
249 AC_DEFINE(HAVE_CIPHER, 1, [Have cipher support built in eet])
250 elif test "x${have_openssl}" = "xyes" -a "x${want_cipher}" = "xyes" ; then
252 AC_DEFINE(HAVE_CIPHER, 1, [Have cipher support built in eet])
255 AC_MSG_CHECKING(whether to activate cipher support in eet)
256 AC_MSG_RESULT(${have_cipher})
259 if test "x${have_gnutls}" = "xyes" -a "x${want_signature}" = "xyes" ; then
261 AC_DEFINE(HAVE_SIGNATURE, 1, [Have signature support for eet file])
262 elif test "x${have_openssl}" = "xyes" -a "x${want_signature}" = "xyes" ; then
264 AC_DEFINE(HAVE_SIGNATURE, 1, [Have signature support for eet file])
267 AC_MSG_CHECKING(whether to activate signature support in eet)
268 AC_MSG_RESULT(${have_signature})
272 EFL_CHECK_PTHREAD([have_pthread="yes"], [have_pthread="no"])
275 ### Checks for header files
277 AC_CHECK_HEADER([zlib.h],
279 [AC_MSG_ERROR("Cannot find zlib.h. Make sure your CFLAGS environment variable contains include lines for the location of this file")])
281 AC_CHECK_HEADER([jpeglib.h],
283 [AC_MSG_ERROR("Cannot find jpeglib.h. Make sure your CFLAGS environment variable contains include lines for the location of this file")])
285 AC_CHECK_HEADERS(netinet/in.h)
287 AC_CHECK_HEADER([fnmatch.h],
289 [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])])
295 ### Checks for structures
298 ### Checks for compiler characteristics
305 # Check whether the null pointer is zero on this arch
309 int main (int argc, char **argv) {
318 AC_MSG_WARN([Cannot check when cross-compiling -- assuming null is okay])
321 AC_MSG_CHECKING([value of the null pointer])
322 AC_MSG_RESULT([${have_null}])
324 if test ! "x${have_null}" = "xyes" ; then
325 AC_MSG_WARN([Your system is a bit too funny, eet might not work properly])
328 # These are needed for fmemopen/open_memstream
329 AC_DEFINE(_GNU_SOURCE, , [Enable GNU extensions])
335 EET_CPPFLAGS="-D_WIN32_WCE=0x0420"
338 EET_CPPFLAGS="-D_WIN32_WCE=0x0420"
342 AC_SUBST(EET_CPPFLAGS)
346 ### Checks for linker characteristics
348 # use --enable-auto-import on Windows
350 lt_enable_auto_import=""
353 lt_enable_auto_import="-Wl,--enable-auto-import"
356 AC_SUBST(lt_enable_auto_import)
358 # use --as-needed if supported
360 LDFLAGS_SAVE=${LDFLAGS}
361 LDFLAGS="${LDFLAGS} -Wl,--as-needed"
364 [AC_LANG_PROGRAM([[]], [])],
365 [ld_as_needed="-Wl,--as-needed"],
369 LDFLAGS=${LDFLAGS_SAVE}
370 AC_SUBST(ld_as_needed)
373 ### Checks for library functions
376 AC_CHECK_FUNCS(fmemopen open_memstream realpath)
379 AC_CHECK_FUNCS([fnmatch], [res="yes"], [res="no"])
380 if test "x$res" = "xno"; then
381 AC_SEARCH_LIBS([fnmatch],
382 [fnmatch evil iberty],
385 if test "x$res" = "xno"; then
386 AC_MSG_ERROR([Cannot find fnmatch() in neither libc nor libfnmatch, nor libiberty, nor libevil])
388 fnmatch_libs="${ac_cv_search_fnmatch}"
390 AC_SUBST(fnmatch_libs)
393 AC_SUBST(requirement_eet)
409 #####################################################################
415 echo "------------------------------------------------------------------------"
416 echo "$PACKAGE_NAME $PACKAGE_VERSION"
417 echo "------------------------------------------------------------------------"
419 echo "Configuration Options Summary:"
421 echo " Gnutls...............: ${have_gnutls}"
422 echo " Openssl..............: ${have_openssl}"
423 echo " Cipher support.....: ${have_cipher}"
424 echo " Signature..........: ${have_signature}"
425 echo " Thread Support.......: ${have_pthread}"
427 echo " Amalgamation.........: ${do_amalgamation}"
428 echo " Documentation........: ${build_doc}"
429 echo " Tests................: ${enable_tests}"
430 echo " Coverage.............: ${enable_coverage}"
432 echo " Old eet file format..: ${old_eet_file_format}"
434 echo " Compilation..........: make"
436 echo " Installation.........: make install"
438 echo " prefix.............: $prefix"