2 dnl We require Automake 1.7.2, which requires Autoconf 2.54.
3 dnl (It needs _AC_AM_CONFIG_HEADER_HOOK, for example.)
6 m4_define([gnumeric_version_epoch], [1])
7 m4_define([gnumeric_version_major], [12])
8 m4_define([gnumeric_version_minor], [14])
9 m4_define([gnumeric_version_extra], [])
10 m4_define([gnumeric_version_full],
11 [gnumeric_version_epoch.gnumeric_version_major.gnumeric_version_minor[]gnumeric_version_extra])
13 dnl Emphasize some of the checks.
14 m4_define([BIG_CHECKING], [AC_MSG_CHECKING([
17 AC_INIT([gnumeric], [gnumeric_version_full],
18 [http://bugzilla.gnome.org/enter_bug.cgi?product=gnumeric])
20 AC_CONFIG_SRCDIR(src/sheet.h)
21 AM_INIT_AUTOMAKE([dist-bzip2])
23 dnl Version info for libraries = CURRENT:REVISION:AGE
25 dnl Within each x.y.*, ABI is maintained backward and _forward_ compatible.
26 dnl (As a consequence, no exported function may be added.)
27 dnl So it's enough to have one interface number per each x.y.* branch.
29 dnl OTOH, we are not able to keep ABI strictly backward compatible throughout
31 dnl The easiest way is to declare no ABI compatibility, ie. AGE is always 0.
33 m4_define([version_iface],
34 m4_eval(100 * gnumeric_version_epoch + gnumeric_version_major))
36 AC_SUBST([VERSION_INFO], [version_iface:gnumeric_version_minor:0])
37 AC_SUBST([VERSION_IFACE], [version_iface])
39 if test `expr gnumeric_version_major % 2` -eq 1; then
40 AC_MSG_NOTICE([NOTE: This is a development release])
42 gnumeric_api_ver=gnumeric_version_epoch.`expr gnumeric_version_major + 1`
43 dnl An explicit version number should be used in place of the above
44 dnl if the epoch is to change.
45 dnl gnumeric_api_ver=2.0
48 gnumeric_api_ver=gnumeric_version_epoch.gnumeric_version_major
50 gnumeric_api_ver_=`echo $gnumeric_api_ver | sed -e 's/\./_/g'`
52 dnl Almost like epoch.major but development versions look forward to the next
54 AC_SUBST([GNUMERIC_API_VER], [$gnumeric_api_ver])
55 AC_SUBST([GNUMERIC_API_VER_], [$gnumeric_api_ver_])
57 dnl This one is created by autoheader, ...
58 AC_CONFIG_HEADERS(gnumeric-config.h)
60 dnl ... and this one is a small subset, maintained manually,
61 dnl which will be installed.
62 AC_CONFIG_HEADERS(gnumeric-features.h)
64 dnl Make sure these two won't clash. Put the following to gnumeric-config.h:
65 AH_BOTTOM([/* Don't include gnumeric-features.h, it's a subset of gnumeric-config.h. */
66 #define GNUMERIC_FEATURES_H])
68 AM_MAINTAINER_MODE([enable])
70 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
72 dnl We use a LINGUAS file, so we need intltool >= 0.35:
73 IT_PROG_INTLTOOL([0.35.0])
74 IT_PO_SUBDIR(po-functions)
76 dnl We use $host and $host_os:
87 # Make --disable-static the default
88 LT_INIT([disable-static])
90 dnl Propagate Gnome-specific variable ACLOCAL_FLAGS to Makefile.
91 AC_SUBST(ACLOCAL_AMFLAGS, $ACLOCAL_FLAGS)
93 dnl *****************************
96 dnl zlib is needed for the excel plugin; see plugins/excel/Makefile.am
98 _cppflags="${CPPFLAGS}"
102 AS_HELP_STRING([--with-zlib=DIR], [use libz in DIR]),
106 CPPFLAGS="${CPPFLAGS} -I$withval/include"
107 LDFLAGS="${LDFLAGS} -L$withval/lib"
111 if test "x$with_zlib" != xno; then
113 AC_CHECK_HEADER(zlib.h, [AC_CHECK_LIB(z, gzread, [with_zlib=yes])])
116 if test "$with_zlib" = no; then
117 AC_MSG_ERROR([*** zlib is required])
120 if test "x${Z_DIR}" != "x"; then
121 Z_CPPFLAGS="-I${Z_DIR}/include"
123 *-*-solaris*) Z_LIBS="-L${Z_DIR}/lib -R${Z_DIR}/lib -lz" ;;
124 *) Z_LIBS="-L${Z_DIR}/lib -lz" ;;
132 CPPFLAGS=${_cppflags}
138 # Goffice releases are parallel installable, which do we depend on
139 GOFFICE_API_VER="0.10"
140 AC_SUBST(GOFFICE_API_VER)
142 GOFFICE_PLUGINS_DIR=`pkg-config --variable=PluginDir libgoffice-${GOFFICE_API_VER}`
143 AC_SUBST(GOFFICE_PLUGINS_DIR)
144 GOFFICE_VERSION=`pkg-config --modversion libgoffice-${GOFFICE_API_VER}`
145 AC_SUBST(GOFFICE_VERSION)
148 dnl PKG_PROG_PKG_CONFIG is expanded just before the first occurrence of
149 dnl PKG_CHECK_MODULES. Since this is inside an `if,' it can escape
150 dnl execution. Thus we need an explicit call:
151 PKG_PROG_PKG_CONFIG(0.18)
153 dnl *****************************
154 libspreadsheet_reqs="
155 libgoffice-${GOFFICE_API_VER} >= 0.10.14
159 gnumeric_reqs="$libspreadsheet_reqs
161 gobject-2.0 >= 2.28.0
162 gmodule-2.0 >= 2.28.0
163 gthread-2.0 >= 2.28.0
167 libspreadsheet_gtk_reqs="
171 gnumeric_gtk_reqs="$libspreadsheet_gtk_reqs"
177 mingw* | pw32* | cygwin*)
182 dnl *******************
183 dnl Should we use gtk ?
184 dnl *******************
185 gnumeric_with_gtk=true
186 AC_ARG_WITH(gtk, AS_HELP_STRING([--without-gtk], [Build without UI]))
187 if test "x$with_gtk" = xno; then
188 ui_msg="None (Gtk disabled by request)"
189 gnumeric_with_gtk=false
191 dnl We shouldn't silently default to --without-gtk.
192 dnl If the requirements are not met, fail.
194 PKG_CHECK_MODULES(GTK, [$libspreadsheet_gtk_reqs])
195 PKG_CHECK_MODULES(GTK, [$gnumeric_gtk_reqs])
198 if test "x$gnumeric_with_gtk" = xtrue ; then
199 AC_DEFINE(GNM_WITH_GTK, 1, [Define if UI is built])
200 libspreadsheet_reqs="$libspreadsheet_reqs $libspreadsheet_gtk_reqs"
201 gnumeric_reqs="$gnumeric_reqs $gnumeric_gtk_reqs"
204 AM_CONDITIONAL(WITH_GTK, $gnumeric_with_gtk)
206 dnl ****************************
207 dnl now that we have selected out libraries the whole collection in one
208 dnl shot so that we can have a nice neat compile/link line
209 dnl ****************************
211 PKG_CHECK_MODULES(LIBSPREADSHEET, $libspreadsheet_reqs)
212 AC_SUBST(LIBSPREADSHEET_LIBS)
213 AC_SUBST(LIBSPREADSHEET_CFLAGS)
215 PKG_CHECK_MODULES(GNUMERIC, $gnumeric_reqs)
216 AC_SUBST(GNUMERIC_LIBS)
217 AC_SUBST(GNUMERIC_CFLAGS)
222 with_native_win32=yes
223 AC_ARG_VAR(WINDRES, [The windres executable (used by win32 builds only).])
224 AC_CHECK_TOOL(WINDRES, windres, :)
227 AM_CONDITIONAL(WITH_WIN32, test $with_win32 = yes)
228 AM_CONDITIONAL(WITH_NATIVE_WIN32, test $with_native_win32 = yes)
229 AM_CONDITIONAL(CROSS_COMPILING, test x"$cross_compiling" != xno)
231 if test "x$with_win32" = "xyes"; then
232 GNUMERIC_PLUGIN_LDFLAGS="-avoid-version -no-undefined $GNUMERIC_LIBS -Wl,--enable-runtime-pseudo-reloc,--export-all-symbols \$(top_builddir)/src/libspreadsheet.la -s"
234 GNUMERIC_PLUGIN_LDFLAGS="-avoid-version"
236 AC_SUBST(GNUMERIC_PLUGIN_LDFLAGS)
238 dnl **************************************************
239 dnl This needs to be done before we add aggressive -Werror=foo flags
241 AC_SUBST(GETTEXT_PACKAGE, gnumeric-${VERSION})
242 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",
243 [The package name, for gettext])
246 dnl ****************************
247 dnl prep the pixmap generator
248 dnl ****************************
250 AC_ARG_VAR(GLIB_GENMARSHAL, [The glib-genmarshal executable.])
251 AC_CHECK_PROG(GLIB_GENMARSHAL, glib-genmarshal$ac_exeext, glib-genmarshal$ac_exeext)
253 AC_ARG_VAR(GDK_PIXBUF_CSOURCE, [The gdk-pixbuf-csource executable.])
254 AC_CHECK_PROG(GDK_PIXBUF_CSOURCE, gdk-pixbuf-csource$ac_exeext, gdk-pixbuf-csource$ac_exeext)
256 ## this should come after `AC_PROG_CC'
257 ifdef([GNOME_COMPILE_WARNINGS],
258 [GNOME_COMPILE_WARNINGS] CFLAGS="$CFLAGS $WARN_CFLAGS",
261 set_more_warnings=yes
262 if test "$GCC" = yes -a "x$set_more_warnings" != xno; then
263 dnl Clang needs this option, or else it will appear to support any
264 dnl warning option, only to spew warnings about them later.
265 uwoption="-Werror=unknown-warning-option"
266 SAVE_CFLAGS="$CFLAGS"
267 CFLAGS="$CFLAGS $uwoption"
268 AC_MSG_CHECKING([whether gcc understands $uwoption])
270 [AC_LANG_PROGRAM([], [])],
271 [has_unknown_warning_option=yes],
272 [has_unknown_warning_option=no; uwoption=""])
273 AC_MSG_RESULT($has_unknown_warning_option)
274 CFLAGS="$SAVE_CFLAGS"
276 warning_options="-Wsign-compare -Wpointer-arith \
277 -Wchar-subscripts -Wwrite-strings \
278 -Wdeclaration-after-statement -Wnested-externs \
280 -Werror=missing-prototypes -Werror=nested-externs \
281 -Werror=implicit-function-declaration \
282 -Wmissing-declarations -Wno-pointer-sign \
283 -Werror=format-security -Wbitwise -Wcast-to-as \
284 -Wdefault-bitfield-sign -Wdo-while -Wparen-string \
285 -Wptr-subtraction-blows -Wreturn-void -Wtypesign \
287 for option in $warning_options ; do
288 SAVE_CFLAGS="$CFLAGS"
289 CFLAGS="$CFLAGS $uwoption $option"
290 AC_MSG_CHECKING([whether gcc understands $option])
291 dnl Include a system header so we ignore Werror=... flags
292 dnl that cause trouble.
294 [AC_LANG_PROGRAM([[#include <stdio.h>]], [])],
297 CFLAGS="$SAVE_CFLAGS"
298 if test $has_option = yes; then
299 CFLAGS="$CFLAGS $option"
301 AC_MSG_RESULT($has_option)
307 AC_SUBST(WARN_CFLAGS)
309 AC_ARG_ENABLE(component,
310 AS_HELP_STRING([--disable-component], [Do not build the goffice component]),
311 [], [enable_component=yes])
313 if test x"$enable_component" = xyes; then
314 component_dir="component"
318 AC_SUBST(COMPONENT_DIR, $component_dir)
320 dnl ****************************
322 dnl ****************************
327 AS_HELP_STRING([--with-gda], [Compile the Gnome Database Access plugin]),
328 if test "x$withval" != xyes; then
330 gda_msg="Disabled by request"
333 if test "$try_gda" = true; then
334 PKG_CHECK_MODULES(GDA, [libgda-5.0 >= 5.0.0, libgda-ui-5.0 >= 5.0.0],
336 [gda_msg="NO. libgda problem"])
337 if test "$gda_msg" = yes; then
338 PKG_CHECK_MODULES(GNOMEDB, [libgnomedb-4.0 >= 3.99.6],
340 [gnomedb_msg="NO. libgnomedb problem"])
341 if test "$gnomedb_msg" = yes; then
342 AC_DEFINE(HAVE_LIBGNOMEDB, 1, [ Define if libgnomedb support is compiled in])
346 AM_CONDITIONAL(WITH_GDA, test x"$gda_msg" = xyes)
350 AM_CONDITIONAL(WITH_GNOMEDB, test x"$gnomedb_msg" = xyes)
351 AC_SUBST(GNOMEDB_CFLAGS)
352 AC_SUBST(GNOMEDB_LIBS)
354 dnl ****************************
356 AC_CHECK_DECL(fdopen, fdopen_works=yes, fdopen_works=no)
358 if test $fdopen_works = no ; then
359 unset ac_cv_have_decl_fdopen
360 CFLAGS="$CFLAGS -D_POSIX_SOURCE"
361 AC_MSG_NOTICE([adding -D_POSIX_SOURCE to CFLAGS])
362 AC_CHECK_DECL(fdopen, fdopen_works=yes, fdopen_works=no)
363 if test $fdopen_works = no ; then
364 AC_MSG_ERROR([fdopen is not available])
368 # Unfortunately, -D_POSIX_SOURCE turns off struct timeval on Solaris
369 AC_MSG_CHECKING([whether struct timeval is available])
371 [AC_LANG_PROGRAM([[#include <sys/time.h>]], [[struct timeval tv;]])],
372 [struct_timeval_works=yes],
373 [struct_timeval_works=no])
374 AC_MSG_RESULT($struct_timeval_works)
376 if test $struct_timeval_works = no ; then
377 CFLAGS="$CFLAGS -D__EXTENSIONS__"
378 AC_MSG_CHECKING([whether struct timeval is available with -D__EXTENSIONS__])
380 [AC_LANG_PROGRAM([[#include <sys/time.h>]], [[struct timeval tv;]])],
381 [struct_timeval_works=yes],
382 [struct_timeval_works=no])
383 AC_MSG_RESULT($struct_timeval_works)
384 if test $struct_timeval_works = no ; then
385 AC_MSG_ERROR([struct timeval is not available])
389 dnl src/functions/fn-math.c uses M_PI
391 AC_MSG_CHECKING([whether M_PI is available])
393 [AC_LANG_PROGRAM([[#include <math.h>]], [[double f = M_PI]])],
394 [works_without_bsd_source=yes],
395 [works_without_bsd_source=no])
396 AC_MSG_RESULT($works_without_bsd_source)
398 if test $works_without_bsd_source = no ; then
399 CFLAGS="$CFLAGS -D_BSD_SOURCE"
400 AC_MSG_CHECKING([whether M_PI is available with -D_BSD_SOURCE])
402 [AC_LANG_PROGRAM([[#include <math.h>]], [[double f = M_PI]])],
405 AC_MSG_RESULT($m_pi_works)
406 if test $m_pi_works = no ; then
407 AC_MSG_ERROR([M_PI is not available])
414 dnl Comment out the guile block:
416 dnl check for guile 1.5
418 guile_msg="disabled pending some guile developer interest"
421 AS_HELP_STRING([--with-guile], [Compile with Guile support or without it]),
422 if test "x$withval" = xyes; then
427 AC_MSG_CHECKING(for guile >= 1.5)
428 if test "`guile -c '(display (string>=? (version) "1.4.1"))'`" != "#t"; then
429 AC_MSG_RESULT([Your Guile is too old. You need Guile 1.5 or later.])
436 if $enable_guile; then
439 AM_CONDITIONAL(WITH_GUILE, $enable_guile)
442 dnl **************************************************
443 dnl * psiconv support
444 dnl **************************************************
447 AS_HELP_STRING([--without-psiconv], [Compile without Psiconv support]))
448 AC_ARG_VAR(PSICONV_CONFIG, [The psiconv-config executable.])
449 if test "x$with_psiconv" != xno; then
450 AC_CHECK_PROG(PSICONV_CONFIG,psiconv-config,psiconv-config)
451 if test x"$PSICONV_CONFIG" = x; then
452 psiconv_msg="missing dependencies"
454 AC_MSG_CHECKING(for psiconv >= 0.9.3)
455 if $PSICONV_CONFIG --version | awk -F. \
456 '{exit !($1 > 0 || $2 > 9 || ($2 == 9 && $3 >= 3))}'
458 PSICONV_CFLAGS=`$PSICONV_CONFIG --cflags`
459 PSICONV_LIBS=`$PSICONV_CONFIG --libs`
464 AC_MSG_RESULT($psiconv_msg)
469 AM_CONDITIONAL(WITH_PSICONV, test "x$psiconv_msg" = xyes)
470 AC_SUBST(PSICONV_LIBS)
471 AC_SUBST(PSICONV_CFLAGS)
476 AS_HELP_STRING([--without-paradox], [Compile without Paradox support]),
477 if test "x$withval" = xno; then
482 if $try_paradox; then
483 PKG_CHECK_MODULES(PARADOX,
486 [paradox_msg="missing dependencies"])
489 if test "x$paradox_msg" = xyes; then
492 AM_CONDITIONAL(WITH_PARADOX, $enable_paradox)
493 AC_SUBST(PARADOX_LIBS)
494 AC_SUBST(PARADOX_CFLAGS)
496 plugin_list_given=false
498 AC_ARG_ENABLE(plugins,
499 AS_HELP_STRING([--enable-plugins="text html"], [Compile only the listed plugins]),
500 [plugin_list_given=true
501 test "x$enableval" != xno && PLUGIN_LIST=$enableval
503 AM_CONDITIONAL(PLUGIN_LIST_GIVEN, $plugin_list_given)
504 AC_SUBST(PLUGIN_LIST)
507 for lang in $ALL_LINGUAS; do
508 POFILES_FULL="$POFILES_FULL \$(top_srcdir)/po/$lang.po"
510 AC_SUBST(POFILES_FULL)
513 dnl Code to handle po-functions/Makefile* and po-functions/POTFILES*
515 dnl First, let me document how the po/ directory is dealt with.
516 dnl Dark mysteries here, so skip the next paragraph if you don't have enough
517 dnl holy water at your hand. You have been warned.
519 dnl AM_GLIB_GNU_GETTEXT creates an incorrect incarnation of po/POTFILES, as
520 dnl glib-gettext.m4 doesn't know about intltool tags. Later on, just before
521 dnl config.status is created, a code originating from intltool.m4 creates
522 dnl POTFILES again, this time correctly removing the intltool tags.
523 dnl config.status then creates po/Makefile, again in two steps. First,
524 dnl po/Makefile.in is created from po/Makefile.in.in the usual way, and then
525 dnl a code registered via the obsolete macro AC_OUTPUT_COMMANDS insterts the
526 dnl contents of file POTFILES to po/Makefile.
528 dnl But both glib-gettext and intltool have the dirname "po/" hardwired, so
529 dnl we are on our own with po-functions.
531 dnl We use a more straightforward approach for po-functions:
532 dnl 1) We create POTFILES immediately here.
533 dnl 2) We let config.status to create Makefile.in.
534 dnl 3) We use AC_CONFIG_COMMANDS to create Makefile.
536 [# Create po-functions/POTFILES:
537 if test -d po-functions; then
538 rm -f po-functions/POTFILES
544 [\\/]* | ?:[\\/]* ) # Absolute name.
545 top_srcdir="$srcdir" ;;
546 *) top_srcdir="../$srcdir" ;;
548 sed <$srcdir/po-functions/POTFILES.in -e '/^#/d' -e 's/^[[].*[]] *//' \
549 -e '/^[ ]*$/d' -e "s,^, $top_srcdir/," | \
550 sed -e '$!s/$/ \\/' >po-functions/POTFILES
552 dnl Finally, register for creation of po-functions/Makefile:
553 dnl We do not currently do anything here.
554 AC_CONFIG_COMMANDS(po-functions/Makefile,
555 [cp po-functions/Makefile.in po-functions/Makefile])
558 LIBS="$LIBS $GNUMERIC_LIBS"
559 AC_CHECK_FUNCS(mkfifo)
565 dnl Check for some functions
566 AC_CHECK_FUNCS(uname)
568 dnl FIXME: Does this really belong here?
569 AC_CHECK_FUNC(bind_textdomain_codeset,,[AC_CHECK_LIB(intl,bind_textdomain_codeset)])
571 dnl check for complete locale implementation
572 AC_CHECK_HEADERS(langinfo.h)
575 AC_CHECK_HEADERS(sys/resource.h)
579 CFLAGS="$CFLAGS $GNUMERIC_CFLAGS"
580 LIBS="$GNUMERIC_LIBS $LIBS"
582 AC_CHECK_FUNCS(gtk_cell_renderer_text_get_background_set gtk_cell_renderer_text_get_foreground_set gtk_cell_renderer_text_get_editable)
583 AC_CHECK_FUNCS(gtk_entry_set_editing_cancelled)
584 AC_CHECK_FUNCS(gsf_infile_msvba_steal_modules gsf_open_pkg_foreach_rel gsf_odf_out_get_version)
586 AC_MSG_CHECKING([for PANGO_WEIGHT_THIN etc.])
587 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pango/pango.h>]],
588 [[(void)(PANGO_WEIGHT_THIN == 42);
589 (void)(PANGO_WEIGHT_MEDIUM == 42);
590 (void)(PANGO_WEIGHT_ULTRAHEAVY == 42);]])],
591 [AC_DEFINE(HAVE_PANGO_WEIGHT_THIN_ETC, 1, [Define if PANGO_WEIGHT_THIN etc are available])
595 AC_MSG_CHECKING([for OO_NS_CHART_OOO])
596 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <gsf/gsf-opendoc-utils.h>]],
597 [[(void)((int)OO_NS_CHART_OOO == 42);]])],
598 [AC_DEFINE(HAVE_OO_NS_CHART_OOO, 1, [Define if OO_NS_CHART_OOO is available])
605 dnl We supply our own lgamma and lgamma_r when missing.
607 AC_CHECK_FUNCS(lgamma_r)
608 if test $ac_cv_func_lgamma_r = no; then
609 AC_CHECK_LIB(m, lgamma_r,
610 [AC_DEFINE(HAVE_LGAMMA_R, 1,
611 [Define if the lgamma_r function is available]
618 if test $supply_lgamma_r = yes; then
619 AC_DEFINE(GNM_SUPPLIES_LGAMMA_R, 1,
620 [Define if Gnumeric supplies the lgamma_r function]
623 AC_CHECK_FUNCS(lgamma)
624 if test $ac_cv_func_lgamma = no; then
625 AC_DEFINE(GNM_SUPPLIES_LGAMMA, 1,
626 [Define if Gnumeric supplies the lgamma function]
630 if test "x$with_win32" = "xyes"; then
631 AC_DEFINE(GNM_REDUCES_TRIG_RANGE, 1,
632 [Define if Gnumeric reduces the argument range of sin/cos/tan]
637 AC_ARG_WITH(long_double,
638 AS_HELP_STRING([--with-long-double], [Use long double for floating point]),
639 [if test "x$withval" = xyes; then
640 SAVE_CFLAGS="$CFLAGS"
642 CFLAGS="$GNUMERIC_CFLAGS"
643 LIBS="$GNUMERIC_LIBS -lm"
645 AC_CHECK_HEADERS(sunmath.h)
647 AC_CHECK_FUNCS(go_render_generall,
649 AC_MSG_ERROR([libgoffice needs to be compiled with long double support.]))
651 AC_CHECK_FUNCS(fabsl sqrtl expl expm1l logl log2l log10l log1pl ceill floorl powl hypotl \
652 sinl cosl tanl asinl acosl atanl atan2l fmodl lgammal lgammal_r \
653 sinhl coshl tanhl asinhl acoshl atanhl \
656 AC_MSG_ERROR([Long doubles require the $ldfunc function.]))
658 AC_MSG_CHECKING([checking for working erfl and erfcl])
664 #ifdef HAVE_SUNMATH_H
669 long double l1 = erfl (1.2L);
670 long double l2 = erfcl (1.2L);
671 return !(l1 >= 0.91 && l1 <= 0.92 &&
672 l2 >= 0.08 && l2 <= 0.09);
674 [AC_DEFINE(HAVE_ERFL)
676 AC_DEFINE(HAVE_ERFCL)
680 [AC_CHECK_FUNCS(erfl erfcl)
681 have_erfl=$ac_cv_func_erfl
682 have_erfcl=$ac_cv_func_erfcl
685 if $have_erfl = no; then
686 AC_DEFINE(GNM_SUPPLIES_ERFL, 1,
687 [Define if Gnumeric supplies the erfl function]
690 if $have_erfcl = no; then
691 AC_DEFINE(GNM_SUPPLIES_ERFCL, 1,
692 [Define if Gnumeric supplies the erfcl function]
696 CFLAGS="$SAVE_CFLAGS"
699 float_msg="long double (EXPERIMENTAL)"
700 AC_MSG_WARN([Long double support is experimental -- expect problems])
701 AC_DEFINE(GNM_WITH_LONG_DOUBLE, 1,
702 [Define if the long double type is to be used]
707 dnl **************************************************
708 dnl * Check for GSettings
709 dnl **************************************************
711 AC_CHECK_LIB(gio-2.0,[g_settings_new],
712 [AC_DEFINE(HAVE_G_SETTINGS_NEW, 1,
713 [Define if the g_settings_new function is available])
717 AC_SUBST(GSETTINGS_RULES)])
718 AM_CONDITIONAL(HAVE_GSETTINGS, test $have_gsettings=yes)
720 dnl **************************************************
722 dnl **************************************************
724 AC_ARG_VAR(PERL, [The Perl executable.])
725 AC_CHECK_PROG(PERL, perl, perl)
730 AC_ARG_WITH(perl, AS_HELP_STRING([--without-perl], [Do not build the Perl plugin loader]),
735 if test "x$want_perl" = xno ; then
736 perl_reason="disabled by request"
738 if test "x$PERL" != x; then
739 BIG_CHECKING([for perl ExtUtils::Embed module])
740 if $PERL -e 'eval { require ExtUtils::Embed }; if ($@) { exit(1); } else { exit(0); }'
744 dnl Use ExtUtils::Embed to figure out the other options.
745 PERL_CCCDLFLAGS=`$PERL -MConfig -e 'print $Config{cccdlflags};'`
746 PERL_LDDLFLAGS=`$PERL -MConfig -e 'print $Config{lddlflags};'`
747 PERL_CC=`$PERL -MConfig -e 'print $Config{cc};'`
748 PERL_LD=`$PERL -MConfig -e 'print $Config{ld};'`
749 perlinc=`$PERL -MConfig -e 'print "$Config{archlib}/CORE";'`
750 PERL_CCOPTS="`$PERL -MExtUtils::Embed -e ccopts` -I$perlinc"
751 PERL_LDOPTS=`$PERL -MExtUtils::Embed -e ldopts`
753 AC_MSG_CHECKING([Checking for perl compiler, linker, libraries and headers])
754 rm -f testperl$ac_exeext testperl.$ac_objext testperl.c testperl.err
755 cat > testperl.c <<EOF
759 int main () { (void)&perl_construct; return 0; }
761 $PERL_CC $PERL_CCOPTS -c testperl.c >testperl.err 2>&1 &&
762 $PERL_LD -o testperl testperl.$ac_objext $PERL_LDOPTS >testperl.err 2>&1 &&
765 AC_MSG_RESULT($have_perl)
767 if test "x$have_perl" != xyes; then
768 perl_reason="failed to compile test program"
769 cat testperl.err testperl.c >&AS_MESSAGE_LOG_FD
772 rm -f testperl$ac_exeext testperl.$ac_objext testperl.c testperl.err
776 perl_reason="missing parts of perl"
779 perl_reason="missing perl"
783 if test "$want_perl" = xyes -a "x$have_perl" != xyes; then
784 AC_MSG_ERROR([Perl requested, but not available: $perl_reason])
787 AM_CONDITIONAL(WITH_PERL, test "x$have_perl" = xyes)
788 if test "x$have_perl" = xyes ; then
789 perl_msg="yes (using $PERL)"
791 perl_msg="no ($perl_reason)"
793 AC_SUBST(PERL_CCCDLFLAGS)
794 AC_SUBST(PERL_LDDLFLAGS)
797 AC_SUBST(PERL_CCOPTS)
798 AC_SUBST(PERL_LDOPTS)
800 dnl **************************************************
801 dnl * Check for Python
802 dnl **************************************************
808 AC_ARG_WITH(python, AS_HELP_STRING([--without-python], [Do not build the Python plugin loader]))
809 AC_ARG_VAR(PYTHON, [The Python executable.])
812 ?*) AC_MSG_ERROR([You cannot use --with-python with an argument.
813 If you want to specify a path to your Python executable, use:
814 $srcdir/configure PYTHON=/path/to/your/python ...]);;
816 if test "x$with_python" != xno; then
817 AC_CHECK_PROGS(PYTHON, python python2 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0)
818 if test "x$PYTHON" = x; then
819 python_msg="could not find python"
822 python_msg="Disabled by request"
825 if test "x$python_msg" = xyes; then
826 BIG_CHECKING([for python = 2.x])
827 [PY_VERSION=`$PYTHON -c 'import sys ; sys.stdout.write(sys.version[0:3])'`
828 major_ver=`$PYTHON -c 'import sys ; sys.stdout.write(sys.version[0:1])'`]
829 if test "x$major_ver" = "x2"; then
831 if test "x$with_native_win32" = xyes ; then
832 # 2.x on linux, 2x on win32
833 PY_VERSION=`echo $PY_VERSION | sed -e 's/\\.//'`
837 python_msg="NO. Python version \"${PY_VERSION}\" is too old."
841 if test "x$python_msg" = xyes; then
842 if test "x$PY_PREFIX" = x; then
843 PY_PREFIX=`$PYTHON -c 'import sys ; sys.stdout.write(sys.prefix)'`
845 if test "x$PY_INCLUDE_DIR" = x; then
846 if test "x$with_native_win32" = xyes ; then
847 PY_INCLUDES="-I$PY_PREFIX/include"
849 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))'`
852 PY_INCLUDES="-I$PY_INCLUDE_DIR"
855 python_msg="unable to find Python.h"
856 for py_include in $PY_INCLUDES; do
857 py_include_dir="${py_include#-I}"
858 BIG_CHECKING(Look for $py_include_dir/Python.h)
859 if test -f $py_include_dir/Python.h; then
869 if test "x$python_msg" = xyes; then
870 m4_define([pygobject_required_version], [3.0.0])
871 PKG_CHECK_MODULES(PYGOBJECT, pygobject-3.0 >= pygobject_required_version,,
872 [python_msg="Missing pygobject"])
875 AM_CONDITIONAL(WITH_PYTHON, test "x$python_msg" = xyes)
876 if test "x$python_msg" = xyes; then
877 if test "x$PY_LIB_DIR" = x; then
878 if test "x$with_native_win32" = xyes ; then
879 PY_LIB_DIR="$PY_PREFIX/libs"
881 PY_LIB_DIR=`$PYTHON -c 'import sys ; import distutils.sysconfig ; sys.stdout.write(distutils.sysconfig.get_config_var("LIBPL"))'`
885 GNM_PY_CFLAGS="$PY_INCLUDES $PYGOBJECT_CFLAGS"
886 GNM_PY_LDFLAGS="-L$PY_LIB_DIR -lpython$PY_VERSION $PYGOBJECT_LIBS"
887 python_msg="yes (using $PYTHON)"
888 elif test "x$with_python" = "xyes"; then
889 AC_MSG_ERROR([$python_msg])
892 AC_SUBST(GNM_PY_CFLAGS)
893 AC_SUBST(GNM_PY_LDFLAGS)
894 AC_SUBST(GNM_PY_LIBADD)
896 # Support for PDF docs
897 AC_ARG_ENABLE(pdfdocs,
898 AS_HELP_STRING([--enable-pdfdocs],[Generate documentation in Portable Document Format]),
899 [enable_pdfdocs=$enableval],
901 pdf_msg="No, not requested.";
902 if test x"$enable_pdfdocs" = xyes; then
904 AC_CHECK_PROG(DBCONTEXT, [dbcontext], [dbcontext], [])
905 AC_CHECK_PROG(DBLATEX, [dblatex], [dblatex], [])
906 if test x"$DBCONTEXT" = x"dbcontext"; then
909 if test x"$DBLATEX" = x"dblatex"; then
913 if test x"$pdfroute" != x""; then
914 pdf_msg="Yes, through $pdfroute."
917 Did not find a suitable tool for generating Portable Document Format from
918 DocBook XML - aborting.
920 Both the DocBook to ConTeXt and the DocBook to LaTeX conversion tool can be
922 http://dblatex.sourceforge.net/
927 AM_CONDITIONAL(ENABLE_PDFDOCS, test x"$enable_pdfdocs" = xyes)
928 AM_CONDITIONAL(ENABLE_PDF_VIA_DBCONTEXT, test x"$pdfroute" = x"dbcontext")
929 AM_CONDITIONAL(ENABLE_PDF_VIA_DBLATEX, test x"$pdfroute" = x"dblatex")
932 dnl A tricky way to comment out in m4:
934 dnl **************************************************
936 dnl **************************************************
938 mono_msg="disabled, still experimental"
940 AC_ARG_WITH(mono, AS_HELP_STRING([--with-mono], [Compile the mono scripting engine]))
942 no) mono_msg="Disabled by request";;
944 PKG_CHECK_MODULES(MONO, mono,
946 AC_DEFINE(WITH_MONO, 1, [Define if mono .NET engine is available])],
951 AM_CONDITIONAL(WITH_MONO, test "x$with_mono" = xyes)
952 AC_SUBST(MONO_CFLAGS)
956 # GObject Introspection
958 AC_ARG_ENABLE(introspection,
959 AS_HELP_STRING([--enable-introspection[=@<:@no/auto/yes@:>@]],
960 [Enable introspection for this build]),,
961 [enable_introspection=no])
963 AC_MSG_CHECKING([for gobject-introspection])
965 dnl presence/version checking
966 AS_CASE([$enable_introspection],
968 found_introspection="no (disabled, use --enable-introspection to enable)"
971 PKG_CHECK_EXISTS([gobject-introspection-1.0],,
972 AC_MSG_ERROR([gobject-introspection-1.0 is not installed]))
973 PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $GIR_REQ],
974 found_introspection=yes,
975 AC_MSG_ERROR([You need to have gobject-introspection >= $1 installed to build AC_PACKAGE_NAME]))
978 PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $GIR_REQ], found_introspection=yes, found_introspection=no)
979 dnl Canonicalize enable_introspection
980 enable_introspection=$found_introspection
983 AC_MSG_ERROR([invalid argument passed to --enable-introspection, should be one of @<:@no/auto/yes@:>@])
986 AC_MSG_RESULT([$found_introspection])
988 if test "x$found_introspection" = "xyes"; then
989 dnl You can override INTROSPECTION_GIRDIR and INTROSPECTION_TYPELIBDIR
990 dnl if you wish. If you override the latter, you might want to set
991 dnl GI_TYPELIB_PATH to include the same directory. For example
993 dnl GI_TYPELIB_PATH=$PREFIX/lib64/girepository-1.0
994 dnl INTROSPECTION_TYPELIBDIR=$GI_TYPELIB_PATH
995 dnl INTROSPECTION_GIRDIR=$PREFIX/share/gir-1.0
997 dnl Note, that unlike gnumeric's binaries, nothing tells python where
998 dnl to find gnumeric libraries, so you might also need to set
1001 INTROSPECTION_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0`
1002 INTROSPECTION_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0`
1003 INTROSPECTION_GENERATE=`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0`
1004 if test "x$INTROSPECTION_GIRDIR" = x; then
1005 INTROSPECTION_GIRDIR=`$PKG_CONFIG --variable=girdir gobject-introspection-1.0`
1007 if test "x$INTROSPECTION_TYPELIBDIR" = x; then
1008 INTROSPECTION_TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)"
1010 INTROSPECTION_CFLAGS=`$PKG_CONFIG --cflags gobject-introspection-1.0`
1011 INTROSPECTION_LIBS=`$PKG_CONFIG --libs gobject-introspection-1.0`
1012 INTROSPECTION_MAKEFILE=`$PKG_CONFIG --variable=datadir gobject-introspection-1.0`/gobject-introspection-1.0/Makefile.introspection
1014 INTROSPECTION_SCANNER=
1015 INTROSPECTION_COMPILER=
1016 INTROSPECTION_GENERATE=
1017 INTROSPECTION_GIRDIR=
1018 INTROSPECTION_TYPELIBDIR=
1019 INTROSPECTION_CFLAGS=
1021 INTROSPECTION_MAKEFILE=
1023 AC_SUBST(INTROSPECTION_SCANNER)
1024 AC_SUBST(INTROSPECTION_COMPILER)
1025 AC_SUBST(INTROSPECTION_GENERATE)
1026 AC_SUBST(INTROSPECTION_GIRDIR)
1027 AC_SUBST(INTROSPECTION_TYPELIBDIR)
1028 AC_SUBST(INTROSPECTION_CFLAGS)
1029 AC_SUBST(INTROSPECTION_LIBS)
1030 AC_SUBST(INTROSPECTION_MAKEFILE)
1032 AM_CONDITIONAL(HAVE_INTROSPECTION, test "x$found_introspection" = "xyes")
1033 dnl we need to change the install directories for distcheck
1034 AC_ARG_WITH([gir-dir],
1038 path to gir repository
1039 (automatically detected via pkg-config)
1043 [GIRDIR=$INTROSPECTION_GIRDIR]
1046 AC_ARG_WITH([typelib-dir],
1048 [--with-typelib-dir],
1050 path to typelibs repository
1051 (automatically detected via pkg-config)
1054 [TYPELIBDIR=$withval],
1055 [TYPELIBDIR=$INTROSPECTION_TYPELIBDIR]
1057 AC_SUBST(TYPELIBDIR)
1059 dnl **************************************************
1060 dnl * Config defaults
1061 dnl **************************************************
1063 dnl These are changed in gutils.c for WIN32 packages
1064 AC_SUBST(gnumeric_datadir, '${datadir}/gnumeric/${VERSION}')
1065 AC_SUBST(gnumeric_libdir, '${libdir}/gnumeric/${VERSION}')
1066 AC_SUBST(gnumeric_icondir, '${datadir}/pixmaps/gnumeric')
1067 AC_SUBST(gnumeric_localedir, '${prefix}/${DATADIRNAME}/locale')
1069 AC_SUBST(gnumeric_plugindir, '${gnumeric_libdir}/plugins')
1070 AC_SUBST(gnumeric_externplugindir, '${libdir}/gnumeric/${GNUMERIC_API_VER}/plugins')
1072 AC_SUBST(YYYYMMDD, `date +%Y%m%d`)
1074 dnl Export to gnumeric-config.h
1075 AC_DEFINE(GNM_VERSION_FULL, "gnumeric_version_full",
1076 [The version number of this release, with optional extra suffix])
1077 AC_DEFINE(GNM_VERSION_EPOCH, gnumeric_version_epoch,
1078 [The Epoch of this release])
1079 AC_DEFINE(GNM_VERSION_MAJOR, gnumeric_version_major,
1080 [The Major version number of this release])
1081 AC_DEFINE(GNM_VERSION_MINOR, gnumeric_version_minor,
1082 [The Minor version number of this release])
1083 AC_DEFINE(GNM_VERSION_EXTRA, "gnumeric_version_extra",
1084 [Extra, possibly empty tag for this release])
1085 AC_DEFINE(GNM_API_VERSION, "GNUMERIC_API_VER",
1086 [The API version number of this release])
1093 icons/16x16/Makefile
1094 icons/22x22/Makefile
1095 icons/24x24/Makefile
1096 icons/32x32/Makefile
1097 icons/48x48/Makefile
1098 icons/256x256/Makefile
1100 src/dialogs/Makefile
1101 src/widgets/Makefile
1103 src/cut-n-paste-code/Makefile
1106 doc/C/figures/Makefile
1107 doc/C/figures/icons/Makefile
1108 doc/developer/Makefile
1110 plugins/fn-christian-date/Makefile
1111 plugins/fn-complex/Makefile
1112 plugins/fn-database/Makefile
1113 plugins/fn-date/Makefile
1114 plugins/fn-derivatives/Makefile
1115 plugins/fn-eng/Makefile
1116 plugins/fn-erlang/Makefile
1117 plugins/fn-financial/Makefile
1118 plugins/fn-hebrew-date/Makefile
1119 plugins/fn-info/Makefile
1120 plugins/fn-logical/Makefile
1121 plugins/fn-lookup/Makefile
1122 plugins/fn-math/Makefile
1123 plugins/fn-numtheory/Makefile
1124 plugins/fn-r/Makefile
1125 plugins/fn-stat/Makefile
1126 plugins/fn-string/Makefile
1127 plugins/fn-random/Makefile
1128 plugins/fn-tsa/Makefile
1129 plugins/applix/Makefile
1130 plugins/dif/Makefile
1131 plugins/excel/Makefile
1132 plugins/excelplugins/Makefile
1133 plugins/gda/Makefile
1134 plugins/gnome-db/Makefile
1135 plugins/gnome-glossary/Makefile
1136 plugins/html/Makefile
1137 plugins/lotus-123/Makefile
1138 plugins/lpsolve/Makefile
1139 plugins/nlsolve/Makefile
1140 plugins/glpk/Makefile
1141 plugins/mps/Makefile
1142 plugins/oleo/Makefile
1143 plugins/openoffice/Makefile
1144 plugins/paradox/Makefile
1145 plugins/perl-func/Makefile
1146 plugins/perl-loader/Makefile
1147 plugins/plan-perfect/Makefile
1148 plugins/psiconv/Makefile
1149 plugins/py-func/Makefile
1150 plugins/python-loader/Makefile
1151 plugins/qpro/Makefile
1152 plugins/sample_datasource/Makefile
1154 plugins/sylk/Makefile
1155 plugins/uihello/Makefile
1156 plugins/xbase/Makefile
1158 po-functions/Makefile.in
1160 schemas/org.gnome.gnumeric.gschema.xml.in
1161 schemas/org.gnome.gnumeric.dialogs.gschema.xml.in
1162 schemas/org.gnome.gnumeric.plugin.gschema.xml.in
1164 templates/english/Makefile
1165 templates/autoformat/Makefile
1168 tools/win32/Makefile
1169 tools/win32/moduleset
1170 tools/win32/gnumeric.nsi
1178 Source code location: ${srcdir}
1180 Compiler flags: ${CFLAGS}
1181 Floating point type: ${float_msg}
1185 Perl Support: ${perl_msg}
1186 Python Support: ${python_msg}
1188 GDA support: ${gda_msg}
1189 GNOME-DB support: ${gnomedb_msg}
1190 Psiconv support: ${psiconv_msg}
1192 PDF documentation: ${pdf_msg}
1194 # Mono support: ${mono_msg}
1195 # Guile Support: ${guile_msg}