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.
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.35post])
12 AC_CONFIG_SRCDIR([src/macsys.lisp])
13 AM_INIT_AUTOMAKE([-Wno-portability])
19 dnl Don't use AC_EXEEXT as that requires a C compiler
38 AM_CONDITIONAL(WIN32, test x$win32 = xtrue)
43 dnl n.b. clisp_default_name is hardcoded in "with" message
44 clisp_default_name=clisp
46 [ --enable-clisp Use clisp],
47 [case "${enableval}" in
49 lisps_enabled="${lisps_enabled} clisp"
52 *) AC_MSG_ERROR(bad value ${enableval} for --enable-clisp) ;;
57 [ --with-clisp=<prog> Use clisp executable <prog> (default clisp)],
59 lisps_enabled="${lisps_enabled} clisp"
61 if test "$withval" = "yes"; then
62 CLISP_NAME="${clisp_default_name}"
66 [CLISP_NAME=${clisp_default_name}])
67 if test x"${win32}" = x"true" ; then
68 CLISP_RUNTIME="lisp.exe"
70 CLISP_RUNTIME="lisp.run"
72 AC_ARG_WITH(clisp-runtime,
73 [ --with-clisp-runtime=<path> Use clisp runtime <path> (default
74 *lib-directory*/base/lisp.run on unix,
75 *lib-directory*\\lisp.exe on windows) ],
77 lisps_enabled="${lisps_enabled} clisp"
78 CLISP_RUNTIME_PATH="$withval"
79 CLISP_RUNTIME=`basename ${CLISP_RUNTIME_PATH}`],
81 AC_ARG_ENABLE(clisp-exec,
82 [ --enable-clisp-exec Create a maxima executable image using CLISP.
83 No check is made if the version of
84 CLISP supports executable images],
85 [case "${enableval}" in
88 lisps_enabled="${lisps_enabled} clisp"
90 no) clisp_exec=false ;;
91 *) AC_MSG_ERROR(bad value ${enableval} for --enable-clisp-exec) ;;
93 CLISP_EXEC=${clisp_exec}],
96 if test x"${clisp}" = xtrue ; then
97 if test `echo "$CLISP_NAME" | sed 's/\(.\).*/\1/'` = "/" ; then
98 if test -x "$CLISP_NAME" ; then
104 AC_CHECK_PROG(clisp_found,$CLISP_NAME,true,false)
106 if test x"${clisp_found}" = xfalse ; then
107 AC_MSG_WARN(clisp executable ${CLISP_NAME} not found in PATH)
112 dnl See if git exists. If it does, update VERSION to include a git tag
113 AC_CHECK_PROG(git_found, git, true, false)
114 if test x"${git_found}" = xtrue; then
115 # Test to see if git describe works (discarding any output). If
116 # it works, use it. Otherwise, keep existing value of VERSION.
117 # (git describe fails if git is executed in a non-Git directory, e.g.,
118 # an unpacked tarball. Since the exit codes of git describe are undocumented,
119 # we cannot distinguish that from a missing annotated tag.
120 # Play it safe by refusing to change VERSION.)
121 if git describe > /dev/null 2>&1; then
122 VERSION="`git describe --dirty`"
123 # When building RPMs, hyphens in the version are not allowed, so
124 # replace them with underscores.
125 VERSION=`echo $VERSION | sed 's;-;_;g'`
129 dnl Parses the version number for the manual
130 manual_version=`echo $VERSION | sed 's+branch_++; s+_base++; s+_dirty++; s+_+.+g'`
131 AC_SUBST(manual_version)
133 dnl n.b. cmucl_default_name is hardcoded in "with" message
134 cmucl_default_name=lisp
137 [ --enable-cmucl Use CMUCL],
138 [case "${enableval}" in
140 lisps_enabled="${lisps_enabled} cmucl"
141 explicit_lisp=true ;;
143 *) AC_MSG_ERROR(bad value ${enableval} for --enable-cmucl) ;;
148 [ --with-cmucl=<prog> Use CMUCL executable <prog> (default lisp)],
150 lisps_enabled="${lisps_enabled} cmucl"
152 if test "$withval" = "yes"; then
153 CMUCL_NAME="${cmucl_default_name}"
155 CMUCL_NAME="$withval"
157 [CMUCL_NAME=${cmucl_default_name}])
158 AC_ARG_WITH(cmucl-runtime,
159 [ --with-cmucl-runtime=<path> Use CMUCL runtime <path> (default
160 *cmucl-lib*/../bin/lisp)],
162 lisps_enabled="${lisps_enabled} cmucl"
163 CMUCL_RUNTIME_PATH="$withval"
164 CMUCL_RUNTIME=`basename ${CMUCL_RUNTIME_PATH}`],
166 AC_ARG_ENABLE(cmucl-exec,
167 [ --enable-cmucl-exec Create a maxima executable image using CMUCL.
168 No check is made if the version of
169 CMUCL supports executable images],
170 [case "${enableval}" in
173 lisps_enabled="${lisps_enabled} cmucl"
174 explicit_lisp=true ;;
175 no) cmucl_exec=false ;;
176 *) AC_MSG_ERROR(bad value ${enableval} for --enable-cmucl-exec) ;;
178 CMUCL_EXEC=${cmucl_exec}],
181 if test x"${cmucl}" = xtrue ; then
182 if test `echo "$CMUCL_NAME" | sed 's/\(.\).*/\1/'` = "/" ; then
183 if test -x "$CMUCL_NAME" ; then
189 AC_CHECK_PROG(cmucl_found,$CMUCL_NAME,true,false)
191 AC_CHECK_PROG(cmucl_found,$CMUCL_NAME,true,false)
192 if test x"${cmucl_found}" = xfalse ; then
193 AC_MSG_WARN(cmucl executable ${CMUCL_NAME} not found in PATH)
197 dnl n.b. scl_default_name is hardcoded in "with" message
201 [ --enable-scl Use SCL],
202 [case "${enableval}" in
204 lisps_enabled="${lisps_enabled} scl"
205 explicit_lisp=true ;;
207 *) AC_MSG_ERROR(bad value ${enableval} for --enable-scl) ;;
212 [ --with-scl=<prog> Use SCL executable <prog> (default scl)],
214 lisps_enabled="${lisps_enabled} scl"
216 if test "$withval" = "yes"; then
217 SCL_NAME="${scl_default_name}"
221 [SCL_NAME=${scl_default_name}])
222 AC_ARG_WITH(scl-runtime,
223 [ --with-scl-runtime=<path> Use SCL runtime <path> (default
224 file://library/../bin/lisp)],
226 lisps_enabled="${lisps_enabled} scl"
227 SCL_RUNTIME_PATH="$withval"
228 SCL_RUNTIME=`basename ${SCL_RUNTIME_PATH}`],
230 if test x"${scl}" = xtrue ; then
231 if test `echo "$SCL_NAME" | sed 's/\(.\).*/\1/'` = "/" ; then
232 if test -x "$SCL_NAME" ; then
238 AC_CHECK_PROG(scl_found,$SCL_NAME,true,false)
240 AC_CHECK_PROG(scl_found,$SCL_NAME,true,false)
241 if test x"${scl_found}" = xfalse ; then
242 AC_MSG_WARN(scl executable ${SCL_NAME} not found in PATH)
246 dnl n.b. sbcl_default_name is hardcoded in "with" message
247 sbcl_default_name=sbcl
249 [ --enable-sbcl Use SBCL],
250 [case "${enableval}" in
252 lisps_enabled="${lisps_enabled} sbcl"
253 explicit_lisp=true ;;
255 *) AC_MSG_ERROR(bad value ${enableval} for --enable-sbcl) ;;
260 [ --with-sbcl=<prog> Use SBCL executable <prog> (default sbcl)],
262 lisps_enabled="${lisps_enabled} sbcl"
264 if test "$withval" = "yes"; then
265 SBCL_NAME="${sbcl_default_name}"
269 [SBCL_NAME="${sbcl_default_name}"])
270 AC_ARG_ENABLE(sbcl-exec,
271 [ --enable-sbcl-exec Create a maxima executable image using SBCL.
272 No check is made if the version of
273 SBCL supports executable images],
274 [case "${enableval}" in
277 lisps_enabled="${lisps_enabled} sbcl"
278 explicit_lisp=true ;;
279 no) sbcl_exec=false ;;
280 *) AC_MSG_ERROR(bad value ${enableval} for --enable-sbcl-exec) ;;
282 SBCL_EXEC=${sbcl_exec}],
285 if test x"${sbcl}" = xtrue ; then
286 if test `echo "$SBCL_NAME" | sed 's/\(.\).*/\1/'` = "/" ; then
287 if test -x "$SBCL_NAME" ; then
293 AC_CHECK_PROG(sbcl_found,"$SBCL_NAME",true,false)
295 AC_CHECK_PROG(sbcl_found,"$SBCL_NAME",true,false)
296 if test x"${sbcl_found}" = xfalse ; then
297 AC_MSG_WARN(sbcl executable "${SBCL_NAME}" not found in PATH)
301 dnl n.b. acl_default_name is hardcoded in "with" message
302 acl_default_name=lisp
304 [ --enable-acl Use ACL],
305 [case "${enableval}" in
307 lisps_enabled="${lisps_enabled} acl"
308 explicit_lisp=true ;;
310 *) AC_MSG_ERROR(bad value ${enableval} for --enable-acl) ;;
315 [ --with-acl=<prog> Use ACL executable <prog> (default lisp)],
317 lisps_enabled="${lisps_enabled} acl"
319 if test "$withval" = "yes"; then
320 ACL_NAME="${acl_default_name}"
324 [ACL_NAME=${acl_default_name}])
325 if test x"${acl}" = xtrue ; then
326 if test `echo "$ACL_NAME" | sed 's/\(.\).*/\1/'` = "/" ; then
327 if test -x "$ACL_NAME" ; then
333 AC_CHECK_PROG(acl_found,$ACL_NAME,true,false)
335 AC_CHECK_PROG(acl_found,$ACL_NAME,true,false)
336 if test x"${acl_found}" = xfalse ; then
337 AC_MSG_WARN(acl executable ${ACL_NAME} not found in PATH)
341 dnl n.b. gcl_default_name is hardcoded in "with" message
344 [ --enable-gcl Use GCL],
345 [case "${enableval}" in
347 lisps_enabled="${lisps_enabled} gcl"
350 *) AC_MSG_ERROR(bad value ${enableval} for --enable-gcl) ;;
354 [ --with-gcl=<prog> Use GCL executable <prog> (default gcl)],
356 lisps_enabled="${lisps_enabled} gcl"
358 if test "$withval" = "yes"; then
359 GCL_NAME="${gcl_default_name}"
363 [GCL_NAME=${gcl_default_name}])
364 if test x"${gcl}" = xtrue ; then
365 if test `echo "$GCL_NAME" | sed 's/\(.\).*/\1/'` = "/" ; then
366 if test -x "$GCL_NAME" ; then
372 AC_CHECK_PROG(gcl_found,$GCL_NAME,true,false)
374 if test x"${gcl_found}" = xfalse ; then
375 AC_MSG_WARN(gcl executable ${GCL_NAME} not found in PATH)
379 dnl n.b. openmcl_default_name is hardcoded in "with" message
380 openmcl_default_name=openmcl
381 AC_ARG_ENABLE(openmcl,
382 [ --enable-openmcl Use OpenMCL],
383 [case "${enableval}" in
385 lisps_enabled="${lisps_enabled} openmcl"
388 *) AC_MSG_ERROR(bad value ${enableval} for --enable-openmcl) ;;
392 [ --with-openmcl=<prog> Use OpenMCL executable <prog> (default openmcl)],
394 lisps_enabled="${lisps_enabled} openmcl"
396 if test "$withval" = "yes"; then
397 OPENMCL_NAME="${openmcl_default_name}"
399 OPENMCL_NAME="$withval"
401 [OPENMCL_NAME=${openmcl_default_name}])
402 AC_ARG_ENABLE(openmcl-exec,
403 [ --enable-openmcl-exec Create a maxima executable image using OPENMCL.
404 No check is made if the version of
405 OPENMCL supports executable images],
406 [case "${enableval}" in
407 yes) openmcl_exec=true
409 lisps_enabled="${lisps_enabled} openmcl"
411 no) openmcl_exec=false ;;
412 *) AC_MSG_ERROR(bad value ${enableval} for --enable-openmcl-exec) ;;
414 OPENMCL_EXEC=${openmcl_exec}],
418 dnl Define ccl as an alias (essentially) for openmcl
420 [ --enable-ccl Use CCL (Clozure Common Lisp)],
421 [case "${enableval}" in
423 lisps_enabled="${lisps_enabled} openmcl"
426 *) AC_MSG_ERROR(bad value ${enableval} for --enable-ccl) ;;
430 [ --with-ccl=<prog> Use OpenMCL executable <prog> (default ccl)],
432 lisps_enabled="${lisps_enabled} openmcl"
434 if test "$withval" = "yes"; then
435 OPENMCL_NAME="${openmcl_default_name}"
437 OPENMCL_NAME="$withval"
439 [OPENMCL_NAME=${openmcl_default_name}])
440 AC_ARG_ENABLE(ccl-exec,
441 [ --enable-ccl-exec Create a maxima executable image using CCL.
442 No check is made if the version of
443 CCL supports executable images],
444 [case "${enableval}" in
445 yes) openmcl_exec=true
447 lisps_enabled="${lisps_enabled} openmcl"
449 no) openmcl_exec=false ;;
450 *) AC_MSG_ERROR(bad value ${enableval} for --enable-ccl-exec) ;;
452 OPENMCL_EXEC=${openmcl_exec}],
456 if test x"${openmcl}" = xtrue ; then
457 if test `echo "$OPENMCL_NAME" | sed 's/\(.\).*/\1/'` = "/" ; then
458 if test -x "$OPENMCL_NAME" ; then
464 AC_CHECK_PROG(openmcl_found,$OPENMCL_NAME,true,false)
466 if test x"${openmcl_found}" = xfalse ; then
467 AC_MSG_WARN(openmcl executable ${OPENMCL_NAME} not found in PATH)
471 dnl n.b. ecl_default_name is hardcoded in "with" message
474 [ --enable-ecl Use ECL],
475 [case "${enableval}" in
477 lisps_enabled="${lisps_enabled} ecl"
480 *) AC_MSG_ERROR(bad value ${enableval} for --enable-ecl) ;;
484 [ --with-ecl=<prog> Use ECL executable <prog> (default ecl)],
486 lisps_enabled="${lisps_enabled} ecl"
488 if test "$withval" = "yes"; then
489 ECL_NAME="${ecl_default_name}"
493 [ECL_NAME=${ecl_default_name}])
494 if test x"${ecl}" = xtrue ; then
495 if test `echo "$ECL_NAME" | sed 's/\(.\).*/\1/'` = "/" ; then
496 if test -x "$ECL_NAME" ; then
502 AC_CHECK_PROG(ecl_found,$ECL_NAME,true,false)
504 if test x"${ecl_found}" = xfalse ; then
505 AC_MSG_WARN(ecl executable ${ECL_NAME} not found in PATH)
510 AC_ARG_ENABLE(gettext,
511 [ --enable-gettext Locale support],
512 [case "${enableval}" in
513 yes) enable_gettext=true ;;
514 no) enable_gettext=false ;;
515 *) AC_MSG_ERROR(bad value ${enableval} for --enable-gettext) ;;
517 [enable_gettext=false])
519 AM_CONDITIONAL(ENABLE_GETTEXT, test x$enable_gettext = xtrue)
522 AC_ARG_ENABLE(lang-de,
523 [ --enable-lang-de German language support],
524 [case "${enableval}" in
527 *) AC_MSG_ERROR(bad value ${enableval} for --enable-lang-de) ;;
531 AM_CONDITIONAL(LANG_DE, test x$lang_de = xtrue)
533 AC_ARG_ENABLE(lang-de-utf8,
534 [ --enable-lang-de-utf8 German language support (UTF-8)],
535 [case "${enableval}" in
536 yes) lang_de_utf8=true ;;
537 no) lang_de_utf8=false ;;
538 *) AC_MSG_ERROR(bad value ${enableval} for --enable-lang-de-utf8) ;;
540 [lang_de_utf8=false])
542 AM_CONDITIONAL(LANG_DE_UTF8, test x$lang_de_utf8 = xtrue)
544 AC_ARG_ENABLE(lang-es,
545 [ --enable-lang-es Spanish language support],
546 [case "${enableval}" in
549 *) AC_MSG_ERROR(bad value ${enableval} for --enable-lang-es) ;;
553 AM_CONDITIONAL(LANG_ES, test x$lang_es = xtrue)
555 AC_ARG_ENABLE(lang-es-utf8,
556 [ --enable-lang-es-utf8 Spanish language support (UTF-8)],
557 [case "${enableval}" in
558 yes) lang_es_utf8=true ;;
559 no) lang_es_utf8=false ;;
560 *) AC_MSG_ERROR(bad value ${enableval} for --enable-lang-es-utf8) ;;
562 [lang_es_utf8=false])
564 AM_CONDITIONAL(LANG_ES_UTF8, test x$lang_es_utf8 = xtrue)
566 AC_ARG_ENABLE(lang-pt,
567 [ --enable-lang-pt Portuguese language support],
568 [case "${enableval}" in
571 *) AC_MSG_ERROR(bad value ${enableval} for --enable-lang-pt) ;;
575 AM_CONDITIONAL(LANG_PT, test x$lang_pt = xtrue)
577 AC_ARG_ENABLE(lang-pt-utf8,
578 [ --enable-lang-pt-utf8 Portuguese language support (UTF-8)],
579 [case "${enableval}" in
580 yes) lang_pt_utf8=true ;;
581 no) lang_pt_utf8=false ;;
582 *) AC_MSG_ERROR(bad value ${enableval} for --enable-lang-pt-utf8) ;;
584 [lang_pt_utf8=false])
586 AM_CONDITIONAL(LANG_PT_UTF8, test x$lang_pt_utf8 = xtrue)
588 AC_ARG_ENABLE(lang-pt_BR,
589 [ --enable-lang-pt_BR Brazilian Portuguese language support],
590 [case "${enableval}" in
591 yes) lang_pt_br=true ;;
592 no) lang_pt_br=false ;;
593 *) AC_MSG_ERROR(bad value ${enableval} for --enable-lang-pt_BR) ;;
597 AM_CONDITIONAL(LANG_PT_BR, test x$lang_pt_br = xtrue)
599 AC_ARG_ENABLE(lang-pt_BR-utf8,
600 [ --enable-lang-pt_BR-utf8 Brazilian Portuguese language support (UTF-8)],
601 [case "${enableval}" in
602 yes) lang_pt_br_utf8=true ;;
603 no) lang_pt_br_utf8=false ;;
604 *) AC_MSG_ERROR(bad value ${enableval} for --enable-lang-pt_BR-utf8) ;;
606 [lang_pt_br_utf8=false])
608 AM_CONDITIONAL(LANG_PT_BR_UTF8, test x$lang_pt_br_utf8 = xtrue)
610 AC_ARG_ENABLE(recode,
611 [ --enable-recode Use recode for charset conversion],
612 [case "${enableval}" in
613 yes) use_recode=true ;;
614 no) use_recode=false ;;
615 *) AC_MSG_ERROR(bad value ${enableval} for --enable-recode) ;;
619 dnl iconv and/or recode
620 AC_CHECK_PROG(iconv_found,iconv,true,false)
621 AC_CHECK_PROG(recode_found,recode,true,false)
623 if test x"${use_recode}" = xtrue ; then
624 if test x"${recode_found}" = xfalse ; then
625 AC_MSG_ERROR(No recode found)
627 elif test x"${iconv_found}" = xfalse ; then
633 AM_CONDITIONAL(USE_RECODE, test x$use_recode = xtrue)
635 dnl Optionally build the windows CHM help files
636 dnl default to false as requires win32 and Microsoft HTML Help Workshop
638 [ --enable-chm Build Windows CHM help files],
639 [case "${enableval}" in
642 *) AC_MSG_ERROR(bad value ${enableval} for --enable-chm) ;;
645 AM_CONDITIONAL(CHM, test x$chm = xtrue)
646 dnl hhc is the HTML Help Compiler for CHM documentation
647 hhc_default_name=hhc$EXEEXT
649 [ --with-hhc=<prog> Use HTML Help Compiler executable <prog> (default hhc)],
651 if test "$withval" = "yes"; then
652 HHC="${hhc_default_name}"
656 [HHC="${hhc_default_name}"])
658 # Check that hhc exists, using AC_CHECK_PROG
659 if test x$chm = xtrue; then
660 if test -x "${HHC}"; then
661 # HHC was a path to the executable, and it existed, which is
662 # great! We still say something to the caller, since this is
663 # probably less confusing.
664 AC_MSG_CHECKING([for hhc])
667 AC_CHECK_PROG(hhc_found, ${HHC}, yes)
668 if test x"${hhc_found}" != x"yes"; then
669 AC_MSG_ERROR([HTML Help Compiler executable ${HHC} not found])
674 dnl Optionally build xmaxima.exe under windows
675 dnl default to false as additional software
676 AC_ARG_ENABLE(xmaxima_exe,
677 [ --enable-xmaxima-exe Build Windows xmaxima.exe for installer],
678 [case "${enableval}" in
679 yes) xmaxima_exe=true ;;
680 no) xmaxima_exe=false ;;
681 *) AC_MSG_ERROR(bad value ${enableval} for --enable-xmaxima-exe) ;;
684 AM_CONDITIONAL(XMAXIMA_EXE, test x$xmaxima_exe = xtrue)
686 dnl Tools for building xmaxima.exe on windows
687 dnl Hard code the filenames for now. Can over-ride on make command line
689 if test x${xmaxima_exe} = xtrue ; then
690 GCCVER=`gcc -dumpversion`
691 if test x${GCCVER} = x3.3.1; then
693 TCLSTUBLIB=-ltclstub84
695 TCLINCLUDE=/c/tcl/include
696 TCLSTUBLIB=/c/tcl/lib/tclstub85.lib
698 dnl http://code.google.com/p/tclkit/ and http://www.tcl.tk/starkits/
699 TCLKITSH=/c/programs/star/tclkitsh-win32.upx.exe
700 TCLKIT_RUNTIME=/c/programs/star/tclkit-win32.upx.exe
701 SDXKIT=/c/programs/star/sdx.kit
702 IMGKIT=/c/programs/star/img.kit
709 AC_SUBST(TCLKIT_RUNTIME)
712 AM_CONDITIONAL(GCC331, test x${GCCVER} = x3.3.1)
714 if test x"${explicit_lisp}" = xfalse ; then
715 dnl See if any of the lisps can be found
716 AC_CHECK_PROG(clisp_found,${clisp_default_name},true,false)
717 AC_CHECK_PROG(gcl_found,${gcl_default_name},true,false)
718 AC_CHECK_PROG(cmucl_found,$CMUCL_NAME,true,false)
719 AC_CHECK_PROG(scl_found,$SCL_NAME,true,false)
720 AC_CHECK_PROG(sbcl_found,$SBCL_NAME,true,false)
721 AC_CHECK_PROG(acl_found,$ACL_NAME,true,false)
722 AC_CHECK_PROG(openmcl_found,$OPENMCL_NAME,true,false)
723 AC_CHECK_PROG(ecl_found,$ECL_NAME,true,false)
725 if test x"${clisp_found}" = xtrue ; then
727 lisps_enabled="${lisps_enabled} clisp"
728 elif test x"${gcl_found}" = xtrue ; then
730 lisps_enabled="${lisps_enabled} gcl"
731 elif test x"${cmucl_found}" = xtrue ; then
733 lisps_enabled="${lisps_enabled} cmucl"
734 elif test x"${scl_found}" = xtrue ; then
736 lisps_enabled="${lisps_enabled} scl"
737 elif test x"${sbcl_found}" = xtrue ; then
739 lisps_enabled="${lisps_enabled} sbcl"
740 elif test x"${acl_found}" = xtrue ; then
742 lisps_enabled="${lisps_enabled} acl"
743 elif test x"${ecl_found}" = xtrue ; then
745 lisps_enabled="${lisps_enabled} ecl"
747 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)
751 AM_CONDITIONAL(CLISP, test x$clisp = xtrue)
752 AM_CONDITIONAL(CLISP_EXEC, test x$clisp_exec = xtrue)
753 AM_CONDITIONAL(GCL, test x$gcl = xtrue)
754 AM_CONDITIONAL(CMUCL, test x$cmucl = xtrue)
755 AM_CONDITIONAL(CMUCL_EXEC, test x${cmucl_exec} = xtrue)
756 AM_CONDITIONAL(SCL, test x$scl = xtrue)
757 AM_CONDITIONAL(SBCL, test x$sbcl = xtrue)
758 AM_CONDITIONAL(SBCL_EXEC, test x$sbcl_exec = xtrue)
759 AM_CONDITIONAL(ACL, test x$acl = xtrue)
760 AM_CONDITIONAL(OPENMCL, test x$openmcl = xtrue)
761 AM_CONDITIONAL(OPENMCL_EXEC, test x${openmcl_exec} = xtrue)
762 AM_CONDITIONAL(ECL, test x$ecl = xtrue)
764 if test x"${clisp}" = xtrue; then
765 if test x"${CLISP_RUNTIME_PATH}" = x"" ; then
766 if test x"${mingw}" = xtrue ; then
767 CLISP_RUNTIME_PATH=`${CLISP_NAME} -norc -q -x "(format nil \"~a${CLISP_RUNTIME}\" (namestring *lib-directory*))"|sed 's/\"\\(.*\\)\"/\\1/'`
769 CLISP_RUNTIME_PATH=`${CLISP_NAME} -norc -q -x "(format nil \"~abase/${CLISP_RUNTIME}\" (namestring *lib-directory*))"|sed 's/\"\\(.*\\)\"/\\1/'`
772 if test -x ${CLISP_RUNTIME_PATH} ; then
773 echo "clisp runtime is \"${CLISP_RUNTIME_PATH}\""
775 AC_MSG_ERROR(clisp runtime \"${CLISP_RUNTIME_PATH}\" is not an executable)
777 CLISP_RUNTIME=`basename ${CLISP_RUNTIME_PATH}`
780 if test x"${cmucl}" = xtrue; then
781 if test x"${CMUCL_RUNTIME_PATH}" = x"" ; then
782 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)'`
784 if test -x "${CMUCL_RUNTIME_PATH}" ; then
785 echo "cmucl runtime is \"${CMUCL_RUNTIME_PATH}\""
787 dnl last chance: find CMUCL_NAME in path. Use it if it doesn't appear to
788 dnl be a shell script.
789 cmucl_path=`type -p "${CMUCL_NAME}"`
790 if test x"`grep -c '#!.*bin.*sh.*' ${cmucl_path}`" = x"0" ; then
791 CMUCL_RUNTIME_PATH="${cmucl_path}"
793 AC_MSG_ERROR([Unable to determine CMUCL runtime path.
794 The best guess for CMUCL runtime, \"${CMUCL_RUNTIME_PATH}\", is not
795 an executable. Use the argument
796 --with-cmucl-runtime=<path>
797 to set the actual CMUCL executable. If the CMUCL lisp command is a shell
798 script the CMUCL executable is the program exec'd by that shell script.])
801 CMUCL_RUNTIME=`basename ${CMUCL_RUNTIME_PATH}`
803 dnl cmucl final check
804 result=`"${CMUCL_RUNTIME_PATH}" -quiet -eval '(format t "MAXIMA_CMUCL_TEST_SUCCESS%")(quit)'`
806 if test ! x"${retval}" = x"0" ; then
807 AC_MSG_ERROR(unable to run cmucl runtime = "${CMUCL_RUNTIME_PATH}".
808 Please specify the full path of the cmucl runtime using the
809 --with-cmucl-runtime=<path>
812 count=`echo "${result}" | grep -c "MAXIMA_CMUCL_TEST_SUCCESS"`
813 if test ! "${count}" = "1" ; then
814 AC_MSG_ERROR(an error occured while checking cmucl runtime)
818 if test x"${scl}" = xtrue; then
819 if test x"${SCL_RUNTIME_PATH}" = x"" ; then
820 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))'`
822 if test -x "${SCL_RUNTIME_PATH}" ; then
823 echo "scl runtime is \"${SCL_RUNTIME_PATH}\""
825 dnl last chance: find SCL_NAME in path. Use it if it doesn't appear to
826 dnl be a shell script.
827 scl_path=`type -p "${SCL_NAME}"`
828 if test x"`grep -c '#!.*bin.*sh.*' ${scl_path}`" = x"0" ; then
829 SCL_RUNTIME_PATH="${scl_path}"
831 AC_MSG_ERROR([Unable to determine SCL runtime path.
832 The best guess for SCL runtime, \"${SCL_RUNTIME_PATH}\", is not
833 an executable. Use the argument
834 --with-scl-runtime=<path>
835 to set the actual SCL executable. If the SCL lisp command is a shell
836 script the SCL executable is the program exec'd by that shell script.])
839 SCL_RUNTIME=`basename ${SCL_RUNTIME_PATH}`
842 if test x"${gcl}" = xtrue; then
843 result=`"${GCL_NAME}" -batch -eval '#+ansi-cl (format t "MAXIMA_GCL_ANSI_TEST_SUCCESS~%") #-ansi-cl (format t "MAXIMA_GCL_ANSI_TEST_FAILURE~%")' -eval '(bye)'`
845 if test ! x"${retval}" = x"0" ; then
846 AC_MSG_ERROR(unable to run gcl executable \"${GCL_NAME}\".)
848 count=`echo "${result}" | grep -c "MAXIMA_GCL_ANSI_TEST_SUCCESS"`
849 if test ! "${count}" = "1" ; then
850 AC_MSG_ERROR([The gcl executable \"${GCL_NAME}\" was not compiled with
851 the --enable-ansi flag, which is required for Maxima.
852 The gcl ANSI-CL check returned
857 AC_ARG_ENABLE(gcl-alt-link,
858 [ --enable-gcl-alt-link Use GCL's alternate linking mechanism],
859 [case "${enableval}" in
860 yes) gcl_alt_link=true ;;
861 no) gcl_alt_link=false ;;
862 *) AC_MSG_ERROR(bad value ${enableval} for --enable-gcl-alt-link) ;;
864 [gcl_alt_link=false])
866 AM_CONDITIONAL(GCL_ALT_LINK, test x$gcl_alt_link = xtrue)
868 ## Enable building sys-proclaim.lisp. Only has any effect on GCL,
869 ## where it increases the compiled binary's performance by maybe 5% at
870 ## the expense of doubling compile time.
871 AC_ARG_ENABLE([sys-proclaim],
872 [ --enable-sys-proclaim Use sys-proclaim.lisp (only affects GCL)],
873 [case "${enableval}" in
874 yes) sys_proclaim=true ;;
875 no) sys_proclaim=false ;;
876 *) AC_MSG_ERROR(bad value ${enableval} for --enable-sys-proclaim) ;;
879 AM_CONDITIONAL([SYS_PROCLAIM], [test x${sys_proclaim} = xtrue])
881 AC_ARG_WITH(default-lisp,
882 [ --with-default-lisp=<lisp> Set default lisp implementation to <lisp>],
883 [case "${withval}" in
885 if test x"${clisp}" = xtrue ; then
888 AC_MSG_ERROR(clisp not enabled)
892 if test x"${cmucl}" = xtrue ; then
895 AC_MSG_ERROR(cmucl not enabled)
899 if test x"${scl}" = xtrue ; then
902 AC_MSG_ERROR(scl not enabled)
906 if test x"${sbcl}" = xtrue ; then
909 AC_MSG_ERROR(sbcl not enabled)
913 if test x"${gcl}" = xtrue ; then
916 AC_MSG_ERROR(gcl not enabled)
920 if test x"${acl}" = xtrue ; then
923 AC_MSG_ERROR(acl not enabled)
927 if test x"${openmcl}" = xtrue ; then
930 AC_MSG_ERROR(openmcl not enabled)
934 if test x"${ecl}" = xtrue ; then
937 AC_MSG_ERROR(ecl not enabled)
941 AC_MSG_ERROR(Unknown argument ${DEFAULTLISP} to --with-default-lisp)
944 [if test x"${clisp}" = xtrue ; then
946 elif test x"${cmucl}" = xtrue ; then
948 elif test x"${scl}" = xtrue ; then
950 elif test x"${sbcl}" = xtrue ; then
952 elif test x"${gcl}" = xtrue ; then
954 elif test x"${acl}" = xtrue ; then
956 elif test x"${openmcl}" = xtrue ; then
958 elif test x"${ecl}" = xtrue ; then
961 AC_MSG_ERROR(Internal error. No lisp enabled. Please contact maintainer.)
965 AC_SUBST(CLISP_RUNTIME)
966 AC_SUBST(CLISP_RUNTIME_PATH)
968 AC_SUBST(CMUCL_RUNTIME)
969 AC_SUBST(CMUCL_RUNTIME_PATH)
972 AC_SUBST(SCL_RUNTIME)
973 AC_SUBST(SCL_RUNTIME_PATH)
977 AC_SUBST(OPENMCL_NAME)
979 AC_SUBST(DEFAULTLISP)
981 AC_SUBST(lisps_enabled)
983 AC_ARG_WITH(posix-shell,
984 [ --with-posix-shell=<path> Use <shell> for maxima script (default /bin/sh)],
985 [posix_shell_list="${withval}"],
986 [posix_shell_list="/bin/sh /bin/bash /usr/bin/bash /usr/local/bin/bash"])
989 [ --with-wish=<prog> Use <prog> for Tk wish shell (default wish)],
995 AC_MSG_CHECKING(POSIX shell to see that it contains getopts)
996 cat <<EOF > conftest-posix-shell.sh
999 echo "result is \$result"
1003 for shell in $posix_shell_list
1005 if test -z "$POSIX_SHELL" ; then
1006 echo "trying $shell"
1007 $shell conftest-posix-shell.sh -a > /dev/null 2>&1
1008 if test "$?" = "0" ; then
1009 POSIX_SHELL="$shell"
1013 rm -f conftest-posix-shell.sh
1014 if test -n "$POSIX_SHELL" ; then
1015 AC_MSG_RESULT(POSIX shell is $POSIX_SHELL)
1017 AC_MSG_WARN(Could not find a shell that supports getopts.
1018 The maxima wrapper script will be unusable. The shell may be specified
1019 with --with-posix-shell=</path/to/shell>)
1021 AC_SUBST(POSIX_SHELL)
1023 if test x"${prefix}" = xNONE ; then
1024 tmp_prefix="/usr/local"
1026 tmp_prefix="${prefix}"
1028 if test x"${exec_prefix}" = xNONE ; then
1029 tmp_exec_prefix="${tmp_prefix}"
1031 tmp_exec_prefix="${exec_prefix}"
1033 expanded_top_srcdir="`(cd \"$top_srcdir\" 1>/dev/null 2>/dev/null; pwd)`"
1034 expanded_exec_prefix="${tmp_exec_prefix}"
1035 expanded_libdir="`eval \"exec_prefix=\\\"${tmp_exec_prefix}\\\";echo ${libdir}\"`"
1036 expanded_libexecdir="`eval \"exec_prefix=\\\"${tmp_exec_prefix}\\\";echo ${libexecdir}\"`"
1037 expanded_datadir="`eval \"prefix=\\\"${tmp_prefix}\\\";datarootdir=\\\"${datarootdir}\\\";echo ${datadir}\"`"
1038 expanded_infodir="`eval \"prefix=\\\"${tmp_prefix}\\\";datarootdir=\\\"${datarootdir}\\\";echo ${infodir}\"`"
1041 dnl Find all the directories in share, but remove the share directory
1042 dnl itself and all CVS directories (if any) and fortran directories.
1043 dnl Remove the leading "share" part of the path, and add double-quotes
1046 #default_sharedirs=`find share -type d | sort | egrep -v 'share$|CVS|/fortran' | sed 's;share/\(.*\); "\1" \\\\;' | sed '$s;\\\\;;'`
1047 default_sharedirs=`find share -type d | sort | egrep -v 'share$|CVS|/fortran' | sed 's;share/\(.*\);"\1";' | tr '\n' ' '`
1049 AC_SUBST(expanded_top_srcdir)
1050 AC_SUBST(expanded_exec_prefix)
1051 AC_SUBST(expanded_libdir)
1052 AC_SUBST(expanded_libexecdir)
1053 AC_SUBST(expanded_datadir)
1054 AC_SUBST(expanded_infodir)
1055 default_layout_autotools="true"
1056 AC_SUBST(default_layout_autotools)
1058 AC_SUBST(default_sharedirs)
1060 dnl Look for grep that can handle long lines and -e.
1065 # Configure these files and make them executable
1066 AC_CONFIG_FILES([maxima-local], chmod +x maxima-local)
1067 AC_CONFIG_FILES([xmaxima-local], chmod +x xmaxima-local)
1069 # Convert maxima.bat to DOS line ending
1070 # sed-3.02 in old mingw distribution doesn't support -i or \r
1071 # dos2unix may not be present, but perl is required elsewhere
1072 # perl -i interferes with binmode so need to use a temporary file
1073 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))
1075 AC_OUTPUT(Makefile maxima.spec maxima.iss \
1076 admin/Makefile src/Makefile src/maxima src/rmaxima src/autoconf-variables.lisp \
1077 src/share-subdirs.lisp \
1078 lisp-utils/Makefile tests/Makefile doc/Makefile \
1079 doc/emaxima/Makefile doc/info/Makefile doc/info/include-maxima.texi \
1080 doc/info/de/Makefile \
1081 doc/info/de.utf8/Makefile doc/info/es/Makefile doc/info/es.utf8/Makefile \
1082 doc/info/pt/Makefile doc/info/pt.utf8/Makefile \
1083 doc/info/pt/include-maxima.texi \
1084 doc/info/pt_BR/Makefile doc/info/pt_BR.utf8/Makefile \
1085 doc/intromax/Makefile doc/man/Makefile doc/man/maxima.1 doc/man/ru/maxima.1 \
1086 doc/share/Makefile interfaces/Makefile interfaces/emacs/Makefile \
1087 interfaces/emacs/emaxima/Makefile interfaces/emacs/imaxima/Makefile \
1088 interfaces/emacs/misc/Makefile interfaces/xmaxima/Makefile \
1089 interfaces/xmaxima/autoconf-variables.tcl interfaces/xmaxima/Tkmaxima/Header.tcl \
1090 interfaces/xmaxima/doc/Makefile interfaces/xmaxima/doc/figures/Makefile \
1091 interfaces/xmaxima/msgs/Makefile interfaces/xmaxima/win32/Makefile \
1092 plotting/mgnuplot share/Makefile demo/Makefile plotting/Makefile locale/Makefile \
1093 share/contrib/Makefile share/contrib/integration/Makefile \
1094 share/draw/Makefile share/logic/Makefile doc/info/es/include-maxima.texi \
1099 if test x"${clisp}" = xtrue ; then
1100 echo "clisp enabled. Executable name: \"${CLISP_NAME}\""
1101 echo "clisp runtime is \"${CLISP_RUNTIME_PATH}\""
1103 if test x"${clisp_exec}" = xtrue ; then
1104 echo "clisp executable image enabled for maxima."
1106 if test x"${cmucl}" = xtrue ; then
1107 echo "CMUCL enabled. Executable name: \"${CMUCL_NAME}\""
1108 echo "cmucl runtime is \"${CMUCL_RUNTIME_PATH}\""
1110 if test x"${cmucl_exec}" = xtrue; then
1111 echo "CMUCL executable image enabled for maxima."
1113 if test x"${scl}" = xtrue ; then
1114 echo "SCL enabled. Executable name: \"${SCL_NAME}\""
1115 echo "SCL runtime is \"${SCL_RUNTIME_PATH}\""
1117 if test x"${sbcl}" = xtrue ; then
1118 echo "SBCL enabled. Executable name: \"${SBCL_NAME}\""
1120 if test x"${sbcl_exec}" = xtrue ; then
1121 echo "sbcl executable image enabled for maxima."
1123 if test x"${gcl}" = xtrue ; then
1124 echo "GCL enabled. Executable name: \"${GCL_NAME}\""
1125 if test x"${gcl_alt_link}" = xtrue ; then
1126 echo " GCL alternative linking method enabled."
1129 if test x"${acl}" = xtrue ; then
1130 echo "ACL enabled. Executable name: \"${ACL_NAME}\""
1132 if test x"${openmcl}" = xtrue ; then
1133 echo "OpenMCL enabled. Executable name: \"${OPENMCL_NAME}\""
1135 if test x"${openmcl_exec}" = xtrue ; then
1136 echo "OpenMCL executable image enabled for maxima."
1138 if test x"${ecl}" = xtrue ; then
1139 echo "ECL enabled. Executable name: \"${ECL_NAME}\""
1141 echo "default lisp: $DEFAULTLISP"
1142 echo "wish executable name: \"${WISH}\""
1144 if test x"${chm}" = xtrue ; then
1145 echo "CHM help files enabled"
1146 echo " HHC: \"${HHC}\""
1148 if test x"${xmaxima_exe}" = xtrue ; then
1149 echo "Windows xmaxima.exe enabled"
1150 echo " GCC version GCCVER: ${GCCVER}"
1151 echo " TCLSTUBLIB: ${TCLSTUBLIB}"
1152 if ! test -f "${TCLSTUBLIB}" ; then
1153 AC_MSG_WARN(*** TCLSTUBLIB ${TCLSTUBLIB} not found)
1154 xmaxima_exe_prerequisite=notfound
1156 echo " TCLKITSH: ${TCLKITSH}"
1157 if ! test -f "${TCLKITSH}" ; then
1158 AC_MSG_WARN(*** TCLKITSH ${TCLKITSH} not found)
1159 xmaxima_exe_prerequisite=notfound
1161 echo " TCLKIT_RUNTIME: ${TCLKIT_RUNTIME}"
1162 if ! test -f "${TCLKIT_RUNTIME}" ; then
1163 AC_MSG_WARN(*** TCLKIT_RUNTIME ${TCLKIT_RUNTIME} not found)
1164 xmaxima_exe_prerequisite=notfound
1166 echo " SDXKIT: ${SDXKIT}"
1167 if ! test -f "${SDXKIT}" ; then
1168 AC_MSG_WARN(*** SDXKIT ${SDXKIT} not found)
1169 xmaxima_exe_prerequisite=notfound
1171 echo " IMGKIT: ${IMGKIT}"
1172 if ! test -f "${IMGKIT}" ; then
1173 AC_MSG_WARN(*** IMGKIT ${IMGKIT} not found)
1174 xmaxima_exe_prerequisite=notfound
1176 if test x${xmaxima_exe_prerequisite} = xnotfound ; then
1177 AC_MSG_WARN([A prerequisite for xmaxima.exe not found. The missing components can be defined on the make command line.])