Configure: disable gtk+ deprecation warnings.
[gnumeric.git] / configure.ac
blob78e60dc25910268668491faf515422df66a2d128
1 -*- mode: m4 -*-
2 dnl We require Automake 1.7.2, which requires Autoconf 2.54.
3 dnl (It needs _AC_AM_CONFIG_HEADER_HOOK, for example.)
4 AC_PREREQ(2.54)
5 AC_CONFIG_MACRO_DIR([m4])
6 AX_IS_RELEASE([git-directory])
8 m4_define([gnumeric_version_epoch], [1])
9 m4_define([gnumeric_version_major], [12])
10 m4_define([gnumeric_version_minor], [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([
17 ======== $1])])
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
27 dnl
28 dnl Within each x.y.*, ABI is maintained backward and _forward_ compatible.
29 dnl (As a consequence, no exported function may be added.)
30 dnl So it's enough to have one interface number per each x.y.* branch.
31 dnl
32 dnl OTOH, we are not able to keep ABI strictly backward compatible throughout
33 dnl the whole x.*.*.
34 dnl The easiest way is to declare no ABI compatibility, ie. AGE is always 0.
35 dnl
36 m4_define([version_iface],
37         m4_eval(100 * gnumeric_version_epoch + gnumeric_version_major))
39 AC_SUBST([VERSION_INFO], [version_iface:gnumeric_version_minor:0])
40 AC_SUBST([VERSION_IFACE], [version_iface])
42 if test `expr gnumeric_version_major % 2` -eq 1; then
43     AC_MSG_NOTICE([NOTE: This is a development release])
44     gnumeric_devel=yes
45     gnumeric_api_ver=gnumeric_version_epoch.`expr gnumeric_version_major + 1`
46     dnl An explicit version number should be used in place of the above
47     dnl if the epoch is to change.
48     dnl gnumeric_api_ver=2.0
49 else
50     gnumeric_devel=no
51     gnumeric_api_ver=gnumeric_version_epoch.gnumeric_version_major
53 gnumeric_api_ver_=`echo $gnumeric_api_ver | sed -e 's/\./_/g'`
55 dnl Almost like epoch.major but development versions look forward to the next
56 dnl stable release.
57 AC_SUBST([GNUMERIC_API_VER], [$gnumeric_api_ver])
58 AC_SUBST([GNUMERIC_API_VER_], [$gnumeric_api_ver_])
60 dnl This one is created by autoheader, ...
61 AC_CONFIG_HEADERS(gnumeric-config.h)
63 dnl ... and this one is a small subset, maintained manually,
64 dnl which will be installed.
65 AC_CONFIG_HEADERS(gnumeric-features.h)
66 dnl
67 dnl Make sure these two won't clash.  Put the following to gnumeric-config.h:
68 AH_BOTTOM([/* Don't include gnumeric-features.h, it's a subset of gnumeric-config.h. */
69 #define GNUMERIC_FEATURES_H])
71 AM_MAINTAINER_MODE([enable])
73 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
75 dnl AX_REQUIRE_DEFINED([GTK_DOC_CHECK])
76 GTK_DOC_CHECK
78 dnl We use a LINGUAS file, so we need intltool >= 0.35:
79 IT_PROG_INTLTOOL([0.35.0])
80 IT_PO_SUBDIR(po-functions)
82 dnl We use $host and $host_os:
83 AC_CANONICAL_HOST
85 AC_ISC_POSIX
86 AC_PROG_CC
87 AC_PROG_CC_C99
88 if test "$ac_cv_prog_cc_c99" = no; then
89         AC_MSG_ERROR([*** c99 is required])
92 AC_PROG_YACC
93 if test "x$ac_cv_prog_YACC" = x; then
94         AC_MSG_ERROR([*** bison or equivalent is required])
97 AC_PROG_LN_S
98 AC_HEADER_STDC
100 LT_PREREQ([2.2.6])
101 # Make --disable-static the default
102 LT_INIT([disable-static])
104 dnl Propagate Gnome-specific variable ACLOCAL_FLAGS to Makefile.
105 AC_SUBST(ACLOCAL_AMFLAGS, $ACLOCAL_FLAGS)
107 dnl *****************************
108 # Check for zlib.
110 dnl zlib is needed for the excel plugin; see plugins/excel/Makefile.am
112 _cppflags="${CPPFLAGS}"
113 _ldflags="${LDFLAGS}"
115 AC_ARG_WITH(zlib,
116         AS_HELP_STRING([--with-zlib=DIR], [use libz in DIR]),
117         [case $withval in
118          yes|no) ;;
119          *)     Z_DIR=$withval
120                 CPPFLAGS="${CPPFLAGS} -I$withval/include"
121                 LDFLAGS="${LDFLAGS} -L$withval/lib"
122                 ;;
123          esac])
125 if test "x$with_zlib" != xno; then
126         with_zlib=no
127         AC_CHECK_HEADER(zlib.h, [AC_CHECK_LIB(z, gzread, [with_zlib=yes])])
130 if test "$with_zlib" = no; then
131         AC_MSG_ERROR([*** zlib is required])
134 if test "x${Z_DIR}" != "x"; then
135         Z_CPPFLAGS="-I${Z_DIR}/include"
136         case ${host} in
137         *-*-solaris*)   Z_LIBS="-L${Z_DIR}/lib -R${Z_DIR}/lib -lz" ;;
138         *)              Z_LIBS="-L${Z_DIR}/lib -lz" ;;
139         esac
140 else
141         Z_LIBS="-lz"
143 AC_SUBST(Z_CPPFLAGS)
144 AC_SUBST(Z_LIBS)
146 CPPFLAGS=${_cppflags}
147 LDFLAGS=${_ldflags}
149 dnl **********
150 dnl * Goffice
151 dnl **********
152 # Goffice releases are parallel installable, which do we depend on
153 GOFFICE_API_VER="0.10"
154 AC_SUBST(GOFFICE_API_VER)
155 # Components
156 GOFFICE_PLUGINS_DIR=`pkg-config --variable=PluginDir libgoffice-${GOFFICE_API_VER}`
157 AC_SUBST(GOFFICE_PLUGINS_DIR)
158 GOFFICE_VERSION=`pkg-config --modversion libgoffice-${GOFFICE_API_VER}`
159 AC_SUBST(GOFFICE_VERSION)
162 dnl PKG_PROG_PKG_CONFIG is expanded just before the first occurrence of
163 dnl PKG_CHECK_MODULES.  Since this is inside an `if,' it can escape
164 dnl execution.  Thus we need an explicit call:
165 PKG_PROG_PKG_CONFIG(0.18)
167 dnl *****************************
168 libspreadsheet_reqs="
169         libgoffice-${GOFFICE_API_VER}   >= 0.10.40
170         libgsf-1                >= 1.14.33
171         libxml-2.0              >= 2.4.12
173 gnumeric_reqs="$libspreadsheet_reqs
174         glib-2.0                >= 2.38.0
175         gobject-2.0             >= 2.38.0
176         gmodule-2.0             >= 2.38.0
177         gthread-2.0             >= 2.38.0
178         pango                   >= 1.24.0
179         pangocairo              >= 1.24.0
181 libspreadsheet_gtk_reqs="
182         gtk+-3.0                >= 3.8.7
185 gnumeric_gtk_reqs="$libspreadsheet_gtk_reqs"
187 ui_msg=
189 with_win32=no
190 case $host_os in
191 mingw* | pw32* | cygwin*)
192     with_win32=yes
193     ;;
194 esac
196 dnl *******************
197 dnl Should we use gtk ?
198 dnl *******************
199 gnumeric_with_gtk=true
200 AC_ARG_WITH(gtk, AS_HELP_STRING([--without-gtk], [Build without UI]))
201 if test "x$with_gtk" = xno; then
202         ui_msg="None (Gtk disabled by request)"
203         gnumeric_with_gtk=false
204         AC_MSG_ERROR([configuration without gtk+ currently does not work])
205 else
206         dnl We shouldn't silently default to --without-gtk.
207         dnl If the requirements are not met, fail.
208         ui_msg="Gtk"
209         PKG_CHECK_MODULES(GTK, [$libspreadsheet_gtk_reqs])
210         PKG_CHECK_MODULES(GTK, [$gnumeric_gtk_reqs])
213 if test "x$gnumeric_with_gtk" = xtrue ; then
214         AC_DEFINE(GNM_WITH_GTK, 1, [Define if UI is built])
215         libspreadsheet_reqs="$libspreadsheet_reqs $libspreadsheet_gtk_reqs"
216         gnumeric_reqs="$gnumeric_reqs $gnumeric_gtk_reqs"
219 AM_CONDITIONAL(WITH_GTK,   $gnumeric_with_gtk)
221 dnl ****************************
222 dnl now that we have selected out libraries the whole collection in one
223 dnl shot so that we can have a nice neat compile/link line
224 dnl ****************************
226 PKG_CHECK_MODULES(LIBSPREADSHEET, $libspreadsheet_reqs)
227 AC_SUBST(LIBSPREADSHEET_LIBS)
228 AC_SUBST(LIBSPREADSHEET_CFLAGS)
230 PKG_CHECK_MODULES(GNUMERIC, $gnumeric_reqs)
231 AC_SUBST(GNUMERIC_LIBS)
232 AC_SUBST(GNUMERIC_CFLAGS)
234 # We don't attempt to track gtk+4, so disable the very noise warnings
235 CFLAGS="$CFLAGS -DGDK_DISABLE_DEPRECATION_WARNINGS -DGTK_DISABLE_DEPRECATION_WARNINGS"
237 with_native_win32=no
238 case $host_os in
239 mingw* | pw32*)
240     with_native_win32=yes
241     AC_ARG_VAR(WINDRES, [The windres executable (used by win32 builds only).])
242     AC_CHECK_TOOL(WINDRES, windres, :)
243     ;;
244 esac
245 AM_CONDITIONAL(WITH_WIN32, test $with_win32 = yes)
246 AM_CONDITIONAL(WITH_NATIVE_WIN32, test $with_native_win32 = yes)
247 AM_CONDITIONAL(CROSS_COMPILING, test x"$cross_compiling" != xno)
249 if test "x$with_win32" = "xyes"; then
250     GNUMERIC_PLUGIN_LDFLAGS="-avoid-version -no-undefined $GNUMERIC_LIBS -Wl,--enable-runtime-pseudo-reloc,--export-all-symbols \$(top_builddir)/src/libspreadsheet.la -s"
251 else
252     GNUMERIC_PLUGIN_LDFLAGS="-avoid-version"
254 AC_SUBST(GNUMERIC_PLUGIN_LDFLAGS)
256 dnl **************************************************
257 dnl This needs to be done before we add aggressive -Werror=foo flags
258 dnl below.
259 AC_SUBST(GETTEXT_PACKAGE, gnumeric-${VERSION})
260 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",
261         [The package name, for gettext])
262 AM_GLIB_GNU_GETTEXT
264 dnl ****************************
265 dnl prep the pixmap generator
266 dnl ****************************
268 AC_ARG_VAR(GLIB_GENMARSHAL, [The glib-genmarshal executable.])
269 AC_CHECK_PROG(GLIB_GENMARSHAL, glib-genmarshal$ac_exeext, glib-genmarshal$ac_exeext)
270 GLIB_COMPILE_RESOURCES=`$PKG_CONFIG --variable=glib_compile_resources gio-2.0`
271 AC_SUBST(GLIB_COMPILE_RESOURCES)
273 AC_ARG_VAR(GDK_PIXBUF_CSOURCE, [The gdk-pixbuf-csource executable.])
274 AC_CHECK_PROG(GDK_PIXBUF_CSOURCE, gdk-pixbuf-csource$ac_exeext, gdk-pixbuf-csource$ac_exeext)
276 AC_ARG_ENABLE(component,
277   AS_HELP_STRING([--disable-component], [Do not build the goffice component]),
278   [], [enable_component=yes])
279 component_dir=""
280 if test x"$enable_component" = xyes; then
281         component_dir="component"
282 else
283         component_dir=""
285 AC_SUBST(COMPONENT_DIR, $component_dir)
287 dnl ****************************
288 dnl GDA Plugin
289 dnl ****************************
290 try_gda=true
291 gda_msg=yes
292 gnomedb_msg=no
293 AC_ARG_WITH(gda,
294         AS_HELP_STRING([--with-gda], [Compile the Gnome Database Access plugin]),
295         if test "x$withval" != xyes; then
296                 try_gda=false
297                 gda_msg="Disabled by request"
298         fi
300 if test "$try_gda" = true; then
301         PKG_CHECK_MODULES(GDA, [libgda-5.0 >= 5.0.0, libgda-ui-5.0 >= 5.0.0],
302                 [gda_msg=yes],
303                 [gda_msg="NO.  libgda problem"])
304         if test "$gda_msg" = yes; then
305                 PKG_CHECK_MODULES(GNOMEDB, [libgnomedb-4.0 >= 3.99.6],
306                         [gnomedb_msg="yes"],
307                         [gnomedb_msg="NO. libgnomedb problem"])
308                 if test "$gnomedb_msg" = yes; then
309                         AC_DEFINE(HAVE_LIBGNOMEDB, 1, [ Define if libgnomedb support is compiled in])
310                 fi
311         fi
313 AM_CONDITIONAL(WITH_GDA, test x"$gda_msg" = xyes)
314 AC_SUBST(GDA_CFLAGS)
315 AC_SUBST(GDA_LIBS)
317 AM_CONDITIONAL(WITH_GNOMEDB, test x"$gnomedb_msg" = xyes)
318 AC_SUBST(GNOMEDB_CFLAGS)
319 AC_SUBST(GNOMEDB_LIBS)
321 dnl ****************************
323 AC_CHECK_DECL(fdopen, fdopen_works=yes, fdopen_works=no)
325 if test $fdopen_works = no ; then
326         unset ac_cv_have_decl_fdopen
327         CFLAGS="$CFLAGS -D_POSIX_SOURCE"
328         AC_MSG_NOTICE([adding -D_POSIX_SOURCE to CFLAGS])
329         AC_CHECK_DECL(fdopen, fdopen_works=yes, fdopen_works=no)
330         if test $fdopen_works = no ; then
331                 AC_MSG_ERROR([fdopen is not available])
332         fi
335 # Unfortunately, -D_POSIX_SOURCE turns off struct timeval on Solaris
336 AC_MSG_CHECKING([whether struct timeval is available])
337 AC_COMPILE_IFELSE(
338         [AC_LANG_PROGRAM([[#include <sys/time.h>]], [[struct timeval tv;]])],
339         [struct_timeval_works=yes],
340         [struct_timeval_works=no])
341 AC_MSG_RESULT($struct_timeval_works)
343 if test $struct_timeval_works = no ; then
344         CFLAGS="$CFLAGS -D__EXTENSIONS__"
345         AC_MSG_CHECKING([whether struct timeval is available with -D__EXTENSIONS__])
346         AC_COMPILE_IFELSE(
347                 [AC_LANG_PROGRAM([[#include <sys/time.h>]], [[struct timeval tv;]])],
348                 [struct_timeval_works=yes],
349                 [struct_timeval_works=no])
350         AC_MSG_RESULT($struct_timeval_works)
351         if test $struct_timeval_works = no ; then
352                 AC_MSG_ERROR([struct timeval is not available])
353         fi
356 dnl src/functions/fn-math.c uses M_PI
358 AC_MSG_CHECKING([whether M_PI is available])
359 AC_COMPILE_IFELSE(
360         [AC_LANG_PROGRAM([[#include <math.h>]], [[double f = M_PI]])],
361         [works_without_bsd_source=yes],
362         [works_without_bsd_source=no])
363 AC_MSG_RESULT($works_without_bsd_source)
365 if test $works_without_bsd_source = no ; then
366         CFLAGS="$CFLAGS -D_BSD_SOURCE"
367         AC_MSG_CHECKING([whether M_PI is available with -D_BSD_SOURCE])
368         AC_COMPILE_IFELSE(
369                 [AC_LANG_PROGRAM([[#include <math.h>]], [[double f = M_PI]])],
370                 [m_pi_works=yes],
371                 [m_pi_works=no])
372         AC_MSG_RESULT($m_pi_works)
373         if test $m_pi_works = no ; then
374                 AC_MSG_ERROR([M_PI is not available])
375         fi
379 AC_SUBST(GUILE_LIBS)
380 AC_SUBST(GUILE_INCS)
382 dnl Comment out the guile block:
383 ifelse([
384 dnl check for guile 1.5
385 try_guile=false
386 guile_msg="disabled pending some guile developer interest"
387 enable_guile=false
388 AC_ARG_WITH(guile,
389         AS_HELP_STRING([--with-guile], [Compile with Guile support or without it]),
390         if test "x$withval" = xyes; then
391                 try_guile=true
392         fi
394 if $try_guile; then
395         AC_MSG_CHECKING(for guile >= 1.5)
396         if test "`guile -c '(display (string>=? (version) "1.4.1"))'`" != "#t"; then
397                 AC_MSG_RESULT([Your Guile is too old.  You need Guile 1.5 or later.])
398         else
399                 AC_MSG_RESULT(found)
400                 guile_msg="yes"
401                 enable_guile=true
402         fi
404 if $enable_guile; then
405         GNOME_CHECK_GUILE
407 AM_CONDITIONAL(WITH_GUILE, $enable_guile)
410 dnl **************************************************
411 dnl * psiconv support
412 dnl **************************************************
414 AC_ARG_WITH(psiconv,
415         AS_HELP_STRING([--without-psiconv], [Compile without Psiconv support]))
416 AC_ARG_VAR(PSICONV_CONFIG, [The psiconv-config executable.])
417 if test "x$with_psiconv" != xno; then
418     AC_CHECK_PROG(PSICONV_CONFIG,psiconv-config,psiconv-config)
419     if test x"$PSICONV_CONFIG" = x; then
420         psiconv_msg="missing dependencies"
421     else
422         AC_MSG_CHECKING(for psiconv >= 0.9.3)
423         if $PSICONV_CONFIG --version | awk -F. \
424                 '{exit !($1 > 0 || $2 > 9 || ($2 == 9 && $3 >= 3))}'
425         then
426             PSICONV_CFLAGS=`$PSICONV_CONFIG --cflags`
427             PSICONV_LIBS=`$PSICONV_CONFIG --libs`
428             psiconv_msg=yes
429         else
430             psiconv_msg=no
431         fi
432         AC_MSG_RESULT($psiconv_msg)
433     fi
434 else
435     psiconv_msg=no
437 AM_CONDITIONAL(WITH_PSICONV, test "x$psiconv_msg" = xyes)
438 AC_SUBST(PSICONV_LIBS)
439 AC_SUBST(PSICONV_CFLAGS)
441 try_paradox=true
442 enable_paradox=false
443 AC_ARG_WITH(paradox,
444         AS_HELP_STRING([--without-paradox], [Compile without Paradox support]),
445         if test "x$withval" = xno; then
446                 try_paradox=false
447         fi
450 if $try_paradox; then
451         PKG_CHECK_MODULES(PARADOX,
452                 [pxlib >= 0.4.0],
453                 [paradox_msg="yes"],
454                 [paradox_msg="missing dependencies"])
457 if test "x$paradox_msg" = xyes; then
458         SAVE_LIBS="$LIBS"
459         LIBS="$LIBS $PARADOX_LIBS"
460         AC_CHECK_FUNC(PX_open_gsf,[ enable_paradox=true ],)
461         LIBS="$SAVE_LIBS"
462         unset SAVE_LIBS
464 AM_CONDITIONAL(WITH_PARADOX, $enable_paradox)
465 AC_SUBST(PARADOX_LIBS)
466 AC_SUBST(PARADOX_CFLAGS)
468 plugin_list_given=false
469 PLUGIN_LIST=""
470 AC_ARG_ENABLE(plugins,
471         AS_HELP_STRING([--enable-plugins="text html"], [Compile only the listed plugins]),
472         [plugin_list_given=true
473          test "x$enableval" != xno && PLUGIN_LIST=$enableval
475 AM_CONDITIONAL(PLUGIN_LIST_GIVEN, $plugin_list_given)
476 AC_SUBST(PLUGIN_LIST)
478 POFILES_FULL=
479 for lang in $ALL_LINGUAS; do
480     POFILES_FULL="$POFILES_FULL \$(top_srcdir)/po/$lang.po"
481 done
482 AC_SUBST(POFILES_FULL)
485 dnl Code to handle po-functions/Makefile* and po-functions/POTFILES*
487 dnl First, let me document how the po/ directory is dealt with.
488 dnl Dark mysteries here, so skip the next paragraph if you don't have enough
489 dnl holy water at your hand.  You have been warned.
491 dnl AM_GLIB_GNU_GETTEXT creates an incorrect incarnation of po/POTFILES, as
492 dnl glib-gettext.m4 doesn't know about intltool tags.  Later on, just before
493 dnl config.status is created, a code originating from intltool.m4 creates
494 dnl POTFILES again, this time correctly removing the intltool tags.
495 dnl config.status then creates po/Makefile, again in two steps.  First,
496 dnl po/Makefile.in is created from po/Makefile.in.in the usual way, and then
497 dnl a code registered via the obsolete macro AC_OUTPUT_COMMANDS insterts the
498 dnl contents of file POTFILES to po/Makefile.
500 dnl But both glib-gettext and intltool have the dirname "po/" hardwired, so
501 dnl we are on our own with po-functions.
503 dnl We use a more straightforward approach for po-functions:
504 dnl 1) We create POTFILES immediately here.
505 dnl 2) We let config.status to create Makefile.in.
506 dnl 3) We use AC_CONFIG_COMMANDS to create Makefile.
508 [# Create po-functions/POTFILES:
509 if test -d po-functions; then
510         rm -f po-functions/POTFILES
511 else
512         mkdir po-functions
514 case "$srcdir" in
515         .)  top_srcdir=.. ;;
516         [\\/]* | ?:[\\/]* )  # Absolute name.
517                 top_srcdir="$srcdir" ;;
518         *)  top_srcdir="../$srcdir" ;;
519 esac
520 sed <$srcdir/po-functions/POTFILES.in -e '/^#/d' -e 's/^[[].*[]] *//' \
521          -e '/^[   ]*$/d' -e "s,^,       $top_srcdir/," | \
522         sed -e '$!s/$/ \\/' >po-functions/POTFILES
524 dnl Finally, register for creation of po-functions/Makefile:
525 dnl We do not currently do anything here.
526 AC_CONFIG_COMMANDS(po-functions/Makefile,
527   [cp po-functions/Makefile.in po-functions/Makefile])
529 SAVE_LIBS="$LIBS"
530 LIBS="$LIBS $GNUMERIC_LIBS"
531 AC_CHECK_FUNCS(mkfifo)
532 LIBS="$SAVE_LIBS"
533 unset SAVE_LIBS
535 AC_HEADER_SYS_WAIT
537 dnl Check for some functions
538 AC_CHECK_FUNCS(uname setenv putenv)
540 dnl FIXME: Does this really belong here?
541 AC_CHECK_FUNC(bind_textdomain_codeset,,[AC_CHECK_LIB(intl,bind_textdomain_codeset)])
543 dnl check for complete locale implementation
544 AC_CHECK_HEADERS(langinfo.h)
546 dnl check for rlimit
547 AC_CHECK_HEADERS(sys/resource.h)
549 dnl we need to check fpu mode
550 AC_CHECK_HEADERS(fpu_control.h)
552 SAVE_CFLAGS=$CFLAGS
553 SAVE_LIBS=$LIBS
554 CFLAGS="$CFLAGS $GNUMERIC_CFLAGS"
555 LIBS="$GNUMERIC_LIBS $LIBS"
557 AC_CHECK_FUNCS(gtk_cell_renderer_text_get_background_set gtk_cell_renderer_text_get_foreground_set gtk_cell_renderer_text_get_editable)
558 AC_CHECK_FUNCS(gtk_entry_set_editing_cancelled gtk_icon_theme_add_resource_path)
560 AC_MSG_CHECKING([for 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])
566                 AC_MSG_RESULT(yes)],
567                [AC_MSG_RESULT(no)])
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])
573                 AC_MSG_RESULT(yes)],
574                [AC_MSG_RESULT(no)])
576 CFLAGS=$SAVE_CFLAGS
577 LIBS=$SAVE_LIBS
579 dnl We supply our own lgamma and lgamma_r when missing.
580 supply_lgamma_r=yes
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]
586          )
587          supply_lgamma_r=no
588          LIBS="$LIBS -lm"])
589 else
590   supply_lgamma_r=no
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]
595         )
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]
601         )
604 cos_works=yes
605 AC_MSG_CHECKING([cos is reliable])
606 AC_RUN_IFELSE(
607         [AC_LANG_PROGRAM([[
608                         #include <stdlib.h>
609                         #include <math.h>
610                 ]],
611                 [[
612                         const char *s = "1.5689793435451356";
613                         double x = atof (s);
614                         double c = cos (x);
615                         int ok = (c > 0 && c < 0.05);
616                         return ok ? 0 : 1;
617                 ]])],
618         [AC_MSG_RESULT(yes)
619          cos_works=yes],
620         [AC_MSG_RESULT(no)
621          cos_works=no],
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]
627         )
630 float_msg=double
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"
635                 SAVE_LIBS="$LIBS"
636                 CFLAGS="$GNUMERIC_CFLAGS"
637                 LIBS="$GNUMERIC_LIBS -lm"
639                 AC_CHECK_HEADERS(sunmath.h)
641                 AC_CHECK_FUNCS(go_render_generall,
642                                ,
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 \
648                                 isnanl finitel,
649                                 ,
650                                 AC_MSG_ERROR([Long doubles require the $ldfunc function.]))
652                 AC_MSG_CHECKING([checking for working erfl and erfcl])
653                 have_erfl=no
654                 have_erfcl=no
655                 AC_RUN_IFELSE(
656                         [AC_LANG_PROGRAM([[
657                                 #include <math.h>
658                                 #ifdef HAVE_SUNMATH_H
659                                 #include <sunmath.h>
660                                 #endif
661                                 ]],
662                                 [[
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);
667                                 ]])],
668                         [AC_DEFINE(HAVE_ERFL)
669                          have_erfl=yes
670                          AC_DEFINE(HAVE_ERFCL)
671                          have_erfcl=yes
672                         AC_MSG_RESULT(yes)],
673                         AC_MSG_RESULT(no),
674                         [AC_CHECK_FUNCS(erfl erfcl)
675                         have_erfl=$ac_cv_func_erfl
676                         have_erfcl=$ac_cv_func_erfcl
677                         ])
679                 if $have_erfl = no; then
680                         AC_DEFINE(GNM_SUPPLIES_ERFL, 1,
681                                  [Define if Gnumeric supplies the erfl function]
682                                  )
683                 fi
684                 if $have_erfcl = no; then
685                         AC_DEFINE(GNM_SUPPLIES_ERFCL, 1,
686                                  [Define if Gnumeric supplies the erfcl function]
687                                  )
688                 fi
690                 CFLAGS="$SAVE_CFLAGS"
691                 LIBS="$SAVE_LIBS"
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]
697                 )
698         fi]
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])
710         AC_COMPILE_IFELSE(
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 \
721                          -Wmissing-noreturn \
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.
735                 AC_COMPILE_IFELSE(
736                         [AC_LANG_PROGRAM([[#include <stdio.h>]], [])],
737                         [has_option=yes],
738                         [has_option=no])
739                 CFLAGS="$SAVE_CFLAGS"
740                 if test $has_option = yes; then
741                         CFLAGS="$CFLAGS $option"
742                 fi
743                 AC_MSG_RESULT($has_option)
744                 unset has_option
745                 unset SAVE_CFLAGS
746         done
747         unset option
749 AC_SUBST(WARN_CFLAGS)
751 dnl **************************************************
752 dnl * Check for GSettings
753 dnl **************************************************
754 have_gsettings=no
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])
758         GLIB_GSETTINGS
759         have_gsettings=yes],
760         [GSETTINGS_RULES=""
761         AC_SUBST(GSETTINGS_RULES)])
762 AM_CONDITIONAL(HAVE_GSETTINGS, test $have_gsettings=yes)
764 dnl **************************************************
765 dnl * Check for Perl
766 dnl **************************************************
768 AC_ARG_VAR(PERL, [The Perl executable.])
769 AC_CHECK_PROG(PERL, perl, perl)
771 want_perl=auto
772 have_perl=no
773 perl_reason=""
774 AC_ARG_WITH(perl, AS_HELP_STRING([--without-perl], [Do not build the Perl plugin loader]),
775         [case $withval in
776         yes) want_perl=yes;;
777         no) want_perl=no;;
778         esac])
779 if test "x$want_perl" = xno ; then
780     perl_reason="disabled by request"
781 else
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); }'
785         then
786             AC_MSG_RESULT(yes)
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
800 #include "EXTERN.h"
801 #include "perl.h"
802 #include "XSUB.h"
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 &&
807             test -x testperl &&
808             have_perl=yes
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
814             fi
816             rm -f testperl$ac_exeext testperl.$ac_objext testperl.c testperl.err
818         else
819             AC_MSG_RESULT(no)
820             perl_reason="missing parts of perl"
821         fi
822     else
823         perl_reason="missing perl"
824     fi
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)"
834 else
835     perl_msg="no ($perl_reason)"
837 AC_SUBST(PERL_CCCDLFLAGS)
838 AC_SUBST(PERL_LDDLFLAGS)
839 AC_SUBST(PERL_CC)
840 AC_SUBST(PERL_LD)
841 AC_SUBST(PERL_CCOPTS)
842 AC_SUBST(PERL_LDOPTS)
844 dnl **************************************************
845 dnl * Check for Python
846 dnl **************************************************
847 python_msg="yes"
848 GNM_PY_CFLAGS=
849 GNM_PY_LDFLAGS=
850 GNM_PY_LIBADD=
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.])
854 case $with_python in
855 yes|no) ;;
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 ...]);;
859 esac
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"
864     fi
865 else
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
871 have_python=no
872 have_python_gi=no
873 if test "x$PYTHON" != x; then
874     AC_DEFINE_UNQUOTED(PYTHON_INTERPRETER, ["$PYTHON"],
875                        [The Python interpreter to use])
876     have_python=yes
878     AC_MSG_CHECKING([for python module gi])
879     if $PYTHON -c 'import gi' 2>/dev/null; then
880         have_python_gi=yes
881     fi
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
892         AC_MSG_RESULT(yes)
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/\\.//'`
896         fi
897     else
898         AC_MSG_RESULT(no)
899         python_msg="NO.  Python version \"${PY_VERSION}\" is too old."
900     fi
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)'`
906     fi
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"
910         else
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))'`
912         fi
913     else
914         PY_INCLUDES="-I$PY_INCLUDE_DIR"
915     fi
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
922             AC_MSG_RESULT(yes)
923             python_msg="yes"
924             break
925         else
926             AC_MSG_RESULT(no)
927         fi
928     done
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"
942         else
943             PY_LIB_DIR=`$PYTHON -c 'import sys ; import distutils.sysconfig ; sys.stdout.write(distutils.sysconfig.get_config_var("LIBPL"))'`
944         fi
945     fi
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)
958 YELP_HELP_INIT
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],
964   [enable_pdfdocs=no])
965 pdf_msg="No, not requested.";
966 if test x"$enable_pdfdocs" = xyes; then
967         pdfroute=""
968         AC_CHECK_PROG(DBCONTEXT, [dbcontext], [dbcontext], [])
969         AC_CHECK_PROG(DBLATEX, [dblatex], [dblatex], [])
970         if test x"$DBCONTEXT" = x"dbcontext"; then
971                 pdfroute=dbcontext
972         else
973                 if test x"$DBLATEX" = x"dblatex"; then
974                         pdfroute=dblatex
975                 fi
976         fi
977         if test x"$pdfroute" != x""; then
978                 pdf_msg="Yes, through $pdfroute."
979         else
980                 AC_MSG_ERROR([
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
985 obtained from
986         http://dblatex.sourceforge.net/
988                 exit 1
989         fi
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:
997 ifelse([
998 dnl **************************************************
999 dnl * Check for mono
1000 dnl **************************************************
1001 with_mono=no
1002 mono_msg="disabled, still experimental"
1004 AC_ARG_WITH(mono, AS_HELP_STRING([--with-mono], [Compile the mono scripting engine]))
1005 case $with_mono in
1006 no)     mono_msg="Disabled by request";;
1008     PKG_CHECK_MODULES(MONO, mono,
1009         [with_mono=yes
1010          AC_DEFINE(WITH_MONO, 1, [Define if mono .NET engine is available])],
1011         [with_mono=no])
1012     mono_msg=$with_mono
1013     ;;
1014 esac
1015 AM_CONDITIONAL(WITH_MONO, test "x$with_mono" = xyes)
1016 AC_SUBST(MONO_CFLAGS)
1017 AC_SUBST(MONO_LIBS)
1020 # GObject Introspection
1021 GIR_REQ=1.0.0
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],
1031 [no], [
1032     found_introspection="no (disabled, use --enable-introspection to enable)"
1034 [yes],[
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]))
1041 [auto],[
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
1046 [       
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
1056    dnl
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
1060    dnl
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`
1070    fi
1071    if test "x$INTROSPECTION_TYPELIBDIR" = x; then
1072      INTROSPECTION_TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)"
1073    fi
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
1077 else
1078    INTROSPECTION_SCANNER=
1079    INTROSPECTION_COMPILER=
1080    INTROSPECTION_GENERATE=
1081    INTROSPECTION_GIRDIR=
1082    INTROSPECTION_TYPELIBDIR=
1083    INTROSPECTION_CFLAGS=
1084    INTROSPECTION_LIBS=
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],
1099         AS_HELP_STRING(
1100                 [--with-gir-dir],
1101                 [
1102                  path to gir repository
1103                  (automatically detected via pkg-config)
1104                 ]
1105         ),
1106         [GIRDIR=$withval],
1107         [GIRDIR=$INTROSPECTION_GIRDIR]
1109 AC_SUBST(GIRDIR)
1110 AC_ARG_WITH([typelib-dir],
1111         AS_HELP_STRING(
1112                 [--with-typelib-dir],
1113                 [
1114                  path to typelibs repository
1115                  (automatically detected via pkg-config)
1116                 ]
1117         ),
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])
1153 AC_OUTPUT([
1154 gnumeric.spec
1155 Makefile
1156 libspreadsheet.pc
1157 icons/Makefile
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
1175 src/Makefile
1176 src/dialogs/Makefile
1177 src/widgets/Makefile
1178 src/tools/Makefile
1179 src/cut-n-paste-code/Makefile
1180 doc/Makefile
1181 plugins/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
1225 plugins/sc/Makefile
1226 plugins/sylk/Makefile
1227 plugins/uihello/Makefile
1228 plugins/xbase/Makefile
1229 po/Makefile.in
1230 po-functions/Makefile.in
1231 schemas/Makefile
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
1235 templates/Makefile
1236 templates/english/Makefile
1237 templates/autoformat/Makefile
1238 test/Makefile
1239 tools/Makefile
1240 tools/win32/Makefile
1241 tools/win32/moduleset
1242 tools/win32/gnumeric.nsi
1243 component/Makefile
1246 echo "
1248 Configuration:
1250         Source code location:   ${srcdir}
1251         Compiler:               ${CC}
1252         Compiler flags:         ${CFLAGS}
1253         Floating point type:    ${float_msg}
1255         UI:                     ${ui_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}