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.37post])
12 AC_CONFIG_SRCDIR([src/macsys.lisp])
13 AM_INIT_AUTOMAKE([-Wno-portability])
19 dnl If we were using a C compiler, EXEEXT would get defined
20 dnl automatically. But we aren't, so we have to define it ourselves.
21 dnl Still to do: Add Win64 support here, if this is needed.
47 AM_CONDITIONAL(WIN32, test x$win32 = xtrue)
48 AM_CONDITIONAL(WIN64, test x$win64 = xtrue)
50 dnl To make life more confusing, the automake test machinery (which we
51 dnl use in ./tests) needs the am__EXEEXT conditional. This would have
52 dnl normally been expanded (via something we've copied from Automake's
53 dnl init.m4 into our aclocal.m4) as Automake computed EXEEXT, but it
54 dnl didn't so we have to drop this in ourselves.
55 AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])
60 dnl n.b. clisp_default_name is hardcoded in "with" message
61 clisp_default_name=clisp
63 [ --enable-clisp Use clisp],
64 [case "${enableval}" in
66 lisps_enabled="${lisps_enabled} clisp"
69 *) AC_MSG_ERROR(bad value ${enableval} for --enable-clisp) ;;
74 [ --with-clisp=<prog> Use clisp executable <prog> (default clisp)],
76 lisps_enabled="${lisps_enabled} clisp"
78 if test "$withval" = "yes"; then
79 CLISP_NAME="${clisp_default_name}"
83 [CLISP_NAME=${clisp_default_name}])
84 CLISP_RUNTIME="lisp${CLISPEXT}"
85 AC_ARG_WITH(clisp-runtime,
86 [ --with-clisp-runtime=<path> Use clisp runtime <path> (default
87 *lib-directory*/base/lisp.run on unix,
88 *lib-directory*\\lisp.exe on windows) ],
90 lisps_enabled="${lisps_enabled} clisp"
91 CLISP_RUNTIME_PATH="$withval"
92 CLISP_RUNTIME=`basename ${CLISP_RUNTIME_PATH}`],
94 AC_ARG_ENABLE(clisp-exec,
95 [ --enable-clisp-exec Create a maxima executable image using CLISP.
96 No check is made if the version of
97 CLISP supports executable images],
98 [case "${enableval}" in
101 lisps_enabled="${lisps_enabled} clisp"
102 explicit_lisp=true ;;
103 no) clisp_exec=false ;;
104 *) AC_MSG_ERROR(bad value ${enableval} for --enable-clisp-exec) ;;
106 CLISP_EXEC=${clisp_exec}],
109 if test x"${clisp}" = xtrue ; then
110 if test `echo "$CLISP_NAME" | sed 's/\(.\).*/\1/'` = "/" ; then
111 if test -x "$CLISP_NAME" ; then
117 AC_CHECK_PROG(clisp_found,$CLISP_NAME,true,false)
119 if test x"${clisp_found}" = xfalse ; then
120 AC_MSG_WARN(clisp executable ${CLISP_NAME} not found in PATH)
125 dnl See if git exists. If it does, update VERSION to include a git tag
126 AC_CHECK_PROG(git_found, git, true, false)
127 if test x"${git_found}" = xtrue; then
128 # Test to see if git describe works (discarding any output). If
129 # it works, use it. Otherwise, keep existing value of VERSION.
130 # (git describe fails if git is executed in a non-Git directory, e.g.,
131 # an unpacked tarball. Since the exit codes of git describe are undocumented,
132 # we cannot distinguish that from a missing annotated tag.
133 # Play it safe by refusing to change VERSION.)
134 if git describe > /dev/null 2>&1; then
135 VERSION="`git describe --dirty`"
136 # When building RPMs, hyphens in the version are not allowed, so
137 # replace them with underscores.
138 VERSION=`echo $VERSION | sed 's;-;_;g'`
142 dnl Parses the version number for the manual
143 manual_version=`echo $VERSION | sed 's+branch_++; s+_base++; s+_dirty++; s+_+.+g'`
144 AC_SUBST(manual_version)
146 dnl n.b. cmucl_default_name is hardcoded in "with" message
147 cmucl_default_name=lisp
150 [ --enable-cmucl Use CMUCL],
151 [case "${enableval}" in
153 lisps_enabled="${lisps_enabled} cmucl"
154 explicit_lisp=true ;;
156 *) AC_MSG_ERROR(bad value ${enableval} for --enable-cmucl) ;;
161 [ --with-cmucl=<prog> Use CMUCL executable <prog> (default lisp)],
163 lisps_enabled="${lisps_enabled} cmucl"
165 if test "$withval" = "yes"; then
166 CMUCL_NAME="${cmucl_default_name}"
168 CMUCL_NAME="$withval"
170 [CMUCL_NAME=${cmucl_default_name}])
171 AC_ARG_WITH(cmucl-runtime,
172 [ --with-cmucl-runtime=<path> Use CMUCL runtime <path> (default
173 *cmucl-lib*/../bin/lisp)],
175 lisps_enabled="${lisps_enabled} cmucl"
176 CMUCL_RUNTIME_PATH="$withval"
177 CMUCL_RUNTIME=`basename ${CMUCL_RUNTIME_PATH}`],
179 AC_ARG_ENABLE(cmucl-exec,
180 [ --enable-cmucl-exec Create a maxima executable image using CMUCL.
181 No check is made if the version of
182 CMUCL supports executable images],
183 [case "${enableval}" in
186 lisps_enabled="${lisps_enabled} cmucl"
187 explicit_lisp=true ;;
188 no) cmucl_exec=false ;;
189 *) AC_MSG_ERROR(bad value ${enableval} for --enable-cmucl-exec) ;;
191 CMUCL_EXEC=${cmucl_exec}],
194 if test x"${cmucl}" = xtrue ; then
195 if test `echo "$CMUCL_NAME" | sed 's/\(.\).*/\1/'` = "/" ; then
196 if test -x "$CMUCL_NAME" ; then
202 AC_CHECK_PROG(cmucl_found,$CMUCL_NAME,true,false)
204 AC_CHECK_PROG(cmucl_found,$CMUCL_NAME,true,false)
205 if test x"${cmucl_found}" = xfalse ; then
206 AC_MSG_WARN(cmucl executable ${CMUCL_NAME} not found in PATH)
210 dnl n.b. scl_default_name is hardcoded in "with" message
214 [ --enable-scl Use SCL],
215 [case "${enableval}" in
217 lisps_enabled="${lisps_enabled} scl"
218 explicit_lisp=true ;;
220 *) AC_MSG_ERROR(bad value ${enableval} for --enable-scl) ;;
225 [ --with-scl=<prog> Use SCL executable <prog> (default scl)],
227 lisps_enabled="${lisps_enabled} scl"
229 if test "$withval" = "yes"; then
230 SCL_NAME="${scl_default_name}"
234 [SCL_NAME=${scl_default_name}])
235 AC_ARG_WITH(scl-runtime,
236 [ --with-scl-runtime=<path> Use SCL runtime <path> (default
237 file://library/../bin/lisp)],
239 lisps_enabled="${lisps_enabled} scl"
240 SCL_RUNTIME_PATH="$withval"
241 SCL_RUNTIME=`basename ${SCL_RUNTIME_PATH}`],
243 if test x"${scl}" = xtrue ; then
244 if test `echo "$SCL_NAME" | sed 's/\(.\).*/\1/'` = "/" ; then
245 if test -x "$SCL_NAME" ; then
251 AC_CHECK_PROG(scl_found,$SCL_NAME,true,false)
253 AC_CHECK_PROG(scl_found,$SCL_NAME,true,false)
254 if test x"${scl_found}" = xfalse ; then
255 AC_MSG_WARN(scl executable ${SCL_NAME} not found in PATH)
259 dnl n.b. sbcl_default_name is hardcoded in "with" message
260 sbcl_default_name=sbcl
262 [ --enable-sbcl Use SBCL],
263 [case "${enableval}" in
265 lisps_enabled="${lisps_enabled} sbcl"
266 explicit_lisp=true ;;
268 *) AC_MSG_ERROR(bad value ${enableval} for --enable-sbcl) ;;
273 [ --with-sbcl=<prog> Use SBCL executable <prog> (default sbcl)],
275 lisps_enabled="${lisps_enabled} sbcl"
277 if test "$withval" = "yes"; then
278 SBCL_NAME="${sbcl_default_name}"
282 [SBCL_NAME="${sbcl_default_name}"])
283 AC_ARG_ENABLE(sbcl-exec,
284 [ --enable-sbcl-exec Create a maxima executable image using SBCL.
285 No check is made if the version of
286 SBCL supports executable images],
287 [case "${enableval}" in
290 lisps_enabled="${lisps_enabled} sbcl"
291 explicit_lisp=true ;;
292 no) sbcl_exec=false ;;
293 *) AC_MSG_ERROR(bad value ${enableval} for --enable-sbcl-exec) ;;
295 SBCL_EXEC=${sbcl_exec}],
298 if test x"${sbcl}" = xtrue ; then
299 if test `echo "$SBCL_NAME" | sed 's/\(.\).*/\1/'` = "/" ; then
300 if test -x "$SBCL_NAME" ; then
306 AC_CHECK_PROG(sbcl_found,"$SBCL_NAME",true,false)
308 AC_CHECK_PROG(sbcl_found,"$SBCL_NAME",true,false)
309 if test x"${sbcl_found}" = xfalse ; then
310 AC_MSG_WARN(sbcl executable "${SBCL_NAME}" not found in PATH)
314 dnl n.b. acl_default_name is hardcoded in "with" message
315 acl_default_name=lisp
317 [ --enable-acl Use ACL],
318 [case "${enableval}" in
320 lisps_enabled="${lisps_enabled} acl"
321 explicit_lisp=true ;;
323 *) AC_MSG_ERROR(bad value ${enableval} for --enable-acl) ;;
328 [ --with-acl=<prog> Use ACL executable <prog> (default lisp)],
330 lisps_enabled="${lisps_enabled} acl"
332 if test "$withval" = "yes"; then
333 ACL_NAME="${acl_default_name}"
337 [ACL_NAME=${acl_default_name}])
338 if test x"${acl}" = xtrue ; then
339 if test `echo "$ACL_NAME" | sed 's/\(.\).*/\1/'` = "/" ; then
340 if test -x "$ACL_NAME" ; then
346 AC_CHECK_PROG(acl_found,$ACL_NAME,true,false)
348 AC_CHECK_PROG(acl_found,$ACL_NAME,true,false)
349 if test x"${acl_found}" = xfalse ; then
350 AC_MSG_WARN(acl executable ${ACL_NAME} not found in PATH)
354 dnl n.b. gcl_default_name is hardcoded in "with" message
357 [ --enable-gcl Use GCL],
358 [case "${enableval}" in
360 lisps_enabled="${lisps_enabled} gcl"
363 *) AC_MSG_ERROR(bad value ${enableval} for --enable-gcl) ;;
367 [ --with-gcl=<prog> Use GCL executable <prog> (default gcl)],
369 lisps_enabled="${lisps_enabled} gcl"
371 if test "$withval" = "yes"; then
372 GCL_NAME="${gcl_default_name}"
376 [GCL_NAME=${gcl_default_name}])
377 if test x"${gcl}" = xtrue ; then
378 if test `echo "$GCL_NAME" | sed 's/\(.\).*/\1/'` = "/" ; then
379 if test -x "$GCL_NAME" ; then
385 AC_CHECK_PROG(gcl_found,$GCL_NAME,true,false)
387 if test x"${gcl_found}" = xfalse ; then
388 AC_MSG_WARN(gcl executable ${GCL_NAME} not found in PATH)
392 dnl n.b. openmcl_default_name is hardcoded in "with" message
393 openmcl_default_name=openmcl
394 AC_ARG_ENABLE(openmcl,
395 [ --enable-openmcl Use OpenMCL],
396 [case "${enableval}" in
398 lisps_enabled="${lisps_enabled} openmcl"
401 *) AC_MSG_ERROR(bad value ${enableval} for --enable-openmcl) ;;
405 [ --with-openmcl=<prog> Use OpenMCL executable <prog> (default openmcl)],
407 lisps_enabled="${lisps_enabled} openmcl"
409 if test "$withval" = "yes"; then
410 OPENMCL_NAME="${openmcl_default_name}"
412 OPENMCL_NAME="$withval"
414 [OPENMCL_NAME=${openmcl_default_name}])
415 AC_ARG_ENABLE(openmcl-exec,
416 [ --enable-openmcl-exec Create a maxima executable image using OPENMCL.
417 No check is made if the version of
418 OPENMCL supports executable images],
419 [case "${enableval}" in
420 yes) openmcl_exec=true
422 lisps_enabled="${lisps_enabled} openmcl"
424 no) openmcl_exec=false ;;
425 *) AC_MSG_ERROR(bad value ${enableval} for --enable-openmcl-exec) ;;
427 OPENMCL_EXEC=${openmcl_exec}],
431 dnl Define ccl as an alias (essentially) for openmcl
433 [ --enable-ccl Use CCL (Clozure Common Lisp)],
434 [case "${enableval}" in
436 lisps_enabled="${lisps_enabled} openmcl"
439 *) AC_MSG_ERROR(bad value ${enableval} for --enable-ccl) ;;
443 [ --with-ccl=<prog> Use OpenMCL executable <prog> (default ccl)],
445 lisps_enabled="${lisps_enabled} openmcl"
447 if test "$withval" = "yes"; then
448 OPENMCL_NAME="${openmcl_default_name}"
450 OPENMCL_NAME="$withval"
452 [OPENMCL_NAME=${openmcl_default_name}])
453 AC_ARG_ENABLE(ccl-exec,
454 [ --enable-ccl-exec Create a maxima executable image using CCL.
455 No check is made if the version of
456 CCL supports executable images],
457 [case "${enableval}" in
458 yes) openmcl_exec=true
460 lisps_enabled="${lisps_enabled} openmcl"
462 no) openmcl_exec=false ;;
463 *) AC_MSG_ERROR(bad value ${enableval} for --enable-ccl-exec) ;;
465 OPENMCL_EXEC=${openmcl_exec}],
469 if test x"${openmcl}" = xtrue ; then
470 if test `echo "$OPENMCL_NAME" | sed 's/\(.\).*/\1/'` = "/" ; then
471 if test -x "$OPENMCL_NAME" ; then
477 AC_CHECK_PROG(openmcl_found,$OPENMCL_NAME,true,false)
479 if test x"${openmcl_found}" = xfalse ; then
480 AC_MSG_WARN(openmcl executable ${OPENMCL_NAME} not found in PATH)
484 dnl n.b. ecl_default_name is hardcoded in "with" message
487 [ --enable-ecl Use ECL],
488 [case "${enableval}" in
490 lisps_enabled="${lisps_enabled} ecl"
493 *) AC_MSG_ERROR(bad value ${enableval} for --enable-ecl) ;;
497 [ --with-ecl=<prog> Use ECL executable <prog> (default ecl)],
499 lisps_enabled="${lisps_enabled} ecl"
501 if test "$withval" = "yes"; then
502 ECL_NAME="${ecl_default_name}"
506 [ECL_NAME=${ecl_default_name}])
507 if test x"${ecl}" = xtrue ; then
508 if test `echo "$ECL_NAME" | sed 's/\(.\).*/\1/'` = "/" ; then
509 if test -x "$ECL_NAME" ; then
515 AC_CHECK_PROG(ecl_found,$ECL_NAME,true,false)
517 if test x"${ecl_found}" = xfalse ; then
518 AC_MSG_WARN(ecl executable ${ECL_NAME} not found in PATH)
523 AC_ARG_ENABLE(gettext,
524 [ --enable-gettext Locale support],
525 [case "${enableval}" in
526 yes) enable_gettext=true ;;
527 no) enable_gettext=false ;;
528 *) AC_MSG_ERROR(bad value ${enableval} for --enable-gettext) ;;
530 [enable_gettext=false])
533 AM_CONDITIONAL(ENABLE_GETTEXT, test x$enable_gettext = xtrue)
536 AC_ARG_ENABLE(lang-de,
537 [ --enable-lang-de German language support],
538 [case "${enableval}" in
541 *) AC_MSG_ERROR(bad value ${enableval} for --enable-lang-de) ;;
545 AM_CONDITIONAL(LANG_DE, test x$lang_de = xtrue)
547 AC_ARG_ENABLE(lang-de-utf8,
548 [ --enable-lang-de-utf8 German language support (UTF-8)],
549 [case "${enableval}" in
550 yes) lang_de_utf8=true ;;
551 no) lang_de_utf8=false ;;
552 *) AC_MSG_ERROR(bad value ${enableval} for --enable-lang-de-utf8) ;;
554 [lang_de_utf8=false])
556 AM_CONDITIONAL(LANG_DE_UTF8, test x$lang_de_utf8 = xtrue)
558 AC_ARG_ENABLE(lang-es,
559 [ --enable-lang-es Spanish language support],
560 [case "${enableval}" in
563 *) AC_MSG_ERROR(bad value ${enableval} for --enable-lang-es) ;;
568 AM_CONDITIONAL(LANG_ES, test x$lang_es = xtrue)
570 AC_ARG_ENABLE(lang-es-utf8,
571 [ --enable-lang-es-utf8 Spanish language support (UTF-8)],
572 [case "${enableval}" in
573 yes) lang_es_utf8=true ;;
574 no) lang_es_utf8=false ;;
575 *) AC_MSG_ERROR(bad value ${enableval} for --enable-lang-es-utf8) ;;
577 [lang_es_utf8=false])
579 AM_CONDITIONAL(LANG_ES_UTF8, test x$lang_es_utf8 = xtrue)
581 AC_ARG_ENABLE(lang-pt,
582 [ --enable-lang-pt Portuguese language support],
583 [case "${enableval}" in
586 *) AC_MSG_ERROR(bad value ${enableval} for --enable-lang-pt) ;;
591 AM_CONDITIONAL(LANG_PT, test x$lang_pt = xtrue)
593 AC_ARG_ENABLE(lang-pt-utf8,
594 [ --enable-lang-pt-utf8 Portuguese language support (UTF-8)],
595 [case "${enableval}" in
596 yes) lang_pt_utf8=true ;;
597 no) lang_pt_utf8=false ;;
598 *) AC_MSG_ERROR(bad value ${enableval} for --enable-lang-pt-utf8) ;;
600 [lang_pt_utf8=false])
602 AM_CONDITIONAL(LANG_PT_UTF8, test x$lang_pt_utf8 = xtrue)
604 AC_ARG_ENABLE(lang-pt_BR,
605 [ --enable-lang-pt_BR Brazilian Portuguese language support],
606 [case "${enableval}" in
607 yes) lang_pt_br=true ;;
608 no) lang_pt_br=false ;;
609 *) AC_MSG_ERROR(bad value ${enableval} for --enable-lang-pt_BR) ;;
614 AM_CONDITIONAL(LANG_PT_BR, test x$lang_pt_br = xtrue)
616 AC_ARG_ENABLE(lang-pt_BR-utf8,
617 [ --enable-lang-pt_BR-utf8 Brazilian Portuguese language support (UTF-8)],
618 [case "${enableval}" in
619 yes) lang_pt_br_utf8=true ;;
620 no) lang_pt_br_utf8=false ;;
621 *) AC_MSG_ERROR(bad value ${enableval} for --enable-lang-pt_BR-utf8) ;;
623 [lang_pt_br_utf8=false])
625 AM_CONDITIONAL(LANG_PT_BR_UTF8, test x$lang_pt_br_utf8 = xtrue)
627 AC_ARG_ENABLE(recode,
628 [ --enable-recode Use recode for charset conversion],
629 [case "${enableval}" in
630 yes) use_recode=true ;;
631 no) use_recode=false ;;
632 *) AC_MSG_ERROR(bad value ${enableval} for --enable-recode) ;;
636 dnl iconv and/or recode
637 AC_CHECK_PROG(iconv_found,iconv,true,false)
638 AC_CHECK_PROG(recode_found,recode,true,false)
640 if test x"${use_recode}" = xtrue ; then
641 if test x"${recode_found}" = xfalse ; then
642 AC_MSG_ERROR(No recode found)
644 elif test x"${iconv_found}" = xfalse ; then
650 AM_CONDITIONAL(USE_RECODE, test x$use_recode = xtrue)
652 dnl Optionally build the windows CHM help files
653 dnl default to false as requires win32 and Microsoft HTML Help Workshop
655 [ --enable-chm Build Windows CHM help files],
656 [case "${enableval}" in
659 *) AC_MSG_ERROR(bad value ${enableval} for --enable-chm) ;;
662 AM_CONDITIONAL(CHM, test x$chm = xtrue)
663 dnl hhc is the HTML Help Compiler for CHM documentation
664 hhc_default_name=hhc$EXEEXT
666 [ --with-hhc=<prog> Use HTML Help Compiler executable <prog> (default hhc)],
668 if test "$withval" = "yes"; then
669 HHC="${hhc_default_name}"
673 [HHC="${hhc_default_name}"])
675 # Check that hhc exists, using AC_CHECK_PROG
676 if test x$chm = xtrue; then
677 if test -x "${HHC}"; then
678 # HHC was a path to the executable, and it existed, which is
679 # great! We still say something to the caller, since this is
680 # probably less confusing.
681 AC_MSG_CHECKING([for hhc])
684 AC_CHECK_PROG(hhc_found, ${HHC}, yes)
685 if test x"${hhc_found}" != x"yes"; then
686 AC_MSG_ERROR([HTML Help Compiler executable ${HHC} not found])
691 dnl Optionally build xmaxima.exe under windows
692 dnl default to false as additional software
693 AC_ARG_ENABLE(xmaxima_exe,
694 [ --enable-xmaxima-exe Build Windows xmaxima.exe for installer],
695 [case "${enableval}" in
696 yes) xmaxima_exe=true ;;
697 no) xmaxima_exe=false ;;
698 *) AC_MSG_ERROR(bad value ${enableval} for --enable-xmaxima-exe) ;;
701 AM_CONDITIONAL(XMAXIMA_EXE, test x$xmaxima_exe = xtrue)
703 dnl Optionally build xmaxima.exe under windows
704 dnl default to false as additional software
705 AC_ARG_ENABLE(winkill_exe,
706 [ --enable-winkill Build Windows winkill.exe and winkill_lib.dll for installer],
707 [case "${enableval}" in
708 yes) winkill_exe=true ;;
709 no) winkill_exe=false ;;
710 *) AC_MSG_ERROR(bad value ${enableval} for --enable-winkill-exe) ;;
713 AM_CONDITIONAL(WINKILL_EXE, test x$winkill_exe = xtrue)
715 dnl Should we build a win64 installer?
716 AC_ARG_ENABLE(win64-installer,
717 [ --enable-win64-installer Build a 64bit installer on Windows],
718 [case "${enableval}" in
719 yes) win64_installer=true ;;
720 no) win64_installer=false ;;
721 *) AC_MSG_ERROR(bad valu ${enableval} for --enable-win64-installer) ;;
723 [win64_installer=false])
724 AM_CONDITIONAL(WIN64_INSTALLER, test x$win64_installer = xtrue)
725 AC_SUBST(win64_installer)
727 dnl Tools for building xmaxima.exe on windows
728 dnl Hard code the filenames for now. Can over-ride on make command line
730 if test x${xmaxima_exe} = xtrue ; then
731 GCCVER=`gcc -dumpversion`
732 dnl http://tclkits.rkeene.org/fossil/wiki?name=Downloads
733 dnl and http://www.tcl.tk/starkits/
734 TCLKITSH=/c/programs/star/tclkitsh-8.6.3-win32-ix86.exe
735 TCLKIT_RUNTIME=/c/programs/star/tclkit-8.6.3-win32-ix86.exe
736 SDXKIT=/c/programs/star/sdx.kit
737 IMGKIT=/c/programs/star/img.kit
742 AC_SUBST(TCLKIT_RUNTIME)
745 AM_CONDITIONAL(GCC331, test x${GCCVER} = x3.3.1)
747 if test x"${explicit_lisp}" = xfalse ; then
748 dnl See if any of the lisps can be found
749 AC_CHECK_PROG(clisp_found,${clisp_default_name},true,false)
750 AC_CHECK_PROG(gcl_found,${gcl_default_name},true,false)
751 AC_CHECK_PROG(cmucl_found,$CMUCL_NAME,true,false)
752 AC_CHECK_PROG(scl_found,$SCL_NAME,true,false)
753 AC_CHECK_PROG(sbcl_found,$SBCL_NAME,true,false)
754 AC_CHECK_PROG(acl_found,$ACL_NAME,true,false)
755 AC_CHECK_PROG(openmcl_found,$OPENMCL_NAME,true,false)
756 AC_CHECK_PROG(ecl_found,$ECL_NAME,true,false)
758 if test x"${clisp_found}" = xtrue ; then
760 lisps_enabled="${lisps_enabled} clisp"
761 elif test x"${gcl_found}" = xtrue ; then
763 lisps_enabled="${lisps_enabled} gcl"
764 elif test x"${cmucl_found}" = xtrue ; then
766 lisps_enabled="${lisps_enabled} cmucl"
767 elif test x"${scl_found}" = xtrue ; then
769 lisps_enabled="${lisps_enabled} scl"
770 elif test x"${sbcl_found}" = xtrue ; then
772 lisps_enabled="${lisps_enabled} sbcl"
773 elif test x"${acl_found}" = xtrue ; then
775 lisps_enabled="${lisps_enabled} acl"
776 elif test x"${ecl_found}" = xtrue ; then
778 lisps_enabled="${lisps_enabled} ecl"
780 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)
784 AM_CONDITIONAL(CLISP, test x$clisp = xtrue)
785 AM_CONDITIONAL(CLISP_EXEC, test x$clisp_exec = xtrue)
786 AM_CONDITIONAL(GCL, test x$gcl = xtrue)
787 AM_CONDITIONAL(CMUCL, test x$cmucl = xtrue)
788 AM_CONDITIONAL(CMUCL_EXEC, test x${cmucl_exec} = xtrue)
789 AM_CONDITIONAL(SCL, test x$scl = xtrue)
790 AM_CONDITIONAL(SBCL, test x$sbcl = xtrue)
791 AM_CONDITIONAL(SBCL_EXEC, test x$sbcl_exec = xtrue)
792 AM_CONDITIONAL(ACL, test x$acl = xtrue)
793 AM_CONDITIONAL(OPENMCL, test x$openmcl = xtrue)
794 AM_CONDITIONAL(OPENMCL_EXEC, test x${openmcl_exec} = xtrue)
795 AM_CONDITIONAL(ECL, test x$ecl = xtrue)
797 if test x"${clisp}" = xtrue; then
798 if test x"${CLISP_RUNTIME_PATH}" = x"" ; then
799 if test x"${mingw}" = xtrue ; then
800 CLISP_RUNTIME_PATH=`${CLISP_NAME} -norc -q -x "(format nil \"~a${CLISP_RUNTIME}\" (namestring *lib-directory*))"|sed 's/\"\\(.*\\)\"/\\1/'`
802 CLISP_RUNTIME_PATH=`${CLISP_NAME} -norc -q -x "(format nil \"~abase/${CLISP_RUNTIME}\" (namestring *lib-directory*))"|sed 's/\"\\(.*\\)\"/\\1/'`
805 if test -x ${CLISP_RUNTIME_PATH} ; then
806 echo "clisp runtime is \"${CLISP_RUNTIME_PATH}\""
808 AC_MSG_ERROR(clisp runtime \"${CLISP_RUNTIME_PATH}\" is not an executable)
810 CLISP_RUNTIME=`basename ${CLISP_RUNTIME_PATH}`
813 if test x"${cmucl}" = xtrue; then
814 if test x"${CMUCL_RUNTIME_PATH}" = x"" ; then
815 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)'`
817 if test -x "${CMUCL_RUNTIME_PATH}" ; then
818 echo "cmucl runtime is \"${CMUCL_RUNTIME_PATH}\""
820 dnl last chance: find CMUCL_NAME in path. Use it if it doesn't appear to
821 dnl be a shell script.
822 cmucl_path=`type -p "${CMUCL_NAME}"`
823 if test x"`grep -c '#!.*bin.*sh.*' ${cmucl_path}`" = x"0" ; then
824 CMUCL_RUNTIME_PATH="${cmucl_path}"
826 AC_MSG_ERROR([Unable to determine CMUCL runtime path.
827 The best guess for CMUCL runtime, \"${CMUCL_RUNTIME_PATH}\", is not
828 an executable. Use the argument
829 --with-cmucl-runtime=<path>
830 to set the actual CMUCL executable. If the CMUCL lisp command is a shell
831 script the CMUCL executable is the program exec'd by that shell script.])
834 CMUCL_RUNTIME=`basename ${CMUCL_RUNTIME_PATH}`
836 dnl cmucl final check
837 result=`"${CMUCL_RUNTIME_PATH}" -quiet -eval '(format t "MAXIMA_CMUCL_TEST_SUCCESS%")(quit)'`
839 if test ! x"${retval}" = x"0" ; then
840 AC_MSG_ERROR(unable to run cmucl runtime = "${CMUCL_RUNTIME_PATH}".
841 Please specify the full path of the cmucl runtime using the
842 --with-cmucl-runtime=<path>
845 count=`echo "${result}" | grep -c "MAXIMA_CMUCL_TEST_SUCCESS"`
846 if test ! "${count}" = "1" ; then
847 AC_MSG_ERROR(an error occured while checking cmucl runtime)
851 if test x"${scl}" = xtrue; then
852 if test x"${SCL_RUNTIME_PATH}" = x"" ; then
853 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))'`
855 if test -x "${SCL_RUNTIME_PATH}" ; then
856 echo "scl runtime is \"${SCL_RUNTIME_PATH}\""
858 dnl last chance: find SCL_NAME in path. Use it if it doesn't appear to
859 dnl be a shell script.
860 scl_path=`type -p "${SCL_NAME}"`
861 if test x"`grep -c '#!.*bin.*sh.*' ${scl_path}`" = x"0" ; then
862 SCL_RUNTIME_PATH="${scl_path}"
864 AC_MSG_ERROR([Unable to determine SCL runtime path.
865 The best guess for SCL runtime, \"${SCL_RUNTIME_PATH}\", is not
866 an executable. Use the argument
867 --with-scl-runtime=<path>
868 to set the actual SCL executable. If the SCL lisp command is a shell
869 script the SCL executable is the program exec'd by that shell script.])
872 SCL_RUNTIME=`basename ${SCL_RUNTIME_PATH}`
875 if test x"${gcl}" = xtrue; then
876 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)'`
878 if test ! x"${retval}" = x"0" ; then
879 AC_MSG_ERROR(unable to run gcl executable \"${GCL_NAME}\".)
881 count=`echo "${result}" | grep -c "MAXIMA_GCL_ANSI_TEST_SUCCESS"`
882 if test ! "${count}" = "1" ; then
883 AC_MSG_ERROR([The gcl executable \"${GCL_NAME}\" was not compiled with
884 the --enable-ansi flag, which is required for Maxima.
885 The gcl ANSI-CL check returned
890 AC_ARG_ENABLE(gcl-alt-link,
891 [ --enable-gcl-alt-link Use GCL's alternate linking mechanism],
892 [case "${enableval}" in
893 yes) gcl_alt_link=true ;;
894 no) gcl_alt_link=false ;;
895 *) AC_MSG_ERROR(bad value ${enableval} for --enable-gcl-alt-link) ;;
897 [gcl_alt_link=false])
899 AM_CONDITIONAL(GCL_ALT_LINK, test x$gcl_alt_link = xtrue)
901 AC_ARG_WITH(default-lisp,
902 [ --with-default-lisp=<lisp> Set default lisp implementation to <lisp>],
903 [case "${withval}" in
905 if test x"${clisp}" = xtrue ; then
908 AC_MSG_ERROR(clisp not enabled)
912 if test x"${cmucl}" = xtrue ; then
915 AC_MSG_ERROR(cmucl not enabled)
919 if test x"${scl}" = xtrue ; then
922 AC_MSG_ERROR(scl not enabled)
926 if test x"${sbcl}" = xtrue ; then
929 AC_MSG_ERROR(sbcl not enabled)
933 if test x"${gcl}" = xtrue ; then
936 AC_MSG_ERROR(gcl not enabled)
940 if test x"${acl}" = xtrue ; then
943 AC_MSG_ERROR(acl not enabled)
947 if test x"${openmcl}" = xtrue ; then
950 AC_MSG_ERROR(openmcl not enabled)
954 if test x"${ecl}" = xtrue ; then
957 AC_MSG_ERROR(ecl not enabled)
961 AC_MSG_ERROR(Unknown argument ${DEFAULTLISP} to --with-default-lisp)
964 [if test x"${clisp}" = xtrue ; then
966 elif test x"${cmucl}" = xtrue ; then
968 elif test x"${scl}" = xtrue ; then
970 elif test x"${sbcl}" = xtrue ; then
972 elif test x"${gcl}" = xtrue ; then
974 elif test x"${acl}" = xtrue ; then
976 elif test x"${openmcl}" = xtrue ; then
978 elif test x"${ecl}" = xtrue ; then
981 AC_MSG_ERROR(Internal error. No lisp enabled. Please contact maintainer.)
985 AC_SUBST(CLISP_RUNTIME)
986 AC_SUBST(CLISP_RUNTIME_PATH)
988 AC_SUBST(CMUCL_RUNTIME)
989 AC_SUBST(CMUCL_RUNTIME_PATH)
992 AC_SUBST(SCL_RUNTIME)
993 AC_SUBST(SCL_RUNTIME_PATH)
997 AC_SUBST(OPENMCL_NAME)
999 AC_SUBST(DEFAULTLISP)
1001 AC_SUBST(lisps_enabled)
1003 AC_ARG_WITH(posix-shell,
1004 [ --with-posix-shell=<path> Use <shell> for maxima script (default /bin/sh)],
1005 [posix_shell_list="${withval}"],
1006 [posix_shell_list="/bin/sh /bin/bash /usr/bin/bash /usr/local/bin/bash"])
1009 [ --with-wish=<prog> Use <prog> for Tk wish shell (default wish)],
1010 [WISH="${withval}"],
1015 AC_MSG_CHECKING(POSIX shell to see that it contains getopts)
1016 cat <<EOF > conftest-posix-shell.sh
1019 echo "result is \$result"
1023 for shell in $posix_shell_list
1025 if test -z "$POSIX_SHELL" ; then
1026 echo "trying $shell"
1027 $shell conftest-posix-shell.sh -a > /dev/null 2>&1
1028 if test "$?" = "0" ; then
1029 POSIX_SHELL="$shell"
1033 rm -f conftest-posix-shell.sh
1034 if test -n "$POSIX_SHELL" ; then
1035 AC_MSG_RESULT(POSIX shell is $POSIX_SHELL)
1037 AC_MSG_WARN(Could not find a shell that supports getopts.
1038 The maxima wrapper script will be unusable. The shell may be specified
1039 with --with-posix-shell=</path/to/shell>)
1041 AC_SUBST(POSIX_SHELL)
1043 if test x"${prefix}" = xNONE ; then
1044 tmp_prefix="/usr/local"
1046 tmp_prefix="${prefix}"
1048 if test x"${exec_prefix}" = xNONE ; then
1049 tmp_exec_prefix="${tmp_prefix}"
1051 tmp_exec_prefix="${exec_prefix}"
1053 expanded_top_srcdir="$(cd "$top_srcdir" 1>/dev/null 2>/dev/null; pwd)"
1054 expanded_exec_prefix="${tmp_exec_prefix}"
1055 expanded_libdir="$(eval "exec_prefix=\"${tmp_exec_prefix}\";echo ${libdir}")"
1056 expanded_libexecdir="$(eval "exec_prefix=\"${tmp_exec_prefix}\";echo ${libexecdir}")"
1057 expanded_datadir="$(eval "prefix=\"${tmp_prefix}\";datarootdir=\"${datarootdir}\";echo ${datadir}")"
1058 expanded_infodir="$(eval "prefix=\"${tmp_prefix}\";datarootdir=\"${datarootdir}\";echo ${infodir}")"
1061 dnl Find all the directories in share, but remove the share directory
1062 dnl itself and all CVS directories (if any) and fortran directories.
1063 dnl Remove the leading "share" part of the path, and add double-quotes
1066 #default_sharedirs=`find share -type d | sort | egrep -v 'share$|CVS|/fortran' | sed 's;share/\(.*\); "\1" \\\\;' | sed '$s;\\\\;;'`
1067 default_sharedirs=`find share -type d | sort | egrep -v 'share$|CVS|/fortran' | sed 's;share/\(.*\);"\1";' | tr '\n' ' '`
1069 AC_SUBST(expanded_top_srcdir)
1070 AC_SUBST(expanded_exec_prefix)
1071 AC_SUBST(expanded_libdir)
1072 AC_SUBST(expanded_libexecdir)
1073 AC_SUBST(expanded_datadir)
1074 AC_SUBST(expanded_infodir)
1075 default_layout_autotools="true"
1076 AC_SUBST(default_layout_autotools)
1078 AC_SUBST(default_sharedirs)
1080 dnl Look for grep that can handle long lines and -e.
1083 AC_PATH_PROG([CAT],[cat])
1088 # Configure these files and make them executable
1089 AC_CONFIG_FILES([maxima-local], chmod +x maxima-local)
1090 AC_CONFIG_FILES([xmaxima-local], chmod +x xmaxima-local)
1092 # Convert maxima.bat to DOS line ending
1093 # sed-3.02 in old mingw distribution doesn't support -i or \r
1094 # dos2unix may not be present, but perl is required elsewhere
1095 # perl -i interferes with binmode so need to use a temporary file
1096 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))
1098 AC_OUTPUT(Makefile maxima.spec maxima.iss \
1099 admin/Makefile src/Makefile src/maxima src/rmaxima src/autoconf-variables.lisp \
1100 src/share-subdirs.lisp \
1101 lisp-utils/Makefile tests/Makefile doc/Makefile \
1102 crosscompile-windows/Makefile crosscompile-windows/wxwidgets/Makefile \
1103 doc/emaxima/Makefile doc/info/Makefile doc/info/include-maxima.texi \
1104 doc/info/figures/Makefile \
1105 doc/info/de/Makefile \
1106 doc/info/de.utf8/Makefile doc/info/es/Makefile doc/info/es.utf8/Makefile \
1107 doc/info/pt/Makefile doc/info/pt.utf8/Makefile \
1108 doc/info/pt/include-maxima.texi \
1109 doc/info/pt_BR/Makefile doc/info/pt_BR.utf8/Makefile \
1110 doc/intromax/Makefile doc/man/Makefile doc/man/maxima.1 doc/man/ru/maxima.1 \
1111 doc/share/Makefile interfaces/Makefile interfaces/emacs/Makefile \
1112 interfaces/emacs/emaxima/Makefile interfaces/emacs/imaxima/Makefile \
1113 interfaces/emacs/misc/Makefile interfaces/xmaxima/Makefile \
1114 interfaces/xmaxima/autoconf-variables.tcl interfaces/xmaxima/Tkmaxima/Header.tcl \
1115 interfaces/xmaxima/doc/Makefile interfaces/xmaxima/doc/figures/Makefile \
1116 interfaces/xmaxima/msgs/Makefile interfaces/xmaxima/win32/Makefile \
1117 plotting/mgnuplot share/Makefile demo/Makefile plotting/Makefile locale/Makefile \
1118 share/contrib/Makefile share/contrib/integration/Makefile \
1119 share/contrib/maxima-odesolve/Makefile \
1120 share/draw/Makefile share/logic/Makefile doc/info/es/include-maxima.texi \
1125 if test x"${clisp}" = xtrue ; then
1126 echo "clisp enabled. Executable name: \"${CLISP_NAME}\""
1127 echo "clisp runtime is \"${CLISP_RUNTIME_PATH}\""
1129 if test x"${clisp_exec}" = xtrue ; then
1130 echo "clisp executable image enabled for maxima."
1132 if test x"${cmucl}" = xtrue ; then
1133 echo "CMUCL enabled. Executable name: \"${CMUCL_NAME}\""
1134 echo "cmucl runtime is \"${CMUCL_RUNTIME_PATH}\""
1136 if test x"${cmucl_exec}" = xtrue; then
1137 echo "CMUCL executable image enabled for maxima."
1139 if test x"${scl}" = xtrue ; then
1140 echo "SCL enabled. Executable name: \"${SCL_NAME}\""
1141 echo "SCL runtime is \"${SCL_RUNTIME_PATH}\""
1143 if test x"${sbcl}" = xtrue ; then
1144 echo "SBCL enabled. Executable name: \"${SBCL_NAME}\""
1146 if test x"${sbcl_exec}" = xtrue ; then
1147 echo "sbcl executable image enabled for maxima."
1149 if test x"${gcl}" = xtrue ; then
1150 echo "GCL enabled. Executable name: \"${GCL_NAME}\""
1151 if test x"${gcl_alt_link}" = xtrue ; then
1152 echo " GCL alternative linking method enabled."
1155 if test x"${acl}" = xtrue ; then
1156 echo "ACL enabled. Executable name: \"${ACL_NAME}\""
1158 if test x"${openmcl}" = xtrue ; then
1159 echo "OpenMCL enabled. Executable name: \"${OPENMCL_NAME}\""
1161 if test x"${openmcl_exec}" = xtrue ; then
1162 echo "OpenMCL executable image enabled for maxima."
1164 if test x"${ecl}" = xtrue ; then
1165 echo "ECL enabled. Executable name: \"${ECL_NAME}\""
1167 echo "default lisp: $DEFAULTLISP"
1168 echo "wish executable name: \"${WISH}\""
1170 if test x"${chm}" = xtrue ; then
1171 echo "CHM help files enabled"
1172 echo " HHC: \"${HHC}\""
1174 if test x"${xmaxima_exe}" = xtrue ; then
1175 echo "Windows xmaxima.exe enabled"
1176 echo " GCC version GCCVER: ${GCCVER}"
1177 echo " TCLKITSH: ${TCLKITSH}"
1178 if ! test -f "${TCLKITSH}" ; then
1179 AC_MSG_WARN(*** TCLKITSH ${TCLKITSH} not found)
1180 xmaxima_exe_prerequisite=notfound
1182 echo " TCLKIT_RUNTIME: ${TCLKIT_RUNTIME}"
1183 if ! test -f "${TCLKIT_RUNTIME}" ; then
1184 AC_MSG_WARN(*** TCLKIT_RUNTIME ${TCLKIT_RUNTIME} not found)
1185 xmaxima_exe_prerequisite=notfound
1187 echo " SDXKIT: ${SDXKIT}"
1188 if ! test -f "${SDXKIT}" ; then
1189 AC_MSG_WARN(*** SDXKIT ${SDXKIT} not found)
1190 xmaxima_exe_prerequisite=notfound
1192 echo " IMGKIT: ${IMGKIT}"
1193 if ! test -f "${IMGKIT}" ; then
1194 AC_MSG_WARN(*** IMGKIT ${IMGKIT} not found)
1195 xmaxima_exe_prerequisite=notfound
1197 if test x${xmaxima_exe_prerequisite} = xnotfound ; then
1198 AC_MSG_WARN([A prerequisite for xmaxima.exe not found. The missing components can be defined on the make command line.])