3 rem begin localisation of Environment Variables
4 setlocal enableextensions
7 rem Uncomment the line below and set required value to MAXIMA_LANG_SUBDIR
8 rem to get localized describe in command line Maxima
9 rem set MAXIMA_LANG_SUBDIR=es
11 rem The variable LANGUAGE is usually not set on Windows, but if Maxima is running in
12 rem Wine/Linux (e.g. for testing purposes) it is inherited from the Linux environment
13 rem and causes troubles (at least with Clisp, maybe other Lisps too),
14 rem so unset this variable.
17 set "lisp=@DEFAULTLISP@"
19 set "version=@VERSION@"
21 title Maxima Open Source Computer Algebra System
%version%
23 rem For what directory was Maxima configured? Set %prefix% to exactly that directory, if
24 rem Maxima was installed in the default path (= %configureprefix%/bin/maxima.bat exists).
25 rem %~dp0/.. should be the same, but is something like the 8.3 short path - and that
26 rem causes problems with Xmaxima and Clisp.
27 rem (the combination will not work if Maxima is installed somewhere else, but that is not recommended)
29 set "configureprefix=@prefix@"
30 if exist "%configureprefix%/bin/maxima.bat" set "prefix=%configureprefix%"
32 rem change "\" to "/" in that path. Works too and causes less troubles (e.g. with xmaxima).
33 set "prefix=%prefix:\=/%"
34 set "maxima_prefix=%prefix%"
35 set "package=@PACKAGE@"
37 set "path=%maxima_prefix%/gnuplot;%maxima_prefix%/gnuplot/bin;%maxima_prefix%/bin;%maxima_prefix%/vtk;%path%"
39 rem set userdir and tempdir - replace "\" with "/"
40 if not defined MAXIMA_USERDIR
set "MAXIMA_USERDIR=%USERPROFILE:\=/%/maxima"
41 if not defined MAXIMA_TEMPDIR
set "MAXIMA_TEMPDIR=%TEMP:\=/%"
42 rem there were reports, that the tempdir could not be found (maybe because of special characters, ut8-chars, ...)
43 rem so set a fallback (as it was before)
44 if not exist "%MAXIMA_TEMPDIR%"/ set "MAXIMA_TEMPDIR=%USERPROFILE:\=/%"
46 rem change 'short names' (e.g. "C:/Users/TESTTE~1/AppData/Local/Temp" to
47 rem long names (e.g. "C:/Users/test test/AppData/Local/Temp" -
48 rem CLISP has a problem with these short names.
49 rem Do this only if maxima_longnames.exe exists in the Maxima binary dir.
50 rem (it is not compiled and installed for example when a Lisp-only build is done).
51 if exist "%maxima_prefix%/bin/maxima_longnames.exe" for /F
"tokens=* USEBACKQ" %%F in
(`maxima_longnames.exe
"%MAXIMA_TEMPDIR%"`
) do set "MAXIMA_TEMPDIR=%%F"
54 rem read maximarc and set the Lisp type, if the user did specify MAXIMA_LISP
55 rem currently no comments or other (Unix shell) commands are understood, only (e.g):
57 if EXIST "%MAXIMA_USERDIR%/maximarc" (
58 setlocal enabledelayedexpansion
59 for /F usebackq
%%L in
("%MAXIMA_USERDIR%/maximarc") do (
61 set lisp
=!MAXIMA_LISP
!
65 rem In order to allow maxima to find out where its files are on MS Windows maxima needs
66 rem to be started in the directory it can be found in. Which in the case of
67 rem maxima-portable might be a different folder every time.
68 rem The user, though, might want it to start in the folder the worksheet lies in, as
69 rem read_matrix, write_data etc. should be relative to that folder.
70 rem common lisp doesn't provide such a function and clisp has problems with shortnames
71 rem while sbcl has problems with non-ascii-non-unicode folder names.
72 rem The variable MAXIMA_INITIAL_FOLDER tells which folder to start maxima in
73 rem after searching for the files it is composed of.
74 if defined MAXIMA_INITIAL_FOLDER
cd "%MAXIMA_INITIAL_FOLDER%"
77 if x
%1 == x
-l
goto foundlisp
78 if x
%1 == x
--lisp
goto foundlisp
79 if x
%1 == x
-u
goto foundversion
80 if x
%1 == x
--use-version
goto foundversion
81 if x
%1 == x
-v
goto foundverbose
82 if x
%1 == x
--verbose
goto foundverbose
83 if x
%1 == x
--lisp
-options
goto foundlispoptions
84 if x
%1 == x
-X
goto foundlispoptions
88 if not x
%1 == x
goto startparseargs
94 goto continueparseargs
99 goto continueparseargs
104 goto continueparseargs
108 goto continueparseargs
112 if "%MAXIMA_LAYOUT_AUTOTOOLS%" == "" goto defaultlayout
113 set layout_autotools
=true
117 set layout_autotools
=@default_layout_autotools@
121 if "%MAXIMA_PREFIX%" == "" goto defaultvars
122 if "%layout_autotools%" == "true" goto maxim_autotools
123 set "maxima_imagesdir=%MAXIMA_PREFIX%/src"
127 set "maxima_imagesdir=%MAXIMA_PREFIX%/lib/%package%/%version%"
131 if "%layout_autotools%" == "true" goto defmaxim_autotools
132 set "maxima_imagesdir=%prefix%/src"
136 set "maxima_imagesdir=%prefix%/lib/%package%/%version%"
141 set "maxima_image_base=%maxima_imagesdir%/binary-%lisp%/maxima"
143 if "%verbose%" == "true" @
echo on
144 if "%lisp%" == "gcl" goto dogcl
145 if "%lisp%" == "clisp" goto doclisp
146 if "%lisp%" == "ecl" goto doecl
147 rem Allow ccl as an alias of openmcl
148 if "%lisp%" == "ccl" set lisp
=openmcl
149 if "%lisp%" == "openmcl" goto doopenmcl
150 if "%lisp%" == "sbcl" goto dosbcl
151 if "%lisp%" == "abcl" goto doabcl
153 @
echo Maxima error
: Lisp
%lisp% not known.
157 set "path=%maxima_prefix%/lib/gcc-lib/mingw32/@GCCVER@;%path"
158 "%maxima_imagesdir%/binary-gcl/maxima.exe" -eval
"(cl-user::run)" %lisp_options% -f
-- %*
162 if exist "%maxima_imagesdir%/binary-clisp/maxima.exe" goto doclisp_exec
164 if "%layout_autotools%" == "true" goto clisp_autotools
165 clisp
%lisp_options% -q
-M
"%maxima_image_base%.mem" "" -- %*
169 set "path=%maxima_imagesdir%/binary-clisp;%maxima_prefix%/clisp-2.49/base;%path%"
170 lisp.exe
%lisp_options% -q
-M
"%maxima_image_base%.mem" "" -- %*
174 "%maxima_imagesdir%/binary-clisp/maxima.exe" %lisp_options% -q
"" -- %*
178 ecl
-load
%maxima_image_base%.fas
%lisp_options% -eval
"(user::run)" -- %*
181 rem SBCL Steel Bank Common Lisp
183 rem run executable image if it exists
184 if exist "%maxima_imagesdir%/binary-sbcl/maxima.exe" goto dosbcl_exec
185 if "%MAXIMA_SIGNALS_THREAD%" == "" (
186 set start_maxima
="(cl-user::run)"
188 set start_maxima
="(progn (load (maxima::$sconcat (namestring (pathname (maxima::maxima-getenv \"MAXIMA_PREFIX\"))) \"/bin/win_signals.lisp\")) (cl-user::run))"
191 rem At least in the crosscompiled installer, SBCL_HOME is not defined - set it here
192 if not defined SBCL_HOME
if exist "%maxima_prefix%/bin/sbcl.exe" set "SBCL_HOME=%~dp0"
194 rem Only on 64bit: if using sbcl (and the user does not specify anything else(!))
195 rem set the dynamic-space-size to 2GB so that load("lapack") will work.
196 rem The check for a 64 bit build is done by checking the name of the Mingw libgcc name
197 rem (which is libgcc_s_seh-1.dll for 64 and libgcc_s_sjlj-1.dll for 32 bit)
198 if exist "%maxima_prefix%/bin/libgcc_s_seh-1.dll" (
199 if "%lisp_options%"=="" set lisp_options
=--dynamic
-space
-size^
2000
201 rem I am a
32 bit build
- the SBCL workaround
for load
(lapack
) will
not work
204 sbcl.exe
--core
"%maxima_imagesdir%/binary-sbcl/maxima.core" --noinform
%lisp_options% --end-runtime
-options
--eval
%start_maxima% --end-toplevel
-options
%*
207 "%maxima_imagesdir%/binary-sbcl/maxima.exe" %lisp_options% --noinform
--end-runtime
-options
--eval
"(cl-user::run)" --end-toplevel
-options
%*
211 if "%MAXIMA_SIGNALS_THREAD%" == "" (
212 set start_maxima
="(cl-user::run)"
214 set start_maxima
="(progn (load (maxima::$sconcat (namestring (pathname (maxima::maxima-getenv \"MAXIMA_PREFIX\"))) \"/bin/win_signals.lisp\")) (cl-user::run))"
216 wx86cl
-I
"%maxima_image_base%.image" %lisp_options% -e
%start_maxima% -- %*
220 set "MAXIMA_IMAGESDIR_BIN=%maxima_imagesdir%/binary-abcl"
222 java
-jar
"%maxima_imagesdir%/binary-abcl/abcl.jar" %lisp_options% --eval
"(load \"%maxima_imagesdir%/binary-abcl/defsystem.lisp\")" --eval
"(mk:add-registry-location \"%maxima_imagesdir%/binary-abcl\")" --eval
"(funcall (intern (symbol-name :operate-on-system) :mk) \"maxima\" :load :verbose nil)" --eval
"(cl-user::run)" -- %*
227 rem Restore environment variables