Changeset - r12576:635f721eaad4
[Not reviewed]
master
0 2 0
rubidium - 15 years ago 2009-08-01 16:57:30
rubidium@openttd.org
(svn r17026) -Fix [FS#3076]: "[bd]ash"-ism in configure
2 files changed with 14 insertions and 8 deletions:
0 comments (0 inline, 0 general)
config.lib
Show inline comments
 
@@ -1425,25 +1425,27 @@ make_cflags_and_ldflags() {
 
	log 1 "using CFLAGS... $CFLAGS"
 
	log 1 "using LDFLAGS... $LIBS $LDFLAGS"
 

	
 
	# Makedepend doesn't like something like: -isysroot /OSX/blabla
 
	#  so convert it to: -isysroot -OSX/blabla. makedepend just ignores
 
	#  any - command it doesn't know, so we are pretty save.
 
	# Lovely hackish, not?
 
	# Btw, this almost always comes from outside the configure, so it is
 
	#  not something we can control.
 
	# Also make makedepend aware of compiler's built-in defines.
 
	if [ "$with_makedepend" != "0" ] || [ "$enable_builtin_depend" != "0" ]; then
 
		cflags_makedep="`echo | $cxx_host -E -x c++ -dM - | sed 's@.define @-D@g;s@ .*@ @g;s@(.*)@@g' | tr -d '\r\n'`"
 
		cflags_makedep="$cflags_makedep `echo "$CFLAGS" | sed 's@ /@ -@g;s@-I[ ]*[^ ]*@@g'`"
 

	
 
		# Please escape ALL " within ` because e.g. "" terminates the string in some sh implementations
 
		cflags_makedep="$cflags_makedep `echo \"$CFLAGS\" | sed 's@ /@ -@g;s@-I[ ]*[^ ]*@@g'`"
 
	else
 
		makedepend=""
 
	fi
 

	
 
	if [ "$with_distcc" != "0" ]; then
 
		cc_host="$distcc $cc_host"
 
		cxx_host="$distcc $cxx_host"
 
		log 1 ""
 
		log 1 " NOTICE: remind yourself to use 'make -jN' to make use of distcc"
 
		log 1 ""
 
	fi
 

	
configure
Show inline comments
 
@@ -77,25 +77,25 @@ DEPEND="depend$EXE"
 
if [ -z "$sort" ]; then
 
	PIPE_SORT="sed s@a@a@"
 
else
 
	PIPE_SORT="$sort"
 
fi
 

	
 
if [ ! -f "$LANG_DIR/english.txt" ]; then
 
	echo "Languages not found in $LANG_DIR. Can't continue without it."
 
	echo "Please make sure the dir exists and contains at least english.txt"
 
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; }
 
	/^(	*)#if/   {
 
		gsub("	", "", $0);
 
		gsub("^#if ", "", $0);
 

	
 
		if (deep != skip) { deep += 1; next; }
 

	
 
		deep += 1;
 

	
 
		if ($0 == "ALLEGRO"     && "'$allegro_config'" == "")      { next; }
 
@@ -122,31 +122,35 @@ SRCS="`< $ROOT_DIR/source.list tr '\r' '
 
		next;
 
	}
 
	/^(	*)#/ { next }
 
	/^$/ { next }
 
	/\.h$/ { next }
 
	/\.hpp$/ { next }
 
	{
 
		if (deep == skip) {
 
			gsub("	", "", $0);
 
			print $0;
 
		}
 
	}
 
' | $PIPE_SORT`"
 
'
 

	
 
# 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; }'`"
 
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
 
	sort="sed s@a@a@"
 
else
 
	sort="$sort -u"
 
fi
 

	
 
CONFIGURE_FILES="$ROOT_DIR/configure $ROOT_DIR/config.lib $ROOT_DIR/Makefile.in $ROOT_DIR/Makefile.lang.in $ROOT_DIR/Makefile.src.in $ROOT_DIR/Makefile.bundle.in"
 

	
 
generate_main
 
generate_lang
0 comments (0 inline, 0 general)