2018-11-15 08:22:44 +03:00
|
|
|
# -*- sh -*-
|
|
|
|
|
|
|
|
quote() {
|
|
|
|
printf "#${indent}define $1"
|
|
|
|
shift
|
|
|
|
${1+printf} ${1+' "%s"'$sep} ${1+"$@"}
|
|
|
|
echo
|
|
|
|
}
|
|
|
|
|
|
|
|
archs=""
|
|
|
|
arch_flag=""
|
|
|
|
|
2018-11-15 09:22:17 +03:00
|
|
|
parse_arch_flags() {
|
|
|
|
for arch in $1; do
|
|
|
|
archs="${archs:+$archs }${arch%=*}"
|
|
|
|
done
|
2018-11-15 08:22:44 +03:00
|
|
|
|
2018-11-15 09:22:17 +03:00
|
|
|
while shift && [ "$#" -gt 0 ]; do
|
|
|
|
case "$1" in
|
|
|
|
-arch)
|
|
|
|
shift
|
|
|
|
archs="${archs:+$archs }$1"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
arch_flag="${arch_flag:+${arch_flag} }$1"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
}
|
2018-11-15 08:22:44 +03:00
|
|
|
|
|
|
|
define_arch_flags() {
|
|
|
|
${archs:+echo} ${archs:+'#if 0'}
|
|
|
|
for arch in $archs; do
|
|
|
|
echo "#elif defined __${arch}__"
|
|
|
|
quote "MJIT_ARCHFLAG " -arch "${arch}"
|
|
|
|
done
|
|
|
|
${archs:+echo} ${archs:+'#else'}
|
2018-11-22 09:09:07 +03:00
|
|
|
quote "MJIT_ARCHFLAG /* ${arch_flag:-no flag} */" ${arch_flag}
|
2018-11-15 08:22:44 +03:00
|
|
|
${archs:+echo} ${archs:+'#endif'}
|
|
|
|
}
|