Handle specreps in STRIP-LINEINFO
[maxima.git] / configure.ac
blob2a8a3e31d7730261b7a12609abc21e0d58bc950a
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.45post])
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 # This enables running the testbench for "make check" on gcl versions with the old
20 # memory management (Which in January 2018 includes all Versions shipped with debian
21 # and Ubuntu)
22 export GCL_MEM_MULTIPLE=0.1
24 AM_PATH_LISPDIR
26 AC_CANONICAL_HOST
28 dnl If we were using a C compiler, EXEEXT would get defined
29 dnl automatically. But we aren't, so we have to define it ourselves.
30 dnl Still to do: Add Win64 support here, if this is needed.
31 case "$host" in
32         *mingw*)
33                 win32=true
34                 win64=false
35                 mingw=true
36                 EXEEXT=.exe
37                 CLISPEXT=${EXEEXT}
38                 ;;
39         *cygwin*)
40                 win32=false
41                 win64=false
42                 mingw=false
43                 EXEEXT=.exe
44                 CLISPEXT=${EXEEXT}
45                 ;;
46         *)
47                 win32=false
48                 win64=false
49                 mingw=false
50                 EXEEXT=
51                 CLISPEXT=.run
52 esac
53 AC_SUBST(EXEEXT)
54 AC_SUBST(win32)
55 AC_SUBST(win64)
56 AM_CONDITIONAL(WIN32, test x$win32 = xtrue)
57 AM_CONDITIONAL(WIN64, test x$win64 = xtrue)
59 dnl To make life more confusing, the automake test machinery (which we
60 dnl use in ./tests) needs the am__EXEEXT conditional. This would have
61 dnl normally been expanded (via something we've copied from Automake's
62 dnl init.m4 into our aclocal.m4) as Automake computed EXEEXT, but it
63 dnl didn't so we have to drop this in ourselves.
64 AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])
66 explicit_lisp=false
67 lisps_enabled=""
69 dnl Compiling with abcl requires a jre and the path to abcl.jar
70 AC_ARG_ENABLE(abcl,
71         [  --enable-abcl                Use abcl, requires --with-abcl-jar],
72         [case "${enableval}" in
73                 yes) abcl=true 
74                      lisps_enabled="${lisps_enabled} abcl"
75                      explicit_lisp=true ;;
76                 no)  abcl=false ;;
77                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-abcl) ;;
78         esac
79         explicit_lisp=true],
80         [abcl=false])
81 ABCL_JAR=`pwd`/"abcl.jar"
82 AC_ARG_WITH(abcl-jar,
83         [  --with-abcl-jar=<jarfile>    Use <jarfile> as abcl install (default ./abcl.jar)],
84         [abcl=true
85         lisps_enabled="${lisps_enabled} abcl"
86         explicit_lisp=true
87         ABCL_JAR="${withval}"])
88         
89 AC_ARG_WITH(jre,
90         [  --with-jre=<jre>             When compiling with abcl: use <jre> as Java interpreter],
91         [JRE="${withval}"],
92         [JRE="java"])
94 if test x"${abcl}" = xtrue ; then
95      if test -e "${ABCL_JAR}" ; then
96           echo Using abcl found in ${ABCL_JAR}
97      else
98         AC_MSG_ERROR(${ABCL_JAR} not found.)
99      fi
102 dnl n.b. clisp_default_name is hardcoded in "with" message
103 clisp_default_name=clisp
104 AC_ARG_ENABLE(clisp,
105         [  --enable-clisp               Use clisp],
106         [case "${enableval}" in
107                 yes) clisp=true 
108                      lisps_enabled="${lisps_enabled} clisp"
109                      explicit_lisp=true ;;
110                 no)  clisp=false ;;
111                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-clisp) ;;
112         esac
113         explicit_lisp=true],
114         [clisp=false])
115 AC_ARG_WITH(clisp,
116         [  --with-clisp=<prog>          Use clisp executable <prog> (default clisp)],
117         [clisp=true
118         lisps_enabled="${lisps_enabled} clisp"
119         explicit_lisp=true
120         if test "$withval" = "yes"; then
121                 CLISP_NAME="${clisp_default_name}"
122         else
123                 CLISP_NAME="$withval"
124         fi],
125         [CLISP_NAME=${clisp_default_name}])
126         CLISP_RUNTIME="lisp${CLISPEXT}"
127 AC_ARG_WITH(clisp-runtime,
128         [  --with-clisp-runtime=<path>  Use clisp runtime <path> (default
129                                   *lib-directory*/base/lisp.run on unix,
130                                   *lib-directory*\\lisp.exe on windows) ],
131         [clisp=true
132         lisps_enabled="${lisps_enabled} clisp"
133         CLISP_RUNTIME_PATH="$withval"
134         CLISP_RUNTIME=`basename ${CLISP_RUNTIME_PATH}`],
135         [])
136 AC_ARG_ENABLE(clisp-exec,
137         [  --enable-clisp-exec          Create a maxima executable image using CLISP.
138                                 No check is made if the version of 
139                                 CLISP supports executable images],
140         [case "${enableval}" in
141             yes) clisp_exec=true 
142                  clisp=true 
143                  lisps_enabled="${lisps_enabled} clisp"
144                  explicit_lisp=true ;;
145             no) clisp_exec=false ;;
146             *) AC_MSG_ERROR(bad value ${enableval} for --enable-clisp-exec) ;;
147          esac
148          CLISP_EXEC=${clisp_exec}],
149         [clisp_exec=false
150          CLISP_EXEC=false])
151 if test x"${clisp}" = xtrue ; then
152         if test `echo "$CLISP_NAME" | sed 's/\(.\).*/\1/'` = "/" ; then
153                 if test -x "$CLISP_NAME" ; then
154                         clisp_found=true
155                 else
156                         clisp_found=false
157                 fi
158         else
159                 AC_CHECK_PROG(clisp_found,$CLISP_NAME,true,false)
160         fi
161         if test x"${clisp_found}" = xfalse ; then
162                 AC_MSG_WARN(clisp executable ${CLISP_NAME} not found in PATH)
163         fi         
167 dnl See if git exists.  If it does, update VERSION to include a git tag
168 AC_CHECK_PROG(git_found, git, true, false)
169 if test x"${git_found}" = xtrue; then
170     # Test to see if git describe works (discarding any output).  If
171     # it works, use it.  Otherwise, keep existing value of VERSION.
172     # (git describe fails if git is executed in a non-Git directory, e.g.,
173     # an unpacked tarball. Since the exit codes of git describe are undocumented,
174     # we cannot distinguish that from a missing annotated tag.
175     # Play it safe by refusing to change VERSION.)
176     if git describe > /dev/null 2>&1; then
177         VERSION="`git describe --dirty`"
178         # When building RPMs, hyphens in the version are not allowed, so
179         # replace them with underscores.
180         VERSION=`echo $VERSION | sed 's;-;_;g'`
181     fi
184 dnl Parses the version number for the manual
185 manual_version=`echo $VERSION | sed 's+branch_++; s+_base++; s+_dirty++; s+_+.+g'`
186 AC_SUBST(manual_version)
188 dnl n.b. cmucl_default_name is hardcoded in "with" message
189 cmucl_default_name=lisp
190 CMUCL_RUNTIME=lisp
191 AC_ARG_ENABLE(cmucl,
192         [  --enable-cmucl               Use CMUCL],
193         [case "${enableval}" in
194                 yes) cmucl=true 
195                      lisps_enabled="${lisps_enabled} cmucl"
196                      explicit_lisp=true ;;
197                 no)  cmucl=false ;;
198                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-cmucl) ;;
199         esac
200         explicit_lisp=true],
201         [cmucl=false])
202 AC_ARG_WITH(cmucl,
203         [  --with-cmucl=<prog>          Use CMUCL executable <prog> (default lisp)],
204         [cmucl=true
205         lisps_enabled="${lisps_enabled} cmucl"
206         explicit_lisp=true
207         if test "$withval" = "yes"; then
208                 CMUCL_NAME="${cmucl_default_name}"
209         else
210                 CMUCL_NAME="$withval"
211         fi],
212         [CMUCL_NAME=${cmucl_default_name}])
213 AC_ARG_WITH(cmucl-runtime,
214         [  --with-cmucl-runtime=<path>  Use CMUCL runtime <path> (default
215                                   *cmucl-lib*/../bin/lisp)],
216         [cmucl=true
217         lisps_enabled="${lisps_enabled} cmucl"
218         CMUCL_RUNTIME_PATH="$withval"
219         CMUCL_RUNTIME=`basename ${CMUCL_RUNTIME_PATH}`],
220         [])
221 AC_ARG_ENABLE(cmucl-exec,
222         [  --enable-cmucl-exec          Create a maxima executable image using CMUCL.
223                                 No check is made if the version of 
224                                 CMUCL supports executable images],
225         [case "${enableval}" in
226             yes) cmucl_exec=true
227                  cmucl=true 
228                  lisps_enabled="${lisps_enabled} cmucl"
229                  explicit_lisp=true ;;
230             no) cmucl_exec=false ;;
231             *) AC_MSG_ERROR(bad value ${enableval} for --enable-cmucl-exec) ;;
232          esac
233          CMUCL_EXEC=${cmucl_exec}],
234         [cmucl_exec=false
235          CMUCL_EXEC=false])
236 if test x"${cmucl}" = xtrue ; then
237         if test `echo "$CMUCL_NAME" | sed 's/\(.\).*/\1/'` = "/" ; then
238                 if test -x "$CMUCL_NAME" ; then
239                         cmucl_found=true
240                 else
241                         cmucl_found=false
242                 fi
243         else
244                 AC_CHECK_PROG(cmucl_found,$CMUCL_NAME,true,false)
245         fi
246         AC_CHECK_PROG(cmucl_found,$CMUCL_NAME,true,false)
247         if test x"${cmucl_found}" = xfalse ; then
248                 AC_MSG_WARN(cmucl executable ${CMUCL_NAME} not found in PATH)
249         fi
252 dnl n.b. scl_default_name is hardcoded in "with" message
253 scl_default_name=scl
254 SCL_RUNTIME=lisp
255 AC_ARG_ENABLE(scl,
256         [  --enable-scl                 Use SCL],
257         [case "${enableval}" in
258                 yes) scl=true 
259                      lisps_enabled="${lisps_enabled} scl"
260                      explicit_lisp=true ;;
261                 no)  scl=false ;;
262                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-scl) ;;
263         esac
264         explicit_lisp=true],
265         [scl=false])
266 AC_ARG_WITH(scl,
267         [  --with-scl=<prog>            Use SCL executable <prog> (default scl)],
268         [scl=true
269         lisps_enabled="${lisps_enabled} scl"
270         explicit_lisp=true
271         if test "$withval" = "yes"; then
272                 SCL_NAME="${scl_default_name}"
273         else
274                 SCL_NAME="$withval"
275         fi],
276         [SCL_NAME=${scl_default_name}])
277 AC_ARG_WITH(scl-runtime,
278         [  --with-scl-runtime=<path>    Use SCL runtime <path> (default
279                                   file://library/../bin/lisp)],
280         [scl=true
281         lisps_enabled="${lisps_enabled} scl"
282         SCL_RUNTIME_PATH="$withval"
283         SCL_RUNTIME=`basename ${SCL_RUNTIME_PATH}`],
284         [])
285 if test x"${scl}" = xtrue ; then
286         if test `echo "$SCL_NAME" | sed 's/\(.\).*/\1/'` = "/" ; then
287                 if test -x "$SCL_NAME" ; then
288                         scl_found=true
289                 else
290                         scl_found=false
291                 fi
292         else
293                 AC_CHECK_PROG(scl_found,$SCL_NAME,true,false)
294         fi
295         AC_CHECK_PROG(scl_found,$SCL_NAME,true,false)
296         if test x"${scl_found}" = xfalse ; then
297                 AC_MSG_WARN(scl executable ${SCL_NAME} not found in PATH)
298         fi
301 dnl n.b. sbcl_default_name is hardcoded in "with" message
302 sbcl_default_name=sbcl
303 AC_ARG_ENABLE(sbcl,
304         [  --enable-sbcl                Use SBCL],
305         [case "${enableval}" in
306                 yes) sbcl=true 
307                      lisps_enabled="${lisps_enabled} sbcl"
308                      explicit_lisp=true ;;
309                 no)  sbcl=false ;;
310                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-sbcl) ;;
311         esac
312         explicit_lisp=true],
313         [sbcl=false])
314 AC_ARG_WITH(sbcl,
315         [  --with-sbcl=<prog>           Use SBCL executable <prog> (default sbcl)],
316         [sbcl=true
317         lisps_enabled="${lisps_enabled} sbcl"
318         explicit_lisp=true
319         if test "$withval" = "yes"; then
320                 SBCL_NAME="${sbcl_default_name}"
321         else
322                 SBCL_NAME="$withval"
323         fi],
324         [SBCL_NAME="${sbcl_default_name}"])
325 AC_ARG_ENABLE(sbcl-exec,
326         [  --enable-sbcl-exec           Create a maxima executable image using SBCL.
327                                 No check is made if the version of 
328                                 SBCL supports executable images],
329         [case "${enableval}" in
330             yes) sbcl_exec=true 
331                  sbcl=true 
332                  lisps_enabled="${lisps_enabled} sbcl"
333                  explicit_lisp=true ;;
334             no) sbcl_exec=false ;;
335             *) AC_MSG_ERROR(bad value ${enableval} for --enable-sbcl-exec) ;;
336          esac
337          SBCL_EXEC=${sbcl_exec}],
338         [sbcl_exec=false
339          SBCL_EXEC=false])
340 if test x"${sbcl}" = xtrue ; then
341         if test `echo "$SBCL_NAME" | sed 's/\(.\).*/\1/'` = "/" ; then
342                 if test -x "$SBCL_NAME" ; then
343                         sbcl_found=true
344                 else
345                         sbcl_found=false
346                 fi
347         else
348                 AC_CHECK_PROG(sbcl_found,"$SBCL_NAME",true,false)
349         fi
350         AC_CHECK_PROG(sbcl_found,"$SBCL_NAME",true,false)
351         if test x"${sbcl_found}" = xfalse ; then
352                 AC_MSG_WARN(sbcl executable "${SBCL_NAME}" not found in PATH)
353         fi
355         
356 dnl n.b. acl_default_name is hardcoded in "with" message
357 acl_default_name=lisp
358 AC_ARG_ENABLE(acl,
359         [  --enable-acl                 Use ACL],
360         [case "${enableval}" in
361                 yes) acl=true 
362                      lisps_enabled="${lisps_enabled} acl"
363                      explicit_lisp=true ;;
364                 no)  acl=false ;;
365                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-acl) ;;
366         esac
367         explicit_lisp=true],
368         [acl=false])
369 AC_ARG_WITH(acl,
370         [  --with-acl=<prog>            Use ACL executable <prog> (default lisp)],
371         [acl=true
372         lisps_enabled="${lisps_enabled} acl"
373         explicit_lisp=true
374         if test "$withval" = "yes"; then
375                 ACL_NAME="${acl_default_name}"
376         else
377                 ACL_NAME="$withval"
378         fi],
379         [ACL_NAME=${acl_default_name}])
380 if test x"${acl}" = xtrue ; then
381         if test `echo "$ACL_NAME" | sed 's/\(.\).*/\1/'` = "/" ; then
382                 if test -x "$ACL_NAME" ; then
383                         acl_found=true
384                 else
385                         acl_found=false
386                 fi
387         else
388                 AC_CHECK_PROG(acl_found,$ACL_NAME,true,false)
389         fi
390         AC_CHECK_PROG(acl_found,$ACL_NAME,true,false)
391         if test x"${acl_found}" = xfalse ; then
392                 AC_MSG_WARN(acl executable ${ACL_NAME} not found in PATH)
393         fi
396 dnl n.b. gcl_default_name is hardcoded in "with" message
397 gcl_default_name=gcl
398 AC_ARG_ENABLE(gcl,
399         [  --enable-gcl                 Use GCL],
400         [case "${enableval}" in
401                 yes) gcl=true 
402                      lisps_enabled="${lisps_enabled} gcl"
403                      explicit_lisp=true;;
404                 no)  gcl=false ;;
405                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-gcl) ;;
406         esac],
407         [gcl=false])
408 AC_ARG_WITH(gcl,
409         [  --with-gcl=<prog>            Use GCL executable <prog> (default gcl)],
410         [gcl=true
411         lisps_enabled="${lisps_enabled} gcl"
412         explicit_lisp=true
413         if test "$withval" = "yes"; then
414                 GCL_NAME="${gcl_default_name}"
415         else
416                 GCL_NAME="$withval"
417         fi],
418         [GCL_NAME=${gcl_default_name}])
419 if test x"${gcl}" = xtrue ; then
420         if test `echo "$GCL_NAME" | sed 's/\(.\).*/\1/'` = "/" ; then
421                 if test -x "$GCL_NAME" ; then
422                         gcl_found=true
423                 else
424                         gcl_found=false
425                 fi
426         else
427                 AC_CHECK_PROG(gcl_found,$GCL_NAME,true,false)
428         fi
429         if test x"${gcl_found}" = xfalse ; then
430                 AC_MSG_WARN(gcl executable ${GCL_NAME} not found in PATH)
431         fi
434 dnl n.b. openmcl_default_name is hardcoded in "with" message
435 openmcl_default_name=openmcl
436 AC_ARG_ENABLE(openmcl,
437         [  --enable-openmcl             Use OpenMCL],
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-openmcl) ;;
444         esac],
445         [openmcl=false])
446 AC_ARG_WITH(openmcl,
447         [  --with-openmcl=<prog>        Use OpenMCL executable <prog> (default openmcl)],
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(openmcl-exec,
458         [  --enable-openmcl-exec        Create a maxima executable image using OPENMCL.
459                                 No check is made if the version of 
460                                 OPENMCL 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-openmcl-exec) ;;
468          esac
469          OPENMCL_EXEC=${openmcl_exec}],
470         [openmcl_exec=false
471          OPENMCL_EXEC=false])
473 dnl Define ccl as an alias (essentially) for openmcl
474 AC_ARG_ENABLE(ccl,
475         [  --enable-ccl                 Use CCL (Clozure Common Lisp)],
476         [case "${enableval}" in
477                 yes) openmcl=true 
478                      lisps_enabled="${lisps_enabled} openmcl"
479                      explicit_lisp=true;;
480                 no)  openmcl=false ;;
481                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-ccl) ;;
482         esac],
483         [openmcl=false])
484 AC_ARG_WITH(ccl,
485         [  --with-ccl=<prog>            Use OpenMCL executable <prog> (default ccl)],
486         [openmcl=true
487         lisps_enabled="${lisps_enabled} openmcl"
488         explicit_lisp=true
489         if test "$withval" = "yes"; then
490                 OPENMCL_NAME="${openmcl_default_name}"
491         else
492                 OPENMCL_NAME="$withval"
493         fi],
494         [OPENMCL_NAME=${openmcl_default_name}])
495 AC_ARG_ENABLE(ccl-exec,
496         [  --enable-ccl-exec            Create a maxima executable image using CCL.
497                                 No check is made if the version of 
498                                 CCL supports executable images],
499         [case "${enableval}" in
500             yes) openmcl_exec=true
501                  openmcl=true 
502                  lisps_enabled="${lisps_enabled} openmcl"
503                  explicit_lisp=true;;
504             no) openmcl_exec=false ;;
505             *) AC_MSG_ERROR(bad value ${enableval} for --enable-ccl-exec) ;;
506          esac
507          OPENMCL_EXEC=${openmcl_exec}],
508         [openmcl_exec=false
509          OPENMCL_EXEC=false])
511 if test x"${openmcl}" = xtrue ; then
512         if test `echo "$OPENMCL_NAME" | sed 's/\(.\).*/\1/'` = "/" ; then
513                 if test -x "$OPENMCL_NAME" ; then
514                         openmcl_found=true
515                 else
516                         openmcl_found=false
517                 fi
518         else
519                 AC_CHECK_PROG(openmcl_found,$OPENMCL_NAME,true,false)
520         fi
521         if test x"${openmcl_found}" = xfalse ; then
522                 AC_MSG_WARN(openmcl executable ${OPENMCL_NAME} not found in PATH)
523         fi
526 dnl n.b. ccl64_default_name is hardcoded in "with" message
527 dnl We assume we're running on an x86 processor.  The user has to
528 dnl select a different executable name to match his system, if neceessary.
530 ccl64_default_name=dx86cl64
531 AC_ARG_ENABLE(ccl64,
532         [  --enable-ccl64               Use CCL (Clozure Common Lisp), 64-bit],
533         [case "${enableval}" in
534                 yes) ccl64=true 
535                      lisps_enabled="${lisps_enabled} ccl64"
536                      explicit_lisp=true;;
537                 no)  ccl64=false ;;
538                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-ccl64) ;;
539         esac],
540         [ccl64=false])
541 AC_ARG_WITH(ccl64,
542         [  --with-ccl64=<prog>          Use ccl64 executable <prog> (default dx86cl64)],
543         [ccl64=true
544         lisps_enabled="${lisps_enabled} ccl64"
545         explicit_lisp=true
546         if test "$withval" = "yes"; then
547                 CCL64_NAME="${ccl64_default_name}"
548         else
549                 CCL64_NAME="$withval"
550         fi],
551         [CCL64_NAME=${ccl64_default_name}])
552 AC_ARG_ENABLE(ccl64-exec,
553         [  --enable-ccl64-exec          Create a maxima executable image using CCL.
554                                 No check is made if the version of 
555                                 CCL supports executable images],
556         [case "${enableval}" in
557             yes) ccl64_exec=true
558                  ccl64=true 
559                  lisps_enabled="${lisps_enabled} ccl64"
560                  explicit_lisp=true;;
561             no) ccl64_exec=false ;;
562             *) AC_MSG_ERROR(bad value ${enableval} for --enable-ccl64-exec) ;;
563          esac
564          CCL64_EXEC=${ccl64_exec}],
565         [ccl64_exec=false
566          CCL64_EXEC=false])
568 dnl n.b. ecl_default_name is hardcoded in "with" message
569 ecl_default_name=ecl
570 AC_ARG_ENABLE(ecl,
571         [  --enable-ecl                 Use ECL],
572         [case "${enableval}" in
573                 yes) ecl=true 
574                      lisps_enabled="${lisps_enabled} ecl"
575                      explicit_lisp=true;;
576                 no)  ecl=false ;;
577                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-ecl) ;;
578         esac],
579         [ecl=false])
580 AC_ARG_WITH(ecl,
581         [  --with-ecl=<prog>            Use ECL executable <prog> (default ecl)],
582         [ecl=true
583         lisps_enabled="${lisps_enabled} ecl"
584         explicit_lisp=true
585         if test "$withval" = "yes"; then
586                 ECL_NAME="${ecl_default_name}"
587         else
588                 ECL_NAME="$withval"
589         fi],
590         [ECL_NAME=${ecl_default_name}])
591 if test x"${ecl}" = xtrue ; then
592         if test `echo "$ECL_NAME" | sed 's/\(.\).*/\1/'` = "/" ; then
593                 if test -x "$ECL_NAME" ; then
594                         ecl_found=true
595                 else
596                         ecl_found=false
597                 fi
598         else
599                 AC_CHECK_PROG(ecl_found,$ECL_NAME,true,false)
600         fi
601         if test x"${ecl_found}" = xfalse ; then
602                 AC_MSG_WARN(ecl executable ${ECL_NAME} not found in PATH)
603         fi
606 dnl xgettext
607 AC_ARG_ENABLE(gettext,
608         [  --enable-gettext             Locale support],
609         [case "${enableval}" in
610                yes) enable_gettext=true  ;;
611                no)  enable_gettext=false ;;
612                *) AC_MSG_ERROR(bad value ${enableval} for --enable-gettext) ;;
613          esac],
614          [enable_gettext=false])
617 AM_CONDITIONAL(ENABLE_GETTEXT, test x$enable_gettext = xtrue)
619 AC_ARG_ENABLE(build-docs,
620         [  --enable-build-docs        Execute make in doc directories],
621         [case "${enableval}" in
622                yes) enable_build_docs=true  ;;
623                no)  enable_build_docs=false ;;
624                *) AC_MSG_ERROR(bad value ${enableval} for --enable-build-docs) ;;
625          esac],
626          [enable_build_docs=true])
629 AM_CONDITIONAL(ENABLE_BUILD_DOCS, test x$enable_build_docs = xtrue)
631 AC_CHECK_PROG(makeinfo_found,makeinfo,true,false)
633 if test x"${enable_build_docs}" = xtrue ; then
634     if test x"${makeinfo_found}" = xfalse ; then
635         AC_MSG_ERROR(No makeinfo found; consider --disable-build-docs)
636     fi
639 dnl languages
640 AC_ARG_ENABLE(lang-de,
641         [  --enable-lang-de             German language support],
642         [case "${enableval}" in
643                 yes) lang_de=true  ;;
644                 no)  lang_de=false ;;
645                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-lang-de) ;;
646         esac],
647         [lang_de=false])
649 AM_CONDITIONAL(LANG_DE, test x$lang_de = xtrue)
651 AC_ARG_ENABLE(lang-de-utf8,
652         [  --enable-lang-de-utf8        German language support (UTF-8)],
653         [case "${enableval}" in
654                 yes) lang_de_utf8=true  ;;
655                 no)  lang_de_utf8=false ;;
656                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-lang-de-utf8) ;;
657         esac],
658         [lang_de_utf8=false])
660 AM_CONDITIONAL(LANG_DE_UTF8, test x$lang_de_utf8 = xtrue)
662 AC_ARG_ENABLE(lang-es,
663         [  --enable-lang-es             Spanish language support],
664         [case "${enableval}" in
665                 yes) lang_es=true  ;;
666                 no)  lang_es=false ;;
667                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-lang-es) ;;
668         esac],
669         [lang_es=false])
671 AC_SUBST(lang_es)
672 AM_CONDITIONAL(LANG_ES, test x$lang_es = xtrue)
674 AC_ARG_ENABLE(lang-es-utf8,
675         [  --enable-lang-es-utf8        Spanish language support (UTF-8)],
676         [case "${enableval}" in
677                 yes) lang_es_utf8=true  ;;
678                 no)  lang_es_utf8=false ;;
679                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-lang-es-utf8) ;;
680         esac],
681         [lang_es_utf8=false])
683 AM_CONDITIONAL(LANG_ES_UTF8, test x$lang_es_utf8 = xtrue)
685 AC_ARG_ENABLE(lang-pt,
686         [  --enable-lang-pt             Portuguese language support],
687         [case "${enableval}" in
688                 yes) lang_pt=true  ;;
689                 no)  lang_pt=false ;;
690                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-lang-pt) ;;
691         esac],
692         [lang_pt=false])
694 AC_SUBST(lang_pt)
695 AM_CONDITIONAL(LANG_PT, test x$lang_pt = xtrue)
697 AC_ARG_ENABLE(lang-pt-utf8,
698         [  --enable-lang-pt-utf8        Portuguese language support (UTF-8)],
699         [case "${enableval}" in
700                 yes) lang_pt_utf8=true  ;;
701                 no)  lang_pt_utf8=false ;;
702                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-lang-pt-utf8) ;;
703         esac],
704         [lang_pt_utf8=false])
706 AM_CONDITIONAL(LANG_PT_UTF8, test x$lang_pt_utf8 = xtrue)
708 AC_ARG_ENABLE(lang-pt_BR,
709         [  --enable-lang-pt_BR          Brazilian Portuguese language support],
710         [case "${enableval}" in
711                 yes) lang_pt_br=true  ;;
712                 no)  lang_pt_br=false ;;
713                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-lang-pt_BR) ;;
714         esac],
715         [lang_pt_br=false])
717 AC_SUBST(lang_pt_br)
718 AM_CONDITIONAL(LANG_PT_BR, test x$lang_pt_br = xtrue)
720 AC_ARG_ENABLE(lang-pt_BR-utf8,
721         [  --enable-lang-pt_BR-utf8     Brazilian Portuguese language support (UTF-8)],
722         [case "${enableval}" in
723                 yes) lang_pt_br_utf8=true  ;;
724                 no)  lang_pt_br_utf8=false ;;
725                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-lang-pt_BR-utf8) ;;
726         esac],
727         [lang_pt_br_utf8=false])
729 AM_CONDITIONAL(LANG_PT_BR_UTF8, test x$lang_pt_br_utf8 = xtrue)
731 AC_ARG_ENABLE(recode,
732         [  --enable-recode              Use recode for charset conversion],
733         [case "${enableval}" in
734                 yes) use_recode=true  ;;
735                 no)  use_recode=false ;;
736                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-recode) ;;
737         esac],
738         [use_recode=false])
740 dnl iconv and/or recode
741 AC_CHECK_PROG(iconv_found,iconv,true,false)
742 AC_CHECK_PROG(recode_found,recode,true,false)
744 if test x"${use_recode}" = xtrue ; then
745     if test x"${recode_found}" = xfalse ; then
746         AC_MSG_ERROR(No recode found)
747     fi
748 elif test x"${iconv_found}" = xfalse ; then
749     use_recode=true 
750 else
751     use_recode=false
754 AM_CONDITIONAL(USE_RECODE, test x$use_recode = xtrue)
756 dnl Optionally build the windows CHM help files
757 dnl default to false as requires win32 and Microsoft HTML Help Workshop
758 AC_ARG_ENABLE(chm,
759   [  --enable-chm                 Build Windows CHM help files],
760   [case "${enableval}" in
761                 yes) chm=true ;;
762                 no)  chm=false ;;
763                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-chm) ;;
764    esac],
765    [chm=false])
766 AM_CONDITIONAL(CHM, test x$chm = xtrue)
767 dnl hhc is the HTML Help Compiler for CHM documentation
768 hhc_default_name=hhc$EXEEXT
769 AC_ARG_WITH(hhc,
770         [  --with-hhc=<prog>            Use HTML Help Compiler executable <prog> (default hhc)],
771         [hhc=true
772         if test "$withval" = "yes"; then
773                 HHC="${hhc_default_name}"
774         else
775                 HHC="$withval"
776         fi],
777         [HHC="${hhc_default_name}"])
779 # Check that hhc exists, using AC_CHECK_PROG
780 if test x$chm = xtrue; then
781   if test -x "${HHC}"; then
782     # HHC was a path to the executable, and it existed, which is
783     # great! We still say something to the caller, since this is
784     # probably less confusing.
785     AC_MSG_CHECKING([for hhc])
786     AC_MSG_RESULT([yes])
787   else
788     AC_CHECK_PROG(hhc_found, ${HHC}, yes)
789     if test x"${hhc_found}" != x"yes"; then
790       AC_MSG_ERROR([HTML Help Compiler executable ${HHC} not found])
791     fi
792   fi
795 dnl Make the build quiet
796 AC_ARG_ENABLE(quiet_build,
797   [  --enable-quiet-build         Make the build quieter],
798   [case "${enableval}" in
799      yes) quiet_build=true ;;
800      no)  quiet_build=false ;;
801      *) AC_MSG_ERROR(bad value ${enableval} for --enable-quiet-build) ;;
802    esac],
803   [quiet_build=false])
804 AM_CONDITIONAL(QUIET_BUILD, test x${quiet_build} = xtrue)
806 dnl Optionally build xmaxima.exe under windows
807 dnl default to false as additional software
808 AC_ARG_ENABLE(xmaxima_exe,
809   [  --enable-xmaxima-exe         Build Windows xmaxima.exe for installer],
810   [case "${enableval}" in
811                 yes) xmaxima_exe=true ;;
812                 no)  xmaxima_exe=false ;;
813                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-xmaxima-exe) ;;
814    esac],
815    [xmaxima_exe=false])
816 AM_CONDITIONAL(XMAXIMA_EXE, test x$xmaxima_exe = xtrue)
818 dnl Optionally build xmaxima.exe under windows
819 dnl default to false as additional software
820 AC_ARG_ENABLE(winkill_exe,
821   [  --enable-winkill             Build Windows winkill.exe and winkill_lib.dll for installer],
822   [case "${enableval}" in
823                 yes) winkill_exe=true ;;
824                 no)  winkill_exe=false ;;
825                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-winkill-exe) ;;
826    esac],
827    [winkill_exe=false])
828 AM_CONDITIONAL(WINKILL_EXE, test x$winkill_exe = xtrue)
830 dnl Should we build a win64 installer?
831 AC_ARG_ENABLE(win64-installer,
832   [  --enable-win64-installer     Build a 64bit installer on Windows],
833   [case "${enableval}" in
834                 yes) win64_installer=true ;;
835                 no) win64_installer=false ;;
836                 *) AC_MSG_ERROR(bad valu ${enableval} for --enable-win64-installer) ;;
837   esac],
838   [win64_installer=false])
839 AM_CONDITIONAL(WIN64_INSTALLER, test x$win64_installer = xtrue)
840 AC_SUBST(win64_installer)
842 dnl Enable use of MathJax in the html documentation.  This just loads
843 dnl MathJax in each html file.  The texi files need to put the
844 dnl appropriate @html/@end html text to generate the equations for MathJax.
845 AC_ARG_ENABLE(mathjax,
846   [  --enable-mathjax             Enable MathJax support for html manual],
847   [case "${enableval}" in
848       yes) mathjax=true
849            mathjax_enable='@set mathjax true'
850            mathjax_script='<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>'
852       no)  mathjax=false
853            mathjax_enable='@clear mathjax'
854            mathjax_script="";;
855       *) AC_MSG_ERROR(bad value ${enableval} for --enable-mathjax) ;;
856    esac],
857   [mathjax=false])
858 AM_CONDITIONAL(MATHJAX, test x$mathjax = xtrue)
859 AC_SUBST(mathjax_script)
860 AC_SUBST(mathjax_enable)
862 dnl Tools for building xmaxima.exe on windows
863 dnl Hard code the filenames for now.  Can over-ride on make command line
864 GCCVER=undefined
865 if test x${xmaxima_exe} = xtrue ; then
866   GCCVER=`gcc -dumpversion`
867   dnl http://tclkits.rkeene.org/fossil/wiki?name=Downloads
868   dnl and http://www.tcl.tk/starkits/
869   TCLKITSH=/c/programs/star/tclkitsh-8.6.3-win32-ix86.exe
870   TCLKIT_RUNTIME=/c/programs/star/tclkit-8.6.3-win32-ix86.exe
871   SDXKIT=/c/programs/star/sdx.kit
872   IMGKIT=/c/programs/star/img.kit
875 AC_SUBST(GCCVER)
876 AC_SUBST(TCLKITSH)
877 AC_SUBST(TCLKIT_RUNTIME)
878 AC_SUBST(SDXKIT)
879 AC_SUBST(IMGKIT)
880 AM_CONDITIONAL(GCC331, test x${GCCVER} = x3.3.1)
882 if test x"${explicit_lisp}" = xfalse ; then
883         dnl See if any of the lisps can be found
884         AC_CHECK_PROG(clisp_found,${clisp_default_name},true,false)
885         AC_CHECK_PROG(gcl_found,${gcl_default_name},true,false)
886         AC_CHECK_PROG(cmucl_found,$CMUCL_NAME,true,false)
887         AC_CHECK_PROG(scl_found,$SCL_NAME,true,false)
888         AC_CHECK_PROG(sbcl_found,$SBCL_NAME,true,false)
889         AC_CHECK_PROG(acl_found,$ACL_NAME,true,false)
890         AC_CHECK_PROG(openmcl_found,$OPENMCL_NAME,true,false)
891         AC_CHECK_PROG(ccl64_found,$CCL64_NAME,true,false)
892         AC_CHECK_PROG(ecl_found,$ECL_NAME,true,false)
894         if test x"${clisp_found}" = xtrue ; then
895                 clisp=true
896                 lisps_enabled="${lisps_enabled} clisp"
897         elif test x"${gcl_found}" = xtrue ; then
898                 gcl=true
899                 lisps_enabled="${lisps_enabled} gcl"
900         elif test x"${cmucl_found}" = xtrue ; then
901                 cmucl=true
902                 lisps_enabled="${lisps_enabled} cmucl"
903         elif test x"${scl_found}" = xtrue ; then
904                 scl=true
905                 lisps_enabled="${lisps_enabled} scl"
906         elif test x"${sbcl_found}" = xtrue ; then
907                 sbcl=true
908                 lisps_enabled="${lisps_enabled} sbcl"
909         elif test x"${acl_found}" = xtrue ; then
910                 acl=true
911                 lisps_enabled="${lisps_enabled} acl"
912         elif test x"${ecl_found}" = xtrue ; then
913                 ecl=true
914                 lisps_enabled="${lisps_enabled} ecl"
915         else
916                 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)
917         fi
920 AM_CONDITIONAL(ABCL, test x$abcl = xtrue)
921 AM_CONDITIONAL(CLISP, test x$clisp = xtrue)
922 AM_CONDITIONAL(CLISP_EXEC, test x$clisp_exec = xtrue)
923 AM_CONDITIONAL(GCL, test x$gcl = xtrue)
924 AM_CONDITIONAL(CMUCL, test x$cmucl = xtrue)
925 AM_CONDITIONAL(CMUCL_EXEC, test x${cmucl_exec} = xtrue)
926 AM_CONDITIONAL(SCL, test x$scl = xtrue)
927 AM_CONDITIONAL(SBCL, test x$sbcl = xtrue)
928 AM_CONDITIONAL(SBCL_EXEC, test x$sbcl_exec = xtrue)
929 AM_CONDITIONAL(ACL, test x$acl = xtrue)
930 AM_CONDITIONAL(OPENMCL, test x$openmcl = xtrue)
931 AM_CONDITIONAL(OPENMCL_EXEC, test x${openmcl_exec} = xtrue)
932 AM_CONDITIONAL(ECL, test x$ecl = xtrue)
933 AM_CONDITIONAL(CCL64, test x$ccl64 = xtrue)
934 AM_CONDITIONAL(CCL64_EXEC, test x${ccl64_exec} = xtrue)
936 if test x"${clisp}" = xtrue; then
937     if test x"${CLISP_RUNTIME_PATH}" = x"" ; then
938         if test x"${mingw}" = xtrue ; then
939             CLISP_RUNTIME_PATH=`${CLISP_NAME} -norc -q -x "(format nil \"~a${CLISP_RUNTIME}\" (namestring *lib-directory*))"|sed 's/\"\\(.*\\)\"/\\1/'`
940         else
941             CLISP_RUNTIME_PATH=`${CLISP_NAME} -norc -q -x "(format nil \"~abase/${CLISP_RUNTIME}\" (namestring *lib-directory*))"|sed 's/\"\\(.*\\)\"/\\1/'`
942         fi
943     fi
944     if test -x ${CLISP_RUNTIME_PATH} ; then
945         echo "clisp runtime is \"${CLISP_RUNTIME_PATH}\""
946     else
947         AC_MSG_ERROR(clisp runtime \"${CLISP_RUNTIME_PATH}\" is not an executable)
948     fi
949     CLISP_RUNTIME=`basename ${CLISP_RUNTIME_PATH}`
952 if test x"${cmucl}" = xtrue; then
953     if test x"${CMUCL_RUNTIME_PATH}" = x"" ; then
954         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)'`
955     fi
956     if test -x "${CMUCL_RUNTIME_PATH}" ; then
957         echo "cmucl runtime is \"${CMUCL_RUNTIME_PATH}\""
958     else
959 dnl last chance: find CMUCL_NAME in path. Use it if it doesn't appear to
960 dnl be a shell script.
961         cmucl_path=`type -p "${CMUCL_NAME}"`
962         if test x"`grep -c '#!.*bin.*sh.*' ${cmucl_path}`" = x"0" ; then
963                 CMUCL_RUNTIME_PATH="${cmucl_path}"
964         else
965                 AC_MSG_ERROR([Unable to determine CMUCL runtime path.
966 The best guess for CMUCL runtime, \"${CMUCL_RUNTIME_PATH}\", is not
967 an executable. Use the argument
968    --with-cmucl-runtime=<path>
969 to set the actual CMUCL executable. If the CMUCL lisp command is a shell
970 script the CMUCL executable is the program exec'd by that shell script.])
971         fi
972     fi
973     CMUCL_RUNTIME=`basename ${CMUCL_RUNTIME_PATH}`
975 dnl cmucl final check
976    result=`"${CMUCL_RUNTIME_PATH}" -quiet -eval '(format t "MAXIMA_CMUCL_TEST_SUCCESS%")(quit)'`
977    retval=$?
978    if test ! x"${retval}" = x"0" ; then
979       AC_MSG_ERROR(unable to run cmucl runtime = "${CMUCL_RUNTIME_PATH}". 
980 Please specify the full path of the cmucl runtime using the 
981     --with-cmucl-runtime=<path>
982 flag.)
983    fi
984    count=`echo "${result}" | grep -c "MAXIMA_CMUCL_TEST_SUCCESS"`
985    if test ! "${count}" = "1" ; then
986       AC_MSG_ERROR(an error occurred while checking cmucl runtime)
987    fi
990 if test x"${scl}" = xtrue; then
991     if test x"${SCL_RUNTIME_PATH}" = x"" ; then
992         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))'`
993     fi
994     if test -x "${SCL_RUNTIME_PATH}" ; then
995         echo "scl runtime is \"${SCL_RUNTIME_PATH}\""
996     else
997 dnl last chance: find SCL_NAME in path. Use it if it doesn't appear to
998 dnl be a shell script.
999         scl_path=`type -p "${SCL_NAME}"`
1000         if test x"`grep -c '#!.*bin.*sh.*' ${scl_path}`" = x"0" ; then
1001                 SCL_RUNTIME_PATH="${scl_path}"
1002         else
1003                 AC_MSG_ERROR([Unable to determine SCL runtime path.
1004 The best guess for SCL runtime, \"${SCL_RUNTIME_PATH}\", is not
1005 an executable. Use the argument
1006    --with-scl-runtime=<path>
1007 to set the actual SCL executable. If the SCL lisp command is a shell
1008 script the SCL executable is the program exec'd by that shell script.])
1009         fi
1010     fi
1011     SCL_RUNTIME=`basename ${SCL_RUNTIME_PATH}`
1014 if test x"${gcl}" = xtrue; then
1015    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)'`
1016    retval=$?
1017    if test ! x"${retval}" = x"0" ; then
1018       AC_MSG_ERROR(unable to run gcl executable \"${GCL_NAME}\".)
1019    fi
1020    count=`echo "${result}" | grep -c "MAXIMA_GCL_ANSI_TEST_SUCCESS"`
1021    if test ! "${count}" = "1" ; then
1022       AC_MSG_ERROR([The gcl executable \"${GCL_NAME}\" was not compiled with
1023 the --enable-ansi flag, which is required for Maxima.
1024 The gcl ANSI-CL check returned
1025 \"${result}\".])
1026    fi
1029 AC_ARG_ENABLE(gcl-alt-link,
1030         [  --enable-gcl-alt-link        Use GCL's alternate linking mechanism],
1031         [case "${enableval}" in
1032                 yes) gcl_alt_link=true ;;
1033                 no)  gcl_alt_link=false ;;
1034                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-gcl-alt-link) ;;
1035         esac],
1036         [gcl_alt_link=false])
1038 AM_CONDITIONAL(GCL_ALT_LINK, test x$gcl_alt_link = xtrue)
1040 AC_ARG_WITH(default-lisp,
1041         [  --with-default-lisp=<lisp>   Set default lisp implementation to <lisp>],
1042         [case "${withval}" in
1043                 clisp)
1044                         if test x"${clisp}" = xtrue ; then
1045                                 DEFAULTLISP=clisp
1046                         else
1047                                 AC_MSG_ERROR(clisp not enabled)
1048                         fi
1049                         ;;
1050                 cmucl)
1051                         if test x"${cmucl}" = xtrue ; then
1052                                 DEFAULTLISP=cmucl
1053                         else
1054                                 AC_MSG_ERROR(cmucl not enabled)
1055                         fi
1056                         ;;
1057                 scl)
1058                         if test x"${scl}" = xtrue ; then
1059                                 DEFAULTLISP=scl
1060                         else
1061                                 AC_MSG_ERROR(scl not enabled)
1062                         fi
1063                         ;;
1064                 sbcl)
1065                         if test x"${sbcl}" = xtrue ; then
1066                                 DEFAULTLISP=sbcl
1067                         else
1068                                 AC_MSG_ERROR(sbcl not enabled)
1069                         fi
1070                         ;;
1071                 gcl)
1072                         if test x"${gcl}" = xtrue ; then
1073                                 DEFAULTLISP=gcl
1074                         else
1075                                 AC_MSG_ERROR(gcl not enabled)
1076                         fi
1077                         ;;      
1078                 acl)
1079                         if test x"${acl}" = xtrue ; then
1080                                 DEFAULTLISP=acl
1081                         else
1082                                 AC_MSG_ERROR(acl not enabled)
1083                         fi
1084                         ;;      
1085                 openmcl)
1086                         if test x"${openmcl}" = xtrue ; then
1087                                 DEFAULTLISP=openmcl
1088                         else
1089                                 AC_MSG_ERROR(openmcl not enabled)
1090                         fi
1091                         ;;              
1092                 ecl)
1093                         if test x"${ecl}" = xtrue ; then
1094                                 DEFAULTLISP=ecl
1095                         else
1096                                 AC_MSG_ERROR(ecl not enabled)
1097                         fi
1098                         ;;
1099                 ccl64)          
1100                         if test x"${ccl64}" = xtrue ; then
1101                                 DEFAULTLISP=ccl64
1102                         else
1103                                 AC_MSG_ERROR(ccl64 not enabled)
1104                         fi
1105                         ;;              
1106                 abcl)           
1107                         if test x"${abcl}" = xtrue ; then
1108                                 DEFAULTLISP=abcl
1109                         else
1110                                 AC_MSG_ERROR(abcl not enabled)
1111                         fi
1112                         ;;              
1113                 *) 
1114                         AC_MSG_ERROR(Unknown argument ${DEFAULTLISP} to --with-default-lisp) 
1115                         ;;
1116         esac],
1117         [if test x"${sbcl}" = xtrue ; then
1118                 DEFAULTLISP=sbcl
1119         elif test x"${cmucl}" = xtrue ; then
1120                 DEFAULTLISP=cmucl
1121         elif test x"${scl}" = xtrue ; then
1122                 DEFAULTLISP=scl
1123         elif test x"${clisp}" = xtrue ; then
1124                 DEFAULTLISP=clisp
1125         elif test x"${gcl}" = xtrue ; then
1126                 DEFAULTLISP=gcl
1127         elif test x"${acl}" = xtrue ; then
1128                 DEFAULTLISP=acl
1129         elif test x"${openmcl}" = xtrue ; then
1130                 DEFAULTLISP=openmcl
1131         elif test x"${ecl}" = xtrue ; then
1132                 DEFAULTLISP=ecl
1133         elif test x"${ccl64}" = xtrue ; then
1134                 DEFAULTLISP=ccl64
1135         elif test x"${abcl}" = xtrue ; then
1136                 DEFAULTLISP=abcl
1137         else
1138                 AC_MSG_ERROR(Internal error. No lisp enabled. Please contact maintainer.)
1139         fi])
1141 AC_SUBST(CLISP_NAME)
1142 AC_SUBST(CLISP_RUNTIME)
1143 AC_SUBST(CLISP_RUNTIME_PATH)
1144 AC_SUBST(CMUCL_NAME)
1145 AC_SUBST(CMUCL_RUNTIME)
1146 AC_SUBST(CMUCL_RUNTIME_PATH)
1147 AC_SUBST(CMUCL_EXEC)
1148 AC_SUBST(SCL_NAME)
1149 AC_SUBST(SCL_RUNTIME)
1150 AC_SUBST(SCL_RUNTIME_PATH)
1151 AC_SUBST(SBCL_NAME)
1152 AC_SUBST(GCL_NAME)
1153 AC_SUBST(ACL_NAME)
1154 AC_SUBST(OPENMCL_NAME)
1155 AC_SUBST(ECL_NAME)
1156 AC_SUBST(CCL64_NAME)
1157 AC_SUBST(DEFAULTLISP)
1158 AC_SUBST(HHC)
1159 AC_SUBST(lisps_enabled)
1160 AC_SUBST(ABCL_JAR)
1161 AC_SUBST(JRE)
1163 AC_ARG_WITH(posix-shell,
1164         [  --with-posix-shell=<path>    Use <shell> for maxima script (default /bin/sh)],
1165         [posix_shell_list="${withval}"],
1166         [posix_shell_list="/bin/sh /bin/bash /usr/bin/bash /usr/local/bin/bash"])
1168 AC_ARG_WITH(wish,
1169         [  --with-wish=<prog>           Use <prog> for Tk wish shell (default wish)],
1170         [WISH="${withval}"],
1171         [WISH="wish"])
1172 AC_SUBST(WISH)
1175 AC_MSG_CHECKING(POSIX shell to see that it contains getopts)
1176 cat <<EOF > conftest-posix-shell.sh
1177 getopts "ab:" opt
1178 result="\$?"
1179 echo "result is \$result"
1180 exit "\$result"
1182 POSIX_SHELL=""
1183 for shell in $posix_shell_list
1185         if test -z "$POSIX_SHELL" ; then
1186                 echo "trying $shell"
1187                 $shell conftest-posix-shell.sh -a > /dev/null 2>&1
1188                 if test "$?" = "0" ; then
1189                         POSIX_SHELL="$shell"
1190                 fi
1191         fi
1192 done
1193 rm -f conftest-posix-shell.sh
1194 if test -n "$POSIX_SHELL" ; then
1195         AC_MSG_RESULT(POSIX shell is $POSIX_SHELL)
1196 else
1197         AC_MSG_WARN(Could not find a shell that supports getopts. 
1198 The maxima wrapper script will be unusable. The shell may be specified
1199 with --with-posix-shell=</path/to/shell>)
1201 AC_SUBST(POSIX_SHELL)
1203 if test x"${prefix}" = xNONE ; then
1204         tmp_prefix="/usr/local"
1205 else
1206         tmp_prefix="${prefix}"
1208 if test x"${exec_prefix}" = xNONE ; then
1209         tmp_exec_prefix="${tmp_prefix}"
1210 else
1211         tmp_exec_prefix="${exec_prefix}"
1213 expanded_top_srcdir="$(cd "$top_srcdir" 1>/dev/null 2>/dev/null; pwd)"
1214 expanded_exec_prefix="${tmp_exec_prefix}"
1215 expanded_libdir="$(eval "exec_prefix=\"${tmp_exec_prefix}\";echo ${libdir}")"
1216 expanded_libexecdir="$(eval "exec_prefix=\"${tmp_exec_prefix}\";echo ${libexecdir}")"
1217 expanded_datadir="$(eval "prefix=\"${tmp_prefix}\";datarootdir=\"${datarootdir}\";echo ${datadir}")"
1218 expanded_infodir="$(eval "prefix=\"${tmp_prefix}\";datarootdir=\"${datarootdir}\";echo ${infodir}")"
1221 dnl Find all the directories in share, but remove the share directory
1222 dnl itself and all CVS directories (if any) and fortran directories
1223 dnl and *.t2p directories (created when generating pdf documentation).
1224 dnl Remove the leading "share" part of the path, and add double-quotes
1225 dnl around it.
1227 #default_sharedirs=`find share -type d | sort | egrep -v 'share$|CVS|/fortran' | sed 's;share/\(.*\);        "\1" \\\\;' | sed '$s;\\\\;;'`
1228 default_sharedirs=`cd $srcdir;find share -type d | sort | egrep -v 'share$|CVS|/fortran' | sed 's;share/\(.*\);"\1";' | tr '\n' ' '`
1230 AC_SUBST(top_srcdir)
1231 AC_SUBST(abs_top_builddir)
1232 AC_SUBST(abs_top_srcdir)
1233 AC_SUBST(top_builddir)
1234 AC_SUBST(expanded_top_srcdir)
1235 AC_SUBST(expanded_exec_prefix)
1236 AC_SUBST(expanded_libdir)
1237 AC_SUBST(expanded_libexecdir)
1238 AC_SUBST(expanded_datadir)
1239 AC_SUBST(expanded_infodir)
1240 default_layout_autotools="true"
1241 AC_SUBST(default_layout_autotools)
1242 AC_SUBST(LDFLAGS)
1243 AC_SUBST(default_sharedirs)
1245 AC_ARG_WITH(emacs-prefix,
1246         [  --emacs-prefix=<path>        Where to install the emacs modes to],
1247         [EMACSDIR="$withval"],
1248         [EMACSDIR="${datarootdir}/emacs/site-lisp"])
1249 AC_SUBST(EMACSDIR)
1251 dnl Tell defsystem that this isn't a lisp-only build
1252 lisp_only_build="nil"
1253 AC_SUBST(lisp_only_build)
1254 dnl Extra files we want to clean from the src dir
1255 if test x"$srcdir" = x"." ; then
1256    DISTCLEAN_EXTRA_SRC_FILES=""
1257 else
1258    DISTCLEAN_EXTRA_SRC_FILES=share_subdirs.lisp
1260 AC_SUBST(DISTCLEAN_EXTRA_SRC_FILES)
1263 dnl Look for grep that can handle long lines and -e.
1264 AC_PROG_EGREP
1265 AC_SUBST(EGREP)
1266 AC_PATH_PROG([CAT],[cat])
1267 AC_PROG_SED
1268 AC_PROG_AWK
1269 AM_PATH_PYTHON
1270 AC_SUBST(SED)
1272 # Configure these files and make them executable
1273 AC_CONFIG_FILES([maxima-local], chmod +x maxima-local)
1274 AC_CONFIG_FILES([src/startmaxima_abcl.sh], chmod +x src/startmaxima_abcl.sh)
1275 AC_CONFIG_FILES([xmaxima-local], chmod +x xmaxima-local)
1276 AC_CONFIG_FILES([tests/test.sh], chmod +x tests/test.sh)
1277 AC_CONFIG_FILES([doc/info/build_html.sh], chmod +x doc/info/build_html.sh)
1278 AC_CONFIG_FILES([src/maxima], chmod +x src/maxima)
1279 AC_CONFIG_FILES([src/maxima.bat])
1281 AC_OUTPUT(Makefile maxima.spec maxima.iss \
1282 admin/Makefile src/Makefile src/rmaxima src/autoconf-variables.lisp \
1283 src/share-subdirs_autogenerated.lisp \
1284 lisp-utils/Makefile tests/Makefile doc/Makefile \
1285 crosscompile-windows/Makefile \
1286 doc/emaxima/Makefile doc/info/Makefile doc/info/include-maxima.texi \
1287 desktopintegration/Makefile \
1288 doc/info/texi2html.init \
1289 doc/info/figures/Makefile \
1290 doc/info/de/Makefile \
1291 doc/info/de.utf8/Makefile doc/info/es/Makefile doc/info/es.utf8/Makefile \
1292 doc/info/pt/Makefile doc/info/pt.utf8/Makefile \
1293 doc/info/pt/include-maxima.texi \
1294 doc/info/pt_BR/Makefile doc/info/pt_BR.utf8/Makefile \
1295 doc/intromax/Makefile doc/man/Makefile doc/man/maxima.1 doc/man/ru/Makefile doc/man/ru/maxima.1 doc/man/de/Makefile doc/man/de/maxima.1 \
1296 doc/share/Makefile interfaces/Makefile interfaces/emacs/Makefile \
1297 interfaces/emacs/emaxima/Makefile interfaces/emacs/imaxima/Makefile \
1298 interfaces/emacs/misc/Makefile interfaces/xmaxima/Makefile \
1299 interfaces/xmaxima/autoconf-variables.tcl interfaces/xmaxima/Tkmaxima/Header.tcl \
1300 interfaces/xmaxima/doc/Makefile interfaces/xmaxima/doc/figures/Makefile \
1301 interfaces/xmaxima/msgs/Makefile interfaces/xmaxima/win32/Makefile \
1302 plotting/mgnuplot share/Makefile demo/Makefile plotting/Makefile locale/Makefile \
1303 share/contrib/Makefile share/contrib/integration/Makefile \
1304 share/contrib/maxima-odesolve/Makefile \
1305 share/contrib/symplectic_ode/Makefile \
1306 share/draw/Makefile share/logic/Makefile  doc/info/es/include-maxima.texi \
1307 src/lisp)
1309 # The default of 4096 is sometimes too little for the test suite.
1310 if test x"${sbcl}" = xtrue ; then
1311    AC_MSG_CHECKING(Testing if sbcl complains if we try to enlarge the thread-local storage)
1312    echo "(quit)" | ${SBCL_NAME} --tls-limit 8192 > /dev/null 2>&1
1313    if test "$?" = "0" ; then
1314         SBCL_EXTRA_ARGS="--tls-limit 8192"
1315         AC_MSG_RESULT(Yes)
1316    else
1317         SBCL_EXTRA_ARGS=""
1318         AC_MSG_RESULT(No)
1319    fi
1321 AC_SUBST(SBCL_EXTRA_ARGS)
1323 if test x"${clisp}" = xtrue ; then
1324         echo
1325         AC_MSG_WARN("CLISP 2.49 is known to sporadically produce garbled data if the front-end is fast enough to acknowledge a data packet while a next data packet is still being prepared.")
1327 echo
1328 echo "Summary:"
1329 if test x"${clisp}" = xtrue ; then
1330         echo "Compiling a maxima image using \"${CLISP_NAME}\"",
1331         echo "clisp runtime is \"${CLISP_RUNTIME_PATH}\""
1332         if test x"${clisp_exec}" = xtrue ; then
1333                 echo "clisp executable image enabled for maxima."
1334         else
1335                 echo Use "--enable-clisp-exec to build a standalone executable instead."
1336         fi
1338 if test x"${cmucl}" = xtrue ; then
1339         echo "Compiling a maxima image using \"${CMUCL_NAME}\""
1340         echo "cmucl runtime is \"${CMUCL_RUNTIME_PATH}\""
1341         if test x"${cmucl_exec}" = xtrue; then
1342                 echo "CMUCL executable image enabled for maxima."
1343         else
1344                 echo Use "--enable-cmucl-exec to build a standalone executable instead."
1345         fi
1347 if test x"${scl}" = xtrue ; then
1348         echo "SCL enabled, using \"${SCL_NAME}\""
1349         echo "SCL runtime is \"${SCL_RUNTIME_PATH}\""
1351 if test x"${sbcl}" = xtrue ; then
1352         echo "Compiling a maxima image using \"${SBCL_NAME}\""
1353         if test x"${sbcl_exec}" = xtrue ; then
1354                 echo "sbcl executable image enabled for maxima."
1355         else
1356                 echo Use "--enable-sbcl-exec to build a standalone executable instead."
1357         fi
1359 if test x"${gcl}" = xtrue ; then
1360         echo "Compiling a maxima image using \"${GCL_NAME}\""
1361         if test x"${gcl_alt_link}" = xtrue ; then
1362                 echo "    GCL alternative linking method enabled."
1363         fi
1365 if test x"${acl}" = xtrue ; then
1366         echo "ACL enabled. Executable name: \"${ACL_NAME}\""
1368 if test x"${openmcl}" = xtrue ; then
1369         echo "Compiling a maxima image using \"${OPENMCL_NAME}\""
1370         if test x"${openmcl_exec}" = xtrue ; then
1371                 echo "OpenMCL executable image enabled for maxima."
1372         else
1373                 echo Use "--enable-openmcl-exec to build a standalone executable instead."
1374         fi
1376 if test x"${ccl64}" = xtrue ; then
1377         echo "Compiling a maxima image using \"${CCL64_NAME}\""
1378         if test x"${ccl64_exec}" = xtrue ; then
1379                 echo "CCL64 executable image enabled for maxima."
1380         else
1381                 echo Use "--enable-ccl64-exec to build a standalone executable instead."
1382         fi
1385 if test x"${ecl}" = xtrue ; then
1386         if test x"$srcdir" = x"." ; then
1387                 echo "Compiling maxima using \"${ECL_NAME}\""
1388         else
1389                 echo "ECL enabled. Executable name: \"${ECL_NAME}\""
1390                 AC_MSG_ERROR(For ECL out-of-tree builds aren't supported. See src/maxima.system for details.)
1391         fi
1394 if test x"${abcl}" = xtrue ; then
1395         if test x"$srcdir" = x"." ; then
1396                 echo "Compiling maxima using \"${ABCL_JAR}\""
1397         else
1398                 echo "ABCL enabled. ABCL jarfile: \"${ABCL_JAR}\""
1399                 AC_MSG_ERROR(For ABCL out-of-tree builds aren't supported. See src/maxima.system for details.)
1400         fi
1403 echo "default lisp: $DEFAULTLISP"
1404 echo "wish executable name: \"${WISH}\""
1406 if test x"${chm}" = xtrue ; then
1407   echo "CHM help files enabled"
1408   echo "  HHC: \"${HHC}\""
1410 if test x"${xmaxima_exe}" = xtrue ; then
1411    echo "Windows xmaxima.exe enabled"
1412    echo "  GCC version GCCVER: ${GCCVER}"
1413    echo "  TCLKITSH: ${TCLKITSH}"
1414    if ! test -f "${TCLKITSH}" ; then
1415      AC_MSG_WARN(*** TCLKITSH ${TCLKITSH} not found)
1416      xmaxima_exe_prerequisite=notfound
1417    fi
1418    echo "  TCLKIT_RUNTIME: ${TCLKIT_RUNTIME}"
1419    if ! test -f "${TCLKIT_RUNTIME}" ; then
1420      AC_MSG_WARN(*** TCLKIT_RUNTIME ${TCLKIT_RUNTIME} not found)
1421      xmaxima_exe_prerequisite=notfound
1422    fi
1423    echo "  SDXKIT: ${SDXKIT}"
1424    if ! test -f "${SDXKIT}" ; then
1425      AC_MSG_WARN(*** SDXKIT ${SDXKIT} not found)
1426      xmaxima_exe_prerequisite=notfound
1427    fi
1428    echo "  IMGKIT: ${IMGKIT}"
1429    if ! test -f "${IMGKIT}" ; then
1430      AC_MSG_WARN(*** IMGKIT ${IMGKIT} not found)
1431      xmaxima_exe_prerequisite=notfound
1432    fi
1433    if test x${xmaxima_exe_prerequisite} = xnotfound ; then
1434      AC_MSG_WARN([A prerequisite for xmaxima.exe not found.  The missing components can be defined on the make command line.])
1435    fi