Imported Upstream version 1.7.7
[platform/upstream/eio.git] / configure.ac
1 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
2 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
3 m4_define([v_maj], [1])
4 m4_define([v_min], [7])
5 m4_define([v_mic], [7])
6 m4_define([v_rev], m4_esyscmd([(git rev-list --count HEAD 2>/dev/null || echo 0) | tr -d '\n']))dnl
7 ##--   When released, remove the dnl on the below line
8 m4_undefine([v_rev])
9 ##--   When doing snapshots - change soname. remove dnl on below line
10 dnl m4_define([relname], [ver-pre-svn-09])
11 dnl m4_define([v_rel], [-release relname])
12 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
13 m4_ifdef([v_rev], [m4_define([v_ver], [v_maj.v_min.v_mic.v_rev])],
14 [m4_define([v_ver], [v_maj.v_min.v_mic])])
15 m4_define([lt_rev], m4_eval(v_maj + v_min))
16 m4_define([lt_cur], v_mic)
17 m4_define([lt_age], v_min)
18 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
19 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
20
21 AC_INIT([eio], [v_ver], [enlightenment-devel@lists.sourceforge.net])
22 AC_PREREQ([2.52])
23 AC_CONFIG_SRCDIR([configure.ac])
24 AC_CONFIG_MACRO_DIR([m4])
25
26 AC_CONFIG_HEADERS([config.h])
27 AH_TOP([
28 #ifndef EFL_CONFIG_H__
29 #define EFL_CONFIG_H__
30 ])
31 AH_BOTTOM([
32 #endif /* EFL_CONFIG_H__ */
33 ])
34
35 AM_INIT_AUTOMAKE([1.6 dist-bzip2])
36 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
37
38 AC_GNU_SOURCE
39 AC_SYS_LARGEFILE
40
41 AC_LIBTOOL_WIN32_DLL
42 define([AC_LIBTOOL_LANG_CXX_CONFIG], [:])dnl
43 define([AC_LIBTOOL_LANG_F77_CONFIG], [:])dnl
44 AC_PROG_LIBTOOL
45
46 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
47 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
48 m4_ifdef([v_rev], , [m4_define([v_rev], [0])])
49 m4_ifdef([v_rel], , [m4_define([v_rel], [])])
50 AC_DEFINE_UNQUOTED(VMAJ, [v_maj], [Major version])
51 AC_DEFINE_UNQUOTED(VMIN, [v_min], [Minor version])
52 AC_DEFINE_UNQUOTED(VMIC, [v_mic], [Micro version])
53 AC_DEFINE_UNQUOTED(VREV, [v_rev], [Revison])
54 version_info="lt_rev:lt_cur:lt_age"
55 release_info="v_rel"
56 AC_SUBST([version_info])
57 AC_SUBST([release_info])
58 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
59 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
60 VMAJ=v_maj
61 AC_SUBST([VMAJ])
62
63
64 ### Needed information
65
66 AC_CANONICAL_BUILD
67 AC_CANONICAL_HOST
68
69
70 ### Default options with respect to host
71
72 want_inotify="no"
73 want_notify_win32="no"
74
75 case "$host_os" in
76    mingw*)
77       want_notify_win32="yes"
78       ;;
79    *)
80       want_inotify="yes"
81       ;;
82 esac
83
84
85 ### Checks for programs
86
87 AC_PROG_CC
88
89 # pkg-config
90 PKG_PROG_PKG_CONFIG
91
92 # Check whether pkg-config supports Requires.private
93 if $PKG_CONFIG --atleast-pkgconfig-version 0.22; then
94    pkgconfig_requires_private="Requires.private"
95 else
96    pkgconfig_requires_private="Requires"
97 fi
98 AC_SUBST([pkgconfig_requires_private])
99
100 # doxygen program for documentation building
101
102 EFL_CHECK_DOXYGEN([build_doc="yes"], [build_doc="no"])
103
104
105 ### Checks for libraries
106
107 EFL_EIO_BUILD=""
108 case "$host_os" in
109    mingw*)
110       PKG_CHECK_EXISTS([evil >= 1.7.7])
111       AC_DEFINE([HAVE_EVIL], [1], [Set to 1 if evil package is installed])
112       requirements_eio="${requirements_eio} evil >= 1.7.7"
113       EFL_EIO_BUILD="-DEFL_EIO_BUILD"
114    ;;
115 esac
116 AC_SUBST([EFL_EIO_BUILD])
117
118 requirements_eio="${requirements_eio} eet >= 1.7.7 eina >= 1.7.7 ecore >= 1.7.7"
119 AC_SUBST([requirements_eio])
120
121 PKG_CHECK_MODULES([EIO], [${requirements_eio}])
122
123
124 ### Checks for header files
125
126 AC_HEADER_DIRENT
127 AC_HEADER_TIME
128 AC_CHECK_HEADERS([unistd.h libgen.h grp.h features.h pwd.h])
129
130 EFL_CHECK_THREADS(
131    [
132     if test "x${_efl_have_posix_threads}" = "xyes" ; then
133        have_threads="POSIX"
134     else
135        if test "x${_efl_have_win32_threads}" = "xyes" ; then
136           have_threads="Win32"
137        else
138           have_threads="no"
139        fi
140     fi
141    ],
142    [have_threads="no"])
143
144 if test "x${have_threads}" = "xno" ; then
145    AC_MSG_ERROR([Threads not supported. Be sure to have pthread on non Windows OS])
146 fi
147
148 EFL_CHECK_PATH_MAX
149
150 ### Checks for types
151
152 ### Checks for structures
153
154 ### Checks for compiler characteristics
155 AC_C_BIGENDIAN
156 AC_C_INLINE
157 AC_C___ATTRIBUTE__
158 AM_PROG_CC_C_O
159
160 EFL_EIO_BUILD=""
161 case "$host_os" in
162    mingw*)
163       EFL_EIO_BUILD="-DEFL_EIO_BUILD"
164    ;;
165 esac
166 AC_SUBST(EFL_EIO_BUILD)
167
168 ### Checks for linker characteristics
169
170 # use --enable-auto-import on Windows
171
172 lt_enable_auto_import=""
173 case "$host_os" in
174    mingw* | cegcc*)
175       lt_enable_auto_import="-Wl,--enable-auto-import"
176       ;;
177 esac
178 AC_SUBST(lt_enable_auto_import)
179
180 ### Checks for library functions
181 AC_CHECK_FUNCS([fchmod chown getpwnam getgrnam fcntl])
182
183 ### Check for splice system call
184
185 AC_MSG_CHECKING([whether to use splice for file copy])
186 AC_TRY_LINK(
187    [
188 #if defined(HAVE_UNISTD_H)
189 # include <unistd.h>
190 #endif
191 #include <fcntl.h>
192    ],
193    [
194 long ret = splice(0,0,1,0,400,0);
195    ],
196    [have_splice="yes"],
197    [have_splice="no"])
198 AC_MSG_RESULT([${have_splice}])
199
200 if test "x${have_splice}" = "xyes" ; then
201    AC_DEFINE([HAVE_SPLICE], [1], [Define to mention that splice syscall is supported])
202 fi
203
204 # Check for lstat
205
206 AC_MSG_CHECKING([whether lstat is available])
207 AC_TRY_LINK(
208    [
209 #include <sys/types.h>
210 #include <sys/stat.h>
211 #if defined(HAVE_UNISTD_H)
212 # include <unistd.h>
213 #endif
214    ],
215    [
216 struct stat st;
217 lstat("/tmp", &st);
218    ],
219    [have_lstat="yes"],
220    [have_lstat="no"])
221 AC_MSG_RESULT([${have_lstat}])
222
223 if test "x${have_lstat}" = "xyes" ; then
224    AC_DEFINE([HAVE_LSTAT], [1], [Define to mention that lstat syscall is supported])
225 fi
226
227 # extended attribute
228
229 AC_MSG_CHECKING([for extended attributes])
230
231 AC_COMPILE_IFELSE(
232    [AC_LANG_PROGRAM(
233        [[
234 #include <stdlib.h>
235 #include <sys/types.h>
236 #include <sys/xattr.h>
237        ]],
238        [[
239 size_t tmp = listxattr("/", NULL, 0);
240 tmp = getxattr("/", "user.ethumb.md5", NULL, 0);
241 setxattr("/", "user.ethumb.md5", NULL, 0, 0);
242        ]])],
243    [
244     AC_DEFINE([HAVE_XATTR], [1], [Define to 1 if you have the `listxattr', `setxattr' and `getxattr' functions.])
245     have_xattr="yes"
246    ],
247    [have_xattr="no"])
248
249 AC_MSG_RESULT([${have_xattr}])
250
251 # Check for inotify specificity
252 have_inotify="no"
253 have_notify_win32="no"
254 EIO_CHECK_INOTIFY([${want_inotify}], [have_inotify="yes"], [have_inotify="no"])
255 EIO_CHECK_NOTIFY_WIN32([${want_notify_win32}], [have_notify_win32="yes"], [have_notify_win32="no"])
256
257 AM_CONDITIONAL([EIO_HAVE_INOTIFY], [test "x$have_inotify" = "xyes"])
258 AM_CONDITIONAL([EIO_HAVE_WINCHANGE], [test "x$have_notify_win32" = "xyes"])
259 EFL_CHECK_BUILD_EXAMPLES([enable_build_examples="yes"], [enable_build_examples="no"])
260 EFL_CHECK_INSTALL_EXAMPLES([enable_install_examples="yes"], [enable_install_examples="no"])
261
262
263 AC_OUTPUT([
264 eio.pc
265 eio.spec
266 Makefile
267 doc/Makefile
268 doc/eio.dox
269 doc/Doxyfile
270 src/Makefile
271 src/lib/Makefile
272 src/examples/Makefile
273 ])
274
275 echo
276 echo
277 echo "------------------------------------------------------------------------"
278 echo "$PACKAGE_NAME $PACKAGE_VERSION"
279 echo "------------------------------------------------------------------------"
280 echo
281 echo
282 echo
283 echo "Configuration Options Summary:"
284 echo
285 echo "  Thread Support.......: ${have_threads}"
286 echo "  Inotify..............: ${have_inotify}"
287 echo "  Windows notification.: ${have_notify_win32}"
288 echo
289 echo "  Documentation........: ${build_doc}"
290 if test "x${build_doc}" = "xyes" ; then
291 echo "    Installation.......: make install-doc"
292 fi
293 echo "  Examples...............: ${enable_build_examples}"
294 echo "  Examples installed.....: ${enable_install_examples}"
295 echo
296 echo "Compilation............: make (or gmake)"
297 echo "  CPPFLAGS.............: $CPPFLAGS"
298 echo "  CFLAGS...............: $CFLAGS"
299 echo "  LDFLAGS..............: $LDFLAGS"
300 echo
301 echo "Installation...........: make install (as root if needed, with 'su' or 'sudo')"
302 echo "  prefix...............: $prefix"
303 echo