summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-08-01 16:57:30 +0000
committerrubidium <rubidium@openttd.org>2009-08-01 16:57:30 +0000
commit144a84a348160397b1ef0d454d7583c197576dbf (patch)
tree7fff647638c1cc2368e5900b61df1287cd996d61 /configure
parent5d083f30395acae796b49814eac0b1262bb867a7 (diff)
downloadopenttd-144a84a348160397b1ef0d454d7583c197576dbf.tar.xz
(svn r17026) -Fix [FS#3076]: "[bd]ash"-ism in configure
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure18
1 files changed, 11 insertions, 7 deletions
diff --git a/configure b/configure
index 19044102a..d641ed01d 100755
--- a/configure
+++ b/configure
@@ -86,7 +86,7 @@ if [ ! -f "$LANG_DIR/english.txt" ]; then
fi
# Read the source.list and process it
-SRCS="`< $ROOT_DIR/source.list tr '\r' '\n' | $awk '
+AWKCOMMAND='
{ }
/^( *)#end/ { if (deep == skip) { skip -= 1; } deep -= 1; next; }
/^( *)#else/ { if (deep == skip) { skip -= 1; } else if (deep - 1 == skip) { skip += 1; } next; }
@@ -131,13 +131,17 @@ SRCS="`< $ROOT_DIR/source.list tr '\r' '\n' | $awk '
print $0;
}
}
-' | $PIPE_SORT`"
+'
-OBJS_C="` echo \"$SRCS\" | $awk ' { ORS = " " } /\.c$/ { gsub(".c$", ".o", $0); print $0; }'`"
-OBJS_CPP="`echo \"$SRCS\" | $awk ' { ORS = " " } /\.cpp$/ { gsub(".cpp$", ".o", $0); print $0; }'`"
-OBJS_MM="` echo \"$SRCS\" | $awk ' { ORS = " " } /\.mm$/ { gsub(".mm$", ".o", $0); print $0; }'`"
-OBJS_RC="` echo \"$SRCS\" | $awk ' { ORS = " " } /\.rc$/ { gsub(".rc$", ".o", $0); print $0; }'`"
-SRCS="` echo \"$SRCS\" | $awk ' { ORS = " " } { print $0; }'`"
+# Read the source.list and process it
+# Please escape ALL " within ` because e.g. "" terminates the string in some sh implementations
+SRCS="`< $ROOT_DIR/source.list tr '\r' '\n' | $awk \"$AWKCOMMAND\" | $PIPE_SORT`"
+
+OBJS_C="` echo \"$SRCS\" | $awk ' { ORS = \" \" } /\.c$/ { gsub(\".c$\", \".o\", $0); print $0; }'`"
+OBJS_CPP="`echo \"$SRCS\" | $awk ' { ORS = \" \" } /\.cpp$/ { gsub(\".cpp$\", \".o\", $0); print $0; }'`"
+OBJS_MM="` echo \"$SRCS\" | $awk ' { ORS = \" \" } /\.mm$/ { gsub(\".mm$\", \".o\", $0); print $0; }'`"
+OBJS_RC="` echo \"$SRCS\" | $awk ' { ORS = \" \" } /\.rc$/ { gsub(\".rc$\", \".o\", $0); print $0; }'`"
+SRCS="` echo \"$SRCS\" | $awk ' { ORS = \" \" } { print $0; }'`"
# In makefiles, we always use -u for sort
if [ -z "$sort" ]; then