configure.ac
4.47 KB
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
AC_PREREQ(2.59)
AC_INIT(scot, 0.0.3, BUG-REPORT-ADDRESS)
AC_CONFIG_AUX_DIR([config])
AC_CONFIG_SRCDIR([src/cmdla.c])
AC_CONFIG_HEADER([config.h])
AM_INIT_AUTOMAKE
AC_CANONICAL_HOST
# Checks for programs.
AC_PROG_CC
AC_PROG_MAKE_SET
AC_LIBTOOL_WIN32_DLL
AC_PROG_LIBTOOL
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([getopt.h libintl.h locale.h stdlib.h string.h unistd.h wchar.h])
AX_CREATE_STDINT_H([include/scot/scot_int.h])
# Checks for libraries.
AM_GNU_GETTEXT([external])
AC_MSG_CHECKING([intl])
AC_MSG_RESULT([$LIBINTL])
AM_GNU_GETTEXT_VERSION(0.13.1)
localedir=`eval echo $datadir/locale`
AC_DEFINE_UNQUOTED(LOCALEDIR, "$localedir", [Name of gettext locale directory])
THREAD_LIB=
THREAD_CFLAGS=
AC_MSG_CHECKING([for Win32])
case "$host" in
*-*-mingw*)
win32="yes, use windows threads"
pthread="pthreadGC2"
SOCK_LIB="-lws2_32"
;;
*)
win32="no"
pthread="pthread"
SOCK_LIB=""
;;
esac
AC_MSG_RESULT([$win32])
AC_CHECK_LIB($pthread,pthread_create,
THREAD_LIB=-l$pthread
THREAD_CFLAGS="-DUSE_PTHREAD -DREENTRANT"
thread="PTHREAD",
THREAD_CFLAGS="-DUSE_WTHREAD"
thread="WTHREAD",)
AC_SUBST(SOCK_LIB)
AC_SUBST(THREAD_LIB)
AC_SUBST(THREAD_CFLAGS)
AM_PROG_CC_C_O
AM_CONDITIONAL(USE_THREADS, test "x$thread" != "x")
AM_CONDITIONAL(PTHREAD, test "x$thread" == "xPTHREAD")
AM_CONDITIONAL(WTHREAD, test "x$thread" == "xWTHREAD")
AM_CONDITIONAL(WIN32, test "x$win32" != "xno")
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
# Checks for library functions.
AC_CHECK_FUNCS([memset setlocale])
dnl We need to check if the right inotify version is accessible
use_inotify="yes"
AC_MSG_CHECKING([whether inotify is to be used for filemonitoring])
if test "x$win32" == "xno"
then
AC_ARG_ENABLE(inotify,
[ --disable-inotify disable inotify in the ecore_file module],
[
if test "$enableval" == "yes"; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no - but we need it])
use_inotify="no"
fi
], [
AC_MSG_RESULT([yes])
]
)
dnl It's hard to find a good test on how to check the correct
dnl inotify version. They changed the headers a lot.
dnl in kernel 2.6.13 __NR_inotify_init was added to the defined syscalls
dnl in asm/unistd.h and IN_MOVE_SELF was added to linux/inotify.h
dnl so with this check you need a very new kernel and kernel-headers!
dnl On my gentoo, /usr/include/asm and /usr/include/linux are no symlinks
dnl into the current kernel tree....so i also try to find the includes
dnl under /usr/src/linux or under /usr/include/linux-`uname -r`
linux_rev=`uname -r`
INOTIFY_INCLUDES=
AC_MSG_CHECKING([for sufficient inotify includes])
if test "x$use_inotify" = "xyes"; then
AC_TRY_COMPILE(
[
#include <asm/unistd.h>
#include <linux/inotify.h>
],
[ int a = __NR_inotify_init; int b = IN_MOVE_SELF; ],
[
AC_DEFINE(HAVE_INOTIFY, 1, [ File monitoring with Inotify ])
an_inc=/usr/include
],
[
AC_TRY_COMPILE(
[
#include "/usr/src/linux/include/asm/unistd.h"
#include "/usr/src/linux/include/linux/inotify.h"
],
[ int a = __NR_inotify_init; int b = IN_MOVE_SELF; ],
[
AC_DEFINE(HAVE_INOTIFY, 1, [ File monitoring with Inotify ])
AC_DEFINE(IN_KERNEL, 1, [ blablabla ])
INOTIFY_INCLUDES=-I/usr/src/linux/include
an_inc=/usr/src/linux/include
],
[
AC_TRY_COMPILE(
[
#include </usr/src/linux-$linux_rev/include/asm/unistd.h>
#include </usr/src/linux-$linux_rev/include/linux/inotify.h>
],
[ int a = __NR_inotify_init; int b = IN_MOVE_SELF; ],
[
AC_DEFINE(HAVE_INOTIFY, 1, [ File monitoring with Inotify ])
AC_DEFINE(IN_KERNEL_UNAME, 1, [ blablabla ])
INOTIFY_INCLUDES=-I/usr/src/linux-$linux_rev/include
an_inc=/usr/src/linux-$linux_rev/include
],
[
use_inotify="no"
an_inc="not found"
]
)
]
)
]
)
AC_MSG_RESULT([$an_inc])
test "x$an_inc" == "xnot found" && exit
else
AC_MSG_RESULT(["Not used"])
fi
AC_SUBST(INOTIFY_INCLUDES)
else
use_inotify="no"
AC_MSG_RESULT([no])
fi
AM_CONDITIONAL(USE_INOTIFY, test "x$use_inotify" != "xno")
AC_CONFIG_FILES([Makefile])
AC_CONFIG_FILES([src/Makefile])
AC_CONFIG_FILES([include/Makefile])
AC_CONFIG_FILES([test/Makefile])
AC_CONFIG_FILES([m4/Makefile])
AC_CONFIG_FILES([src/po/Makefile.in])
AC_CONFIG_FILES([test/po/Makefile.in])
AC_OUTPUT