Revert, revert, try another thing
[gnumeric.git] / configure.in
blobd3e8a8fff10fbe04bd5ed4bdb440f2bff53621a6
1 AC_INIT(src/gnumeric.h)
3 AM_CONFIG_HEADER(config.h)
4 AM_INIT_AUTOMAKE(gnumeric,0.49)
5 AM_MAINTAINER_MODE
6 AM_ACLOCAL_INCLUDE(macros)
8 AC_ISC_POSIX
9 AC_PROG_CC
10 AC_STDC_HEADERS
11 AC_PROG_YACC
12 AC_ARG_PROGRAM
13 AM_PROG_LIBTOOL
15 GNOME_INIT
17 ## this should come after `AC_PROG_CC'
18 GNOME_COMPILE_WARNINGS
19 GNOME_X_CHECKS
20 GNOME_XML_CHECK
22 dnl
23 dnl alloca tests
24 dnl;
25 AC_FUNC_ALLOCA
26 if test $ac_cv_header_alloca_h = yes; then
27         GNUMERIC_HAVE_ALLOCA_H=1
28 else
29         GNUMERIC_HAVE_ALLOCA_H=0
31 AC_SUBST(GNUMERIC_HAVE_ALLOCA_H)
33 AC_SUBST(QTTHREADS_LIB)
34 AC_SUBST(TERMCAP_LIB)
35 AC_SUBST(READLINE_LIB)
36 AC_SUBST(GUILE_LIBS)
37 AC_SUBST(GUILE_INCS)
38 AC_ARG_WITH(guile,[--with-guile   Include Guile support],[GNOME_CHECK_GUILE])
40 AC_SUBST(CFLAGS)
41 AC_SUBST(CPPFLAGS)
42 AC_SUBST(LDFLAGS)
44 dnl **************************************************
45 dnl * internationalization support
46 dnl **************************************************
47 dnl 
48 dnl
49 dnl Check doc/translating.sgml for a description of how to translate
50 dnl and why we have so many translations.
51 dnl
52 ALL_LINGUAS="cs da de en_GB es es_DO es_GT es_HN es_MX es_PA es_PE es_SV et fi fr ga hu hr it ja ko nl no pt pt_BR ru pl sk zh_TW.Big5 sv uk zh_CN.GB2312"
53 AM_GNU_GETTEXT
54 # AM_GNOME_GETTEXT above substs $DATADIRNAME
55 # this is the directory where the *.{mo,gmo} files are installed
56 gnomelocaledir='${prefix}/${DATADIRNAME}/locale'
57 AC_SUBST(gnomelocaledir)
59 AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl)
62 dnl
63 dnl On Solaris finite() needs ieeefp.h
64 dnl
65 AC_CHECK_HEADERS(ieeefp.h)
67 dnl Check for some functions
68 AC_CHECK_FUNCS(random drand48)
70 dnl **************************************************
71 dnl * ORBit support
72 dnl **************************************************
73 GNOMEGNORBA_LIBS="$GNOMEGNORBA_LIBS"
74 AC_SUBST(GNOMEGNORBA_LIBS)
76 dnl ******************************
77 dnl gnome-xml checking
78 dnl ******************************
79 AC_MSG_CHECKING(for GnomeXML libraries >= 1.8.5)
80 if xml-config --libs print > /dev/null 2>&1; then 
81     vers=`xml-config --version | sed -e "s/libxml //" | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
82     if test "$vers" -ge 1008005; then
83         AC_MSG_RESULT(found)
84     else
85         AC_MSG_ERROR(You need at least GnomeXML 1.8.5 for this version of Gnumeric)
86     fi
87 else
88     AC_MSG_ERROR(Did not find GnomeXML installed)
92 dnl **************************************************
93 dnl * Check for Perl
94 dnl **************************************************
95 dnl
96 AC_CHECK_PROG(perl_val, perl, true, false)
97 if $perl_val; then
98   AC_MSG_CHECKING(for perl ExtUtils::Embed module)
99   perl -e 'eval { require ExtUtils::Embed }; if ($@) { exit(1); } else { exit(0); }'
100   if test "x$?" = "x0"; then
101     AC_MSG_RESULT(yes)
103     dnl Use ExtUtils::Embed to figure out the other options.
104     PERL_CCCDLFLAGS=`perl -MConfig -e 'print $Config{cccdlflags},"\n";'`
105     PERL_LDDLFLAGS=`perl -MConfig -e 'print $Config{lddlflags},"\n";'`
106     PERL_CC=`perl -MConfig -e 'print $Config{cc},"\n";'`
107     PERL_LD=`perl -MConfig -e 'print $Config{ld},"\n";'`
108     PERL_CCOPTS=`perl -MExtUtils::Embed -e ccopts`
109     PERL_LDOPTS=`perl -MExtUtils::Embed -e ldopts`
110     AC_SUBST(PERL_CCCDLFLAGS)
111     AC_SUBST(PERL_LDDLFLAGS)
112     AC_SUBST(PERL_CC)
113     AC_SUBST(PERL_LD)
114     AC_SUBST(PERL_CCOPTS)
115     AC_SUBST(PERL_LDOPTS)
116   else
117     AC_MSG_RESULT(no)
118     perl_val=false
119   fi
121 AM_CONDITIONAL(WITH_PERL, $perl_val)
123 dnl **************************************************
124 dnl * Check for Python
125 dnl **************************************************
126 AC_CHECK_PROG(python_val, python, true, false)
127 if $python_val; then
128           PY_PREFIX=`python -c 'import sys ; print sys.prefix'`
129           PY_EXEC_PREFIX=`python -c 'import sys ; print sys.exec_prefix'`
130           changequote(<<, >>)dnl
131           PY_VERSION=`python -c 'import sys ; print sys.version[0:3]'`
132           changequote([, ])dnl
133           if test -f $PY_PREFIX/include/python$PY_VERSION/Python.h; then
134                   PY_LIBS="python$PY_VERSION"
135                   PY_LIB_LOC="-L$PY_EXEC_PREFIX/lib/python$PY_VERSION/config"
136                   PY_CFLAGS="-I$PY_PREFIX/include/python$PY_VERSION"
137                   PY_MAKEFILE="$PY_EXEC_PREFIX/lib/python$PY_VERSION/config/Makefile"
138                   PY_LOCALMODLIBS=`sed -n -e 's/^LOCALMODLIBS=\(.*\)/\1/p' $PY_MAKEFILE`
139                   PY_BASEMODLIBS=`sed -n -e 's/^BASEMODLIBS=\(.*\)/\1/p' $PY_MAKEFILE`
140                   PY_OTHER_LIBS=`sed -n -e 's/^LIBS=\(.*\)/\1/p' $PY_MAKEFILE`
141                   PY_EXTRA_LIBS="$PY_LOCALMODLIBS $PY_BASEMODLIBS $PY_OTHER_LIBS"
142                   AC_SUBST(PY_LIBS)
143                   AC_SUBST(PY_LIB_LOC)
144                   AC_SUBST(PY_CFLAGS)
145                   AC_SUBST(PY_EXTRA_LIBS)
146           else
147                   python_val=false
148           fi
150 AM_CONDITIONAL(WITH_PYTHON, $python_val)
152 dnl ******************************
153 dnl Check for Bonobo
154 dnl ******************************
155 try_bonobo=true
156 bonobo=
157 bonobo_msg=no
158 have_bonobo=false
159 AC_ARG_WITH(bonobo,
160         [--{with,without}-bonobo   Compile with Bonobo support or without it],
161         if test x$withval = xno; then
162                 try_bonobo=false
163         fi
166 gnumeric_executable=gnumeric
167 AC_SUBST(gnumeric_executable)
168 if $try_bonobo; then
169         AC_MSG_CHECKING(for Bonobo >= 0.9)
170         if gnome-config --libs bonobo > /dev/null 2>&1; then
171                 vers=`gnome-config --modversion bonobo`
172                 case $vers
173                 in
174                     bonobo-0.[[012345678]]) bonobo_ok=false ;;
175                     *) bonobo_ok=true ;;
176                 esac
177         else
178                 bonobo_ok=false
179         fi
180         
181         if $bonobo_ok; then
182                 AC_MSG_RESULT(found)
183                 AC_DEFINE(ENABLE_BONOBO)
184                 have_bonobo=true
185                 bonobo=bonobo
186                 bonobo_msg=yes
187                 gnumeric_executable=gnumeric-bonobo
188         else
189                 AC_MSG_RESULT(not found)
190         fi
192 AM_CONDITIONAL(BONOBO, $have_bonobo)
194 dnl ******************************
195 dnl Kludge for Libole2 virtual link.
196 dnl ******************************
197 AM_CONDITIONAL(LIBOLE2_PUBLIC_LIBRARY, false)
199 dnl ******************************
200 dnl Check for GB
201 dnl ******************************
202 try_gb=true
204 gb_msg=no
205 have_gb=false
206 GB_CFLAGS=
207 GB_LIBS=
208 AC_ARG_WITH(gb,
209         [--{with,without}-gb       Compile with Gb support or without it],
210         if test x$withval = xno; then
211                 try_gb=false
212         fi
215 if $try_gb; then
216         AC_MSG_CHECKING(for Gb >= 0.0.8)
217         if gnome-config --libs gb > /dev/null 2>&1; then
218                 vers=`gnome-config --modversion gb | awk 'BEGIN { FS = "."; } { print $1 * 10000 + $2 * 100 + $3; }'`
219                 if test "$vers" -ge 000008; then
220                         gb_ok=true
221                 else
222                         gb_ok=false
223                 fi
224         else
225                 gb_ok=false
226         fi
227         
228         if $gb_ok; then
229                 AC_MSG_RESULT(found)
230                 AC_DEFINE(ENABLE_GB)
231                 GB_LIBS=`gnome-config --libs gb`
232                 GB_CFLAGS=`gnome-config --cflags gb`
233                 have_gb=true
234                 gb=gb
235                 gb_msg=yes
236         else
237                 AC_MSG_RESULT(not found)
238         fi
240 AM_CONDITIONAL(WITH_GB, $have_gb)
241 AC_SUBST(GB_CFLAGS)
242 AC_SUBST(GB_LIBS)
244 dnl ******************************
245 dnl GnomePrint checking
246 dnl ******************************
247 AC_MSG_CHECKING(for GnomePrint libraries >= 0.13)
248 if gnome-config --libs print > /dev/null 2>&1; then 
249     vers=`gnome-config --modversion print | sed -e "s/gnome-print-//" | \
250         awk 'BEGIN { FS = "."; } { print $1 * 1000 + $2;}'`
251     if test "$vers" -ge 14; then
252         AC_MSG_RESULT(found)
253     else
254         AC_MSG_ERROR(You need at least GNOME print 0.14 for this version of Gnumeric)
255     fi
256 else
257     AC_MSG_ERROR(Did not find GnomePrint installed)
260 dnl ******************************
261 dnl LibGlade checking
262 dnl ******************************
263 AC_MSG_CHECKING(for Glade libraries >= 0.11)
264 if gnome-config --libs libglade > /dev/null 2>&1; then 
265     vers=`gnome-config --modversion libglade | awk 'BEGIN { FS = "."; } { print $1 * 1000 + $2;}'`
266     if test "$vers" -ge 11; then
267         AC_MSG_RESULT(found)
268     else
269         AC_MSG_ERROR(You need at least libglade 0.11 for this version of Gnumeric)
270     fi
271 else
272     AC_MSG_ERROR(Did not find libGlade installed)
275 dnl ******************************
276 dnl gtk+ checking
277 dnl ******************************
278 AC_MSG_CHECKING(for GTK >= 1.2.2)
279 if gtk-config --version > /dev/null 2>&1; then 
280     dnl We need the "%d" in order not to get e-notation on hpux.
281     vers=`gtk-config --version | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
282     if test "$vers" -ge 1002002; then
283         AC_MSG_RESULT(found)
284     else
285         AC_MSG_ERROR(You need at least GTK+ 1.2.2 for this version of Gnumeric)
286     fi
287 else
288     AC_MSG_ERROR(Did not find GTK+ installed)
291 EXTRA_GNOME_LIBS=`gnome-config --libs gnomeui print libglade $bonobo`
292 EXTRA_GNOME_CFLAGS=`gnome-config --cflags gnomeui print libglade $bonobo`
293 AC_SUBST(EXTRA_GNOME_LIBS)
294 AC_SUBST(EXTRA_GNOME_CFLAGS)
296 AM_CONDITIONAL(LIBOLE2_PUBLIC_LIBRARY, false)
298 AC_OUTPUT([
299 gnumeric.spec
300 Makefile
301 icons/Makefile
302 idl/Makefile
303 src/Makefile
304 src/dialogs/Makefile
305 src/widgets/Makefile
306 src/functions/Makefile
307 src/portability.h
308 graph/Makefile
309 wizards/Makefile
310 wizards/graphics/Makefile
311 doc/Makefile
312 doc/C/Makefile
313 doc/es/Makefile
314 corba-test/Makefile
315 plugins/Makefile
316 plugins/sample/Makefile
317 plugins/sc/Makefile
318 plugins/sylk/Makefile
319 plugins/excel/Makefile
320 plugins/excel/libole2/Makefile
321 plugins/gb/Makefile
322 plugins/lotus-123/Makefile
323 plugins/oleo/Makefile
324 plugins/python/Makefile
325 plugins/perl/Makefile
326 plugins/perl/ext/Makefile.PL
327 plugins/guile/Makefile
328 plugins/ff-csv/Makefile
329 plugins/text/Makefile
330 plugins/xbase/Makefile
331 plugins/html/Makefile
332 plugins/dif/Makefile
333 plugins/plan-perfect/Makefile
334 intl/Makefile
335 po/Makefile.in
336 macros/Makefile
337 gnumeric.desktop
338 stamp.h
339 ],[sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile])
342 echo "
344 Configuration:
346         Source code location:   ${srcdir}
347         Compiler:               ${CC} 
348         
349         GB Support:             ${gb_msg}
350         Bonobo Support:         ${bonobo_msg}
352 if $have_bonobo; then
353         echo "
354         The Bonobo version of gnumeric is not supported,
355 this code is changing extremely rapidly. For any given
356 release it may not compile or depend on unreleased packages.
358         Please do not file bonobo related bug reports.