set -e

if [ "$1" = clean ]; then
	./c
	exit
fi

LD_LIBRARY_PATH=${HOME}/a/x86_64_lib ./ao

#get a wine python from https://www.python.org/downloads/windows/ python-3.14.5-amd64.exe
#if not at installer, then:
#	wine6 reg add "HKCU\Environment" /v PATH /t REG_SZ /d "C:\users\bc\AppData\Local\Programs\Python\Python314;%PATH%" /f
#retest:
#	wine6 reg query "HKCU\Environment" /v PATH
#and with system paths:
#	wine6 cmd /c echo %PATH%
#WINEPATH,execve are alternatives but at python if none are working, use our OAPATH
#REG_EXPAND_SZ to expand only
#F or Z? wine6 cmd
#WINEDEBUG=+loaddll,+module

if [ -z "${p}" ]; then
	p='wine6 python.exe'
fi
#ffdec only if going on windows path
#if [ -n "${server_extern}" ]; then # server_extern=x
#	haxe --wait 6000 &
#	echo $!
#fi
server_compiler="F:\\home\\bc\\a\\haxe\\haxe.exe" no_clean=x no_confirm=x no_execv=x sentinel=0 launcher=/bin/bash compiler=/home/bc/a/whaxe platform=win \
	OAPATH="F:\\home\\bc\\s\\actionswf-1\\oaas" p="$p" ./b
echo $?
#if [ -n "${server_extern}" ]; then
#	./k
#fi

exit
#!/bin/bash
a="$1"
b="$2"
shift 2
#c=( ${@:1:3} ../a.swf ${@:5} )
if [ $b != 0 ]; then
	/usr/bin/haxe "$@" 2>"$b"
#	/usr/bin/haxe "${c[@]}" 2>"$b"
else
	/usr/bin/haxe "$@"
#	/usr/bin/haxe "${c[@]}"
fi
echo -n $? > "$a"
