-
Notifications
You must be signed in to change notification settings - Fork 2
/
configure.ac
388 lines (354 loc) · 10.2 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
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
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
dnl Document $Id$
dnl Summary Configure script for the chemical-mime-data project.
dnl
dnl Copyright (C) 2004-2008 Daniel Leidert <[email protected]>.
dnl Copyright (C) 2004-2006 Egon Willighagen <[email protected]>.
dnl All rights reserved.
dnl
dnl This file is free software. The copyright owner gives unlimited
dnl permission to copy, distribute and modify it.
AC_PREREQ([2.59])
dnl --------------------------------------------------------------------------
dnl initialization
dnl --------------------------------------------------------------------------
AC_INIT([chemical-mime-data],[0.3.0],[http://sourceforge.net/projects/chemical-mime/])
AM_INIT_AUTOMAKE([-Wall])
AC_REVISION($Revision$)
AC_CONFIG_SRCDIR([src/chemical-mime-database.xml.in])
dnl --------------------------------------------------------------------------
dnl intltool/gettext
dnl --------------------------------------------------------------------------
ALL_LINGUAS="de fr"
GETTEXT_PACKAGE=AC_PACKAGE_NAME
AC_SUBST([GETTEXT_PACKAGE])
AM_PO_SUBDIRS
IT_PROG_INTLTOOL
ITPROG_VERSION=`intltoolize --version | awk '{print $4}'`
ITPROG_VERSION_MILES=`echo $ITPROG_VERSION | cut -f1 -d.`
ITPROG_VERSION_MAJOR=`echo $ITPROG_VERSION | cut -f2 -d.`
ITPROG_VERSION_MINOR=`echo $ITPROG_VERSION | cut -f3 -d.`
test -n "$ITPROG_VERSION_MILES" || ITPROG_VERSION_MILES=0
test -n "$ITPROG_VERSION_MAJOR" || ITPROG_VERSION_MAJOR=0
test -n "$ITPROG_VERSION_MINOR" || ITPROG_VERSION_MINOR=0
ITPROG_VERSION_ALL=`expr $ITPROG_VERSION_MILES '*' 1000000 + $ITPROG_VERSION_MAJOR '*' 1000 + $ITPROG_VERSION_MINOR`
AC_MSG_CHECKING([for intltool >= 0.35.0])
if test "$ITPROG_VERSION_ALL" -lt 35000; then
AC_MSG_RESULT([no])
USE_NLS=no
AC_SUBST([USE_NLS])
CATOBJEXT=.gmo
AC_SUBST([CATOBJEXT])
else
AC_MSG_RESULT([yes])
fi
dnl --------------------------------------------------------------------------
dnl necessary applications
dnl --------------------------------------------------------------------------
AC_PROG_INSTALL
PKG_PROG_PKG_CONFIG
MP_PROG_XMLLINT
MP_PROG_XSLTPROC
dnl --------------------------------------------------------------------------
dnl configure options
dnl --------------------------------------------------------------------------
dnl Choose to run update-mime-database
AC_ARG_ENABLE(
[update-database],
AS_HELP_STRING(
[--enable-update-database],
[
enable (or disable) the running of the update-mime-database utility after installation
@<:@default=yes@:>@
]
),
[enable_update_database=$enableval],
[enable_update_database=yes]
)
dnl --------------------------------------------------------------------------
dnl installation locations
dnl --------------------------------------------------------------------------
AC_ARG_WITH(
[freedesktop-mime],
AS_HELP_STRING(
[--with-freedesktop-mime@<:@=PATH@:>@],
[
enable, disable or override the installation directory of the freedesktop.org shared MIME info support files
@<:@default=$datadir/mime@:>@
]
),
[
if test "x$withval" = "xyes" ; then
with_freedesktop_mime=${datadir}/mime
fi
],
[with_freedesktop_mime=${datadir}/mime]
)
AC_SUBST([with_freedesktop_mime])
AC_ARG_WITH(
[gnome-mime],
AS_HELP_STRING(
[--with-gnome-mime@<:@=PATH@:>@],
[
enable, disable or override the installation directory of the old GNOME 2.4 MIME support files
@<:@default=$datadir/mime-info@:>@
]
),
[
if test "x$withval" = "xyes" ; then
with_gnome_mime=${datadir}/mime-info
fi
],
[with_gnome_mime=${datadir}/mime-info]
)
AC_SUBST([with_gnome_mime])
AC_PATH_PROG([KDE_CONFIG], [kde-config], [no])
AC_ARG_WITH(
[kde-magic],
AS_HELP_STRING(
[--with-kde-magic@<:@=PATH@:>@],
[
enable, disable or override the installation directory of the KDE 3.x MIME magic snippet files
@<:@default=auto(=$sysconfdir/kde3/magic)@:>@
]
),
[
if test "x$withval" = "xyes" ; then
if test "x$KDE_CONFIG" != "xno" ; then
with_kde_magic=`$KDE_CONFIG --install config`/magic
else
with_kde_magic=${sysconfdir}/kde3/magic
fi
fi
],
[
if test "x$KDE_CONFIG" != "xno" ; then
with_kde_magic=`$KDE_CONFIG --install config`/magic
else
with_kde_magic=${sysconfdir}/kde3/magic
fi
]
)
AC_SUBST([with_kde_magic])
AC_ARG_WITH(
[kde-mime],
AS_HELP_STRING(
[--with-kde-mime@<:@=PATH@:>@],
[
enable, disable or override the installation directory of the KDE 3.x MIME support files
@<:@default=auto(=$datadir/mimelnk)@:>@
]
),
[
if test "x$withval" = "xyes" ; then
if test "x$KDE_CONFIG" != "xno" ; then
with_kde_mime=`$KDE_CONFIG --install mime`
else
with_kde_mime=${datadir}/mimelnk
fi
fi
],
[
if test "x$KDE_CONFIG" != "xno" ; then
with_kde_mime=`$KDE_CONFIG --install mime`
else
with_kde_mime=${datadir}/mimelnk
fi
]
)
AC_SUBST([with_kde_mime])
dnl --------------------------------------------------------------------------
dnl Check target file locations
dnl --------------------------------------------------------------------------
AC_ARG_VAR(
[FDO_SHARED_MIME_INFO_DB],
[
The freedesktop.org shared-mime-info database.
@<:@default=$datadir/mime/packages/freedesktop.org.xml@:>@
]
)
if test -z $FDO_SHARED_MIME_INFO_DB; then
AC_SUBST(
[FDO_SHARED_MIME_INFO_DB],
[${datadir}/mime/packages/freedesktop.org.xml]
)
fi
AC_ARG_VAR(
[GNOME_VFS_MIME_DATA_DB],
[
The GNOME-VFS mime data database.
@<:@default=$datadir/mime-info/gnome-vfs.mime@:>@
]
)
if test -z $GNOME_VFS_MIME_DATA_DB; then
AC_SUBST(
[GNOME_VFS_MIME_DATA_DB],
[${datadir}/mime-info/gnome-vfs.mime]
)
fi
AC_ARG_VAR(
[KDE_MIMELNK_DATA_DB],
[
The KDE mimelnk mime data database path.
@<:@default=auto or $datadir/mimelnk@:>@
]
)
if test -z $KDE_MIMELNK_DATA_DB; then
if test "x$KDE_CONFIG" != "xno" ; then
AC_SUBST(
[KDE_MIMELNK_DATA_DB],
[`$KDE_CONFIG --install mime`]
)
else
AC_SUBST(
[KDE_MIMELNK_DATA_DB],
[${datadir}/mimelnk]
)
fi
fi
AC_ARG_VAR(
[MIME_SUPPORT_MIME_TYPES_DATA_DB],
[
The system wide mime.types database (on Debian systems part of mime-support).
@<:@default=$sysconfdir/mime.types@:>@
]
)
if test -z $MIME_SUPPORT_MIME_TYPES_DATA_DB; then
AC_SUBST(
[MIME_SUPPORT_MIME_TYPES_DATA_DB],
[${sysconfdir}/mime.types]
)
fi
dnl --------------------------------------------------------------------------
dnl necessary checks
dnl --------------------------------------------------------------------------
dnl necessary checks and additions for freedesktop.org shared-mime-info
if test "x$with_freedesktop_mime" != "xno" ; then
AC_MSG_CHECKING([for shared-mime-info >= 0.12])
m4_ifdef(
[PKG_CHECK_EXISTS],
[PKG_CHECK_EXISTS(
[shared-mime-info >= 0.12],
[
AC_MSG_RESULT([yes])
CHEMICAL_MIME_DEPS="$CHEMICAL_MIME_DEPS shared-mime-info"
],
[
AC_MSG_RESULT([no])
AC_MSG_ERROR([shared-mime-info package missing.])
]
)
],
[
if ( $PKG_CONFIG shared-mime-info --atleast-version=0.12 ); then
AC_MSG_RESULT([yes])
CHEMICAL_MIME_DEPS="$CHEMICAL_MIME_DEPS shared-mime-info"
else
AC_MSG_RESULT([no])
AC_MSG_ERROR([shared-mime-info package missing.])
fi
]
)
AC_ARG_VAR(
[UPDATE_MIME_DATABASE],
[
The update-mime-database binary with path.
Use it to define or override the location of update-mime-database.
]
)
AC_PATH_PROG([UPDATE_MIME_DATABASE], [update-mime-database], [no])
AC_SUBST([UPDATE_MIME_DATABASE])
fi
AC_SUBST([CHEMICAL_MIME_DEPS])
dnl --------------------------------------------------------------------------
dnl conditions
dnl --------------------------------------------------------------------------
AM_CONDITIONAL([BOOL_FREEDESKTOP_MIME], [test "x$with_freedesktop_mime" != "xno"])
AC_MSG_CHECKING([if freedesktop.org shared MIME-info database file will be installed])
if test "x$with_freedesktop_mime" != "xno" ; then
AC_MSG_RESULT([yes])
AC_MSG_CHECKING([for installation path of the freedesktop.org shared MIME-info database files])
AC_MSG_RESULT([$with_freedesktop_mime])
else
AC_MSG_RESULT([no])
fi
AM_CONDITIONAL([BOOL_UPDATE_DATABASE], [test "x$enable_update_database" = "xyes" -a "x$UPDATE_MIME_DATABASE" != "xno" -a "x$with_freedesktop_mime" != "xno"])
AC_MSG_CHECKING([if update-mime-database will run])
if test "x$enable_update_database" = "xyes" \
-a "x$UPDATE_MIME_DATABASE" != "xno" \
-a "x$with_freedesktop_mime" != "xno" ; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
AM_CONDITIONAL([BOOL_GNOME_MIME], [test "x$with_gnome_mime" != "xno"])
AC_MSG_CHECKING([if old GNOME 2.4 MIME support files will be installed])
if test "x$with_gnome_mime" != "xno" ; then
AC_MSG_RESULT([yes])
AC_MSG_CHECKING([for installation path of the GNOME 2.4 support files])
AC_MSG_RESULT([$with_gnome_mime])
else
AC_MSG_RESULT([no])
fi
AM_CONDITIONAL([BOOL_KDE_MAGIC], [test "x$with_kde_magic" != "xno"])
AC_MSG_CHECKING([if KDE 3.x MIME magic files will be installed])
if test "x$with_kde_magic" != "xno" ; then
AC_MSG_RESULT([yes])
AC_MSG_CHECKING([for installation path of the KDE 3.x MIME magic files])
AC_MSG_RESULT([$with_kde_magic])
else
AC_MSG_RESULT([no])
fi
AM_CONDITIONAL([BOOL_KDE_MIME], [test "x$with_kde_mime" != "xno"])
AC_MSG_CHECKING([if KDE 3.x MIME definition files will be installed])
if test "x$with_kde_mime" != "xno" ; then
AC_MSG_RESULT([yes])
AC_MSG_CHECKING([for installation path of the KDE 3.x MIME definition files])
AC_MSG_RESULT([$with_kde_mime])
else
AC_MSG_RESULT([no])
fi
dnl --------------------------------------------------------------------------
dnl location determination
dnl --------------------------------------------------------------------------
if test "x$datarootdir" = "x" ; then
AC_SUBST(
[datarootdir],
[${datadir}]
)
fi
if test "x$docdir" = "x" ; then
AC_SUBST(
[docdir],
[m4_ifset(
[AC_PACKAGE_TARNAME],
[${datadir}'/doc/${PACKAGE_TARNAME}'],
[${datadir}'/doc/${PACKAGE}']
)
]
)
fi
if test "x$htmldir" = "x" ; then
AC_SUBST(
[htmldir],
['${docdir}']
)
fi
dnl --------------------------------------------------------------------------
dnl output
dnl --------------------------------------------------------------------------
AC_CONFIG_FILES([
chemical-mime-data.pc
Makefile
file/Makefile
freedesktop.org/Makefile
gnome/Makefile
html_docs/Makefile
kde/Makefile
mime-support/Makefile
po/Makefile.in
src/Makefile
test/Makefile
xsl/Makefile
xsl/cmd_entities.dtd
])
AC_OUTPUT