summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorglx <glx@openttd.org>2019-02-09 21:26:37 +0100
committerglx22 <glx22@users.noreply.github.com>2019-02-10 12:44:10 +0100
commit70e1c57f81006abd571b35ad7f876f2176cf413d (patch)
tree93a7ccfe50803980a89afcb13cd12fa02c0aff55 /src
parentd242875d270e29f198cc62508b338f8949bf3404 (diff)
downloadopenttd-70e1c57f81006abd571b35ad7f876f2176cf413d.tar.xz
Fix: line ending issues with MSYS2
Diffstat (limited to 'src')
-rwxr-xr-xsrc/script/api/generate_widget.sh2
-rwxr-xr-xsrc/script/api/squirrel_export.sh8
2 files changed, 5 insertions, 5 deletions
diff --git a/src/script/api/generate_widget.sh b/src/script/api/generate_widget.sh
index 4bdbc31c7..96ef5dfb3 100755
--- a/src/script/api/generate_widget.sh
+++ b/src/script/api/generate_widget.sh
@@ -20,5 +20,5 @@ if [ "$?" != "0" ]; then
exit 1
fi
-${AWK} -f generate_widget.awk script_window.hpp > script_window.tmp
+${AWK} -v BINMODE=1 -f generate_widget.awk script_window.hpp > script_window.tmp
mv script_window.tmp script_window.hpp
diff --git a/src/script/api/squirrel_export.sh b/src/script/api/squirrel_export.sh
index e1f5e8613..14ff4e147 100755
--- a/src/script/api/squirrel_export.sh
+++ b/src/script/api/squirrel_export.sh
@@ -49,7 +49,7 @@ for f in `ls ../*.hpp`; do
# ScriptController has custom code, and should not be generated
if [ "`basename ${f}`" = "script_controller.hpp" ]; then continue; fi
- ${AWK} -v api=${apiuc} -f ${scriptdir}/squirrel_export.awk ${f} > ${bf}.tmp
+ ${AWK} -v BINMODE=1 -v api=${apiuc} -f ${scriptdir}/squirrel_export.awk ${f} > ${bf}.tmp
if [ "`wc -l ${bf}.tmp | cut -d\ -f1`" = "0" ]; then
if [ -f "${bf}.sq" ]; then
@@ -90,7 +90,7 @@ echo "
/Note: this line is a marker in squirrel_export.sh. Do not change!/ {
print \$0
gsub(\"^.*/\", \"\")
- split(\"`grep '^void SQ'${apiuc}'.*_Register(Squirrel \*engine)$' *.hpp.sq | sed 's/:.*$//' | sort | uniq | tr -d '\r' | tr '\n' ' '`\", files, \" \")
+ split(\"`grep '^void SQ'${apiuc}'.*_Register(Squirrel \*engine).\?$' *.hpp.sq | sed 's/:.*$//' | sort | uniq | tr -d '\r' | tr '\n' ' '`\", files, \" \")
for (i = 1; files[i] != \"\"; i++) {
print \"#include \\\"../script/api/${apilc}/\" files[i] \"\\\"\" \$0
@@ -104,7 +104,7 @@ echo "
gsub(\"^.*/\", \"\")
# List needs to be registered with squirrel before all List subclasses.
print \" SQ${apiuc}List_Register(this->engine);\" \$0
- split(\"`grep '^void SQ'${apiuc}'.*_Register(Squirrel \*engine)$' *.hpp.sq | grep -v 'SQ'${apiuc}'List_Register' | sed 's/^.*void //;s/Squirrel \*/this->/;s/$/;/;s/_Register/0000Register/g;' | sort | sed 's/0000Register/_Register/g' | tr -d '\r' | tr '\n' ' '`\", regs, \" \")
+ split(\"`grep '^void SQ'${apiuc}'.*_Register(Squirrel \*engine).\?$' *.hpp.sq | grep -v 'SQ'${apiuc}'List_Register' | sed 's/^.*void //;s/Squirrel \*/this->/;s/$/;/;s/_Register/0000Register/g;' | sort | sed 's/0000Register/_Register/g' | tr -d '\r' | tr '\n' ' '`\", regs, \" \")
for (i = 1; regs[i] != \"\"; i++) {
if (regs[i] == \"SQ${apiuc}Controller_Register(this->engine);\") continue
@@ -117,7 +117,7 @@ echo "
{ print \$0; }
" > ${f}.awk
-${AWK} -f ${f}.awk ${f} > ${f}.tmp
+${AWK} -v BINMODE=1 -f ${f}.awk ${f} > ${f}.tmp
if ! [ -f "${f}" ] || [ -n "`diff -I '$Id' ${f} ${f}.tmp 2> /dev/null || echo boo`" ]; then
mv ${f}.tmp ${f}