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 # Old eet file format support
56 old_eet_file_format="yes"
57 AC_ARG_ENABLE(old-eet-file-format,
59 [--disable-old-eet-file-format],
60 [disable old eet file format support. [[default=enabled]]]
62 [old_eet_file_format=$enableval]
64 AC_MSG_CHECKING([whether to support old eet file format])
65 AC_MSG_RESULT([${old_eet_file_format}])
67 if test "x${old_eet_file_format}" = "xyes" ; then
68 AC_DEFINE(EET_OLD_EET_FILE_FORMAT, 1, [support old eet file format])
70 AC_DEFINE(EET_OLD_EET_FILE_FORMAT, 0, [support old eet file format])
75 AC_ARG_ENABLE([gnutls],
76 [AC_HELP_STRING([--disable-gnutls], [disable gnutls eet support])],
77 [want_gnutls=$enableval]
79 AC_MSG_CHECKING([whether to use Gnutls])
80 AC_MSG_RESULT([${want_gnutls}])
82 # Specific GNUTLS improvement
85 AC_ARG_ENABLE(new-gnutls-api,
87 [--enable-new-gnutls-api],
88 [enable use of gnutls_x509_crt_verify_hash. [[default=disable]]]
90 [new_gnutls_api=$enableval]
92 AC_MSG_CHECKING([whether to use gnutls_x509_crt_verify_hash])
93 AC_MSG_RESULT([${new_gnutls_api}])
95 if test "x${new_gnutls_api}" = "xyes" ; then
96 AC_DEFINE(EET_USE_NEW_GNUTLS_API, 1, [use gnutls_x509_crt_verify_hash])
98 AC_DEFINE(EET_USE_NEW_GNUTLS_API, 0, [don't use gnutls_x509_crt_verify_hash])
103 AC_ARG_ENABLE([openssl],
104 [AC_HELP_STRING([--disable-openssl], [disable openssl eet support])],
105 [want_openssl=$enableval]
107 AC_MSG_CHECKING([whether to use OpenSSL])
108 AC_MSG_RESULT([${want_openssl}])
110 # Cryptography support
112 AC_ARG_ENABLE([cipher],
113 [AC_HELP_STRING([--disable-cipher], [disable cipher support for eet API])],
114 [want_cipher=$enableval]
116 AC_MSG_CHECKING([whether to use cipher])
117 AC_MSG_RESULT([${want_cipher}])
119 AC_ARG_ENABLE([signature],
120 [AC_HELP_STRING([--disable-signature], [disable signature file support for eet])],
121 [want_signature=$enableval]
123 AC_MSG_CHECKING([whether to use signature])
124 AC_MSG_RESULT([${want_signature}])
128 AC_ARG_ENABLE([assert],
129 [AC_HELP_STRING([--enable-assert], [enable assert, [[default=disabled]]])],
130 [prefer_assert=$enableval]
133 # Unit tests, coverage and benchmarking
135 EFL_CHECK_TESTS([enable_tests="yes"], [enable_tests="no"])
136 EFL_CHECK_COVERAGE([${enable_tests}], [enable_coverage="yes"], [enable_coverage="no"])
138 if test "x${prefer_assert}" = "xno"; then
139 DEBUG_CFLAGS="-DNDEBUG"
141 # use debug symbols and set DEBUG if coverage support is enabled
142 DEBUG_CFLAGS="${EFL_DEBUG_CFLAGS}"
144 AC_SUBST(DEBUG_CFLAGS)
147 ### Checks for programs
153 # Check whether pkg-config supports Requires.private
154 if $PKG_CONFIG --atleast-pkgconfig-version 0.22; then
155 pkgconfig_requires_private="Requires.private"
157 pkgconfig_requires_private="Requires"
159 AC_SUBST(pkgconfig_requires_private)
162 # doxygen program for documentation building
164 EFL_CHECK_DOXYGEN([build_doc="yes"], [build_doc="no"])
167 ### Checks for libraries
169 # Evil library for compilation on Windows
174 PKG_CHECK_MODULES([EVIL], [evil])
175 AC_DEFINE(HAVE_EVIL, 1, [Set to 1 if Evil library is installed])
176 requirement_eet="evil ${requirement_eet}"
177 EFL_EET_BUILD="-DEFL_EET_BUILD"
180 AC_SUBST(EFL_EET_BUILD)
198 PKG_CHECK_MODULES(EINA, [eina-0])
199 requirement_eet="eina-0 ${requirement_eet}"
203 if test "x${want_gnutls}" = "xyes" -o "x${want_gnutls}" = "xauto" ; then
204 PKG_CHECK_MODULES(GNUTLS, [gnutls >= 1.7.6],
208 AC_DEFINE(HAVE_GNUTLS, 1, [Have Gnutls support])
209 requirement_eet="gnutls ${requirement_eet}"
218 if test "x${want_openssl}" = "xyes" -o "x${want_openssl}" = "xauto" ; then
219 PKG_CHECK_MODULES(OPENSSL, openssl,
222 AC_DEFINE(HAVE_OPENSSL, 1, [Have Openssl support])
223 requirement_eet="openssl ${requirement_eet}"
229 if test "x${have_gnutls}" = "xyes" -a "x${want_cipher}" = "xyes" ; then
231 AC_DEFINE(HAVE_CIPHER, 1, [Have cipher support built in eet])
232 elif test "x${have_openssl}" = "xyes" -a "x${want_cipher}" = "xyes" ; then
234 AC_DEFINE(HAVE_CIPHER, 1, [Have cipher support built in eet])
237 AC_MSG_CHECKING(whether to activate cipher support in eet)
238 AC_MSG_RESULT(${have_cipher})
241 if test "x${have_gnutls}" = "xyes" -a "x${want_signature}" = "xyes" ; then
243 AC_DEFINE(HAVE_SIGNATURE, 1, [Have signature support for eet file])
244 elif test "x${have_openssl}" = "xyes" -a "x${want_signature}" = "xyes" ; then
246 AC_DEFINE(HAVE_SIGNATURE, 1, [Have signature support for eet file])
249 AC_MSG_CHECKING(whether to activate signature support in eet)
250 AC_MSG_RESULT(${have_signature})
253 ### Checks for header files
255 AC_CHECK_HEADER([zlib.h],
257 [AC_MSG_ERROR("Cannot find zlib.h. Make sure your CFLAGS environment variable contains include lines for the location of this file")])
259 AC_CHECK_HEADER([jpeglib.h],
261 [AC_MSG_ERROR("Cannot find jpeglib.h. Make sure your CFLAGS environment variable contains include lines for the location of this file")])
263 AC_CHECK_HEADERS(netinet/in.h)
265 AC_CHECK_HEADER([fnmatch.h],
267 [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])])
273 ### Checks for structures
276 ### Checks for compiler characteristics
283 # Check whether the null pointer is zero on this arch
287 int main (int argc, char **argv) {
296 AC_MSG_WARN([Cannot check when cross-compiling -- assuming null is okay])
299 AC_MSG_CHECKING([value of the null pointer])
300 AC_MSG_RESULT([${have_null}])
302 if test ! "x${have_null}" = "xyes" ; then
303 AC_MSG_WARN([Your system is a bit too funny, eet might not work properly])
306 # These are needed for fmemopen/open_memstream
307 AC_DEFINE(_GNU_SOURCE, , [Enable GNU extensions])
313 EET_CPPFLAGS="-D_WIN32_WCE=0x0420"
316 EET_CPPFLAGS="-D_WIN32_WCE=0x0420"
320 AC_SUBST(EET_CPPFLAGS)
324 ### Checks for linker characteristics
326 # use --enable-auto-import on Windows
328 lt_enable_auto_import=""
331 lt_enable_auto_import="-Wl,--enable-auto-import"
334 AC_SUBST(lt_enable_auto_import)
336 # use --as-needed if supported
338 LDFLAGS_SAVE=${LDFLAGS}
339 LDFLAGS="${LDFLAGS} -Wl,--as-needed"
342 [AC_LANG_PROGRAM([[]], [])],
343 [ld_as_needed="-Wl,--as-needed"],
347 LDFLAGS=${LDFLAGS_SAVE}
348 AC_SUBST(ld_as_needed)
351 ### Checks for library functions
354 AC_CHECK_FUNCS(fmemopen open_memstream realpath)
357 AC_CHECK_FUNCS([fnmatch], [res="yes"], [res="no"])
358 if test "x$res" = "xno"; then
359 AC_SEARCH_LIBS([fnmatch],
360 [fnmatch evil iberty],
363 if test "x$res" = "xno"; then
364 AC_MSG_ERROR([Cannot find fnmatch() in neither libc nor libfnmatch, nor libiberty, nor libevil])
366 fnmatch_libs="${ac_cv_search_fnmatch}"
368 AC_SUBST(fnmatch_libs)
371 AC_SUBST(requirement_eet)
387 #####################################################################
393 echo "------------------------------------------------------------------------"
394 echo "$PACKAGE_NAME $PACKAGE_VERSION"
395 echo "------------------------------------------------------------------------"
397 echo "Configuration Options Summary:"
399 echo " Gnutls...............: ${have_gnutls}"
400 echo " Openssl..............: ${have_openssl}"
401 echo " Cipher support.....: ${have_cipher}"
402 echo " Signature..........: ${have_signature}"
404 echo " Documentation........: ${build_doc}"
405 echo " Tests................: ${enable_tests}"
406 echo " Coverage.............: ${enable_coverage}"
408 echo " Old eet file format..: ${old_eet_file_format}"
410 echo " Compilation..........: make"
412 echo " Installation.........: make install"
414 echo " prefix.............: $prefix"