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