Make eet depends on eina.
[framework/uifw/eet.git] / configure.ac
1 # get rid of that stupid cache mechanism
2 rm -f config.cache
3
4 AC_INIT([eet], [1.1.0], [enlightenment-devel@lists.sourceforge.net])
5 AC_PREREQ([2.52])
6 AC_CONFIG_SRCDIR([configure.ac])
7 AC_CONFIG_MACRO_DIR([m4])
8 AC_CANONICAL_BUILD
9 AC_CANONICAL_HOST
10 AC_ISC_POSIX
11
12 AM_INIT_AUTOMAKE(1.6 dist-bzip2)
13 AM_CONFIG_HEADER(config.h)
14
15 AC_PROG_CC
16 AM_PROG_CC_STDC
17 AC_HEADER_STDC
18 AC_C_CONST
19 AM_PROG_CC_C_O
20 AC_C___ATTRIBUTE__
21
22 AC_LIBTOOL_WIN32_DLL
23 define([AC_LIBTOOL_LANG_CXX_CONFIG], [:])dnl
24 define([AC_LIBTOOL_LANG_F77_CONFIG], [:])dnl
25 AC_PROG_LIBTOOL
26
27 VMAJ=`echo $PACKAGE_VERSION | awk -F. '{printf("%s", $1);}'`
28 VMIN=`echo $PACKAGE_VERSION | awk -F. '{printf("%s", $2);}'`
29 VMIC=`echo $PACKAGE_VERSION | awk -F. '{printf("%s", $3);}'`
30 SNAP=`echo $PACKAGE_VERSION | awk -F. '{printf("%s", $4);}'`
31 version_info=`expr $VMAJ + $VMIN`":$VMIC:$VMIN"
32 AC_SUBST(version_info)
33
34 PKG_PROG_PKG_CONFIG
35
36 WIN32_CFLAGS=""
37 WIN32_LIBS=""
38 lt_enable_auto_import=""
39 case "$host_os" in
40         mingw* | cegcc*)
41                 PKG_CHECK_MODULES([EVIL], [evil])
42                 AC_DEFINE(HAVE_EVIL, 1, [Set to 1 if evil package is installed])
43                 dnl needed for correct definition of EAPI
44                 AC_DEFINE(EFL_EET_BUILD, 1, [Define to mention that eet is built])
45                 lt_enable_auto_import="-Wl,--enable-auto-import"
46                 ;;
47 esac
48 case "$host_os" in
49         mingw32ce*)
50                 WIN32_LIBS="-lws2"
51                 ;;
52         mingw*)
53                 WIN32_LIBS="-lws2_32"
54                 ;;
55         cegcc*)
56                 WIN32_CFLAGS="-mwin32"
57                 WIN32_LIBS="-lws2"
58                 ;;
59 esac
60 AC_SUBST(WIN32_CFLAGS)
61 AC_SUBST(WIN32_LIBS)
62 AC_SUBST(lt_enable_auto_import)
63
64 AC_FUNC_ALLOCA
65
66 AC_CHECK_HEADER([zlib.h],
67    [dummy="yes"],
68    [AC_MSG_ERROR("Cannot find zlib.h. Make sure your CFLAGS environment variable contains include lines for the location of this file")])
69
70 AC_CHECK_HEADER([jpeglib.h],
71    [dummy="yes"],
72    [AC_MSG_ERROR("Cannot find jpeglib.h. Make sure your CFLAGS environment variable contains include lines for the location of this file")])
73
74 AC_CHECK_HEADERS(netinet/in.h)
75
76 AC_CHECK_HEADER([fnmatch.h],
77    [dummy="yes"],
78    [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])])
79
80 AC_CHECK_FUNCS([fnmatch], [res="yes"], [res="no"])
81 if test "x$res" = "xno"; then
82    AC_SEARCH_LIBS([fnmatch],
83       [fnmatch iberty evil])
84 fi
85
86 dnl These are needed for fmemopen/open_memstream
87 AC_DEFINE(_GNU_SOURCE, , [Enable GNU extensions])
88
89 AC_CHECK_FUNCS(fmemopen open_memstream realpath)
90
91 dnl Check whether the null pointer is zero on this arch
92 AC_MSG_CHECKING([value of the null pointer])
93 AC_TRY_RUN([
94 #include <stdlib.h>
95 int main (int argc, char **argv) {
96   void *foo = NULL;
97   int bar = (int)foo;
98   return (int)foo;
99 }
100 ], AC_MSG_RESULT([yes]), [
101         AC_MSG_RESULT([no])
102         AC_MSG_WARN([Your system is a bit too funny, eet might not work properly])
103 ], AC_MSG_WARN([Cannot check when cross-compiling -- assuming null is okay])
104 )
105
106 dnl Unit Tests
107 EFL_CHECK_TESTS([enable_tests="yes"], [enable_tests="no"])
108 EFL_CHECK_COVERAGE([${enable_tests}], [enable_coverage="yes"], [enable_coverage="no"])
109
110 dnl Openssl support
111 want_openssl="auto"
112 have_openssl="no"
113 AC_ARG_ENABLE(openssl,
114   [AC_HELP_STRING([--disable-openssl], [disable openssl eet support])],
115   [ want_openssl=$enableval ]
116 )
117 if test "x$want_openssl" = "xyes" -o "x$want_openssl" = "xauto"; then
118   PKG_CHECK_MODULES(OPENSSL, openssl,
119     [
120       have_openssl="yes"
121       AC_DEFINE(HAVE_OPENSSL, 1, [Have Openssl support])
122     ])
123 fi
124
125 dnl Crypto option
126 want_cypher="yes"
127 have_cypher="no"
128 want_signature="yes"
129 have_signature="no"
130
131 AC_ARG_ENABLE(cypher,
132   [AC_HELP_STRING([--disable-cypher], [disable cypher support for eet API])],
133   [ want_cypher=$enableval ]
134 )
135
136 if test "x$have_openssl" = "xyes" -a "x$want_cypher" = "xyes"; then
137   have_cypher="yes"
138   AC_DEFINE(HAVE_CYPHER, 1, [Have cypher support built in eet])
139 fi
140
141 AC_MSG_CHECKING(whether to activate cypher support in eet)
142 AC_MSG_RESULT($have_cypher)
143
144 AC_ARG_ENABLE(signature,
145   [AC_HELP_STRING([--disable-signature], [disable signature file support for eet])],
146   [ want_signature=$enableval ]
147 )
148
149 if test "x$have_openssl" = "xyes" -a "x$want_signature" = "xyes"; then
150   have_signature="yes"
151   AC_DEFINE(HAVE_SIGNATURE, 1, [Have signature support for eet file])
152 fi
153
154 AC_MSG_CHECKING(whether to activate signature support in eet)
155 AC_MSG_RESULT($have_signature)
156
157 dnl Disable support for old eet file format.
158 old_eet_file_format="yes"
159 AC_ARG_ENABLE(old-eet-file-format,
160   AC_HELP_STRING(
161     [--disable-old-eet-file-format],
162     [disable old eet file format support. [[default=enabled]]]
163   ),
164   [ old_eet_file_format=$enableval ]
165 )
166 if test "x$old_eet_file_format" = "xyes"; then
167   AC_DEFINE(EET_OLD_EET_FILE_FORMAT, 1, [support old eet file format])
168 else
169   AC_DEFINE(EET_OLD_EET_FILE_FORMAT, 0, [support old eet file format])
170 fi
171
172 dnl Assert or fail.
173 prefer_assert="no"
174 AC_ARG_ENABLE(assert,
175   AC_HELP_STRING(
176     [--enable-assert],
177     [enable assert, [[default=disabled]]]
178   ),
179   [ prefer_assert=$enableval ]
180 )
181 if test "x$prefer_assert" = "xno"; then
182   DEBUG_CFLAGS="-DNDEBUG"
183 fi
184 AC_SUBST(DEBUG_CFLAGS)
185
186 PKG_CHECK_MODULES(EINA, [eina-0])
187
188 EFL_CHECK_DOXYGEN([enable_doc="yes"], [enable_doc="no"])
189
190 AC_OUTPUT([
191 Makefile
192 eet.pc
193 doc/Makefile
194 doc/eet.c
195 src/Makefile
196 src/lib/Makefile
197 src/bin/Makefile
198 src/tests/Makefile
199 README
200 eet.spec
201 ])
202
203
204 #####################################################################
205 ## Info
206
207 echo
208 echo
209 echo
210 echo "------------------------------------------------------------------------"
211 echo "$PACKAGE_NAME $PACKAGE_VERSION"
212 echo "------------------------------------------------------------------------"
213 echo
214 echo "Configuration Options Summary:"
215 echo
216 echo "  Openssl..............: ${have_openssl}"
217 echo "    Cypher support.....: ${have_cypher}"
218 echo "    Signature..........: ${have_signature}"
219 echo
220 echo "  Documentation........: ${enable_doc}"
221 echo "  Tests................: ${enable_tests}"
222 echo "  Coverage.............: ${enable_coverage}"
223 echo
224 echo "  Old eet file format..: ${old_eet_file_format}"
225 echo
226 echo "  Compilation..........: make"
227 echo
228 echo "  Installation.........: make install"
229 echo
230 echo "    prefix.............: $prefix"
231 echo