-
Notifications
You must be signed in to change notification settings - Fork 2
/
configure.ac
199 lines (167 loc) · 4.73 KB
/
configure.ac
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
dnl Set package name and maintainer
AC_INIT([mate-eiciel],[1.20.2],[[email protected]])
dnl Where are we
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
AC_CANONICAL_TARGET
dnl Require autoconf 2.59
AC_PREREQ(2.59)
dnl Initialize automake
AM_INIT_AUTOMAKE([1.11 dist-bzip2])
AM_SILENT_RULES([yes])
ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS} -I m4
dnl gettext support
GETTEXT_PACKAGE=mate-eiciel
AC_SUBST([GETTEXT_PACKAGE])
AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], ["$GETTEXT_PACKAGE"], [gettext domain])
AM_GNU_GETTEXT([external])
AM_GNU_GETTEXT_VERSION([0.18.1])
dnl m4 files directory
AC_CONFIG_MACRO_DIR([m4])
dnl Source check
AC_CONFIG_SRCDIR(src/eiciel_standalone.cpp)
dnl Config header name
AC_CONFIG_HEADER(config.hpp)
dnl We want tests in C++
AC_LANG(C++)
dnl Check install program
AC_PROG_INSTALL
dnl Check cpp
AC_PROG_CPP
dnl Check c++ compiler
AC_PROG_CXX
AX_CXX_COMPILE_STDCXX_11
dnl Check libtool
LT_INIT
dnl GNOME 2 or 3?
AC_ARG_WITH(gnome-version,
AS_HELP_STRING([--with-gtk-version=VERSION],[GNOME major version (2, 3, or check; default is check)])
,
[
if test x$withval != x2 -a x$withval != x3 -a x$withval != xchceck;
then
AC_MSG_ERROR([Valid choices for --with-gtk-version= are 2, 3, and check.])
fi
]
,
[with_gnome_version=check])
if test x$with_gnome_version = xcheck;
then
PKG_CHECK_EXISTS(libcaja-extension >= 1.16.0,
[with_gnome_version=3],
[with_gnome_version=2])
else
dnl If we don't do this, $PKG_CONFIG can end up undefined when $with_gnome_version != check
PKG_PROG_PKG_CONFIG
fi
AH_TEMPLATE([USING_GNOME2],[Define to 1 if building mate-eiciel for MATE Desktop Gtk2 (instead of Gtk3)])
dnl Check for gtkmm-3 and dependencies from GNOME 3 ...
if test x$with_gnome_version = x3;
then
AC_MSG_NOTICE([checking for dependencies for Gtk3 version of mate-eiciel])
PKG_CHECK_MODULES(GTKMM, gtkmm-3.0 >= 3.0.0 libcaja-extension >= 1.16.0)
else
dnl ... or check for gtkmm-2.4 and dependencies from GNOME 2
AC_MSG_NOTICE([checking for dependencies for Gtk3 version of mate-eiciel])
PKG_CHECK_MODULES(GTKMM, gtkmm-2.4 >= 2.4.0 libgnome-2.0 >= 2.10.0 libcaja-extension >= 1.0.0 libcaja-extension < 1.16.0, [AC_DEFINE(USING_GNOME2, 1)])
fi
AC_MSG_CHECKING([for caja extensions directory])
AC_ARG_WITH(caja-extensions-dir,
AS_HELP_STRING([--with-caja-extensions-dir=DIR],[Directory where caja extensions have to be installed (usually /usr/lib/caja/extensions-2.0)])
,
[
if test x$withval = xyes -o x$withval = xno;
then
AC_MSG_ERROR([If you specify --with-caja-extensions-dir you must set the directory. E.g.: --with-caja-extensions-dir=/usr/lib/caja/extensions-2.0])
else
AC_SUBST(CAJA_EXTENSIONS_DIR, [$withval])
AC_MSG_RESULT([$withval])
fi
]
,
[dnl Linux distributions
extensiondir=`pkg-config --variable=extensiondir libcaja-extension`;
if test -n "$extensiondir" ;
then
AC_SUBST(CAJA_EXTENSIONS_DIR, [$extensiondir])
AC_MSG_RESULT(${CAJA_EXTENSIONS_DIR})
else
AC_MSG_ERROR([I need pkg-config in order to determine where to install caja extensions. You may want to set --with-caja-extensions-dir=DIR])
fi
]
)
enable_eua=no
AC_MSG_CHECKING([for extended user attributes support])
AC_ARG_ENABLE(user-attributes,
AS_HELP_STRING([--enable-user-attributes],[Enables support for extended user attributes. This is GNU/Linux specific.]),
[
if test x$enableval = xyes -o x$enableval = x;
then
AC_MSG_RESULT([yes])
enable_eua=yes
else
if test x$enableval = xno;
then
enable_eua=no
AC_MSG_RESULT([no])
else
AC_MSG_ERROR([This option can only be given 'yes' or 'no' values])
fi
fi
]
,
[
case $target_os in
linux*)
enable_eua=yes
AC_MSG_RESULT([yes, since we are in GNU/Linux])
;;
*)
enable_eua=no
AC_MSG_RESULT([no, this does not seem to be GNU/Linux])
;;
esac
]
)
if test x$enable_eua = xyes;
then
AC_CHECK_HEADERS([sys/xattr.h], [], AC_MSG_ERROR([This header is mandatory for extended user attributes support]), [])
AC_DEFINE([ENABLE_USER_XATTR], [1], [Enables user extended attributes support])
fi
AM_CONDITIONAL(ENABLE_USER_XATTR, test x$enable_eua = xyes)
dnl Header checks
acl_headers=0
AC_CHECK_HEADERS([sys/acl.h],
[
acl_headers=1
], [], [])
AC_CHECK_HEADERS([acl/libacl.h],
[
acl_headers=1
], [], [])
if test x$acl_headers = x0;
then
AC_MSG_ERROR([No suitable headers for ACL support have been found])
fi
dnl FreeBSD
AC_CHECK_FUNC([acl_get_perm_np],
[AC_DEFINE([HAVE_ACL_GET_PERM_NP], [], [acl_get_perm_np is available])]
[])
AC_SUBST(ACL_LIBS, [])
dnl Check ACL library
AC_CHECK_LIB(acl, acl_get_perm,
[
AC_DEFINE([HAVE_ACL_GET_PERM], [], [acl_get_perm is available])
AC_SUBST(ACL_LIBS, [-lacl])
],)
dnl Output files
AC_CONFIG_FILES([Makefile
src/Makefile
img/Makefile
po/Makefile.in
man/Makefile
doc/Makefile
doc/C/Makefile
doc/C/figures/Makefile
])
AC_OUTPUT