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)
11 AM_INIT_AUTOMAKE(1.6 dist-bzip2)
12 AM_CONFIG_HEADER(config.h)
21 define([AC_LIBTOOL_LANG_CXX_CONFIG], [:])dnl
22 define([AC_LIBTOOL_LANG_F77_CONFIG], [:])dnl
25 VMAJ=`echo $PACKAGE_VERSION | awk -F. '{printf("%s", $1);}'`
26 VMIN=`echo $PACKAGE_VERSION | awk -F. '{printf("%s", $2);}'`
27 VMIC=`echo $PACKAGE_VERSION | awk -F. '{printf("%s", $3);}'`
28 SNAP=`echo $PACKAGE_VERSION | awk -F. '{printf("%s", $4);}'`
29 version_info=`expr $VMAJ + $VMIN`":$VMIC:$VMIN"
30 AC_SUBST(version_info)
37 lt_enable_auto_import=""
40 PKG_CHECK_MODULES([EVIL], [evil])
41 AC_DEFINE(HAVE_EVIL, 1, [Set to 1 if evil package is installed])
42 dnl needed for correct definition of EAPI
43 AC_DEFINE(EFL_EET_BUILD, 1, [Define to mention that eet is built])
44 if test "$host_os" = "cegcc" ; then
45 WIN32_CFLAGS="-mwin32"
47 lt_enable_auto_import="-Wl,--enable-auto-import"
51 lt_no_undefined="-no-undefined"
54 AC_SUBST(WIN32_CFLAGS)
56 AC_SUBST(lt_no_undefined)
57 AC_SUBST(lt_enable_auto_import)
59 dnl Checking for __attribute__ support
60 AC_MSG_CHECKING([for __attribute__])
61 AC_CACHE_VAL(_cv_have___attribute__,
63 AC_TRY_COMPILE([#include <stdlib.h>],
64 [int func(int x); int foo(int x __attribute__ ((unused))) { exit(1); }],
65 [_cv_have___attribute__="yes"],
66 [_cv_have___attribute__="no"])
70 if test "x${_cv_have___attribute__}" = "xyes" ; then
71 AC_DEFINE(HAVE___ATTRIBUTE__, 1, [Define to 1 if your compiler has __attribute__])
73 AC_MSG_RESULT(${_cv_have___attribute__})
77 AC_CHECK_HEADER(zlib.h,, AC_MSG_ERROR("Cannot find zlib.h. Make sure your CFLAGS environment variable contains include lines for the location of this file"))
78 AC_CHECK_HEADER(jpeglib.h,, AC_MSG_ERROR("Cannot find jpeglib.h. Make sure your CFLAGS environment variable contains include lines for the location of this file"))
80 AC_CHECK_HEADERS(netinet/in.h)
82 AC_CHECK_HEADER(fnmatch.h,, 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]))
85 AC_CHECK_FUNCS(fnmatch, res=yes, res=no)
86 if test "x$res" = "xno"; then
87 AC_CHECK_LIB(fnmatch, fnmatch, res=yes fnmatch_libs="-lfnmatch", res=no)
88 dnl Test for compilation with MinGW.
89 dnl fnmatch function is in the libiberty library
90 if test "x$res" = "xno"; then
91 AC_CHECK_LIB(iberty, fnmatch, res=yes fnmatch_libs="-liberty", res=no)
93 if test "x$res" = "xno"; then
94 AC_MSG_ERROR([Cannot find fnmatch() in neither libc nor libfnmatch, nor libiberty])
98 AC_SUBST(fnmatch_libs)
100 dnl These are needed for fmemopen/open_memstream
101 AC_DEFINE(_GNU_SOURCE, , [Enable GNU extensions])
103 AC_CHECK_FUNCS(fmemopen open_memstream realpath)
105 dnl Check whether the null pointer is zero on this arch
106 AC_MSG_CHECKING([value of the null pointer])
109 int main (int argc, char **argv) {
114 ], AC_MSG_RESULT([yes]), [
116 AC_MSG_WARN([Your system is a bit too funny, eet might not work properly])
117 ], AC_MSG_WARN([Cannot check when cross-compiling -- assuming null is okay])
123 [AC_HELP_STRING([--enable-tests], [Enable tests @<:@default=no@:>@])],
125 if test "x${enableval}" = "xyes" ; then
133 AC_MSG_CHECKING([if tests are built])
134 AC_MSG_RESULT([${enable_tests}])
136 if test "x${enable_tests}" = "xyes" ; then
137 PKG_CHECK_MODULES([CHECK],
144 AM_CONDITIONAL(EET_ENABLE_TESTS, test "x${enable_tests}" = "xyes")
149 AC_ARG_ENABLE(openssl,
150 [AC_HELP_STRING([--disable-openssl], [disable openssl eet support])],
151 [ want_openssl=$enableval ]
153 if test "x$want_openssl" = "xyes" -o "x$want_openssl" = "xauto"; then
154 PKG_CHECK_MODULES(OPENSSL, openssl,
157 AC_DEFINE(HAVE_OPENSSL, 1, [Have Openssl support])
160 if test "x$use_strict" = "xyes"; then
161 AC_MSG_ERROR([Openssl not found (strict dependencies checking)])
172 AC_MSG_CHECKING(whether to activate cypher support in eet)
173 AC_ARG_ENABLE(cypher,
174 [AC_HELP_STRING([--disable-cypher], [disable cypher support for eet API])],
175 [ want_cypher=$enableval ]
177 if test "x$have_openssl" = "xyes" -a "x$want_cypher" = "xyes"; then
179 AC_DEFINE(HAVE_CYPHER, 1, [Have cypher support built in eet])
181 AC_MSG_RESULT($have_cypher)
183 AC_MSG_CHECKING(whether to activate signature support in eet)
184 AC_ARG_ENABLE(signature,
185 [AC_HELP_STRING([--disable-signature], [disable signature file support for eet])],
186 [ want_signature=$enableval ]
188 if test "x$have_openssl" = "xyes" -a "x$want_signature" = "xyes"; then
190 AC_DEFINE(HAVE_SIGNATURE, 1, [Have signature support for eet file])
192 AC_MSG_RESULT($have_signature)
196 AC_ARG_ENABLE(coverage,
197 [AC_HELP_STRING([--enable-coverage],
198 [compile with coverage profiling instrumentation @<:@default=no@:>@])],
200 if test "x${enableval}" = "xyes" ; then
201 enable_coverage="yes"
205 [enable_coverage="no"]
207 AC_MSG_CHECKING([whether to use profiling instrumentation])
208 AC_MSG_RESULT($enable_coverage)
210 if test "x$enable_tests" = "xno" -a "x$enable_coverage" = "xyes"; then
214 if test "x$enable_coverage" = "xyes"; then
215 AC_CHECK_PROG(have_lcov,
220 if test "x$have_lcov" = "xyes" ; then
221 COVERAGE_CFLAGS="-fprofile-arcs -ftest-coverage"
222 COVERAGE_LIBS="-lgcov"
223 dnl remove any optimisation flag and force debug symbols
226 AC_MSG_WARN([lcov is not found, disable profiling instrumentation])
230 AC_SUBST(COVERAGE_CFLAGS)
231 AC_SUBST(COVERAGE_LIBS)
233 AM_CONDITIONAL(EET_ENABLE_COVERAGE, test "x$enable_coverage" = "xyes")
235 dnl Disable support for old eet file format.
236 old_eet_file_format="yes"
237 AC_ARG_ENABLE(old-eet-file-format,
239 [--disable-old-eet-file-format],
240 [disable old eet file format support. [[default=enabled]]]
242 [ old_eet_file_format=$enableval ]
244 AM_CONDITIONAL(EET_OLD_EET_FILE_FORMAT, test "x$old_eet_file_format" = "xyes")
245 if test "x$old_eet_file_format" = "xyes"; then
246 AC_DEFINE(EET_OLD_EET_FILE_FORMAT, 1, [support old eet file format])
248 AC_DEFINE(EET_OLD_EET_FILE_FORMAT, 0, [support old eet file format])
253 AC_ARG_ENABLE(assert,
256 [enable assert, [[default=disabled]]]
258 [ prefer_assert=$enableval ]
260 AM_CONDITIONAL(EET_ASSERT, test "x$prefer_assert" = "xyes")
261 if test "x$prefer_assert" = "xno"; then
262 cflags="$cflags -DNDEBUG"
280 #####################################################################
286 echo "------------------------------------------------------------------------"
287 echo "$PACKAGE_NAME $PACKAGE_VERSION"
288 echo "------------------------------------------------------------------------"
290 echo "Configuration Options Summary:"
292 echo " Openssl..............: ${have_openssl}"
293 echo " Cypher support.....: ${have_cypher}"
294 echo " Signature..........: ${have_signature}"
296 echo " Tests................: ${enable_tests}"
297 echo " Coverage.............: ${enable_coverage}"
299 echo " Old eet file format..: ${old_eet_file_format}"
301 echo " Compilation..........: make"
303 echo " Installation.........: make install"
305 echo " prefix.............: $prefix"