summaryrefslogtreecommitdiff
path: root/legacy/eio/configure.ac
blob: 154d09da93749e59be99fff7ab52963ec34288e1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
m4_define([v_maj], [1])
m4_define([v_min], [6])
m4_define([v_mic], [99])
m4_define([v_rev], m4_esyscmd([(svnversion "${SVN_REPO_PATH:-.}" | grep -v '\(export\|Unversioned directory\)' || echo 0) | awk -F : '{printf("%s\n", $1);}' | tr -d ' :MSP\n']))
m4_if(v_rev, [0], [m4_define([v_rev], m4_esyscmd([git log 2> /dev/null | (grep -m1 git-svn-id || echo 0) | sed -e 's/.*@\([0-9]*\).*/\1/' | tr -d '\n']))])
##--   When released, remove the dnl on the below line
m4_undefine([v_rev])
##--   When doing snapshots - change soname. remove dnl on below line
dnl m4_define([relname], [ver-pre-svn-09])
dnl m4_define([v_rel], [-release relname])
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
m4_ifdef([v_rev], [m4_define([v_ver], [v_maj.v_min.v_mic.v_rev])],
[m4_define([v_ver], [v_maj.v_min.v_mic])])
m4_define([lt_rev], m4_eval(v_maj + v_min))
m4_define([lt_cur], v_mic)
m4_define([lt_age], v_min)
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##

AC_INIT([eio], [v_ver-alpha], [enlightenment-devel@lists.sourceforge.net])
AC_PREREQ([2.52])
AC_CONFIG_SRCDIR([configure.ac])
AC_CONFIG_MACRO_DIR([m4])

AC_CONFIG_HEADERS([config.h])
AH_TOP([
#ifndef EFL_CONFIG_H__
#define EFL_CONFIG_H__
])
AH_BOTTOM([
#endif /* EFL_CONFIG_H__ */
])

AM_INIT_AUTOMAKE([1.6 dist-bzip2])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])

AC_GNU_SOURCE
AC_SYS_LARGEFILE

AC_LIBTOOL_WIN32_DLL
define([AC_LIBTOOL_LANG_CXX_CONFIG], [:])dnl
define([AC_LIBTOOL_LANG_F77_CONFIG], [:])dnl
AC_PROG_LIBTOOL

##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
m4_ifdef([v_rev], , [m4_define([v_rev], [0])])
m4_ifdef([v_rel], , [m4_define([v_rel], [])])
AC_DEFINE_UNQUOTED(VMAJ, [v_maj], [Major version])
AC_DEFINE_UNQUOTED(VMIN, [v_min], [Minor version])
AC_DEFINE_UNQUOTED(VMIC, [v_mic], [Micro version])
AC_DEFINE_UNQUOTED(VREV, [v_rev], [Revison])
version_info="lt_rev:lt_cur:lt_age"
release_info="v_rel"
AC_SUBST([version_info])
AC_SUBST([release_info])
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
VMAJ=v_maj
AC_SUBST([VMAJ])


### Needed information

AC_CANONICAL_BUILD
AC_CANONICAL_HOST


### Default options with respect to host

want_inotify="no"
want_notify_win32="no"

case "$host_os" in
   mingw*)
      want_notify_win32="yes"
      ;;
   *)
      want_inotify="yes"
      ;;
esac


### Checks for programs

AC_PROG_CC

# pkg-config
PKG_PROG_PKG_CONFIG

# Check whether pkg-config supports Requires.private
if $PKG_CONFIG --atleast-pkgconfig-version 0.22; then
   pkgconfig_requires_private="Requires.private"
else
   pkgconfig_requires_private="Requires"
fi
AC_SUBST([pkgconfig_requires_private])

# doxygen program for documentation building

EFL_CHECK_DOXYGEN([build_doc="yes"], [build_doc="no"])


### Checks for libraries

EFL_EIO_BUILD=""
case "$host_os" in
   mingw*)
      PKG_CHECK_EXISTS([evil >= 1.6.99])
      AC_DEFINE([HAVE_EVIL], [1], [Set to 1 if evil package is installed])
      requirements_eio="${requirements_eio} evil >= 1.6.99"
      EFL_EIO_BUILD="-DEFL_EIO_BUILD"
   ;;
esac
AC_SUBST([EFL_EIO_BUILD])

requirements_eio="${requirements_eio} eet >= 1.6.99 eina >= 1.6.99 ecore >= 1.6.99"
AC_SUBST([requirements_eio])

PKG_CHECK_MODULES([EIO], [${requirements_eio}])


### Checks for header files

AC_HEADER_DIRENT
AC_HEADER_TIME
AC_CHECK_HEADERS([unistd.h libgen.h grp.h features.h pwd.h])

EFL_CHECK_THREADS(
   [
    if test "x${_efl_have_posix_threads}" = "xyes" ; then
       have_threads="POSIX"
    else
       if test "x${_efl_have_win32_threads}" = "xyes" ; then
          have_threads="Win32"
       else
          have_threads="no"
       fi
    fi
   ],
   [have_threads="no"])

if test "x${have_threads}" = "xno" ; then
   AC_MSG_ERROR([Threads not supported. Be sure to have pthread on non Windows OS])
fi

EFL_CHECK_PATH_MAX

### Checks for types

### Checks for structures

### Checks for compiler characteristics
AC_C_BIGENDIAN
AC_C_INLINE
AC_C___ATTRIBUTE__
AM_PROG_CC_C_O

EFL_EIO_BUILD=""
case "$host_os" in
   mingw*)
      EFL_EIO_BUILD="-DEFL_EIO_BUILD"
   ;;
esac
AC_SUBST(EFL_EIO_BUILD)

### Checks for linker characteristics

# use --enable-auto-import on Windows

lt_enable_auto_import=""
case "$host_os" in
   mingw* | cegcc*)
      lt_enable_auto_import="-Wl,--enable-auto-import"
      ;;
esac
AC_SUBST(lt_enable_auto_import)

### Checks for library functions
AC_CHECK_FUNCS([fchmod chown getpwnam getgrnam])

### Check for splice system call

AC_MSG_CHECKING([whether to use splice for file copy])
AC_TRY_LINK(
   [
#if defined(HAVE_UNISTD_H)
# include <unistd.h>
#endif
#include <fcntl.h>
   ],
   [
long ret = splice(0,0,1,0,400,0);
   ],
   [have_splice="yes"],
   [have_splice="no"])
AC_MSG_RESULT([${have_splice}])

if test "x${have_splice}" = "xyes" ; then
   AC_DEFINE([HAVE_SPLICE], [1], [Define to mention that splice syscall is supported])
fi

# Check for lstat

AC_MSG_CHECKING([whether lstat is available])
AC_TRY_LINK(
   [
#include <sys/types.h>
#include <sys/stat.h>
#if defined(HAVE_UNISTD_H)
# include <unistd.h>
#endif
   ],
   [
struct stat st;
lstat("/tmp", &st);
   ],
   [have_lstat="yes"],
   [have_lstat="no"])
AC_MSG_RESULT([${have_lstat}])

if test "x${have_lstat}" = "xyes" ; then
   AC_DEFINE([HAVE_LSTAT], [1], [Define to mention that lstat syscall is supported])
fi

# extended attribute

AC_MSG_CHECKING([for extended attributes])

AC_COMPILE_IFELSE(
   [AC_LANG_PROGRAM(
       [[
#include <stdlib.h>
#include <sys/types.h>
#include <sys/xattr.h>
       ]],
       [[
size_t tmp = listxattr("/", NULL, 0);
tmp = getxattr("/", "user.ethumb.md5", NULL, 0);
setxattr("/", "user.ethumb.md5", NULL, 0, 0);
       ]])],
   [
    AC_DEFINE([HAVE_XATTR], [1], [Define to 1 if you have the `listxattr', `setxattr' and `getxattr' functions.])
    have_xattr="yes"
   ],
   [have_xattr="no"])

AC_MSG_RESULT([${have_xattr}])

# Check for inotify specificity
have_inotify="no"
have_notify_win32="no"
EIO_CHECK_INOTIFY([${want_inotify}], [have_inotify="yes"], [have_inotify="no"])
EIO_CHECK_NOTIFY_WIN32([${want_notify_win32}], [have_notify_win32="yes"], [have_notify_win32="no"])

AM_CONDITIONAL([EIO_HAVE_INOTIFY], [test "x$have_inotify" = "xyes"])
AM_CONDITIONAL([EIO_HAVE_WINCHANGE], [test "x$have_notify_win32" = "xyes"])
EFL_CHECK_BUILD_EXAMPLES([enable_build_examples="yes"], [enable_build_examples="no"])
EFL_CHECK_INSTALL_EXAMPLES([enable_install_examples="yes"], [enable_install_examples="no"])


AC_OUTPUT([
eio.pc
eio.spec
Makefile
doc/Makefile
doc/eio.dox
doc/Doxyfile
src/Makefile
src/lib/Makefile
src/examples/Makefile
])

echo
echo
echo "------------------------------------------------------------------------"
echo "$PACKAGE_NAME $PACKAGE_VERSION"
echo "------------------------------------------------------------------------"
echo
echo
echo
echo "Configuration Options Summary:"
echo
echo "  Thread Support.......: ${have_threads}"
echo "  Inotify..............: ${have_inotify}"
echo "  Windows notification.: ${have_notify_win32}"
echo
echo "  Documentation........: ${build_doc}"
echo "  Examples...............: ${enable_build_examples}"
echo "  Examples installed.....: ${enable_install_examples}"
echo
echo "Compilation............: make (or gmake)"
echo "  CPPFLAGS.............: $CPPFLAGS"
echo "  CFLAGS...............: $CFLAGS"
echo "  LDFLAGS..............: $LDFLAGS"
echo
echo "Installation...........: make install (as root if needed, with 'su' or 'sudo')"
echo "  prefix...............: $prefix"
echo