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], [36])
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.28
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)
548 CFLAGS="$CFLAGS $GNUMERIC_CFLAGS"
549 LIBS="$GNUMERIC_LIBS $LIBS"
551 AC_CHECK_FUNCS(gtk_cell_renderer_text_get_background_set gtk_cell_renderer_text_get_foreground_set gtk_cell_renderer_text_get_editable)
552 AC_CHECK_FUNCS(gtk_entry_set_editing_cancelled gtk_icon_theme_add_resource_path)
554 AC_MSG_CHECKING([for PANGO_WEIGHT_THIN etc.])
555 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pango/pango.h>]],
556 [[(void)(PANGO_WEIGHT_THIN == 42);
557 (void)(PANGO_WEIGHT_MEDIUM == 42);
558 (void)(PANGO_WEIGHT_ULTRAHEAVY == 42);]])],
559 [AC_DEFINE(HAVE_PANGO_WEIGHT_THIN_ETC, 1, [Define if PANGO_WEIGHT_THIN etc are available])
563 AC_MSG_CHECKING([for OO_NS_LOCALC_EXT])
564 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <gsf/gsf.h>]],
565 [[(void)(OO_NS_LOCALC_EXT == OO_NS_LOCALC_EXT);]])],
566 [AC_DEFINE(HAVE_OO_NS_LOCALC_EXT, 1, [Define if OO_NS_LOCALC_EXT is available])
573 dnl We supply our own lgamma and lgamma_r when missing.
575 AC_CHECK_FUNCS(lgamma_r)
576 if test $ac_cv_func_lgamma_r = no; then
577 AC_CHECK_LIB(m, lgamma_r,
578 [AC_DEFINE(HAVE_LGAMMA_R, 1,
579 [Define if the lgamma_r function is available]
586 if test $supply_lgamma_r = yes; then
587 AC_DEFINE(GNM_SUPPLIES_LGAMMA_R, 1,
588 [Define if Gnumeric supplies the lgamma_r function]
591 AC_CHECK_FUNCS(lgamma)
592 if test $ac_cv_func_lgamma = no; then
593 AC_DEFINE(GNM_SUPPLIES_LGAMMA, 1,
594 [Define if Gnumeric supplies the lgamma function]
599 AC_MSG_CHECKING([cos is reliable])
606 const char *s = "1.5689793435451356";
609 int ok = (c > 0 && c < 0.05);
616 [AC_MSG_RESULT(assuming it is)])
618 if test "x$with_win32" = "xyes" -o "x$cos_works" = "xno"; then
619 AC_DEFINE(GNM_REDUCES_TRIG_RANGE, 1,
620 [Define if Gnumeric reduces the argument range of sin/cos/tan]
625 AC_ARG_WITH(long_double,
626 AS_HELP_STRING([--with-long-double], [Use long double for floating point]),
627 [if test "x$withval" = xyes; then
628 SAVE_CFLAGS="$CFLAGS"
630 CFLAGS="$GNUMERIC_CFLAGS"
631 LIBS="$GNUMERIC_LIBS -lm"
633 AC_CHECK_HEADERS(sunmath.h)
635 AC_CHECK_FUNCS(go_render_generall,
637 AC_MSG_ERROR([libgoffice needs to be compiled with long double support.]))
639 AC_CHECK_FUNCS(fabsl sqrtl expl expm1l logl log2l log10l log1pl ceill floorl powl hypotl \
640 sinl cosl tanl asinl acosl atanl atan2l fmodl lgammal lgammal_r \
641 sinhl coshl tanhl asinhl acoshl atanhl \
644 AC_MSG_ERROR([Long doubles require the $ldfunc function.]))
646 AC_MSG_CHECKING([checking for working erfl and erfcl])
652 #ifdef HAVE_SUNMATH_H
657 long double l1 = erfl (1.2L);
658 long double l2 = erfcl (1.2L);
659 return !(l1 >= 0.91 && l1 <= 0.92 &&
660 l2 >= 0.08 && l2 <= 0.09);
662 [AC_DEFINE(HAVE_ERFL)
664 AC_DEFINE(HAVE_ERFCL)
668 [AC_CHECK_FUNCS(erfl erfcl)
669 have_erfl=$ac_cv_func_erfl
670 have_erfcl=$ac_cv_func_erfcl
673 if $have_erfl = no; then
674 AC_DEFINE(GNM_SUPPLIES_ERFL, 1,
675 [Define if Gnumeric supplies the erfl function]
678 if $have_erfcl = no; then
679 AC_DEFINE(GNM_SUPPLIES_ERFCL, 1,
680 [Define if Gnumeric supplies the erfcl function]
684 CFLAGS="$SAVE_CFLAGS"
687 float_msg="long double (EXPERIMENTAL)"
688 AC_MSG_WARN([Long double support is experimental -- expect problems])
689 AC_DEFINE(GNM_WITH_LONG_DOUBLE, 1,
690 [Define if the long double type is to be used]
695 ## this should come after `AC_PROG_CC'
696 set_more_warnings=yes
697 if test "$GCC" = yes -a "x$set_more_warnings" != xno; then
698 dnl Clang needs this option, or else it will appear to support any
699 dnl warning option, only to spew warnings about them later.
700 uwoption="-Werror=unknown-warning-option"
701 SAVE_CFLAGS="$CFLAGS"
702 CFLAGS="$CFLAGS $uwoption"
703 AC_MSG_CHECKING([whether gcc understands $uwoption])
705 [AC_LANG_PROGRAM([], [])],
706 [has_unknown_warning_option=yes],
707 [has_unknown_warning_option=no; uwoption=""])
708 AC_MSG_RESULT($has_unknown_warning_option)
709 CFLAGS="$SAVE_CFLAGS"
711 warning_options="-Wall -Werror=init-self -Werror=missing-include-dirs \
712 -Wsign-compare -Werror=pointer-arith \
713 -Wchar-subscripts -Wwrite-strings \
714 -Wdeclaration-after-statement -Wnested-externs \
716 -Werror=missing-prototypes -Werror=nested-externs \
717 -Werror=implicit-function-declaration \
718 -Wmissing-declarations -Wno-pointer-sign \
719 -Werror=format-security -Wbitwise -Wcast-to-as \
720 -Wdefault-bitfield-sign -Wdo-while -Wparen-string \
721 -Wptr-subtraction-blows -Wreturn-void -Wtypesign \
722 -Wstrict-prototypes -Wno-error=format-nonliteral "
723 for option in $warning_options ; do
724 SAVE_CFLAGS="$CFLAGS"
725 CFLAGS="$CFLAGS $uwoption $option"
726 AC_MSG_CHECKING([whether gcc understands $option])
727 dnl Include a system header so we ignore Werror=... flags
728 dnl that cause trouble.
730 [AC_LANG_PROGRAM([[#include <stdio.h>]], [])],
733 CFLAGS="$SAVE_CFLAGS"
734 if test $has_option = yes; then
735 CFLAGS="$CFLAGS $option"
737 AC_MSG_RESULT($has_option)
743 AC_SUBST(WARN_CFLAGS)
745 dnl **************************************************
746 dnl * Check for GSettings
747 dnl **************************************************
749 AC_CHECK_LIB(gio-2.0,[g_settings_new],
750 [AC_DEFINE(HAVE_G_SETTINGS_NEW, 1,
751 [Define if the g_settings_new function is available])
755 AC_SUBST(GSETTINGS_RULES)])
756 AM_CONDITIONAL(HAVE_GSETTINGS, test $have_gsettings=yes)
758 dnl **************************************************
760 dnl **************************************************
762 AC_ARG_VAR(PERL, [The Perl executable.])
763 AC_CHECK_PROG(PERL, perl, perl)
768 AC_ARG_WITH(perl, AS_HELP_STRING([--without-perl], [Do not build the Perl plugin loader]),
773 if test "x$want_perl" = xno ; then
774 perl_reason="disabled by request"
776 if test "x$PERL" != x; then
777 BIG_CHECKING([for perl ExtUtils::Embed module])
778 if $PERL -e 'eval { require ExtUtils::Embed }; if ($@) { exit(1); } else { exit(0); }'
782 dnl Use ExtUtils::Embed to figure out the other options.
783 PERL_CCCDLFLAGS=`$PERL -MConfig -e 'print $Config{cccdlflags};'`
784 PERL_LDDLFLAGS=`$PERL -MConfig -e 'print $Config{lddlflags};'`
785 PERL_CC=`$PERL -MConfig -e 'print $Config{cc};'`
786 PERL_LD=`$PERL -MConfig -e 'print $Config{ld};'`
787 perlinc=`$PERL -MConfig -e 'print "$Config{archlib}/CORE";'`
788 PERL_CCOPTS="`$PERL -MExtUtils::Embed -e ccopts` -I$perlinc"
789 PERL_LDOPTS=`$PERL -MExtUtils::Embed -e ldopts`
791 AC_MSG_CHECKING([Checking for perl compiler, linker, libraries and headers])
792 rm -f testperl$ac_exeext testperl.$ac_objext testperl.c testperl.err
793 cat > testperl.c <<EOF
797 int main () { (void)&perl_construct; return 0; }
799 $PERL_CC $PERL_CCOPTS -c testperl.c >testperl.err 2>&1 &&
800 $PERL_LD -o testperl testperl.$ac_objext $PERL_LDOPTS >testperl.err 2>&1 &&
803 AC_MSG_RESULT($have_perl)
805 if test "x$have_perl" != xyes; then
806 perl_reason="failed to compile test program"
807 cat testperl.err testperl.c >&AS_MESSAGE_LOG_FD
810 rm -f testperl$ac_exeext testperl.$ac_objext testperl.c testperl.err
814 perl_reason="missing parts of perl"
817 perl_reason="missing perl"
821 if test "$want_perl" = xyes -a "x$have_perl" != xyes; then
822 AC_MSG_ERROR([Perl requested, but not available: $perl_reason])
825 AM_CONDITIONAL(WITH_PERL, test "x$have_perl" = xyes)
826 if test "x$have_perl" = xyes ; then
827 perl_msg="yes (using $PERL)"
829 perl_msg="no ($perl_reason)"
831 AC_SUBST(PERL_CCCDLFLAGS)
832 AC_SUBST(PERL_LDDLFLAGS)
835 AC_SUBST(PERL_CCOPTS)
836 AC_SUBST(PERL_LDOPTS)
838 dnl **************************************************
839 dnl * Check for Python
840 dnl **************************************************
846 AC_ARG_WITH(python, AS_HELP_STRING([--without-python], [Do not build the Python plugin loader]))
847 AC_ARG_VAR(PYTHON, [The Python executable.])
850 ?*) AC_MSG_ERROR([You cannot use --with-python with an argument.
851 If you want to specify a path to your Python executable, use:
852 $srcdir/configure PYTHON=/path/to/your/python ...]);;
854 if test "x$with_python" != xno; then
855 AC_CHECK_PROGS(PYTHON, python python2 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0)
856 if test "x$PYTHON" = x; then
857 python_msg="could not find python"
860 python_msg="Disabled by request"
863 if test "x$python_msg" = xyes; then
864 BIG_CHECKING([for python = 2.x])
865 [PY_VERSION=`$PYTHON -c 'import sys ; sys.stdout.write(sys.version[0:3])'`
866 major_ver=`$PYTHON -c 'import sys ; sys.stdout.write(sys.version[0:1])'`]
867 if test "x$major_ver" = "x2"; then
869 if test "x$with_native_win32" = xyes ; then
870 # 2.x on linux, 2x on win32
871 PY_VERSION=`echo $PY_VERSION | sed -e 's/\\.//'`
875 python_msg="NO. Python version \"${PY_VERSION}\" is too old."
879 if test "x$python_msg" = xyes; then
880 if test "x$PY_PREFIX" = x; then
881 PY_PREFIX=`$PYTHON -c 'import sys ; sys.stdout.write(sys.prefix)'`
883 if test "x$PY_INCLUDE_DIR" = x; then
884 if test "x$with_native_win32" = xyes ; then
885 PY_INCLUDES="-I$PY_PREFIX/include"
887 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))'`
890 PY_INCLUDES="-I$PY_INCLUDE_DIR"
893 python_msg="unable to find Python.h"
894 for py_include in $PY_INCLUDES; do
895 py_include_dir="${py_include#-I}"
896 BIG_CHECKING(Look for $py_include_dir/Python.h)
897 if test -f $py_include_dir/Python.h; then
907 if test "x$python_msg" = xyes; then
908 m4_define([pygobject_required_version], [3.0.0])
909 PKG_CHECK_MODULES(PYGOBJECT, pygobject-3.0 >= pygobject_required_version,,
910 [python_msg="Missing pygobject"])
913 AM_CONDITIONAL(WITH_PYTHON, test "x$python_msg" = xyes)
914 if test "x$python_msg" = xyes; then
915 if test "x$PY_LIB_DIR" = x; then
916 if test "x$with_native_win32" = xyes ; then
917 PY_LIB_DIR="$PY_PREFIX/libs"
919 PY_LIB_DIR=`$PYTHON -c 'import sys ; import distutils.sysconfig ; sys.stdout.write(distutils.sysconfig.get_config_var("LIBPL"))'`
923 GNM_PY_CFLAGS="$PY_INCLUDES $PYGOBJECT_CFLAGS"
924 GNM_PY_LDFLAGS="-L$PY_LIB_DIR -lpython$PY_VERSION $PYGOBJECT_LIBS"
925 python_msg="yes (using $PYTHON)"
926 elif test "x$with_python" = "xyes"; then
927 AC_MSG_ERROR([$python_msg])
930 AC_SUBST(GNM_PY_CFLAGS)
931 AC_SUBST(GNM_PY_LDFLAGS)
932 AC_SUBST(GNM_PY_LIBADD)
936 # Support for PDF docs
937 AC_ARG_ENABLE(pdfdocs,
938 AS_HELP_STRING([--enable-pdfdocs],[Generate documentation in Portable Document Format]),
939 [enable_pdfdocs=$enableval],
941 pdf_msg="No, not requested.";
942 if test x"$enable_pdfdocs" = xyes; then
944 AC_CHECK_PROG(DBCONTEXT, [dbcontext], [dbcontext], [])
945 AC_CHECK_PROG(DBLATEX, [dblatex], [dblatex], [])
946 if test x"$DBCONTEXT" = x"dbcontext"; then
949 if test x"$DBLATEX" = x"dblatex"; then
953 if test x"$pdfroute" != x""; then
954 pdf_msg="Yes, through $pdfroute."
957 Did not find a suitable tool for generating Portable Document Format from
958 DocBook XML - aborting.
960 Both the DocBook to ConTeXt and the DocBook to LaTeX conversion tool can be
962 http://dblatex.sourceforge.net/
967 AM_CONDITIONAL(ENABLE_PDFDOCS, test x"$enable_pdfdocs" = xyes)
968 AM_CONDITIONAL(ENABLE_PDF_VIA_DBCONTEXT, test x"$pdfroute" = x"dbcontext")
969 AM_CONDITIONAL(ENABLE_PDF_VIA_DBLATEX, test x"$pdfroute" = x"dblatex")
972 dnl A tricky way to comment out in m4:
974 dnl **************************************************
976 dnl **************************************************
978 mono_msg="disabled, still experimental"
980 AC_ARG_WITH(mono, AS_HELP_STRING([--with-mono], [Compile the mono scripting engine]))
982 no) mono_msg="Disabled by request";;
984 PKG_CHECK_MODULES(MONO, mono,
986 AC_DEFINE(WITH_MONO, 1, [Define if mono .NET engine is available])],
991 AM_CONDITIONAL(WITH_MONO, test "x$with_mono" = xyes)
992 AC_SUBST(MONO_CFLAGS)
996 # GObject Introspection
998 AC_ARG_ENABLE(introspection,
999 AS_HELP_STRING([--enable-introspection[=@<:@no/auto/yes@:>@]],
1000 [Enable introspection for this build]),,
1001 [enable_introspection=no])
1003 AC_MSG_CHECKING([for gobject-introspection])
1005 dnl presence/version checking
1006 AS_CASE([$enable_introspection],
1008 found_introspection="no (disabled, use --enable-introspection to enable)"
1011 PKG_CHECK_EXISTS([gobject-introspection-1.0],,
1012 AC_MSG_ERROR([gobject-introspection-1.0 is not installed]))
1013 PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $GIR_REQ],
1014 found_introspection=yes,
1015 AC_MSG_ERROR([You need to have gobject-introspection >= $1 installed to build AC_PACKAGE_NAME]))
1018 PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $GIR_REQ], found_introspection=yes, found_introspection=no)
1019 dnl Canonicalize enable_introspection
1020 enable_introspection=$found_introspection
1023 AC_MSG_ERROR([invalid argument passed to --enable-introspection, should be one of @<:@no/auto/yes@:>@])
1026 AC_MSG_RESULT([$found_introspection])
1028 if test "x$found_introspection" = "xyes"; then
1029 dnl You can override INTROSPECTION_GIRDIR and INTROSPECTION_TYPELIBDIR
1030 dnl if you wish. If you override the latter, you might want to set
1031 dnl GI_TYPELIB_PATH to include the same directory. For example
1033 dnl GI_TYPELIB_PATH=$PREFIX/lib64/girepository-1.0
1034 dnl INTROSPECTION_TYPELIBDIR=$GI_TYPELIB_PATH
1035 dnl INTROSPECTION_GIRDIR=$PREFIX/share/gir-1.0
1037 dnl Note, that unlike gnumeric's binaries, nothing tells python where
1038 dnl to find gnumeric libraries, so you might also need to set
1039 dnl LD_LIBRARY_PATH.
1041 INTROSPECTION_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0`
1042 INTROSPECTION_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0`
1043 INTROSPECTION_GENERATE=`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0`
1044 if test "x$INTROSPECTION_GIRDIR" = x; then
1045 INTROSPECTION_GIRDIR=`$PKG_CONFIG --variable=girdir gobject-introspection-1.0`
1047 if test "x$INTROSPECTION_TYPELIBDIR" = x; then
1048 INTROSPECTION_TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)"
1050 INTROSPECTION_CFLAGS=`$PKG_CONFIG --cflags gobject-introspection-1.0`
1051 INTROSPECTION_LIBS=`$PKG_CONFIG --libs gobject-introspection-1.0`
1052 INTROSPECTION_MAKEFILE=`$PKG_CONFIG --variable=datadir gobject-introspection-1.0`/gobject-introspection-1.0/Makefile.introspection
1054 INTROSPECTION_SCANNER=
1055 INTROSPECTION_COMPILER=
1056 INTROSPECTION_GENERATE=
1057 INTROSPECTION_GIRDIR=
1058 INTROSPECTION_TYPELIBDIR=
1059 INTROSPECTION_CFLAGS=
1061 INTROSPECTION_MAKEFILE=
1063 AC_SUBST(INTROSPECTION_SCANNER)
1064 AC_SUBST(INTROSPECTION_COMPILER)
1065 AC_SUBST(INTROSPECTION_GENERATE)
1066 AC_SUBST(INTROSPECTION_GIRDIR)
1067 AC_SUBST(INTROSPECTION_TYPELIBDIR)
1068 AC_SUBST(INTROSPECTION_CFLAGS)
1069 AC_SUBST(INTROSPECTION_LIBS)
1070 AC_SUBST(INTROSPECTION_MAKEFILE)
1072 AM_CONDITIONAL(HAVE_INTROSPECTION, test "x$found_introspection" = "xyes")
1073 dnl we need to change the install directories for distcheck
1074 AC_ARG_WITH([gir-dir],
1078 path to gir repository
1079 (automatically detected via pkg-config)
1083 [GIRDIR=$INTROSPECTION_GIRDIR]
1086 AC_ARG_WITH([typelib-dir],
1088 [--with-typelib-dir],
1090 path to typelibs repository
1091 (automatically detected via pkg-config)
1094 [TYPELIBDIR=$withval],
1095 [TYPELIBDIR=$INTROSPECTION_TYPELIBDIR]
1097 AC_SUBST(TYPELIBDIR)
1099 dnl **************************************************
1100 dnl * Config defaults
1101 dnl **************************************************
1103 dnl These are changed in gutils.c for WIN32 packages
1104 AC_SUBST(gnumeric_datadir, '${datadir}/gnumeric/${VERSION}')
1105 AC_SUBST(gnumeric_libdir, '${libdir}/gnumeric/${VERSION}')
1106 AC_SUBST(gnumeric_icondir, '${datadir}/pixmaps/gnumeric')
1107 AC_SUBST(gnumeric_localedir, '${prefix}/${DATADIRNAME}/locale')
1109 AC_SUBST(gnumeric_plugindir, '${gnumeric_libdir}/plugins')
1110 AC_SUBST(gnumeric_externplugindir, '${libdir}/gnumeric/${GNUMERIC_API_VER}/plugins')
1112 AC_SUBST(YYYYMMDD, `date +%Y%m%d`)
1114 dnl Export to gnumeric-config.h
1115 AC_DEFINE(GNM_VERSION_FULL, "gnumeric_version_full",
1116 [The version number of this release, with optional extra suffix])
1117 AC_DEFINE(GNM_VERSION_EPOCH, gnumeric_version_epoch,
1118 [The Epoch of this release])
1119 AC_DEFINE(GNM_VERSION_MAJOR, gnumeric_version_major,
1120 [The Major version number of this release])
1121 AC_DEFINE(GNM_VERSION_MINOR, gnumeric_version_minor,
1122 [The Minor version number of this release])
1123 AC_DEFINE(GNM_VERSION_EXTRA, "gnumeric_version_extra",
1124 [Extra, possibly empty tag for this release])
1125 AC_DEFINE(GNM_API_VERSION, "GNUMERIC_API_VER",
1126 [The API version number of this release])
1133 icons/16x16/Makefile
1134 icons/16x16/actions/Makefile
1135 icons/16x16/apps/Makefile
1136 icons/22x22/Makefile
1137 icons/22x22/actions/Makefile
1138 icons/22x22/apps/Makefile
1139 icons/24x24/Makefile
1140 icons/24x24/actions/Makefile
1141 icons/24x24/apps/Makefile
1142 icons/32x32/Makefile
1143 icons/32x32/actions/Makefile
1144 icons/32x32/apps/Makefile
1145 icons/48x48/Makefile
1146 icons/48x48/actions/Makefile
1147 icons/48x48/apps/Makefile
1148 icons/256x256/Makefile
1149 icons/256x256/apps/Makefile
1151 src/dialogs/Makefile
1152 src/widgets/Makefile
1154 src/cut-n-paste-code/Makefile
1157 plugins/fn-christian-date/Makefile
1158 plugins/fn-complex/Makefile
1159 plugins/fn-database/Makefile
1160 plugins/fn-date/Makefile
1161 plugins/fn-derivatives/Makefile
1162 plugins/fn-eng/Makefile
1163 plugins/fn-erlang/Makefile
1164 plugins/fn-financial/Makefile
1165 plugins/fn-hebrew-date/Makefile
1166 plugins/fn-info/Makefile
1167 plugins/fn-logical/Makefile
1168 plugins/fn-lookup/Makefile
1169 plugins/fn-math/Makefile
1170 plugins/fn-numtheory/Makefile
1171 plugins/fn-r/Makefile
1172 plugins/fn-stat/Makefile
1173 plugins/fn-string/Makefile
1174 plugins/fn-random/Makefile
1175 plugins/fn-tsa/Makefile
1176 plugins/applix/Makefile
1177 plugins/dif/Makefile
1178 plugins/excel/Makefile
1179 plugins/excelplugins/Makefile
1180 plugins/gda/Makefile
1181 plugins/gnome-db/Makefile
1182 plugins/gnome-glossary/Makefile
1183 plugins/html/Makefile
1184 plugins/lotus-123/Makefile
1185 plugins/lpsolve/Makefile
1186 plugins/nlsolve/Makefile
1187 plugins/glpk/Makefile
1188 plugins/mps/Makefile
1189 plugins/oleo/Makefile
1190 plugins/openoffice/Makefile
1191 plugins/paradox/Makefile
1192 plugins/perl-func/Makefile
1193 plugins/perl-loader/Makefile
1194 plugins/plan-perfect/Makefile
1195 plugins/psiconv/Makefile
1196 plugins/py-func/Makefile
1197 plugins/python-loader/Makefile
1198 plugins/qpro/Makefile
1199 plugins/sample_datasource/Makefile
1201 plugins/sylk/Makefile
1202 plugins/uihello/Makefile
1203 plugins/xbase/Makefile
1205 po-functions/Makefile.in
1207 schemas/org.gnome.gnumeric.gschema.xml.in
1208 schemas/org.gnome.gnumeric.dialogs.gschema.xml.in
1209 schemas/org.gnome.gnumeric.plugin.gschema.xml.in
1211 templates/english/Makefile
1212 templates/autoformat/Makefile
1215 tools/win32/Makefile
1216 tools/win32/moduleset
1217 tools/win32/gnumeric.nsi
1225 Source code location: ${srcdir}
1227 Compiler flags: ${CFLAGS}
1228 Floating point type: ${float_msg}
1232 Perl Support: ${perl_msg}
1233 Python Support: ${python_msg}
1235 GDA support: ${gda_msg}
1236 GNOME-DB support: ${gnomedb_msg}
1237 Psiconv support: ${psiconv_msg}
1239 PDF documentation: ${pdf_msg}
1241 # Mono support: ${mono_msg}
1242 # Guile Support: ${guile_msg}