-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
422 lines (371 loc) · 12.7 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
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
AC_PREREQ(2.59)
m4_define([chupa_version_major], [1])
m4_define([chupa_version_minor], [0])
m4_define([chupa_version_micro], [0])
m4_define([chupa_version_full],
[chupa_version_major.chupa_version_minor.chupa_version_micro])
AC_INIT(chupatext, [chupa_version_full], [email protected])
CHUPA_VERSION_MAJOR=chupa_version_major
CHUPA_VERSION_MINOR=chupa_version_minor
CHUPA_VERSION_MICRO=chupa_version_micro
CHUPA_VERSION=chupa_version_full
version_txt=$(dirname $0)/version.txt
if test -f "$version_txt"; then
source "$version_txt"
else
CHUPA_N_COMMITS=0
CHUPA_COMMIT_ID=
CHUPA_RELEASE_DATE=0
fi
AC_SUBST(CHUPA_VERSION_MAJOR)
AC_SUBST(CHUPA_VERSION_MINOR)
AC_SUBST(CHUPA_VERSION_MICRO)
AC_SUBST(CHUPA_VERSION)
AC_SUBST(CHUPA_N_COMMITS)
AC_SUBST(CHUPA_COMMIT_ID)
AC_SUBST(CHUPA_RELEASE_DATE)
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_AUX_DIR([config])
AC_CONFIG_SRCDIR([chupatext.h])
AM_CONFIG_HEADER([chupatext/config.h])
PROJECT_NAME="Ranguba"
AC_SUBST(PROJECT_NAME)
AM_INIT_AUTOMAKE($PACKAGE_NAME, $PACKAGE_VERSION)
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
PACKAGE_TITLE=ChupaText
AC_SUBST(PACKAGE_TITLE)
AC_ENABLE_SHARED(yes)
AC_ENABLE_STATIC(no)
AC_PROG_LIBTOOL
LT_CURRENT=$CHUPA_VERSION_MAJOR
LT_REVISION=$CHUPA_VERSION_MINOR
LT_AGE=$CHUPA_VERSION_MICRO
LT_VERSION_INFO="$LT_CURRENT:$LT_REVISION:$LT_AGE"
AC_SUBST(LT_CURRENT)
AC_SUBST(LT_REVISION)
AC_SUBST(LT_AGE)
AC_SUBST(LT_VERSION_INFO)
LIBTOOL_EXPORT_OPTIONS='-export-symbols-regex "[^[Cc]hupa.*]"'
AC_SUBST(LIBTOOL_EXPORT_OPTIONS)
dnl IT_PROG_INTLTOOL
# Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
if test "x$GCC" = "xyes"; then
case " $CFLAGS " in
*[\ \ ]-Wall[\ \ ]*) ;;
*) CFLAGS="$CFLAGS -Wall" ;;
esac
case " $CFLAGS " in
*[\ \ ]-Wmissing-declarations[\ \ ]*) ;;
*) CFLAGS="$CFLAGS -Wmissing-declarations" ;;
esac
case " $CFLAGS " in
*[\ \ ]-Wmissing-prototypes[\ \ ]*) ;;
*) CFLAGS="$CFLAGS -Wmissing-prototypes" ;;
esac
case " $CFLAGS " in
*[\ \ ]-Wpointer-arith[\ \ ]*) ;;
*) CFLAGS="$CFLAGS -Wpointer-arith" ;;
esac
case " $CFLAGS " in
*[\ \ ]-Wcast-align[\ \ ]*) ;;
*) CFLAGS="$CFLAGS -Wcast-align" ;;
esac
fi
dnl **************************************************************
dnl Check for GLib
dnl **************************************************************
m4_ifdef([AM_PATH_GLIB_2_0], [
GLIB_REQUIRED=2.24.0
AC_SUBST(GLIB_REQUIRED)
AM_PATH_GLIB_2_0($GLIB_REQUIRED,
[ac_glib_available="yes"],
[ac_glib_available="no"],
[gobject gio])
],
[ac_glib_available="no"])
AC_MSG_CHECKING(for glib availablity)
AC_MSG_RESULT($ac_glib_available)
if test "$ac_glib_available" != "yes"; then
AC_MSG_ERROR([no glib available])
fi
dnl **************************************************************
dnl Check for GetText
dnl **************************************************************
AC_PROG_INTLTOOL([0.35.0])
AM_GLIB_GNU_GETTEXT
GETTEXT_PACKAGE=chupatext
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], ["$GETTEXT_PACKAGE"], [Gettext package])
dnl **************************************************************
dnl Check for Packages
dnl **************************************************************
PKG_CHECK_MODULES(GSF, libgsf-1, [have_gsf=yes], [have_gsf=no])
AM_CONDITIONAL([HAVE_GSF], [test "$have_gsf" = "yes"])
PKG_CHECK_MODULES(GIO_UNIX, gio-unix-2.0,
[have_gio_unix=yes], [have_gio_unix=no])
AM_CONDITIONAL([HAVE_GIO_UNIX], [test "$have_gio_unix" = "yes"])
PKG_CHECK_MODULES(POPPLER_GLIB, poppler-glib,
[have_poppler=yes], [have_poppler=no])
AM_CONDITIONAL([HAVE_POPPLER_GLIB], [test "$have_poppler" = "yes"])
PKG_CHECK_MODULES(WV, wv-1.0, [have_wv=yes], [have_wv=no])
AM_CONDITIONAL([HAVE_WV], [test "$have_wv" = "yes"])
PKG_CHECK_MODULES(GTK, gtk+-2.0, [have_gtk=yes], [have_gtk=no])
PKG_CHECK_MODULES(GOFFICE, libgoffice-0.8, [have_goffice=yes], [have_goffice=no])
AM_CONDITIONAL([HAVE_GOFFICE], [test "$have_goffice" = "yes"])
LIBS_SAVE="$LIBS"
LIBS="$LIBS $GOFFICE_LIBS"
AC_CHECK_LIB([spreadsheet], [go_data_cache_get_type],
[have_gnumeric=yes], [have_gnumeric=no])
LIBS="$LIBS_SAVE"
AM_CONDITIONAL([HAVE_GNUMERIC], [test "$have_gnumeric" = "yes"])
dnl **************************************************************
dnl Check for Ruby
dnl **************************************************************
ruby_available="no"
AC_ARG_WITH([ruby],
AS_HELP_STRING([--with-ruby=PATH],
[Ruby interpreter path (default: auto-detect)]),
[RUBY="$withval"])
if test "$RUBY" != "no"; then
AC_PATH_PROG(RUBY, ruby, none)
if test "$RUBY" != "none"; then
ruby_available="yes"
fi
fi
AC_MSG_CHECKING([for Ruby availability])
AC_MSG_RESULT($ruby_available)
RBCONFIG="$RUBY -rrbconfig"dnl
AC_DEFUN([RUBY_CONFIG],dnl
[dnl
AS_VAR_PUSHDEF([rbcv], m4_ifval([$2], [$2],
m4_bmatch([$1],
[ruby], [$1], [RUBY], [$1],
[^[a-z]], [ruby]$1,
[RUBY_]$1)))dnl
if test $ruby_available = yes; then
AC_MSG_CHECKING([for RbConfig[[$1]]])
rbcv=`[$RBCONFIG] m4_ifval([$3], [-e ['%w{$3}.each{|k|k,v=k.split(/=/,2);RbConfig::MAKEFILE_CONFIG[k]=v}']])\
[-e 'puts RbConfig.expand(RbConfig::MAKEFILE_CONFIG["$1"]||abort, RbConfig::MAKEFILE_CONFIG).strip'] 2>&1` || \
ruby_available=no
AC_MSG_RESULT($rbcv)
if test $ruby_available = no; then
AC_MSG_WARN(Ruby disabled)
fi
fi dnl
AS_VAR_POPDEF([rbcv])dnl
])
RUBY_CONFIG(rubyhdrdir)
RUBY_CONFIG(arch)
RUBY_CONFIG(CFLAGS, [], [ARCH_FLAG=])
RUBY_CONFIG(CPPFLAGS)
RUBY_CONFIG(LDFLAGS, [], [ARCH_FLAG=])
RUBY_CONFIG(DLDFLAGS)
RUBY_CONFIG(LIBS)
RUBY_CONFIG(LIBRUBYARG)
RUBY_CONFIG(ARCH_FLAG)
RUBY_CPPFLAGS="$RUBY_CPPFLAGS -I$rubyhdrdir/$rubyarch -I$rubyhdrdir"
RUBY_LDFLAGS="$LIBRUBYARG $RUBY_LDFLAGS $RUBY_DLDFLAGS"
AC_SUBST(RUBY_CFLAGS)
AC_SUBST(RUBY_CPPFLAGS)
AC_SUBST(RUBY_LDFLAGS)
AC_SUBST(RUBY_LIBS)
AC_SUBST(RUBY_ARCH_FLAG)
AC_SUBST(rubyarch)
if test "$ruby_available" = "yes"; then
AC_MSG_CHECKING([for Ruby/GLib2 CFLAGS])
RUBY_GLIB2_CFLAGS=$($RUBY -e '
ruby_glib2_gem = Gem::Specification.find_by_name("glib2")
if ruby_glib2_gem.nil?
begin
require "glib2"
ruby_glib2_path = $".grep(/glib2\.(?!rb\z)\w+\z/).first
exit(false) if ruby_glib2_path.nil?
print("-I", File.dirname(ruby_glib2_path))
exit(true)
rescue LoadError
exit(false)
end
end
ruby_glib2_path = ruby_glib2_gem.full_gem_path
print("-I", File.join(ruby_glib2_path, "ext", "glib2"))')
if test $? -ne 0; then
ac_ruby_available="no"
fi
AC_MSG_RESULT($RUBY_GLIB2_CFLAGS)
if test "$ac_ruby_available" = "no"; then
AC_MSG_ERROR([no Ruby/GLib2 available])
fi
AC_SUBST(RUBY_GLIB2_CFLAGS)
fi
AM_CONDITIONAL([HAVE_RUBY], [test "$ruby_available" = "yes"])
dnl **************************************************************
dnl Check for supported formats
dnl **************************************************************
if test "$ruby_available" = "yes"; then
supported_by_ruby_decomposer="dynamic"
else
supported_by_ruby_decomposer="no"
fi
support_text="yes"
support_word="$have_wv"
AM_CONDITIONAL([SUPPORT_WORD], [test "$support_word" = "yes"])
if test "$have_goffice" = "yes" -a "$have_gnumeric" = "yes"; then
support_excel=yes
else
support_excel=no
fi
AM_CONDITIONAL([SUPPORT_EXCEL], [test "$support_excel" = "yes"])
support_power_point="$supported_by_ruby_decomposer"
support_pdf="$have_poppler"
AM_CONDITIONAL([SUPPORT_PDF], [test "$support_pdf" = "yes"])
support_html="$supported_by_ruby_decomposer"
support_xml="$supported_by_ruby_decomposer"
support_gzip="$have_gsf"
AM_CONDITIONAL([SUPPORT_GZIP], [test "$support_gzip" = "yes"])
support_zip="$have_gsf"
AM_CONDITIONAL([SUPPORT_ZIP], [test "$support_zip" = "yes"])
dnl **************************************************************
dnl Checks for RD2
dnl **************************************************************
AC_ARG_WITH([rd2],
AS_HELP_STRING([--with-rd2=PATH],
[rd2 path (default: auto-detect)]),
[RD2="$withval"])
if test "$RD2" = "no"; then
RD2=rd2-not-found
elif test "$RD2" = ""; then
AC_PATH_PROG(RD2, rd2, rd2-not-found)
else
AC_CHECK_FILE([$RD2],
[],
[AC_PATH_PROG(RD2, $RD2, rd2-not-found)])
fi
AM_CONDITIONAL([HAVE_RD2], [test "$RD2" != "rd2-not-found"])
dnl **************************************************************
dnl Checks for gtk-doc
dnl **************************************************************
GTK_DOC_CHECK([1.8])
dnl **************************************************************
dnl Check for Cutter
dnl **************************************************************
m4_ifdef([AC_CHECK_GCUTTER], [
AC_CHECK_GCUTTER(>= 1.1.5)
],
[ac_cv_use_cutter="no"])
AM_CONDITIONAL([WITH_CUTTER], [test "$ac_cv_use_cutter" != "no"])
if test "$ac_cv_use_cutter" != "no"; then
AC_DEFINE(WITH_CUTTER, 1, [Define to 1 if you use Cutter])
fi
m4_ifdef([AC_CHECK_COVERAGE], [AC_CHECK_COVERAGE])
GENHTML_OPTIONS="--title 'chupatext Code Coverage'"
# Check for RubyForge
RUBYFORGE_PROJECT_NAME="groonga"
AC_SUBST(RUBYFORGE_PROJECT_NAME)
AC_ARG_WITH([rubyforge-user],
AS_HELP_STRING([--with-rubyforge-user=USER],
[User name on RubyFroge (default: $USER)]),
[RUBYFORGE_USER="$withval"],
[RUBYFORGE_USER="$USER"])
AC_SUBST(RUBYFORGE_USER)
RUBYFORGE_PATH="/var/www/gforge-projects/\$(RUBYFORGE_PROJECT_NAME)"
AC_SUBST(RUBYFORGE_PATH)
RSYNC_PATH="\$(RUBYFORGE_USER)@rubyforge.org:\$(RUBYFORGE_PATH)"
AC_SUBST(RSYNC_PATH)
modulesdir='$(pkglibdir)/modules'
AC_SUBST(modulesdir)
decomposersdir='$(modulesdir)/decomposers'
AC_SUBST(decomposersdir)
ruby_libdir='$(pkglibdir)/ruby'
AC_SUBST(ruby_libdir)
ruby_lib_chupatextdir='$(ruby_libdir)/chupatext'
AC_SUBST(ruby_lib_chupatextdir)
ruby_decomposersdir='$(ruby_lib_chupatextdir)/decomposers'
AC_SUBST(ruby_decomposersdir)
descriptionsdir='$(sysconfdir)/$(PACKAGE)/descriptions'
AC_SUBST(descriptionsdir)
AC_SUBST(build_includedir, '$(top_build_prefix)')
AC_SUBST(top_includedir, '$(top_srcdir)')
AC_CONFIG_FILES([Makefile
chupatext.pc
chupatext-excel.pc
chupatext-pdf.pc
chupatext-ruby.pc
chupatext-tar.pc
chupatext-text.pc
chupatext-word.pc
chupatext-zip.pc
chupatext-gzip.pc
po/Makefile.in
build/Makefile
data/Makefile
data/descriptions/Makefile
chupatext/Makefile
chupatext/chupa_version.h
test/Makefile
test/fixtures/Makefile
test/fixtures/html/Makefile
test/fixtures/word/Makefile
test/fixtures/open_document_text/Makefile
test/fixtures/excel/Makefile
test/fixtures/open_document_spreadsheet/Makefile
test/fixtures/powerpoint/Makefile
test/fixtures/open_document_presentation/Makefile
test/ruby/Makefile
modules/Makefile
modules/excel/Makefile
modules/ruby/Makefile
modules/ruby/lib/Makefile
modules/ruby/lib/chupatext/Makefile
modules/ruby/lib/chupatext/decomposers/Makefile
license/Makefile
misc/Makefile
doc/Makefile
doc/reference/Makefile
doc/reference/version.xml
apt/Makefile])
AC_OUTPUT
echo
echo "Configure Result:"
echo
echo " Options:"
echo " coverage : $cutter_enable_coverage"
echo
echo " Libraries:"
echo " GLib : $ac_glib_available"
echo " GSF : $have_gsf"
echo " GIO Unix : $have_gio_unix"
echo " Poppler : $have_poppler"
echo " wvWare : $have_wv"
echo " GTK+ : $have_gtk"
echo " GOffice : $have_goffice"
echo " Gnumeric : $have_gnumeric"
echo " Ruby : $ruby_available ($RUBY)"
echo
echo " Supported formats:"
echo " Plain text : $support_text"
echo " Word : $support_word"
echo " Excel : $support_excel"
echo " PowerPoint : $support_power_point"
echo " PDF : $support_pdf"
echo " HTML : $support_html"
echo " XML : $support_xml"
echo " gzip : $support_gzip"
echo " ZIP : $support_zip"
echo
echo " Paths:"
echo " modules directory : $modulesdir"
echo " decomposers directory : $decomposersdir"
echo " Ruby decomposers directory : $ruby_decomposersdir"
echo " descriptions directory : $descriptionsdir"
echo
echo " Tools:"
echo " GTK-Doc : $enable_gtk_doc"
echo " rd2 : $RD2"
if test "$cutter_enable_coverage" = "yes"; then
echo " lcov : $LCOV"
echo " genhtml : $GENHTML"
fi