summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2014-01-21 21:25:00 +0100
committerHans Hagen <pragma@wxs.nl>2014-01-21 21:25:00 +0100
commita5409b105acef4f613170dc24dd9dee49085e8fc (patch)
tree6ce833483f177e659fdda112b1a968a3648fd3d6 /scripts
parent5e7ca681fa20247e2774b90558ae8e79f1962a50 (diff)
downloadcontext-a5409b105acef4f613170dc24dd9dee49085e8fc.tar.gz
beta 2014.01.21 21:25
Diffstat (limited to 'scripts')
-rw-r--r--scripts/context/stubs/mswin/mtxrun.dllbin7680 -> 7680 bytes
-rw-r--r--scripts/context/stubs/source/mtxrun_dll.c63
2 files changed, 44 insertions, 19 deletions
diff --git a/scripts/context/stubs/mswin/mtxrun.dll b/scripts/context/stubs/mswin/mtxrun.dll
index 42b38cb23..943e76a4b 100644
--- a/scripts/context/stubs/mswin/mtxrun.dll
+++ b/scripts/context/stubs/mswin/mtxrun.dll
Binary files differ
diff --git a/scripts/context/stubs/source/mtxrun_dll.c b/scripts/context/stubs/source/mtxrun_dll.c
index dc312a145..3e75cc9ab 100644
--- a/scripts/context/stubs/source/mtxrun_dll.c
+++ b/scripts/context/stubs/source/mtxrun_dll.c
@@ -128,23 +128,48 @@ __declspec(dllexport) int dllrunscript( int argc, char *argv[] )
// find texlua.exe
- if ( !SearchPath(
- getenv( "PATH" ), // path to search (optional)
- (is_jit ? "luajittex.exe":"luatex.exe"), // file name to search
- NULL, // file extension to add (optional)
- MAX_PATH, // output buffer size
- luatexpath, // output buffer pointer
- &luatexfname ) // pointer to a file part in the output buffer (optional)
- )
- if ( !SearchPath(
- dirpath, // path to search (optional)
- (is_jit ? "luajittex.exe":"luatex.exe"), // file name to search
- NULL, // file extension to add (optional)
- MAX_PATH, // output buffer size
- luatexpath, // output buffer pointer
- &luatexfname ) // pointer to a file part in the output buffer (optional)
- )
- DIE( "unable to locate texlua.exe on the search path" );
+
+ local binary = ""
+
+ if ( SearchPath(
+ getenv( "PATH" ), // path to search (optional)
+ (is_jit ? "luajittex.exe":"luatex.exe"), // file name to search
+ NULL, // file extension to add (optional)
+ MAX_PATH, // output buffer size
+ luatexpath, // output buffer pointer
+ &luatexfname ) // pointer to a file part in the output buffer (optional)
+ ) {
+ binary = is_jit ? "luajittex.exe":"luatex.exe"
+ } else if ( SearchPath(
+ dirpath, // path to search (optional)
+ (is_jit ? "luajittex.exe":"luatex.exe"), // file name to search
+ NULL, // file extension to add (optional)
+ MAX_PATH, // output buffer size
+ luatexpath, // output buffer pointer
+ &luatexfname ) // pointer to a file part in the output buffer (optional)
+ ) {
+ binary = is_jit ? "luajittex.exe":"luatex.exe"
+ } else if ( SearchPath(
+ getenv( "PATH" ), // path to search (optional)
+ (is_jit ? "texluajitexe":"texlua.exe"), // file name to search
+ NULL, // file extension to add (optional)
+ MAX_PATH, // output buffer size
+ luatexpath, // output buffer pointer
+ &luatexfname ) // pointer to a file part in the output buffer (optional)
+ ) {
+ binary= is_jit ? "texluajit.exe":"texlua.exe"
+ } else if ( SearchPath(
+ dirpath, // path to search (optional)
+ (is_jit ? "texluajit.exe":"texlua.exe"), // file name to search
+ NULL, // file extension to add (optional)
+ MAX_PATH, // output buffer size
+ luatexpath, // output buffer pointer
+ &luatexfname ) // pointer to a file part in the output buffer (optional)
+ ) {
+ binary = is_jit ? "texluajit.exe":"texlua.exe"
+ } else {
+ DIE( "unable to locate texlua.exe on the search path" );
+ }
// link directly with luatex.dll if available in texlua's dir
@@ -159,7 +184,7 @@ __declspec(dllexport) int dllrunscript( int argc, char *argv[] )
lua_argv = (char **)malloc( (argc + 4) * sizeof(char *) );
if ( lua_argv == NULL ) DIE( "out of memory\n" );
- lua_argv[lua_argc=0] = (is_jit ? "luajittex.exe":"luatex.exe");
+ lua_argv[lua_argc=0] = binary;
lua_argv[++lua_argc] = "--luaonly";
lua_argv[++lua_argc] = scriptpath; // script to execute
if (passprogname) {
@@ -179,7 +204,7 @@ __declspec(dllexport) int dllrunscript( int argc, char *argv[] )
// we are still here, so no luatex.dll; spawn texlua.exe instead
- strcpy( luatexfname,(is_jit ? "luajittex.exe":"luatex.exe"));
+ strcpy( luatexfname,binary);
strcpy( cmdline, " --luaonly " );
strcpy( cmdline, "\"" );
strcat( cmdline, luatexpath );