added Info.plist
[TestXSLT.git] / libsablot / configure.in
1 dnl
2 dnl The contents of this file are subject to the Mozilla Public
3 dnl License Version 1.1 (the "License"); you may not use this file
4 dnl except in compliance with the License. You may obtain a copy of
5 dnl the License at http://www.mozilla.org/MPL/
6 dnl 
7 dnl Software distributed under the License is distributed on an "AS
8 dnl IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
9 dnl implied. See the License for the specific language governing
10 dnl rights and limitations under the License.
11 dnl 
12 dnl The Original Code is the Charlie project.
13 dnl 
14 dnl The Initial Developer of the Original Code is Ginger Alliance Ltd.
15 dnl Portions created by Ginger Alliance are 
16 dnl Copyright (C) 1999-2002 Ginger Alliance Ltd.
17 dnl All Rights Reserved.
18 dnl 
19 dnl Contributor(s):
20 dnl 
21 dnl Alternatively, the contents of this file may be used under the
22 dnl terms of the GNU General Public License Version 2 or later (the
23 dnl "GPL"), in which case the provisions of the GPL are applicable 
24 dnl instead of those above.  If you wish to allow use of your 
25 dnl version of this file only under the terms of the GPL and not to
26 dnl allow others to use your version of this file under the MPL,
27 dnl indicate your decision by deleting the provisions above and
28 dnl replace them with the notice and other provisions required by
29 dnl the GPL.  If you do not delete the provisions above, a recipient
30 dnl may use your version of this file under either the MPL or the
31 dnl GPL.
32 dnl 
33
34 AC_INIT()
35
36 PKG_NAME=Sablot
37 PKG_VERSION=0.98
38
39 dnl --------------------------------------------------
40 dnl common initialization stuff
41 dnl !!! keep synchronized with other files !!!
42 dnl vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
43
44 dnl for better portability we need higher version of autoconf
45 dnl on most platforms it may work w/ lower version number
46 AC_PREREQ( 2.13 )
47 AC_CONFIG_AUX_DIR(tools)
48
49 AM_INIT_AUTOMAKE($PKG_NAME, $PKG_VERSION, 'z')
50 AM_CONFIG_HEADER( autocfg/config.h:autocfg/config.h.in )
51
52 dnl automake stuff
53 AC_PROG_LIBTOOL()
54
55 dnl C/C++ stuff
56 dnl AC_LANG_C()
57 dnl AC_PROG_CC()
58 dnl AC_PROG_CPP()
59 AC_LANG_CPLUSPLUS()
60 AC_PROG_CXX($EXTRA_CXX)
61 AC_PROG_CXXCPP()
62
63 dnl switch checking
64 dnl default no warnings
65 CXXWARNING_FLAGS=
66 AC_ARG_ENABLE(warnings,
67 [  --enable-warnings           display all warning while compiling])
68 if test -z "$enable_warnings"; then
69   enable_warnings=no
70 fi
71 if test x$enable_warnings != xno; then
72   CXXWARNING_FLAGS='-Wall -W -Winline -Wno-unused-parameter'
73   AC_MSG_CHECKING([Whether $CXX accepts -Wno-unused-parameter])
74   old_cxxflags="$CXXFLAGS"
75   CXXFLAGS="$old_cxxflags $CXXWARNING_FLAGS"
76   AC_TRY_COMPILE([ ], [return 0;], [AC_MSG_RESULT(yes)],
77     [ AC_MSG_RESULT(no)
78       CXXWARNING_FLAGS="-Wall -W -Winline"
79     ])
80   CXXFLAGS="$old_cxxflags"
81 fi
82 AC_SUBST(CXXWARNING_FLAGS)
83
84 AC_ARG_ENABLE(abort-on-error,
85 [  --enable-abort-on-error     abort processor on XSLT error],
86   AC_DEFINE(SABLOT_ABORT_ON_ERROR, 1,
87             [abort on XSLT error]))
88
89 AC_ARG_ENABLE(adding-meta, 
90 [  --disable-adding-meta       do not output the META html tag])
91 if test x$enable_adding_meta = xno; then
92   AC_DEFINE(SABLOT_DISABLE_ADDING_META, 1, 
93            [define if don't want to generate the META html tag])
94 fi
95
96 AC_ARG_ENABLE(document-errors, 
97 [  --disable-document-errors   ignore errors in the document() function])
98 if test x$enable_document_errors = xno; then
99   AC_DEFINE(SABLOT_DISABLE_DOC_ERRORS, 1, 
100            [define if don't want to produce errors in the document() function])
101 fi
102
103 AC_ARG_ENABLE(javascript, 
104 [  --enable-javascript     enable JavaScript extensions (e.g. exslt.org)])
105 if test x$enable_javascript = xyes; then
106   js_enabled=1
107   AC_DEFINE(ENABLE_JS, 1, [define, whether to build the JS extension])
108 else
109   js_enabled=0
110 fi
111 AC_ARG_WITH(js-prefix,
112 [  --with-js-prefix=DIR    set alternate JavaScript prefix],
113  [if test -x $withval ; then
114    #on Redhat js header files are in include/js
115    if test -x $withval/include/js ; then
116     CFLAGS="$CFLAGS -I$withval/include/js"
117     CXXFLAGS="$CXXFLAGS -I$withval/include/js"
118     CPPFLAGS="$CPPFLAGS -I$withval/include/js"
119    else
120     if test -x $withval/include ; then
121      CFLAGS="$CFLAGS -I$withval/include"
122      CPPFLAGS="$CPPFLAGS -I$withval/include"
123      CXXFLAGS="$CXXFLAGS -I$withval/include"
124     else
125      AC_MSG_ERROR([prefix for JavaScript not valid (include dir)])
126     fi
127    fi
128    if test -x $withval/lib ; then
129     LDFLAGS="$LDFLAGS -L$withval/lib"
130    else
131     AC_MSG_ERROR([prefix for JavaScript library invalid (libdir)])
132    fi
133   else
134    AC_MSG_ERROR([prefix for JavaScript library invalid (not a directory)])
135   fi
136  ]
137 )
138
139 dnl make it easier to link with expat and iconv
140 AC_ARG_WITH(expat-prefix,
141 [  --with-expat-prefix=DIR set alternate expat prefix],
142  [if test -x $withval ; then
143    if test -x $withval/include ; then
144     CFLAGS="$CFLAGS -I$withval/include"
145     CPPFLAGS="$CPPFLAGS -I$withval/include"
146     CXXFLAGS="$CXXFLAGS -I$withval/include"
147    else
148     AC_MSG_ERROR([prefix for Expat not valid (include dir)])
149    fi
150    if test -x $withval/lib ; then
151     LDFLAGS="$LDFLAGS -L$withval/lib"
152    else
153     AC_MSG_ERROR([prefix for Expat library invalid (libdir)])
154    fi
155   else
156    AC_MSG_ERROR([prefix for Expat library invalid (not a directory)])
157   fi
158  ]
159 )
160
161 AC_ARG_WITH(iconv-prefix,
162 [  --with-iconv-prefix=DIR set alternate iconv prefix],
163  [if test -x $withval ; then
164    if test -x $withval/include ; then
165     CFLAGS="$CFLAGS -I$withval/include"
166     CXXFLAGS="$CXXFLAGS -I$withval/include"
167     CPPFLAGS="$CPPFLAGS -I$withval/include"
168    else
169     AC_MSG_ERROR([prefix for Iconv not valid (include dir)])
170    fi
171    if test -x $withval/lib ; then
172     LDFLAGS="$LDFLAGS -L$withval/lib"
173    else
174     AC_MSG_ERROR([prefix for Iconv library invalid (libdir)])
175    fi
176   else
177    AC_MSG_ERROR([prefix for Iconv library invalid (not a directory)])
178   fi
179  ]
180 )
181
182 dnl PH removed this to keep the compatibility with pre 2.5 autoconf
183 dnl AC_ARG_VAR(PERL, [
184 dnl                  path to perl binary to be used in various scripts
185 dnl                  to build documentation])
186
187 dnl environment PERL_PROG is used instead
188
189 AC_ARG_WITH(perl,
190 [  --with-perl=PATH use perl binary to install apidocs],
191  [if test -x $withval ; then
192    AC_MSG_CHECKING([perl version of $withval])
193    perlv=`$withval -v | sed -n -e "s%^This is perl, v\(ersion \)\?\(5.*\) built.*$%\2%p"`
194    if test -z "$perlv" ; then
195     AC_MSG_ERROR([You need to provide a path to perl 5])
196    else
197     AC_MSG_RESULT([$perlv ok])
198     AC_SUBST(PERL_PROG, [$withval])
199    fi
200   else
201    AC_MSG_ERROR([Perl $withval is not executable])
202   fi
203  ],
204  [AC_PATH_PROG([PERL_PROG], [perl], [/usr/bin/perl])]
205 )
206 AC_MSG_CHECKING([XML::Parser perl module])
207 PERL_SOURCE='eval { require XML::Parser; }; print "yes" unless $@; '
208 BUILD_APIDOCS=`echo $PERL_SOURCE | $PERL_PROG`
209 if test "x$BUILD_APIDOCS" = "xyes"; then
210   AC_MSG_RESULT([yes])
211 else
212   AC_MSG_RESULT([no: documentation requires XML::Parser module and will not be built.])
213 fi
214 AC_SUBST([BUILD_APIDOCS])
215
216
217 AC_ARG_WITH(html-dir,
218 [  --with-html-dir=DIR path to install HTML documentation (defaults to docdir)],
219  [AC_MSG_CHECKING([html dir])
220    HTML_DIR=$withval
221    if test -x $withval ; then
222      AC_SUBST(HTML_DIR)
223      AC_MSG_RESULT($withval)
224    else
225      AC_SUBST(HTML_DIR)
226      AC_MSG_WARN([Directory $withval does not exist and will be created])
227    fi
228  ],
229  [if test "x$BUILD_APIDOCS" = "xyes"; then
230     AC_MSG_NOTICE([Setting html dir to $datadir/doc/html])
231     HTML_DIR=$datadir/doc/html
232   fi
233   AC_SUBST(HTML_DIR)
234  ]
235 )
236
237 AC_ARG_ENABLE(perlconnect, 
238 [  --enable-perlconnect    enable JS engine perlconnect)])
239 if test x$enable_perlconnect = xyes; then
240   perlconnect_enabled=1
241 else
242   perlconnect_enabled=0
243 fi
244
245 AC_ARG_ENABLE(iconv-typecast,
246 [  --enable-iconv-typecast typecast the second parameter of iconv to char**])
247 if test x$enable_iconv_typecast = xyes; then
248   force_iconv_typecast=1
249 fi
250
251 AC_ARG_ENABLE(check-leaks,
252 [  --enable-check-leaks    enable memory leak checking (optional)])
253 if test x$enable_check_leaks = xyes; then
254   AC_DEFINE(CHECK_LEAKS, 1, [define whether to check for memory leaks])
255 fi
256
257 dnl dom
258 AC_ARG_ENABLE(dom,
259 [  --disable-dom           disable the DOM interface (smaller)],
260 __dom_given=1, __dom_given=0)
261
262 __has_dom=0
263 if test x$__dom_given = x1; then
264   if test x$enable_dom = xyes; then
265     AC_DEFINE(ENABLE_DOM, 1, [define if we want to publish the DOM interface])
266     __has_dom=1
267   else
268     AC_DEFINE(DISABLE_DOM, 1, 
269           [define if we want to supress the DOM interface (needed in sdom.h)])
270   fi
271 else
272   AC_DEFINE(ENABLE_DOM, 1, [define if we want to publish the DOM interface])
273   __has_dom=1
274 fi
275
276 dnl consitence check
277 if test x$enable_javascript = xyes -a x$__has_dom = x0; then
278    AC_MSG_ERROR(--disable-dom must not be specified with --enable-javascript)
279 fi
280
281
282
283 dnl ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
284 dnl end of initialization stuff
285 dnl --------------------------------------------------
286
287 dnl --------------------------------------------------
288 dnl miscellaneous - initial
289 dnl vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
290
291 dnl here we collect needed libraries
292 OTHER_LIBS=
293
294 AC_MSG_CHECKING(whether to build under GPL)
295 if test ! x$SABLOT_GPL = 'x'; then
296   AC_DEFINE(SABLOT_GPL, 1, [define if we want to build under GPL])
297   AC_MSG_RESULT(yes)
298 else
299   AC_MSG_RESULT(no)
300 fi
301
302 dnl debugger
303
304 AC_MSG_CHECKING(whether to build the debugger)
305 AC_ARG_ENABLE(debugger,
306 [  --enable-debugger       enable xslt debugger])
307 if test x$enable_debugger = xyes; then
308   AC_MSG_RESULT(yes)
309   AC_DEFINE(SABLOT_DEBUGGER, 1, [define if we want to build the debugger])
310   AC_ARG_WITH(readline, 
311               [  --with-readline         use the GNU readline in the debugger],
312               userl=1, userl=0)
313   if test x$userl = x1; then
314     if test x$SABLOT_GPL = 'x'; then
315       AC_MSG_ERROR(you must compile under GNU's GPL to use the debugger)
316     fi
317     AC_CHECK_LIB(ncurses, initscr, 
318                  [__rllib=-lncurses; OTHER_LIBS="$OTHER_LIBS -lncurses"],
319                  __rllib=)
320     __rl=1
321     AC_CHECK_LIB(readline, readline, [OTHER_LIBS="$OTHER_LIBS -lreadline"], 
322                  __rl=0, $__rllib)
323     AC_CHECK_HEADERS(readline/readline.h readline/history.h)
324   fi
325
326 dnl EMACS_SITE_LISP='undefined'
327 dnl AC_CHECK_PROG(has_emacs, emacs, yes, no)
328 dnl if test $has_emacs = yes; then
329 dnl    EMACS_SITE_LISP=`emacs --batch --load=emacs/config.el --funcall=find-path`
330 dnl fi
331 dnl AC_SUBST(EMACS_SITE_LISP)
332
333 else
334   AC_MSG_RESULT(no)
335 fi
336
337
338 dnl ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
339 dnl end of miscellaneous - initial
340 dnl --------------------------------------------------
341
342 dnl --------------------------------------------------
343 dnl Expat stuff - keep in sysc
344 dnl vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
345
346 dnl check for presence of the new Expat library
347 AC_MSG_CHECKING(where to find xml parser)
348 dnl steal the output descriptor
349 exec 6>/dev/null
350
351 AC_CHECK_LIB(expat, XML_Parse, [xmle=1; EXPAT_LIBS=-lexpat], xmle=0)
352
353 if test $xmle = 0; then 
354   AC_CHECK_LIB(xmlparse, XML_Parse, 
355               [xmlp=1; EXPAT_LIBS="EXPAT_LIBS=-lxmlparse -lxmltok"],
356               xmlp=0, -lxmltok)
357 fi
358
359 dnl return output descriptor
360 if test ! x$silent = xyes; then
361   exec 6>&1
362 fi
363
364 panic=0
365 if test $xmle = 1; then
366   resmsg='expat (new)'
367 elif $xmlp = 1; then
368   resmsg='expat (old)'
369 else
370   resmsg='not found (panic)'
371   panic=1
372 fi
373
374 AC_MSG_RESULT($resmsg);
375 if test $panic = 1; then
376   AC_MSG_ERROR(Couldn't find the expat libraries)
377 fi
378
379 dnl Expat headers location (according Linux distribution etc.)
380 dnl different headers for different library version required
381 if test $xmle = 1; then
382   AC_CHECK_HEADERS( expat.h, has_expat_headers=1, has_expat_headers=0 )
383 else
384   AC_CHECK_HEADERS( xmlparse.h xmltok/xmlparse.h, has_expat_headers=1, 
385                     has_expat_headers=0 )
386 fi
387
388 if test $has_expat_headers = 0; then
389   AC_MSG_ERROR(Couldn't find the expat header file(s))
390 fi
391
392 dnl check wheter expat.h can be included (1.95.6 is broken - bad bad boys)
393 AC_MSG_CHECKING(whether expat.h is broken)
394 AC_TRY_COMPILE([
395 #include <expat.h>
396 ],[
397 return 1;
398 ],[
399  AC_MSG_RESULT(no)
400 ],[
401  AC_MSG_RESULT(yes)
402  AC_MSG_ERROR([You probably have expat version 1.95.6. Please refer to:
403   http://sourceforge.net/tracker/index.php?func=detail&aid=676844&group_id=10127&atid=110127
404   for a description of the problem.])
405 ])
406  
407 dnl check XML_SetReturnNSTriplet
408 AC_CHECK_LIB(expat, XML_SetReturnNSTriplet, has_extrip=1, has_extrip=0)
409
410 if test $has_extrip = 1; then
411   AC_MSG_CHECKING(whether XML_SetReturnNSTriplet works)
412   save_libs=$LIBS
413   LIBS=-lexpat
414   AC_TRY_RUN([
415 #include <expat.h>
416 #include <string.h>
417 const char* xml = "<?xml version='1.0'?><a:b xmlns:a='http'/>";
418 int cnt = 0;
419 void tcStartElement(void *data, const char *elName, const char **atts)
420 {
421   const char *q = elName;
422   do {
423     q = strchr(q, '|');
424     if (q) { cnt++; q++; }
425   } while (q);
426 }
427 void tcEndElement(void *data, const char *elName) {}
428 int main (int argc, char* argv[])
429 {
430   XML_Parser theParser = XML_ParserCreateNS(NULL, '|');
431   XML_SetElementHandler(theParser, tcStartElement, tcEndElement);  
432   XML_SetReturnNSTriplet(theParser, 1);
433   XML_Parse(theParser, xml, strlen(xml), 1);
434   XML_ParserFree(theParser);
435   return cnt == 2 ? 0 : 1;
436 }], extrip_ok=1, extrip_ok=0, extrip_ok=0)
437
438   LIBS=$save_libs
439
440   if test $extrip_ok = 1; then
441     AC_MSG_RESULT(yes)
442     AC_DEFINE(EXPAT_SUPPORTS_TRIPLETS, 1, 
443               [define whether Expat supports (working) XML_SetReturnNSTriplet])
444   else
445     AC_MSG_RESULT(no)
446   fi
447 fi
448
449 dnl AC_SUBST(EXPAT_DIR)
450 AC_SUBST(EXPAT_LIBS)
451
452 dnl ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
453 dnl end of expat stuff
454 dnl --------------------------------------------------
455
456 dnl --------------------------------------------------
457 dnl headers, functions, libraries, keep in sync. state
458 dnl for easier maintenance - keep synchronized!!
459 dnl vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
460
461 AC_CHECK_HEADER( sys/types.h, sabcfg_types_h=1, sabcfg_types_h=0 )
462 dnl sabcfg_types_h=koko
463 AC_SUBST(sabcfg_types_h)
464
465 AC_CHECK_HEADERS( timeb.h sys/timeb.h sys/time.h \
466          unistd.h ieeefp.h sunmath.h )
467
468 dnl check wheter iconv is the part of libc.
469 AC_CHECK_HEADERS( iconv.h, has_iconv=1,  has_iconv=0)
470
471 dnl if we have iconv library, we have to decide if it 
472 dnl is present in libc
473
474 ICONV_LIB=
475 if test $has_iconv = 1; then
476   AC_MSG_CHECKING(where to find iconv_open)
477   exec 6>/dev/null
478   AC_CHECK_FUNCS(iconv_open, iconv_in_libc=1, iconv_in_libc=0)
479   AC_CHECK_LIB(iconv, iconv_open, iconv_in_iconv=1, iconv_in_iconv=0)
480   AC_CHECK_LIB(iconv, libiconv_open, libiconv_in_iconv=1, libiconv_in_iconv=0)
481   if test ! x$silent = xyes; then
482     exec 6>&1
483   fi
484   #standalone library rules over libc
485   if test $iconv_in_iconv = 1 -o $libiconv_in_iconv = 1; then
486     AC_MSG_RESULT(libiconv)
487     ICONV_LIB=-liconv
488   elif test $iconv_in_libc = 1; then
489     AC_MSG_RESULT(libc)
490   else
491     AC_MSG_RESULT(not found (panic))
492     AC_MSG_ERROR([iconv.h found, while iconv library not found])
493   fi
494   #we have iconv at this moment, so we'll check out the need of
495   #typecast in the call of iconv
496   AC_MSG_CHECKING(whether to typecast in iconv)
497   if test x$force_iconv_typecast = x1; then
498     AC_MSG_RESULT(forced)
499     AC_DEFINE(SABLOT_ICONV_CAST_OK, 1, 
500               [define whether second param of iconv has to be typecasted])
501   else
502     AC_TRY_COMPILE([#include <iconv.h>],[
503                    {  
504                       const char *src = "nothing";
505                       char *outbuf;
506                       size_t insize = 0;
507                       size_t outsize = 0;
508                       iconv_t cd;
509                       iconv(cd, &src, &insize, &outbuf, &outsize);
510                    }], 
511                    iconv_cast=0, iconv_cast=1)
512     if test $iconv_cast = 1; then
513       AC_MSG_RESULT(yes)
514       AC_DEFINE(SABLOT_ICONV_CAST_OK, 1, 
515                 [define whether second param of iconv has to be typecasted])
516     else
517       AC_MSG_RESULT(no)
518     fi
519   fi
520 fi
521 AC_SUBST(ICONV_LIB)
522
523 dnl check for the need of -lm library spec.
524 AC_MSG_CHECKING(whether to force -lm switch)
525 AC_TRY_LINK([#include <math.h>], 
526             { double foo; foo = ceil(1.234); },
527             link_libm=0, link_libm=1)
528 if test $link_libm = 1; then
529   AC_MSG_RESULT(yes)
530   OTHER_LIBS="$OTHER_LIBS -lm"
531 else
532   AC_MSG_RESULT(no)
533 fi
534
535 dnl javascript stuff
536 if test $js_enabled = 1; then
537   dnl get default libname
538   if test x$SABLOT_JSLIB = x; then
539     SABLOT_JSLIB=js
540   fi
541   dnl check library and header
542   dnl we have to specify perl libraries for Charlie
543   dnl PERLCFLAGS := $(shell perl -MExtUtils::Embed -e ccopts)
544   if test $perlconnect_enabled = 1; then
545     AC_CHECK_PROG(has_perl, perl, yes, no)
546     if test $has_perl = yes; then
547       PERLLDFLAGS=`perl -MExtUtils::Embed -e ldopts`
548       dnl perl erroneously reports compiler flag -rdynamic (interpreted by ld
549       dnl as -r) when it really meant -export-dynamic.
550       PERLLDFLAGS=`echo $PERLLDFLAGS | perl -pe 's/-rdynamic/-export-dynamic/'`
551     fi
552   else
553     PERLLDFLAGS=
554   fi
555
556   AC_CHECK_LIB($SABLOT_JSLIB, js_NewContext, 
557                [has_js=1; OTHER_LIBS="$OTHER_LIBS -l$SABLOT_JSLIB $PERLLDFLAGS"], 
558                has_js=0, $PERLLDFLAGS)
559   if test $has_js = 1; then
560     echo '#define XP_UNIX' >> confdefs.h
561     AC_CHECK_HEADERS( jsapi.h, has_js_header=1, has_js_header=0 )
562     if test $has_js_header = 0; then
563       AC_MSG_ERROR(required file jsapi.h not found)
564     fi
565   else
566     AC_MSG_ERROR(JavaScript library not found)
567   fi
568 fi
569
570 dnl check for the presence of miscellaneous functions
571 AC_CHECK_FUNCS( ftime gettimeofday , break )
572 AC_CHECK_FUNCS( mtrace )
573
574 dnl I/O operations
575 AC_CHECK_FUNCS( setvbuf )
576
577 dnl check for isnan etc...in the std. way and try link if not found
578 dnl this is due HPUX, where isnan & Co. are defined as macros
579
580 AC_CHECK_FUNC( isnan, [has_isnan=1; AC_DEFINE(HAVE_ISNAN, 1, isnan)], has_isnan=0)
581 AC_CHECK_FUNC( isinf, [has_isinf=1; AC_DEFINE(HAVE_ISINF, 1, isinf)], has_isinf=0)
582 AC_CHECK_FUNC( finite,[has_finite=1;AC_DEFINE(HAVE_FINITE, 1, finite)], has_finite=0)
583
584 dnl check for macro isnan in math
585 if test $has_isnan = 0; then
586   AC_MSG_CHECKING(for macro isnan)
587   AC_TRY_LINK( [#include <math.h>],  { int foo; foo = isnan(0); }, 
588               has_isnan=1, has_isnan=0 )
589   if test $has_isnan = 1; then
590     AC_MSG_RESULT(yes)
591     AC_DEFINE(HAVE_ISNAN, 1, isnan)
592   else
593     AC_MSG_RESULT(no)
594   fi
595 fi
596
597 dnl check for macro isinf in math
598 if test $has_isinf = 0; then
599   AC_MSG_CHECKING(for macro isinf)
600   AC_TRY_LINK( [#include <math.h>],  { int foo; foo = isinf(0); }, 
601               has_isinf=1, has_isinf=0 )
602   if test $has_isinf = 1; then
603     AC_MSG_RESULT(yes)
604     AC_DEFINE(HAVE_ISINF, 1, isinf)
605   else
606     AC_MSG_RESULT(no)
607   fi
608 fi
609
610 dnl check for macro finite in math
611 if test $has_finite = 0; then
612   AC_MSG_CHECKING(for macro finite)
613   AC_TRY_LINK( [#include <math.h>],  { int foo; foo = finite(0); }, 
614               has_finite=1, has_finite=0 )
615   if test $has_finite = 1; then
616     AC_MSG_RESULT(yes)
617     AC_DEFINE(HAVE_FINITE, 1, finite)
618   else
619     AC_MSG_RESULT(no)
620   fi
621 fi
622
623 dnl wchar.h (not present on FreeBSD)
624 AC_CHECK_HEADER( wchar.h, has_wchar=1, has_wchar=0)
625
626 if test $has_wchar = 1; then
627   AC_DEFINE(HAVE_WCHAR_H, 1, [define if you have wchar.h header])
628   AC_CHECK_FUNCS( wcsxfrm wcscmp )
629 fi
630
631 dnl if test $has_wchar = 0; then
632 dnl   AC_MSG_ERROR(The header <wchar.h> not found. This problem occurs on
633 dnl certain platforms (e.g. FreeBSD). Please check your system configuration.)
634 dnl fi
635
636 AC_SUBST(OTHER_LIBS)
637
638 dnl ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
639 dnl end of headers etc.
640 dnl --------------------------------------------------
641
642 dnl --------------------------------------------------
643 dnl output files
644 dnl vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
645
646 AC_OUTPUT( src/engine/sabcfg.h 
647            Makefile src/Makefile src/engine/Makefile 
648            src/command/Makefile src/command/sablot-config
649            doc/Makefile doc/man/Makefile doc/misc/Makefile 
650            doc/apidoc/Makefile utils/Makefile 
651            utils/apidoc/Makefile )
652 dnl emacs/Makefile )
653
654 dnl ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
655 dnl end of output files
656 dnl --------------------------------------------------
657
658 dnl --------------------------------------------------
659 dnl notices and messages
660 dnl vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
661
662 if test $has_wchar = 0; then
663   AC_MSG_WARN([Your system doesn't support standard widechar library (wchar.h), result of the <xsl:sort> instruction may be undefined])
664 fi
665
666 dnl ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
667 dnl end of file
668 dnl --------------------------------------------------
669
670 dnl vim600: ts=2 sw=2 et nocin nosi