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],
173 AC_DEFINE(HAVE_GNUTLS, 1, [Have Gnutls support])
174 requirement_eet="gnutls ${requirement_eet}"
183 if test "x${want_openssl}" = "xyes" -o "x${want_openssl}" = "xauto" ; then
184 PKG_CHECK_MODULES(OPENSSL, openssl,
187 AC_DEFINE(HAVE_OPENSSL, 1, [Have Openssl support])
188 requirement_eet="openssl ${requirement_eet}"
194 if test "x${have_gnutls}" = "xyes" -a "x${want_cipher}" = "xyes" ; then
196 AC_DEFINE(HAVE_CIPHER, 1, [Have cipher support built in eet])
197 elif test "x${have_openssl}" = "xyes" -a "x${want_cipher}" = "xyes" ; then
199 AC_DEFINE(HAVE_CIPHER, 1, [Have cipher support built in eet])
202 AC_MSG_CHECKING(whether to activate cipher support in eet)
203 AC_MSG_RESULT(${have_cipher})
206 if test "x${have_gnutls}" = "xyes" -a "x${want_signature}" = "xyes" ; then
208 AC_DEFINE(HAVE_SIGNATURE, 1, [Have signature support for eet file])
209 elif test "x${have_openssl}" = "xyes" -a "x${want_signature}" = "xyes" ; then
211 AC_DEFINE(HAVE_SIGNATURE, 1, [Have signature support for eet file])
214 AC_MSG_CHECKING(whether to activate signature support in eet)
215 AC_MSG_RESULT(${have_signature})
218 ### Checks for header files
220 AC_CHECK_HEADER([zlib.h],
222 [AC_MSG_ERROR("Cannot find zlib.h. Make sure your CFLAGS environment variable contains include lines for the location of this file")])
224 AC_CHECK_HEADER([jpeglib.h],
226 [AC_MSG_ERROR("Cannot find jpeglib.h. Make sure your CFLAGS environment variable contains include lines for the location of this file")])
228 AC_CHECK_HEADERS(netinet/in.h)
230 AC_CHECK_HEADER([fnmatch.h],
232 [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])])
238 ### Checks for structures
241 ### Checks for compiler characteristics
248 # Check whether the null pointer is zero on this arch
252 int main (int argc, char **argv) {
261 AC_MSG_WARN([Cannot check when cross-compiling -- assuming null is okay])
264 AC_MSG_CHECKING([value of the null pointer])
265 AC_MSG_RESULT([${have_null}])
267 if test ! "x${have_null}" = "xyes" ; then
268 AC_MSG_WARN([Your system is a bit too funny, eet might not work properly])
271 # These are needed for fmemopen/open_memstream
272 AC_DEFINE(_GNU_SOURCE, , [Enable GNU extensions])
278 EET_CPPFLAGS="-D_WIN32_WCE=0x0420"
281 EET_CPPFLAGS="-D_WIN32_WCE=0x0420"
285 AC_SUBST(EET_CPPFLAGS)
289 ### Checks for linker characteristics
291 # use --enable-auto-import on Windows
293 lt_enable_auto_import=""
296 lt_enable_auto_import="-Wl,--enable-auto-import"
299 AC_SUBST(lt_enable_auto_import)
301 # use --as-needed if supported
303 LDFLAGS_SAVE=${LDFLAGS}
304 LDFLAGS="${LDFLAGS} -Wl,--as-needed"
307 [AC_LANG_PROGRAM([[]], [])],
308 [ld_as_needed="-Wl,--as-needed"],
312 LDFLAGS=${LDFLAGS_SAVE}
313 AC_SUBST(ld_as_needed)
316 ### Checks for library functions
319 AC_CHECK_FUNCS(fmemopen open_memstream realpath)
322 AC_CHECK_FUNCS([fnmatch], [res="yes"], [res="no"])
323 if test "x$res" = "xno"; then
324 AC_SEARCH_LIBS([fnmatch],
325 [fnmatch evil iberty],
328 if test "x$res" = "xno"; then
329 AC_MSG_ERROR([Cannot find fnmatch() in neither libc nor libfnmatch, nor libiberty, nor libevil])
331 fnmatch_libs="${ac_cv_search_fnmatch}"
333 AC_SUBST(fnmatch_libs)
336 AC_SUBST(requirement_eet)
352 #####################################################################
358 echo "------------------------------------------------------------------------"
359 echo "$PACKAGE_NAME $PACKAGE_VERSION"
360 echo "------------------------------------------------------------------------"
362 echo "Configuration Options Summary:"
364 echo " Gnutls...............: ${have_gnutls}"
365 echo " Openssl..............: ${have_openssl}"
366 echo " Cipher support.....: ${have_cipher}"
367 echo " Signature..........: ${have_signature}"
369 echo " Documentation........: ${build_doc}"
370 echo " Tests................: ${enable_tests}"
371 echo " Coverage.............: ${enable_coverage}"
373 echo " Old eet file format..: ${old_eet_file_format}"
375 echo " Compilation..........: make"
377 echo " Installation.........: make install"
379 echo " prefix.............: $prefix"