Better and more consistent coding style
[maxima.git] / configure.ac
blobb54cc091cf9a483fa16880a920f805c24b106567
1 dnl Process this file with autoconf to produce a configure script.
3 dnl If git is available, the version number here is not used.  
4 dnl Instead, git is used to derive the version based on the closest
5 dnl annotated branch tag.
6 dnl
7 dnl Note: during Lisp-based builds (see INSTALL.lisp) the version
8 dnl number is read from the following AC_INIT line.  It's sensitive to
9 dnl whitespace so when updating the version number only make changes
10 dnl within the second pair of square brackets.
11 AC_INIT([maxima], [5.41post])
12 AC_CONFIG_SRCDIR([src/macsys.lisp])
13 AM_INIT_AUTOMAKE([-Wno-portability tar-ustar])
15 # On debian-based systems this makes us use the right gcl version out-of-the box.
16 # On other systems it doesn't hurt.
17 export GCL_ANSI=t
19 AM_PATH_LISPDIR
21 AC_CANONICAL_HOST
23 dnl If we were using a C compiler, EXEEXT would get defined
24 dnl automatically. But we aren't, so we have to define it ourselves.
25 dnl Still to do: Add Win64 support here, if this is needed.
26 case "$host" in
27         *mingw*)
28                 win32=true
29                 win64=false
30                 mingw=true
31                 EXEEXT=.exe
32                 CLISPEXT=${EXEEXT}
33                 ;;
34         *cygwin*)
35                 win32=false
36                 win64=false
37                 mingw=false
38                 EXEEXT=.exe
39                 CLISPEXT=${EXEEXT}
40                 ;;
41         *)
42                 win32=false
43                 win64=false
44                 mingw=false
45                 EXEEXT=
46                 CLISPEXT=.run
47 esac
48 AC_SUBST(EXEEXT)
49 AC_SUBST(win32)
50 AC_SUBST(win64)
51 AM_CONDITIONAL(WIN32, test x$win32 = xtrue)
52 AM_CONDITIONAL(WIN64, test x$win64 = xtrue)
54 dnl To make life more confusing, the automake test machinery (which we
55 dnl use in ./tests) needs the am__EXEEXT conditional. This would have
56 dnl normally been expanded (via something we've copied from Automake's
57 dnl init.m4 into our aclocal.m4) as Automake computed EXEEXT, but it
58 dnl didn't so we have to drop this in ourselves.
59 AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])
61 explicit_lisp=false
62 lisps_enabled=""
64 dnl n.b. clisp_default_name is hardcoded in "with" message
65 clisp_default_name=clisp
66 AC_ARG_ENABLE(clisp,
67         [  --enable-clisp               Use clisp],
68         [case "${enableval}" in
69                 yes) clisp=true 
70                      lisps_enabled="${lisps_enabled} clisp"
71                      explicit_lisp=true ;;
72                 no)  clisp=false ;;
73                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-clisp) ;;
74         esac
75         explicit_lisp=true],
76         [clisp=false])
77 AC_ARG_WITH(clisp,
78         [  --with-clisp=<prog>          Use clisp executable <prog> (default clisp)],
79         [clisp=true
80         lisps_enabled="${lisps_enabled} clisp"
81         explicit_lisp=true
82         if test "$withval" = "yes"; then
83                 CLISP_NAME="${clisp_default_name}"
84         else
85                 CLISP_NAME="$withval"
86         fi],
87         [CLISP_NAME=${clisp_default_name}])
88         CLISP_RUNTIME="lisp${CLISPEXT}"
89 AC_ARG_WITH(clisp-runtime,
90         [  --with-clisp-runtime=<path>  Use clisp runtime <path> (default
91                                   *lib-directory*/base/lisp.run on unix,
92                                   *lib-directory*\\lisp.exe on windows) ],
93         [clisp=true
94         lisps_enabled="${lisps_enabled} clisp"
95         CLISP_RUNTIME_PATH="$withval"
96         CLISP_RUNTIME=`basename ${CLISP_RUNTIME_PATH}`],
97         [])
98 AC_ARG_ENABLE(clisp-exec,
99         [  --enable-clisp-exec          Create a maxima executable image using CLISP.
100                                 No check is made if the version of 
101                                 CLISP supports executable images],
102         [case "${enableval}" in
103             yes) clisp_exec=true 
104                  clisp=true 
105                  lisps_enabled="${lisps_enabled} clisp"
106                  explicit_lisp=true ;;
107             no) clisp_exec=false ;;
108             *) AC_MSG_ERROR(bad value ${enableval} for --enable-clisp-exec) ;;
109          esac
110          CLISP_EXEC=${clisp_exec}],
111         [clisp_exec=false
112          CLISP_EXEC=false])
113 if test x"${clisp}" = xtrue ; then
114         if test `echo "$CLISP_NAME" | sed 's/\(.\).*/\1/'` = "/" ; then
115                 if test -x "$CLISP_NAME" ; then
116                         clisp_found=true
117                 else
118                         clisp_found=false
119                 fi
120         else
121                 AC_CHECK_PROG(clisp_found,$CLISP_NAME,true,false)
122         fi
123         if test x"${clisp_found}" = xfalse ; then
124                 AC_MSG_WARN(clisp executable ${CLISP_NAME} not found in PATH)
125         fi         
129 dnl See if git exists.  If it does, update VERSION to include a git tag
130 AC_CHECK_PROG(git_found, git, true, false)
131 if test x"${git_found}" = xtrue; then
132     # Test to see if git describe works (discarding any output).  If
133     # it works, use it.  Otherwise, keep existing value of VERSION.
134     # (git describe fails if git is executed in a non-Git directory, e.g.,
135     # an unpacked tarball. Since the exit codes of git describe are undocumented,
136     # we cannot distinguish that from a missing annotated tag.
137     # Play it safe by refusing to change VERSION.)
138     if git describe > /dev/null 2>&1; then
139         VERSION="`git describe --dirty`"
140         # When building RPMs, hyphens in the version are not allowed, so
141         # replace them with underscores.
142         VERSION=`echo $VERSION | sed 's;-;_;g'`
143     fi
146 dnl Parses the version number for the manual
147 manual_version=`echo $VERSION | sed 's+branch_++; s+_base++; s+_dirty++; s+_+.+g'`
148 AC_SUBST(manual_version)
150 dnl n.b. cmucl_default_name is hardcoded in "with" message
151 cmucl_default_name=lisp
152 CMUCL_RUNTIME=lisp
153 AC_ARG_ENABLE(cmucl,
154         [  --enable-cmucl               Use CMUCL],
155         [case "${enableval}" in
156                 yes) cmucl=true 
157                      lisps_enabled="${lisps_enabled} cmucl"
158                      explicit_lisp=true ;;
159                 no)  cmucl=false ;;
160                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-cmucl) ;;
161         esac
162         explicit_lisp=true],
163         [cmucl=false])
164 AC_ARG_WITH(cmucl,
165         [  --with-cmucl=<prog>          Use CMUCL executable <prog> (default lisp)],
166         [cmucl=true
167         lisps_enabled="${lisps_enabled} cmucl"
168         explicit_lisp=true
169         if test "$withval" = "yes"; then
170                 CMUCL_NAME="${cmucl_default_name}"
171         else
172                 CMUCL_NAME="$withval"
173         fi],
174         [CMUCL_NAME=${cmucl_default_name}])
175 AC_ARG_WITH(cmucl-runtime,
176         [  --with-cmucl-runtime=<path>  Use CMUCL runtime <path> (default
177                                   *cmucl-lib*/../bin/lisp)],
178         [cmucl=true
179         lisps_enabled="${lisps_enabled} cmucl"
180         CMUCL_RUNTIME_PATH="$withval"
181         CMUCL_RUNTIME=`basename ${CMUCL_RUNTIME_PATH}`],
182         [])
183 AC_ARG_ENABLE(cmucl-exec,
184         [  --enable-cmucl-exec          Create a maxima executable image using CMUCL.
185                                 No check is made if the version of 
186                                 CMUCL supports executable images],
187         [case "${enableval}" in
188             yes) cmucl_exec=true
189                  cmucl=true 
190                  lisps_enabled="${lisps_enabled} cmucl"
191                  explicit_lisp=true ;;
192             no) cmucl_exec=false ;;
193             *) AC_MSG_ERROR(bad value ${enableval} for --enable-cmucl-exec) ;;
194          esac
195          CMUCL_EXEC=${cmucl_exec}],
196         [cmucl_exec=false
197          CMUCL_EXEC=false])
198 if test x"${cmucl}" = xtrue ; then
199         if test `echo "$CMUCL_NAME" | sed 's/\(.\).*/\1/'` = "/" ; then
200                 if test -x "$CMUCL_NAME" ; then
201                         cmucl_found=true
202                 else
203                         cmucl_found=false
204                 fi
205         else
206                 AC_CHECK_PROG(cmucl_found,$CMUCL_NAME,true,false)
207         fi
208         AC_CHECK_PROG(cmucl_found,$CMUCL_NAME,true,false)
209         if test x"${cmucl_found}" = xfalse ; then
210                 AC_MSG_WARN(cmucl executable ${CMUCL_NAME} not found in PATH)
211         fi
214 dnl n.b. scl_default_name is hardcoded in "with" message
215 scl_default_name=scl
216 SCL_RUNTIME=lisp
217 AC_ARG_ENABLE(scl,
218         [  --enable-scl                 Use SCL],
219         [case "${enableval}" in
220                 yes) scl=true 
221                      lisps_enabled="${lisps_enabled} scl"
222                      explicit_lisp=true ;;
223                 no)  scl=false ;;
224                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-scl) ;;
225         esac
226         explicit_lisp=true],
227         [scl=false])
228 AC_ARG_WITH(scl,
229         [  --with-scl=<prog>            Use SCL executable <prog> (default scl)],
230         [scl=true
231         lisps_enabled="${lisps_enabled} scl"
232         explicit_lisp=true
233         if test "$withval" = "yes"; then
234                 SCL_NAME="${scl_default_name}"
235         else
236                 SCL_NAME="$withval"
237         fi],
238         [SCL_NAME=${scl_default_name}])
239 AC_ARG_WITH(scl-runtime,
240         [  --with-scl-runtime=<path>    Use SCL runtime <path> (default
241                                   file://library/../bin/lisp)],
242         [scl=true
243         lisps_enabled="${lisps_enabled} scl"
244         SCL_RUNTIME_PATH="$withval"
245         SCL_RUNTIME=`basename ${SCL_RUNTIME_PATH}`],
246         [])
247 if test x"${scl}" = xtrue ; then
248         if test `echo "$SCL_NAME" | sed 's/\(.\).*/\1/'` = "/" ; then
249                 if test -x "$SCL_NAME" ; then
250                         scl_found=true
251                 else
252                         scl_found=false
253                 fi
254         else
255                 AC_CHECK_PROG(scl_found,$SCL_NAME,true,false)
256         fi
257         AC_CHECK_PROG(scl_found,$SCL_NAME,true,false)
258         if test x"${scl_found}" = xfalse ; then
259                 AC_MSG_WARN(scl executable ${SCL_NAME} not found in PATH)
260         fi
263 dnl n.b. sbcl_default_name is hardcoded in "with" message
264 sbcl_default_name=sbcl
265 AC_ARG_ENABLE(sbcl,
266         [  --enable-sbcl                Use SBCL],
267         [case "${enableval}" in
268                 yes) sbcl=true 
269                      lisps_enabled="${lisps_enabled} sbcl"
270                      explicit_lisp=true ;;
271                 no)  sbcl=false ;;
272                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-sbcl) ;;
273         esac
274         explicit_lisp=true],
275         [sbcl=false])
276 AC_ARG_WITH(sbcl,
277         [  --with-sbcl=<prog>           Use SBCL executable <prog> (default sbcl)],
278         [sbcl=true
279         lisps_enabled="${lisps_enabled} sbcl"
280         explicit_lisp=true
281         if test "$withval" = "yes"; then
282                 SBCL_NAME="${sbcl_default_name}"
283         else
284                 SBCL_NAME="$withval"
285         fi],
286         [SBCL_NAME="${sbcl_default_name}"])
287 AC_ARG_ENABLE(sbcl-exec,
288         [  --enable-sbcl-exec           Create a maxima executable image using SBCL.
289                                 No check is made if the version of 
290                                 SBCL supports executable images],
291         [case "${enableval}" in
292             yes) sbcl_exec=true 
293                  sbcl=true 
294                  lisps_enabled="${lisps_enabled} sbcl"
295                  explicit_lisp=true ;;
296             no) sbcl_exec=false ;;
297             *) AC_MSG_ERROR(bad value ${enableval} for --enable-sbcl-exec) ;;
298          esac
299          SBCL_EXEC=${sbcl_exec}],
300         [sbcl_exec=false
301          SBCL_EXEC=false])
302 if test x"${sbcl}" = xtrue ; then
303         if test `echo "$SBCL_NAME" | sed 's/\(.\).*/\1/'` = "/" ; then
304                 if test -x "$SBCL_NAME" ; then
305                         sbcl_found=true
306                 else
307                         sbcl_found=false
308                 fi
309         else
310                 AC_CHECK_PROG(sbcl_found,"$SBCL_NAME",true,false)
311         fi
312         AC_CHECK_PROG(sbcl_found,"$SBCL_NAME",true,false)
313         if test x"${sbcl_found}" = xfalse ; then
314                 AC_MSG_WARN(sbcl executable "${SBCL_NAME}" not found in PATH)
315         fi
317         
318 dnl n.b. acl_default_name is hardcoded in "with" message
319 acl_default_name=lisp
320 AC_ARG_ENABLE(acl,
321         [  --enable-acl                 Use ACL],
322         [case "${enableval}" in
323                 yes) acl=true 
324                      lisps_enabled="${lisps_enabled} acl"
325                      explicit_lisp=true ;;
326                 no)  acl=false ;;
327                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-acl) ;;
328         esac
329         explicit_lisp=true],
330         [acl=false])
331 AC_ARG_WITH(acl,
332         [  --with-acl=<prog>            Use ACL executable <prog> (default lisp)],
333         [acl=true
334         lisps_enabled="${lisps_enabled} acl"
335         explicit_lisp=true
336         if test "$withval" = "yes"; then
337                 ACL_NAME="${acl_default_name}"
338         else
339                 ACL_NAME="$withval"
340         fi],
341         [ACL_NAME=${acl_default_name}])
342 if test x"${acl}" = xtrue ; then
343         if test `echo "$ACL_NAME" | sed 's/\(.\).*/\1/'` = "/" ; then
344                 if test -x "$ACL_NAME" ; then
345                         acl_found=true
346                 else
347                         acl_found=false
348                 fi
349         else
350                 AC_CHECK_PROG(acl_found,$ACL_NAME,true,false)
351         fi
352         AC_CHECK_PROG(acl_found,$ACL_NAME,true,false)
353         if test x"${acl_found}" = xfalse ; then
354                 AC_MSG_WARN(acl executable ${ACL_NAME} not found in PATH)
355         fi
358 dnl n.b. gcl_default_name is hardcoded in "with" message
359 gcl_default_name=gcl
360 AC_ARG_ENABLE(gcl,
361         [  --enable-gcl                 Use GCL],
362         [case "${enableval}" in
363                 yes) gcl=true 
364                      lisps_enabled="${lisps_enabled} gcl"
365                      explicit_lisp=true;;
366                 no)  gcl=false ;;
367                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-gcl) ;;
368         esac],
369         [gcl=false])
370 AC_ARG_WITH(gcl,
371         [  --with-gcl=<prog>            Use GCL executable <prog> (default gcl)],
372         [gcl=true
373         lisps_enabled="${lisps_enabled} gcl"
374         explicit_lisp=true
375         if test "$withval" = "yes"; then
376                 GCL_NAME="${gcl_default_name}"
377         else
378                 GCL_NAME="$withval"
379         fi],
380         [GCL_NAME=${gcl_default_name}])
381 if test x"${gcl}" = xtrue ; then
382         if test `echo "$GCL_NAME" | sed 's/\(.\).*/\1/'` = "/" ; then
383                 if test -x "$GCL_NAME" ; then
384                         gcl_found=true
385                 else
386                         gcl_found=false
387                 fi
388         else
389                 AC_CHECK_PROG(gcl_found,$GCL_NAME,true,false)
390         fi
391         if test x"${gcl_found}" = xfalse ; then
392                 AC_MSG_WARN(gcl executable ${GCL_NAME} not found in PATH)
393         fi
396 dnl n.b. openmcl_default_name is hardcoded in "with" message
397 openmcl_default_name=openmcl
398 AC_ARG_ENABLE(openmcl,
399         [  --enable-openmcl             Use OpenMCL],
400         [case "${enableval}" in
401                 yes) openmcl=true 
402                      lisps_enabled="${lisps_enabled} openmcl"
403                      explicit_lisp=true;;
404                 no)  openmcl=false ;;
405                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-openmcl) ;;
406         esac],
407         [openmcl=false])
408 AC_ARG_WITH(openmcl,
409         [  --with-openmcl=<prog>        Use OpenMCL executable <prog> (default openmcl)],
410         [openmcl=true
411         lisps_enabled="${lisps_enabled} openmcl"
412         explicit_lisp=true
413         if test "$withval" = "yes"; then
414                 OPENMCL_NAME="${openmcl_default_name}"
415         else
416                 OPENMCL_NAME="$withval"
417         fi],
418         [OPENMCL_NAME=${openmcl_default_name}])
419 AC_ARG_ENABLE(openmcl-exec,
420         [  --enable-openmcl-exec        Create a maxima executable image using OPENMCL.
421                                 No check is made if the version of 
422                                 OPENMCL supports executable images],
423         [case "${enableval}" in
424             yes) openmcl_exec=true
425                  openmcl=true 
426                  lisps_enabled="${lisps_enabled} openmcl"
427                  explicit_lisp=true;;
428             no) openmcl_exec=false ;;
429             *) AC_MSG_ERROR(bad value ${enableval} for --enable-openmcl-exec) ;;
430          esac
431          OPENMCL_EXEC=${openmcl_exec}],
432         [openmcl_exec=false
433          OPENMCL_EXEC=false])
435 dnl Define ccl as an alias (essentially) for openmcl
436 AC_ARG_ENABLE(ccl,
437         [  --enable-ccl                 Use CCL (Clozure Common Lisp)],
438         [case "${enableval}" in
439                 yes) openmcl=true 
440                      lisps_enabled="${lisps_enabled} openmcl"
441                      explicit_lisp=true;;
442                 no)  openmcl=false ;;
443                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-ccl) ;;
444         esac],
445         [openmcl=false])
446 AC_ARG_WITH(ccl,
447         [  --with-ccl=<prog>            Use OpenMCL executable <prog> (default ccl)],
448         [openmcl=true
449         lisps_enabled="${lisps_enabled} openmcl"
450         explicit_lisp=true
451         if test "$withval" = "yes"; then
452                 OPENMCL_NAME="${openmcl_default_name}"
453         else
454                 OPENMCL_NAME="$withval"
455         fi],
456         [OPENMCL_NAME=${openmcl_default_name}])
457 AC_ARG_ENABLE(ccl-exec,
458         [  --enable-ccl-exec            Create a maxima executable image using CCL.
459                                 No check is made if the version of 
460                                 CCL supports executable images],
461         [case "${enableval}" in
462             yes) openmcl_exec=true
463                  openmcl=true 
464                  lisps_enabled="${lisps_enabled} openmcl"
465                  explicit_lisp=true;;
466             no) openmcl_exec=false ;;
467             *) AC_MSG_ERROR(bad value ${enableval} for --enable-ccl-exec) ;;
468          esac
469          OPENMCL_EXEC=${openmcl_exec}],
470         [openmcl_exec=false
471          OPENMCL_EXEC=false])
473 if test x"${openmcl}" = xtrue ; then
474         if test `echo "$OPENMCL_NAME" | sed 's/\(.\).*/\1/'` = "/" ; then
475                 if test -x "$OPENMCL_NAME" ; then
476                         openmcl_found=true
477                 else
478                         openmcl_found=false
479                 fi
480         else
481                 AC_CHECK_PROG(openmcl_found,$OPENMCL_NAME,true,false)
482         fi
483         if test x"${openmcl_found}" = xfalse ; then
484                 AC_MSG_WARN(openmcl executable ${OPENMCL_NAME} not found in PATH)
485         fi
488 dnl n.b. ccl64_default_name is hardcoded in "with" message
489 dnl We assume we're running on an x86 processor.  The user has to
490 dnl select a different executable name to match his system, if neceessary.
492 ccl64_default_name=dx86cl64
493 AC_ARG_ENABLE(ccl64,
494         [  --enable-ccl64               Use CCL (Clozure Common Lisp), 64-bit],
495         [case "${enableval}" in
496                 yes) ccl64=true 
497                      lisps_enabled="${lisps_enabled} ccl64"
498                      explicit_lisp=true;;
499                 no)  ccl64=false ;;
500                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-ccl64) ;;
501         esac],
502         [ccl64=false])
503 AC_ARG_WITH(ccl64,
504         [  --with-ccl64=<prog>          Use ccl64 executable <prog> (default dx86cl64)],
505         [ccl64=true
506         lisps_enabled="${lisps_enabled} ccl64"
507         explicit_lisp=true
508         if test "$withval" = "yes"; then
509                 CCL64_NAME="${ccl64_default_name}"
510         else
511                 CCL64_NAME="$withval"
512         fi],
513         [CCL64_NAME=${ccl64_default_name}])
514 AC_ARG_ENABLE(ccl64-exec,
515         [  --enable-ccl64-exec          Create a maxima executable image using CCL.
516                                 No check is made if the version of 
517                                 CCL supports executable images],
518         [case "${enableval}" in
519             yes) ccl64_exec=true
520                  ccl64=true 
521                  lisps_enabled="${lisps_enabled} ccl64"
522                  explicit_lisp=true;;
523             no) ccl64_exec=false ;;
524             *) AC_MSG_ERROR(bad value ${enableval} for --enable-ccl64-exec) ;;
525          esac
526          CCL64_EXEC=${ccl64_exec}],
527         [ccl64_exec=false
528          CCL64_EXEC=false])
530 dnl n.b. ecl_default_name is hardcoded in "with" message
531 ecl_default_name=ecl
532 AC_ARG_ENABLE(ecl,
533         [  --enable-ecl                 Use ECL],
534         [case "${enableval}" in
535                 yes) ecl=true 
536                      lisps_enabled="${lisps_enabled} ecl"
537                      explicit_lisp=true;;
538                 no)  ecl=false ;;
539                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-ecl) ;;
540         esac],
541         [ecl=false])
542 AC_ARG_WITH(ecl,
543         [  --with-ecl=<prog>            Use ECL executable <prog> (default ecl)],
544         [ecl=true
545         lisps_enabled="${lisps_enabled} ecl"
546         explicit_lisp=true
547         if test "$withval" = "yes"; then
548                 ECL_NAME="${ecl_default_name}"
549         else
550                 ECL_NAME="$withval"
551         fi],
552         [ECL_NAME=${ecl_default_name}])
553 if test x"${ecl}" = xtrue ; then
554         if test `echo "$ECL_NAME" | sed 's/\(.\).*/\1/'` = "/" ; then
555                 if test -x "$ECL_NAME" ; then
556                         ecl_found=true
557                 else
558                         ecl_found=false
559                 fi
560         else
561                 AC_CHECK_PROG(ecl_found,$ECL_NAME,true,false)
562         fi
563         if test x"${ecl_found}" = xfalse ; then
564                 AC_MSG_WARN(ecl executable ${ECL_NAME} not found in PATH)
565         fi
568 dnl xgettext
569 AC_ARG_ENABLE(gettext,
570         [  --enable-gettext             Locale support],
571         [case "${enableval}" in
572                yes) enable_gettext=true  ;;
573                no)  enable_gettext=false ;;
574                *) AC_MSG_ERROR(bad value ${enableval} for --enable-gettext) ;;
575          esac],
576          [enable_gettext=false])
579 AM_CONDITIONAL(ENABLE_GETTEXT, test x$enable_gettext = xtrue)
581 dnl languages
582 AC_ARG_ENABLE(lang-de,
583         [  --enable-lang-de             German language support],
584         [case "${enableval}" in
585                 yes) lang_de=true  ;;
586                 no)  lang_de=false ;;
587                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-lang-de) ;;
588         esac],
589         [lang_de=false])
591 AM_CONDITIONAL(LANG_DE, test x$lang_de = xtrue)
593 AC_ARG_ENABLE(lang-de-utf8,
594         [  --enable-lang-de-utf8        German language support (UTF-8)],
595         [case "${enableval}" in
596                 yes) lang_de_utf8=true  ;;
597                 no)  lang_de_utf8=false ;;
598                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-lang-de-utf8) ;;
599         esac],
600         [lang_de_utf8=false])
602 AM_CONDITIONAL(LANG_DE_UTF8, test x$lang_de_utf8 = xtrue)
604 AC_ARG_ENABLE(lang-es,
605         [  --enable-lang-es             Spanish language support],
606         [case "${enableval}" in
607                 yes) lang_es=true  ;;
608                 no)  lang_es=false ;;
609                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-lang-es) ;;
610         esac],
611         [lang_es=false])
613 AC_SUBST(lang_es)
614 AM_CONDITIONAL(LANG_ES, test x$lang_es = xtrue)
616 AC_ARG_ENABLE(lang-es-utf8,
617         [  --enable-lang-es-utf8        Spanish language support (UTF-8)],
618         [case "${enableval}" in
619                 yes) lang_es_utf8=true  ;;
620                 no)  lang_es_utf8=false ;;
621                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-lang-es-utf8) ;;
622         esac],
623         [lang_es_utf8=false])
625 AM_CONDITIONAL(LANG_ES_UTF8, test x$lang_es_utf8 = xtrue)
627 AC_ARG_ENABLE(lang-pt,
628         [  --enable-lang-pt             Portuguese language support],
629         [case "${enableval}" in
630                 yes) lang_pt=true  ;;
631                 no)  lang_pt=false ;;
632                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-lang-pt) ;;
633         esac],
634         [lang_pt=false])
636 AC_SUBST(lang_pt)
637 AM_CONDITIONAL(LANG_PT, test x$lang_pt = xtrue)
639 AC_ARG_ENABLE(lang-pt-utf8,
640         [  --enable-lang-pt-utf8        Portuguese language support (UTF-8)],
641         [case "${enableval}" in
642                 yes) lang_pt_utf8=true  ;;
643                 no)  lang_pt_utf8=false ;;
644                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-lang-pt-utf8) ;;
645         esac],
646         [lang_pt_utf8=false])
648 AM_CONDITIONAL(LANG_PT_UTF8, test x$lang_pt_utf8 = xtrue)
650 AC_ARG_ENABLE(lang-pt_BR,
651         [  --enable-lang-pt_BR          Brazilian Portuguese language support],
652         [case "${enableval}" in
653                 yes) lang_pt_br=true  ;;
654                 no)  lang_pt_br=false ;;
655                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-lang-pt_BR) ;;
656         esac],
657         [lang_pt_br=false])
659 AC_SUBST(lang_pt_br)
660 AM_CONDITIONAL(LANG_PT_BR, test x$lang_pt_br = xtrue)
662 AC_ARG_ENABLE(lang-pt_BR-utf8,
663         [  --enable-lang-pt_BR-utf8     Brazilian Portuguese language support (UTF-8)],
664         [case "${enableval}" in
665                 yes) lang_pt_br_utf8=true  ;;
666                 no)  lang_pt_br_utf8=false ;;
667                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-lang-pt_BR-utf8) ;;
668         esac],
669         [lang_pt_br_utf8=false])
671 AM_CONDITIONAL(LANG_PT_BR_UTF8, test x$lang_pt_br_utf8 = xtrue)
673 AC_ARG_ENABLE(recode,
674         [  --enable-recode              Use recode for charset conversion],
675         [case "${enableval}" in
676                 yes) use_recode=true  ;;
677                 no)  use_recode=false ;;
678                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-recode) ;;
679         esac],
680         [use_recode=false])
682 dnl iconv and/or recode
683 AC_CHECK_PROG(iconv_found,iconv,true,false)
684 AC_CHECK_PROG(recode_found,recode,true,false)
686 if test x"${use_recode}" = xtrue ; then
687     if test x"${recode_found}" = xfalse ; then
688         AC_MSG_ERROR(No recode found)
689     fi
690 elif test x"${iconv_found}" = xfalse ; then
691     use_recode=true 
692 else
693     use_recode=false
696 AM_CONDITIONAL(USE_RECODE, test x$use_recode = xtrue)
698 dnl Optionally build the windows CHM help files
699 dnl default to false as requires win32 and Microsoft HTML Help Workshop
700 AC_ARG_ENABLE(chm,
701   [  --enable-chm                 Build Windows CHM help files],
702   [case "${enableval}" in
703                 yes) chm=true ;;
704                 no)  chm=false ;;
705                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-chm) ;;
706    esac],
707    [chm=false])
708 AM_CONDITIONAL(CHM, test x$chm = xtrue)
709 dnl hhc is the HTML Help Compiler for CHM documentation
710 hhc_default_name=hhc$EXEEXT
711 AC_ARG_WITH(hhc,
712         [  --with-hhc=<prog>            Use HTML Help Compiler executable <prog> (default hhc)],
713         [hhc=true
714         if test "$withval" = "yes"; then
715                 HHC="${hhc_default_name}"
716         else
717                 HHC="$withval"
718         fi],
719         [HHC="${hhc_default_name}"])
721 # Check that hhc exists, using AC_CHECK_PROG
722 if test x$chm = xtrue; then
723   if test -x "${HHC}"; then
724     # HHC was a path to the executable, and it existed, which is
725     # great! We still say something to the caller, since this is
726     # probably less confusing.
727     AC_MSG_CHECKING([for hhc])
728     AC_MSG_RESULT([yes])
729   else
730     AC_CHECK_PROG(hhc_found, ${HHC}, yes)
731     if test x"${hhc_found}" != x"yes"; then
732       AC_MSG_ERROR([HTML Help Compiler executable ${HHC} not found])
733     fi
734   fi
737 dnl Make the build quiet
738 AC_ARG_ENABLE(quiet_build,
739   [  --enable-quiet-build         Make the build quieter],
740   [case "${enableval}" in
741      yes) quiet_build=true ;;
742      no)  quiet_build=false ;;
743      *) AC_MSG_ERROR(bad value ${enableval} for --enable-quiet-build) ;;
744    esac],
745   [quiet_build=false])
746 AM_CONDITIONAL(QUIET_BUILD, test x${quiet_build} = xtrue)
748 dnl Optionally build xmaxima.exe under windows
749 dnl default to false as additional software
750 AC_ARG_ENABLE(xmaxima_exe,
751   [  --enable-xmaxima-exe         Build Windows xmaxima.exe for installer],
752   [case "${enableval}" in
753                 yes) xmaxima_exe=true ;;
754                 no)  xmaxima_exe=false ;;
755                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-xmaxima-exe) ;;
756    esac],
757    [xmaxima_exe=false])
758 AM_CONDITIONAL(XMAXIMA_EXE, test x$xmaxima_exe = xtrue)
760 dnl Optionally build xmaxima.exe under windows
761 dnl default to false as additional software
762 AC_ARG_ENABLE(winkill_exe,
763   [  --enable-winkill             Build Windows winkill.exe and winkill_lib.dll for installer],
764   [case "${enableval}" in
765                 yes) winkill_exe=true ;;
766                 no)  winkill_exe=false ;;
767                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-winkill-exe) ;;
768    esac],
769    [winkill_exe=false])
770 AM_CONDITIONAL(WINKILL_EXE, test x$winkill_exe = xtrue)
772 dnl Should we build a win64 installer?
773 AC_ARG_ENABLE(win64-installer,
774   [  --enable-win64-installer     Build a 64bit installer on Windows],
775   [case "${enableval}" in
776                 yes) win64_installer=true ;;
777                 no) win64_installer=false ;;
778                 *) AC_MSG_ERROR(bad valu ${enableval} for --enable-win64-installer) ;;
779   esac],
780   [win64_installer=false])
781 AM_CONDITIONAL(WIN64_INSTALLER, test x$win64_installer = xtrue)
782 AC_SUBST(win64_installer)
784 dnl Enable use of MathJax in the html documentation.  This just loads
785 dnl MathJax in each html file.  The texi files need to put the
786 dnl appropriate @html/@end html text to generate the equations for MathJax.
787 AC_ARG_ENABLE(mathjax,
788   [  --enable-mathjax             Enable MathJax support for html manual],
789   [case "${enableval}" in
790       yes) mathjax=true
791            mathjax_enable='@set mathjax true'
792            mathjax_script="<script src='https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/MathJax.js?config=TeX-AMS-MML_HTMLorMML'></script>"
794       no)  mathjax=false
795            mathjax_enable='@clear mathjax'
796            mathjax_script="";;
797       *) AC_MSG_ERROR(bad value ${enableval} for --enable-mathjax) ;;
798    esac],
799   [mathjax=false])
800 AM_CONDITIONAL(MATHJAX, test x$mathjax = xtrue)
801 AC_SUBST(mathjax_script)
802 AC_SUBST(mathjax_enable)
804 dnl Tools for building xmaxima.exe on windows
805 dnl Hard code the filenames for now.  Can over-ride on make command line
806 GCCVER=undefined
807 if test x${xmaxima_exe} = xtrue ; then
808   GCCVER=`gcc -dumpversion`
809   dnl http://tclkits.rkeene.org/fossil/wiki?name=Downloads
810   dnl and http://www.tcl.tk/starkits/
811   TCLKITSH=/c/programs/star/tclkitsh-8.6.3-win32-ix86.exe
812   TCLKIT_RUNTIME=/c/programs/star/tclkit-8.6.3-win32-ix86.exe
813   SDXKIT=/c/programs/star/sdx.kit
814   IMGKIT=/c/programs/star/img.kit
817 AC_SUBST(GCCVER)
818 AC_SUBST(TCLKITSH)
819 AC_SUBST(TCLKIT_RUNTIME)
820 AC_SUBST(SDXKIT)
821 AC_SUBST(IMGKIT)
822 AM_CONDITIONAL(GCC331, test x${GCCVER} = x3.3.1)
824 if test x"${explicit_lisp}" = xfalse ; then
825         dnl See if any of the lisps can be found
826         AC_CHECK_PROG(clisp_found,${clisp_default_name},true,false)
827         AC_CHECK_PROG(gcl_found,${gcl_default_name},true,false)
828         AC_CHECK_PROG(cmucl_found,$CMUCL_NAME,true,false)
829         AC_CHECK_PROG(scl_found,$SCL_NAME,true,false)
830         AC_CHECK_PROG(sbcl_found,$SBCL_NAME,true,false)
831         AC_CHECK_PROG(acl_found,$ACL_NAME,true,false)
832         AC_CHECK_PROG(openmcl_found,$OPENMCL_NAME,true,false)
833         AC_CHECK_PROG(ccl64_found,$CCL64_NAME,true,false)
834         AC_CHECK_PROG(ecl_found,$ECL_NAME,true,false)
836         if test x"${clisp_found}" = xtrue ; then
837                 clisp=true
838                 lisps_enabled="${lisps_enabled} clisp"
839         elif test x"${gcl_found}" = xtrue ; then
840                 gcl=true
841                 lisps_enabled="${lisps_enabled} gcl"
842         elif test x"${cmucl_found}" = xtrue ; then
843                 cmucl=true
844                 lisps_enabled="${lisps_enabled} cmucl"
845         elif test x"${scl_found}" = xtrue ; then
846                 scl=true
847                 lisps_enabled="${lisps_enabled} scl"
848         elif test x"${sbcl_found}" = xtrue ; then
849                 sbcl=true
850                 lisps_enabled="${lisps_enabled} sbcl"
851         elif test x"${acl_found}" = xtrue ; then
852                 acl=true
853                 lisps_enabled="${lisps_enabled} acl"
854         elif test x"${ecl_found}" = xtrue ; then
855                 ecl=true
856                 lisps_enabled="${lisps_enabled} ecl"
857         elif test x"${ccl64_found}" = xtrue; then
858                 ccl64=true
859                 lisps_enabled="${lisps_enabled} ccl64"
860         else
861                 AC_MSG_ERROR(No lisp implementation specified and none of the default executables [${clisp_default_name}(clisp),${gcl_default_name}(GCL),${cmucl_default_name}(CMUCL),${scl_default_name}(SCL),${sbcl_default_name}(SBCL),${acl_default_name}(ACL),${openmcl_default_name}(OpenMCL),${ecl_default_name}(ECL)] were found in PATH)
862         fi
865 AM_CONDITIONAL(CLISP, test x$clisp = xtrue)
866 AM_CONDITIONAL(CLISP_EXEC, test x$clisp_exec = xtrue)
867 AM_CONDITIONAL(GCL, test x$gcl = xtrue)
868 AM_CONDITIONAL(CMUCL, test x$cmucl = xtrue)
869 AM_CONDITIONAL(CMUCL_EXEC, test x${cmucl_exec} = xtrue)
870 AM_CONDITIONAL(SCL, test x$scl = xtrue)
871 AM_CONDITIONAL(SBCL, test x$sbcl = xtrue)
872 AM_CONDITIONAL(SBCL_EXEC, test x$sbcl_exec = xtrue)
873 AM_CONDITIONAL(ACL, test x$acl = xtrue)
874 AM_CONDITIONAL(OPENMCL, test x$openmcl = xtrue)
875 AM_CONDITIONAL(OPENMCL_EXEC, test x${openmcl_exec} = xtrue)
876 AM_CONDITIONAL(ECL, test x$ecl = xtrue)
877 AM_CONDITIONAL(CCL64, test x$ccl64 = xtrue)
878 AM_CONDITIONAL(CCL64_EXEC, test x${ccl64_exec} = xtrue)
880 if test x"${clisp}" = xtrue; then
881     if test x"${CLISP_RUNTIME_PATH}" = x"" ; then
882         if test x"${mingw}" = xtrue ; then
883             CLISP_RUNTIME_PATH=`${CLISP_NAME} -norc -q -x "(format nil \"~a${CLISP_RUNTIME}\" (namestring *lib-directory*))"|sed 's/\"\\(.*\\)\"/\\1/'`
884         else
885             CLISP_RUNTIME_PATH=`${CLISP_NAME} -norc -q -x "(format nil \"~abase/${CLISP_RUNTIME}\" (namestring *lib-directory*))"|sed 's/\"\\(.*\\)\"/\\1/'`
886         fi
887     fi
888     if test -x ${CLISP_RUNTIME_PATH} ; then
889         echo "clisp runtime is \"${CLISP_RUNTIME_PATH}\""
890     else
891         AC_MSG_ERROR(clisp runtime \"${CLISP_RUNTIME_PATH}\" is not an executable)
892     fi
893     CLISP_RUNTIME=`basename ${CLISP_RUNTIME_PATH}`
896 if test x"${cmucl}" = xtrue; then
897     if test x"${CMUCL_RUNTIME_PATH}" = x"" ; then
898         CMUCL_RUNTIME_PATH=`${CMUCL_NAME} -noinit -nositeinit -quiet -batch -eval '#-cmu18 (progn (setf (search-list "cmuclbin:") (append (lisp::parse-unix-search-path lisp::*cmucl-lib*) (mapcar (function (lambda (p) (concatenate (quote string) p "../bin/"))) (lisp::parse-unix-search-path lisp::*cmucl-lib*))))(enumerate-search-list (s "cmuclbin:lisp") (when (probe-file s) (format t "~A~%" s) (quit)))) #+cmu18 (format t "~a/../bin/lisp~%" common-lisp::*cmucl-lib*)(quit)'`
899     fi
900     if test -x "${CMUCL_RUNTIME_PATH}" ; then
901         echo "cmucl runtime is \"${CMUCL_RUNTIME_PATH}\""
902     else
903 dnl last chance: find CMUCL_NAME in path. Use it if it doesn't appear to
904 dnl be a shell script.
905         cmucl_path=`type -p "${CMUCL_NAME}"`
906         if test x"`grep -c '#!.*bin.*sh.*' ${cmucl_path}`" = x"0" ; then
907                 CMUCL_RUNTIME_PATH="${cmucl_path}"
908         else
909                 AC_MSG_ERROR([Unable to determine CMUCL runtime path.
910 The best guess for CMUCL runtime, \"${CMUCL_RUNTIME_PATH}\", is not
911 an executable. Use the argument
912    --with-cmucl-runtime=<path>
913 to set the actual CMUCL executable. If the CMUCL lisp command is a shell
914 script the CMUCL executable is the program exec'd by that shell script.])
915         fi
916     fi
917     CMUCL_RUNTIME=`basename ${CMUCL_RUNTIME_PATH}`
919 dnl cmucl final check
920    result=`"${CMUCL_RUNTIME_PATH}" -quiet -eval '(format t "MAXIMA_CMUCL_TEST_SUCCESS%")(quit)'`
921    retval=$?
922    if test ! x"${retval}" = x"0" ; then
923       AC_MSG_ERROR(unable to run cmucl runtime = "${CMUCL_RUNTIME_PATH}". 
924 Please specify the full path of the cmucl runtime using the 
925     --with-cmucl-runtime=<path>
926 flag.)
927    fi
928    count=`echo "${result}" | grep -c "MAXIMA_CMUCL_TEST_SUCCESS"`
929    if test ! "${count}" = "1" ; then
930       AC_MSG_ERROR(an error occured while checking cmucl runtime)
931    fi
934 if test x"${scl}" = xtrue; then
935     if test x"${SCL_RUNTIME_PATH}" = x"" ; then
936         SCL_RUNTIME_PATH=`${SCL_NAME} -noinit -nositeinit -quiet -batch -eval '(progn (enumerate-pathname-translations (pathname "file://library/../bin/lisp") (when (probe-file pathname) (format t "~A~%" (unix-namestring pathname)))) (quit))'`
937     fi
938     if test -x "${SCL_RUNTIME_PATH}" ; then
939         echo "scl runtime is \"${SCL_RUNTIME_PATH}\""
940     else
941 dnl last chance: find SCL_NAME in path. Use it if it doesn't appear to
942 dnl be a shell script.
943         scl_path=`type -p "${SCL_NAME}"`
944         if test x"`grep -c '#!.*bin.*sh.*' ${scl_path}`" = x"0" ; then
945                 SCL_RUNTIME_PATH="${scl_path}"
946         else
947                 AC_MSG_ERROR([Unable to determine SCL runtime path.
948 The best guess for SCL runtime, \"${SCL_RUNTIME_PATH}\", is not
949 an executable. Use the argument
950    --with-scl-runtime=<path>
951 to set the actual SCL executable. If the SCL lisp command is a shell
952 script the SCL executable is the program exec'd by that shell script.])
953         fi
954     fi
955     SCL_RUNTIME=`basename ${SCL_RUNTIME_PATH}`
958 if test x"${gcl}" = xtrue; then
959    result=`"${GCL_NAME}" -batch -eval '#+ansi-cl (format t "MAXIMA_GCL_ANSI_TEST_SUCCESS~%") #-ansi-cl (format t "MAXIMA_GCL_ANSI_TEST_FAILURE~%")' -eval '(si::bye)'`
960    retval=$?
961    if test ! x"${retval}" = x"0" ; then
962       AC_MSG_ERROR(unable to run gcl executable \"${GCL_NAME}\".)
963    fi
964    count=`echo "${result}" | grep -c "MAXIMA_GCL_ANSI_TEST_SUCCESS"`
965    if test ! "${count}" = "1" ; then
966       AC_MSG_ERROR([The gcl executable \"${GCL_NAME}\" was not compiled with
967 the --enable-ansi flag, which is required for Maxima.
968 The gcl ANSI-CL check returned
969 \"${result}\".])
970    fi
973 AC_ARG_ENABLE(gcl-alt-link,
974         [  --enable-gcl-alt-link        Use GCL's alternate linking mechanism],
975         [case "${enableval}" in
976                 yes) gcl_alt_link=true ;;
977                 no)  gcl_alt_link=false ;;
978                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-gcl-alt-link) ;;
979         esac],
980         [gcl_alt_link=false])
982 AM_CONDITIONAL(GCL_ALT_LINK, test x$gcl_alt_link = xtrue)
984 AC_ARG_WITH(default-lisp,
985         [  --with-default-lisp=<lisp>   Set default lisp implementation to <lisp>],
986         [case "${withval}" in
987                 clisp)
988                         if test x"${clisp}" = xtrue ; then
989                                 DEFAULTLISP=clisp
990                         else
991                                 AC_MSG_ERROR(clisp not enabled)
992                         fi
993                         ;;
994                 cmucl)
995                         if test x"${cmucl}" = xtrue ; then
996                                 DEFAULTLISP=cmucl
997                         else
998                                 AC_MSG_ERROR(cmucl not enabled)
999                         fi
1000                         ;;
1001                 scl)
1002                         if test x"${scl}" = xtrue ; then
1003                                 DEFAULTLISP=scl
1004                         else
1005                                 AC_MSG_ERROR(scl not enabled)
1006                         fi
1007                         ;;
1008                 sbcl)
1009                         if test x"${sbcl}" = xtrue ; then
1010                                 DEFAULTLISP=sbcl
1011                         else
1012                                 AC_MSG_ERROR(sbcl not enabled)
1013                         fi
1014                         ;;
1015                 gcl)
1016                         if test x"${gcl}" = xtrue ; then
1017                                 DEFAULTLISP=gcl
1018                         else
1019                                 AC_MSG_ERROR(gcl not enabled)
1020                         fi
1021                         ;;      
1022                 acl)
1023                         if test x"${acl}" = xtrue ; then
1024                                 DEFAULTLISP=acl
1025                         else
1026                                 AC_MSG_ERROR(acl not enabled)
1027                         fi
1028                         ;;      
1029                 openmcl)
1030                         if test x"${openmcl}" = xtrue ; then
1031                                 DEFAULTLISP=openmcl
1032                         else
1033                                 AC_MSG_ERROR(openmcl not enabled)
1034                         fi
1035                         ;;              
1036                 ecl)
1037                         if test x"${ecl}" = xtrue ; then
1038                                 DEFAULTLISP=ecl
1039                         else
1040                                 AC_MSG_ERROR(ecl not enabled)
1041                         fi
1042                         ;;
1043                 ccl64)          
1044                         if test x"${ccl64}" = xtrue ; then
1045                                 DEFAULTLISP=ccl64
1046                         else
1047                                 AC_MSG_ERROR(ccl64 not enabled)
1048                         fi
1049                         ;;              
1050                 *) 
1051                         AC_MSG_ERROR(Unknown argument ${DEFAULTLISP} to --with-default-lisp) 
1052                         ;;
1053         esac],
1054         [if test x"${clisp}" = xtrue ; then
1055                 DEFAULTLISP=clisp
1056         elif test x"${cmucl}" = xtrue ; then
1057                 DEFAULTLISP=cmucl
1058         elif test x"${scl}" = xtrue ; then
1059                 DEFAULTLISP=scl
1060         elif test x"${sbcl}" = xtrue ; then
1061                 DEFAULTLISP=sbcl
1062         elif test x"${gcl}" = xtrue ; then
1063                 DEFAULTLISP=gcl
1064         elif test x"${acl}" = xtrue ; then
1065                 DEFAULTLISP=acl
1066         elif test x"${openmcl}" = xtrue ; then
1067                 DEFAULTLISP=openmcl
1068         elif test x"${ecl}" = xtrue ; then
1069                 DEFAULTLISP=ecl
1070         elif test x"${ccl64}" = xtrue ; then
1071                 DEFAULTLISP=ccl64
1072         else
1073                 AC_MSG_ERROR(Internal error. No lisp enabled. Please contact maintainer.)
1074         fi])
1076 AC_SUBST(CLISP_NAME)
1077 AC_SUBST(CLISP_RUNTIME)
1078 AC_SUBST(CLISP_RUNTIME_PATH)
1079 AC_SUBST(CMUCL_NAME)
1080 AC_SUBST(CMUCL_RUNTIME)
1081 AC_SUBST(CMUCL_RUNTIME_PATH)
1082 AC_SUBST(CMUCL_EXEC)
1083 AC_SUBST(SCL_NAME)
1084 AC_SUBST(SCL_RUNTIME)
1085 AC_SUBST(SCL_RUNTIME_PATH)
1086 AC_SUBST(SBCL_NAME)
1087 AC_SUBST(GCL_NAME)
1088 AC_SUBST(ACL_NAME)
1089 AC_SUBST(OPENMCL_NAME)
1090 AC_SUBST(ECL_NAME)
1091 AC_SUBST(CCL64_NAME)
1092 AC_SUBST(DEFAULTLISP)
1093 AC_SUBST(HHC)
1094 AC_SUBST(lisps_enabled)
1096 AC_ARG_WITH(posix-shell,
1097         [  --with-posix-shell=<path>    Use <shell> for maxima script (default /bin/sh)],
1098         [posix_shell_list="${withval}"],
1099         [posix_shell_list="/bin/sh /bin/bash /usr/bin/bash /usr/local/bin/bash"])
1101 AC_ARG_WITH(wish,
1102         [  --with-wish=<prog>           Use <prog> for Tk wish shell (default wish)],
1103         [WISH="${withval}"],
1104         [WISH="wish"])
1105 AC_SUBST(WISH)
1108 AC_MSG_CHECKING(POSIX shell to see that it contains getopts)
1109 cat <<EOF > conftest-posix-shell.sh
1110 getopts "ab:" opt
1111 result="\$?"
1112 echo "result is \$result"
1113 exit "\$result"
1115 POSIX_SHELL=""
1116 for shell in $posix_shell_list
1118         if test -z "$POSIX_SHELL" ; then
1119                 echo "trying $shell"
1120                 $shell conftest-posix-shell.sh -a > /dev/null 2>&1
1121                 if test "$?" = "0" ; then
1122                         POSIX_SHELL="$shell"
1123                 fi
1124         fi
1125 done
1126 rm -f conftest-posix-shell.sh
1127 if test -n "$POSIX_SHELL" ; then
1128         AC_MSG_RESULT(POSIX shell is $POSIX_SHELL)
1129 else
1130         AC_MSG_WARN(Could not find a shell that supports getopts. 
1131 The maxima wrapper script will be unusable. The shell may be specified
1132 with --with-posix-shell=</path/to/shell>)
1134 AC_SUBST(POSIX_SHELL)
1136 if test x"${prefix}" = xNONE ; then
1137         tmp_prefix="/usr/local"
1138 else
1139         tmp_prefix="${prefix}"
1141 if test x"${exec_prefix}" = xNONE ; then
1142         tmp_exec_prefix="${tmp_prefix}"
1143 else
1144         tmp_exec_prefix="${exec_prefix}"
1146 expanded_top_srcdir="$(cd "$top_srcdir" 1>/dev/null 2>/dev/null; pwd)"
1147 expanded_exec_prefix="${tmp_exec_prefix}"
1148 expanded_libdir="$(eval "exec_prefix=\"${tmp_exec_prefix}\";echo ${libdir}")"
1149 expanded_libexecdir="$(eval "exec_prefix=\"${tmp_exec_prefix}\";echo ${libexecdir}")"
1150 expanded_datadir="$(eval "prefix=\"${tmp_prefix}\";datarootdir=\"${datarootdir}\";echo ${datadir}")"
1151 expanded_infodir="$(eval "prefix=\"${tmp_prefix}\";datarootdir=\"${datarootdir}\";echo ${infodir}")"
1154 dnl Find all the directories in share, but remove the share directory
1155 dnl itself and all CVS directories (if any) and fortran directories
1156 dnl and *.t2p directories (created when generating pdf documentation).
1157 dnl Remove the leading "share" part of the path, and add double-quotes
1158 dnl around it.
1160 #default_sharedirs=`find share -type d | sort | egrep -v 'share$|CVS|/fortran' | sed 's;share/\(.*\);        "\1" \\\\;' | sed '$s;\\\\;;'`
1161 default_sharedirs=`find share -type d | sort | egrep -v 'share$|CVS|/fortran|\.t2p' | sed 's;share/\(.*\);"\1";' | tr '\n' ' '`
1163 AC_SUBST(expanded_top_srcdir)
1164 AC_SUBST(expanded_exec_prefix)
1165 AC_SUBST(expanded_libdir)
1166 AC_SUBST(expanded_libexecdir)
1167 AC_SUBST(expanded_datadir)
1168 AC_SUBST(expanded_infodir)
1169 default_layout_autotools="true"
1170 AC_SUBST(default_layout_autotools)
1171 AC_SUBST(LDFLAGS)
1172 AC_SUBST(default_sharedirs)
1174 dnl Look for grep that can handle long lines and -e.
1175 AC_PROG_EGREP
1176 AC_SUBST(EGREP)
1177 AC_PATH_PROG([CAT],[cat])
1178 AC_PROG_SED
1179 AC_PROG_AWK
1180 AM_PATH_PYTHON
1182 # Configure these files and make them executable
1183 AC_CONFIG_FILES([maxima-local], chmod +x maxima-local)
1184 AC_CONFIG_FILES([xmaxima-local], chmod +x xmaxima-local)
1186 # Convert maxima.bat to DOS line ending
1187 # sed-3.02 in old mingw distribution doesn't support -i or \r
1188 # dos2unix may not be present, but perl is required elsewhere
1189 # perl -i interferes with binmode so need to use a temporary file
1190 AC_CONFIG_FILES([src/maxima.bat], (perl -ne 'BEGIN{binmode(STDOUT,":crlf")};' -e 'print' < src/maxima.bat > src/maxima.bat.tmp; mv src/maxima.bat.tmp src/maxima.bat))
1192 AC_OUTPUT(Makefile maxima.spec maxima.iss \
1193 admin/Makefile src/Makefile src/maxima src/rmaxima src/autoconf-variables.lisp \
1194 src/share-subdirs.lisp \
1195 lisp-utils/Makefile tests/Makefile doc/Makefile \
1196 crosscompile-windows/Makefile \
1197 doc/emaxima/Makefile doc/info/Makefile doc/info/include-maxima.texi \
1198 desktopintegration/Makefile \
1199 doc/info/texi2html.init \
1200 doc/info/figures/Makefile \
1201 doc/info/de/Makefile \
1202 doc/info/de.utf8/Makefile doc/info/es/Makefile doc/info/es.utf8/Makefile \
1203 doc/info/pt/Makefile doc/info/pt.utf8/Makefile \
1204 doc/info/pt/include-maxima.texi \
1205 doc/info/pt_BR/Makefile doc/info/pt_BR.utf8/Makefile \
1206 doc/intromax/Makefile doc/man/Makefile doc/man/maxima.1 doc/man/ru/maxima.1 \
1207 doc/share/Makefile interfaces/Makefile interfaces/emacs/Makefile \
1208 interfaces/emacs/emaxima/Makefile interfaces/emacs/imaxima/Makefile \
1209 interfaces/emacs/misc/Makefile interfaces/xmaxima/Makefile \
1210 interfaces/xmaxima/autoconf-variables.tcl interfaces/xmaxima/Tkmaxima/Header.tcl \
1211 interfaces/xmaxima/doc/Makefile interfaces/xmaxima/doc/figures/Makefile \
1212 interfaces/xmaxima/msgs/Makefile interfaces/xmaxima/win32/Makefile \
1213 plotting/mgnuplot share/Makefile demo/Makefile plotting/Makefile locale/Makefile \
1214 share/contrib/Makefile share/contrib/integration/Makefile \
1215 share/contrib/maxima-odesolve/Makefile \
1216 share/draw/Makefile share/logic/Makefile  doc/info/es/include-maxima.texi \
1217 src/lisp)
1219 echo
1220 echo "Summary:"
1221 if test x"${clisp}" = xtrue ; then
1222         echo "clisp enabled. Executable name: \"${CLISP_NAME}\""
1223         echo "clisp runtime is \"${CLISP_RUNTIME_PATH}\""
1225 if test x"${clisp_exec}" = xtrue ; then
1226    echo "clisp executable image enabled for maxima."
1228 if test x"${cmucl}" = xtrue ; then
1229         echo "CMUCL enabled. Executable name: \"${CMUCL_NAME}\""
1230         echo "cmucl runtime is \"${CMUCL_RUNTIME_PATH}\""
1232 if test x"${cmucl_exec}" = xtrue; then
1233         echo "CMUCL executable image enabled for maxima."
1235 if test x"${scl}" = xtrue ; then
1236         echo "SCL enabled. Executable name: \"${SCL_NAME}\""
1237         echo "SCL runtime is \"${SCL_RUNTIME_PATH}\""
1239 if test x"${sbcl}" = xtrue ; then
1240         echo "SBCL enabled. Executable name: \"${SBCL_NAME}\""
1242 if test x"${sbcl_exec}" = xtrue ; then
1243    echo "sbcl executable image enabled for maxima."
1245 if test x"${gcl}" = xtrue ; then
1246         echo "GCL enabled. Executable name: \"${GCL_NAME}\""
1247         if test x"${gcl_alt_link}" = xtrue ; then
1248                 echo "    GCL alternative linking method enabled."
1249         fi
1251 if test x"${acl}" = xtrue ; then
1252         echo "ACL enabled. Executable name: \"${ACL_NAME}\""
1254 if test x"${openmcl}" = xtrue ; then
1255         echo "OpenMCL enabled. Executable name: \"${OPENMCL_NAME}\""
1257 if test x"${openmcl_exec}" = xtrue ; then
1258    echo "OpenMCL executable image enabled for maxima."
1260 if test x"${ccl64}" = xtrue ; then
1261         echo "CCL64 enabled. Executable name: \"${CCL64_NAME}\""
1263 if test x"${ccl64_exec}" = xtrue ; then
1264    echo "CCL64 executable image enabled for maxima."
1266 if test x"${ecl}" = xtrue ; then
1267         echo "ECL enabled. Executable name: \"${ECL_NAME}\""
1269 echo "default lisp: $DEFAULTLISP"
1270 echo "wish executable name: \"${WISH}\""
1272 if test x"${chm}" = xtrue ; then
1273   echo "CHM help files enabled"
1274   echo "  HHC: \"${HHC}\""
1276 if test x"${xmaxima_exe}" = xtrue ; then
1277    echo "Windows xmaxima.exe enabled"
1278    echo "  GCC version GCCVER: ${GCCVER}"
1279    echo "  TCLKITSH: ${TCLKITSH}"
1280    if ! test -f "${TCLKITSH}" ; then
1281      AC_MSG_WARN(*** TCLKITSH ${TCLKITSH} not found)
1282      xmaxima_exe_prerequisite=notfound
1283    fi
1284    echo "  TCLKIT_RUNTIME: ${TCLKIT_RUNTIME}"
1285    if ! test -f "${TCLKIT_RUNTIME}" ; then
1286      AC_MSG_WARN(*** TCLKIT_RUNTIME ${TCLKIT_RUNTIME} not found)
1287      xmaxima_exe_prerequisite=notfound
1288    fi
1289    echo "  SDXKIT: ${SDXKIT}"
1290    if ! test -f "${SDXKIT}" ; then
1291      AC_MSG_WARN(*** SDXKIT ${SDXKIT} not found)
1292      xmaxima_exe_prerequisite=notfound
1293    fi
1294    echo "  IMGKIT: ${IMGKIT}"
1295    if ! test -f "${IMGKIT}" ; then
1296      AC_MSG_WARN(*** IMGKIT ${IMGKIT} not found)
1297      xmaxima_exe_prerequisite=notfound
1298    fi
1299    if test x${xmaxima_exe_prerequisite} = xnotfound ; then
1300      AC_MSG_WARN([A prerequisite for xmaxima.exe not found.  The missing components can be defined on the make command line.])
1301    fi