configure.in 12.2 KB
Newer Older
Arturo Espinosa's avatar
Arturo Espinosa committed
1 2 3
AC_INIT(src/gnumeric.h)

AM_CONFIG_HEADER(config.h)
Jody Goldberg's avatar
Jody Goldberg committed
4
AM_INIT_AUTOMAKE(gnumeric,0.56)
Arturo Espinosa's avatar
Arturo Espinosa committed
5 6 7
AM_MAINTAINER_MODE
AM_ACLOCAL_INCLUDE(macros)

8 9 10
# Make --disable-static the default
AC_DISABLE_STATIC

Arturo Espinosa's avatar
Arturo Espinosa committed
11 12 13
AC_ISC_POSIX
AC_PROG_CC
AC_STDC_HEADERS
Arturo Espinosa's avatar
Arturo Espinosa committed
14
AC_PROG_YACC
Arturo Espinosa's avatar
Arturo Espinosa committed
15 16 17
AC_ARG_PROGRAM
AM_PROG_LIBTOOL

18 19
GNOME_INIT

Arturo Espinosa's avatar
Arturo Espinosa committed
20
## this should come after `AC_PROG_CC'
21
GNOME_COMPILE_WARNINGS
Arturo Espinosa's avatar
Arturo Espinosa committed
22
GNOME_X_CHECKS
23
GNOME_XML_CHECK
24

25 26 27 28 29 30 31 32 33 34 35
dnl
dnl alloca tests
dnl;
AC_FUNC_ALLOCA
if test $ac_cv_header_alloca_h = yes; then
        GNUMERIC_HAVE_ALLOCA_H=1
else
        GNUMERIC_HAVE_ALLOCA_H=0
fi
AC_SUBST(GNUMERIC_HAVE_ALLOCA_H)

Arturo Espinosa's avatar
Arturo Espinosa committed
36 37 38 39 40
AC_SUBST(QTTHREADS_LIB)
AC_SUBST(TERMCAP_LIB)
AC_SUBST(READLINE_LIB)
AC_SUBST(GUILE_LIBS)
AC_SUBST(GUILE_INCS)
41
AC_ARG_WITH(guile,[--with-guile   Include Guile support],[GNOME_CHECK_GUILE])
Arturo Espinosa's avatar
Arturo Espinosa committed
42 43 44 45 46

AC_SUBST(CFLAGS)
AC_SUBST(CPPFLAGS)
AC_SUBST(LDFLAGS)

47 48 49 50 51 52 53 54
dnl **************************************************
dnl * internationalization support
dnl **************************************************
dnl 
dnl
dnl Check doc/translating.sgml for a description of how to translate
dnl and why we have so many translations.
dnl
55
ALL_LINGUAS="cs da de en_GB el es es_DO es_GT es_HN es_MX es_PA es_PE es_SV et fi fr ga gl hr hu it ja ko nl no pl pt pt_BR ru sk sv uk zh_CN.GB2312 zh_TW.Big5"
56
AM_GNU_GETTEXT
57 58 59 60 61
# AM_GNOME_GETTEXT above substs $DATADIRNAME
# this is the directory where the *.{mo,gmo} files are installed
gnomelocaledir='${prefix}/${DATADIRNAME}/locale'
AC_SUBST(gnomelocaledir)

62 63
AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl)

64

65 66 67
dnl
dnl On Solaris finite() needs ieeefp.h
dnl
Morten Welinder's avatar
Morten Welinder committed
68
AC_CHECK_HEADERS(ieeefp.h)
69

Morten Welinder's avatar
Morten Welinder committed
70 71 72
dnl Check for some functions
AC_CHECK_FUNCS(random drand48)

73 74 75 76 77 78
dnl **************************************************
dnl * ORBit support
dnl **************************************************
GNOMEGNORBA_LIBS="$GNOMEGNORBA_LIBS"
AC_SUBST(GNOMEGNORBA_LIBS)

79 80 81
dnl ******************************
dnl gnome-xml checking
dnl ******************************
82
AC_MSG_CHECKING(for libxml (aka gnome-xml) libraries 1.8.5 <= version < 2.0.0)
83
if xml-config --libs print > /dev/null 2>&1; then 
84
    vers=`xml-config --version | sed -e "s/libxml //" | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
85
    if test "$vers" -ge 1008005; then
86 87 88
	if test "$vers" -lt 2000000; then
	    AC_MSG_RESULT(found)
	else
89
	    AC_MSG_ERROR(This version of Gnumeric does not support libxml (aka gnome-xml) 2.x.x yet.)
90
	fi
91
    else
92
        AC_MSG_ERROR(You need at least libxml (aka gnome-xml) 1.8.5 for this version of Gnumeric.)
93 94
    fi
else
95
    AC_MSG_ERROR(Did not find libxml (aka gnome-xml) installed)
96 97
fi

98 99 100 101

dnl **************************************************
dnl * Check for Perl
dnl **************************************************
102 103 104 105 106 107 108 109 110
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(yes)

    dnl Use ExtUtils::Embed to figure out the other options.
111 112
    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
113
    PERL_CC=`perl -MConfig -e 'print $Config{cc},"\n";'`
114
    PERL_LD=`perl -MConfig -e 'print $Config{ld},"\n";'`
115 116
    PERL_CCOPTS=`perl -MExtUtils::Embed -e ccopts`
    PERL_LDOPTS=`perl -MExtUtils::Embed -e ldopts`
117 118
    AC_SUBST(PERL_CCCDLFLAGS)
    AC_SUBST(PERL_LDDLFLAGS)
Raja R Harinath's avatar
Raja R Harinath committed
119
    AC_SUBST(PERL_CC)
120
    AC_SUBST(PERL_LD)
121 122 123 124 125 126 127
    AC_SUBST(PERL_CCOPTS)
    AC_SUBST(PERL_LDOPTS)
  else
    AC_MSG_RESULT(no)
    perl_val=false
  fi
fi
Jody Goldberg's avatar
Jody Goldberg committed
128 129
#
# Disable perl for now
Morten Welinder's avatar
Morten Welinder committed
130
AM_CONDITIONAL(WITH_PERL, false)
131

132 133 134
dnl **************************************************
dnl * Check for Python
dnl **************************************************
135
AC_CHECK_PROG(python_val, python, true, false)
136
if $python_val; then
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157
	  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
158
fi
159
AM_CONDITIONAL(WITH_PYTHON, $python_val)
160

Michael Meeks's avatar
Michael Meeks committed
161 162 163

dnl Check for libole2
AC_MSG_CHECKING(for libole2 >= 0.1.4)
Arturo Tena's avatar
Arturo Tena committed
164 165
vers_ok="";
vers=`gnome-config --modversion libole2 | grep "libole2-" | sed -e "s/libole2-//" | \
Michael Meeks's avatar
Michael Meeks committed
166
	awk 'BEGIN { FS = "."; } { printf "%d", $1 * 10000 + $2 * 100 + $3 ;}'`
Arturo Tena's avatar
Arturo Tena committed
167 168 169 170 171 172 173
if test "$vers"; then
       if test "$vers" -ge 104; then
               vers_ok="yes";
       fi
fi

if test "$vers_ok"; then
Michael Meeks's avatar
Michael Meeks committed
174 175 176 177 178 179 180 181 182 183 184 185
	AC_MSG_RESULT(found)
else
	AC_MSG_ERROR(not found


this version of gnumeric requires an external
libole2 library the latest version can be obtained from
ftp://ftp.gnome.org/pub/GNOME/unstable/sources/libole2/

)
fi

186 187 188
dnl ******************************
dnl Check for Bonobo
dnl ******************************
189 190 191
try_bonobo=true
bonobo=
bonobo_msg=no
192
using_oaf=no
193
bonobo_suffix=
194 195
have_bonobo=false
AC_ARG_WITH(bonobo,
Michael Meeks's avatar
Michael Meeks committed
196
	[--{with,without}-bonobo   Compile with Bonobo support or without it],
197 198 199 200 201
	if test x$withval = xno; then
		try_bonobo=false
	fi
)

Miguel de Icaza's avatar
Miguel de Icaza committed
202 203
gnumeric_executable=gnumeric
AC_SUBST(gnumeric_executable)
204
if $try_bonobo; then
205
	AC_MSG_CHECKING(for Bonobo >= 0.14)
Morten Welinder's avatar
Morten Welinder committed
206 207
	vers=`gnome-config --modversion bonobo | sed -e "s/bonobo-//" | \
		awk 'BEGIN { FS = "."; } { printf "%d", $1 * 1000 + $2;}'`
208
	if test "$vers" -ge 14; then
209 210 211 212 213
		AC_MSG_RESULT(found)
		AC_DEFINE(ENABLE_BONOBO)
		have_bonobo=true
		bonobo=bonobo
		bonobo_msg=yes
214
		bonobo_suffix=-bonobo
Miguel de Icaza's avatar
Miguel de Icaza committed
215
	        gnumeric_executable=gnumeric-bonobo
Michael Meeks's avatar
Michael Meeks committed
216 217 218 219 220 221 222 223 224 225 226 227

		dnl Check if Bonobo is OAFized

		AC_MSG_CHECKING(if Bonobo uses OAF)
		if ( gnome-config --libs bonobo | grep oaf ) > /dev/null 2>&1 ; then
			using_oaf="yes"
			AC_DEFINE(USING_OAF)
		fi

		AC_MSG_RESULT("$using_oaf")

		AM_CONDITIONAL(USING_OAF, test x"using_oaf" = "xyes")
228 229 230
	else
		AC_MSG_RESULT(not found)
	fi
231
fi
232
gnumeric_bonobo_enabled=$bonobo_msg
233
AM_CONDITIONAL(BONOBO, $have_bonobo)
Michael Meeks's avatar
Michael Meeks committed
234

235

236 237 238
dnl **************************************************
dnl * Config defaults (Must be after bonobo)
dnl **************************************************
239 240
gnumeric_prefix="${prefix}"
gnumeric_exec_prefix="${exec_prefix}"
241
gnumeric_version="${VERSION}${bonobo_suffix}"
242 243
gnumeric_datadir="${datadir}/gnumeric/${gnumeric_version}/"
gnumeric_libdir="${libdir}/gnumeric/${gnumeric_version}/"
244 245 246
gnumeric_plugindir="${gnumeric_libdir}plugins/"
gnumeric_gladedir="${gnumeric_datadir}glade/"

Almer. S. Tigelaar's avatar
Almer. S. Tigelaar committed
247 248 249
dnl Export to config.h
AC_DEFINE_UNQUOTED(GNUMERIC_VERSION, "$gnumeric_version")

250 251 252 253 254 255 256
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)
257
AC_SUBST(gnumeric_bonobo_enabled)
258

Michael Meeks's avatar
Michael Meeks committed
259 260 261 262 263 264 265
dnl ******************************
dnl Check for GB
dnl ******************************
try_gb=true
gb=
gb_msg=no
have_gb=false
266 267
GB_CFLAGS=
GB_LIBS=
Michael Meeks's avatar
Michael Meeks committed
268
AC_ARG_WITH(gb,
Michael Meeks's avatar
Michael Meeks committed
269
	[--{with,without}-gb       Compile with Gb support or without it],
Michael Meeks's avatar
Michael Meeks committed
270 271 272 273 274 275
	if test x$withval = xno; then
		try_gb=false
	fi
)

if $try_gb; then
Michael Meeks's avatar
Michael Meeks committed
276
	AC_MSG_CHECKING(for Gb >= 0.0.10)
Michael Meeks's avatar
Michael Meeks committed
277
	if gnome-config --libs gb > /dev/null 2>&1; then
278
		vers=`gnome-config --modversion gb | awk 'BEGIN { FS = "."; } { print $1 * 10000 + $2 * 100 + $3; }'`
Michael Meeks's avatar
Michael Meeks committed
279
		if test "$vers" -ge 000010; then
280 281 282 283
			gb_ok=true
		else
		    	gb_ok=false
		fi
Michael Meeks's avatar
Michael Meeks committed
284 285 286 287 288 289 290
	else
		gb_ok=false
	fi
	
	if $gb_ok; then
		AC_MSG_RESULT(found)
		AC_DEFINE(ENABLE_GB)
291 292
		GB_LIBS=`gnome-config --libs gb`
		GB_CFLAGS=`gnome-config --cflags gb`
Michael Meeks's avatar
Michael Meeks committed
293 294 295 296 297 298 299
		have_gb=true
		gb=gb
		gb_msg=yes
	else
		AC_MSG_RESULT(not found)
	fi
fi
300
AM_CONDITIONAL(WITH_GB, $have_gb)
301 302
AC_SUBST(GB_CFLAGS)
AC_SUBST(GB_LIBS)
Michael Meeks's avatar
Michael Meeks committed
303

304 305 306
dnl ******************************
dnl GnomePrint checking
dnl ******************************
Jody Goldberg's avatar
Jody Goldberg committed
307
AC_MSG_CHECKING(for GnomePrint libraries >= 0.20)
308
if gnome-config --libs print > /dev/null 2>&1; then 
309
    vers=`gnome-config --modversion print | sed -e "s/gnome-print-//" -e 's/cvs$//' | \
310
        awk 'BEGIN { FS = "."; } { print $1 * 1000 + $2;}'`
Jody Goldberg's avatar
Jody Goldberg committed
311
    if test "$vers" -ge 20; then
312 313
        AC_MSG_RESULT(found)
    else
Jody Goldberg's avatar
Jody Goldberg committed
314
        AC_MSG_ERROR(You need at least GNOME print 0.20 for this version of Gnumeric)
315
    fi
316 317 318 319 320 321 322
else
    AC_MSG_ERROR(Did not find GnomePrint installed)
fi

dnl ******************************
dnl LibGlade checking
dnl ******************************
323
AC_MSG_CHECKING(for Glade libraries >= 0.13)
324
if gnome-config --libs libglade > /dev/null 2>&1; then 
325
    vers=`gnome-config --modversion libglade | awk 'BEGIN { FS = "."; } { print $1 * 1000 + $2;}'`
326
    if test "$vers" -ge 13; then
327 328
        AC_MSG_RESULT(found)
    else
329
        AC_MSG_ERROR(You need at least libglade 0.13 for this version of Gnumeric)
330
    fi
331 332 333 334
else
    AC_MSG_ERROR(Did not find libGlade installed)
fi

335 336 337
dnl ******************************
dnl gtk+ checking
dnl ******************************
Miguel de Icaza's avatar
Miguel de Icaza committed
338
AC_MSG_CHECKING(for GTK >= 1.2.7)
339
if gtk-config --version > /dev/null 2>&1; then 
Morten Welinder's avatar
Morten Welinder committed
340 341
    dnl We need the "%d" in order not to get e-notation on hpux.
    vers=`gtk-config --version | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
Miguel de Icaza's avatar
Miguel de Icaza committed
342
    if test "$vers" -ge 1002007; then
343 344
        AC_MSG_RESULT(found)
    else
Miguel de Icaza's avatar
Miguel de Icaza committed
345
        AC_MSG_ERROR(You need at least GTK+ 1.2.7 for this version of Gnumeric)
346
    fi
347
else
348
    AC_MSG_ERROR(Did not find GTK+ installed)
349 350
fi

Jody Goldberg's avatar
Jody Goldberg committed
351 352 353 354 355 356 357 358 359 360 361 362 363
dnl ******************************
dnl Check for Applix SHELF
dnl ******************************
try_applix_shelf=false
applix_shelf=
applix_shelf_msg=no
have_applix_shelf=false
AC_ARG_WITH(applix_shelf,
	[--{with,without}-shelf   Compile with Applix SHELF support or without it],
	if test x$withval = xyes; then
		try_applix_shelf=true
	fi
)
Jacob Berkman's avatar
Jacob Berkman committed
364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379

dnl ***************************************
dnl Check for gnome-libs which supports wm icons
dnl ***************************************
CFLAGS_save=$CFLAGS
LIBS_save=$LIBS
CFLAGS=`gnome-config --cflags gnomeui`
LIBS=`gnome-config --libs gnomeui`
use_wm_icons=false
AC_CHECK_LIB(gnomeui, gnome_window_icon_set_default_from_file, use_wm_icons=true)
if test x$use_wm_icons = xtrue; then
	AC_DEFINE(USE_WM_ICONS)
fi
CFLAGS=$CFLAGS_save
LIBS=$LIBS_save

Jody Goldberg's avatar
Jody Goldberg committed
380 381
dnl ***************************************

Michael Meeks's avatar
Michael Meeks committed
382 383
EXTRA_GNOME_LIBS=`gnome-config --libs gnomeui print libglade $bonobo libole2`
EXTRA_GNOME_CFLAGS=`gnome-config --cflags gnomeui print libglade $bonobo libole2`
384 385
AC_SUBST(EXTRA_GNOME_LIBS)
AC_SUBST(EXTRA_GNOME_CFLAGS)
386

387
AM_CONDITIONAL(LIBOLE2_PUBLIC_LIBRARY, false)
388

Morten Welinder's avatar
Morten Welinder committed
389 390
AM_CONDITIONAL(WITH_GDA, false)
AM_CONDITIONAL(WITH_PLAN_PERFECT, false)
Jody Goldberg's avatar
Jody Goldberg committed
391

Arturo Espinosa's avatar
Arturo Espinosa committed
392
AC_OUTPUT([
393
gnumeric.spec
Arturo Espinosa's avatar
Arturo Espinosa committed
394
Makefile
395
icons/Makefile
Miguel de Icaza's avatar
Miguel de Icaza committed
396
idl/Makefile
Arturo Espinosa's avatar
Arturo Espinosa committed
397
src/Makefile
398 399 400
src/dialogs/Makefile
src/widgets/Makefile
src/functions/Makefile
401
src/portability.h
402
graph/Makefile
Michael Meeks's avatar
Michael Meeks committed
403
graph/graph.oafinfo
404 405
wizards/Makefile
wizards/graphics/Makefile
406
doc/Makefile
407 408
doc/C/Makefile
doc/es/Makefile
409
corba-test/Makefile
Arturo Espinosa's avatar
Arturo Espinosa committed
410 411
plugins/Makefile
plugins/sample/Makefile
Morten Welinder's avatar
Morten Welinder committed
412
plugins/numtheory/Makefile
413
plugins/sc/Makefile
414
plugins/sylk/Makefile
415
plugins/excel/Makefile
416
plugins/gb/Makefile
Michael Meeks's avatar
Michael Meeks committed
417
plugins/lotus-123/Makefile
418
plugins/oleo/Makefile
419
plugins/python/Makefile
420
plugins/perl/Makefile
421
plugins/perl/ext/Makefile.PL
Mark Probst's avatar
Mark Probst committed
422
plugins/guile/Makefile
423
plugins/ff-csv/Makefile
424
plugins/text/Makefile
Michael Meeks's avatar
Michael Meeks committed
425
plugins/xbase/Makefile
426
plugins/html/Makefile
427
plugins/dif/Makefile
Jody Goldberg's avatar
Jody Goldberg committed
428 429
plugins/xml2/Makefile
plugins/applix/Makefile
430
plugins/plan-perfect/Makefile
Jody Goldberg's avatar
Jody Goldberg committed
431
plugins/gda/Makefile
Arturo Espinosa's avatar
Arturo Espinosa committed
432 433 434
intl/Makefile
po/Makefile.in
macros/Makefile
Miguel de Icaza's avatar
Miguel de Icaza committed
435
gnumeric.desktop
436 437
stamp.h
],[sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile])
438

439

440 441 442 443 444 445 446
echo "

Configuration:

	Source code location:	${srcdir}
	Compiler:		${CC} 
	
447
	GB Support:		${gb_msg}
448
	Bonobo Support:		${bonobo_msg}
Michael Meeks's avatar
Michael Meeks committed
449
	Oaf Support:		${using_oaf}
450
"
451 452 453 454 455 456 457 458 459
if $have_bonobo; then
	echo "
	The Bonobo version of gnumeric is not supported,
this code is changing extremely rapidly. For any given
release it may not compile or depend on unreleased packages.

	Please do not file bonobo related bug reports.
"
fi