2 dnl We require Automake 1.7.2, which requires Autoconf 2.54.
3 dnl (It needs _AC_AM_CONFIG_HEADER_HOOK, for example.)
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], [40])
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([
19 AC_INIT([gnumeric], [gnumeric_version_full],
20 [https://bugzilla.gnome.org/enter_bug.cgi?product=gnumeric],,
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
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.
32 dnl OTOH, we are not able to keep ABI strictly backward compatible throughout
34 dnl The easiest way is to declare no ABI compatibility, ie. AGE is always 0.
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])
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
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
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)
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])
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:
88 if test "$ac_cv_prog_cc_c99" = no; then
89 AC_MSG_ERROR([*** c99 is required])
93 if test "x$ac_cv_prog_YACC" = x; then
94 AC_MSG_ERROR([*** bison or equivalent is required])
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 *****************************
110 dnl zlib is needed for the excel plugin; see plugins/excel/Makefile.am
112 _cppflags="${CPPFLAGS}"
113 _ldflags="${LDFLAGS}"
116 AS_HELP_STRING([--with-zlib=DIR], [use libz in DIR]),
120 CPPFLAGS="${CPPFLAGS} -I$withval/include"
121 LDFLAGS="${LDFLAGS} -L$withval/lib"
125 if test "x$with_zlib" != xno; then
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"
137 *-*-solaris*) Z_LIBS="-L${Z_DIR}/lib -R${Z_DIR}/lib -lz" ;;
138 *) Z_LIBS="-L${Z_DIR}/lib -lz" ;;
146 CPPFLAGS=${_cppflags}
152 # Goffice releases are parallel installable, which do we depend on
153 GOFFICE_API_VER="0.10"
154 AC_SUBST(GOFFICE_API_VER)
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.40
173 gnumeric_reqs="$libspreadsheet_reqs
175 gobject-2.0 >= 2.38.0
176 gmodule-2.0 >= 2.38.0
177 gthread-2.0 >= 2.38.0
181 libspreadsheet_gtk_reqs="
185 gnumeric_gtk_reqs="$libspreadsheet_gtk_reqs"
191 mingw* | pw32* | cygwin*)
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])
206 dnl We shouldn't silently default to --without-gtk.
207 dnl If the requirements are not met, fail.
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)
237 with_native_win32=yes
238 AC_ARG_VAR(WINDRES, [The windres executable (used by win32 builds only).])
239 AC_CHECK_TOOL(WINDRES, windres, :)
242 AM_CONDITIONAL(WITH_WIN32, test $with_win32 = yes)
243 AM_CONDITIONAL(WITH_NATIVE_WIN32, test $with_native_win32 = yes)
244 AM_CONDITIONAL(CROSS_COMPILING, test x"$cross_compiling" != xno)
246 if test "x$with_win32" = "xyes"; then
247 GNUMERIC_PLUGIN_LDFLAGS="-avoid-version -no-undefined $GNUMERIC_LIBS -Wl,--enable-runtime-pseudo-reloc,--export-all-symbols \$(top_builddir)/src/libspreadsheet.la -s"
249 GNUMERIC_PLUGIN_LDFLAGS="-avoid-version"
251 AC_SUBST(GNUMERIC_PLUGIN_LDFLAGS)
253 dnl **************************************************
254 dnl This needs to be done before we add aggressive -Werror=foo flags
256 AC_SUBST(GETTEXT_PACKAGE, gnumeric-${VERSION})
257 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",
258 [The package name, for gettext])
261 dnl ****************************
262 dnl prep the pixmap generator
263 dnl ****************************
265 AC_ARG_VAR(GLIB_GENMARSHAL, [The glib-genmarshal executable.])
266 AC_CHECK_PROG(GLIB_GENMARSHAL, glib-genmarshal$ac_exeext, glib-genmarshal$ac_exeext)
267 GLIB_COMPILE_RESOURCES=`$PKG_CONFIG --variable=glib_compile_resources gio-2.0`
268 AC_SUBST(GLIB_COMPILE_RESOURCES)
270 AC_ARG_VAR(GDK_PIXBUF_CSOURCE, [The gdk-pixbuf-csource executable.])
271 AC_CHECK_PROG(GDK_PIXBUF_CSOURCE, gdk-pixbuf-csource$ac_exeext, gdk-pixbuf-csource$ac_exeext)
273 AC_ARG_ENABLE(component,
274 AS_HELP_STRING([--disable-component], [Do not build the goffice component]),
275 [], [enable_component=yes])
277 if test x"$enable_component" = xyes; then
278 component_dir="component"
282 AC_SUBST(COMPONENT_DIR, $component_dir)
284 dnl ****************************
286 dnl ****************************
291 AS_HELP_STRING([--with-gda], [Compile the Gnome Database Access plugin]),
292 if test "x$withval" != xyes; then
294 gda_msg="Disabled by request"
297 if test "$try_gda" = true; then
298 PKG_CHECK_MODULES(GDA, [libgda-5.0 >= 5.0.0, libgda-ui-5.0 >= 5.0.0],
300 [gda_msg="NO. libgda problem"])
301 if test "$gda_msg" = yes; then
302 PKG_CHECK_MODULES(GNOMEDB, [libgnomedb-4.0 >= 3.99.6],
304 [gnomedb_msg="NO. libgnomedb problem"])
305 if test "$gnomedb_msg" = yes; then
306 AC_DEFINE(HAVE_LIBGNOMEDB, 1, [ Define if libgnomedb support is compiled in])
310 AM_CONDITIONAL(WITH_GDA, test x"$gda_msg" = xyes)
314 AM_CONDITIONAL(WITH_GNOMEDB, test x"$gnomedb_msg" = xyes)
315 AC_SUBST(GNOMEDB_CFLAGS)
316 AC_SUBST(GNOMEDB_LIBS)
318 dnl ****************************
320 AC_CHECK_DECL(fdopen, fdopen_works=yes, fdopen_works=no)
322 if test $fdopen_works = no ; then
323 unset ac_cv_have_decl_fdopen
324 CFLAGS="$CFLAGS -D_POSIX_SOURCE"
325 AC_MSG_NOTICE([adding -D_POSIX_SOURCE to CFLAGS])
326 AC_CHECK_DECL(fdopen, fdopen_works=yes, fdopen_works=no)
327 if test $fdopen_works = no ; then
328 AC_MSG_ERROR([fdopen is not available])
332 # Unfortunately, -D_POSIX_SOURCE turns off struct timeval on Solaris
333 AC_MSG_CHECKING([whether struct timeval is available])
335 [AC_LANG_PROGRAM([[#include <sys/time.h>]], [[struct timeval tv;]])],
336 [struct_timeval_works=yes],
337 [struct_timeval_works=no])
338 AC_MSG_RESULT($struct_timeval_works)
340 if test $struct_timeval_works = no ; then
341 CFLAGS="$CFLAGS -D__EXTENSIONS__"
342 AC_MSG_CHECKING([whether struct timeval is available with -D__EXTENSIONS__])
344 [AC_LANG_PROGRAM([[#include <sys/time.h>]], [[struct timeval tv;]])],
345 [struct_timeval_works=yes],
346 [struct_timeval_works=no])
347 AC_MSG_RESULT($struct_timeval_works)
348 if test $struct_timeval_works = no ; then
349 AC_MSG_ERROR([struct timeval is not available])
353 dnl src/functions/fn-math.c uses M_PI
355 AC_MSG_CHECKING([whether M_PI is available])
357 [AC_LANG_PROGRAM([[#include <math.h>]], [[double f = M_PI]])],
358 [works_without_bsd_source=yes],
359 [works_without_bsd_source=no])
360 AC_MSG_RESULT($works_without_bsd_source)
362 if test $works_without_bsd_source = no ; then
363 CFLAGS="$CFLAGS -D_BSD_SOURCE"
364 AC_MSG_CHECKING([whether M_PI is available with -D_BSD_SOURCE])
366 [AC_LANG_PROGRAM([[#include <math.h>]], [[double f = M_PI]])],
369 AC_MSG_RESULT($m_pi_works)
370 if test $m_pi_works = no ; then
371 AC_MSG_ERROR([M_PI is not available])
379 dnl Comment out the guile block:
381 dnl check for guile 1.5
383 guile_msg="disabled pending some guile developer interest"
386 AS_HELP_STRING([--with-guile], [Compile with Guile support or without it]),
387 if test "x$withval" = xyes; then
392 AC_MSG_CHECKING(for guile >= 1.5)
393 if test "`guile -c '(display (string>=? (version) "1.4.1"))'`" != "#t"; then
394 AC_MSG_RESULT([Your Guile is too old. You need Guile 1.5 or later.])
401 if $enable_guile; then
404 AM_CONDITIONAL(WITH_GUILE, $enable_guile)
407 dnl **************************************************
408 dnl * psiconv support
409 dnl **************************************************
412 AS_HELP_STRING([--without-psiconv], [Compile without Psiconv support]))
413 AC_ARG_VAR(PSICONV_CONFIG, [The psiconv-config executable.])
414 if test "x$with_psiconv" != xno; then
415 AC_CHECK_PROG(PSICONV_CONFIG,psiconv-config,psiconv-config)
416 if test x"$PSICONV_CONFIG" = x; then
417 psiconv_msg="missing dependencies"
419 AC_MSG_CHECKING(for psiconv >= 0.9.3)
420 if $PSICONV_CONFIG --version | awk -F. \
421 '{exit !($1 > 0 || $2 > 9 || ($2 == 9 && $3 >= 3))}'
423 PSICONV_CFLAGS=`$PSICONV_CONFIG --cflags`
424 PSICONV_LIBS=`$PSICONV_CONFIG --libs`
429 AC_MSG_RESULT($psiconv_msg)
434 AM_CONDITIONAL(WITH_PSICONV, test "x$psiconv_msg" = xyes)
435 AC_SUBST(PSICONV_LIBS)
436 AC_SUBST(PSICONV_CFLAGS)
441 AS_HELP_STRING([--without-paradox], [Compile without Paradox support]),
442 if test "x$withval" = xno; then
447 if $try_paradox; then
448 PKG_CHECK_MODULES(PARADOX,
451 [paradox_msg="missing dependencies"])
454 if test "x$paradox_msg" = xyes; then
456 LIBS="$LIBS $PARADOX_LIBS"
457 AC_CHECK_FUNC(PX_open_gsf,[ enable_paradox=true ],)
461 AM_CONDITIONAL(WITH_PARADOX, $enable_paradox)
462 AC_SUBST(PARADOX_LIBS)
463 AC_SUBST(PARADOX_CFLAGS)
465 plugin_list_given=false
467 AC_ARG_ENABLE(plugins,
468 AS_HELP_STRING([--enable-plugins="text html"], [Compile only the listed plugins]),
469 [plugin_list_given=true
470 test "x$enableval" != xno && PLUGIN_LIST=$enableval
472 AM_CONDITIONAL(PLUGIN_LIST_GIVEN, $plugin_list_given)
473 AC_SUBST(PLUGIN_LIST)
476 for lang in $ALL_LINGUAS; do
477 POFILES_FULL="$POFILES_FULL \$(top_srcdir)/po/$lang.po"
479 AC_SUBST(POFILES_FULL)
482 dnl Code to handle po-functions/Makefile* and po-functions/POTFILES*
484 dnl First, let me document how the po/ directory is dealt with.
485 dnl Dark mysteries here, so skip the next paragraph if you don't have enough
486 dnl holy water at your hand. You have been warned.
488 dnl AM_GLIB_GNU_GETTEXT creates an incorrect incarnation of po/POTFILES, as
489 dnl glib-gettext.m4 doesn't know about intltool tags. Later on, just before
490 dnl config.status is created, a code originating from intltool.m4 creates
491 dnl POTFILES again, this time correctly removing the intltool tags.
492 dnl config.status then creates po/Makefile, again in two steps. First,
493 dnl po/Makefile.in is created from po/Makefile.in.in the usual way, and then
494 dnl a code registered via the obsolete macro AC_OUTPUT_COMMANDS insterts the
495 dnl contents of file POTFILES to po/Makefile.
497 dnl But both glib-gettext and intltool have the dirname "po/" hardwired, so
498 dnl we are on our own with po-functions.
500 dnl We use a more straightforward approach for po-functions:
501 dnl 1) We create POTFILES immediately here.
502 dnl 2) We let config.status to create Makefile.in.
503 dnl 3) We use AC_CONFIG_COMMANDS to create Makefile.
505 [# Create po-functions/POTFILES:
506 if test -d po-functions; then
507 rm -f po-functions/POTFILES
513 [\\/]* | ?:[\\/]* ) # Absolute name.
514 top_srcdir="$srcdir" ;;
515 *) top_srcdir="../$srcdir" ;;
517 sed <$srcdir/po-functions/POTFILES.in -e '/^#/d' -e 's/^[[].*[]] *//' \
518 -e '/^[ ]*$/d' -e "s,^, $top_srcdir/," | \
519 sed -e '$!s/$/ \\/' >po-functions/POTFILES
521 dnl Finally, register for creation of po-functions/Makefile:
522 dnl We do not currently do anything here.
523 AC_CONFIG_COMMANDS(po-functions/Makefile,
524 [cp po-functions/Makefile.in po-functions/Makefile])
527 LIBS="$LIBS $GNUMERIC_LIBS"
528 AC_CHECK_FUNCS(mkfifo)
534 dnl Check for some functions
535 AC_CHECK_FUNCS(uname setenv putenv)
537 dnl FIXME: Does this really belong here?
538 AC_CHECK_FUNC(bind_textdomain_codeset,,[AC_CHECK_LIB(intl,bind_textdomain_codeset)])
540 dnl check for complete locale implementation
541 AC_CHECK_HEADERS(langinfo.h)
544 AC_CHECK_HEADERS(sys/resource.h)
546 dnl we need to check fpu mode
547 AC_CHECK_HEADERS(fpu_control.h)
551 CFLAGS="$CFLAGS $GNUMERIC_CFLAGS"
552 LIBS="$GNUMERIC_LIBS $LIBS"
554 AC_CHECK_FUNCS(gtk_cell_renderer_text_get_background_set gtk_cell_renderer_text_get_foreground_set gtk_cell_renderer_text_get_editable)
555 AC_CHECK_FUNCS(gtk_entry_set_editing_cancelled gtk_icon_theme_add_resource_path)
557 AC_MSG_CHECKING([for PANGO_WEIGHT_THIN etc.])
558 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pango/pango.h>]],
559 [[(void)(PANGO_WEIGHT_THIN == 42);
560 (void)(PANGO_WEIGHT_MEDIUM == 42);
561 (void)(PANGO_WEIGHT_ULTRAHEAVY == 42);]])],
562 [AC_DEFINE(HAVE_PANGO_WEIGHT_THIN_ETC, 1, [Define if PANGO_WEIGHT_THIN etc are available])
566 AC_MSG_CHECKING([for OO_NS_LOCALC_EXT])
567 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <gsf/gsf.h>]],
568 [[(void)(OO_NS_LOCALC_EXT == OO_NS_LOCALC_EXT);]])],
569 [AC_DEFINE(HAVE_OO_NS_LOCALC_EXT, 1, [Define if OO_NS_LOCALC_EXT is available])
576 dnl We supply our own lgamma and lgamma_r when missing.
578 AC_CHECK_FUNCS(lgamma_r)
579 if test $ac_cv_func_lgamma_r = no; then
580 AC_CHECK_LIB(m, lgamma_r,
581 [AC_DEFINE(HAVE_LGAMMA_R, 1,
582 [Define if the lgamma_r function is available]
589 if test $supply_lgamma_r = yes; then
590 AC_DEFINE(GNM_SUPPLIES_LGAMMA_R, 1,
591 [Define if Gnumeric supplies the lgamma_r function]
594 AC_CHECK_FUNCS(lgamma)
595 if test $ac_cv_func_lgamma = no; then
596 AC_DEFINE(GNM_SUPPLIES_LGAMMA, 1,
597 [Define if Gnumeric supplies the lgamma function]
602 AC_MSG_CHECKING([cos is reliable])
609 const char *s = "1.5689793435451356";
612 int ok = (c > 0 && c < 0.05);
619 [AC_MSG_RESULT(assuming it is)])
621 if test "x$with_win32" = "xyes" -o "x$cos_works" = "xno"; then
622 AC_DEFINE(GNM_REDUCES_TRIG_RANGE, 1,
623 [Define if Gnumeric reduces the argument range of sin/cos/tan]
628 AC_ARG_WITH(long_double,
629 AS_HELP_STRING([--with-long-double], [Use long double for floating point]),
630 [if test "x$withval" = xyes; then
631 SAVE_CFLAGS="$CFLAGS"
633 CFLAGS="$GNUMERIC_CFLAGS"
634 LIBS="$GNUMERIC_LIBS -lm"
636 AC_CHECK_HEADERS(sunmath.h)
638 AC_CHECK_FUNCS(go_render_generall,
640 AC_MSG_ERROR([libgoffice needs to be compiled with long double support.]))
642 AC_CHECK_FUNCS(fabsl sqrtl expl expm1l logl log2l log10l log1pl ceill floorl powl hypotl \
643 sinl cosl tanl asinl acosl atanl atan2l fmodl lgammal lgammal_r \
644 sinhl coshl tanhl asinhl acoshl atanhl \
647 AC_MSG_ERROR([Long doubles require the $ldfunc function.]))
649 AC_MSG_CHECKING([checking for working erfl and erfcl])
655 #ifdef HAVE_SUNMATH_H
660 long double l1 = erfl (1.2L);
661 long double l2 = erfcl (1.2L);
662 return !(l1 >= 0.91 && l1 <= 0.92 &&
663 l2 >= 0.08 && l2 <= 0.09);
665 [AC_DEFINE(HAVE_ERFL)
667 AC_DEFINE(HAVE_ERFCL)
671 [AC_CHECK_FUNCS(erfl erfcl)
672 have_erfl=$ac_cv_func_erfl
673 have_erfcl=$ac_cv_func_erfcl
676 if $have_erfl = no; then
677 AC_DEFINE(GNM_SUPPLIES_ERFL, 1,
678 [Define if Gnumeric supplies the erfl function]
681 if $have_erfcl = no; then
682 AC_DEFINE(GNM_SUPPLIES_ERFCL, 1,
683 [Define if Gnumeric supplies the erfcl function]
687 CFLAGS="$SAVE_CFLAGS"
690 float_msg="long double (EXPERIMENTAL)"
691 AC_MSG_WARN([Long double support is experimental -- expect problems])
692 AC_DEFINE(GNM_WITH_LONG_DOUBLE, 1,
693 [Define if the long double type is to be used]
698 ## this should come after `AC_PROG_CC'
699 set_more_warnings=yes
700 if test "$GCC" = yes -a "x$set_more_warnings" != xno; then
701 dnl Clang needs this option, or else it will appear to support any
702 dnl warning option, only to spew warnings about them later.
703 uwoption="-Werror=unknown-warning-option"
704 SAVE_CFLAGS="$CFLAGS"
705 CFLAGS="$CFLAGS $uwoption"
706 AC_MSG_CHECKING([whether gcc understands $uwoption])
708 [AC_LANG_PROGRAM([], [])],
709 [has_unknown_warning_option=yes],
710 [has_unknown_warning_option=no; uwoption=""])
711 AC_MSG_RESULT($has_unknown_warning_option)
712 CFLAGS="$SAVE_CFLAGS"
714 warning_options="-Wall -Werror=init-self -Werror=missing-include-dirs \
715 -Wsign-compare -Werror=pointer-arith \
716 -Wchar-subscripts -Wwrite-strings \
717 -Wdeclaration-after-statement -Wnested-externs \
719 -Werror=missing-prototypes -Werror=nested-externs \
720 -Werror=implicit-function-declaration \
721 -Wmissing-declarations -Wno-pointer-sign \
722 -Werror=format-security -Wbitwise -Wcast-to-as \
723 -Wdefault-bitfield-sign -Wdo-while -Wparen-string \
724 -Wptr-subtraction-blows -Wreturn-void -Wtypesign \
725 -Wstrict-prototypes -Wno-error=format-nonliteral "
726 for option in $warning_options ; do
727 SAVE_CFLAGS="$CFLAGS"
728 CFLAGS="$CFLAGS $uwoption $option"
729 AC_MSG_CHECKING([whether gcc understands $option])
730 dnl Include a system header so we ignore Werror=... flags
731 dnl that cause trouble.
733 [AC_LANG_PROGRAM([[#include <stdio.h>]], [])],
736 CFLAGS="$SAVE_CFLAGS"
737 if test $has_option = yes; then
738 CFLAGS="$CFLAGS $option"
740 AC_MSG_RESULT($has_option)
746 AC_SUBST(WARN_CFLAGS)
748 dnl **************************************************
749 dnl * Check for GSettings
750 dnl **************************************************
752 AC_CHECK_LIB(gio-2.0,[g_settings_new],
753 [AC_DEFINE(HAVE_G_SETTINGS_NEW, 1,
754 [Define if the g_settings_new function is available])
758 AC_SUBST(GSETTINGS_RULES)])
759 AM_CONDITIONAL(HAVE_GSETTINGS, test $have_gsettings=yes)
761 dnl **************************************************
763 dnl **************************************************
765 AC_ARG_VAR(PERL, [The Perl executable.])
766 AC_CHECK_PROG(PERL, perl, perl)
771 AC_ARG_WITH(perl, AS_HELP_STRING([--without-perl], [Do not build the Perl plugin loader]),
776 if test "x$want_perl" = xno ; then
777 perl_reason="disabled by request"
779 if test "x$PERL" != x; then
780 BIG_CHECKING([for perl ExtUtils::Embed module])
781 if $PERL -e 'eval { require ExtUtils::Embed }; if ($@) { exit(1); } else { exit(0); }'
785 dnl Use ExtUtils::Embed to figure out the other options.
786 PERL_CCCDLFLAGS=`$PERL -MConfig -e 'print $Config{cccdlflags};'`
787 PERL_LDDLFLAGS=`$PERL -MConfig -e 'print $Config{lddlflags};'`
788 PERL_CC=`$PERL -MConfig -e 'print $Config{cc};'`
789 PERL_LD=`$PERL -MConfig -e 'print $Config{ld};'`
790 perlinc=`$PERL -MConfig -e 'print "$Config{archlib}/CORE";'`
791 PERL_CCOPTS="`$PERL -MExtUtils::Embed -e ccopts` -I$perlinc"
792 PERL_LDOPTS=`$PERL -MExtUtils::Embed -e ldopts`
794 AC_MSG_CHECKING([Checking for perl compiler, linker, libraries and headers])
795 rm -f testperl$ac_exeext testperl.$ac_objext testperl.c testperl.err
796 cat > testperl.c <<EOF
800 int main () { (void)&perl_construct; return 0; }
802 $PERL_CC $PERL_CCOPTS -c testperl.c >testperl.err 2>&1 &&
803 $PERL_LD -o testperl testperl.$ac_objext $PERL_LDOPTS >testperl.err 2>&1 &&
806 AC_MSG_RESULT($have_perl)
808 if test "x$have_perl" != xyes; then
809 perl_reason="failed to compile test program"
810 cat testperl.err testperl.c >&AS_MESSAGE_LOG_FD
813 rm -f testperl$ac_exeext testperl.$ac_objext testperl.c testperl.err
817 perl_reason="missing parts of perl"
820 perl_reason="missing perl"
824 if test "$want_perl" = xyes -a "x$have_perl" != xyes; then
825 AC_MSG_ERROR([Perl requested, but not available: $perl_reason])
828 AM_CONDITIONAL(WITH_PERL, test "x$have_perl" = xyes)
829 if test "x$have_perl" = xyes ; then
830 perl_msg="yes (using $PERL)"
832 perl_msg="no ($perl_reason)"
834 AC_SUBST(PERL_CCCDLFLAGS)
835 AC_SUBST(PERL_LDDLFLAGS)
838 AC_SUBST(PERL_CCOPTS)
839 AC_SUBST(PERL_LDOPTS)
841 dnl **************************************************
842 dnl * Check for Python
843 dnl **************************************************
849 AC_ARG_WITH(python, AS_HELP_STRING([--without-python], [Do not build the Python plugin loader]))
850 AC_ARG_VAR(PYTHON, [The Python executable.])
853 ?*) AC_MSG_ERROR([You cannot use --with-python with an argument.
854 If you want to specify a path to your Python executable, use:
855 $srcdir/configure PYTHON=/path/to/your/python ...]);;
857 if test "x$with_python" != xno; then
858 AC_CHECK_PROGS(PYTHON, python python2 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0)
859 if test "x$PYTHON" = x; then
860 python_msg="could not find python"
863 python_msg="Disabled by request"
866 if test "x$python_msg" = xyes; then
867 BIG_CHECKING([for python = 2.x])
868 [PY_VERSION=`$PYTHON -c 'import sys ; sys.stdout.write(sys.version[0:3])'`
869 major_ver=`$PYTHON -c 'import sys ; sys.stdout.write(sys.version[0:1])'`]
870 if test "x$major_ver" = "x2"; then
872 if test "x$with_native_win32" = xyes ; then
873 # 2.x on linux, 2x on win32
874 PY_VERSION=`echo $PY_VERSION | sed -e 's/\\.//'`
878 python_msg="NO. Python version \"${PY_VERSION}\" is too old."
882 if test "x$python_msg" = xyes; then
883 if test "x$PY_PREFIX" = x; then
884 PY_PREFIX=`$PYTHON -c 'import sys ; sys.stdout.write(sys.prefix)'`
886 if test "x$PY_INCLUDE_DIR" = x; then
887 if test "x$with_native_win32" = xyes ; then
888 PY_INCLUDES="-I$PY_PREFIX/include"
890 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))'`
893 PY_INCLUDES="-I$PY_INCLUDE_DIR"
896 python_msg="unable to find Python.h"
897 for py_include in $PY_INCLUDES; do
898 py_include_dir="${py_include#-I}"
899 BIG_CHECKING(Look for $py_include_dir/Python.h)
900 if test -f $py_include_dir/Python.h; then
910 if test "x$python_msg" = xyes; then
911 m4_define([pygobject_required_version], [3.0.0])
912 PKG_CHECK_MODULES(PYGOBJECT, pygobject-3.0 >= pygobject_required_version,,
913 [python_msg="Missing pygobject"])
916 AM_CONDITIONAL(WITH_PYTHON, test "x$python_msg" = xyes)
917 if test "x$python_msg" = xyes; then
918 if test "x$PY_LIB_DIR" = x; then
919 if test "x$with_native_win32" = xyes ; then
920 PY_LIB_DIR="$PY_PREFIX/libs"
922 PY_LIB_DIR=`$PYTHON -c 'import sys ; import distutils.sysconfig ; sys.stdout.write(distutils.sysconfig.get_config_var("LIBPL"))'`
926 GNM_PY_CFLAGS="$PY_INCLUDES $PYGOBJECT_CFLAGS"
927 GNM_PY_LDFLAGS="-L$PY_LIB_DIR -lpython$PY_VERSION $PYGOBJECT_LIBS"
928 python_msg="yes (using $PYTHON)"
929 elif test "x$with_python" = "xyes"; then
930 AC_MSG_ERROR([$python_msg])
933 AC_SUBST(GNM_PY_CFLAGS)
934 AC_SUBST(GNM_PY_LDFLAGS)
935 AC_SUBST(GNM_PY_LIBADD)
939 # Support for PDF docs
940 AC_ARG_ENABLE(pdfdocs,
941 AS_HELP_STRING([--enable-pdfdocs],[Generate documentation in Portable Document Format]),
942 [enable_pdfdocs=$enableval],
944 pdf_msg="No, not requested.";
945 if test x"$enable_pdfdocs" = xyes; then
947 AC_CHECK_PROG(DBCONTEXT, [dbcontext], [dbcontext], [])
948 AC_CHECK_PROG(DBLATEX, [dblatex], [dblatex], [])
949 if test x"$DBCONTEXT" = x"dbcontext"; then
952 if test x"$DBLATEX" = x"dblatex"; then
956 if test x"$pdfroute" != x""; then
957 pdf_msg="Yes, through $pdfroute."
960 Did not find a suitable tool for generating Portable Document Format from
961 DocBook XML - aborting.
963 Both the DocBook to ConTeXt and the DocBook to LaTeX conversion tool can be
965 http://dblatex.sourceforge.net/
970 AM_CONDITIONAL(ENABLE_PDFDOCS, test x"$enable_pdfdocs" = xyes)
971 AM_CONDITIONAL(ENABLE_PDF_VIA_DBCONTEXT, test x"$pdfroute" = x"dbcontext")
972 AM_CONDITIONAL(ENABLE_PDF_VIA_DBLATEX, test x"$pdfroute" = x"dblatex")
975 dnl A tricky way to comment out in m4:
977 dnl **************************************************
979 dnl **************************************************
981 mono_msg="disabled, still experimental"
983 AC_ARG_WITH(mono, AS_HELP_STRING([--with-mono], [Compile the mono scripting engine]))
985 no) mono_msg="Disabled by request";;
987 PKG_CHECK_MODULES(MONO, mono,
989 AC_DEFINE(WITH_MONO, 1, [Define if mono .NET engine is available])],
994 AM_CONDITIONAL(WITH_MONO, test "x$with_mono" = xyes)
995 AC_SUBST(MONO_CFLAGS)
999 # GObject Introspection
1001 AC_ARG_ENABLE(introspection,
1002 AS_HELP_STRING([--enable-introspection[=@<:@no/auto/yes@:>@]],
1003 [Enable introspection for this build]),,
1004 [enable_introspection=no])
1006 AC_MSG_CHECKING([for gobject-introspection])
1008 dnl presence/version checking
1009 AS_CASE([$enable_introspection],
1011 found_introspection="no (disabled, use --enable-introspection to enable)"
1014 PKG_CHECK_EXISTS([gobject-introspection-1.0],,
1015 AC_MSG_ERROR([gobject-introspection-1.0 is not installed]))
1016 PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $GIR_REQ],
1017 found_introspection=yes,
1018 AC_MSG_ERROR([You need to have gobject-introspection >= $1 installed to build AC_PACKAGE_NAME]))
1021 PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $GIR_REQ], found_introspection=yes, found_introspection=no)
1022 dnl Canonicalize enable_introspection
1023 enable_introspection=$found_introspection
1026 AC_MSG_ERROR([invalid argument passed to --enable-introspection, should be one of @<:@no/auto/yes@:>@])
1029 AC_MSG_RESULT([$found_introspection])
1031 if test "x$found_introspection" = "xyes"; then
1032 dnl You can override INTROSPECTION_GIRDIR and INTROSPECTION_TYPELIBDIR
1033 dnl if you wish. If you override the latter, you might want to set
1034 dnl GI_TYPELIB_PATH to include the same directory. For example
1036 dnl GI_TYPELIB_PATH=$PREFIX/lib64/girepository-1.0
1037 dnl INTROSPECTION_TYPELIBDIR=$GI_TYPELIB_PATH
1038 dnl INTROSPECTION_GIRDIR=$PREFIX/share/gir-1.0
1040 dnl Note, that unlike gnumeric's binaries, nothing tells python where
1041 dnl to find gnumeric libraries, so you might also need to set
1042 dnl LD_LIBRARY_PATH.
1044 INTROSPECTION_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0`
1045 INTROSPECTION_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0`
1046 INTROSPECTION_GENERATE=`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0`
1047 if test "x$INTROSPECTION_GIRDIR" = x; then
1048 INTROSPECTION_GIRDIR=`$PKG_CONFIG --variable=girdir gobject-introspection-1.0`
1050 if test "x$INTROSPECTION_TYPELIBDIR" = x; then
1051 INTROSPECTION_TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)"
1053 INTROSPECTION_CFLAGS=`$PKG_CONFIG --cflags gobject-introspection-1.0`
1054 INTROSPECTION_LIBS=`$PKG_CONFIG --libs gobject-introspection-1.0`
1055 INTROSPECTION_MAKEFILE=`$PKG_CONFIG --variable=datadir gobject-introspection-1.0`/gobject-introspection-1.0/Makefile.introspection
1057 INTROSPECTION_SCANNER=
1058 INTROSPECTION_COMPILER=
1059 INTROSPECTION_GENERATE=
1060 INTROSPECTION_GIRDIR=
1061 INTROSPECTION_TYPELIBDIR=
1062 INTROSPECTION_CFLAGS=
1064 INTROSPECTION_MAKEFILE=
1066 AC_SUBST(INTROSPECTION_SCANNER)
1067 AC_SUBST(INTROSPECTION_COMPILER)
1068 AC_SUBST(INTROSPECTION_GENERATE)
1069 AC_SUBST(INTROSPECTION_GIRDIR)
1070 AC_SUBST(INTROSPECTION_TYPELIBDIR)
1071 AC_SUBST(INTROSPECTION_CFLAGS)
1072 AC_SUBST(INTROSPECTION_LIBS)
1073 AC_SUBST(INTROSPECTION_MAKEFILE)
1075 AM_CONDITIONAL(HAVE_INTROSPECTION, test "x$found_introspection" = "xyes")
1076 dnl we need to change the install directories for distcheck
1077 AC_ARG_WITH([gir-dir],
1081 path to gir repository
1082 (automatically detected via pkg-config)
1086 [GIRDIR=$INTROSPECTION_GIRDIR]
1089 AC_ARG_WITH([typelib-dir],
1091 [--with-typelib-dir],
1093 path to typelibs repository
1094 (automatically detected via pkg-config)
1097 [TYPELIBDIR=$withval],
1098 [TYPELIBDIR=$INTROSPECTION_TYPELIBDIR]
1100 AC_SUBST(TYPELIBDIR)
1102 dnl **************************************************
1103 dnl * Config defaults
1104 dnl **************************************************
1106 dnl These are changed in gutils.c for WIN32 packages
1107 AC_SUBST(gnumeric_datadir, '${datadir}/gnumeric/${VERSION}')
1108 AC_SUBST(gnumeric_libdir, '${libdir}/gnumeric/${VERSION}')
1109 AC_SUBST(gnumeric_icondir, '${datadir}/pixmaps/gnumeric')
1110 AC_SUBST(gnumeric_localedir, '${prefix}/${DATADIRNAME}/locale')
1112 AC_SUBST(gnumeric_plugindir, '${gnumeric_libdir}/plugins')
1113 AC_SUBST(gnumeric_externplugindir, '${libdir}/gnumeric/${GNUMERIC_API_VER}/plugins')
1115 AC_SUBST(YYYYMMDD, `date +%Y%m%d`)
1117 dnl Export to gnumeric-config.h
1118 AC_DEFINE(GNM_VERSION_FULL, "gnumeric_version_full",
1119 [The version number of this release, with optional extra suffix])
1120 AC_DEFINE(GNM_VERSION_EPOCH, gnumeric_version_epoch,
1121 [The Epoch of this release])
1122 AC_DEFINE(GNM_VERSION_MAJOR, gnumeric_version_major,
1123 [The Major version number of this release])
1124 AC_DEFINE(GNM_VERSION_MINOR, gnumeric_version_minor,
1125 [The Minor version number of this release])
1126 AC_DEFINE(GNM_VERSION_EXTRA, "gnumeric_version_extra",
1127 [Extra, possibly empty tag for this release])
1128 AC_DEFINE(GNM_API_VERSION, "GNUMERIC_API_VER",
1129 [The API version number of this release])
1136 icons/16x16/Makefile
1137 icons/16x16/actions/Makefile
1138 icons/16x16/apps/Makefile
1139 icons/22x22/Makefile
1140 icons/22x22/actions/Makefile
1141 icons/22x22/apps/Makefile
1142 icons/24x24/Makefile
1143 icons/24x24/actions/Makefile
1144 icons/24x24/apps/Makefile
1145 icons/32x32/Makefile
1146 icons/32x32/actions/Makefile
1147 icons/32x32/apps/Makefile
1148 icons/48x48/Makefile
1149 icons/48x48/actions/Makefile
1150 icons/48x48/apps/Makefile
1151 icons/256x256/Makefile
1152 icons/256x256/apps/Makefile
1154 src/dialogs/Makefile
1155 src/widgets/Makefile
1157 src/cut-n-paste-code/Makefile
1160 plugins/fn-christian-date/Makefile
1161 plugins/fn-complex/Makefile
1162 plugins/fn-database/Makefile
1163 plugins/fn-date/Makefile
1164 plugins/fn-derivatives/Makefile
1165 plugins/fn-eng/Makefile
1166 plugins/fn-erlang/Makefile
1167 plugins/fn-financial/Makefile
1168 plugins/fn-hebrew-date/Makefile
1169 plugins/fn-info/Makefile
1170 plugins/fn-logical/Makefile
1171 plugins/fn-lookup/Makefile
1172 plugins/fn-math/Makefile
1173 plugins/fn-numtheory/Makefile
1174 plugins/fn-r/Makefile
1175 plugins/fn-stat/Makefile
1176 plugins/fn-string/Makefile
1177 plugins/fn-random/Makefile
1178 plugins/fn-tsa/Makefile
1179 plugins/applix/Makefile
1180 plugins/dif/Makefile
1181 plugins/excel/Makefile
1182 plugins/excelplugins/Makefile
1183 plugins/gda/Makefile
1184 plugins/gnome-db/Makefile
1185 plugins/gnome-glossary/Makefile
1186 plugins/html/Makefile
1187 plugins/lotus-123/Makefile
1188 plugins/lpsolve/Makefile
1189 plugins/nlsolve/Makefile
1190 plugins/glpk/Makefile
1191 plugins/mps/Makefile
1192 plugins/oleo/Makefile
1193 plugins/openoffice/Makefile
1194 plugins/paradox/Makefile
1195 plugins/perl-func/Makefile
1196 plugins/perl-loader/Makefile
1197 plugins/plan-perfect/Makefile
1198 plugins/psiconv/Makefile
1199 plugins/py-func/Makefile
1200 plugins/python-loader/Makefile
1201 plugins/qpro/Makefile
1202 plugins/sample_datasource/Makefile
1204 plugins/sylk/Makefile
1205 plugins/uihello/Makefile
1206 plugins/xbase/Makefile
1208 po-functions/Makefile.in
1210 schemas/org.gnome.gnumeric.gschema.xml.in
1211 schemas/org.gnome.gnumeric.dialogs.gschema.xml.in
1212 schemas/org.gnome.gnumeric.plugin.gschema.xml.in
1214 templates/english/Makefile
1215 templates/autoformat/Makefile
1218 tools/win32/Makefile
1219 tools/win32/moduleset
1220 tools/win32/gnumeric.nsi
1228 Source code location: ${srcdir}
1230 Compiler flags: ${CFLAGS}
1231 Floating point type: ${float_msg}
1235 Perl Support: ${perl_msg}
1236 Python Support: ${python_msg}
1238 GDA support: ${gda_msg}
1239 GNOME-DB support: ${gnomedb_msg}
1240 Psiconv support: ${psiconv_msg}
1242 PDF documentation: ${pdf_msg}
1244 # Mono support: ${mono_msg}
1245 # Guile Support: ${guile_msg}