#!/bin/sh
inc="include_sec 1"
if [ -z "${conv_64}" ]; then conv_64=0
elif [ ${conv_64} = 1 ]; then
	if [ "`dpkg-architecture -qDEB_HOST_ARCH`" != "i386" ]; then #cross
		inc=
	fi
fi
l_z=`pkg-config --libs zlib`
o a${interext}.oc logfile 0 conv_64 ${conv_64} ${inc} && {
	if [ ${conv_64} = 1 ]; then
		if [ -z "${inc}" ]; then #cross
			LD_LIBRARY_PATH=/home/bc/Desktop/out/ld/usr/lib/i386-linux-gnu /home/bc/Desktop/out/ld/usr/bin/i686-linux-gnu-ld.bfd \
				--dynamic-linker=/lib/ld-linux.so.2 a.o -entry main -lc ${l_z} -L${_L}../src -lactionswf
		else
			echo cc a${interext}.o ${l_z} -L${_L}../${inter}src -lactionswf
			cc a${interext}.o ${l_z} -L${_L}../${inter}src -lactionswf
		fi
	else
		if [ -z "${LD_LIBRARY_PATH}" ]; then
			#local cc has -lz? bionic i386 cc has no -lz? who cares
			echo cc a${interext}.o ${l_z} -L${_L}../${inter}src -lactionswf
			cc a${interext}.o -L${_L}../${inter}src -lactionswf ${l_z}
		else
			echo cc a.o ${l_z} -L${LD_LIBRARY_PATH} -lactionswf
			cc a.o ${l_z} -L${LD_LIBRARY_PATH} -lactionswf
		fi
	fi && {
		if [ -z "${LD_LIBRARY_PATH}" ]; then LD_LIBRARY_PATH=${_L}../${inter}src; fi
		echo LD_LIBRARY_PATH=${LD_LIBRARY_PATH} ${launcher} ./a.out ${extra}
		LD_LIBRARY_PATH=${LD_LIBRARY_PATH} ${launcher} ./a.out ${extra}
	}
}
