File: configure.in

package info (click to toggle)
gnumeric 1.4.3-4
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 71,576 kB
  • ctags: 28,555
  • sloc: ansic: 282,333; xml: 45,788; sh: 8,479; makefile: 3,119; yacc: 1,129; lisp: 200; perl: 173; python: 86
file content (1034 lines) | stat: -rw-r--r-- 30,864 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
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
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
-*- mode: m4 -*-
AC_PREREQ(2.52)

m4_define([gnumeric_version_epoch], [1])
m4_define([gnumeric_version_major], [4])
m4_define([gnumeric_version_minor], [3])
m4_define([gnumeric_version_extra], [])
m4_define([gnumeric_full_version],
    [gnumeric_version_epoch.gnumeric_version_major.gnumeric_version_minor()gnumeric_version_extra])

AC_INIT([gnumeric], [gnumeric_full_version],
	[http://bugzilla.gnome.org/enter_bug.cgi?product=gnumeric])

AC_CONFIG_SRCDIR(src/sheet.h)
AM_INIT_AUTOMAKE([dist-bzip2])
AM_CONFIG_HEADER(gnumeric-config.h)

AM_MAINTAINER_MODE

# Make --disable-static the default
AC_DISABLE_STATIC

# We need intltool >= 0.27.2 to extract the UTF-8 chars from source code
AC_PROG_INTLTOOL([0.27.2])

AC_ISC_POSIX
AC_PROG_CC
AC_PROG_YACC
AM_PROG_LEX
AC_PROG_LN_S
AM_PROG_LIBTOOL
AC_STDC_HEADERS

AC_SUBST(ACLOCAL_FLAGS)

if test "$GCC" = "yes"; then
  gcc_check=`$CC -v 2>&1 | grep '^gcc version 2\.96'`
  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
    # Volts through it!
    #
    # Actually, the real problem here is that there are so many
    # different compilers calling themselves 2.96.  RedHat, listen
    # up!  That's a MAJOR BLUNDER!  If the user just thinks of it
    # as "gcc 2.96" then how the H*** are we going to get bug
    # reports we can use?  Chances are the newer 2.96 compilers
    # are just fine, but how can we know?
  fi
fi

dnl *****************************
# Check for zlib.
_cppflags="${CPPFLAGS}"
_ldflags="${LDFLAGS}"

AC_ARG_WITH(zlib,
	[[  --with-zlib=DIR       use libz in DIR]],
	[case x"$withval" in
	 xyes|xno) ;;
	 *)	Z_DIR=$withval
		CPPFLAGS="${CPPFLAGS} -I$withval/include"
		LDFLAGS="${LDFLAGS} -L$withval/lib"
		;;
	 esac])

if test "x$with_zlib" != xno; then
	with_zlib=no
	AC_CHECK_HEADER(zlib.h, [AC_CHECK_LIB(z, gzread, [with_zlib=yes])])
fi

if test "$with_zlib" = no; then
	AC_MSG_ERROR([*** zlib is required])
fi

if test "x${Z_DIR}" != "x"; then
	Z_CPPFLAGS="-I${Z_DIR}/include"
	case ${host} in
	*-*-solaris*)	Z_LIBS="-L${Z_DIR}/lib -R${Z_DIR}/lib -lz" ;;
	*)		Z_LIBS="-L${Z_DIR}/lib -lz" ;;
	esac
else
	Z_LIBS="-lz"
fi
AC_DEFINE([HAVE_LIBZ], [], [Have compression library])
AC_SUBST(Z_CPPFLAGS)
AC_SUBST(Z_LIBS)

CPPFLAGS=${_cppflags}
LDFLAGS=${_ldflags}

dnl *****************************
gnumeric_reqs="
	glib-2.0		>= 2.4.0
	gobject-2.0		>= 2.4.0
	gmodule-2.0		>= 2.4.0
	libgsf-1		>= 1.10.0
	libxml-2.0		>= 2.4.12
	pango			>= 1.4.0
	pangoft2		>= 1.4.0
"
gnumeric_gtk_reqs="
	gtk+-2.0		>= 2.4.0
	libglade-2.0		>= 2.3.6
	libgnomecanvas-2.0	>= 2.0.0
	libgnomeprint-2.2	>= 2.5.2
	libgnomeprintui-2.2	>= 2.5.2
	libart-2.0		>= 2.3.11
"
gnumeric_gnome_reqs="
	gconf-2.0
	libbonobo-2.0		>= 2.2.0
	libbonoboui-2.0		>= 2.2.0
	libgnome-2.0		>= 2.0.0
	libgnomeui-2.0		>= 2.0.0
	libgsf-gnome-1		>= 1.10.0
"

ui_msg=

dnl *******************
dnl Should we use gtk ?
dnl *******************
gnumeric_with_gtk=true
AC_ARG_WITH(gtk, [--without-gtk    Build without UI])
if test "x$with_gtk" = xno; then
	ui_msg="None (Gtk disabled by request)"
	gnumeric_with_gtk=false
fi

if test "x$gnumeric_with_gtk" = "xtrue" ; then
	PKG_CHECK_MODULES(GTK, [$gnumeric_gtk_reqs],
		[ui_msg="Gtk"],
		[ui_msg="None (missing gtk dependencies)" ; gnumeric_with_gtk=false ])
fi 

gnumeric_with_gnome=$gnumeric_with_gtk
if test "x$gnumeric_with_gtk" = "xtrue" ; then
	AC_DEFINE(WITH_GTK, 1, [Define if UI is built])
	gnumeric_reqs="$gnumeric_reqs $gnumeric_gtk_reqs"

	dnl ************************************
	dnl Are the GNOME extensions available ?
	dnl ************************************

	gnumeric_with_gnome=true
	AC_ARG_WITH(gnome,
		[--{with,without}-gnome    Use GNOME extensions],
		if test "x$withval" = xno; then
			gnumeric_with_gnome=false
			ui_msg="Gtk+ (Gnome disabled by request)"
		fi
	)
	if test "x$gnumeric_with_gnome" = "xtrue"; then
		PKG_CHECK_MODULES(GNOME, [$gnumeric_gnome_reqs],
			[ui_msg="Gnome"],
			[ui_msg="Gtk (missing gnome dependencies)" ; gnumeric_with_gnome=false])
	fi

	if test "x$gnumeric_with_gnome" = "xtrue"; then
		AC_DEFINE(WITH_GNOME, 1, [Define if GNOME extensions are available])
		gnumeric_reqs="$gnumeric_reqs $gnumeric_gnome_reqs"
	fi
fi
AM_CONDITIONAL(WITH_GTK,   $gnumeric_with_gtk)
AM_CONDITIONAL(WITH_GNOME, $gnumeric_with_gnome)

dnl ****************************
dnl now that we have selected out libraries the whole collection in one
dnl shot so that we can have a nice neat compile/link line
dnl ****************************

PKG_CHECK_MODULES(GNUMERIC, $gnumeric_reqs)
GNUMERIC_CFLAGS="$GNUMERIC_CFLAGS -I\$(top_srcdir)/src/cut-n-paste-code"
AC_SUBST(GNUMERIC_LIBS)
AC_SUBST(GNUMERIC_CFLAGS)

win32=no
case $host_os in
*mingw* | pw32* | cygwin*)
    win32=yes
    GNUMERIC_PLUGIN_LDFLAGS="-no-undefined $GNUMERIC_LIBS -Wl,--enable-runtime-pseudo-relo,\$(top_builddir)/src/gnumeric.exe.a -s"
    AC_CHECK_TOOL(WINDRES, windres, :)
    ;;
esac
AM_CONDITIONAL(WITH_WIN32, test x"$win32" = "xyes")

GNUMERIC_PLUGIN_LDFLAGS="-avoid-version $GNUMERIC_PLUGIN_LDFLAGS"
AC_SUBST(GNUMERIC_PLUGIN_LDFLAGS)

dnl disable for in stable release, re-enable for development series
CFLAGS="$CFLAGS -DG_DISABLE_DEPRECATED"
CFLAGS="$CFLAGS -DPANGO_DISABLE_DEPRECATED"
if test "x$gnumeric_with_gtk" = "xtrue"; then
	CFLAGS="$CFLAGS -DGDK_PIXBUF_DISABLE_DEPRECATED"
	CFLAGS="$CFLAGS -DGDK_DISABLE_DEPRECATED"
	CFLAGS="$CFLAGS -DGDK_MULTIHEAD_SAFE"
	CFLAGS="$CFLAGS -DGTK_DISABLE_DEPRECATED"
	CFLAGS="$CFLAGS -DLIBGLADE_DISABLE_DEPRECATED"
fi
if test "x$gnumeric_with_gnome" = "xtrue"; then
	CFLAGS="$CFLAGS -DGNOME_DISABLE_DEPRECATED"
	CFLAGS="$CFLAGS -DBONOBO_DISABLE_DEPRECATED"
	CFLAGS="$CFLAGS -DBONOBO_UI_DISABLE_DEPRECATED"
fi

dnl ==============================================
dnl GNOME Specific extensions
with_corba=false
if test "x${gnumeric_with_gnome}" = "xtrue"; then

	dnl ==============================================
	dnl Special GConf section  (stolen from libgnome)
	dnl ==============================================

	AC_ARG_VAR(GCONFTOOL, [Absolute path of the gconftool-2 executable (part of GConf).])
	AC_PATH_PROG(GCONFTOOL, gconftool-2)
	if test x"$GCONFTOOL" = x; then
		AC_MSG_ERROR([gconftool-2 executable not found in your path - should be installed with GConf])
	fi
	AM_GCONF_SOURCE_2

	dnl *************
	dnl Corba support
	dnl *************
	PKG_CHECK_MODULES(CORBA_LIBS,  [ORBit-2.0 >= 2.4.2
					libbonobo-2.0 >= 2.0.0
					bonobo-activation-2.0 >= 1.0.2
					],[with_corba=true], [with_corba=false])
	if test "x$with_corba" = "xtrue" ; then
		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)
	fi
fi
AM_CONDITIONAL(GCONF_SCHEMAS_INSTALL, $gnumeric_with_gnome)
AM_CONDITIONAL(WITH_CORBA, $with_corba)

dnl ****************************
dnl prep the pixmap generator
dnl ****************************

AC_ARG_VAR(GLIB_GENMARSHAL, [Absolute path of the glib-genmarshal executable.])
AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
AC_ARG_VAR(GDK_PIXBUF_CSOURCE, [Absolute path of the gdk-pixbuf-csource executable.])
AC_PATH_PROG(GDK_PIXBUF_CSOURCE, gdk-pixbuf-csource)

## this should come after `AC_PROG_CC'
ifdef([GNOME_COMPILE_WARNINGS],
	[GNOME_COMPILE_WARNINGS] CFLAGS="$CFLAGS $WARN_CFLAGS",
	[]
)
set_more_warnings=yes
if test "$GCC" = "yes" -a "x$set_more_warnings" != "xno"; then
	for option in -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
AC_SUBST(WARN_CFLAGS)

AC_ARG_ENABLE(ssconvert, [--disable-ssconvert		Do not build ssconvert (cmd line spreadsheet conversion tool)],
	[ ], [enable_ssconvert=yes])
AM_CONDITIONAL(ENABLE_SSCONVERT, test x"$enable_ssconvert" = "xyes")
AC_ARG_ENABLE(ssindex, [--enable-ssindex		Build ssindex (spreadsheet indexer for beagle)],
	[ ], [enable_ssindex=no])
AM_CONDITIONAL(ENABLE_SSINDEX, test x"$enable_ssindex" = "xyes")

dnl ****************************
dnl GDA Plugin
dnl ****************************
try_gda=true
gda_msg=yes
gnomedb_msg=no
AC_ARG_WITH(gda,
	[--{with,without}-gda      Compile the Gnome Database Access plugin],
	if test "x$withval" != xyes; then
		try_gda=false
		gda_msg="Disabled by request"
	fi
)
if test "$try_gda" = "true"; then
	PKG_CHECK_MODULES(GDA, [libgda >= 1.0.1 ],
		[gda_msg=yes],
		[gda_msg="NO.  libgda problem"])
	if test "$gda_msg" = "yes"; then
		PKG_CHECK_MODULES(GNOMEDB, [libgnomedb >= 1.0.1 ],
			[gnomedb_msg="yes"],
			[gnomedb_msg="NO. libgnomedb problem"])
		if test "$gnomedb_msg" = "yes"; then
			AC_DEFINE(HAVE_LIBGNOMEDB, 1, [ Define if libgnomedb support is compiled in])
		fi
	fi
fi
AM_CONDITIONAL(WITH_GDA, test x"$gda_msg" = "xyes")
AC_SUBST(GDA_CFLAGS)
AC_SUBST(GDA_LIBS)

AM_CONDITIONAL(WITH_GNOMEDB, test x"$gnomedb_msg" = "xyes")
AC_SUBST(GNOMEDB_CFLAGS)
AC_SUBST(GNOMEDB_LIBS)

dnl ****************************
dnl GB Plugin
dnl ****************************
#try_gda=true
#gb_msg=yes
try_gb=no
gb_msg="disabled due to lack of gb maintenance"
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.  There is no upstream maintainer for GB"
		#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 ****************************

AC_CHECK_DECL(fdopen, fdopen_works=yes, fdopen_works=no)

if test $fdopen_works = no ; then
	unset ac_cv_have_decl_fdopen
	CFLAGS="$CFLAGS -D_POSIX_SOURCE"
	AC_MSG_NOTICE([adding -D_POSIX_SOURCE to CFLAGS])
	AC_CHECK_DECL(fdopen, fdopen_works=yes, fdopen_works=no)
	if test $fdopen_works = no ; then
		AC_MSG_ERROR([fdopen is not available])
	fi
fi

# Unfortunately, -D_POSIX_SOURCE turns off struct timeval on Solaris
AC_MSG_CHECKING([whether struct timeval is available])
AC_TRY_COMPILE([#include <sys/time.h>], [struct timeval tv;], struct_timeval_works=yes, struct_timeval_works=no)
AC_MSG_RESULT($struct_timeval_works)

if test $struct_timeval_works = no ; then
	CFLAGS="$CFLAGS -D__EXTENSIONS__"
	AC_MSG_CHECKING([whether struct timeval is available with -D__EXTENSIONS__])
	AC_TRY_COMPILE([#include <sys/time.h>], [struct timeval tv;], struct_timeval_works=yes, struct_timeval_works=no)
	AC_MSG_RESULT($struct_timeval_works)
	if test $struct_timeval_works = no ; then
		AC_MSG_ERROR([struct timeval is not available])
	fi
fi

AC_CHECK_FUNC(gettimeofday,
	[AC_DEFINE(HAVE_GETTIMEOFDAY, 1,
		[Define if the gettimeofday function is available]
	)])

dnl src/functions/fn-math.c uses M_PI

AC_MSG_CHECKING([whether M_PI is available])
AC_TRY_COMPILE([#include <math.h>], [double f = M_PI], works_without_bsd_source=yes, works_without_bsd_source=no)
AC_MSG_RESULT($works_without_bsd_source)

if test $works_without_bsd_source = no ; then
	CFLAGS="$CFLAGS -D_BSD_SOURCE"
	AC_MSG_CHECKING([whether M_PI is available with -D_BSD_SOURCE])
	AC_TRY_COMPILE([#include <math.h>], [double f = M_PI], m_pi_works=yes, m_pi_works=no)
	AC_MSG_RESULT($m_pi_works)
	if test $m_pi_works = no ; then
		AC_MSG_ERROR([M_PI is not available])
	fi
fi

AC_SUBST(GUILE_LIBS)
AC_SUBST(GUILE_INCS)

#check for guile 1.5
try_guile=false
guile_msg="disabled pending some guile developer interest"
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 **************************************************

AC_ARG_WITH(psiconv,
	[--{with,without}-psiconv  Compile with Psiconv support or without it])
AC_ARG_VAR(PSICONV_CONFIG, [The psiconv-config executable.])
if test "x$with_psiconv" != xno; then
    AC_CHECK_PROG(PSICONV_CONFIG,psiconv-config,psiconv-config)
    if test x"$PSICONV_CONFIG" = x; then
	psiconv_msg="missing dependencies"
    else
	AC_MSG_CHECKING(for psiconv >= 0.9.3)
	if $PSICONV_CONFIG --version | awk -F. \
		'{exit !($1 > 0 || $2 > 9 || ($2 == 9 && $3 >= 3))}'
	then
	    PSICONV_CFLAGS=`$PSICONV_CONFIG --cflags`
            PSICONV_LIBS=`$PSICONV_CONFIG --libs`
	    psiconv_msg=yes
        else
	    psiconv_msg=no
        fi
	AC_MSG_RESULT($psiconv_msg)
    fi
else
    psiconv_msg=no
fi
AM_CONDITIONAL(WITH_PSICONV, test "x$psiconv_msg" = "xyes")
AC_SUBST(PSICONV_LIBS)
AC_SUBST(PSICONV_CFLAGS)

try_paradox=true
enable_paradox=false
AC_ARG_WITH(paradox,
	[--{with,without}-paradox  Compile with Paradox support or without it],
	if test "x$withval" = xno; then
		try_paradox=false
	fi
)

if $try_paradox; then
	PKG_CHECK_MODULES(PARADOX, [
		pxlib >= 0.4.0
		],
		[paradox_msg="yes"],
		[paradox_msg="missing dependencies"])
fi

if test "x$paradox_msg" = "xyes"; then
	enable_paradox=true
fi
AM_CONDITIONAL(WITH_PARADOX, $enable_paradox)
AC_SUBST(PARADOX_LIBS)
AC_SUBST(PARADOX_CFLAGS)

AC_ARG_ENABLE(solver, [--disable-solver  Don't compile the solver])
if test "x$enable_solver" = xno; then
	enable_solver=false
else
	enable_solver=true
	AC_DEFINE(ENABLE_SOLVER, 1, [Define if SOLVER is compiled])
fi
AM_CONDITIONAL(ENABLE_SOLVER, $enable_solver)

plugin_list_given=false
PLUGIN_LIST=""
AC_ARG_ENABLE(plugins,
	[--enable-plugins="text html"  Compile only the listed plugins],
	plugin_list_given=true
	PLUGIN_LIST=$enableval
)
AM_CONDITIONAL(PLUGIN_LIST_GIVEN, $plugin_list_given)
AC_SUBST(PLUGIN_LIST)

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/developer/translating.sgml for a description of how to translate
dnl and why we have so many translations.
dnl
ALL_LINGUAS="am az bg ca cs da de el en_CA en_GB es et fi fr ga gl he hr hu it ja ko lv ml mr ms nb nl nn no pl pt pt_BR ro ru sk sr sr@Latn sv tr uk vi zh_CN zh_TW"
AC_SUBST(ALL_LINGUAS)

GETTEXT_PACKAGE=gnumeric
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",
	[The package name, for gettext]
)
AM_GLIB_GNU_GETTEXT

#AC_PATH_PROG(TPUT_CMD,tput,no)
TPUT_CMD=no
marker_ok="<yes >"
marker_fail="<FAIL>"
marker_no="<NO  >"
if test "$TPUT_CMD" '!=' no && test -t 1 && test -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 We do not want to force libgnomeprint 2.8 just yet.
SAVE_LIBS="$LIBS"
LIBS="$LIBS $GNUMERIC_LIBS"
AC_CHECK_FUNCS(gnome_print_pango_create_layout mkfifo)
LIBS="$SAVE_LIBS"
unset SAVE_LIBS

dnl We do not want to force pango 1.6 just yet.
SAVE_LIBS="$LIBS"
LIBS="$LIBS $GNUMERIC_LIBS"
AC_CHECK_FUNCS(pango_layout_set_ellipsize pango_context_set_matrix pango_context_get_font_map)
LIBS="$SAVE_LIBS"
unset SAVE_LIBS

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 memmove mkdtemp uname times sysconf)

dnl FIXME: Does this really belong here?
AC_CHECK_FUNC(bind_textdomain_codeset,,[AC_CHECK_LIB(intl,bind_textdomain_codeset)])

dnl isfinite is a macro on HPUX
AC_TRY_COMPILE([#include <math.h>], [int a = isfinite(0.0)],
	[AC_DEFINE(HAVE_ISFINITE, 1,
		[Define if the isfinite() macro is available]
	 )
	], [])

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, 1,
		[Define if the finite function is available]
	 )
         LIBS="$LIBS -lm"])
fi

dnl check for complete locale implementation
AC_CHECK_HEADERS(langinfo.h)

dnl We supply our own lgamma_r (using lgamma) when missing.
dnl We supply our own expm1 (using log1p) when missing.
AC_CHECK_FUNCS(lgamma)
if test $ac_cv_func_lgamma = no; then
  AC_CHECK_LIB(m, lgamma,
        [AC_DEFINE(HAVE_LGAMMA, 1,
		[Define if the lgamma function is available]
	 )
         LIBS="$LIBS -lm"])
fi
AC_CHECK_FUNCS(lgamma_r expm1 log1p asinh acosh atanh)

AC_C_LONG_DOUBLE
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
		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 fmodl lgammal lgammal_r \
				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, 1,
					[Define if we need to provide a prototype for strtold()]
				 )],
				AC_MSG_RESULT(assuming not))
		elif test "x$ac_cv_func_string_to_decimal" != "xyes" || \
		     test "x$ac_cv_func_decimal_to_quadruple" != "xyes" || \
		     test "x$ac_cv_header_floatingpoint_h" != "xyes"; then
			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, 1,
			[Define if the long double type is to be used]
		)
	fi]
)

dnl **************************************************
dnl * Check for Perl
dnl **************************************************
dnl
perl_msg=no
AC_ARG_WITH(perl, [--{with,without}-perl   Compile the Perl plugin loader])
AC_ARG_VAR(PERL, [The Perl executable.])
if test "x$with_perl" != xno; then
    AC_CHECK_PROG(PERL, perl, perl)
    if test "x$PERL" != x; then
	AC_MSG_CHECKING([for perl ExtUtils::Embed module])
	if $PERL -e 'eval { require ExtUtils::Embed }; if ($@) { exit(1); } else { exit(0); }'
	then
	    AC_MSG_RESULT($marker_ok)
	    dnl AC_CHECK_LIB(perl, perl_construct, [], [perl_msg="missing/invalid libperl"])
	else
	    AC_MSG_RESULT($marker_no)
	    perl_msg="Missing ExtUtils::Embed"
	fi
    else
	perl_msg="could not find perl"
    fi
else
    perl_msg="Disabled by default"
fi

AM_CONDITIONAL(WITH_PERL, test "x$perl_msg" = xyes)
if test "x$perl_msg" = xyes ; then
    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`

    perl_msg="yes (using $PERL)"
fi
AC_SUBST(PERL_CCCDLFLAGS)
AC_SUBST(PERL_LDDLFLAGS)
AC_SUBST(PERL_CC)
AC_SUBST(PERL_LD)
AC_SUBST(PERL_CCOPTS)
AC_SUBST(PERL_LDOPTS)

dnl **************************************************
dnl * Check for Python
dnl **************************************************
python_msg="yes"
AC_ARG_WITH(python, [--{with,without}-python   Compile the Python plugin loader])
AC_ARG_VAR(PYTHON, [The Python executable.])
if test "x$with_python" != xno; then
    AC_CHECK_PROG(PYTHON, python, python)
    if test "x$PYTHON" = x; then
	python_msg="could not find python"
    fi
else
    python_msg="Disabled by request"
fi

if test "x$python_msg" = xyes; then
    AC_MSG_CHECKING([for python >= 2.0])
    PY_PREFIX=`$PYTHON -c 'import sys ; print sys.prefix'`
    PY_EXEC_PREFIX=`$PYTHON -c 'import sys ; print sys.exec_prefix'`
    PY_MAKEFILE=`$PYTHON -c 'from distutils.sysconfig import get_makefile_filename; print get_makefile_filename()'`
    [PY_VERSION=`$PYTHON -c 'import sys ; print sys.version[0:3]'`
    broken_py_initialize=`$PYTHON -c \
'import sys
if int(sys.version[0]) < 2:
    print "yes"
else:
    print "no"'`]
    if test "x$broken_py_initialize" != "xyes"; then
	AC_MSG_RESULT($marker_ok)
    else
	AC_MSG_RESULT($marker_fail)
	python_msg="NO.  Python version is too old."
    fi
fi

if test "x$python_msg" = xyes; then
    AC_MSG_CHECKING(Look for $PY_PREFIX/include/python$PY_VERSION/Python.h)
    if test -f $PY_PREFIX/include/python$PY_VERSION/Python.h; then
	AC_MSG_RESULT($marker_ok)
	PY_LIBS="python$PY_VERSION"
    	PY_LIB_LOC=`$PYTHON -c 'from distutils.sysconfig import get_config_var; print get_config_var("LIBPL")'`
    	PY_LIB_LOC="-L$PY_LIB_LOC"
	PY_CFLAGS="-I$PY_PREFIX/include/python$PY_VERSION"
	[echo 'echo_python_libs:
	@echo $(MODLIBS) $(LIBS)' >confmake.tmp
	PY_EXTRA_LIBS=`make -s -f confmake.tmp -f "$PY_MAKEFILE"`
	rm -f confmake.tmp]
    else
	AC_MSG_RESULT($marker_fail)
	python_msg="unable to find Python.h"
    fi
fi

if test "x$python_msg" = xyes; 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
    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($marker_ok)
    else
	AC_MSG_RESULT($marker_fail)
	python_msg="unable to link to python"
    fi
    cd ..
    rm -rf testpython
fi
if test "x$python_msg" = xyes; then
    PKG_CHECK_MODULES(PYGTK, pygtk-2.0 >= 1.99.10,
	    [],
	    [python_msg="NO.  pygtk problem"])
fi

AM_CONDITIONAL(WITH_PYTHON, test "x$python_msg" = xyes)
if test "x$python_msg" = xyes; then
    python_msg="yes (using $PYTHON)"
fi
AC_SUBST(PYGTK_CFLAGS)
AC_SUBST(PY_LIBS)
AC_SUBST(PY_LIB_LOC)
AC_SUBST(PY_CFLAGS)
AC_SUBST(PY_EXTRA_LIBS)

dnl **************************************************
dnl * Check for mono
dnl **************************************************
with_mono=no
mono_msg="disabled, still experimental"

dnl A tricky way to comment out in m4:
ifelse([
AC_ARG_WITH(mono, [--{with,without}-mono     Compile the mono scripting engine])
case x$with_mono in
xno)	mono_msg="Disabled by request";;
*)
    PKG_CHECK_MODULES(MONO, mono,
	[with_mono=yes
	 AC_DEFINE(WITH_MONO, 1, [Define if mono .NET engine is available])],
	[with_mono=no])
    mono_msg=$with_mono
    ;;
esac
])

AM_CONDITIONAL(WITH_MONO, test "x$with_mono" = "xyes")
AC_SUBST(MONO_CFLAGS)
AC_SUBST(MONO_LIBS)

dnl **************************************************
dnl * Config defaults (Must be after bonobo)
dnl **************************************************
gnumeric_version="${VERSION}"
gnumeric_prefix='${prefix}'
gnumeric_exec_prefix='${exec_prefix}'
gnumeric_sysconfdir='${sysconfdir}'
dnl These are changed in libgnumeric.c for WIN32 packages
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_localedir='${prefix}/${DATADIRNAME}/locale'

gnumeric_autoformatdir='${gnumeric_datadir}/autoformat-templates'

dnl Export to gnumeric-config.h
AC_DEFINE_UNQUOTED(GNUMERIC_VERSION, "gnumeric_full_version",
	[The version number of this release, possibly suffixed for bonobo]
)
AC_DEFINE_UNQUOTED(GNM_VERSION_EPOCH, gnumeric_version_epoch,
	[The Epoch of this release]
)
AC_DEFINE_UNQUOTED(GNM_VERSION_MAJOR, gnumeric_version_major,
	[The Major version number of this release]
)
AC_DEFINE_UNQUOTED(GNM_VERSION_MINOR, gnumeric_version_minor,
	[The Minor version number of this release]
)
AC_DEFINE_UNQUOTED(GNM_VERSION_EXTRA, "gnumeric_version_extra",
	[Extra, possibly empty tag for this release]
)
AC_SUBST(gnumeric_version)
AC_SUBST(gnumeric_prefix)
AC_SUBST(gnumeric_exec_prefix)
AC_SUBST(gnumeric_sysconfdir)
AC_SUBST(gnumeric_datadir)
AC_SUBST(gnumeric_libdir)
AC_SUBST(gnumeric_plugindir)
AC_SUBST(gnumeric_gladedir)
AC_SUBST(gnumeric_icondir)
AC_SUBST(gnumeric_localedir)
AC_SUBST(gnumeric_autoformatdir)
AC_SUBST(gnumeric_with_gnome)

AC_OUTPUT([
gnumeric.spec
Makefile
icons/Makefile
src/Makefile
src/dialogs/Makefile
src/gnumeric-paths.sh
src/pixmaps/Makefile
src/widgets/Makefile
src/tools/Makefile
src/tools/solver/Makefile
src/tools/solver/glpk/Makefile
src/tools/solver/glpk/source/Makefile
src/tools/solver/glpk/include/Makefile
src/tools/solver/lp_solve/Makefile
src/cut-n-paste-code/Makefile
src/cut-n-paste-code/foocanvas/Makefile
src/cut-n-paste-code/foocanvas/libfoocanvas/Makefile
src/cut-n-paste-code/goffice/Makefile
src/cut-n-paste-code/goffice/app/Makefile
src/cut-n-paste-code/goffice/pixmaps/Makefile
src/cut-n-paste-code/goffice/utils/Makefile
src/cut-n-paste-code/goffice/gui-utils/Makefile
src/cut-n-paste-code/goffice/graph/Makefile
src/cut-n-paste-code/goffice/graph/plugins/Makefile
src/cut-n-paste-code/goffice/graph/plugins/plot_barcol/Makefile
src/cut-n-paste-code/goffice/graph/plugins/plot_pie/Makefile
src/cut-n-paste-code/goffice/graph/plugins/plot_radar/Makefile
src/cut-n-paste-code/goffice/graph/plugins/plot_xy/Makefile
src/cut-n-paste-code/goffice/graph/plugins/plot_surface/Makefile
src/cut-n-paste-code/goffice/drawing/Makefile
src/cut-n-paste-code/goffice/ms-compat/Makefile
src/cut-n-paste-code/goffice/libpresent/Makefile
src/cut-n-paste-code/goffice/test/Makefile
src/cut-n-paste-code/goffice/cut-n-paste/Makefile
src/cut-n-paste-code/goffice/cut-n-paste/pcre/Makefile
src/cut-n-paste-code/goffice/cut-n-paste/egg-recent-files/Makefile
doc/Makefile
doc/C/Makefile
doc/C/figures/Makefile
doc/developer/Makefile
plugins/Makefile
plugins/numtheory/Makefile
plugins/fn-complex/Makefile
plugins/fn-database/Makefile
plugins/fn-date/Makefile
plugins/fn-eng/Makefile
plugins/fn-erlang/Makefile
plugins/fn-financial/Makefile
plugins/fn-info/Makefile
plugins/fn-logical/Makefile
plugins/fn-lookup/Makefile
plugins/fn-math/Makefile
plugins/fn-stat/Makefile
plugins/fn-string/Makefile
plugins/fn-random/Makefile
plugins/derivatives/Makefile
plugins/sc/Makefile
plugins/sylk/Makefile
plugins/excel/Makefile
plugins/gda/Makefile
plugins/gnome-db/Makefile
plugins/lotus-123/Makefile
plugins/oleo/Makefile
plugins/python-loader/Makefile
plugins/gnome-glossary/Makefile
plugins/py-func/Makefile
plugins/corba/Makefile
plugins/perl/Makefile
plugins/perl/ext/Makefile.PL
plugins/perl-func/Makefile
plugins/perl-loader/Makefile
plugins/guile/Makefile
plugins/xbase/Makefile
plugins/html/Makefile
plugins/dif/Makefile
plugins/qpro/Makefile
plugins/plan-perfect/Makefile
plugins/xml_sax/Makefile
plugins/applix/Makefile
plugins/openoffice/Makefile
plugins/psiconv/Makefile
plugins/mps/Makefile
plugins/sample_datasource/Makefile
plugins/paradox/Makefile
plugins/uihello/Makefile
po/Makefile.in
schemas/Makefile
templates/Makefile
templates/english/Makefile
templates/autoformat/Makefile
stamp.h
])

echo "

Configuration:

	Source code location:	${srcdir}
	Compiler:		${CC}
	Compiler flags:		${CFLAGS}
	Floating point type:	${float_msg}

	UI :			${ui_msg}

	Perl Support:		${perl_msg}
	Python Support:		${python_msg}
	Guile Support:		${guile_msg}

	GDA support:		${gda_msg}
	GNOME-DB support:	${gnomedb_msg}
	Psiconv support:        ${psiconv_msg}
"
#	Mono support:		${mono_msg}