configure.in 20.5 KB
Newer Older
Jody Goldberg's avatar
Jody Goldberg committed
1 2
-*- mode: m4 -*-
AC_PREREQ(2.52)
3
AC_INIT(gnumeric, 1.1.8,
Jody Goldberg's avatar
Jody Goldberg committed
4
	http://bugzilla.gnome.org/enter_bug.cgi?product=gnumeric)
Arturo Espinosa's avatar
Arturo Espinosa committed
5

Jody Goldberg's avatar
Jody Goldberg committed
6
AC_CONFIG_SRCDIR(src/sheet.h)
Jody Goldberg's avatar
Jody Goldberg committed
7
AM_CONFIG_HEADER(gnumeric-config.h)
Jody Goldberg's avatar
Jody Goldberg committed
8

Jody Goldberg's avatar
Jody Goldberg committed
9 10
AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)

Arturo Espinosa's avatar
Arturo Espinosa committed
11 12
AM_MAINTAINER_MODE

Jody Goldberg's avatar
Jody Goldberg committed
13 14
GNOME_PLATFORM_GNOME_2(yes, force)

15 16 17
# Make --disable-static the default
AC_DISABLE_STATIC

Arturo Espinosa's avatar
Arturo Espinosa committed
18 19
AC_ISC_POSIX
AC_PROG_CC
Arturo Espinosa's avatar
Arturo Espinosa committed
20
AC_PROG_YACC
Jody Goldberg's avatar
Jody Goldberg committed
21 22 23
AM_PROG_LIBTOOL
AC_PROG_INTLTOOL
AM_PROG_LIBTOOL
Arturo Tena's avatar
Arturo Tena committed
24
AC_STDC_HEADERS
Arturo Espinosa's avatar
Arturo Espinosa committed
25 26
AC_ARG_PROGRAM

27
if test "$GCC" = "yes"; then
Morten Welinder's avatar
Morten Welinder committed
28
  gcc_check=`$CC -v 2>&1 | grep '^gcc version 2\.96'`
29 30 31 32 33 34 35
  if test "$gcc_check" != ""; then
    # I know a dead parrot when I see one, and I am looking at
    # one now.
    AC_MSG_ERROR([You cannot compile Gnumeric with RedHat gcc 2.96.
We have seen too many subtle compiler errors.
Please use another compiler, for example a gcc 2.95 series compiler.])
    # Mate, this parrot wouldn't "vooom!" if you put four million
Morten Welinder's avatar
Morten Welinder committed
36
    # Volts through it!
37 38 39
  fi
fi

Jody Goldberg's avatar
Jody Goldberg committed
40
PKG_CHECK_MODULES(GNUMERIC,[
Jody Goldberg's avatar
Jody Goldberg committed
41 42 43
glib-2.0	>= 2.0.0
gobject-2.0	>= 2.0.0
gmodule-2.0	>= 2.0.0
Jon K Hellan's avatar
Jon K Hellan committed
44
libgsf-1	>= 1.3.0
Jody Goldberg's avatar
Jody Goldberg committed
45 46 47
gtk+-2.0	>= 2.0.0
libxml-2.0	>= 2.4.12
libglade-2.0	>= 1.99.7
48
libgnomecanvas-2.0 >= 1.113.0
Jon K Hellan's avatar
Jon K Hellan committed
49
gal-2.0		>= 0.0.2
Jody Goldberg's avatar
Jody Goldberg committed
50 51
libgnome-2.0	>= 1.105.0
libgnomeui-2.0	>= 1.106.0
Jody Goldberg's avatar
Jody Goldberg committed
52
libgnomeprint-2.0 >= 1.114.0
53
libgnomeprintui-2.0 >= 1.114.0
Jody Goldberg's avatar
Jody Goldberg committed
54 55 56 57 58 59
])
AC_SUBST(GNUMERIC_LIBS)
AC_SUBST(GNUMERIC_CFLAGS)

AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
AC_PATH_PROG(GDK_PIXBUF_CSOURCE, gdk-pixbuf-csource)
60

Arturo Espinosa's avatar
Arturo Espinosa committed
61
## this should come after `AC_PROG_CC'
62
ifdef([GNOME_COMPILE_WARNINGS],[GNOME_COMPILE_WARNINGS],)
63
set_more_warnings=yes
64
if test "$GCC" = "yes" -a "x$set_more_warnings" != "xno"; then
Morten Welinder's avatar
Morten Welinder committed
65
	for option in -Wsign-promo -Wsign-compare -Wpointer-arith -Wnested-externs -Wchar-subscripts -Wwrite-strings; do
Morten Welinder's avatar
Morten Welinder committed
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
		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

82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107
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
Jody Goldberg's avatar
typos  
Jody Goldberg committed
108
try_gb=no
109 110
gb_msg="Temporarily disabled during gnome2 porting"
AC_ARG_WITH(gb,
Jody Goldberg's avatar
typos  
Jody Goldberg committed
111
	[--{with,without}-gb      Compile the Gnome Basic plugin],
112
	if test "x$withval" = xyes; then
Jody Goldberg's avatar
typos  
Jody Goldberg committed
113
		#try_gb=true
114 115 116 117 118 119 120 121 122 123 124 125 126 127
		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 ****************************
Morten Welinder's avatar
Morten Welinder committed
128

129 130 131 132 133 134 135 136 137 138 139 140 141 142 143
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 <math.h>], [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 <sys/types.h>], [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
Morten Welinder's avatar
Morten Welinder committed
144

Arturo Espinosa's avatar
Arturo Espinosa committed
145 146
AC_SUBST(GUILE_LIBS)
AC_SUBST(GUILE_INCS)
147 148

#check for guile 1.5
149 150 151
try_guile=false
guile_msg="temporarily disabled in gnome2 branch"
enable_guile=false
152 153
AC_ARG_WITH(guile,
	[--{with,without}-guile   Compile with Guile support or without it],
154
	if test "x$withval" = xyes; then
155
		try_guile=true
156 157 158
	fi
)

159 160 161 162 163 164 165 166 167 168 169 170 171 172 173
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)
Arturo Espinosa's avatar
Arturo Espinosa committed
174

Jody Goldberg's avatar
Jody Goldberg committed
175 176 177
dnl **************************************************
dnl * psiconv support
dnl **************************************************
178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195
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)
Jody Goldberg's avatar
Jody Goldberg committed
196

Jody Goldberg's avatar
Jody Goldberg committed
197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212
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)
Jody Goldberg's avatar
Jody Goldberg committed
213

214 215 216 217 218 219 220
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
221
ALL_LINGUAS="bg ca cs da de en_AU en_CA en_GB el es et fi fr ga gl hr hu it ja ko lv ms nl nn no pl pt pt_BR ro ru sk sv tr uk vi zh_CN zh_TW"
Jody Goldberg's avatar
Jody Goldberg committed
222 223 224 225 226
GETTEXT_PACKAGE=gnumeric
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE")
AM_GLIB_GNU_GETTEXT

227 228
# AM_GNOME_GETTEXT above substs $DATADIRNAME
# this is the directory where the *.{mo,gmo} files are installed
229 230 231 232
AC_MSG_CHECKING(locale directory)
GNUMERIC_LOCALE_DIR="${prefix}/${DATADIRNAME}/locale"
AC_DEFINE_UNQUOTED(GNUMERIC_LOCALE_DIR,"$GNUMERIC_LOCALE_DIR")
AC_MSG_RESULT("$GNUMERIC_LOCALE_DIR")
233

234 235 236 237 238 239 240
#AC_PATH_PROG(TPUT_CMD,tput,no)
TPUT_CMD=no
marker_ok="<yes >"
marker_fail="<FAIL>"
marker_no="<NO  >"
if test "$TPUT_CMD" '!=' no  -a  -t 1  -a  -t 2; then
  # We have tput and output goes to a terminal.
241 242 243 244
  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
245

246 247
dnl
dnl On Solaris finite() needs ieeefp.h
248
dnl Either of these seem to signal IEEE754 math, see mathfunc.c
249
dnl
250
AC_CHECK_HEADERS(ieeefp.h ieee754.h)
251

Morten Welinder's avatar
Morten Welinder committed
252
dnl Check for some functions
253 254
AC_CHECK_FUNCS(random drand48 finite)

Morten Welinder's avatar
Morten Welinder committed
255 256 257
dnl FIXME: Does this really belong here?
AC_CHECK_FUNC(bind_textdomain_codeset,,[AC_CHECK_LIB(intl,bind_textdomain_codeset)])

258 259
dnl isfinite is a macro on HPUX
AC_TRY_COMPILE([#include <math.h>], [int a = isfinite(0.0)], [AC_DEFINE(HAVE_ISFINITE)], [])
Morten Welinder's avatar
Morten Welinder committed
260

Morten Welinder's avatar
56857.  
Morten Welinder committed
261 262 263 264 265 266 267 268 269
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

270 271
dnl check for complete locale implementation
AC_CHECK_HEADERS(langinfo.h)
Jon Kåre Hellan's avatar
Jon Kåre Hellan committed
272 273 274
dnl iswprint/iswspace are sometimes in wctype.h
AC_CHECK_HEADERS(wctype.h)

275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383
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 <stdlib.h>
				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 <math.h>
			#ifdef HAVE_SUNMATH_H
			#include <sunmath.h>
			#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 erfl and erfcl])
		AC_TRY_RUN([
			#include <math.h>
			#ifdef HAVE_SUNMATH_H
			#include <sunmath.h>
			#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_ERFL)
			 AC_DEFINE(HAVE_ERFCL)
			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]
)

384 385 386
dnl **************************************************
dnl * Check for Perl
dnl **************************************************
387 388 389
dnl
AC_CHECK_PROG(perl_val, perl, true, false)
if $perl_val; then
390
  AC_MSG_CHECKING(for perl ExtUtils::Embed module				)
391 392
  perl -e 'eval { require ExtUtils::Embed }; if ($@) { exit(1); } else { exit(0); }'
  if test "x$?" = "x0"; then
393
    AC_MSG_RESULT($marker_ok)
394 395

    dnl Use ExtUtils::Embed to figure out the other options.
396 397
    PERL_CCCDLFLAGS=`perl -MConfig -e 'print $Config{cccdlflags},"\n";'`
    PERL_LDDLFLAGS=`perl -MConfig -e 'print $Config{lddlflags},"\n";'`
Raja R Harinath's avatar
Raja R Harinath committed
398
    PERL_CC=`perl -MConfig -e 'print $Config{cc},"\n";'`
399
    PERL_LD=`perl -MConfig -e 'print $Config{ld},"\n";'`
400 401
    PERL_CCOPTS=`perl -MExtUtils::Embed -e ccopts`
    PERL_LDOPTS=`perl -MExtUtils::Embed -e ldopts`
402 403
    AC_SUBST(PERL_CCCDLFLAGS)
    AC_SUBST(PERL_LDDLFLAGS)
Raja R Harinath's avatar
Raja R Harinath committed
404
    AC_SUBST(PERL_CC)
405
    AC_SUBST(PERL_LD)
406 407 408
    AC_SUBST(PERL_CCOPTS)
    AC_SUBST(PERL_LDOPTS)
  else
409
    AC_MSG_RESULT($marker_no)
410 411 412
    perl_val=false
  fi
fi
Jody Goldberg's avatar
update  
Jody Goldberg committed
413 414

dnl Disable perl until we have an active maintainer
Morten Welinder's avatar
Morten Welinder committed
415
AM_CONDITIONAL(WITH_PERL, false)
416

417 418 419
dnl **************************************************
dnl * Check for Python
dnl **************************************************
420
try_python=true
Jon Kåre Hellan's avatar
Jon Kåre Hellan committed
421
try_pygtk=false
422
AC_ARG_WITH(python,
423
	[--{with,without}-python   Compile the Python plugin loader],
Jody Goldberg's avatar
Jody Goldberg committed
424
	if test "x$withval" = xno; then
425
		try_python=false
Jody Goldberg's avatar
Jody Goldberg committed
426
	else
Jody Goldberg's avatar
Jody Goldberg committed
427
		python_prog="$withval"
428 429 430 431
	fi
)

if $try_python; then
Jody Goldberg's avatar
Jody Goldberg committed
432 433 434 435
	if test "x$python_prog" = xyes -o "x$python_prog" = x ; then
	    python_prog=python
	fi

436
	python_val=
Jody Goldberg's avatar
Jody Goldberg committed
437
	AC_CHECK_PROG(python_val, "$python_prog", true, false)
438
	if $python_val; then
439
		  PY_PREFIX=`$python_prog -c 'import sys ; print sys.prefix'`
Jon Kåre Hellan's avatar
Jon Kåre Hellan committed
440
		  PY_EXEC_PREFIX=`$python_prog -c 'import sys ; print sys.exec_prefix'`
441
		  changequote(<<, >>)dnl
442
		  PY_VERSION=`$python_prog -c 'import sys ; print sys.version[0:3]'`
443 444 445 446 447 448
		  broken_py_initialize=`$python_prog -c \
'import sys
if int(sys.version[0]) < 2:
    print "yes"
else:
    print "no"'`
449 450 451 452 453 454 455 456 457 458 459 460 461 462
		  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)
463 464 465
			  if test "x$broken_py_initialize" = "xyes"; then
			  	AC_DEFINE(BROKEN_PY_INITIALIZE)
			  fi
466 467 468 469
		  else
			  python_val=false
		  fi
	fi
470 471 472 473 474 475 476 477 478 479 480 481
	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 <<EOF
#include <Python.h>
int testpython (void)
{
Py_Exit (0);
}
EOF
482 483 484
		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
485 486 487 488 489 490 491 492
			AC_MSG_RESULT(yes)
		else
			AC_MSG_RESULT(no)
			python_val=false
		fi
		cd ..
		rm -rf testpython
	fi
493
	AM_CONDITIONAL(WITH_PYTHON, $python_val)
Jon Kåre Hellan's avatar
Jon Kåre Hellan committed
494
	try_pygtk=$python_val
495 496
else
	AM_CONDITIONAL(WITH_PYTHON, false)
497
fi
Jon Kåre Hellan's avatar
Jon Kåre Hellan committed
498 499 500 501 502 503 504 505 506 507
pygtk_msg="no"
if test "x$try_pygtk" = "xtrue"; then
	PKG_CHECK_MODULES(PYGTK, pygtk-2.0 >= 1.99.10,
			  [pygtk_msg="yes"],
		          [pygtk_msg="NO.  pygtk problem"])
	AC_SUBST(PYGTK_CFLAGS)
fi
if test "x$pygtk_msg" = "xyes"; then
	AC_DEFINE(WITH_PYGTK)
fi
508

509
try_bonobo=false
510
bonobo_msg="disabled"
511
AC_ARG_WITH(bonobo,
Jody Goldberg's avatar
Jody Goldberg committed
512
	[--{with,without}-bonobo   Use the bonobo UI routines],
Jody Goldberg's avatar
Jody Goldberg committed
513
	if test "x$withval" = xyes; then
514
		try_bonobo=true
515 516
	fi
)
517 518 519 520 521
if test "x$try_bonobo" = "xtrue"; then
	PKG_CHECK_MODULES(LIBBONOBO, [
		libbonobo-2.0 >= 1.115.0
		libbonoboui-2.0
		bonobo-activation-2.0
522
		libgsf-gnome-1 >= 1.3.0
523 524 525 526
		],	
		[bonobo_msg="yes"],
		[bonobo_msg="NO. xxx problem"])
fi
527 528
AC_SUBST(LIBBONOBO_LIBS)
AC_SUBST(LIBBONOBO_CFLAGS)
529 530 531 532 533 534

if test "x$bonobo_msg" = "xyes"; then
	bonobo_suffix=-bonobo
	AC_DEFINE(WITH_BONOBO)
        gnumeric_bonobo_enabled=true
else
Jody Goldberg's avatar
typo  
Jody Goldberg committed
535
        gnumeric_bonobo_enabled=false
536 537
fi
AM_CONDITIONAL(WITH_BONOBO, $gnumeric_bonobo_enabled)
538

539 540 541
dnl **************************************************
dnl * Config defaults (Must be after bonobo)
dnl **************************************************
542 543
gnumeric_prefix="${prefix}"
gnumeric_exec_prefix="${exec_prefix}"
544
gnumeric_version="${VERSION}${bonobo_suffix}"
545 546 547 548
gnumeric_datadir="${datadir}/gnumeric/${gnumeric_version}"
gnumeric_libdir="${libdir}/gnumeric/${gnumeric_version}"
gnumeric_plugindir="${gnumeric_libdir}/plugins"
gnumeric_gladedir="${gnumeric_datadir}/glade"
Jody Goldberg's avatar
Jody Goldberg committed
549 550
gnumeric_icondir="${datadir}/pixmaps/gnumeric"

551
gnumeric_autoformatdir="${gnumeric_datadir}/autoformat-templates"
552

Jody Goldberg's avatar
Jody Goldberg committed
553
dnl Export to gnumeric-config.h
Almer. S. Tigelaar's avatar
Almer. S. Tigelaar committed
554
AC_DEFINE_UNQUOTED(GNUMERIC_VERSION, "$gnumeric_version")
Jody Goldberg's avatar
Jody Goldberg committed
555
AC_DEFINE_UNQUOTED(GNUMERIC_PREFIX,  "$gnumeric_prefix")
Almer. S. Tigelaar's avatar
Almer. S. Tigelaar committed
556

557 558 559 560 561 562 563
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)
Jody Goldberg's avatar
Jody Goldberg committed
564
AC_SUBST(gnumeric_icondir)
565
AC_SUBST(gnumeric_autoformatdir)
566
AC_SUBST(gnumeric_bonobo_enabled)
567

568 569 570 571 572 573 574 575 576 577 578 579
dnl ==============================================
dnl Special GConf section  (stolen from libgnome)
dnl ==============================================

AC_PATH_PROG(GCONFTOOL, gconftool-2, no)

if test x"$GCONFTOOL" = xno; then
  AC_MSG_ERROR([gconftool-2 executable not found in your path - should be installed with GConf])
fi

AM_GCONF_SOURCE_2

580 581 582
dnl ******************************
dnl Check for Evolution
dnl ******************************
Jody Goldberg's avatar
Jody Goldberg committed
583
try_evolution=false
584 585
evolution=no
AC_ARG_WITH(evolution,
Jody Goldberg's avatar
Jody Goldberg committed
586
	[--{with,without}-evolution Use evolution to send spreadsheets (bonobo needed).],
587
	if test "x$withval" = xyes; then
Jody Goldberg's avatar
Jody Goldberg committed
588
		try_evolution=true
589 590
	fi
)
591
if test x"$have_bonobo" = "xtrue" -a x"$try_evolution" = "xtrue" ; then
Jody Goldberg's avatar
Jody Goldberg committed
592
	path_to_composer_idl=`pkg-config --datadir`/idl/Evolution-Composer.idl
593
	AC_CHECK_FILE($path_to_composer_idl, evolution=yes, evolution=no)
594 595 596 597 598
 	if test x"$evolution" = "xno" ; then
 		echo "Debian build hack: enabling Evolution support anyway;"
 		echo "be sure to set EVOLUTION_IDL_DIR to a dir containing Evolution-Composer.idl"
 		evolution=yes
 	fi
599
fi
Jody Goldberg's avatar
Jody Goldberg committed
600
AM_CONDITIONAL(ENABLE_EVOLUTION, test x"$evolution" = "xyes")
601 602 603
if test x"$evolution" = "xyes" ; then
    AC_DEFINE(ENABLE_EVOLUTION)
fi
604

605 606 607 608 609 610 611 612 613
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],
614
dnl	if test "x$withval" = xyes; then
615 616 617
dnl		try_applix_shelf=true
dnl	fi
dnl)
618

Jody Goldberg's avatar
Jody Goldberg committed
619 620 621 622 623
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)
624

Jon K Hellan's avatar
Jon K Hellan committed
625 626 627 628 629
dnl ====================================
dnl = Plan Perfect Plugin
dnl ====================================
AM_CONDITIONAL(WITH_PLAN_PERFECT, false)

630 631 632 633 634 635 636 637 638 639 640 641 642 643 644
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 ====================================

Arturo Espinosa's avatar
Arturo Espinosa committed
645
AC_OUTPUT([
646
gnumeric.spec
647
GNOME_Gnumeric.server.in
Arturo Espinosa's avatar
Arturo Espinosa committed
648
Makefile
Jody Goldberg's avatar
Jody Goldberg committed
649
src/Makefile
650
icons/Makefile
Miguel de Icaza's avatar
Miguel de Icaza committed
651
idl/Makefile
Arturo Espinosa's avatar
Arturo Espinosa committed
652
src/Makefile
653
src/dialogs/Makefile
Jody Goldberg's avatar
Jody Goldberg committed
654 655
src/pixmaps/Makefile
src/widgets/Makefile
656 657
src/tools/Makefile
src/tools/solver/Makefile
658 659
src/tools/solver/glpk/Makefile
src/tools/solver/glpk/source/Makefile
660
src/tools/solver/lp_solve/Makefile
661
doc/Makefile
662
doc/C/Makefile
Jody Goldberg's avatar
Jody Goldberg committed
663 664 665 666 667 668 669 670 671 672 673
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
Jody Goldberg's avatar
Jody Goldberg committed
674
omf-install/Makefile
Arturo Espinosa's avatar
Arturo Espinosa committed
675
plugins/Makefile
Morten Welinder's avatar
Morten Welinder committed
676
plugins/numtheory/Makefile
jpekka's avatar
jpekka committed
677
plugins/fn-complex/Makefile
678
plugins/fn-database/Makefile
Morten Welinder's avatar
Morten Welinder committed
679
plugins/fn-date/Makefile
680
plugins/fn-eng/Makefile
Morten Welinder's avatar
Morten Welinder committed
681
plugins/fn-financial/Makefile
Morten Welinder's avatar
Morten Welinder committed
682
plugins/fn-info/Makefile
Morten Welinder's avatar
Morten Welinder committed
683
plugins/fn-logical/Makefile
684
plugins/fn-lookup/Makefile
Morten Welinder's avatar
Morten Welinder committed
685
plugins/fn-math/Makefile
686
plugins/fn-stat/Makefile
Morten Welinder's avatar
Morten Welinder committed
687
plugins/fn-string/Makefile
jpekka's avatar
jpekka committed
688
plugins/fn-random/Makefile
Morten Welinder's avatar
Morten Welinder committed
689
plugins/derivatives/Makefile
690
plugins/sc/Makefile
691
plugins/sylk/Makefile
692
plugins/excel/Makefile
Jody Goldberg's avatar
typos  
Jody Goldberg committed
693
plugins/gda/Makefile
694
plugins/gb/Makefile
Michael Meeks's avatar
Michael Meeks committed
695
plugins/lotus-123/Makefile
696
plugins/oleo/Makefile
697
plugins/python/Makefile
698 699 700
plugins/python-loader/Makefile
plugins/gnome-glossary/Makefile
plugins/py-func/Makefile
701
plugins/perl/Makefile
702
plugins/perl/ext/Makefile.PL
Mark Probst's avatar
Mark Probst committed
703
plugins/guile/Makefile
Michael Meeks's avatar
Michael Meeks committed
704
plugins/xbase/Makefile
705
plugins/html/Makefile
706
plugins/dif/Makefile
707
plugins/qpro/Makefile
708
plugins/plan-perfect/Makefile
Jody Goldberg's avatar
Jody Goldberg committed
709
plugins/xml_sax/Makefile
Jody Goldberg's avatar
Jody Goldberg committed
710
plugins/applix/Makefile
Jody Goldberg's avatar
Jody Goldberg committed
711
plugins/psiconv/Makefile
Jukka-Pekka Iivonen's avatar
Jukka-Pekka Iivonen committed
712
plugins/mps/Makefile
Jody Goldberg's avatar
Jody Goldberg committed
713
plugins/sample_datasource/Makefile
714
plugins/uihello/Makefile
Arturo Espinosa's avatar
Arturo Espinosa committed
715
po/Makefile.in
Jody Goldberg's avatar
Jody Goldberg committed
716
schemas/Makefile
Jody Goldberg's avatar
Jody Goldberg committed
717 718
templates/Makefile
templates/english/Makefile
719
templates/autoformat/Makefile
720
stamp.h
Fatih Demir's avatar
Fatih Demir committed
721
])
722

723

724 725
echo "

726 727 728 729 730 731 732 733 734 735
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

736 737 738
Configuration:

	Source code location:	${srcdir}
Morten Welinder's avatar
Morten Welinder committed
739
	Compiler:		${CC}
Morten Welinder's avatar
Morten Welinder committed
740
	Compiler flags:		${CFLAGS}
Morten Welinder's avatar
Morten Welinder committed
741
	Floating point type:	${float_msg}
742

743
	GDA support:		${gda_msg}
744
	Bonobo Support:		${bonobo_msg}
745
	Guile Support:		${guile_msg}
Jody Goldberg's avatar
Jody Goldberg committed
746
	Evolution Support:      ${evolution}
747
"