: "This script generates readonly" CC=${CC-cc} trap 'rm -f data data.[os] core r$$.s' 0 echo ': "Make readonly data into text for sharing"' > readonly chmod 755 readonly if ${CC} -R -o data -Dconst= install/data.c > /dev/null 2>&1 then if ./data 2>/dev/null then : else echo '${CC-cc} -R -c "$@"' >> readonly echo "#define const /* empty */" >> sh_config.h exit 0 fi fi if ${CC} -Wa,-r -o data -Dconst= install/data.c > /dev/null 2>&1 then if ./data 2>/dev/null then : else echo '${CC-cc} -Wa,-r -c "$@"' >> readonly echo "#define const /* empty */" >> sh_config.h exit 0 fi fi if ${CC} -S -Dconst= install/data.c > /dev/null 2>&1 then data=text idat=code for from in idat data do eval to=\$$from if grep $from data.s > /dev/null 2>&1 && sed -e "s/^\([ ]*\.*\)$from/\1$to/" data.s >r$$.s && ${CC} -o data r$$.s >/dev/null 2>&1 then if ./data 2> /dev/null then : else cat >> readonly < data\$\$.s mv data\$\$.s "\$x.s" if \${CC} -c "\$x.s" then rm -f "\$x.s" else error=1 \${CC} \${flags} -c "\$i" fi done exit \$error !!! exit 0 fi fi done fi : "Don't know how to do readonly, just compile" echo '${CC-cc} -c "$@"' >> readonly exit 0