-*- mode: m4 -*- AC_PREREQ(2.52) AC_INIT(gnumeric, 1.1.2, http://bugzilla.gnome.org/enter_bug.cgi?product=gnumeric) AC_CONFIG_SRCDIR(src/sheet.h) AM_CONFIG_HEADER(gnumeric-config.h) AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION) AM_MAINTAINER_MODE GNOME_PLATFORM_GNOME_2(yes, force) # Make --disable-static the default AC_DISABLE_STATIC AC_ISC_POSIX AC_PROG_CC AC_PROG_YACC AM_PROG_LIBTOOL AC_PROG_INTLTOOL AM_PROG_LIBTOOL AC_STDC_HEADERS AC_ARG_PROGRAM PKG_CHECK_MODULES(GNUMERIC,[ glib-2.0 >= 1.3.14 libxml-2.0 >= 2.4.12 gtk+-2.0 >= 1.3.14 libglade-2.0 >= 1.99.7 libgnomecanvas-2.0 >= 1.110.0 gal-2.0 >= 0.0.2 libgnome-2.0 >= 1.105.0 libgnomeui-2.0 >= 1.106.0 libgnomeprint-2.0 >= 1.106.0 libgnomeprintui-2.0 >= 1.106.0 ]) AC_SUBST(GNUMERIC_LIBS) AC_SUBST(GNUMERIC_CFLAGS) AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal) AC_PATH_PROG(GDK_PIXBUF_CSOURCE, gdk-pixbuf-csource) ## this should come after `AC_PROG_CC' GNOME_COMPILE_WARNINGS set_more_warnings=yes if test "$GCC" = "yes" -a "x$set_more_warnings" != "xno"; then for option in -Wsign-promo -Wsign-compare -Wpointer-arith -Wnested-externs -Wchar-subscripts -Wwrite-strings; do SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $option" AC_MSG_CHECKING([whether gcc understands $option]) AC_TRY_COMPILE([], [], has_option=yes, has_option=no,) if test $has_option = no; then CFLAGS="$SAVE_CFLAGS" fi AC_MSG_RESULT($has_option) unset has_option unset SAVE_CFLAGS done unset option fi float_msg=double have_ld=no AC_ARG_WITH(long_double, [--{with,without}-long-double Use long double for floating point], [if test "x$withval" = xyes; then AC_C_LONG_DOUBLE if test "x$ac_cv_c_long_double" != "xyes"; then AC_MSG_ERROR([Long double type is not available.]) fi need_sunmath=no for ldfunc in fabsl sqrtl expl expm1l logl log10l log1pl ceill floorl powl hypotl \ sinl cosl tanl asinl acosl atanl atan2l \ sinhl coshl tanhl asinhl acoshl atanhl \ isnanl finitel; do AC_CHECK_FUNC($ldfunc, , AC_CHECK_LIB(m, $ldfunc, , AC_CHECK_LIB(sunmath, $ldfunc, [ if test "x$need_sunmath" = "xno"; then # FIXME: better idea? LDFLAGS="$LDFLAGS -L/opt/SUNWspro/lib -R/opt/SUNWspro/lib -lsunmath" sunmathinclude=`ls -d /opt/SUNWspro/*/include/cc | tail -1` CPPFLAGS="$CPPFLAGS -I$sunmathinclude" fi need_sunmath=yes ], AC_MSG_ERROR([Long doubles require the $ldfunc function.]), -L/opt/SUNWspro/lib $GNUMERIC_LIBS))) done if test "x$need_sunmath" = "xyes"; then AC_CHECK_HEADERS([sunmath.h floatingpoint.h], , AC_MSG_ERROR([Long doubles require the sunmath.h header.])) fi AC_CHECK_FUNCS(modfl frexpl ldexpl strtold string_to_decimal decimal_to_quadruple) if test "x$ac_cv_func_strtold" = "xyes"; then AC_MSG_CHECKING([if we must prototype strtold ourselves]) AC_TRY_RUN([ #include int main () { const char *s = "+3.1415e+0"; char *theend; long double res = strtold (s, &theend); return !(*theend == 0 && finitel (res) && res >= 3.14 && res <= 3.15); }], AC_MSG_RESULT(no), [AC_MSG_RESULT(yes) AC_DEFINE(MUST_PROTOTYPE_STRTOLD)], AC_MSG_RESULT(assuming not)); true elif test "x$ac_cv_func_string_to_decimal" = "xyes" -a \ "x$ac_cv_func_decimal_to_quadruple" = "xyes" -a \ "x$ac_cv_header_floatingpoint_h" = "xyes"; then true else AC_MSG_WARN([You lack the strtold function -- precision will be impaired]) fi if test "x$ac_cv_func_modfl" != "xyes"; then AC_MSG_WARN([You lack the modfl function -- precision will be impaired]) fi AC_MSG_CHECKING([checking for working ynl]) AC_TRY_RUN([ #include #ifdef HAVE_SUNMATH_H #include #endif int main () { long double l = ynl (2, 4.0L); return !(l >= 0.21 && l <= 0.22); }], [AC_DEFINE(HAVE_YNL) AC_MSG_RESULT(yes)], AC_MSG_RESULT(no), [AC_CHECK_FUNCS(ynl)]) AC_MSG_CHECKING([checking for working erf and erfc]) AC_TRY_RUN([ #include #ifdef HAVE_SUNMATH_H #include #endif int main () { long double l1 = erfl (1.2L); long double l2 = erfcl (1.2L); return !(l1 >= 0.91 && l1 <= 0.92 && l2 >= 0.08 && l2 <= 0.09); }], [AC_DEFINE(HAVE_ERF) AC_DEFINE(HAVE_ERFC) AC_MSG_RESULT(yes)], AC_MSG_RESULT(no), [AC_CHECK_FUNCS(erfl erfcl)]) float_msg="long double (EXPERIMENTAL)" AC_MSG_WARN([Long double support is experimental -- expect problems]) AC_DEFINE(WITH_LONG_DOUBLE) fi] ) dnl **************************** dnl MS Excel (tm) Plugin dnl **************************** try_ole=true excel_msg=yes AC_ARG_WITH(excel, [--{with,without}-excel Compile the Excel plugin], if test "x$withval" = xno; then try_ole=false excel_msg="Disabled by request" fi ) if test "$try_ole" = "true"; then PKG_CHECK_MODULES(LIBOLE2, [libole2-2.0 >= 2.2.7], [excel_msg="yes"], [excel_msg="NO. libole2 problem"]) fi AM_CONDITIONAL(WITH_EXCEL, test x"$excel_msg" = "xyes") AC_SUBST(LIBOLE2_CFLAGS) AC_SUBST(LIBOLE2_LIBS) dnl **************************** dnl GDA Plugin dnl **************************** try_gda=true gda_msg=yes AC_ARG_WITH(gda, [--{with,without}-gda Compile the Gnome Database Access plugin], if test "x$withval" = xyes; then try_gda=true gda_msg="Disabled by request" fi ) if test "$try_gda" = "true"; then PKG_CHECK_MODULES(GDA, [libgda >= 0.8.102 ], [gda_msg=yes], [gda_msg="NO. libdga problem"]) fi AM_CONDITIONAL(WITH_GDA, test x"$gda_msg" = "xyes") AC_SUBST(GDA_CFLAGS) AC_SUBST(GDA_LIBS) dnl **************************** dnl GB Plugin dnl **************************** #try_gda=true #gb_msg=yes try_gb=no gb_msg="Temporarily disabled during gnome2 porting" AC_ARG_WITH(gb, [--{with,without}-gb Compile the Gnome Basic plugin], if test "x$withval" = xyes; then #try_gb=true gb_msg="We are not joking, it is temporarily disabled during gnome2 porting" #gb_msg="Disabled by request" fi ) if test "$try_gb" = "true"; then PKG_CHECK_MODULES(GB, [libgb == 1.17 ], [gb_msg=yes], [gb_msg="NO. gb problem"]) fi AM_CONDITIONAL(WITH_GB, test x"$gb_msg" = "xyes") AC_SUBST(GB_CFLAGS) AC_SUBST(GB_LIBS) dnl **************************** dnl src/functions/fn-math.c uses M_PI dnl src/plugin-util.c uses caddr_t AC_MSG_CHECKING([whether -D_BSD_SOURCE is needed for M_PI]) AC_TRY_COMPILE([#include ], [double f = M_PI], need_bsd=no, need_bsd=yes) AC_MSG_RESULT($need_bsd) if test $need_bsd = yes ; then CFLAGS="$CFLAGS -D_BSD_SOURCE" else AC_MSG_CHECKING([whether -D_BSD_SOURCE is needed for caddr_t]) AC_TRY_COMPILE([#include ], [caddr_t ca], need_bsd=no, need_bsd=yes) if test $need_bsd = yes ; then CFLAGS="$CFLAGS -D_BSD_SOURCE" fi AC_MSG_RESULT($need_bsd) fi AC_SUBST(GUILE_LIBS) AC_SUBST(GUILE_INCS) #check for guile 1.5 try_guile=false guile_msg="temporarily disabled in gnome2 branch" enable_guile=false AC_ARG_WITH(guile, [--{with,without}-guile Compile with Guile support or without it], if test "x$withval" = xyes; then try_guile=true fi ) dnl if $try_guile; then dnl AC_MSG_CHECKING(for guile >= 1.5) dnl if test "`guile -c '(display (string>=? (version) "1.4.1"))'`" != "#t"; then dnl AC_MSG_RESULT([Your Guile is too old. You need Guile 1.5 or later.]) dnl else dnl AC_MSG_RESULT(found) dnl guile_msg="yes" dnl enable_guile=true dnl fi dnl dnl fi dnl if $enable_guile; then dnl GNOME_CHECK_GUILE dnl fi AM_CONDITIONAL(WITH_GUILE, $enable_guile) dnl ************************************************** dnl * psiconv support dnl ************************************************** dnl PSICONV_INIT() dnl if test "$want_psiconv" = "yes"; then dnl ac_save_CFLAGS="$CFLAGS" dnl ac_save_LIBS="$LIBS" dnl CFLAGS="$CFLAGS $psiconv_cflags" dnl LIBS="$LIBS $psiconv_libs" dnl AC_CHECK_LIB(psiconv,psiconv_parse_sheet_file,want_psiconv=yes,want_psiconv=no) dnl CFLAGS="$ac_save_CFLAGS" dnl LIBS="$ac_save_LIBS" dnl dnl if test "$want_psiconv" = "no"; then dnl PSICONV_LIBS="" dnl PSICONV_CFLAGS="" dnl enable_psiconv=false dnl fi dnl fi enable_psiconv=false AM_CONDITIONAL(WITH_PSICONV,$enable_psiconv) dnl ************************************************** dnl stolen from gtk+ AC_MSG_CHECKING(whether make is GNU Make) STRIP_BEGIN= STRIP_END= if $ac_make --version 2>/dev/null | grep '^GNU Make ' >/dev/null ; then STRIP_BEGIN='$(strip $(STRIP_DUMMY)' STRIP_END=')' AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fi STRIP_DUMMY= AC_SUBST(STRIP_DUMMY) AC_SUBST(STRIP_BEGIN) AC_SUBST(STRIP_END) dnl ************************************************** dnl * internationalization support dnl ************************************************** dnl dnl Check doc/translating.sgml for a description of how to translate dnl and why we have so many translations. dnl ALL_LINGUAS="ca cs da de en_AU en_CA en_GB el es et fi fr ga gl hr hu it ja ko nl nn no pl pt pt_BR ro ru sk sv tr uk zh_CN zh_TW" GETTEXT_PACKAGE=gnumeric AC_SUBST(GETTEXT_PACKAGE) AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE") AM_GLIB_GNU_GETTEXT # AM_GNOME_GETTEXT above substs $DATADIRNAME # this is the directory where the *.{mo,gmo} files are installed gnomelocaledir='${prefix}/${DATADIRNAME}/locale' AC_SUBST(gnomelocaledir) #AC_PATH_PROG(TPUT_CMD,tput,no) TPUT_CMD=no marker_ok="" marker_fail="" marker_no="" if test "$TPUT_CMD" '!=' no -a -t 1 -a -t 2; then # We have tput and output goes to a terminal. marker_ok="<`$TPUT_CMD bold`yes`$TPUT_CMD sgr0` >" marker_fail="<`$TPUT_CMD bold`fail`$TPUT_CMD sgr0`>" marker_no="<`$TPUT_CMD bold`no`$TPUT_CMD sgr0` >" fi dnl dnl On Solaris finite() needs ieeefp.h dnl Either of these seem to signal IEEE754 math, see mathfunc.c dnl AC_CHECK_HEADERS(ieeefp.h ieee754.h) dnl Check for some functions AC_CHECK_FUNCS(random drand48 finite isfinite) dnl dnl On BSD, we seem to need -lm for finite dnl if test $ac_cv_func_finite = no; then AC_CHECK_LIB(m, finite, [AC_DEFINE(HAVE_FINITE) LIBS="$LIBS -lm"]) fi dnl check for complete locale implementation AC_CHECK_HEADERS(langinfo.h) dnl we need iconv for translating to/from locale's charset when dnl reading/writing Excel files AC_CHECK_HEADERS(iconv.h) dnl ************************************************** dnl * Check for Perl dnl ************************************************** dnl AC_CHECK_PROG(perl_val, perl, true, false) if $perl_val; then AC_MSG_CHECKING(for perl ExtUtils::Embed module ) perl -e 'eval { require ExtUtils::Embed }; if ($@) { exit(1); } else { exit(0); }' if test "x$?" = "x0"; then AC_MSG_RESULT($marker_ok) dnl Use ExtUtils::Embed to figure out the other options. PERL_CCCDLFLAGS=`perl -MConfig -e 'print $Config{cccdlflags},"\n";'` PERL_LDDLFLAGS=`perl -MConfig -e 'print $Config{lddlflags},"\n";'` PERL_CC=`perl -MConfig -e 'print $Config{cc},"\n";'` PERL_LD=`perl -MConfig -e 'print $Config{ld},"\n";'` PERL_CCOPTS=`perl -MExtUtils::Embed -e ccopts` PERL_LDOPTS=`perl -MExtUtils::Embed -e ldopts` AC_SUBST(PERL_CCCDLFLAGS) AC_SUBST(PERL_LDDLFLAGS) AC_SUBST(PERL_CC) AC_SUBST(PERL_LD) AC_SUBST(PERL_CCOPTS) AC_SUBST(PERL_LDOPTS) else AC_MSG_RESULT($marker_no) perl_val=false fi fi dnl Disable perl until we have an active maintainer AM_CONDITIONAL(WITH_PERL, false) dnl ************************************************** dnl * Check for Python dnl ************************************************** try_python=true AC_ARG_WITH(python, [--{with,without}-python Compile the Python plugin loader], if test "x$withval" = xno; then try_python=false else python_prog="$withval" fi ) if $try_python; then if test "x$python_prog" = xyes -o "x$python_prog" = x ; then python_prog=python fi python_val= AC_CHECK_PROG(python_val, "$python_prog", true, false) if $python_val; then PY_PREFIX=`python -c 'import sys ; print sys.prefix'` PY_EXEC_PREFIX=`python -c 'import sys ; print sys.exec_prefix'` changequote(<<, >>)dnl PY_VERSION=`python -c 'import sys ; print sys.version[0:3]'` changequote([, ])dnl if test -f $PY_PREFIX/include/python$PY_VERSION/Python.h; then PY_LIBS="python$PY_VERSION" PY_LIB_LOC="-L$PY_EXEC_PREFIX/lib/python$PY_VERSION/config" PY_CFLAGS="-I$PY_PREFIX/include/python$PY_VERSION" PY_MAKEFILE="$PY_EXEC_PREFIX/lib/python$PY_VERSION/config/Makefile" PY_LOCALMODLIBS=`sed -n -e 's/^LOCALMODLIBS=\(.*\)/\1/p' $PY_MAKEFILE` PY_BASEMODLIBS=`sed -n -e 's/^BASEMODLIBS=\(.*\)/\1/p' $PY_MAKEFILE` PY_OTHER_LIBS=`sed -n -e 's/^LIBS=\(.*\)/\1/p' $PY_MAKEFILE` PY_EXTRA_LIBS="$PY_LOCALMODLIBS $PY_BASEMODLIBS $PY_OTHER_LIBS" AC_SUBST(PY_LIBS) AC_SUBST(PY_LIB_LOC) AC_SUBST(PY_CFLAGS) AC_SUBST(PY_EXTRA_LIBS) else python_val=false fi fi if $python_val; then AC_MSG_CHECKING(if we can build a shared library depending on libpython) rm -rf testpython mkdir testpython cd testpython cat > testpython.c < int testpython (void) { Py_Exit (0); } EOF if /bin/sh ../libtool --mode=compile ${CC} $PY_CFLAGS -c testpython.c >/dev/null 2>&1 && \ /bin/sh ../libtool --mode=link ${CC} -o testpython.la -rpath `pwd` -module -avoid-version $PY_LIB_LOC testpython.lo -l$PY_LIBS $PY_EXTRA_LIBS >/dev/null 2>&1 && \ grep 'dlname.*testpython' testpython.la >/dev/null 2>&1; then AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) python_val=false fi cd .. rm -rf testpython fi AM_CONDITIONAL(WITH_PYTHON, $python_val) else AM_CONDITIONAL(WITH_PYTHON, false) fi enable_bonobo=false bonobo_msg="temporarily disabled in gnome2 branch" AC_ARG_WITH(bonobo, [--{with,without}-bonobo Use the bonobo UI routines], if test "x$withval" = xyes; then enable_bonobo=true bonobo_msg=yes fi ) dnl gnumeric_bonobo_enabled=$enable_bonobo gnumeric_bonobo_enabled=$enable_bonobo AM_CONDITIONAL(WITH_BONOBO, $enable_bonobo) dnl ************************************************** dnl * Config defaults (Must be after bonobo) dnl ************************************************** gnumeric_prefix="${prefix}" gnumeric_exec_prefix="${exec_prefix}" gnumeric_version="${VERSION}${bonobo_suffix}" gnumeric_datadir="${datadir}/gnumeric/${gnumeric_version}" gnumeric_libdir="${libdir}/gnumeric/${gnumeric_version}" gnumeric_plugindir="${gnumeric_libdir}/plugins" gnumeric_gladedir="${gnumeric_datadir}/glade" gnumeric_icondir="${datadir}/pixmaps/gnumeric" gnumeric_autoformatdir="${gnumeric_datadir}/autoformat-templates" dnl Export to gnumeric-config.h AC_DEFINE_UNQUOTED(GNUMERIC_VERSION, "$gnumeric_version") AC_DEFINE_UNQUOTED(GNUMERIC_PREFIX, "$gnumeric_prefix") AC_SUBST(gnumeric_prefix) AC_SUBST(gnumeric_exec_prefix) AC_SUBST(gnumeric_datadir) AC_SUBST(gnumeric_version) AC_SUBST(gnumeric_libdir) AC_SUBST(gnumeric_plugindir) AC_SUBST(gnumeric_gladedir) AC_SUBST(gnumeric_icondir) AC_SUBST(gnumeric_autoformatdir) AC_SUBST(gnumeric_bonobo_enabled) dnl ****************************** dnl Check for Evolution dnl ****************************** try_evolution=false evolution=no AC_ARG_WITH(evolution, [--{with,without}-evolution Use evolution to send spreadsheets (bonobo needed).], if test "x$withval" = xyes; then try_evolution=true fi ) if test x"$have_bonobo" = "xtrue" -a x"$try_evolution" = "xtrue" ; then path_to_composer_idl=`pkg-config --datadir`/idl/Evolution-Composer.idl AC_CHECK_FILE($path_to_composer_idl, evolution=yes, evolution=no) fi AM_CONDITIONAL(ENABLE_EVOLUTION, test x"$evolution" = "xyes") if test x"$evolution" = "xyes" ; then AC_DEFINE(ENABLE_EVOLUTION) fi dnl ****************************** dnl Check for Applix SHELF dnl ****************************** dnl try_applix_shelf=false dnl applix_shelf= dnl applix_shelf_msg=no dnl have_applix_shelf=false dnl AC_ARG_WITH(applix_shelf, dnl [--{with,without}-shelf Compile with Applix SHELF support or without it], dnl if test "x$withval" = xyes; then dnl try_applix_shelf=true dnl fi dnl) ORBIT="`$PKG_CONFIG --variable=orbit_idl ORBit-2.0`" BONOBO_IDL_DIR="`$PKG_CONFIG --variable=idldir libbonobo-2.0`" BONOBO_ACTIVATION_IDL_DIR="`$PKG_CONFIG --variable=idldir bonobo-activation-2.0`" ORBIT_IDL="${ORBIT} -I${BONOBO_IDL_DIR} -I${BONOBO_ACTIVATION_IDL_DIR}" AC_SUBST(ORBIT_IDL) dnl ==================================== dnl = Plan Perfect Plugin dnl ==================================== AM_CONDITIONAL(WITH_PLAN_PERFECT, false) dnl ==================================== dnl = Test whether jw is installed dnl ==================================== AC_PATH_PROG(JW,jw,no) if test x$JW = xno; then HAVE_JW="no" else HAVE_JW="yes" fi AM_CONDITIONAL(HAVE_JW, test "x$HAVE_JW" = "xyes") AC_SUBST(HAVE_JW) dnl ==================================== dnl = End tests for jw dnl ==================================== AC_OUTPUT([ gnumeric.spec Makefile src/Makefile icons/Makefile idl/Makefile src/Makefile src/dialogs/Makefile src/functions/Makefile src/pixmaps/Makefile src/widgets/Makefile src/tools/Makefile src/tools/solver/Makefile src/tools/solver/lp_solve/Makefile doc/Makefile doc/C/Makefile doc/de/Makefile doc/es/Makefile doc/hu/Makefile doc/ja/Makefile doc/nl/Makefile doc/no/Makefile doc/pl/Makefile doc/pt/Makefile doc/ru/Makefile doc/sk/Makefile doc/sv/Makefile omf-install/Makefile plugins/Makefile plugins/numtheory/Makefile plugins/derivatives/Makefile plugins/sc/Makefile plugins/sylk/Makefile plugins/excel/Makefile plugins/gda/Makefile plugins/gb/Makefile plugins/lotus-123/Makefile plugins/oleo/Makefile plugins/python/Makefile plugins/python-loader/Makefile plugins/gnome-glossary/Makefile plugins/py-func/Makefile plugins/perl/Makefile plugins/perl/ext/Makefile.PL plugins/guile/Makefile plugins/xbase/Makefile plugins/html/Makefile plugins/dif/Makefile plugins/xml_sax/Makefile plugins/applix/Makefile plugins/plan-perfect/Makefile plugins/psiconv/Makefile plugins/mps/Makefile plugins/sample_datasource/Makefile po/Makefile.in templates/Makefile templates/english/Makefile templates/autoformat/Makefile stamp.h ]) echo " WARNING WARNING WARNING This is the _DEVELOPMENT_ branch of gnumeric. It is undergoing rapid change and is _NOT_ suitable for packaging or production work. Please use the stable branch cvs co -r gnome_1_4 gnumeric WARNING WARNING WARNING Configuration: Source code location: ${srcdir} Compiler: ${CC} Compiler flags: ${CFLAGS} Floating point type: ${float_msg} MS Excel Support: ${excel_msg} GDA support: ${gda_msg} GB support: ${gb_msg} Bonobo Support: ${bonobo_msg} Guile Support: ${guile_msg} Evolution Support: ${evolution} "