Update Spanish translation
[gnumeric.git] / configure.ac
blob49d1411024ba6e7c4b2b9d7367c7b0c6090c9f7f
1 -*- mode: m4 -*-
2 dnl We require Automake 1.7.2, which requires Autoconf 2.54.
3 dnl (It needs _AC_AM_CONFIG_HEADER_HOOK, for example.)
4 AC_PREREQ(2.54)
5 AC_CONFIG_MACRO_DIR([m4])
6 AX_IS_RELEASE([git-directory])
8 m4_define([gnumeric_version_epoch], [1])
9 m4_define([gnumeric_version_major], [12])
10 m4_define([gnumeric_version_minor], [44])
11 m4_define([gnumeric_version_extra], [])
12 m4_define([gnumeric_version_full],
13     [gnumeric_version_epoch.gnumeric_version_major.gnumeric_version_minor[]gnumeric_version_extra])
15 dnl Emphasize some of the checks.
16 m4_define([BIG_CHECKING], [AC_MSG_CHECKING([
17 ======== $1])])
19 AC_INIT([gnumeric], [gnumeric_version_full],
20         [https://gitlab.gnome.org/GNOME/gnumeric/issues],,
21         [http://www.gnumeric.org/])
23 AC_CONFIG_SRCDIR(src/sheet.h)
24 AM_INIT_AUTOMAKE([dist-bzip2])
26 dnl Version info for libraries = CURRENT:REVISION:AGE
27 dnl
28 dnl Within each x.y.*, ABI is maintained backward and _forward_ compatible.
29 dnl (As a consequence, no exported function may be added.)
30 dnl So it's enough to have one interface number per each x.y.* branch.
31 dnl
32 dnl OTOH, we are not able to keep ABI strictly backward compatible throughout
33 dnl the whole x.*.*.
34 dnl The easiest way is to declare no ABI compatibility, ie. AGE is always 0.
35 dnl
36 m4_define([version_iface],
37         m4_eval(100 * gnumeric_version_epoch + gnumeric_version_major))
39 AC_SUBST([VERSION_INFO], [version_iface:gnumeric_version_minor:0])
40 AC_SUBST([VERSION_IFACE], [version_iface])
42 if test `expr gnumeric_version_major % 2` -eq 1; then
43     AC_MSG_NOTICE([NOTE: This is a development release])
44     gnumeric_devel=yes
45     gnumeric_api_ver=gnumeric_version_epoch.`expr gnumeric_version_major + 1`
46     dnl An explicit version number should be used in place of the above
47     dnl if the epoch is to change.
48     dnl gnumeric_api_ver=2.0
49 else
50     gnumeric_devel=no
51     gnumeric_api_ver=gnumeric_version_epoch.gnumeric_version_major
53 gnumeric_api_ver_=`echo $gnumeric_api_ver | sed -e 's/\./_/g'`
55 dnl Almost like epoch.major but development versions look forward to the next
56 dnl stable release.
57 AC_SUBST([GNUMERIC_API_VER], [$gnumeric_api_ver])
58 AC_SUBST([GNUMERIC_API_VER_], [$gnumeric_api_ver_])
60 dnl This one is created by autoheader, ...
61 AC_CONFIG_HEADERS(gnumeric-config.h)
63 dnl ... and this one is a small subset, maintained manually,
64 dnl which will be installed.
65 AC_CONFIG_HEADERS(gnumeric-features.h)
66 dnl
67 dnl Make sure these two won't clash.  Put the following to gnumeric-config.h:
68 AH_BOTTOM([/* Don't include gnumeric-features.h, it's a subset of gnumeric-config.h. */
69 #define GNUMERIC_FEATURES_H])
71 AM_MAINTAINER_MODE([enable])
73 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
75 dnl AX_REQUIRE_DEFINED([GTK_DOC_CHECK])
76 GTK_DOC_CHECK
78 dnl We use a LINGUAS file, so we need intltool >= 0.35:
79 IT_PROG_INTLTOOL([0.35.0])
80 IT_PO_SUBDIR(po-functions)
82 dnl We use $host and $host_os:
83 AC_CANONICAL_HOST
85 AC_ISC_POSIX
86 AC_PROG_CC
87 AC_PROG_CC_C99
88 if test "$ac_cv_prog_cc_c99" = no; then
89         AC_MSG_ERROR([*** c99 is required])
92 AC_PROG_YACC
93 if test "x$ac_cv_prog_YACC" = x; then
94         AC_MSG_ERROR([*** bison or equivalent is required])
97 AC_PROG_LN_S
98 AC_HEADER_STDC
100 LT_PREREQ([2.2.6])
101 # Make --disable-static the default
102 LT_INIT([disable-static])
104 dnl Propagate Gnome-specific variable ACLOCAL_FLAGS to Makefile.
105 AC_SUBST(ACLOCAL_AMFLAGS, $ACLOCAL_FLAGS)
107 dnl *****************************
108 # Check for zlib.
110 dnl zlib is needed for the excel plugin; see plugins/excel/Makefile.am
112 _cppflags="${CPPFLAGS}"
113 _ldflags="${LDFLAGS}"
115 AC_ARG_WITH(zlib,
116         AS_HELP_STRING([--with-zlib=DIR], [use libz in DIR]),
117         [case $withval in
118          yes|no) ;;
119          *)     Z_DIR=$withval
120                 CPPFLAGS="${CPPFLAGS} -I$withval/include"
121                 LDFLAGS="${LDFLAGS} -L$withval/lib"
122                 ;;
123          esac])
125 if test "x$with_zlib" != xno; then
126         with_zlib=no
127         AC_CHECK_HEADER(zlib.h, [AC_CHECK_LIB(z, gzread, [with_zlib=yes])])
130 if test "$with_zlib" = no; then
131         AC_MSG_ERROR([*** zlib is required])
134 if test "x${Z_DIR}" != "x"; then
135         Z_CPPFLAGS="-I${Z_DIR}/include"
136         case ${host} in
137         *-*-solaris*)   Z_LIBS="-L${Z_DIR}/lib -R${Z_DIR}/lib -lz" ;;
138         *)              Z_LIBS="-L${Z_DIR}/lib -lz" ;;
139         esac
140 else
141         Z_LIBS="-lz"
143 AC_SUBST(Z_CPPFLAGS)
144 AC_SUBST(Z_LIBS)
146 CPPFLAGS=${_cppflags}
147 LDFLAGS=${_ldflags}
149 dnl **********
150 dnl * Goffice
151 dnl **********
152 # Goffice releases are parallel installable, which do we depend on
153 GOFFICE_API_VER="0.10"
154 AC_SUBST(GOFFICE_API_VER)
155 # Components
156 GOFFICE_PLUGINS_DIR=`pkg-config --variable=PluginDir libgoffice-${GOFFICE_API_VER}`
157 AC_SUBST(GOFFICE_PLUGINS_DIR)
158 GOFFICE_VERSION=`pkg-config --modversion libgoffice-${GOFFICE_API_VER}`
159 AC_SUBST(GOFFICE_VERSION)
162 dnl PKG_PROG_PKG_CONFIG is expanded just before the first occurrence of
163 dnl PKG_CHECK_MODULES.  Since this is inside an `if,' it can escape
164 dnl execution.  Thus we need an explicit call:
165 PKG_PROG_PKG_CONFIG(0.18)
167 dnl *****************************
168 libspreadsheet_reqs="
169         libgoffice-${GOFFICE_API_VER}   >= 0.10.42
170         libgsf-1                >= 1.14.33
171         libxml-2.0              >= 2.4.12
173 gnumeric_reqs="$libspreadsheet_reqs
174         glib-2.0                >= 2.40.0
175         gobject-2.0             >= 2.40.0
176         gmodule-2.0             >= 2.40.0
177         gthread-2.0             >= 2.40.0
178         pango                   >= 1.24.0
179         pangocairo              >= 1.24.0
181 libspreadsheet_gtk_reqs="
182         gtk+-3.0                >= 3.8.7
185 gnumeric_gtk_reqs="$libspreadsheet_gtk_reqs"
187 ui_msg=
189 with_win32=no
190 case $host_os in
191 mingw* | pw32* | cygwin*)
192     with_win32=yes
193     ;;
194 esac
196 dnl *******************
197 dnl Should we use gtk ?
198 dnl *******************
199 gnumeric_with_gtk=true
200 AC_ARG_WITH(gtk, AS_HELP_STRING([--without-gtk], [Build without UI]))
201 if test "x$with_gtk" = xno; then
202         ui_msg="None (Gtk disabled by request)"
203         gnumeric_with_gtk=false
204         AC_MSG_ERROR([configuration without gtk+ currently does not work])
205 else
206         dnl We shouldn't silently default to --without-gtk.
207         dnl If the requirements are not met, fail.
208         ui_msg="Gtk"
209         PKG_CHECK_MODULES(GTK, [$libspreadsheet_gtk_reqs])
210         PKG_CHECK_MODULES(GTK, [$gnumeric_gtk_reqs])
213 if test "x$gnumeric_with_gtk" = xtrue ; then
214         AC_DEFINE(GNM_WITH_GTK, 1, [Define if UI is built])
215         libspreadsheet_reqs="$libspreadsheet_reqs $libspreadsheet_gtk_reqs"
216         gnumeric_reqs="$gnumeric_reqs $gnumeric_gtk_reqs"
219 AM_CONDITIONAL(WITH_GTK,   $gnumeric_with_gtk)
221 dnl ****************************
222 dnl now that we have selected out libraries the whole collection in one
223 dnl shot so that we can have a nice neat compile/link line
224 dnl ****************************
226 PKG_CHECK_MODULES(LIBSPREADSHEET, $libspreadsheet_reqs)
227 AC_SUBST(LIBSPREADSHEET_LIBS)
228 AC_SUBST(LIBSPREADSHEET_CFLAGS)
230 PKG_CHECK_MODULES(GNUMERIC, $gnumeric_reqs)
231 AC_SUBST(GNUMERIC_LIBS)
232 AC_SUBST(GNUMERIC_CFLAGS)
234 # We don't attempt to track gtk+4, so disable the very noise warnings
235 CFLAGS="$CFLAGS -DGDK_DISABLE_DEPRECATION_WARNINGS -DGTK_DISABLE_DEPRECATION_WARNINGS"
237 with_native_win32=no
238 case $host_os in
239 mingw* | pw32*)
240     with_native_win32=yes
241     AC_ARG_VAR(WINDRES, [The windres executable (used by win32 builds only).])
242     AC_CHECK_TOOL(WINDRES, windres, :)
243     ;;
244 esac
245 AM_CONDITIONAL(WITH_WIN32, test $with_win32 = yes)
246 AM_CONDITIONAL(WITH_NATIVE_WIN32, test $with_native_win32 = yes)
247 AM_CONDITIONAL(CROSS_COMPILING, test x"$cross_compiling" != xno)
249 if test "x$with_win32" = "xyes"; then
250     GNUMERIC_PLUGIN_LDFLAGS="-avoid-version -no-undefined $GNUMERIC_LIBS -Wl,--enable-runtime-pseudo-reloc,--export-all-symbols \$(top_builddir)/src/libspreadsheet.la -s"
251 else
252     GNUMERIC_PLUGIN_LDFLAGS="-avoid-version"
254 AC_SUBST(GNUMERIC_PLUGIN_LDFLAGS)
256 dnl **************************************************
257 dnl This needs to be done before we add aggressive -Werror=foo flags
258 dnl below.
259 AC_SUBST(GETTEXT_PACKAGE, gnumeric-${VERSION})
260 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",
261         [The package name, for gettext])
262 AM_GLIB_GNU_GETTEXT
264 dnl ****************************
265 dnl prep the pixmap generator
266 dnl ****************************
268 AC_ARG_VAR(GLIB_GENMARSHAL, [The glib-genmarshal executable.])
269 AC_CHECK_PROG(GLIB_GENMARSHAL, glib-genmarshal$ac_exeext, glib-genmarshal$ac_exeext)
270 GLIB_COMPILE_RESOURCES=`$PKG_CONFIG --variable=glib_compile_resources gio-2.0`
271 AC_SUBST(GLIB_COMPILE_RESOURCES)
273 AC_ARG_VAR(GDK_PIXBUF_CSOURCE, [The gdk-pixbuf-csource executable.])
274 AC_CHECK_PROG(GDK_PIXBUF_CSOURCE, gdk-pixbuf-csource$ac_exeext, gdk-pixbuf-csource$ac_exeext)
276 AC_ARG_ENABLE(component,
277   AS_HELP_STRING([--disable-component], [Do not build the goffice component]),
278   [], [enable_component=yes])
279 component_dir=""
280 if test x"$enable_component" = xyes; then
281         component_dir="component"
282 else
283         component_dir=""
285 AC_SUBST(COMPONENT_DIR, $component_dir)
287 dnl ****************************
288 dnl GDA Plugin
289 dnl ****************************
290 try_gda=true
291 gda_msg=yes
292 gnomedb_msg=no
293 AC_ARG_WITH(gda,
294         AS_HELP_STRING([--with-gda], [Compile the Gnome Database Access plugin]),
295         if test "x$withval" != xyes; then
296                 try_gda=false
297                 gda_msg="Disabled by request"
298         fi
300 if test "$try_gda" = true; then
301         PKG_CHECK_MODULES(GDA, [libgda-5.0 >= 5.0.0, libgda-ui-5.0 >= 5.0.0],
302                 [gda_msg=yes],
303                 [gda_msg="NO.  libgda problem"])
304         if test "$gda_msg" = yes; then
305                 PKG_CHECK_MODULES(GNOMEDB, [libgnomedb-4.0 >= 3.99.6],
306                         [gnomedb_msg="yes"],
307                         [gnomedb_msg="NO. libgnomedb problem"])
308                 if test "$gnomedb_msg" = yes; then
309                         AC_DEFINE(HAVE_LIBGNOMEDB, 1, [ Define if libgnomedb support is compiled in])
310                 fi
311         fi
313 AM_CONDITIONAL(WITH_GDA, test x"$gda_msg" = xyes)
314 AC_SUBST(GDA_CFLAGS)
315 AC_SUBST(GDA_LIBS)
317 AM_CONDITIONAL(WITH_GNOMEDB, test x"$gnomedb_msg" = xyes)
318 AC_SUBST(GNOMEDB_CFLAGS)
319 AC_SUBST(GNOMEDB_LIBS)
321 dnl ****************************
323 AC_CHECK_DECL(fdopen, fdopen_works=yes, fdopen_works=no)
325 if test $fdopen_works = no ; then
326         unset ac_cv_have_decl_fdopen
327         CFLAGS="$CFLAGS -D_POSIX_SOURCE"
328         AC_MSG_NOTICE([adding -D_POSIX_SOURCE to CFLAGS])
329         AC_CHECK_DECL(fdopen, fdopen_works=yes, fdopen_works=no)
330         if test $fdopen_works = no ; then
331                 AC_MSG_ERROR([fdopen is not available])
332         fi
335 # Unfortunately, -D_POSIX_SOURCE turns off struct timeval on Solaris
336 AC_MSG_CHECKING([whether struct timeval is available])
337 AC_COMPILE_IFELSE(
338         [AC_LANG_PROGRAM([[#include <sys/time.h>]], [[struct timeval tv;]])],
339         [struct_timeval_works=yes],
340         [struct_timeval_works=no])
341 AC_MSG_RESULT($struct_timeval_works)
343 if test $struct_timeval_works = no ; then
344         CFLAGS="$CFLAGS -D__EXTENSIONS__"
345         AC_MSG_CHECKING([whether struct timeval is available with -D__EXTENSIONS__])
346         AC_COMPILE_IFELSE(
347                 [AC_LANG_PROGRAM([[#include <sys/time.h>]], [[struct timeval tv;]])],
348                 [struct_timeval_works=yes],
349                 [struct_timeval_works=no])
350         AC_MSG_RESULT($struct_timeval_works)
351         if test $struct_timeval_works = no ; then
352                 AC_MSG_ERROR([struct timeval is not available])
353         fi
356 dnl src/functions/fn-math.c uses M_PI
358 AC_MSG_CHECKING([whether M_PI is available])
359 AC_COMPILE_IFELSE(
360         [AC_LANG_PROGRAM([[#include <math.h>]], [[double f = M_PI]])],
361         [works_without_bsd_source=yes],
362         [works_without_bsd_source=no])
363 AC_MSG_RESULT($works_without_bsd_source)
365 if test $works_without_bsd_source = no ; then
366         CFLAGS="$CFLAGS -D_BSD_SOURCE"
367         AC_MSG_CHECKING([whether M_PI is available with -D_BSD_SOURCE])
368         AC_COMPILE_IFELSE(
369                 [AC_LANG_PROGRAM([[#include <math.h>]], [[double f = M_PI]])],
370                 [m_pi_works=yes],
371                 [m_pi_works=no])
372         AC_MSG_RESULT($m_pi_works)
373         if test $m_pi_works = no ; then
374                 AC_MSG_ERROR([M_PI is not available])
375         fi
379 AC_SUBST(GUILE_LIBS)
380 AC_SUBST(GUILE_INCS)
382 dnl Comment out the guile block:
383 ifelse([
384 dnl check for guile 1.5
385 try_guile=false
386 guile_msg="disabled pending some guile developer interest"
387 enable_guile=false
388 AC_ARG_WITH(guile,
389         AS_HELP_STRING([--with-guile], [Compile with Guile support or without it]),
390         if test "x$withval" = xyes; then
391                 try_guile=true
392         fi
394 if $try_guile; then
395         AC_MSG_CHECKING(for guile >= 1.5)
396         if test "`guile -c '(display (string>=? (version) "1.4.1"))'`" != "#t"; then
397                 AC_MSG_RESULT([Your Guile is too old.  You need Guile 1.5 or later.])
398         else
399                 AC_MSG_RESULT(found)
400                 guile_msg="yes"
401                 enable_guile=true
402         fi
404 if $enable_guile; then
405         GNOME_CHECK_GUILE
407 AM_CONDITIONAL(WITH_GUILE, $enable_guile)
410 dnl **************************************************
411 dnl * psiconv support
412 dnl **************************************************
414 AC_ARG_WITH(psiconv,
415         AS_HELP_STRING([--without-psiconv], [Compile without Psiconv support]))
416 AC_ARG_VAR(PSICONV_CONFIG, [The psiconv-config executable.])
417 if test "x$with_psiconv" != xno; then
418     AC_CHECK_PROG(PSICONV_CONFIG,psiconv-config,psiconv-config)
419     if test x"$PSICONV_CONFIG" = x; then
420         psiconv_msg="missing dependencies"
421     else
422         AC_MSG_CHECKING(for psiconv >= 0.9.3)
423         if $PSICONV_CONFIG --version | awk -F. \
424                 '{exit !($1 > 0 || $2 > 9 || ($2 == 9 && $3 >= 3))}'
425         then
426             PSICONV_CFLAGS=`$PSICONV_CONFIG --cflags`
427             PSICONV_LIBS=`$PSICONV_CONFIG --libs`
428             psiconv_msg=yes
429         else
430             psiconv_msg=no
431         fi
432         AC_MSG_RESULT($psiconv_msg)
433     fi
434 else
435     psiconv_msg=no
437 AM_CONDITIONAL(WITH_PSICONV, test "x$psiconv_msg" = xyes)
438 AC_SUBST(PSICONV_LIBS)
439 AC_SUBST(PSICONV_CFLAGS)
441 try_paradox=true
442 enable_paradox=false
443 AC_ARG_WITH(paradox,
444         AS_HELP_STRING([--without-paradox], [Compile without Paradox support]),
445         if test "x$withval" = xno; then
446                 try_paradox=false
447         fi
450 if $try_paradox; then
451         PKG_CHECK_MODULES(PARADOX,
452                 [pxlib >= 0.4.0],
453                 [paradox_msg="yes"],
454                 [paradox_msg="missing dependencies"])
457 if test "x$paradox_msg" = xyes; then
458         SAVE_LIBS="$LIBS"
459         LIBS="$LIBS $PARADOX_LIBS"
460         AC_CHECK_FUNC(PX_open_gsf,[ enable_paradox=true ],)
461         LIBS="$SAVE_LIBS"
462         unset SAVE_LIBS
464 AM_CONDITIONAL(WITH_PARADOX, $enable_paradox)
465 AC_SUBST(PARADOX_LIBS)
466 AC_SUBST(PARADOX_CFLAGS)
468 plugin_list_given=false
469 PLUGIN_LIST=""
470 AC_ARG_ENABLE(plugins,
471         AS_HELP_STRING([--enable-plugins="text html"], [Compile only the listed plugins]),
472         [plugin_list_given=true
473          test "x$enableval" != xno && PLUGIN_LIST=$enableval
475 AM_CONDITIONAL(PLUGIN_LIST_GIVEN, $plugin_list_given)
476 AC_SUBST(PLUGIN_LIST)
478 POFILES_FULL=
479 for lang in $ALL_LINGUAS; do
480     POFILES_FULL="$POFILES_FULL \$(top_srcdir)/po/$lang.po"
481 done
482 AC_SUBST(POFILES_FULL)
485 dnl Code to handle po-functions/Makefile* and po-functions/POTFILES*
487 dnl First, let me document how the po/ directory is dealt with.
488 dnl Dark mysteries here, so skip the next paragraph if you don't have enough
489 dnl holy water at your hand.  You have been warned.
491 dnl AM_GLIB_GNU_GETTEXT creates an incorrect incarnation of po/POTFILES, as
492 dnl glib-gettext.m4 doesn't know about intltool tags.  Later on, just before
493 dnl config.status is created, a code originating from intltool.m4 creates
494 dnl POTFILES again, this time correctly removing the intltool tags.
495 dnl config.status then creates po/Makefile, again in two steps.  First,
496 dnl po/Makefile.in is created from po/Makefile.in.in the usual way, and then
497 dnl a code registered via the obsolete macro AC_OUTPUT_COMMANDS insterts the
498 dnl contents of file POTFILES to po/Makefile.
500 dnl But both glib-gettext and intltool have the dirname "po/" hardwired, so
501 dnl we are on our own with po-functions.
503 dnl We use a more straightforward approach for po-functions:
504 dnl 1) We create POTFILES immediately here.
505 dnl 2) We let config.status to create Makefile.in.
506 dnl 3) We use AC_CONFIG_COMMANDS to create Makefile.
508 [# Create po-functions/POTFILES:
509 if test -d po-functions; then
510         rm -f po-functions/POTFILES
511 else
512         mkdir po-functions
514 case "$srcdir" in
515         .)  top_srcdir=.. ;;
516         [\\/]* | ?:[\\/]* )  # Absolute name.
517                 top_srcdir="$srcdir" ;;
518         *)  top_srcdir="../$srcdir" ;;
519 esac
520 sed <$srcdir/po-functions/POTFILES.in -e '/^#/d' -e 's/^[[].*[]] *//' \
521          -e '/^[   ]*$/d' -e "s,^,       $top_srcdir/," | \
522         sed -e '$!s/$/ \\/' >po-functions/POTFILES
524 dnl Finally, register for creation of po-functions/Makefile:
525 dnl We do not currently do anything here.
526 AC_CONFIG_COMMANDS(po-functions/Makefile,
527   [cp po-functions/Makefile.in po-functions/Makefile])
529 SAVE_LIBS="$LIBS"
530 LIBS="$LIBS $GNUMERIC_LIBS"
531 AC_CHECK_FUNCS(mkfifo)
532 LIBS="$SAVE_LIBS"
533 unset SAVE_LIBS
535 AC_HEADER_SYS_WAIT
537 dnl Check for some functions
538 AC_CHECK_FUNCS(uname setenv putenv)
540 dnl FIXME: Does this really belong here?
541 AC_CHECK_FUNC(bind_textdomain_codeset,,[AC_CHECK_LIB(intl,bind_textdomain_codeset)])
543 dnl check for complete locale implementation
544 AC_CHECK_HEADERS(langinfo.h)
546 dnl check for rlimit
547 AC_CHECK_HEADERS(sys/resource.h)
549 dnl we need to check fpu mode
550 AC_CHECK_HEADERS(fpu_control.h)
552 SAVE_CFLAGS=$CFLAGS
553 SAVE_LIBS=$LIBS
554 CFLAGS="$CFLAGS $GNUMERIC_CFLAGS"
555 LIBS="$GNUMERIC_LIBS $LIBS"
557 AC_CHECK_FUNCS(gtk_cell_renderer_text_get_background_set gtk_cell_renderer_text_get_foreground_set gtk_cell_renderer_text_get_editable)
558 AC_CHECK_FUNCS(gtk_entry_set_editing_cancelled gtk_icon_theme_add_resource_path)
560 AC_MSG_CHECKING([for OO_NS_LOCALC_EXT])
561 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <gsf/gsf.h>]],
562                                 [[(void)(OO_NS_LOCALC_EXT == OO_NS_LOCALC_EXT);]])],
563                [AC_DEFINE(HAVE_OO_NS_LOCALC_EXT, 1, [Define if OO_NS_LOCALC_EXT is available])
564                 AC_MSG_RESULT(yes)],
565                [AC_MSG_RESULT(no)])
567 CFLAGS=$SAVE_CFLAGS
568 LIBS=$SAVE_LIBS
570 dnl We supply our own lgamma and lgamma_r when missing.
571 supply_lgamma_r=yes
572 AC_CHECK_FUNCS(lgamma_r)
573 if test $ac_cv_func_lgamma_r = no; then
574   AC_CHECK_LIB(m, lgamma_r,
575         [AC_DEFINE(HAVE_LGAMMA_R, 1,
576                 [Define if the lgamma_r function is available]
577          )
578          supply_lgamma_r=no
579          LIBS="$LIBS -lm"])
580 else
581   supply_lgamma_r=no
583 if test $supply_lgamma_r = yes; then
584    AC_DEFINE(GNM_SUPPLIES_LGAMMA_R, 1,
585         [Define if Gnumeric supplies the lgamma_r function]
586         )
588 AC_CHECK_FUNCS(lgamma)
589 if test $ac_cv_func_lgamma = no; then
590    AC_DEFINE(GNM_SUPPLIES_LGAMMA, 1,
591         [Define if Gnumeric supplies the lgamma function]
592         )
595 cos_works=yes
596 AC_MSG_CHECKING([cos is reliable])
597 AC_RUN_IFELSE(
598         [AC_LANG_PROGRAM([[
599                         #include <stdlib.h>
600                         #include <math.h>
601                 ]],
602                 [[
603                         const char *s = "1.5689793435451356";
604                         double x = atof (s);
605                         double c = cos (x);
606                         int ok = (c > 0 && c < 0.05);
607                         return ok ? 0 : 1;
608                 ]])],
609         [AC_MSG_RESULT(yes)
610          cos_works=yes],
611         [AC_MSG_RESULT(no)
612          cos_works=no],
613         [AC_MSG_RESULT(assuming it is)])
615 if test "x$with_win32" = "xyes" -o "x$cos_works" = "xno"; then
616    AC_DEFINE(GNM_REDUCES_TRIG_RANGE, 1,
617         [Define if Gnumeric reduces the argument range of sin/cos/tan]
618         )
621 float_msg=double
622 AC_ARG_WITH(long_double,
623         AS_HELP_STRING([--with-long-double], [Use long double for floating point]),
624         [if test "x$withval" = xyes; then
625                 SAVE_CFLAGS="$CFLAGS"
626                 SAVE_LIBS="$LIBS"
627                 CFLAGS="$GNUMERIC_CFLAGS"
628                 LIBS="$GNUMERIC_LIBS -lm"
630                 AC_CHECK_HEADERS(sunmath.h)
632                 AC_CHECK_FUNCS(go_render_generall,
633                                ,
634                                AC_MSG_ERROR([libgoffice needs to be compiled with long double support.]))
636                 AC_CHECK_FUNCS(fabsl sqrtl expl expm1l logl log2l log10l log1pl ceill floorl powl hypotl \
637                                 sinl cosl tanl asinl acosl atanl atan2l fmodl lgammal lgammal_r \
638                                 sinhl coshl tanhl asinhl acoshl atanhl \
639                                 isnanl finitel,
640                                 ,
641                                 AC_MSG_ERROR([Long doubles require the $ldfunc function.]))
643                 AC_MSG_CHECKING([checking for working erfl and erfcl])
644                 have_erfl=no
645                 have_erfcl=no
646                 AC_RUN_IFELSE(
647                         [AC_LANG_PROGRAM([[
648                                 #include <math.h>
649                                 #ifdef HAVE_SUNMATH_H
650                                 #include <sunmath.h>
651                                 #endif
652                                 ]],
653                                 [[
654                                         long double l1 = erfl (1.2L);
655                                         long double l2 = erfcl (1.2L);
656                                         return !(l1 >= 0.91 && l1 <= 0.92 &&
657                                                  l2 >= 0.08 && l2 <= 0.09);
658                                 ]])],
659                         [AC_DEFINE(HAVE_ERFL)
660                          have_erfl=yes
661                          AC_DEFINE(HAVE_ERFCL)
662                          have_erfcl=yes
663                         AC_MSG_RESULT(yes)],
664                         AC_MSG_RESULT(no),
665                         [AC_CHECK_FUNCS(erfl erfcl)
666                         have_erfl=$ac_cv_func_erfl
667                         have_erfcl=$ac_cv_func_erfcl
668                         ])
670                 if $have_erfl = no; then
671                         AC_DEFINE(GNM_SUPPLIES_ERFL, 1,
672                                  [Define if Gnumeric supplies the erfl function]
673                                  )
674                 fi
675                 if $have_erfcl = no; then
676                         AC_DEFINE(GNM_SUPPLIES_ERFCL, 1,
677                                  [Define if Gnumeric supplies the erfcl function]
678                                  )
679                 fi
681                 CFLAGS="$SAVE_CFLAGS"
682                 LIBS="$SAVE_LIBS"
684                 float_msg="long double (EXPERIMENTAL)"
685                 AC_MSG_WARN([Long double support is experimental -- expect problems])
686                 AC_DEFINE(GNM_WITH_LONG_DOUBLE, 1,
687                         [Define if the long double type is to be used]
688                 )
689         fi]
692 ## this should come after `AC_PROG_CC'
693 set_more_warnings=yes
694 if test "$GCC" = yes -a "x$set_more_warnings" != xno; then
695         dnl Clang needs this option, or else it will appear to support any
696         dnl warning option, only to spew warnings about them later.
697         uwoption="-Werror=unknown-warning-option"
698         SAVE_CFLAGS="$CFLAGS"
699         CFLAGS="$CFLAGS $uwoption"
700         AC_MSG_CHECKING([whether gcc understands $uwoption])
701         AC_COMPILE_IFELSE(
702                 [AC_LANG_PROGRAM([], [])],
703                 [has_unknown_warning_option=yes],
704                 [has_unknown_warning_option=no; uwoption=""])
705         AC_MSG_RESULT($has_unknown_warning_option)
706         CFLAGS="$SAVE_CFLAGS"
708         warning_options="-Wall -Werror=init-self -Werror=missing-include-dirs \
709                          -Wsign-compare -Werror=pointer-arith \
710                          -Wchar-subscripts -Wwrite-strings \
711                          -Wdeclaration-after-statement -Wnested-externs \
712                          -Wmissing-noreturn \
713                          -Werror=missing-prototypes -Werror=nested-externs \
714                          -Werror=implicit-function-declaration \
715                          -Wmissing-declarations -Wno-pointer-sign \
716                          -Werror=format-security -Wbitwise -Wcast-to-as \
717                          -Wdefault-bitfield-sign -Wdo-while -Wparen-string \
718                          -Wptr-subtraction-blows -Wreturn-void -Wtypesign \
719                          -Wstrict-prototypes -Wno-error=format-nonliteral "
720         for option in $warning_options ; do
721                 SAVE_CFLAGS="$CFLAGS"
722                 CFLAGS="$CFLAGS $uwoption $option"
723                 AC_MSG_CHECKING([whether gcc understands $option])
724                 dnl Include a system header so we ignore Werror=... flags
725                 dnl that cause trouble.
726                 AC_COMPILE_IFELSE(
727                         [AC_LANG_PROGRAM([[#include <stdio.h>]], [])],
728                         [has_option=yes],
729                         [has_option=no])
730                 CFLAGS="$SAVE_CFLAGS"
731                 if test $has_option = yes; then
732                         CFLAGS="$CFLAGS $option"
733                 fi
734                 AC_MSG_RESULT($has_option)
735                 unset has_option
736                 unset SAVE_CFLAGS
737         done
738         unset option
740 AC_SUBST(WARN_CFLAGS)
742 dnl **************************************************
743 dnl * Check for GSettings
744 dnl **************************************************
745 have_gsettings=no
746 AC_CHECK_LIB(gio-2.0,[g_settings_new],
747         [AC_DEFINE(HAVE_G_SETTINGS_NEW, 1,
748                 [Define if the g_settings_new function is available])
749         GLIB_GSETTINGS
750         have_gsettings=yes],
751         [GSETTINGS_RULES=""
752         AC_SUBST(GSETTINGS_RULES)])
753 AM_CONDITIONAL(HAVE_GSETTINGS, test $have_gsettings=yes)
755 dnl **************************************************
756 dnl * Check for Perl
757 dnl **************************************************
759 AC_ARG_VAR(PERL, [The Perl executable.])
760 AC_CHECK_PROG(PERL, perl, perl)
762 want_perl=auto
763 have_perl=no
764 perl_reason=""
765 AC_ARG_WITH(perl, AS_HELP_STRING([--without-perl], [Do not build the Perl plugin loader]),
766         [case $withval in
767         yes) want_perl=yes;;
768         no) want_perl=no;;
769         esac])
770 if test "x$want_perl" = xno ; then
771     perl_reason="disabled by request"
772 else
773     if test "x$PERL" != x; then
774         BIG_CHECKING([for perl ExtUtils::Embed module])
775         if $PERL -e 'eval { require ExtUtils::Embed }; if ($@) { exit(1); } else { exit(0); }'
776         then
777             AC_MSG_RESULT(yes)
779             dnl Use ExtUtils::Embed to figure out the other options.
780             PERL_CCCDLFLAGS=`$PERL -MConfig -e 'print $Config{cccdlflags};'`
781             PERL_LDDLFLAGS=`$PERL -MConfig -e 'print $Config{lddlflags};'`
782             PERL_CC=`$PERL -MConfig -e 'print $Config{cc};'`
783             PERL_LD=`$PERL -MConfig -e 'print $Config{ld};'`
784             perlinc=`$PERL -MConfig -e 'print "$Config{archlib}/CORE";'`
785             PERL_CCOPTS="`$PERL -MExtUtils::Embed -e ccopts` -I$perlinc"
786             PERL_LDOPTS=`$PERL -MExtUtils::Embed -e ldopts`
788             AC_MSG_CHECKING([Checking for perl compiler, linker, libraries and headers])
789             rm -f testperl$ac_exeext testperl.$ac_objext testperl.c testperl.err
790             cat > testperl.c <<EOF
791 #include "EXTERN.h"
792 #include "perl.h"
793 #include "XSUB.h"
794 int main () { (void)&perl_construct; return 0; }
796             $PERL_CC $PERL_CCOPTS -c testperl.c >testperl.err 2>&1 &&
797             $PERL_LD -o testperl testperl.$ac_objext $PERL_LDOPTS >testperl.err 2>&1 &&
798             test -x testperl &&
799             have_perl=yes
800             AC_MSG_RESULT($have_perl)
802             if test "x$have_perl" != xyes; then
803                 perl_reason="failed to compile test program"
804                 cat testperl.err testperl.c >&AS_MESSAGE_LOG_FD
805             fi
807             rm -f testperl$ac_exeext testperl.$ac_objext testperl.c testperl.err
809         else
810             AC_MSG_RESULT(no)
811             perl_reason="missing parts of perl"
812         fi
813     else
814         perl_reason="missing perl"
815     fi
818 if test "$want_perl" = xyes -a "x$have_perl" != xyes; then
819     AC_MSG_ERROR([Perl requested, but not available: $perl_reason])
822 AM_CONDITIONAL(WITH_PERL, test "x$have_perl" = xyes)
823 if test "x$have_perl" = xyes ; then
824     perl_msg="yes (using $PERL)"
825 else
826     perl_msg="no ($perl_reason)"
828 AC_SUBST(PERL_CCCDLFLAGS)
829 AC_SUBST(PERL_LDDLFLAGS)
830 AC_SUBST(PERL_CC)
831 AC_SUBST(PERL_LD)
832 AC_SUBST(PERL_CCOPTS)
833 AC_SUBST(PERL_LDOPTS)
835 dnl **************************************************
836 dnl * Check for Python
837 dnl **************************************************
838 python_msg="yes"
839 GNM_PY_CFLAGS=
840 GNM_PY_LDFLAGS=
841 GNM_PY_LIBADD=
843 AC_ARG_WITH(python, AS_HELP_STRING([--without-python], [Do not build the Python plugin loader]))
844 AC_ARG_VAR(PYTHON, [The Python executable.])
845 case $with_python in
846 yes|no) ;;
847 ?*) AC_MSG_ERROR([You cannot use --with-python with an argument.
848 If you want to specify a path to your Python executable, use:
849         $srcdir/configure PYTHON=/path/to/your/python ...]);;
850 esac
851 if test "x$with_python" != xno; then
852     AC_PATH_PROGS(PYTHON, python python2 python2.7)
853     if test "x$PYTHON" = x; then
854         python_msg="could not find python"
855     fi
856 else
857     python_msg="Disabled by request"
860 # A bit of a mess.  We really ought to separate the Python interpreter
861 # and the Python plugin
862 have_python=no
863 have_python_gi=no
864 PYTHON_GIOVERRIDESDIR=
865 if test "x$PYTHON" != x; then
866     AC_DEFINE_UNQUOTED(PYTHON_INTERPRETER, ["$PYTHON"],
867                        [The Python interpreter to use])
868     have_python=yes
870     AC_MSG_CHECKING([for python module gi])
871     if $PYTHON -c 'import gi' 2>/dev/null; then
872         have_python_gi=yes
873         [PYTHON_GIOVERRIDESDIR=`python -c 'import gi; import os.path; print(os.path.dirname(gi.__file__)+"/overrides")'`]
874     fi
875     AC_MSG_RESULT($have_python_gi)
877 AM_CONDITIONAL(HAVE_PYTHON_GI, test "x$have_python_gi" = "xyes")
880 if test "x$python_msg" = xyes; then
881     BIG_CHECKING([for python = 2.x])
882     [PY_VERSION=`$PYTHON -c 'import sys ; sys.stdout.write(sys.version[0:3])'`
883      major_ver=`$PYTHON -c 'import sys ; sys.stdout.write(sys.version[0:1])'`]
884     if test "x$major_ver" = "x2"; then
885         AC_MSG_RESULT(yes)
886         if test "x$with_native_win32" = xyes ; then
887             # 2.x on linux, 2x on win32
888             PY_VERSION=`echo $PY_VERSION | sed -e 's/\\.//'`
889         fi
890     else
891         AC_MSG_RESULT(no)
892         python_msg="NO.  Python version \"${PY_VERSION}\" is too old."
893     fi
896 if test "x$python_msg" = xyes; then
897     if test "x$PY_PREFIX" = x; then
898         PY_PREFIX=`$PYTHON -c 'import sys ; sys.stdout.write(sys.prefix)'`
899     fi
900     if test "x$PY_INCLUDE_DIR" = x; then
901         if test "x$with_native_win32" = xyes ; then
902             PY_INCLUDES="-I$PY_PREFIX/include"
903         else
904             PY_INCLUDES=`$PYTHON -c 'import sys ; import distutils.sysconfig ; sys.stdout.write("-I" + distutils.sysconfig.get_python_inc()) ; sys.stdout.write(" -I" + distutils.sysconfig.get_python_inc(plat_specific=True))'`
905         fi
906     else
907         PY_INCLUDES="-I$PY_INCLUDE_DIR"
908     fi
910     python_msg="unable to find Python.h"
911     for py_include in $PY_INCLUDES; do
912         py_include_dir="${py_include#-I}"
913         BIG_CHECKING(Look for $py_include_dir/Python.h)
914         if test -f $py_include_dir/Python.h; then
915             AC_MSG_RESULT(yes)
916             python_msg="yes"
917             break
918         else
919             AC_MSG_RESULT(no)
920         fi
921     done
924 if test "x$python_msg" = xyes; then
925     m4_define([pygobject_required_version], [3.0.0])
926     PKG_CHECK_MODULES(PYGOBJECT, pygobject-3.0 >= pygobject_required_version,,
927       [python_msg="Missing pygobject"])
930 AM_CONDITIONAL(WITH_PYTHON, test "x$python_msg" = xyes)
931 if test "x$python_msg" = xyes; then
932     if test "x$PY_LIB_DIR" = x; then
933         if test "x$with_native_win32" = xyes ; then
934             PY_LIB_DIR="$PY_PREFIX/libs"
935         else
936             PY_LIB_DIR=`$PYTHON -c 'import sys ; import distutils.sysconfig ; sys.stdout.write(distutils.sysconfig.get_config_var("LIBPL"))'`
937         fi
938     fi
940     GNM_PY_CFLAGS="$PY_INCLUDES $PYGOBJECT_CFLAGS"
941     GNM_PY_LDFLAGS="-L$PY_LIB_DIR -lpython$PY_VERSION $PYGOBJECT_LIBS"
942     python_msg="yes (using $PYTHON)"
943 elif test "x$with_python" = "xyes"; then
944                 AC_MSG_ERROR([$python_msg])
947 AC_SUBST(GNM_PY_CFLAGS)
948 AC_SUBST(GNM_PY_LDFLAGS)
949 AC_SUBST(GNM_PY_LIBADD)
951 YELP_HELP_INIT(no-lc-dist)
953 # Support for PDF docs
954 AC_ARG_ENABLE(pdfdocs,
955   AS_HELP_STRING([--enable-pdfdocs],[Generate documentation in Portable Document Format]),
956   [enable_pdfdocs=$enableval],
957   [enable_pdfdocs=no])
958 pdf_msg="No, not requested.";
959 if test x"$enable_pdfdocs" = xyes; then
960         pdfroute=""
961         AC_CHECK_PROG(DBCONTEXT, [dbcontext], [dbcontext], [])
962         AC_CHECK_PROG(DBLATEX, [dblatex], [dblatex], [])
963         if test x"$DBCONTEXT" = x"dbcontext"; then
964                 pdfroute=dbcontext
965         else
966                 if test x"$DBLATEX" = x"dblatex"; then
967                         pdfroute=dblatex
968                 fi
969         fi
970         if test x"$pdfroute" != x""; then
971                 pdf_msg="Yes, through $pdfroute."
972         else
973                 AC_MSG_ERROR([
974 Did not find a suitable tool for generating Portable Document Format from
975 DocBook XML - aborting.
977 Both the DocBook to ConTeXt and the DocBook to LaTeX conversion tool can be
978 obtained from
979         http://dblatex.sourceforge.net/
981                 exit 1
982         fi
984 AM_CONDITIONAL(ENABLE_PDFDOCS, test x"$enable_pdfdocs" = xyes)
985 AM_CONDITIONAL(ENABLE_PDF_VIA_DBCONTEXT, test x"$pdfroute" = x"dbcontext")
986 AM_CONDITIONAL(ENABLE_PDF_VIA_DBLATEX, test x"$pdfroute" = x"dblatex")
989 dnl A tricky way to comment out in m4:
990 ifelse([
991 dnl **************************************************
992 dnl * Check for mono
993 dnl **************************************************
994 with_mono=no
995 mono_msg="disabled, still experimental"
997 AC_ARG_WITH(mono, AS_HELP_STRING([--with-mono], [Compile the mono scripting engine]))
998 case $with_mono in
999 no)     mono_msg="Disabled by request";;
1001     PKG_CHECK_MODULES(MONO, mono,
1002         [with_mono=yes
1003          AC_DEFINE(WITH_MONO, 1, [Define if mono .NET engine is available])],
1004         [with_mono=no])
1005     mono_msg=$with_mono
1006     ;;
1007 esac
1008 AM_CONDITIONAL(WITH_MONO, test "x$with_mono" = xyes)
1009 AC_SUBST(MONO_CFLAGS)
1010 AC_SUBST(MONO_LIBS)
1013 # GObject Introspection
1014 GIR_REQ=1.0.0
1015 AC_ARG_ENABLE(introspection,
1016           AS_HELP_STRING([--enable-introspection[=@<:@no/auto/yes@:>@]],
1017                          [Enable introspection for this build]),, 
1018                          [enable_introspection=no])
1020 AC_MSG_CHECKING([for gobject-introspection])
1022 dnl presence/version checking
1023 AS_CASE([$enable_introspection],
1024 [no], [
1025     found_introspection="no (disabled, use --enable-introspection to enable)"
1027 [yes],[
1028     PKG_CHECK_EXISTS([gobject-introspection-1.0],,
1029                      AC_MSG_ERROR([gobject-introspection-1.0 is not installed]))
1030     PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $GIR_REQ],
1031                      found_introspection=yes,
1032                      AC_MSG_ERROR([You need to have gobject-introspection >= $1 installed to build AC_PACKAGE_NAME]))
1034 [auto],[
1035     PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $GIR_REQ], found_introspection=yes, found_introspection=no)
1036 dnl Canonicalize enable_introspection
1037 enable_introspection=$found_introspection
1039 [       
1040     AC_MSG_ERROR([invalid argument passed to --enable-introspection, should be one of @<:@no/auto/yes@:>@])
1043 AC_MSG_RESULT([$found_introspection])
1045 if test "x$found_introspection" = "xyes"; then
1046    dnl You can override INTROSPECTION_GIRDIR and INTROSPECTION_TYPELIBDIR
1047    dnl if you wish.  If you override the latter, you might want to set
1048    dnl GI_TYPELIB_PATH to include the same directory.  For example
1049    dnl
1050    dnl GI_TYPELIB_PATH=$PREFIX/lib64/girepository-1.0
1051    dnl INTROSPECTION_TYPELIBDIR=$GI_TYPELIB_PATH
1052    dnl INTROSPECTION_GIRDIR=$PREFIX/share/gir-1.0
1053    dnl
1054    dnl Note, that unlike gnumeric's binaries, nothing tells python where
1055    dnl to find gnumeric libraries, so you might also need to set
1056    dnl LD_LIBRARY_PATH.
1058    INTROSPECTION_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0`
1059    INTROSPECTION_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0`
1060    INTROSPECTION_GENERATE=`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0`
1061    if test "x$INTROSPECTION_GIRDIR" = x; then
1062      INTROSPECTION_GIRDIR=`$PKG_CONFIG --variable=girdir gobject-introspection-1.0`
1063    fi
1064    if test "x$INTROSPECTION_TYPELIBDIR" = x; then
1065      INTROSPECTION_TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)"
1066    fi
1067    INTROSPECTION_CFLAGS=`$PKG_CONFIG --cflags gobject-introspection-1.0`
1068    INTROSPECTION_LIBS=`$PKG_CONFIG --libs gobject-introspection-1.0`
1069    INTROSPECTION_MAKEFILE=`$PKG_CONFIG --variable=datadir gobject-introspection-1.0`/gobject-introspection-1.0/Makefile.introspection
1070 else
1071    INTROSPECTION_SCANNER=
1072    INTROSPECTION_COMPILER=
1073    INTROSPECTION_GENERATE=
1074    INTROSPECTION_GIRDIR=
1075    INTROSPECTION_TYPELIBDIR=
1076    INTROSPECTION_CFLAGS=
1077    INTROSPECTION_LIBS=
1078    INTROSPECTION_MAKEFILE=
1080 AC_SUBST(INTROSPECTION_SCANNER)
1081 AC_SUBST(INTROSPECTION_COMPILER)
1082 AC_SUBST(INTROSPECTION_GENERATE)
1083 AC_SUBST(INTROSPECTION_GIRDIR)
1084 AC_SUBST(INTROSPECTION_TYPELIBDIR)
1085 AC_SUBST(INTROSPECTION_CFLAGS)
1086 AC_SUBST(INTROSPECTION_LIBS)
1087 AC_SUBST(INTROSPECTION_MAKEFILE)
1089 AM_CONDITIONAL(HAVE_INTROSPECTION, test "x$found_introspection" = "xyes")
1090 dnl we need to change the install directories for distcheck
1091 AC_ARG_WITH([gir-dir],
1092         AS_HELP_STRING(
1093                 [--with-gir-dir],
1094                 [
1095                  path to gir repository
1096                  (automatically detected via pkg-config)
1097                 ]
1098         ),
1099         [GIRDIR=$withval],
1100         [GIRDIR=$INTROSPECTION_GIRDIR]
1102 AC_SUBST(GIRDIR)
1103 AC_ARG_WITH([typelib-dir],
1104         AS_HELP_STRING(
1105                 [--with-typelib-dir],
1106                 [
1107                  path to typelibs repository
1108                  (automatically detected via pkg-config)
1109                 ]
1110         ),
1111         [TYPELIBDIR=$withval],
1112         [TYPELIBDIR=$INTROSPECTION_TYPELIBDIR]
1114 AC_SUBST(TYPELIBDIR)
1115 AC_ARG_WITH([gi-overrides-dir],
1116         AS_HELP_STRING(
1117                 [--with-gi-overrides-dir],
1118                 [
1119                  path to introspection overrides repository
1120                  (automatically detected via python)
1121                 ]
1122         ),
1123         [GIOVERRIDESDIR=$withval],
1124         [GIOVERRIDESDIR=$PYTHON_GIOVERRIDESDIR]
1126 AC_SUBST(GIOVERRIDESDIR)
1128 AC_ARG_WITH([goffice-plugins-dir],
1129         AS_HELP_STRING(
1130                 [--with-goffice-plugins-dir],
1131                 [
1132                  path to goffice plugins
1133                  (automatically detected via pkg-config)
1134                 ]
1135         ),
1136         [GOFFICE_PLUGINS_DIR=$withval],
1137         [:]
1141 dnl **************************************************
1142 dnl * Config defaults
1143 dnl **************************************************
1145 dnl These are changed in gutils.c for WIN32 packages
1146 AC_SUBST(gnumeric_datadir, '${datadir}/gnumeric/${VERSION}')
1147 AC_SUBST(gnumeric_libdir, '${libdir}/gnumeric/${VERSION}')
1148 AC_SUBST(gnumeric_icondir, '${datadir}/pixmaps/gnumeric')
1149 AC_SUBST(gnumeric_localedir, '${prefix}/${DATADIRNAME}/locale')
1151 AC_SUBST(gnumeric_plugindir, '${gnumeric_libdir}/plugins')
1152 AC_SUBST(gnumeric_externplugindir, '${libdir}/gnumeric/${GNUMERIC_API_VER}/plugins')
1154 AC_SUBST(YYYYMMDD, `date +%Y%m%d`)
1156 dnl Export to gnumeric-config.h
1157 AC_DEFINE(GNM_VERSION_FULL, "gnumeric_version_full",
1158         [The version number of this release, with optional extra suffix])
1159 AC_DEFINE(GNM_VERSION_EPOCH, gnumeric_version_epoch,
1160         [The Epoch of this release])
1161 AC_DEFINE(GNM_VERSION_MAJOR, gnumeric_version_major,
1162         [The Major version number of this release])
1163 AC_DEFINE(GNM_VERSION_MINOR, gnumeric_version_minor,
1164         [The Minor version number of this release])
1165 AC_DEFINE(GNM_VERSION_EXTRA, "gnumeric_version_extra",
1166         [Extra, possibly empty tag for this release])
1167 AC_DEFINE(GNM_API_VERSION, "GNUMERIC_API_VER",
1168         [The API version number of this release])
1170 AC_OUTPUT([
1171 gnumeric.spec
1172 Makefile
1173 libspreadsheet.pc
1174 icons/Makefile
1175 icons/16x16/Makefile
1176 icons/16x16/actions/Makefile
1177 icons/16x16/apps/Makefile
1178 icons/22x22/Makefile
1179 icons/22x22/actions/Makefile
1180 icons/22x22/apps/Makefile
1181 icons/24x24/Makefile
1182 icons/24x24/actions/Makefile
1183 icons/24x24/apps/Makefile
1184 icons/32x32/Makefile
1185 icons/32x32/actions/Makefile
1186 icons/32x32/apps/Makefile
1187 icons/48x48/Makefile
1188 icons/48x48/actions/Makefile
1189 icons/48x48/apps/Makefile
1190 icons/256x256/Makefile
1191 icons/256x256/apps/Makefile
1192 introspection/Makefile
1193 src/Makefile
1194 doc/Makefile
1195 plugins/Makefile
1196 plugins/fn-christian-date/Makefile
1197 plugins/fn-complex/Makefile
1198 plugins/fn-database/Makefile
1199 plugins/fn-date/Makefile
1200 plugins/fn-derivatives/Makefile
1201 plugins/fn-eng/Makefile
1202 plugins/fn-erlang/Makefile
1203 plugins/fn-financial/Makefile
1204 plugins/fn-hebrew-date/Makefile
1205 plugins/fn-info/Makefile
1206 plugins/fn-logical/Makefile
1207 plugins/fn-lookup/Makefile
1208 plugins/fn-math/Makefile
1209 plugins/fn-numtheory/Makefile
1210 plugins/fn-r/Makefile
1211 plugins/fn-stat/Makefile
1212 plugins/fn-string/Makefile
1213 plugins/fn-random/Makefile
1214 plugins/fn-tsa/Makefile
1215 plugins/applix/Makefile
1216 plugins/dif/Makefile
1217 plugins/excel/Makefile
1218 plugins/excelplugins/Makefile
1219 plugins/gda/Makefile
1220 plugins/gnome-db/Makefile
1221 plugins/gnome-glossary/Makefile
1222 plugins/html/Makefile
1223 plugins/lotus-123/Makefile
1224 plugins/lpsolve/Makefile
1225 plugins/nlsolve/Makefile
1226 plugins/glpk/Makefile
1227 plugins/mps/Makefile
1228 plugins/oleo/Makefile
1229 plugins/openoffice/Makefile
1230 plugins/paradox/Makefile
1231 plugins/perl-func/Makefile
1232 plugins/perl-loader/Makefile
1233 plugins/plan-perfect/Makefile
1234 plugins/psiconv/Makefile
1235 plugins/py-func/Makefile
1236 plugins/python-loader/Makefile
1237 plugins/qpro/Makefile
1238 plugins/sample_datasource/Makefile
1239 plugins/sc/Makefile
1240 plugins/sylk/Makefile
1241 plugins/uihello/Makefile
1242 plugins/xbase/Makefile
1243 po/Makefile.in
1244 po-functions/Makefile.in
1245 schemas/Makefile
1246 schemas/org.gnome.gnumeric.gschema.xml.in
1247 schemas/org.gnome.gnumeric.dialogs.gschema.xml.in
1248 schemas/org.gnome.gnumeric.plugin.gschema.xml.in
1249 templates/Makefile
1250 templates/english/Makefile
1251 templates/autoformat/Makefile
1252 test/Makefile
1253 tools/Makefile
1254 tools/win32/Makefile
1255 tools/win32/moduleset
1256 tools/win32/gnumeric.nsi
1257 component/Makefile
1260 echo "
1262 Configuration:
1264         Source code location:   ${srcdir}
1265         Compiler:               ${CC}
1266         Compiler flags:         ${CFLAGS}
1267         Floating point type:    ${float_msg}
1269         UI:                     ${ui_msg}
1271         Perl Support:           ${perl_msg}
1272         Python Support:         ${python_msg}
1274         GDA support:            ${gda_msg}
1275         GNOME-DB support:       ${gnomedb_msg}
1276         Psiconv support:        ${psiconv_msg}
1278         PDF documentation:      ${pdf_msg}
1280 #       Mono support:           ${mono_msg}
1281 #       Guile Support:          ${guile_msg}