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.41post])
12 AC_CONFIG_SRCDIR([src/macsys.lisp])
13 AM_INIT_AUTOMAKE([-Wno-portability tar-ustar])
15 # On debian-based systems this makes us use the right gcl version out-of-the box.
16 # On other systems it doesn't hurt.
23 dnl If we were using a C compiler, EXEEXT would get defined
24 dnl automatically. But we aren't, so we have to define it ourselves.
25 dnl Still to do: Add Win64 support here, if this is needed.
51 AM_CONDITIONAL(WIN32, test x$win32 = xtrue)
52 AM_CONDITIONAL(WIN64, test x$win64 = xtrue)
54 dnl To make life more confusing, the automake test machinery (which we
55 dnl use in ./tests) needs the am__EXEEXT conditional. This would have
56 dnl normally been expanded (via something we've copied from Automake's
57 dnl init.m4 into our aclocal.m4) as Automake computed EXEEXT, but it
58 dnl didn't so we have to drop this in ourselves.
59 AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])
64 dnl n.b. clisp_default_name is hardcoded in "with" message
65 clisp_default_name=clisp
67 [ --enable-clisp Use clisp],
68 [case "${enableval}" in
70 lisps_enabled="${lisps_enabled} clisp"
73 *) AC_MSG_ERROR(bad value ${enableval} for --enable-clisp) ;;
78 [ --with-clisp=<prog> Use clisp executable <prog> (default clisp)],
80 lisps_enabled="${lisps_enabled} clisp"
82 if test "$withval" = "yes"; then
83 CLISP_NAME="${clisp_default_name}"
87 [CLISP_NAME=${clisp_default_name}])
88 CLISP_RUNTIME="lisp${CLISPEXT}"
89 AC_ARG_WITH(clisp-runtime,
90 [ --with-clisp-runtime=<path> Use clisp runtime <path> (default
91 *lib-directory*/base/lisp.run on unix,
92 *lib-directory*\\lisp.exe on windows) ],
94 lisps_enabled="${lisps_enabled} clisp"
95 CLISP_RUNTIME_PATH="$withval"
96 CLISP_RUNTIME=`basename ${CLISP_RUNTIME_PATH}`],
98 AC_ARG_ENABLE(clisp-exec,
99 [ --enable-clisp-exec Create a maxima executable image using CLISP.
100 No check is made if the version of
101 CLISP supports executable images],
102 [case "${enableval}" in
105 lisps_enabled="${lisps_enabled} clisp"
106 explicit_lisp=true ;;
107 no) clisp_exec=false ;;
108 *) AC_MSG_ERROR(bad value ${enableval} for --enable-clisp-exec) ;;
110 CLISP_EXEC=${clisp_exec}],
113 if test x"${clisp}" = xtrue ; then
114 if test `echo "$CLISP_NAME" | sed 's/\(.\).*/\1/'` = "/" ; then
115 if test -x "$CLISP_NAME" ; then
121 AC_CHECK_PROG(clisp_found,$CLISP_NAME,true,false)
123 if test x"${clisp_found}" = xfalse ; then
124 AC_MSG_WARN(clisp executable ${CLISP_NAME} not found in PATH)
129 dnl See if git exists. If it does, update VERSION to include a git tag
130 AC_CHECK_PROG(git_found, git, true, false)
131 if test x"${git_found}" = xtrue; then
132 # Test to see if git describe works (discarding any output). If
133 # it works, use it. Otherwise, keep existing value of VERSION.
134 # (git describe fails if git is executed in a non-Git directory, e.g.,
135 # an unpacked tarball. Since the exit codes of git describe are undocumented,
136 # we cannot distinguish that from a missing annotated tag.
137 # Play it safe by refusing to change VERSION.)
138 if git describe > /dev/null 2>&1; then
139 VERSION="`git describe --dirty`"
140 # When building RPMs, hyphens in the version are not allowed, so
141 # replace them with underscores.
142 VERSION=`echo $VERSION | sed 's;-;_;g'`
146 dnl Parses the version number for the manual
147 manual_version=`echo $VERSION | sed 's+branch_++; s+_base++; s+_dirty++; s+_+.+g'`
148 AC_SUBST(manual_version)
150 dnl n.b. cmucl_default_name is hardcoded in "with" message
151 cmucl_default_name=lisp
154 [ --enable-cmucl Use CMUCL],
155 [case "${enableval}" in
157 lisps_enabled="${lisps_enabled} cmucl"
158 explicit_lisp=true ;;
160 *) AC_MSG_ERROR(bad value ${enableval} for --enable-cmucl) ;;
165 [ --with-cmucl=<prog> Use CMUCL executable <prog> (default lisp)],
167 lisps_enabled="${lisps_enabled} cmucl"
169 if test "$withval" = "yes"; then
170 CMUCL_NAME="${cmucl_default_name}"
172 CMUCL_NAME="$withval"
174 [CMUCL_NAME=${cmucl_default_name}])
175 AC_ARG_WITH(cmucl-runtime,
176 [ --with-cmucl-runtime=<path> Use CMUCL runtime <path> (default
177 *cmucl-lib*/../bin/lisp)],
179 lisps_enabled="${lisps_enabled} cmucl"
180 CMUCL_RUNTIME_PATH="$withval"
181 CMUCL_RUNTIME=`basename ${CMUCL_RUNTIME_PATH}`],
183 AC_ARG_ENABLE(cmucl-exec,
184 [ --enable-cmucl-exec Create a maxima executable image using CMUCL.
185 No check is made if the version of
186 CMUCL supports executable images],
187 [case "${enableval}" in
190 lisps_enabled="${lisps_enabled} cmucl"
191 explicit_lisp=true ;;
192 no) cmucl_exec=false ;;
193 *) AC_MSG_ERROR(bad value ${enableval} for --enable-cmucl-exec) ;;
195 CMUCL_EXEC=${cmucl_exec}],
198 if test x"${cmucl}" = xtrue ; then
199 if test `echo "$CMUCL_NAME" | sed 's/\(.\).*/\1/'` = "/" ; then
200 if test -x "$CMUCL_NAME" ; then
206 AC_CHECK_PROG(cmucl_found,$CMUCL_NAME,true,false)
208 AC_CHECK_PROG(cmucl_found,$CMUCL_NAME,true,false)
209 if test x"${cmucl_found}" = xfalse ; then
210 AC_MSG_WARN(cmucl executable ${CMUCL_NAME} not found in PATH)
214 dnl n.b. scl_default_name is hardcoded in "with" message
218 [ --enable-scl Use SCL],
219 [case "${enableval}" in
221 lisps_enabled="${lisps_enabled} scl"
222 explicit_lisp=true ;;
224 *) AC_MSG_ERROR(bad value ${enableval} for --enable-scl) ;;
229 [ --with-scl=<prog> Use SCL executable <prog> (default scl)],
231 lisps_enabled="${lisps_enabled} scl"
233 if test "$withval" = "yes"; then
234 SCL_NAME="${scl_default_name}"
238 [SCL_NAME=${scl_default_name}])
239 AC_ARG_WITH(scl-runtime,
240 [ --with-scl-runtime=<path> Use SCL runtime <path> (default
241 file://library/../bin/lisp)],
243 lisps_enabled="${lisps_enabled} scl"
244 SCL_RUNTIME_PATH="$withval"
245 SCL_RUNTIME=`basename ${SCL_RUNTIME_PATH}`],
247 if test x"${scl}" = xtrue ; then
248 if test `echo "$SCL_NAME" | sed 's/\(.\).*/\1/'` = "/" ; then
249 if test -x "$SCL_NAME" ; then
255 AC_CHECK_PROG(scl_found,$SCL_NAME,true,false)
257 AC_CHECK_PROG(scl_found,$SCL_NAME,true,false)
258 if test x"${scl_found}" = xfalse ; then
259 AC_MSG_WARN(scl executable ${SCL_NAME} not found in PATH)
263 dnl n.b. sbcl_default_name is hardcoded in "with" message
264 sbcl_default_name=sbcl
266 [ --enable-sbcl Use SBCL],
267 [case "${enableval}" in
269 lisps_enabled="${lisps_enabled} sbcl"
270 explicit_lisp=true ;;
272 *) AC_MSG_ERROR(bad value ${enableval} for --enable-sbcl) ;;
277 [ --with-sbcl=<prog> Use SBCL executable <prog> (default sbcl)],
279 lisps_enabled="${lisps_enabled} sbcl"
281 if test "$withval" = "yes"; then
282 SBCL_NAME="${sbcl_default_name}"
286 [SBCL_NAME="${sbcl_default_name}"])
287 AC_ARG_ENABLE(sbcl-exec,
288 [ --enable-sbcl-exec Create a maxima executable image using SBCL.
289 No check is made if the version of
290 SBCL supports executable images],
291 [case "${enableval}" in
294 lisps_enabled="${lisps_enabled} sbcl"
295 explicit_lisp=true ;;
296 no) sbcl_exec=false ;;
297 *) AC_MSG_ERROR(bad value ${enableval} for --enable-sbcl-exec) ;;
299 SBCL_EXEC=${sbcl_exec}],
302 if test x"${sbcl}" = xtrue ; then
303 if test `echo "$SBCL_NAME" | sed 's/\(.\).*/\1/'` = "/" ; then
304 if test -x "$SBCL_NAME" ; then
310 AC_CHECK_PROG(sbcl_found,"$SBCL_NAME",true,false)
312 AC_CHECK_PROG(sbcl_found,"$SBCL_NAME",true,false)
313 if test x"${sbcl_found}" = xfalse ; then
314 AC_MSG_WARN(sbcl executable "${SBCL_NAME}" not found in PATH)
318 dnl n.b. acl_default_name is hardcoded in "with" message
319 acl_default_name=lisp
321 [ --enable-acl Use ACL],
322 [case "${enableval}" in
324 lisps_enabled="${lisps_enabled} acl"
325 explicit_lisp=true ;;
327 *) AC_MSG_ERROR(bad value ${enableval} for --enable-acl) ;;
332 [ --with-acl=<prog> Use ACL executable <prog> (default lisp)],
334 lisps_enabled="${lisps_enabled} acl"
336 if test "$withval" = "yes"; then
337 ACL_NAME="${acl_default_name}"
341 [ACL_NAME=${acl_default_name}])
342 if test x"${acl}" = xtrue ; then
343 if test `echo "$ACL_NAME" | sed 's/\(.\).*/\1/'` = "/" ; then
344 if test -x "$ACL_NAME" ; then
350 AC_CHECK_PROG(acl_found,$ACL_NAME,true,false)
352 AC_CHECK_PROG(acl_found,$ACL_NAME,true,false)
353 if test x"${acl_found}" = xfalse ; then
354 AC_MSG_WARN(acl executable ${ACL_NAME} not found in PATH)
358 dnl n.b. gcl_default_name is hardcoded in "with" message
361 [ --enable-gcl Use GCL],
362 [case "${enableval}" in
364 lisps_enabled="${lisps_enabled} gcl"
367 *) AC_MSG_ERROR(bad value ${enableval} for --enable-gcl) ;;
371 [ --with-gcl=<prog> Use GCL executable <prog> (default gcl)],
373 lisps_enabled="${lisps_enabled} gcl"
375 if test "$withval" = "yes"; then
376 GCL_NAME="${gcl_default_name}"
380 [GCL_NAME=${gcl_default_name}])
381 if test x"${gcl}" = xtrue ; then
382 if test `echo "$GCL_NAME" | sed 's/\(.\).*/\1/'` = "/" ; then
383 if test -x "$GCL_NAME" ; then
389 AC_CHECK_PROG(gcl_found,$GCL_NAME,true,false)
391 if test x"${gcl_found}" = xfalse ; then
392 AC_MSG_WARN(gcl executable ${GCL_NAME} not found in PATH)
396 dnl n.b. openmcl_default_name is hardcoded in "with" message
397 openmcl_default_name=openmcl
398 AC_ARG_ENABLE(openmcl,
399 [ --enable-openmcl Use OpenMCL],
400 [case "${enableval}" in
402 lisps_enabled="${lisps_enabled} openmcl"
405 *) AC_MSG_ERROR(bad value ${enableval} for --enable-openmcl) ;;
409 [ --with-openmcl=<prog> Use OpenMCL executable <prog> (default openmcl)],
411 lisps_enabled="${lisps_enabled} openmcl"
413 if test "$withval" = "yes"; then
414 OPENMCL_NAME="${openmcl_default_name}"
416 OPENMCL_NAME="$withval"
418 [OPENMCL_NAME=${openmcl_default_name}])
419 AC_ARG_ENABLE(openmcl-exec,
420 [ --enable-openmcl-exec Create a maxima executable image using OPENMCL.
421 No check is made if the version of
422 OPENMCL supports executable images],
423 [case "${enableval}" in
424 yes) openmcl_exec=true
426 lisps_enabled="${lisps_enabled} openmcl"
428 no) openmcl_exec=false ;;
429 *) AC_MSG_ERROR(bad value ${enableval} for --enable-openmcl-exec) ;;
431 OPENMCL_EXEC=${openmcl_exec}],
435 dnl Define ccl as an alias (essentially) for openmcl
437 [ --enable-ccl Use CCL (Clozure Common Lisp)],
438 [case "${enableval}" in
440 lisps_enabled="${lisps_enabled} openmcl"
443 *) AC_MSG_ERROR(bad value ${enableval} for --enable-ccl) ;;
447 [ --with-ccl=<prog> Use OpenMCL executable <prog> (default ccl)],
449 lisps_enabled="${lisps_enabled} openmcl"
451 if test "$withval" = "yes"; then
452 OPENMCL_NAME="${openmcl_default_name}"
454 OPENMCL_NAME="$withval"
456 [OPENMCL_NAME=${openmcl_default_name}])
457 AC_ARG_ENABLE(ccl-exec,
458 [ --enable-ccl-exec Create a maxima executable image using CCL.
459 No check is made if the version of
460 CCL supports executable images],
461 [case "${enableval}" in
462 yes) openmcl_exec=true
464 lisps_enabled="${lisps_enabled} openmcl"
466 no) openmcl_exec=false ;;
467 *) AC_MSG_ERROR(bad value ${enableval} for --enable-ccl-exec) ;;
469 OPENMCL_EXEC=${openmcl_exec}],
473 if test x"${openmcl}" = xtrue ; then
474 if test `echo "$OPENMCL_NAME" | sed 's/\(.\).*/\1/'` = "/" ; then
475 if test -x "$OPENMCL_NAME" ; then
481 AC_CHECK_PROG(openmcl_found,$OPENMCL_NAME,true,false)
483 if test x"${openmcl_found}" = xfalse ; then
484 AC_MSG_WARN(openmcl executable ${OPENMCL_NAME} not found in PATH)
488 dnl n.b. ccl64_default_name is hardcoded in "with" message
489 dnl We assume we're running on an x86 processor. The user has to
490 dnl select a different executable name to match his system, if neceessary.
492 ccl64_default_name=dx86cl64
494 [ --enable-ccl64 Use CCL (Clozure Common Lisp), 64-bit],
495 [case "${enableval}" in
497 lisps_enabled="${lisps_enabled} ccl64"
500 *) AC_MSG_ERROR(bad value ${enableval} for --enable-ccl64) ;;
504 [ --with-ccl64=<prog> Use ccl64 executable <prog> (default dx86cl64)],
506 lisps_enabled="${lisps_enabled} ccl64"
508 if test "$withval" = "yes"; then
509 CCL64_NAME="${ccl64_default_name}"
511 CCL64_NAME="$withval"
513 [CCL64_NAME=${ccl64_default_name}])
514 AC_ARG_ENABLE(ccl64-exec,
515 [ --enable-ccl64-exec Create a maxima executable image using CCL.
516 No check is made if the version of
517 CCL supports executable images],
518 [case "${enableval}" in
521 lisps_enabled="${lisps_enabled} ccl64"
523 no) ccl64_exec=false ;;
524 *) AC_MSG_ERROR(bad value ${enableval} for --enable-ccl64-exec) ;;
526 CCL64_EXEC=${ccl64_exec}],
530 dnl n.b. ecl_default_name is hardcoded in "with" message
533 [ --enable-ecl Use ECL],
534 [case "${enableval}" in
536 lisps_enabled="${lisps_enabled} ecl"
539 *) AC_MSG_ERROR(bad value ${enableval} for --enable-ecl) ;;
543 [ --with-ecl=<prog> Use ECL executable <prog> (default ecl)],
545 lisps_enabled="${lisps_enabled} ecl"
547 if test "$withval" = "yes"; then
548 ECL_NAME="${ecl_default_name}"
552 [ECL_NAME=${ecl_default_name}])
553 if test x"${ecl}" = xtrue ; then
554 if test `echo "$ECL_NAME" | sed 's/\(.\).*/\1/'` = "/" ; then
555 if test -x "$ECL_NAME" ; then
561 AC_CHECK_PROG(ecl_found,$ECL_NAME,true,false)
563 if test x"${ecl_found}" = xfalse ; then
564 AC_MSG_WARN(ecl executable ${ECL_NAME} not found in PATH)
569 AC_ARG_ENABLE(gettext,
570 [ --enable-gettext Locale support],
571 [case "${enableval}" in
572 yes) enable_gettext=true ;;
573 no) enable_gettext=false ;;
574 *) AC_MSG_ERROR(bad value ${enableval} for --enable-gettext) ;;
576 [enable_gettext=false])
579 AM_CONDITIONAL(ENABLE_GETTEXT, test x$enable_gettext = xtrue)
582 AC_ARG_ENABLE(lang-de,
583 [ --enable-lang-de German language support],
584 [case "${enableval}" in
587 *) AC_MSG_ERROR(bad value ${enableval} for --enable-lang-de) ;;
591 AM_CONDITIONAL(LANG_DE, test x$lang_de = xtrue)
593 AC_ARG_ENABLE(lang-de-utf8,
594 [ --enable-lang-de-utf8 German language support (UTF-8)],
595 [case "${enableval}" in
596 yes) lang_de_utf8=true ;;
597 no) lang_de_utf8=false ;;
598 *) AC_MSG_ERROR(bad value ${enableval} for --enable-lang-de-utf8) ;;
600 [lang_de_utf8=false])
602 AM_CONDITIONAL(LANG_DE_UTF8, test x$lang_de_utf8 = xtrue)
604 AC_ARG_ENABLE(lang-es,
605 [ --enable-lang-es Spanish language support],
606 [case "${enableval}" in
609 *) AC_MSG_ERROR(bad value ${enableval} for --enable-lang-es) ;;
614 AM_CONDITIONAL(LANG_ES, test x$lang_es = xtrue)
616 AC_ARG_ENABLE(lang-es-utf8,
617 [ --enable-lang-es-utf8 Spanish language support (UTF-8)],
618 [case "${enableval}" in
619 yes) lang_es_utf8=true ;;
620 no) lang_es_utf8=false ;;
621 *) AC_MSG_ERROR(bad value ${enableval} for --enable-lang-es-utf8) ;;
623 [lang_es_utf8=false])
625 AM_CONDITIONAL(LANG_ES_UTF8, test x$lang_es_utf8 = xtrue)
627 AC_ARG_ENABLE(lang-pt,
628 [ --enable-lang-pt Portuguese language support],
629 [case "${enableval}" in
632 *) AC_MSG_ERROR(bad value ${enableval} for --enable-lang-pt) ;;
637 AM_CONDITIONAL(LANG_PT, test x$lang_pt = xtrue)
639 AC_ARG_ENABLE(lang-pt-utf8,
640 [ --enable-lang-pt-utf8 Portuguese language support (UTF-8)],
641 [case "${enableval}" in
642 yes) lang_pt_utf8=true ;;
643 no) lang_pt_utf8=false ;;
644 *) AC_MSG_ERROR(bad value ${enableval} for --enable-lang-pt-utf8) ;;
646 [lang_pt_utf8=false])
648 AM_CONDITIONAL(LANG_PT_UTF8, test x$lang_pt_utf8 = xtrue)
650 AC_ARG_ENABLE(lang-pt_BR,
651 [ --enable-lang-pt_BR Brazilian Portuguese language support],
652 [case "${enableval}" in
653 yes) lang_pt_br=true ;;
654 no) lang_pt_br=false ;;
655 *) AC_MSG_ERROR(bad value ${enableval} for --enable-lang-pt_BR) ;;
660 AM_CONDITIONAL(LANG_PT_BR, test x$lang_pt_br = xtrue)
662 AC_ARG_ENABLE(lang-pt_BR-utf8,
663 [ --enable-lang-pt_BR-utf8 Brazilian Portuguese language support (UTF-8)],
664 [case "${enableval}" in
665 yes) lang_pt_br_utf8=true ;;
666 no) lang_pt_br_utf8=false ;;
667 *) AC_MSG_ERROR(bad value ${enableval} for --enable-lang-pt_BR-utf8) ;;
669 [lang_pt_br_utf8=false])
671 AM_CONDITIONAL(LANG_PT_BR_UTF8, test x$lang_pt_br_utf8 = xtrue)
673 AC_ARG_ENABLE(recode,
674 [ --enable-recode Use recode for charset conversion],
675 [case "${enableval}" in
676 yes) use_recode=true ;;
677 no) use_recode=false ;;
678 *) AC_MSG_ERROR(bad value ${enableval} for --enable-recode) ;;
682 dnl iconv and/or recode
683 AC_CHECK_PROG(iconv_found,iconv,true,false)
684 AC_CHECK_PROG(recode_found,recode,true,false)
686 if test x"${use_recode}" = xtrue ; then
687 if test x"${recode_found}" = xfalse ; then
688 AC_MSG_ERROR(No recode found)
690 elif test x"${iconv_found}" = xfalse ; then
696 AM_CONDITIONAL(USE_RECODE, test x$use_recode = xtrue)
698 dnl Optionally build the windows CHM help files
699 dnl default to false as requires win32 and Microsoft HTML Help Workshop
701 [ --enable-chm Build Windows CHM help files],
702 [case "${enableval}" in
705 *) AC_MSG_ERROR(bad value ${enableval} for --enable-chm) ;;
708 AM_CONDITIONAL(CHM, test x$chm = xtrue)
709 dnl hhc is the HTML Help Compiler for CHM documentation
710 hhc_default_name=hhc$EXEEXT
712 [ --with-hhc=<prog> Use HTML Help Compiler executable <prog> (default hhc)],
714 if test "$withval" = "yes"; then
715 HHC="${hhc_default_name}"
719 [HHC="${hhc_default_name}"])
721 # Check that hhc exists, using AC_CHECK_PROG
722 if test x$chm = xtrue; then
723 if test -x "${HHC}"; then
724 # HHC was a path to the executable, and it existed, which is
725 # great! We still say something to the caller, since this is
726 # probably less confusing.
727 AC_MSG_CHECKING([for hhc])
730 AC_CHECK_PROG(hhc_found, ${HHC}, yes)
731 if test x"${hhc_found}" != x"yes"; then
732 AC_MSG_ERROR([HTML Help Compiler executable ${HHC} not found])
737 dnl Make the build quiet
738 AC_ARG_ENABLE(quiet_build,
739 [ --enable-quiet-build Make the build quieter],
740 [case "${enableval}" in
741 yes) quiet_build=true ;;
742 no) quiet_build=false ;;
743 *) AC_MSG_ERROR(bad value ${enableval} for --enable-quiet-build) ;;
746 AM_CONDITIONAL(QUIET_BUILD, test x${quiet_build} = xtrue)
748 dnl Optionally build xmaxima.exe under windows
749 dnl default to false as additional software
750 AC_ARG_ENABLE(xmaxima_exe,
751 [ --enable-xmaxima-exe Build Windows xmaxima.exe for installer],
752 [case "${enableval}" in
753 yes) xmaxima_exe=true ;;
754 no) xmaxima_exe=false ;;
755 *) AC_MSG_ERROR(bad value ${enableval} for --enable-xmaxima-exe) ;;
758 AM_CONDITIONAL(XMAXIMA_EXE, test x$xmaxima_exe = xtrue)
760 dnl Optionally build xmaxima.exe under windows
761 dnl default to false as additional software
762 AC_ARG_ENABLE(winkill_exe,
763 [ --enable-winkill Build Windows winkill.exe and winkill_lib.dll for installer],
764 [case "${enableval}" in
765 yes) winkill_exe=true ;;
766 no) winkill_exe=false ;;
767 *) AC_MSG_ERROR(bad value ${enableval} for --enable-winkill-exe) ;;
770 AM_CONDITIONAL(WINKILL_EXE, test x$winkill_exe = xtrue)
772 dnl Should we build a win64 installer?
773 AC_ARG_ENABLE(win64-installer,
774 [ --enable-win64-installer Build a 64bit installer on Windows],
775 [case "${enableval}" in
776 yes) win64_installer=true ;;
777 no) win64_installer=false ;;
778 *) AC_MSG_ERROR(bad valu ${enableval} for --enable-win64-installer) ;;
780 [win64_installer=false])
781 AM_CONDITIONAL(WIN64_INSTALLER, test x$win64_installer = xtrue)
782 AC_SUBST(win64_installer)
784 dnl Enable use of MathJax in the html documentation. This just loads
785 dnl MathJax in each html file. The texi files need to put the
786 dnl appropriate @html/@end html text to generate the equations for MathJax.
787 AC_ARG_ENABLE(mathjax,
788 [ --enable-mathjax Enable MathJax support for html manual],
789 [case "${enableval}" in
791 mathjax_enable='@set mathjax true'
792 mathjax_script="<script src='https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/MathJax.js?config=TeX-AMS-MML_HTMLorMML'></script>"
795 mathjax_enable='@clear mathjax'
797 *) AC_MSG_ERROR(bad value ${enableval} for --enable-mathjax) ;;
800 AM_CONDITIONAL(MATHJAX, test x$mathjax = xtrue)
801 AC_SUBST(mathjax_script)
802 AC_SUBST(mathjax_enable)
804 dnl Tools for building xmaxima.exe on windows
805 dnl Hard code the filenames for now. Can over-ride on make command line
807 if test x${xmaxima_exe} = xtrue ; then
808 GCCVER=`gcc -dumpversion`
809 dnl http://tclkits.rkeene.org/fossil/wiki?name=Downloads
810 dnl and http://www.tcl.tk/starkits/
811 TCLKITSH=/c/programs/star/tclkitsh-8.6.3-win32-ix86.exe
812 TCLKIT_RUNTIME=/c/programs/star/tclkit-8.6.3-win32-ix86.exe
813 SDXKIT=/c/programs/star/sdx.kit
814 IMGKIT=/c/programs/star/img.kit
819 AC_SUBST(TCLKIT_RUNTIME)
822 AM_CONDITIONAL(GCC331, test x${GCCVER} = x3.3.1)
824 if test x"${explicit_lisp}" = xfalse ; then
825 dnl See if any of the lisps can be found
826 AC_CHECK_PROG(clisp_found,${clisp_default_name},true,false)
827 AC_CHECK_PROG(gcl_found,${gcl_default_name},true,false)
828 AC_CHECK_PROG(cmucl_found,$CMUCL_NAME,true,false)
829 AC_CHECK_PROG(scl_found,$SCL_NAME,true,false)
830 AC_CHECK_PROG(sbcl_found,$SBCL_NAME,true,false)
831 AC_CHECK_PROG(acl_found,$ACL_NAME,true,false)
832 AC_CHECK_PROG(openmcl_found,$OPENMCL_NAME,true,false)
833 AC_CHECK_PROG(ccl64_found,$CCL64_NAME,true,false)
834 AC_CHECK_PROG(ecl_found,$ECL_NAME,true,false)
836 if test x"${clisp_found}" = xtrue ; then
838 lisps_enabled="${lisps_enabled} clisp"
839 elif test x"${gcl_found}" = xtrue ; then
841 lisps_enabled="${lisps_enabled} gcl"
842 elif test x"${cmucl_found}" = xtrue ; then
844 lisps_enabled="${lisps_enabled} cmucl"
845 elif test x"${scl_found}" = xtrue ; then
847 lisps_enabled="${lisps_enabled} scl"
848 elif test x"${sbcl_found}" = xtrue ; then
850 lisps_enabled="${lisps_enabled} sbcl"
851 elif test x"${acl_found}" = xtrue ; then
853 lisps_enabled="${lisps_enabled} acl"
854 elif test x"${ecl_found}" = xtrue ; then
856 lisps_enabled="${lisps_enabled} ecl"
857 elif test x"${ccl64_found}" = xtrue; then
859 lisps_enabled="${lisps_enabled} ccl64"
861 AC_MSG_ERROR(No lisp implementation specified and none of the default executables [${clisp_default_name}(clisp),${gcl_default_name}(GCL),${cmucl_default_name}(CMUCL),${scl_default_name}(SCL),${sbcl_default_name}(SBCL),${acl_default_name}(ACL),${openmcl_default_name}(OpenMCL),${ecl_default_name}(ECL)] were found in PATH)
865 AM_CONDITIONAL(CLISP, test x$clisp = xtrue)
866 AM_CONDITIONAL(CLISP_EXEC, test x$clisp_exec = xtrue)
867 AM_CONDITIONAL(GCL, test x$gcl = xtrue)
868 AM_CONDITIONAL(CMUCL, test x$cmucl = xtrue)
869 AM_CONDITIONAL(CMUCL_EXEC, test x${cmucl_exec} = xtrue)
870 AM_CONDITIONAL(SCL, test x$scl = xtrue)
871 AM_CONDITIONAL(SBCL, test x$sbcl = xtrue)
872 AM_CONDITIONAL(SBCL_EXEC, test x$sbcl_exec = xtrue)
873 AM_CONDITIONAL(ACL, test x$acl = xtrue)
874 AM_CONDITIONAL(OPENMCL, test x$openmcl = xtrue)
875 AM_CONDITIONAL(OPENMCL_EXEC, test x${openmcl_exec} = xtrue)
876 AM_CONDITIONAL(ECL, test x$ecl = xtrue)
877 AM_CONDITIONAL(CCL64, test x$ccl64 = xtrue)
878 AM_CONDITIONAL(CCL64_EXEC, test x${ccl64_exec} = xtrue)
880 if test x"${clisp}" = xtrue; then
881 if test x"${CLISP_RUNTIME_PATH}" = x"" ; then
882 if test x"${mingw}" = xtrue ; then
883 CLISP_RUNTIME_PATH=`${CLISP_NAME} -norc -q -x "(format nil \"~a${CLISP_RUNTIME}\" (namestring *lib-directory*))"|sed 's/\"\\(.*\\)\"/\\1/'`
885 CLISP_RUNTIME_PATH=`${CLISP_NAME} -norc -q -x "(format nil \"~abase/${CLISP_RUNTIME}\" (namestring *lib-directory*))"|sed 's/\"\\(.*\\)\"/\\1/'`
888 if test -x ${CLISP_RUNTIME_PATH} ; then
889 echo "clisp runtime is \"${CLISP_RUNTIME_PATH}\""
891 AC_MSG_ERROR(clisp runtime \"${CLISP_RUNTIME_PATH}\" is not an executable)
893 CLISP_RUNTIME=`basename ${CLISP_RUNTIME_PATH}`
896 if test x"${cmucl}" = xtrue; then
897 if test x"${CMUCL_RUNTIME_PATH}" = x"" ; then
898 CMUCL_RUNTIME_PATH=`${CMUCL_NAME} -noinit -nositeinit -quiet -batch -eval '#-cmu18 (progn (setf (search-list "cmuclbin:") (append (lisp::parse-unix-search-path lisp::*cmucl-lib*) (mapcar (function (lambda (p) (concatenate (quote string) p "../bin/"))) (lisp::parse-unix-search-path lisp::*cmucl-lib*))))(enumerate-search-list (s "cmuclbin:lisp") (when (probe-file s) (format t "~A~%" s) (quit)))) #+cmu18 (format t "~a/../bin/lisp~%" common-lisp::*cmucl-lib*)(quit)'`
900 if test -x "${CMUCL_RUNTIME_PATH}" ; then
901 echo "cmucl runtime is \"${CMUCL_RUNTIME_PATH}\""
903 dnl last chance: find CMUCL_NAME in path. Use it if it doesn't appear to
904 dnl be a shell script.
905 cmucl_path=`type -p "${CMUCL_NAME}"`
906 if test x"`grep -c '#!.*bin.*sh.*' ${cmucl_path}`" = x"0" ; then
907 CMUCL_RUNTIME_PATH="${cmucl_path}"
909 AC_MSG_ERROR([Unable to determine CMUCL runtime path.
910 The best guess for CMUCL runtime, \"${CMUCL_RUNTIME_PATH}\", is not
911 an executable. Use the argument
912 --with-cmucl-runtime=<path>
913 to set the actual CMUCL executable. If the CMUCL lisp command is a shell
914 script the CMUCL executable is the program exec'd by that shell script.])
917 CMUCL_RUNTIME=`basename ${CMUCL_RUNTIME_PATH}`
919 dnl cmucl final check
920 result=`"${CMUCL_RUNTIME_PATH}" -quiet -eval '(format t "MAXIMA_CMUCL_TEST_SUCCESS%")(quit)'`
922 if test ! x"${retval}" = x"0" ; then
923 AC_MSG_ERROR(unable to run cmucl runtime = "${CMUCL_RUNTIME_PATH}".
924 Please specify the full path of the cmucl runtime using the
925 --with-cmucl-runtime=<path>
928 count=`echo "${result}" | grep -c "MAXIMA_CMUCL_TEST_SUCCESS"`
929 if test ! "${count}" = "1" ; then
930 AC_MSG_ERROR(an error occured while checking cmucl runtime)
934 if test x"${scl}" = xtrue; then
935 if test x"${SCL_RUNTIME_PATH}" = x"" ; then
936 SCL_RUNTIME_PATH=`${SCL_NAME} -noinit -nositeinit -quiet -batch -eval '(progn (enumerate-pathname-translations (pathname "file://library/../bin/lisp") (when (probe-file pathname) (format t "~A~%" (unix-namestring pathname)))) (quit))'`
938 if test -x "${SCL_RUNTIME_PATH}" ; then
939 echo "scl runtime is \"${SCL_RUNTIME_PATH}\""
941 dnl last chance: find SCL_NAME in path. Use it if it doesn't appear to
942 dnl be a shell script.
943 scl_path=`type -p "${SCL_NAME}"`
944 if test x"`grep -c '#!.*bin.*sh.*' ${scl_path}`" = x"0" ; then
945 SCL_RUNTIME_PATH="${scl_path}"
947 AC_MSG_ERROR([Unable to determine SCL runtime path.
948 The best guess for SCL runtime, \"${SCL_RUNTIME_PATH}\", is not
949 an executable. Use the argument
950 --with-scl-runtime=<path>
951 to set the actual SCL executable. If the SCL lisp command is a shell
952 script the SCL executable is the program exec'd by that shell script.])
955 SCL_RUNTIME=`basename ${SCL_RUNTIME_PATH}`
958 if test x"${gcl}" = xtrue; then
959 result=`"${GCL_NAME}" -batch -eval '#+ansi-cl (format t "MAXIMA_GCL_ANSI_TEST_SUCCESS~%") #-ansi-cl (format t "MAXIMA_GCL_ANSI_TEST_FAILURE~%")' -eval '(si::bye)'`
961 if test ! x"${retval}" = x"0" ; then
962 AC_MSG_ERROR(unable to run gcl executable \"${GCL_NAME}\".)
964 count=`echo "${result}" | grep -c "MAXIMA_GCL_ANSI_TEST_SUCCESS"`
965 if test ! "${count}" = "1" ; then
966 AC_MSG_ERROR([The gcl executable \"${GCL_NAME}\" was not compiled with
967 the --enable-ansi flag, which is required for Maxima.
968 The gcl ANSI-CL check returned
973 AC_ARG_ENABLE(gcl-alt-link,
974 [ --enable-gcl-alt-link Use GCL's alternate linking mechanism],
975 [case "${enableval}" in
976 yes) gcl_alt_link=true ;;
977 no) gcl_alt_link=false ;;
978 *) AC_MSG_ERROR(bad value ${enableval} for --enable-gcl-alt-link) ;;
980 [gcl_alt_link=false])
982 AM_CONDITIONAL(GCL_ALT_LINK, test x$gcl_alt_link = xtrue)
984 AC_ARG_WITH(default-lisp,
985 [ --with-default-lisp=<lisp> Set default lisp implementation to <lisp>],
986 [case "${withval}" in
988 if test x"${clisp}" = xtrue ; then
991 AC_MSG_ERROR(clisp not enabled)
995 if test x"${cmucl}" = xtrue ; then
998 AC_MSG_ERROR(cmucl not enabled)
1002 if test x"${scl}" = xtrue ; then
1005 AC_MSG_ERROR(scl not enabled)
1009 if test x"${sbcl}" = xtrue ; then
1012 AC_MSG_ERROR(sbcl not enabled)
1016 if test x"${gcl}" = xtrue ; then
1019 AC_MSG_ERROR(gcl not enabled)
1023 if test x"${acl}" = xtrue ; then
1026 AC_MSG_ERROR(acl not enabled)
1030 if test x"${openmcl}" = xtrue ; then
1033 AC_MSG_ERROR(openmcl not enabled)
1037 if test x"${ecl}" = xtrue ; then
1040 AC_MSG_ERROR(ecl not enabled)
1044 if test x"${ccl64}" = xtrue ; then
1047 AC_MSG_ERROR(ccl64 not enabled)
1051 AC_MSG_ERROR(Unknown argument ${DEFAULTLISP} to --with-default-lisp)
1054 [if test x"${clisp}" = xtrue ; then
1056 elif test x"${cmucl}" = xtrue ; then
1058 elif test x"${scl}" = xtrue ; then
1060 elif test x"${sbcl}" = xtrue ; then
1062 elif test x"${gcl}" = xtrue ; then
1064 elif test x"${acl}" = xtrue ; then
1066 elif test x"${openmcl}" = xtrue ; then
1068 elif test x"${ecl}" = xtrue ; then
1070 elif test x"${ccl64}" = xtrue ; then
1073 AC_MSG_ERROR(Internal error. No lisp enabled. Please contact maintainer.)
1076 AC_SUBST(CLISP_NAME)
1077 AC_SUBST(CLISP_RUNTIME)
1078 AC_SUBST(CLISP_RUNTIME_PATH)
1079 AC_SUBST(CMUCL_NAME)
1080 AC_SUBST(CMUCL_RUNTIME)
1081 AC_SUBST(CMUCL_RUNTIME_PATH)
1082 AC_SUBST(CMUCL_EXEC)
1084 AC_SUBST(SCL_RUNTIME)
1085 AC_SUBST(SCL_RUNTIME_PATH)
1089 AC_SUBST(OPENMCL_NAME)
1091 AC_SUBST(CCL64_NAME)
1092 AC_SUBST(DEFAULTLISP)
1094 AC_SUBST(lisps_enabled)
1096 AC_ARG_WITH(posix-shell,
1097 [ --with-posix-shell=<path> Use <shell> for maxima script (default /bin/sh)],
1098 [posix_shell_list="${withval}"],
1099 [posix_shell_list="/bin/sh /bin/bash /usr/bin/bash /usr/local/bin/bash"])
1102 [ --with-wish=<prog> Use <prog> for Tk wish shell (default wish)],
1103 [WISH="${withval}"],
1108 AC_MSG_CHECKING(POSIX shell to see that it contains getopts)
1109 cat <<EOF > conftest-posix-shell.sh
1112 echo "result is \$result"
1116 for shell in $posix_shell_list
1118 if test -z "$POSIX_SHELL" ; then
1119 echo "trying $shell"
1120 $shell conftest-posix-shell.sh -a > /dev/null 2>&1
1121 if test "$?" = "0" ; then
1122 POSIX_SHELL="$shell"
1126 rm -f conftest-posix-shell.sh
1127 if test -n "$POSIX_SHELL" ; then
1128 AC_MSG_RESULT(POSIX shell is $POSIX_SHELL)
1130 AC_MSG_WARN(Could not find a shell that supports getopts.
1131 The maxima wrapper script will be unusable. The shell may be specified
1132 with --with-posix-shell=</path/to/shell>)
1134 AC_SUBST(POSIX_SHELL)
1136 if test x"${prefix}" = xNONE ; then
1137 tmp_prefix="/usr/local"
1139 tmp_prefix="${prefix}"
1141 if test x"${exec_prefix}" = xNONE ; then
1142 tmp_exec_prefix="${tmp_prefix}"
1144 tmp_exec_prefix="${exec_prefix}"
1146 expanded_top_srcdir="$(cd "$top_srcdir" 1>/dev/null 2>/dev/null; pwd)"
1147 expanded_exec_prefix="${tmp_exec_prefix}"
1148 expanded_libdir="$(eval "exec_prefix=\"${tmp_exec_prefix}\";echo ${libdir}")"
1149 expanded_libexecdir="$(eval "exec_prefix=\"${tmp_exec_prefix}\";echo ${libexecdir}")"
1150 expanded_datadir="$(eval "prefix=\"${tmp_prefix}\";datarootdir=\"${datarootdir}\";echo ${datadir}")"
1151 expanded_infodir="$(eval "prefix=\"${tmp_prefix}\";datarootdir=\"${datarootdir}\";echo ${infodir}")"
1154 dnl Find all the directories in share, but remove the share directory
1155 dnl itself and all CVS directories (if any) and fortran directories
1156 dnl and *.t2p directories (created when generating pdf documentation).
1157 dnl Remove the leading "share" part of the path, and add double-quotes
1160 #default_sharedirs=`find share -type d | sort | egrep -v 'share$|CVS|/fortran' | sed 's;share/\(.*\); "\1" \\\\;' | sed '$s;\\\\;;'`
1161 default_sharedirs=`find share -type d | sort | egrep -v 'share$|CVS|/fortran|\.t2p' | sed 's;share/\(.*\);"\1";' | tr '\n' ' '`
1163 AC_SUBST(expanded_top_srcdir)
1164 AC_SUBST(expanded_exec_prefix)
1165 AC_SUBST(expanded_libdir)
1166 AC_SUBST(expanded_libexecdir)
1167 AC_SUBST(expanded_datadir)
1168 AC_SUBST(expanded_infodir)
1169 default_layout_autotools="true"
1170 AC_SUBST(default_layout_autotools)
1172 AC_SUBST(default_sharedirs)
1174 dnl Look for grep that can handle long lines and -e.
1177 AC_PATH_PROG([CAT],[cat])
1182 # Configure these files and make them executable
1183 AC_CONFIG_FILES([maxima-local], chmod +x maxima-local)
1184 AC_CONFIG_FILES([xmaxima-local], chmod +x xmaxima-local)
1186 # Convert maxima.bat to DOS line ending
1187 # sed-3.02 in old mingw distribution doesn't support -i or \r
1188 # dos2unix may not be present, but perl is required elsewhere
1189 # perl -i interferes with binmode so need to use a temporary file
1190 AC_CONFIG_FILES([src/maxima.bat], (perl -ne 'BEGIN{binmode(STDOUT,":crlf")};' -e 'print' < src/maxima.bat > src/maxima.bat.tmp; mv src/maxima.bat.tmp src/maxima.bat))
1192 AC_OUTPUT(Makefile maxima.spec maxima.iss \
1193 admin/Makefile src/Makefile src/maxima src/rmaxima src/autoconf-variables.lisp \
1194 src/share-subdirs.lisp \
1195 lisp-utils/Makefile tests/Makefile doc/Makefile \
1196 crosscompile-windows/Makefile \
1197 doc/emaxima/Makefile doc/info/Makefile doc/info/include-maxima.texi \
1198 desktopintegration/Makefile \
1199 doc/info/texi2html.init \
1200 doc/info/figures/Makefile \
1201 doc/info/de/Makefile \
1202 doc/info/de.utf8/Makefile doc/info/es/Makefile doc/info/es.utf8/Makefile \
1203 doc/info/pt/Makefile doc/info/pt.utf8/Makefile \
1204 doc/info/pt/include-maxima.texi \
1205 doc/info/pt_BR/Makefile doc/info/pt_BR.utf8/Makefile \
1206 doc/intromax/Makefile doc/man/Makefile doc/man/maxima.1 doc/man/ru/maxima.1 \
1207 doc/share/Makefile interfaces/Makefile interfaces/emacs/Makefile \
1208 interfaces/emacs/emaxima/Makefile interfaces/emacs/imaxima/Makefile \
1209 interfaces/emacs/misc/Makefile interfaces/xmaxima/Makefile \
1210 interfaces/xmaxima/autoconf-variables.tcl interfaces/xmaxima/Tkmaxima/Header.tcl \
1211 interfaces/xmaxima/doc/Makefile interfaces/xmaxima/doc/figures/Makefile \
1212 interfaces/xmaxima/msgs/Makefile interfaces/xmaxima/win32/Makefile \
1213 plotting/mgnuplot share/Makefile demo/Makefile plotting/Makefile locale/Makefile \
1214 share/contrib/Makefile share/contrib/integration/Makefile \
1215 share/contrib/maxima-odesolve/Makefile \
1216 share/draw/Makefile share/logic/Makefile doc/info/es/include-maxima.texi \
1221 if test x"${clisp}" = xtrue ; then
1222 echo "clisp enabled. Executable name: \"${CLISP_NAME}\""
1223 echo "clisp runtime is \"${CLISP_RUNTIME_PATH}\""
1225 if test x"${clisp_exec}" = xtrue ; then
1226 echo "clisp executable image enabled for maxima."
1228 if test x"${cmucl}" = xtrue ; then
1229 echo "CMUCL enabled. Executable name: \"${CMUCL_NAME}\""
1230 echo "cmucl runtime is \"${CMUCL_RUNTIME_PATH}\""
1232 if test x"${cmucl_exec}" = xtrue; then
1233 echo "CMUCL executable image enabled for maxima."
1235 if test x"${scl}" = xtrue ; then
1236 echo "SCL enabled. Executable name: \"${SCL_NAME}\""
1237 echo "SCL runtime is \"${SCL_RUNTIME_PATH}\""
1239 if test x"${sbcl}" = xtrue ; then
1240 echo "SBCL enabled. Executable name: \"${SBCL_NAME}\""
1242 if test x"${sbcl_exec}" = xtrue ; then
1243 echo "sbcl executable image enabled for maxima."
1245 if test x"${gcl}" = xtrue ; then
1246 echo "GCL enabled. Executable name: \"${GCL_NAME}\""
1247 if test x"${gcl_alt_link}" = xtrue ; then
1248 echo " GCL alternative linking method enabled."
1251 if test x"${acl}" = xtrue ; then
1252 echo "ACL enabled. Executable name: \"${ACL_NAME}\""
1254 if test x"${openmcl}" = xtrue ; then
1255 echo "OpenMCL enabled. Executable name: \"${OPENMCL_NAME}\""
1257 if test x"${openmcl_exec}" = xtrue ; then
1258 echo "OpenMCL executable image enabled for maxima."
1260 if test x"${ccl64}" = xtrue ; then
1261 echo "CCL64 enabled. Executable name: \"${CCL64_NAME}\""
1263 if test x"${ccl64_exec}" = xtrue ; then
1264 echo "CCL64 executable image enabled for maxima."
1266 if test x"${ecl}" = xtrue ; then
1267 echo "ECL enabled. Executable name: \"${ECL_NAME}\""
1269 echo "default lisp: $DEFAULTLISP"
1270 echo "wish executable name: \"${WISH}\""
1272 if test x"${chm}" = xtrue ; then
1273 echo "CHM help files enabled"
1274 echo " HHC: \"${HHC}\""
1276 if test x"${xmaxima_exe}" = xtrue ; then
1277 echo "Windows xmaxima.exe enabled"
1278 echo " GCC version GCCVER: ${GCCVER}"
1279 echo " TCLKITSH: ${TCLKITSH}"
1280 if ! test -f "${TCLKITSH}" ; then
1281 AC_MSG_WARN(*** TCLKITSH ${TCLKITSH} not found)
1282 xmaxima_exe_prerequisite=notfound
1284 echo " TCLKIT_RUNTIME: ${TCLKIT_RUNTIME}"
1285 if ! test -f "${TCLKIT_RUNTIME}" ; then
1286 AC_MSG_WARN(*** TCLKIT_RUNTIME ${TCLKIT_RUNTIME} not found)
1287 xmaxima_exe_prerequisite=notfound
1289 echo " SDXKIT: ${SDXKIT}"
1290 if ! test -f "${SDXKIT}" ; then
1291 AC_MSG_WARN(*** SDXKIT ${SDXKIT} not found)
1292 xmaxima_exe_prerequisite=notfound
1294 echo " IMGKIT: ${IMGKIT}"
1295 if ! test -f "${IMGKIT}" ; then
1296 AC_MSG_WARN(*** IMGKIT ${IMGKIT} not found)
1297 xmaxima_exe_prerequisite=notfound
1299 if test x${xmaxima_exe_prerequisite} = xnotfound ; then
1300 AC_MSG_WARN([A prerequisite for xmaxima.exe not found. The missing components can be defined on the make command line.])