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)
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"
240 with_native_win32=yes
241 AC_ARG_VAR(WINDRES, [The windres executable (used by win32 builds only).])
242 AC_CHECK_TOOL(WINDRES, windres, :)
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"
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
259 AC_SUBST(GETTEXT_PACKAGE, gnumeric-${VERSION})
260 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",
261 [The package name, for 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])
280 if test x"$enable_component" = xyes; then
281 component_dir="component"
285 AC_SUBST(COMPONENT_DIR, $component_dir)
287 dnl ****************************
289 dnl ****************************
294 AS_HELP_STRING([--with-gda], [Compile the Gnome Database Access plugin]),
295 if test "x$withval" != xyes; then
297 gda_msg="Disabled by request"
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],
303 [gda_msg="NO. libgda problem"])
304 if test "$gda_msg" = yes; then
305 PKG_CHECK_MODULES(GNOMEDB, [libgnomedb-4.0 >= 3.99.6],
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])
313 AM_CONDITIONAL(WITH_GDA, test x"$gda_msg" = xyes)
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])
335 # Unfortunately, -D_POSIX_SOURCE turns off struct timeval on Solaris
336 AC_MSG_CHECKING([whether struct timeval is available])
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__])
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])
356 dnl src/functions/fn-math.c uses M_PI
358 AC_MSG_CHECKING([whether M_PI is available])
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])
369 [AC_LANG_PROGRAM([[#include <math.h>]], [[double f = M_PI]])],
372 AC_MSG_RESULT($m_pi_works)
373 if test $m_pi_works = no ; then
374 AC_MSG_ERROR([M_PI is not available])
382 dnl Comment out the guile block:
384 dnl check for guile 1.5
386 guile_msg="disabled pending some guile developer interest"
389 AS_HELP_STRING([--with-guile], [Compile with Guile support or without it]),
390 if test "x$withval" = xyes; 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.])
404 if $enable_guile; then
407 AM_CONDITIONAL(WITH_GUILE, $enable_guile)
410 dnl **************************************************
411 dnl * psiconv support
412 dnl **************************************************
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"
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))}'
426 PSICONV_CFLAGS=`$PSICONV_CONFIG --cflags`
427 PSICONV_LIBS=`$PSICONV_CONFIG --libs`
432 AC_MSG_RESULT($psiconv_msg)
437 AM_CONDITIONAL(WITH_PSICONV, test "x$psiconv_msg" = xyes)
438 AC_SUBST(PSICONV_LIBS)
439 AC_SUBST(PSICONV_CFLAGS)
444 AS_HELP_STRING([--without-paradox], [Compile without Paradox support]),
445 if test "x$withval" = xno; then
450 if $try_paradox; then
451 PKG_CHECK_MODULES(PARADOX,
454 [paradox_msg="missing dependencies"])
457 if test "x$paradox_msg" = xyes; then
459 LIBS="$LIBS $PARADOX_LIBS"
460 AC_CHECK_FUNC(PX_open_gsf,[ enable_paradox=true ],)
464 AM_CONDITIONAL(WITH_PARADOX, $enable_paradox)
465 AC_SUBST(PARADOX_LIBS)
466 AC_SUBST(PARADOX_CFLAGS)
468 plugin_list_given=false
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)
479 for lang in $ALL_LINGUAS; do
480 POFILES_FULL="$POFILES_FULL \$(top_srcdir)/po/$lang.po"
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
516 [\\/]* | ?:[\\/]* ) # Absolute name.
517 top_srcdir="$srcdir" ;;
518 *) top_srcdir="../$srcdir" ;;
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])
530 LIBS="$LIBS $GNUMERIC_LIBS"
531 AC_CHECK_FUNCS(mkfifo)
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)
547 AC_CHECK_HEADERS(sys/resource.h)
549 dnl we need to check fpu mode
550 AC_CHECK_HEADERS(fpu_control.h)
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 PANGO_WEIGHT_THIN etc.])
561 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pango/pango.h>]],
562 [[(void)(PANGO_WEIGHT_THIN == 42);
563 (void)(PANGO_WEIGHT_MEDIUM == 42);
564 (void)(PANGO_WEIGHT_ULTRAHEAVY == 42);]])],
565 [AC_DEFINE(HAVE_PANGO_WEIGHT_THIN_ETC, 1, [Define if PANGO_WEIGHT_THIN etc are available])
569 AC_MSG_CHECKING([for OO_NS_LOCALC_EXT])
570 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <gsf/gsf.h>]],
571 [[(void)(OO_NS_LOCALC_EXT == OO_NS_LOCALC_EXT);]])],
572 [AC_DEFINE(HAVE_OO_NS_LOCALC_EXT, 1, [Define if OO_NS_LOCALC_EXT is available])
579 dnl We supply our own lgamma and lgamma_r when missing.
581 AC_CHECK_FUNCS(lgamma_r)
582 if test $ac_cv_func_lgamma_r = no; then
583 AC_CHECK_LIB(m, lgamma_r,
584 [AC_DEFINE(HAVE_LGAMMA_R, 1,
585 [Define if the lgamma_r function is available]
592 if test $supply_lgamma_r = yes; then
593 AC_DEFINE(GNM_SUPPLIES_LGAMMA_R, 1,
594 [Define if Gnumeric supplies the lgamma_r function]
597 AC_CHECK_FUNCS(lgamma)
598 if test $ac_cv_func_lgamma = no; then
599 AC_DEFINE(GNM_SUPPLIES_LGAMMA, 1,
600 [Define if Gnumeric supplies the lgamma function]
605 AC_MSG_CHECKING([cos is reliable])
612 const char *s = "1.5689793435451356";
615 int ok = (c > 0 && c < 0.05);
622 [AC_MSG_RESULT(assuming it is)])
624 if test "x$with_win32" = "xyes" -o "x$cos_works" = "xno"; then
625 AC_DEFINE(GNM_REDUCES_TRIG_RANGE, 1,
626 [Define if Gnumeric reduces the argument range of sin/cos/tan]
631 AC_ARG_WITH(long_double,
632 AS_HELP_STRING([--with-long-double], [Use long double for floating point]),
633 [if test "x$withval" = xyes; then
634 SAVE_CFLAGS="$CFLAGS"
636 CFLAGS="$GNUMERIC_CFLAGS"
637 LIBS="$GNUMERIC_LIBS -lm"
639 AC_CHECK_HEADERS(sunmath.h)
641 AC_CHECK_FUNCS(go_render_generall,
643 AC_MSG_ERROR([libgoffice needs to be compiled with long double support.]))
645 AC_CHECK_FUNCS(fabsl sqrtl expl expm1l logl log2l log10l log1pl ceill floorl powl hypotl \
646 sinl cosl tanl asinl acosl atanl atan2l fmodl lgammal lgammal_r \
647 sinhl coshl tanhl asinhl acoshl atanhl \
650 AC_MSG_ERROR([Long doubles require the $ldfunc function.]))
652 AC_MSG_CHECKING([checking for working erfl and erfcl])
658 #ifdef HAVE_SUNMATH_H
663 long double l1 = erfl (1.2L);
664 long double l2 = erfcl (1.2L);
665 return !(l1 >= 0.91 && l1 <= 0.92 &&
666 l2 >= 0.08 && l2 <= 0.09);
668 [AC_DEFINE(HAVE_ERFL)
670 AC_DEFINE(HAVE_ERFCL)
674 [AC_CHECK_FUNCS(erfl erfcl)
675 have_erfl=$ac_cv_func_erfl
676 have_erfcl=$ac_cv_func_erfcl
679 if $have_erfl = no; then
680 AC_DEFINE(GNM_SUPPLIES_ERFL, 1,
681 [Define if Gnumeric supplies the erfl function]
684 if $have_erfcl = no; then
685 AC_DEFINE(GNM_SUPPLIES_ERFCL, 1,
686 [Define if Gnumeric supplies the erfcl function]
690 CFLAGS="$SAVE_CFLAGS"
693 float_msg="long double (EXPERIMENTAL)"
694 AC_MSG_WARN([Long double support is experimental -- expect problems])
695 AC_DEFINE(GNM_WITH_LONG_DOUBLE, 1,
696 [Define if the long double type is to be used]
701 ## this should come after `AC_PROG_CC'
702 set_more_warnings=yes
703 if test "$GCC" = yes -a "x$set_more_warnings" != xno; then
704 dnl Clang needs this option, or else it will appear to support any
705 dnl warning option, only to spew warnings about them later.
706 uwoption="-Werror=unknown-warning-option"
707 SAVE_CFLAGS="$CFLAGS"
708 CFLAGS="$CFLAGS $uwoption"
709 AC_MSG_CHECKING([whether gcc understands $uwoption])
711 [AC_LANG_PROGRAM([], [])],
712 [has_unknown_warning_option=yes],
713 [has_unknown_warning_option=no; uwoption=""])
714 AC_MSG_RESULT($has_unknown_warning_option)
715 CFLAGS="$SAVE_CFLAGS"
717 warning_options="-Wall -Werror=init-self -Werror=missing-include-dirs \
718 -Wsign-compare -Werror=pointer-arith \
719 -Wchar-subscripts -Wwrite-strings \
720 -Wdeclaration-after-statement -Wnested-externs \
722 -Werror=missing-prototypes -Werror=nested-externs \
723 -Werror=implicit-function-declaration \
724 -Wmissing-declarations -Wno-pointer-sign \
725 -Werror=format-security -Wbitwise -Wcast-to-as \
726 -Wdefault-bitfield-sign -Wdo-while -Wparen-string \
727 -Wptr-subtraction-blows -Wreturn-void -Wtypesign \
728 -Wstrict-prototypes -Wno-error=format-nonliteral "
729 for option in $warning_options ; do
730 SAVE_CFLAGS="$CFLAGS"
731 CFLAGS="$CFLAGS $uwoption $option"
732 AC_MSG_CHECKING([whether gcc understands $option])
733 dnl Include a system header so we ignore Werror=... flags
734 dnl that cause trouble.
736 [AC_LANG_PROGRAM([[#include <stdio.h>]], [])],
739 CFLAGS="$SAVE_CFLAGS"
740 if test $has_option = yes; then
741 CFLAGS="$CFLAGS $option"
743 AC_MSG_RESULT($has_option)
749 AC_SUBST(WARN_CFLAGS)
751 dnl **************************************************
752 dnl * Check for GSettings
753 dnl **************************************************
755 AC_CHECK_LIB(gio-2.0,[g_settings_new],
756 [AC_DEFINE(HAVE_G_SETTINGS_NEW, 1,
757 [Define if the g_settings_new function is available])
761 AC_SUBST(GSETTINGS_RULES)])
762 AM_CONDITIONAL(HAVE_GSETTINGS, test $have_gsettings=yes)
764 dnl **************************************************
766 dnl **************************************************
768 AC_ARG_VAR(PERL, [The Perl executable.])
769 AC_CHECK_PROG(PERL, perl, perl)
774 AC_ARG_WITH(perl, AS_HELP_STRING([--without-perl], [Do not build the Perl plugin loader]),
779 if test "x$want_perl" = xno ; then
780 perl_reason="disabled by request"
782 if test "x$PERL" != x; then
783 BIG_CHECKING([for perl ExtUtils::Embed module])
784 if $PERL -e 'eval { require ExtUtils::Embed }; if ($@) { exit(1); } else { exit(0); }'
788 dnl Use ExtUtils::Embed to figure out the other options.
789 PERL_CCCDLFLAGS=`$PERL -MConfig -e 'print $Config{cccdlflags};'`
790 PERL_LDDLFLAGS=`$PERL -MConfig -e 'print $Config{lddlflags};'`
791 PERL_CC=`$PERL -MConfig -e 'print $Config{cc};'`
792 PERL_LD=`$PERL -MConfig -e 'print $Config{ld};'`
793 perlinc=`$PERL -MConfig -e 'print "$Config{archlib}/CORE";'`
794 PERL_CCOPTS="`$PERL -MExtUtils::Embed -e ccopts` -I$perlinc"
795 PERL_LDOPTS=`$PERL -MExtUtils::Embed -e ldopts`
797 AC_MSG_CHECKING([Checking for perl compiler, linker, libraries and headers])
798 rm -f testperl$ac_exeext testperl.$ac_objext testperl.c testperl.err
799 cat > testperl.c <<EOF
803 int main () { (void)&perl_construct; return 0; }
805 $PERL_CC $PERL_CCOPTS -c testperl.c >testperl.err 2>&1 &&
806 $PERL_LD -o testperl testperl.$ac_objext $PERL_LDOPTS >testperl.err 2>&1 &&
809 AC_MSG_RESULT($have_perl)
811 if test "x$have_perl" != xyes; then
812 perl_reason="failed to compile test program"
813 cat testperl.err testperl.c >&AS_MESSAGE_LOG_FD
816 rm -f testperl$ac_exeext testperl.$ac_objext testperl.c testperl.err
820 perl_reason="missing parts of perl"
823 perl_reason="missing perl"
827 if test "$want_perl" = xyes -a "x$have_perl" != xyes; then
828 AC_MSG_ERROR([Perl requested, but not available: $perl_reason])
831 AM_CONDITIONAL(WITH_PERL, test "x$have_perl" = xyes)
832 if test "x$have_perl" = xyes ; then
833 perl_msg="yes (using $PERL)"
835 perl_msg="no ($perl_reason)"
837 AC_SUBST(PERL_CCCDLFLAGS)
838 AC_SUBST(PERL_LDDLFLAGS)
841 AC_SUBST(PERL_CCOPTS)
842 AC_SUBST(PERL_LDOPTS)
844 dnl **************************************************
845 dnl * Check for Python
846 dnl **************************************************
852 AC_ARG_WITH(python, AS_HELP_STRING([--without-python], [Do not build the Python plugin loader]))
853 AC_ARG_VAR(PYTHON, [The Python executable.])
856 ?*) AC_MSG_ERROR([You cannot use --with-python with an argument.
857 If you want to specify a path to your Python executable, use:
858 $srcdir/configure PYTHON=/path/to/your/python ...]);;
860 if test "x$with_python" != xno; then
861 AC_PATH_PROGS(PYTHON, python python2 python2.7)
862 if test "x$PYTHON" = x; then
863 python_msg="could not find python"
866 python_msg="Disabled by request"
869 # A bit of a mess. We really ought to separate the Python interpreter
870 # and the Python plugin
873 if test "x$PYTHON" != x; then
874 AC_DEFINE_UNQUOTED(PYTHON_INTERPRETER, ["$PYTHON"],
875 [The Python interpreter to use])
878 AC_MSG_CHECKING([for python module gi])
879 if $PYTHON -c 'import gi' 2>/dev/null; then
882 AC_MSG_RESULT($have_python_gi)
884 AM_CONDITIONAL(HAVE_PYTHON_GI, test "x$have_python_gi" = "xyes")
887 if test "x$python_msg" = xyes; then
888 BIG_CHECKING([for python = 2.x])
889 [PY_VERSION=`$PYTHON -c 'import sys ; sys.stdout.write(sys.version[0:3])'`
890 major_ver=`$PYTHON -c 'import sys ; sys.stdout.write(sys.version[0:1])'`]
891 if test "x$major_ver" = "x2"; then
893 if test "x$with_native_win32" = xyes ; then
894 # 2.x on linux, 2x on win32
895 PY_VERSION=`echo $PY_VERSION | sed -e 's/\\.//'`
899 python_msg="NO. Python version \"${PY_VERSION}\" is too old."
903 if test "x$python_msg" = xyes; then
904 if test "x$PY_PREFIX" = x; then
905 PY_PREFIX=`$PYTHON -c 'import sys ; sys.stdout.write(sys.prefix)'`
907 if test "x$PY_INCLUDE_DIR" = x; then
908 if test "x$with_native_win32" = xyes ; then
909 PY_INCLUDES="-I$PY_PREFIX/include"
911 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))'`
914 PY_INCLUDES="-I$PY_INCLUDE_DIR"
917 python_msg="unable to find Python.h"
918 for py_include in $PY_INCLUDES; do
919 py_include_dir="${py_include#-I}"
920 BIG_CHECKING(Look for $py_include_dir/Python.h)
921 if test -f $py_include_dir/Python.h; then
931 if test "x$python_msg" = xyes; then
932 m4_define([pygobject_required_version], [3.0.0])
933 PKG_CHECK_MODULES(PYGOBJECT, pygobject-3.0 >= pygobject_required_version,,
934 [python_msg="Missing pygobject"])
937 AM_CONDITIONAL(WITH_PYTHON, test "x$python_msg" = xyes)
938 if test "x$python_msg" = xyes; then
939 if test "x$PY_LIB_DIR" = x; then
940 if test "x$with_native_win32" = xyes ; then
941 PY_LIB_DIR="$PY_PREFIX/libs"
943 PY_LIB_DIR=`$PYTHON -c 'import sys ; import distutils.sysconfig ; sys.stdout.write(distutils.sysconfig.get_config_var("LIBPL"))'`
947 GNM_PY_CFLAGS="$PY_INCLUDES $PYGOBJECT_CFLAGS"
948 GNM_PY_LDFLAGS="-L$PY_LIB_DIR -lpython$PY_VERSION $PYGOBJECT_LIBS"
949 python_msg="yes (using $PYTHON)"
950 elif test "x$with_python" = "xyes"; then
951 AC_MSG_ERROR([$python_msg])
954 AC_SUBST(GNM_PY_CFLAGS)
955 AC_SUBST(GNM_PY_LDFLAGS)
956 AC_SUBST(GNM_PY_LIBADD)
960 # Support for PDF docs
961 AC_ARG_ENABLE(pdfdocs,
962 AS_HELP_STRING([--enable-pdfdocs],[Generate documentation in Portable Document Format]),
963 [enable_pdfdocs=$enableval],
965 pdf_msg="No, not requested.";
966 if test x"$enable_pdfdocs" = xyes; then
968 AC_CHECK_PROG(DBCONTEXT, [dbcontext], [dbcontext], [])
969 AC_CHECK_PROG(DBLATEX, [dblatex], [dblatex], [])
970 if test x"$DBCONTEXT" = x"dbcontext"; then
973 if test x"$DBLATEX" = x"dblatex"; then
977 if test x"$pdfroute" != x""; then
978 pdf_msg="Yes, through $pdfroute."
981 Did not find a suitable tool for generating Portable Document Format from
982 DocBook XML - aborting.
984 Both the DocBook to ConTeXt and the DocBook to LaTeX conversion tool can be
986 http://dblatex.sourceforge.net/
991 AM_CONDITIONAL(ENABLE_PDFDOCS, test x"$enable_pdfdocs" = xyes)
992 AM_CONDITIONAL(ENABLE_PDF_VIA_DBCONTEXT, test x"$pdfroute" = x"dbcontext")
993 AM_CONDITIONAL(ENABLE_PDF_VIA_DBLATEX, test x"$pdfroute" = x"dblatex")
996 dnl A tricky way to comment out in m4:
998 dnl **************************************************
1000 dnl **************************************************
1002 mono_msg="disabled, still experimental"
1004 AC_ARG_WITH(mono, AS_HELP_STRING([--with-mono], [Compile the mono scripting engine]))
1006 no) mono_msg="Disabled by request";;
1008 PKG_CHECK_MODULES(MONO, mono,
1010 AC_DEFINE(WITH_MONO, 1, [Define if mono .NET engine is available])],
1015 AM_CONDITIONAL(WITH_MONO, test "x$with_mono" = xyes)
1016 AC_SUBST(MONO_CFLAGS)
1020 # GObject Introspection
1022 AC_ARG_ENABLE(introspection,
1023 AS_HELP_STRING([--enable-introspection[=@<:@no/auto/yes@:>@]],
1024 [Enable introspection for this build]),,
1025 [enable_introspection=no])
1027 AC_MSG_CHECKING([for gobject-introspection])
1029 dnl presence/version checking
1030 AS_CASE([$enable_introspection],
1032 found_introspection="no (disabled, use --enable-introspection to enable)"
1035 PKG_CHECK_EXISTS([gobject-introspection-1.0],,
1036 AC_MSG_ERROR([gobject-introspection-1.0 is not installed]))
1037 PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $GIR_REQ],
1038 found_introspection=yes,
1039 AC_MSG_ERROR([You need to have gobject-introspection >= $1 installed to build AC_PACKAGE_NAME]))
1042 PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $GIR_REQ], found_introspection=yes, found_introspection=no)
1043 dnl Canonicalize enable_introspection
1044 enable_introspection=$found_introspection
1047 AC_MSG_ERROR([invalid argument passed to --enable-introspection, should be one of @<:@no/auto/yes@:>@])
1050 AC_MSG_RESULT([$found_introspection])
1052 if test "x$found_introspection" = "xyes"; then
1053 dnl You can override INTROSPECTION_GIRDIR and INTROSPECTION_TYPELIBDIR
1054 dnl if you wish. If you override the latter, you might want to set
1055 dnl GI_TYPELIB_PATH to include the same directory. For example
1057 dnl GI_TYPELIB_PATH=$PREFIX/lib64/girepository-1.0
1058 dnl INTROSPECTION_TYPELIBDIR=$GI_TYPELIB_PATH
1059 dnl INTROSPECTION_GIRDIR=$PREFIX/share/gir-1.0
1061 dnl Note, that unlike gnumeric's binaries, nothing tells python where
1062 dnl to find gnumeric libraries, so you might also need to set
1063 dnl LD_LIBRARY_PATH.
1065 INTROSPECTION_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0`
1066 INTROSPECTION_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0`
1067 INTROSPECTION_GENERATE=`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0`
1068 if test "x$INTROSPECTION_GIRDIR" = x; then
1069 INTROSPECTION_GIRDIR=`$PKG_CONFIG --variable=girdir gobject-introspection-1.0`
1071 if test "x$INTROSPECTION_TYPELIBDIR" = x; then
1072 INTROSPECTION_TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)"
1074 INTROSPECTION_CFLAGS=`$PKG_CONFIG --cflags gobject-introspection-1.0`
1075 INTROSPECTION_LIBS=`$PKG_CONFIG --libs gobject-introspection-1.0`
1076 INTROSPECTION_MAKEFILE=`$PKG_CONFIG --variable=datadir gobject-introspection-1.0`/gobject-introspection-1.0/Makefile.introspection
1078 INTROSPECTION_SCANNER=
1079 INTROSPECTION_COMPILER=
1080 INTROSPECTION_GENERATE=
1081 INTROSPECTION_GIRDIR=
1082 INTROSPECTION_TYPELIBDIR=
1083 INTROSPECTION_CFLAGS=
1085 INTROSPECTION_MAKEFILE=
1087 AC_SUBST(INTROSPECTION_SCANNER)
1088 AC_SUBST(INTROSPECTION_COMPILER)
1089 AC_SUBST(INTROSPECTION_GENERATE)
1090 AC_SUBST(INTROSPECTION_GIRDIR)
1091 AC_SUBST(INTROSPECTION_TYPELIBDIR)
1092 AC_SUBST(INTROSPECTION_CFLAGS)
1093 AC_SUBST(INTROSPECTION_LIBS)
1094 AC_SUBST(INTROSPECTION_MAKEFILE)
1096 AM_CONDITIONAL(HAVE_INTROSPECTION, test "x$found_introspection" = "xyes")
1097 dnl we need to change the install directories for distcheck
1098 AC_ARG_WITH([gir-dir],
1102 path to gir repository
1103 (automatically detected via pkg-config)
1107 [GIRDIR=$INTROSPECTION_GIRDIR]
1110 AC_ARG_WITH([typelib-dir],
1112 [--with-typelib-dir],
1114 path to typelibs repository
1115 (automatically detected via pkg-config)
1118 [TYPELIBDIR=$withval],
1119 [TYPELIBDIR=$INTROSPECTION_TYPELIBDIR]
1121 AC_SUBST(TYPELIBDIR)
1124 dnl **************************************************
1125 dnl * Config defaults
1126 dnl **************************************************
1128 dnl These are changed in gutils.c for WIN32 packages
1129 AC_SUBST(gnumeric_datadir, '${datadir}/gnumeric/${VERSION}')
1130 AC_SUBST(gnumeric_libdir, '${libdir}/gnumeric/${VERSION}')
1131 AC_SUBST(gnumeric_icondir, '${datadir}/pixmaps/gnumeric')
1132 AC_SUBST(gnumeric_localedir, '${prefix}/${DATADIRNAME}/locale')
1134 AC_SUBST(gnumeric_plugindir, '${gnumeric_libdir}/plugins')
1135 AC_SUBST(gnumeric_externplugindir, '${libdir}/gnumeric/${GNUMERIC_API_VER}/plugins')
1137 AC_SUBST(YYYYMMDD, `date +%Y%m%d`)
1139 dnl Export to gnumeric-config.h
1140 AC_DEFINE(GNM_VERSION_FULL, "gnumeric_version_full",
1141 [The version number of this release, with optional extra suffix])
1142 AC_DEFINE(GNM_VERSION_EPOCH, gnumeric_version_epoch,
1143 [The Epoch of this release])
1144 AC_DEFINE(GNM_VERSION_MAJOR, gnumeric_version_major,
1145 [The Major version number of this release])
1146 AC_DEFINE(GNM_VERSION_MINOR, gnumeric_version_minor,
1147 [The Minor version number of this release])
1148 AC_DEFINE(GNM_VERSION_EXTRA, "gnumeric_version_extra",
1149 [Extra, possibly empty tag for this release])
1150 AC_DEFINE(GNM_API_VERSION, "GNUMERIC_API_VER",
1151 [The API version number of this release])
1158 icons/16x16/Makefile
1159 icons/16x16/actions/Makefile
1160 icons/16x16/apps/Makefile
1161 icons/22x22/Makefile
1162 icons/22x22/actions/Makefile
1163 icons/22x22/apps/Makefile
1164 icons/24x24/Makefile
1165 icons/24x24/actions/Makefile
1166 icons/24x24/apps/Makefile
1167 icons/32x32/Makefile
1168 icons/32x32/actions/Makefile
1169 icons/32x32/apps/Makefile
1170 icons/48x48/Makefile
1171 icons/48x48/actions/Makefile
1172 icons/48x48/apps/Makefile
1173 icons/256x256/Makefile
1174 icons/256x256/apps/Makefile
1176 src/dialogs/Makefile
1177 src/widgets/Makefile
1179 src/cut-n-paste-code/Makefile
1182 plugins/fn-christian-date/Makefile
1183 plugins/fn-complex/Makefile
1184 plugins/fn-database/Makefile
1185 plugins/fn-date/Makefile
1186 plugins/fn-derivatives/Makefile
1187 plugins/fn-eng/Makefile
1188 plugins/fn-erlang/Makefile
1189 plugins/fn-financial/Makefile
1190 plugins/fn-hebrew-date/Makefile
1191 plugins/fn-info/Makefile
1192 plugins/fn-logical/Makefile
1193 plugins/fn-lookup/Makefile
1194 plugins/fn-math/Makefile
1195 plugins/fn-numtheory/Makefile
1196 plugins/fn-r/Makefile
1197 plugins/fn-stat/Makefile
1198 plugins/fn-string/Makefile
1199 plugins/fn-random/Makefile
1200 plugins/fn-tsa/Makefile
1201 plugins/applix/Makefile
1202 plugins/dif/Makefile
1203 plugins/excel/Makefile
1204 plugins/excelplugins/Makefile
1205 plugins/gda/Makefile
1206 plugins/gnome-db/Makefile
1207 plugins/gnome-glossary/Makefile
1208 plugins/html/Makefile
1209 plugins/lotus-123/Makefile
1210 plugins/lpsolve/Makefile
1211 plugins/nlsolve/Makefile
1212 plugins/glpk/Makefile
1213 plugins/mps/Makefile
1214 plugins/oleo/Makefile
1215 plugins/openoffice/Makefile
1216 plugins/paradox/Makefile
1217 plugins/perl-func/Makefile
1218 plugins/perl-loader/Makefile
1219 plugins/plan-perfect/Makefile
1220 plugins/psiconv/Makefile
1221 plugins/py-func/Makefile
1222 plugins/python-loader/Makefile
1223 plugins/qpro/Makefile
1224 plugins/sample_datasource/Makefile
1226 plugins/sylk/Makefile
1227 plugins/uihello/Makefile
1228 plugins/xbase/Makefile
1230 po-functions/Makefile.in
1232 schemas/org.gnome.gnumeric.gschema.xml.in
1233 schemas/org.gnome.gnumeric.dialogs.gschema.xml.in
1234 schemas/org.gnome.gnumeric.plugin.gschema.xml.in
1236 templates/english/Makefile
1237 templates/autoformat/Makefile
1240 tools/win32/Makefile
1241 tools/win32/moduleset
1242 tools/win32/gnumeric.nsi
1250 Source code location: ${srcdir}
1252 Compiler flags: ${CFLAGS}
1253 Floating point type: ${float_msg}
1257 Perl Support: ${perl_msg}
1258 Python Support: ${python_msg}
1260 GDA support: ${gda_msg}
1261 GNOME-DB support: ${gnomedb_msg}
1262 Psiconv support: ${psiconv_msg}
1264 PDF documentation: ${pdf_msg}
1266 # Mono support: ${mono_msg}
1267 # Guile Support: ${guile_msg}