summaryrefslogtreecommitdiffstats
path: root/tdeio/tdeio/configure.in.in
blob: 70d381bacc36039e9dad5adf33fc97c00a606cf8 (plain)
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
dnl ------------------------------------------------------------------------
dnl Try to find if FAM is installed
dnl ------------------------------------------------------------------------
dnl
kde_have_fam=yes
AC_ARG_ENABLE(libfam,
	AC_HELP_STRING([--disable-libfam],[don't search for libfam and do not use it]),
[ kde_have_fam=$enableval ], [])dnl

dnl Bloody libfam is C++ and certainly compiled by GNU C++.  This means,
dnl we can't use it, when compiling with another C++ compiler, as the
dnl runtime systems would conflict (e.g. in KAI C++) (matz)
test "$GXX" = yes || kde_have_fam=no

if test "$kde_have_fam" = "yes" ; then
  AC_LANG_SAVE
  AC_LANG_CPLUSPLUS
  KDE_CHECK_LIB(fam, FAMOpen, [LIBFAM="-lfam"; kde_have_fam=yes],kde_have_fam=no)
  if test $kde_have_fam = yes; then
    AC_DEFINE_UNQUOTED(HAVE_FAM, 1, [Define if your system has libfam])
  fi
  AC_LANG_RESTORE
fi
AC_SUBST(LIBFAM)
dnl ------------------------------------------------------------------------
dnl Try to find if LIBZ is installed
dnl ------------------------------------------------------------------------
dnl

AC_FIND_ZLIB

AC_CHECK_HEADERS(sys/mnttab.h sys/mntent.h mntent.h fstab.h sys/ucred.h sys/mount.h)
AC_CHECK_FUNCS(setmntent getmntinfo)

AH_VERBATIM(_GETMNTINFO, [
#ifdef __osf__
#ifdef __cplusplus
extern "C" {
#endif
#include <sys/mount.h>
int getmntinfo(struct statfs **mntbufp, int flags);
#include <sys/fs_types.h>    /* for mnt_names[] */
#ifdef __cplusplus
}
#endif
#endif
])

dnl ------------------------------------------------------------------------
dnl Try to find if libvolmgt is installed (Solaris)
dnl ------------------------------------------------------------------------
kde_have_volmgt=yes
AC_CHECK_LIB(volmgt, volmgt_running, [LIBVOLMGT=-lvolmgt], kde_have_volmgt=no)
AC_SUBST(LIBVOLMGT)
if test "$kde_have_volmgt" = "yes"; then
  AC_DEFINE_UNQUOTED(HAVE_VOLMGT, 1, [Define, to enable volume management (Solaris 2.x), if you have -lvolmgt])
fi

dnl ------------------------------------------------------------------------
dnl Try to find if we have Linux Dir Notification
dnl ------------------------------------------------------------------------

AC_ARG_ENABLE(dnotify,
AC_HELP_STRING([--enable-dnotify],[enable use of Linux directory notifications]),
[ kde_enable_dnotify=$enableval ], [])dnl

AC_CHECK_GNU_EXTENSIONS

if test "x$kde_enable_dnotify" = "xyes"; then
  AC_MSG_CHECKING([for Linux Directory Notification])
  AC_CACHE_VAL(kde_cv_have_dnotify,
  [
  kde_cv_have_dnotify=no
  AC_LANG_SAVE
  AC_LANG_C

  AC_TRY_COMPILE(
  [
#include <fcntl.h>
#include <signal.h>
  ],
  [
#ifndef F_NOTIFY
#error no dir notification
#endif
    int fd;
    siginfo_t *t = 0;

    fcntl(fd, F_SETSIG, SIGRTMIN);
    fcntl(fd, F_NOTIFY, DN_DELETE|DN_CREATE|DN_MULTISHOT);

  ],kde_cv_have_dnotify=yes)

  AC_LANG_RESTORE
  ])

  if test "$kde_cv_have_dnotify" = "yes" ; then
    AC_DEFINE_UNQUOTED(HAVE_DNOTIFY, 1, [Define if your system has Linux Directory Notification])
    AC_MSG_RESULT(yes)
  else
    AC_MSG_RESULT(no)
  fi
fi

dnl ------------------------------------------------------------------------
dnl Try to find if we have Linux Inode based Dir Notification
dnl ------------------------------------------------------------------------

AC_ARG_ENABLE(inotify,
AC_HELP_STRING([--disable-inotify],[enable use of Linux inode notifications]),
[ kde_enable_inotify=$enableval ], [kde_enable_inotify=yes])dnl

AC_CHECK_GNU_EXTENSIONS

if test "x$kde_enable_inotify" = "xyes"; then
  AC_MSG_CHECKING([for Linux Inotify Notification])
  AC_CACHE_VAL(kde_cv_have_inotify,
  [
  kde_cv_have_inotify=no
  AC_LANG_SAVE
  AC_LANG_C

  AC_TRY_COMPILE(
  [
#include <asm/unistd.h>
#define _S390_BITOPS_H
#include <linux/inotify.h>
  ],
  [
#ifndef IN_ALL_EVENTS
#error no inotify notification
#endif

  ],kde_cv_have_inotify=yes,kde_cv_have_inotify=no)

  AC_LANG_RESTORE
  ])

  AC_CACHE_VAL(kde_cv_have_sys_inotify,
  [
  kde_cv_have_sys_inotify=no
  AC_LANG_SAVE
  AC_LANG_C

  AC_TRY_COMPILE(
  [
#include <sys/inotify.h>
  ],
  [
#ifndef IN_ALL_EVENTS
#error no inotify notification
#endif
  ],kde_cv_have_sys_inotify=yes,kde_cv_have_sys_inotify=no)

  AC_LANG_RESTORE
  ])

  if test "$kde_cv_have_inotify" = "yes" -o "$kde_cv_have_sys_inotify" = "yes"; then
    AC_DEFINE_UNQUOTED(HAVE_INOTIFY, 1, [Define if your system has Linux Inode Notification])
    if test "$kde_cv_have_sys_inotify" = "yes"; then
      AC_DEFINE_UNQUOTED(HAVE_SYS_INOTIFY, 1, [Define if your system has glibc support for inotify])
    fi
    AC_MSG_RESULT(yes)
  else
    AC_MSG_RESULT(no)
  fi
fi

dnl ------------------------------------------------------------------------
dnl Try to find if libmagic is installed and contains magic_getpath
dnl ------------------------------------------------------------------------
dnl
AC_MSG_CHECKING([for libmagic])
KDE_CHECK_LIB(magic, magic_load, kde_have_libmagic=yes, kde_have_libmagic=no)
if test $kde_have_libmagic = yes; then
  AC_MSG_RESULT(yes)
  AC_MSG_CHECKING([for libmagic - magic_getpath])
  KDE_CHECK_LIB(magic, magic_getpath, kde_have_libmagic_getpath=yes, kde_have_libmagic_getpath=no)
  if test $kde_have_libmagic_getpath = yes; then
    AC_DEFINE_UNQUOTED(HAVE_LIBMAGIC_GETPATH, 1, [Defined if libmagic contain magic_getpath function])
    AC_MSG_RESULT(yes)
  else
    libmagic_path=`file --version 2>&1 | sed -n "s/^magic file from //p"`
    AC_DEFINE_UNQUOTED(LIBMAGIC_PATH, $libmagic_path, [Define default path for libmagic files])
    AC_MSG_RESULT(no)
  fi
else
  AC_MSG_RESULT(no)
fi