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
46 ### Additional options to configure
48 # Old eet file format support
50 old_eet_file_format="yes"
51 AC_ARG_ENABLE(old-eet-file-format,
53 [--disable-old-eet-file-format],
54 [disable old eet file format support. [[default=enabled]]]
56 [old_eet_file_format=$enableval]
58 AC_MSG_CHECKING([whether to support old eet file format])
59 AC_MSG_RESULT([${old_eet_file_format}])
61 if test "x${old_eet_file_format}" = "xyes" ; then
62 AC_DEFINE(EET_OLD_EET_FILE_FORMAT, 1, [support old eet file format])
64 AC_DEFINE(EET_OLD_EET_FILE_FORMAT, 0, [support old eet file format])
69 AC_ARG_ENABLE([openssl],
70 [AC_HELP_STRING([--disable-openssl], [disable openssl eet support])],
71 [want_openssl=$enableval]
73 AC_MSG_CHECKING([whether to use OpenSSL])
74 AC_MSG_RESULT([${want_openssl}])
76 # Cryptography support
78 AC_ARG_ENABLE([cypher],
79 [AC_HELP_STRING([--disable-cypher], [disable cypher support for eet API])],
80 [want_cypher=$enableval]
82 AC_MSG_CHECKING([whether to use cypher])
83 AC_MSG_RESULT([${want_cypher}])
85 AC_ARG_ENABLE([signature],
86 [AC_HELP_STRING([--disable-signature], [disable signature file support for eet])],
87 [want_signature=$enableval]
89 AC_MSG_CHECKING([whether to use signature])
90 AC_MSG_RESULT([${want_signature}])
94 AC_ARG_ENABLE([assert],
95 [AC_HELP_STRING([--enable-assert], [enable assert, [[default=disabled]]])],
96 [prefer_assert=$enableval]
99 # Unit tests, coverage and benchmarking
101 EFL_CHECK_TESTS([enable_tests="yes"], [enable_tests="no"])
102 EFL_CHECK_COVERAGE([${enable_tests}], [enable_coverage="yes"], [enable_coverage="no"])
104 if test "x${prefer_assert}" = "xno"; then
105 DEBUG_CFLAGS="-DNDEBUG"
107 # use debug symbols and set DEBUG if coverage support is enabled
108 DEBUG_CFLAGS="${EFL_DEBUG_CFLAGS}"
110 AC_SUBST(DEBUG_CFLAGS)
113 ### Checks for libraries
117 # Evil library for compilation on Windows
122 PKG_CHECK_MODULES([EVIL], [evil])
123 AC_DEFINE(HAVE_EVIL, 1, [Set to 1 if Evil library is installed])
124 requirement_eet="evil ${requirement_eet}"
125 EFL_EET_BUILD="-DEFL_EET_BUILD"
128 AC_SUBST(EFL_EET_BUILD)
132 PKG_CHECK_MODULES(EINA, [eina-0])
133 requirement_eet="eina-0 ${requirement_eet}"
137 if test "x${want_openssl}" = "xyes" -o "x${want_openssl}" = "xauto" ; then
138 PKG_CHECK_MODULES(OPENSSL, openssl,
141 AC_DEFINE(HAVE_OPENSSL, 1, [Have Openssl support])
142 requirement_eet="openssl ${requirement_eet}"
143 ], [have_openssl="no"])
147 if test "x${have_openssl}" = "xyes" -a "x${want_cypher}" = "xyes" ; then
149 AC_DEFINE(HAVE_CYPHER, 1, [Have cypher support built in eet])
152 AC_MSG_CHECKING(whether to activate cypher support in eet)
153 AC_MSG_RESULT(${have_cypher})
156 if test "x${have_openssl}" = "xyes" -a "x${want_signature}" = "xyes" ; then
158 AC_DEFINE(HAVE_SIGNATURE, 1, [Have signature support for eet file])
161 AC_MSG_CHECKING(whether to activate signature support in eet)
162 AC_MSG_RESULT(${have_signature})
165 ### Checks for header files
167 AC_CHECK_HEADER([zlib.h],
169 [AC_MSG_ERROR("Cannot find zlib.h. Make sure your CFLAGS environment variable contains include lines for the location of this file")])
171 AC_CHECK_HEADER([jpeglib.h],
173 [AC_MSG_ERROR("Cannot find jpeglib.h. Make sure your CFLAGS environment variable contains include lines for the location of this file")])
175 AC_CHECK_HEADERS(netinet/in.h)
177 AC_CHECK_HEADER([fnmatch.h],
179 [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])])
182 ### Checks for programs
185 # doxygen program for documentation building
187 EFL_CHECK_DOXYGEN([build_doc="yes"], [build_doc="no"])
193 ### Checks for structures
196 ### Checks for compiler characteristics
203 # Check whether the null pointer is zero on this arch
207 int main (int argc, char **argv) {
216 AC_MSG_WARN([Cannot check when cross-compiling -- assuming null is okay])
219 AC_MSG_CHECKING([value of the null pointer])
220 AC_MSG_RESULT([${have_null}])
222 if test ! "x${have_null}" = "xyes" ; then
223 AC_MSG_WARN([Your system is a bit too funny, eet might not work properly])
226 # These are needed for fmemopen/open_memstream
227 AC_DEFINE(_GNU_SOURCE, , [Enable GNU extensions])
233 EET_CPPFLAGS="-D_WIN32_WCE=0x0420"
236 EET_CPPFLAGS="-D_WIN32_WCE=0x0420"
240 AC_SUBST(EET_CPPFLAGS)
244 ### Checks for linker characteristics
260 lt_enable_auto_import=""
263 lt_enable_auto_import="-Wl,--enable-auto-import"
266 AC_SUBST(lt_enable_auto_import)
269 ### Checks for library functions
272 AC_CHECK_FUNCS(fmemopen open_memstream realpath)
275 AC_CHECK_FUNCS([fnmatch], [res="yes"], [res="no"])
276 if test "x$res" = "xno"; then
277 AC_SEARCH_LIBS([fnmatch],
278 [fnmatch iberty evil],
281 if test "x$res" = "xno"; then
282 AC_MSG_ERROR([Cannot find fnmatch() in neither libc nor libfnmatch, nor libiberty, nor libevil])
284 fnmatch_libs="${ac_cv_search_fnmatch}"
286 AC_SUBST(fnmatch_libs)
289 AC_SUBST(requirement_eet)
305 #####################################################################
311 echo "------------------------------------------------------------------------"
312 echo "$PACKAGE_NAME $PACKAGE_VERSION"
313 echo "------------------------------------------------------------------------"
315 echo "Configuration Options Summary:"
317 echo " Openssl..............: ${have_openssl}"
318 echo " Cypher support.....: ${have_cypher}"
319 echo " Signature..........: ${have_signature}"
321 echo " Documentation........: ${enable_doc}"
322 echo " Tests................: ${enable_tests}"
323 echo " Coverage.............: ${enable_coverage}"
325 echo " Old eet file format..: ${old_eet_file_format}"
327 echo " Compilation..........: make"
329 echo " Installation.........: make install"
331 echo " prefix.............: $prefix"