Made doc paper size configure'able.
[grace.git] / ac-tools / configure.in
blobc26dafa548d7ba7f6006e53c2d494fe3c9df5818
1 dnl **** Process this file with autoconf to produce a configure script.
3 AC_PREREQ(2.57)
5 AC_INIT(src/main.c)
6 AC_CONFIG_AUX_DIR(ac-tools)
8 AC_CONFIG_HEADER(include/config.h:ac-tools/config.h.in)
10 AC_PREFIX_DEFAULT("/usr/local")
12 builtin(include, ac-tools/aclocal.m4)
14 AC_SUBST(EXEEXT)
15 AC_SUBST(OBJEXT)
16 AC_SUBST(BATEXT)
18 AC_SUBST(MKINSTALLDIRS)
20 AC_SUBST(GRACE)
21 AC_SUBST(GRACE_HOME)
22 AC_SUBST(GUI_FLAGS)
23 AC_SUBST(FC)
24 AC_SUBST(GUI_LIBS)
25 AC_SUBST(NOGUI_LIBS)
26 AC_SUBST(NETCDF_LIBS)
27 AC_SUBST(XDR_LIB)
28 AC_SUBST(DL_LIB)
29 AC_SUBST(T1_LIB)
30 AC_SUBST(T1_INC)
31 AC_SUBST(EXPAT_LIB)
32 AC_SUBST(EXPAT_INC)
33 AC_SUBST(FFTW_LIB)
34 AC_SUBST(Z_LIB)
35 AC_SUBST(JPEG_LIB)
36 AC_SUBST(PNG_LIB)
37 AC_SUBST(PDF_LIB)
38 AC_SUBST(GRACE_EDITOR)
39 AC_SUBST(XBAE_INC)
40 AC_SUBST(HELPVIEWER)
41 AC_SUBST(SUBDIRS)
43 AC_SUBST(PAPERSIZE)
45 AC_SUBST(PRINT_CMD)
47 AC_SUBST(MAJOR_REV)
48 AC_SUBST(MINOR_REV)
49 AC_SUBST(PATCHLEVEL)
50 AC_SUBST(BETA_VER)
51 AC_SUBST(PROG_SUFFIX)
53 dnl **** Those are for T1lib
55 AC_SUBST(T1_AA_TYPE16)
56 AC_SUBST(T1_AA_TYPE32)
57 AC_SUBST(T1_AA_TYPE64)
59 dnl **** Grace version numbers
60 MAJOR_REV=5
61 MINOR_REV=99
62 PATCHLEVEL=0
63 BETA_VER="rc3"
65 VERSTRING=${MAJOR_REV}.${MINOR_REV}.${PATCHLEVEL}
66 if test "x${program_suffix}" = "xNONE"
67 then
68     PROG_SUFFIX="-$VERSTRING"
69 else
70     PROG_SUFFIX=${program_suffix}
73 dnl **** define home dir of Grace
74 if test "x${prefix}" = "xNONE"
75 then
76   GRACE_HOME=${ac_default_prefix}/grace-$VERSTRING
77 else
78   GRACE_HOME=${prefix}/grace
80 AC_ARG_ENABLE(grace-home,
81 [  --enable-grace-home=DIR      define Grace home dir [[PREFIX/grace-x.y.z]]],
82 [GRACE_HOME="${enableval}"])
85 dnl **** option to define config file overriding autodetect
86 AC_ARG_ENABLE(config,
87 [  --enable-config=FILE         define configuration FILE to override
88                                autodetection (not recommended!)],
89                              [CONF_FILE="${enableval}"])
91 dnl **** define C compiler
92 CC=${CC-gcc}
93 AC_ARG_WITH(cc,
94 [  --with-cc=PROG               use PROG as C compiler [${CC-gcc}]],
95 [CC="${withval}"])
97 dnl **** define Fortran compiler
98 FC=${FC-f77}
99 AC_ARG_WITH(f77,
100 [  --with-f77=PROG              use PROG as Fortran compiler [${FC-f77}]],
101 [FC="${withval}"])
103 dnl Chance to add include path
104 AC_ARG_WITH(extra-incpath,
105 [  --with-extra-incpath=PATH    define extra include path (dir1:dir2:...) [[none]]],
106 [CPPFLAGS="${CPPFLAGS} -I`echo ${withval}|sed 's/:/\ -I/g'`"])
108 dnl ... and ld path
109 AC_ARG_WITH(extra-ldpath,
110 [  --with-extra-ldpath=PATH     define extra ld path (dir1:dir2:...) [[none]]],
111 [LDFLAGS="-L`echo ${withval}|sed 's/:/\ -L/g'` ${LDFLAGS}";
112   case "${host}" in
113     sparc-sun-solaris*) LDFLAGS="-R:${withval} ${LDFLAGS}";;
114   esac
117 dnl **** use bundled T1lib  
118 AC_ARG_WITH(bundled_t1lib,
119 [  --with-bundled-t1lib         use bundled T1lib [[no]]],
120 [case "${withval}" in
121   yes) bundled_t1lib=true ;;
122   no)  bundled_t1lib=false;;
123   *) AC_MSG_ERROR(bad value ${withval} for --with-bundled-t1lib) ;;
124 esac],[bundled_t1lib=false])
126 dnl **** use bundled Expat  
127 AC_ARG_WITH(bundled_expat,
128 [  --with-bundled-expat         use bundled Expat [[no]]],
129 [case "${withval}" in
130   yes) bundled_expat=true ;;
131   no)  bundled_expat=false;;
132   *) AC_MSG_ERROR(bad value ${withval} for --with-bundled-expat) ;;
133 esac],[bundled_expat=false])
135 dnl **** use bundled Xbae  
136 AC_ARG_WITH(bundled_xbae,
137 [  --with-bundled-xbae          use bundled Xbae [[yes]]],
138 [case "${withval}" in
139   yes) bundled_xbae=true ;;
140   no)  bundled_xbae=false;;
141   *) AC_MSG_ERROR(bad value ${withval} for --with-bundled-xbae) ;;
142 esac],[bundled_xbae=true])
144 dnl **** use netcdf  
145 AC_ARG_ENABLE(netcdf,
146 [  --enable-netcdf              enable support for netCDF [[yes]]],
147 [case "${enableval}" in
148   yes) netcdf=true ;;
149   no)  netcdf=false;;
150   *) AC_MSG_ERROR(bad value ${enableval} for --enable-netcdf) ;;
151 esac],[netcdf=true])
153 dnl **** use FFTW
154 AC_ARG_WITH(fftw,
155 [  --with-fftw                  use FFTW library for Fourier transforms [[yes]]],
156 [case "${withval}" in
157   yes) fftw=true ;;
158   no)  fftw=false;;
159   *) AC_MSG_ERROR(bad value ${withval} for --with-fftw) ;;
160 esac],[fftw=true])
162 dnl **** whether to build JPEG driver
163 AC_ARG_ENABLE(jpegdrv,
164 [  --enable-jpegdrv             build JPEG driver [[yes]]],
165 [case "${enableval}" in
166   yes) jpegdrv=true ;;
167   no)  jpegdrv=false;;
168   *) AC_MSG_ERROR(bad value ${enableval} for --enable-jpegdrv) ;;
169 esac],[jpegdrv=true])
171 dnl **** whether to build PNG driver
172 AC_ARG_ENABLE(pngdrv,
173 [  --enable-pngdrv              build PNG driver [[yes]]],
174 [case "${enableval}" in
175   yes) pngdrv=true ;;
176   no)  pngdrv=false;;
177   *) AC_MSG_ERROR(bad value ${enableval} for --enable-pngdrv) ;;
178 esac],[pngdrv=true])
180 dnl **** whether to build PDF driver
181 AC_ARG_ENABLE(pdfdrv,
182 [  --enable-pdfdrv              build PDF driver [[yes]]],
183 [case "${enableval}" in
184   yes) pdfdrv=true ;;
185   no)  pdfdrv=false;;
186   *) AC_MSG_ERROR(bad value ${enableval} for --enable-pdfdrv) ;;
187 esac],[pdfdrv=true])
189 dnl **** use editres  
190 AC_ARG_ENABLE(editres,
191 [  --enable-editres             enable editres support [[yes]]],
192 [case "${enableval}" in
193   yes) editres=true ;;
194   no)  editres=false;;
195   *) AC_MSG_ERROR(bad value ${enableval} for --enable-editres) ;;
196 esac],[editres=true])
198 dnl **** use XmHTML
199 AC_ARG_ENABLE(xmhtml,
200 [  --enable-xmhtml              use XmHTML widget for on-line help [[yes]]],
201 [case "${enableval}" in
202   yes) xmhtml=true ;;
203   no)  xmhtml=false;;
204   *) AC_MSG_ERROR(bad value ${enableval} for --enable-xmhtml) ;;
205 esac],[xmhtml=true])
207 dnl **** define editor
208 GRACE_EDITOR="'xterm -e vi'"
209 AC_ARG_WITH(editor,
210 [  --with-editor=COMMAND        define editor [[\"xterm -e vi\"]]],
211 [GRACE_EDITOR="'${withval}'"])
213 dnl **** define help viewer
214 AC_ARG_WITH(helpviewer,
215 [  --with-helpviewer=COMMAND    define (alternative) help viewer command],
216 [HELPVIEWER="-DGRACE_HELPVIEWER=${withval}"])
218 dnl **** define print command
219 AC_ARG_WITH(printcmd,
220 [  --with-printcmd=PROG         use PROG for printing],
221 [if test "x${withval}" != "x"; then
222     PRINT_CMD="'${withval}'"
223  else
224     PRINT_CMD=NONE
225  fi],
226 [PRINT_CMD=NONE]
229 dnl **** default papersize  
230 AC_ARG_ENABLE(papersize,
231 [  --enable-papersize=PAPER     select paper size for docs (a4 or letter) [[a4]]],
232 [case "${enableval}" in
233   a4)     PAPERSIZE=a4    ;;
234   letter) PAPERSIZE=letter;;
235   *) AC_MSG_ERROR(bad value ${enableval} for --enable-papersize) ;;
236 esac],[PAPERSIZE=a4])
238 dnl **** check if user wants to compile with debugging support
239 AC_ARG_ENABLE(debug,
240 [  --enable-debug               turn on support for debugging [[no]]],
241 [case "${enableval}" in
242   yes) debug=true ;;
243   no)  debug=false ;;
244   *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
245 esac],[debug=false])
247 dnl **** maintainer mode
248 AC_ARG_ENABLE(maintainer,
249 [  --enable-maintainer          enable maintainer's mode [[no]]],
250 [case "${enableval}" in
251   yes) maintainer=true; debug=true ;;
252   no)  maintainer=false ;;
253   *) AC_MSG_ERROR(bad value ${enableval} for --enable-maintainer) ;;
254 esac],[maintainer=false])
256 if test $maintainer = true
257 then
258   AC_DEFINE(WITH_DEBUG)
262 dnl **** Possibility to override defaults
263 if test "x$CONF_FILE" != "x"
264 then
265   if test -r $CONF_FILE
266   then
267     AC_MSG_RESULT(--> using \`$CONF_FILE' as config file)
268     . $CONF_FILE
269   else
270     AC_MSG_ERROR(--> Can't open file \`$CONF_FILE' for reading!)
271     exit 1
272   fi
273 else
274   dnl **** Define CFLAGS etc empty to prevent configure from setting them
275   CFLAGS=${CFLAGS-""}
276   FFLAGS=${FFLAGS-""}
277   LDFLAGS=${LDFLAGS-""}
278   OPTIMIZE=${OPTIMIZE-""}
279   DEBUG=${DEBUG-""}
282 dnl **** Check for host type
283 AC_CANONICAL_HOST
285 dnl Checks for C compiler
286 AC_PROG_CC
288 AC_ISC_POSIX
289 AC_AIX
290 AC_MINIX
292 if test "x${CFLAGS}" = "x"
293 then
294   if test "x${GCC}" = "xyes"
295   then
296     dnl **** default settings for gcc
297     DEBUG="-g -O2"
298     OPTIMIZE="-O2"
299     CFLAGS="-fno-common -Wall -pedantic -Wpointer-arith -Wnested-externs"
301     dnl **** check for strength-reduce bug
302     ACX_GCC_STRENGTH_REDUCE(CFLAGS="$CFLAGS -fno-strength-reduce")
304     dnl **** some arch-specific optimizations/settings for gcc
305     case "${host}" in
306       i486-*) CPU_FLAGS="-m486";;
307       i586-*) ACX_CHECK_CC_FLAGS(-mcpu=pentium,cpu_pentium,
308                  [CPU_FLAGS=-mcpu=pentium],
309                  [ACX_CHECK_CC_FLAGS(-mpentium,pentium,
310                          [CPU_FLAGS=-mpentium], [CPU_FLAGS=-m486])])
311               ;;
312       i686-*) ACX_CHECK_CC_FLAGS(-mcpu=pentiumpro,cpu_pentiumpro,
313                  [CPU_FLAGS=-mcpu=pentiumpro],
314                  [ACX_CHECK_CC_FLAGS(-mpentiumpro,pentiumpro,
315                          [CPU_FLAGS=-mpentiumpro], [CPU_FLAGS=-m486])])
316               ;;
317     esac
319     CFLAGS="$CPU_FLAGS $CFLAGS"
320   else
321     case "${host}" in
322       alpha*-dec-osf4.*)
323         CFLAGS="-std1 -w0"
324         OPTIMIZE="-O2"
325         DEBUG="-g3 -O2"
326         ;;
327       hppa*-hp-hpux*)
328         CFLAGS="-Aa -D_HPUX_SOURCE"
329         OPTIMIZE="-O"
330         DEBUG="-g -O"
331         ;;
332       mips-sgi-irix6.[[4-9]]*)
333         CFLAGS="-w"
334         OPTIMIZE="-O2 -OPT:Olimit=0"
335         DEBUG="-g3 -O2 -OPT:Olimit=0"
336         ;;
337       mips-sgi-irix*)
338         CFLAGS="-fullwarn -woff 835"
339         OPTIMIZE="-O2 -Olimit 3500"
340         ;;
341       rs6000-ibm-aix*)
342         CFLAGS="-D_ALL_SOURCE"
343         OPTIMIZE="-O2"
344         DEBUG="-g -O2"
345         ;;
346       *)
347         CFLAGS=""
348         OPTIMIZE="-O"
349         DEBUG="-g"
350         ;;
351     esac
352   fi
355 case $debug in
356   true) CFLAGS="$DEBUG $CFLAGS";;
357   *) CFLAGS="$OPTIMIZE $CFLAGS";;
358 esac
360 case $FC in
361   /*|../*|./*)
362      if test ! -x $FC; then
363        FC=no
364      fi
365      ;;
366   *) AC_CHECK_PROG(fc, $FC, $FC, no)
367      FC=$ac_cv_prog_fc
368      ;;
369 esac
371 if test "${FC}" = "no"
372 then
373   AC_MSG_RESULT(--> Fortran tests won't be compiled)
374   FC=:
377 dnl **** Check for some compiler/system characteristics
378 AC_C_CHAR_UNSIGNED
379 AC_CHECK_SIZEOF(char,0)
380 AC_CHECK_SIZEOF(short,0)
381 AC_CHECK_SIZEOF(int,0)
382 AC_CHECK_SIZEOF(long,0)
383 AC_CHECK_SIZEOF(long long,0)
384 AC_CHECK_SIZEOF(float,0)
385 AC_CHECK_SIZEOF(double,0)
386 AC_CHECK_SIZEOF(long double,0)
387 AC_CHECK_SIZEOF(void *,0)
389 dnl **** Check for endianess
390 AC_C_BIGENDIAN
392 dnl **** Checks for FPU arithmetics
393 ACX_CHECK_FPU
395 dnl **** .exe/.obj file extensions
396 AC_EXEEXT
397 AC_OBJEXT
399 OBJEXT=".$OBJEXT"
401 AC_PROG_MAKE_SET
403 dnl **** Checks for programs.
404 AC_CHECK_PROG(AR, ar, ar, NONE)
405 if test "$AR" = "NONE"; then
406   AC_MSG_ERROR(--> Can't find \`ar'!)
407   AC_CACHE_SAVE
408   exit 1
411 AC_PROG_RANLIB
412 AC_PROG_LN_S
413 AC_PROG_YACC
415 AC_PROG_INSTALL
416 case "x$INSTALL" in
417    x/*) ;;
418    *) INSTALL=`pwd`/ac-tools/"shtool install -c" ;
419 esac
421 MKINSTALLDIRS=`pwd`/ac-tools/"shtool mkdir -p -f"
423 if test "x$PRINT_CMD" = "xNONE"; then
424   AC_CHECK_PROG(LP_CMD, lp, 'lp -c', "NONE")
425   if test "${ac_cv_prog_LP_CMD}" = "NONE"; then
426     AC_CHECK_PROG(LPR_CMD, lpr, 'lpr', "NONE")
427     if test "${ac_cv_prog_LPR_CMD}" = "NONE"; then
428       PRINT_CMD=
429     else
430       PRINT_CMD="${ac_cv_prog_LPR_CMD}"
431     fi
432   else
433     PRINT_CMD="${ac_cv_prog_LP_CMD}"
434   fi
437 AC_MSG_RESULT(--> Using \"$PRINT_CMD\" to print)
439 dnl **** Checks for header files.
440 AC_HEADER_STDC
441 AC_HEADER_SYS_WAIT
442 AC_CHECK_HEADERS(unistd.h fcntl.h)
443 AC_CHECK_HEADERS(sys/param.h sys/time.h sys/select.h)
444 AC_HEADER_TIME
445 dnl **** math.h and related
446 AC_CHECK_HEADERS(math.h float.h ieeefp.h)
448 dnl **** Checks for typedefs, structures, and compiler characteristics.
449 AC_C_CONST
450 AC_TYPE_PID_T
451 AC_TYPE_SIZE_T
452 AC_STRUCT_TM
454 dnl **** Checks for library functions.
455 AC_TYPE_SIGNAL
456 AC_FUNC_ALLOCA
457 AC_CHECK_FUNCS(getcwd gethostname)
458 AC_CHECK_FUNCS(strstr)
459 AC_CHECK_FUNCS(memcpy memmove bcopy)
460 AC_CHECK_FUNCS(unlink fcntl)
461 AC_CHECK_FUNCS(popen)
462 AC_CHECK_FUNCS(gettimeofday)
463 AC_CHECK_FUNCS(fnmatch)
464 AC_CHECK_FUNCS(vsnprintf)
465 AC_CHECK_FUNCS(on_exit)
466 AC_CHECK_FUNCS(strerror)
467 if test "$ac_cv_func_strerror" = no; then
468   AC_CACHE_CHECK([for sys_errlist declaration in stdio.h], ac_cv_sys_errlist_decl,
469       AC_EGREP_HEADER(sys_errlist, stdio.h, ac_cv_sys_errlist_decl="yes",
470       ac_cv_sys_errlist_decl="no"))
471   if test "$ac_cv_sys_errlist_decl" = yes; then
472     AC_DEFINE(HAVE_SYS_ERRLIST_DECL)
473   fi
476 ICE_CHECK_DECL(drand48, stdlib.h)
478 dnl **** Check for locale
479 AC_CHECK_FUNCS(setlocale)
481 dnl **** Check for buggy realloc()
482 ACX_CHECK_REALLOC(AC_DEFINE(REALLOC_IS_BUGGY))
484 dnl **** Checks for libm
485 AC_CHECK_LIB(m, sin)
487 dnl **** Those functions are usually found in libm but...
488 ICE_CHECK_DECL(hypot, math.h)
489 ICE_CHECK_DECL(rint, math.h)
490 ICE_CHECK_DECL(cbrt, math.h)
491 ICE_CHECK_DECL(log2, math.h)
492 ICE_CHECK_DECL(asinh, math.h)
493 ICE_CHECK_DECL(acosh, math.h)
494 ICE_CHECK_DECL(atanh, math.h)
495 ICE_CHECK_DECL(lgamma, math.h)
497 dnl **** The machten4 (unix for mac) system does have signgam in libm
498 dnl **** but it is not declared in <math.h>
499 if test "$ac_cv_func_lgamma" = yes; then
500   AC_CACHE_CHECK([for signgam declaration in math.h], ac_cv_signgam_decl,
501       AC_EGREP_HEADER(signgam, math.h, ac_cv_signgam_decl="yes",
502       ac_cv_signgam_decl="no"))
503   if test "$ac_cv_signgam_decl" = yes; then
504     AC_DEFINE(HAVE_SIGNGAM_DECL)
505   fi
508 ICE_CHECK_DECL(erf, math.h)
509 ICE_CHECK_DECL(erfc, math.h)
510 ICE_CHECK_DECL(j0, math.h)
511 ICE_CHECK_DECL(j1, math.h)
512 ICE_CHECK_DECL(jn, math.h)
513 ICE_CHECK_DECL(y0, math.h)
514 ICE_CHECK_DECL(y1, math.h)
515 ICE_CHECK_DECL(yn, math.h)
516 ICE_CHECK_DECL(finite, math.h)
517 dnl **** C9X-compatible isfinite() may be a good replacement for finite()
518 if test "$ac_cv_lib_m_finite" != yes; then
519   ICE_CHECK_DECL(isfinite, math.h)
521 ICE_CHECK_DECL(isnan, math.h)
523 dnl **** Check for T1lib installed
524 if test $bundled_t1lib = false
525 then
526   ACX_CHECK_T1LIB(5.0.2, AC_DEFINE(HAVE_LIBT1), bundled_t1lib=true)
529 if test $bundled_t1lib = true
530 then
531   dnl **** Use the bundled T1lib
533   AC_MSG_RESULT(--> Bundled version of T1lib will be used)
535   T1_LIB='$(TOP)/T1lib/libt1.a'
536   T1_INC='-I$(TOP)/T1lib/t1lib'
537   t1lib_dir="T1lib"
539   dnl **** Check ANSI types
540   ACX_ANSI_TYPES
541 else
542   AC_MSG_RESULT(--> Good. Seems you have compatible version of T1lib installed)
545 dnl **** Check for Expat installed
546 if test $bundled_expat = false
547 then
548   ACX_CHECK_EXPAT(1.95.7, AC_DEFINE(HAVE_EXPAT), bundled_expat=true)
551 if test $bundled_expat = true
552 then
553   dnl **** Use the bundled Expat
555   AC_MSG_RESULT(--> Bundled version of Expat will be used)
557   EXPAT_LIB='$(TOP)/expat/libexpat.a'
558   EXPAT_INC='-I$(TOP)/expat'
559   expat_dir="expat"
560 else
561   AC_MSG_RESULT(--> Good. Seems you have compatible version of Expat installed)
564 dnl **** Check for XDR
565 mdw_CHECK_MANYLIBS(xdrstdio_create, nsl rpc xdr rpclib, XDR_LIB=$mdw_cv_lib_xdrstdio_create, XDR_LIB="NONE")
567 if test "${XDR_LIB}" = "NONE"; then
568   XDR_LIB=
569   AC_MSG_RESULT(--> No XDR library found; grconvert will not be built)
570 else
571   grconvert_dir="grconvert"
574 dnl **** Check for dlopen() interface
575 dnl           (Linux, SunOS-[4,5], OSF, IRIX, AIX-4, UnixWare, ...)
576 mdw_CHECK_MANYLIBS(dlopen, dl, [DL_LIB=$mdw_cv_lib_dlopen; AC_DEFINE(HAVE_DLOPEN)], DL_LIB="NONE")
578 if test "${DL_LIB}" != "NONE"; then
579   dnl **** Old implementations of dlopen() don't have RTLD_NOW
580   AC_CACHE_CHECK([whether RTLD_NOW is defined in dlfcn.h], ac_rtld_now_in_dlfcn_h,  
581     AC_EGREP_CPP(yes,
582         [#include <dlfcn.h>
583          #ifdef RTLD_NOW
584             yes
585          #endif
586         ], ac_rtld_now_in_dlfcn_h="yes"; AC_DEFINE(HAVE_RTLD_NOW),
587            ac_rtld_now_in_dlfcn_h="no")
588   )
589 else
590   dnl **** Check for shl_load() interface (HP/UX)
591   mdw_CHECK_MANYLIBS(shl_load, dld, [DL_LIB=$mdw_cv_lib_shl_load; AC_DEFINE(HAVE_SHL_LOAD)], DL_LIB="NONE")
594 if test "${DL_LIB}" = "NONE"; then
595   AC_MSG_RESULT(--> Support for dll modules will not be compiled)
596   DL_LIB=""
599 if test $netcdf = true
600 then
601   ACX_CHECK_NETCDF(3.0, AC_DEFINE(HAVE_NETCDF),
602                    AC_MSG_RESULT(--> support for netCDF is disabled))
605 if test $fftw = true
606 then
607   ACX_CHECK_FFTW(2.1.3, AC_DEFINE(HAVE_FFTW),
608                  AC_MSG_RESULT(--> using legacy unoptimized FFT code))
611 dnl **** check for libz - needed for PDF and PNG drivers and XmHTML
612 if test $pngdrv = true || test $pdfdrv = true || test $xmhtml = true
613 then
614   ACX_CHECK_ZLIB(1.0.3)
617 dnl **** check for libxmi - needed for all raster drivers
618 ACX_CHECK_XMI(1.2, , jpegdrv=false;pngdrv=false;
619     AC_MSG_RESULT(--> all raster drivers are disabled))
621 dnl **** check for IJG's libjpeg - also, for PDF driver and XmHTML
622 if test $jpegdrv = true || test $pdfdrv = true || test $xmhtml = true
623 then
624   ACX_CHECK_JPEG(61, AC_DEFINE(HAVE_LIBJPEG),
625                      AC_MSG_RESULT(--> JPEG backend is disabled))
628 dnl **** check for libpng - needed for PDF and PNG drivers and XmHTML
629 if test $pngdrv = true || test $pdfdrv = true || test $xmhtml = true
630 then
631   ACX_CHECK_PNG(0.9.6, AC_DEFINE(HAVE_LIBPNG),
632                        AC_MSG_RESULT(--> PNG backend is disabled))
635 dnl **** check for PDFlib
636 if test $pdfdrv = true
637 then
638   ACX_CHECK_PDFLIB(6.0.0, AC_DEFINE(HAVE_LIBPDF), pdfdrv=false)
640 if test $pdfdrv != true; then
641   AC_MSG_RESULT(--> PDF driver is disabled)
644 dnl **** TODO: undefine unneeded libraries
646 NOGUI_LIBS="$LIBS"
648 dnl **** Choose a GUI *****
650 dnl **** default is gui-less
651 GRACE=grace
653 AC_PATH_XTRA
654 if test "$no_x" = yes; then
655   GUI="NONE_GUI"
656 else
657 dnl **** Check for Motif
658   GUI_LIBS="-lXt -lXext -lX11 $X_PRE_LIBS $X_EXTRA_LIBS"
660   ACX_SAVE_STATE
661   
662   LIBS="$GUI_LIBS"
663   CFLAGS="$X_CFLAGS $CFLAGS"
664   CPPFLAGS="$X_CFLAGS $CPPFLAGS"
665   LDFLAGS="$X_LIBS $LDFLAGS"
666   
667   dnl **** use editres  
668   case $editres in
669     true) AC_CHECK_LIB(Xmu,_XEditResCheckMessages,GUI_LIBS="-lXmu $GUI_LIBS"; AC_DEFINE(WITH_EDITRES));;
670     *) ;;
671   esac
672   
673   if test "$ac_cv_lib_Xmu__XEditResCheckMessages" != yes; then
674     AC_MSG_RESULT(--> support for EditRes protocol is disabled)
675   fi
677   dnl **** some Motif-2.1 variants need the -lXp library
678   AC_CHECK_LIB(Xp,main,GUI_LIBS="-lXp $GUI_LIBS")
680   ACX_RESTORE_STATE
682   dnl **** check for Xpm lib
683   ACX_CHECK_XPM(30411, GUI_LIBS="$XPM_LIB $GUI_LIBS"; AC_DEFINE(HAVE_XPM),AC_MSG_ERROR(Xpm lib has not been found))
685   ACX_CHECK_MOTIF(1002)
686   if test "$acx_cv_motif" = "no"; then
687     dnl **** only Motif GUI is supported by now:
688     GUI="NONE_GUI"
689     GUI_FLAGS=""
690     GUI_LIBS=""
691     AC_MSG_ERROR(M*tif has not been found)
692   else
693     GUI_LIBS="$MOTIF_LIB $GUI_LIBS"
694     GUI="MOTIF_GUI"
695     GUI_FLAGS="$X_CFLAGS"
696     GRACE=xmgrace
698     dnl **** Special Motif checks
699     xsave_CPPFLAGS="$CPPFLAGS"
700     xsave_LIBS="$LIBS"
701     CPPFLAGS="$CPPFLAGS $GUI_FLAGS"
702     LIBS="$X_LIBS $GUI_LIBS $LIBS"
704     dnl **** Check for Xbae widget
705     if test $bundled_xbae = false
706     then
707       AC_CHECK_LIB(Xbae, XbaeCreateMatrix, XBAE_LIB="-lXbae";AC_DEFINE(HAVE_LIBXBAE))
708     fi
709     if test -z "$XBAE_LIB"
710     then
711       dnl **** Use the bundled Xbae library
712       AC_MSG_RESULT(--> Bundled version of Xbae library will be used)
713       XBAE_LIB='$(TOP)/Xbae/Xbae/libXbae.a'
714       XBAE_INC='-I$(TOP)/Xbae'
715       xbae_dir="Xbae/Xbae"
716     else
717       AC_MSG_RESULT(--> Good. Seems you have compatible version of Xbae installed)
718     fi
720     dnl **** Check for XmHTML widget
721     if test $xmhtml = true
722     then
723       ACX_CHECK_XMHTML(1105, AC_DEFINE(WITH_XMHTML), xmhtml=false)
724     fi
726     GUI_LIBS="$XMHTML_LIB $XBAE_LIB $GUI_LIBS"
728     CPPFLAGS="$xsave_CPPFLAGS"
729     LIBS="$xsave_LIBS"
730     
731   fi
734 dnl **** Final list of subdirs
735 SUBDIRS="cephes ${t1lib_dir} ${expat_dir} ${xbae_dir} lib/base lib/canvas lib/core src ${grconvert_dir} fonts templates doc examples auxiliary"
737 dnl **** Create Make.conf
738 AC_OUTPUT(Make.conf:ac-tools/Make.conf.in)