Files @ r23571:154370618e18
Branch filter:

Location: cpp/openttd-patchpack/source/configure - annotation

PeterN
Change: Shorten engine rail type drop down in autoreplace window. (#7448)

In the autoreplace window, the rail type drop down is for choosing engines
of the given time. Many rail types do not have engines specifically designed for them,
and are merely compatible with other rail types. This list is thus unwieldy and many
options have no engines available.

As this drop down is for choosing _engine_ rail type rather than compatible rail types,
we can list just the rail types explicitly listed by engines.
r3198:2fd76a5c7026
r3198:2fd76a5c7026
r12768:980ae0491352
r12768:980ae0491352
r12768:980ae0491352
r12768:980ae0491352
r12768:980ae0491352
r12768:980ae0491352
r12768:980ae0491352
r11880:02a6568b43ea
r11880:02a6568b43ea
r11880:02a6568b43ea
r11880:02a6568b43ea
r11880:02a6568b43ea
r11880:02a6568b43ea
r11880:02a6568b43ea
r11880:02a6568b43ea
r6246:05127c85a10b
r6246:05127c85a10b
r6246:05127c85a10b
r6387:c2b5fc2f69cb
r6387:c2b5fc2f69cb
r6387:c2b5fc2f69cb
r6387:c2b5fc2f69cb
r6339:53a33070f380
r6339:53a33070f380
r6339:53a33070f380
r6339:53a33070f380
r6246:05127c85a10b
r5475:3f5cd13d1b63
r5475:3f5cd13d1b63
r12008:976162879be1
r12008:976162879be1
r12008:976162879be1
r12008:976162879be1
r12008:976162879be1
r3198:2fd76a5c7026
r11880:02a6568b43ea
r11880:02a6568b43ea
r12008:976162879be1
r12008:976162879be1
r9962:288ef297f5e3
r3198:2fd76a5c7026
r5475:3f5cd13d1b63
r3198:2fd76a5c7026
r5475:3f5cd13d1b63
r5475:3f5cd13d1b63
r5475:3f5cd13d1b63
r5475:3f5cd13d1b63
r15805:83ef427d044d
r17414:35690285ddcd
r5475:3f5cd13d1b63
r5475:3f5cd13d1b63
r5475:3f5cd13d1b63
r5475:3f5cd13d1b63
r5475:3f5cd13d1b63
r3198:2fd76a5c7026
r8080:18ba871a1f5b
r9758:639c35eca387
r5475:3f5cd13d1b63
r5475:3f5cd13d1b63
r5475:3f5cd13d1b63
r5475:3f5cd13d1b63
r11911:68c886dabb52
r5560:3a25b20628de
r12690:90eab199360e
r5560:3a25b20628de
r12690:90eab199360e
r5475:3f5cd13d1b63
r3198:2fd76a5c7026
r5475:3f5cd13d1b63
r5486:22474c931347
r6811:1bece01dbf0a
r5475:3f5cd13d1b63
r5475:3f5cd13d1b63
r3198:2fd76a5c7026
r5475:3f5cd13d1b63
r23482:de566f8c088d
r5475:3f5cd13d1b63
r5475:3f5cd13d1b63
r5475:3f5cd13d1b63
r5475:3f5cd13d1b63
r5475:3f5cd13d1b63
r11902:1d7b999e8b04
r17414:35690285ddcd
r5475:3f5cd13d1b63
r5558:87193b0bf8bb
r11911:68c886dabb52
r5475:3f5cd13d1b63
r5475:3f5cd13d1b63
r3198:2fd76a5c7026
r3198:2fd76a5c7026
r9758:639c35eca387
r5475:3f5cd13d1b63
r5475:3f5cd13d1b63
r3205:d6457bf4d56d
r3205:d6457bf4d56d
r5475:3f5cd13d1b63
r12576:635f721eaad4
r5475:3f5cd13d1b63
r5475:3f5cd13d1b63
r5475:3f5cd13d1b63
r5475:3f5cd13d1b63
r5475:3f5cd13d1b63
r5475:3f5cd13d1b63
r5475:3f5cd13d1b63
r5475:3f5cd13d1b63
r3205:d6457bf4d56d
r5475:3f5cd13d1b63
r5475:3f5cd13d1b63
r10379:941352ab53b3
r5475:3f5cd13d1b63
r6901:0ac8fd77d505
r5475:3f5cd13d1b63
r5589:5e73b493e4bc
r5475:3f5cd13d1b63
r14500:437319d09620
r5475:3f5cd13d1b63
r23407:8313083e9002
r5475:3f5cd13d1b63
r13095:c8ad2bbbdb3b
r5475:3f5cd13d1b63
r5480:d3f0d8831363
r23037:12ba24203729
r23459:7f7fb3c3c9b5
r23451:ace1e805d312
r23452:1fee067ed88f
r5475:3f5cd13d1b63
r5475:3f5cd13d1b63
r3198:2fd76a5c7026
r5475:3f5cd13d1b63
r5475:3f5cd13d1b63
r5475:3f5cd13d1b63
r5475:3f5cd13d1b63
r5475:3f5cd13d1b63
r5475:3f5cd13d1b63
r5475:3f5cd13d1b63
r5475:3f5cd13d1b63
r5475:3f5cd13d1b63
r5475:3f5cd13d1b63
r5475:3f5cd13d1b63
r5475:3f5cd13d1b63
r12576:635f721eaad4
r12576:635f721eaad4
r12576:635f721eaad4
r12576:635f721eaad4
r22367:cf8b605e1164
r3200:de20afe05adc
r12576:635f721eaad4
r12576:635f721eaad4
r12576:635f721eaad4
r12576:635f721eaad4
r12576:635f721eaad4
r5475:3f5cd13d1b63
r5475:3f5cd13d1b63
r5558:87193b0bf8bb
r11911:68c886dabb52
r5475:3f5cd13d1b63
r5475:3f5cd13d1b63
r3200:de20afe05adc
r3200:de20afe05adc
r17414:35690285ddcd
r5475:3f5cd13d1b63
r5475:3f5cd13d1b63
r5475:3f5cd13d1b63
r17414:35690285ddcd
r15805:83ef427d044d
r5475:3f5cd13d1b63
r11880:02a6568b43ea
r11880:02a6568b43ea
#!/bin/sh

# $Id$

# This file is part of OpenTTD.
# OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
# OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.

check_path_characters() {
	if [ -n "`echo $ROOT_DIR | grep '[^-_A-Za-z0-9\/\\\.:]'`" ]; then
		echo "WARNING: The path contains a non-alphanumeric character that might cause"
		echo "         failures in subsequent build stages. Any failures with the build"
		echo "         will most likely be caused by this."
	fi
}

CONFIGURE_EXECUTABLE="$_"
# On *nix systems those two are equal when ./configure is done
if [ "$0" != "$CONFIGURE_EXECUTABLE" ]; then
	# On some systems, when ./configure is triggered from 'make'
	#  the $_ is filled with 'make'. So if that is true, skip 'make'
	#  and use $0 (and hope that is correct ;))
	if [ -n "`echo $CONFIGURE_EXECUTABLE | grep make`" ]; then
		CONFIGURE_EXECUTABLE="$0"
	else
		CONFIGURE_EXECUTABLE="$CONFIGURE_EXECUTABLE $0"
	fi
fi
# Find out where configure is (in what dir)
ROOT_DIR="`dirname $0`"
# For MSYS/MinGW we want to know the FULL path. This as that path is generated
# once you call an outside binary. Having the same path for the rest is needed
# for dependency checking.
# pwd -W returns said FULL path, but doesn't exist on others so fall back.
ROOT_DIR="`cd $ROOT_DIR && (pwd -W 2>/dev/null || pwd 2>/dev/null)`"

check_path_characters

# Same here as for the ROOT_DIR above
PWD="`pwd -W 2>/dev/null || pwd 2>/dev/null`"
PREFIX="$PWD/bin"

. $ROOT_DIR/config.lib

# Set default dirs
OBJS_DIR="$PWD/objs"
BASE_SRC_OBJS_DIR="$OBJS_DIR"
LANG_OBJS_DIR="$OBJS_DIR/lang"
GRF_OBJS_DIR="$OBJS_DIR/extra_grf"
SETTING_OBJS_DIR="$OBJS_DIR/setting"
BIN_DIR="$PREFIX"
SRC_DIR="$ROOT_DIR/src"
LANG_DIR="$SRC_DIR/lang"
MEDIA_DIR="$ROOT_DIR/media"
SOURCE_LIST="$ROOT_DIR/source.list"

if [ "$1" = "--reconfig" ] || [ "$1" = "--reconfigure" ]; then
	if [ ! -f "config.cache" ]; then
		echo "can't reconfigure, because never configured before"
		exit 1
	fi
	# Make sure we don't lock config.cache
	cat config.cache | sed 's@\\ @\\\\ @g' > cache.tmp
	sh cache.tmp
	RET=$?
	rm -f cache.tmp
	exit $RET
fi

set_default
detect_params "$@"
check_params
save_params
make_cflags_and_ldflags

EXE=""
if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ] || [ "$os" = "OS2" ]; then
	EXE=".exe"
fi

TTD="openttd$EXE"
STRGEN="strgen$EXE"
DEPEND="depend$EXE"
SETTINGSGEN="settings_gen$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
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; }
		if ($0 == "SDL"         && "'$sdl_config'" == "")          { next; }
		if ($0 == "PNG"         && "'$png_config'" == "")          { next; }
		if ($0 == "OSX"         && "'$os'" != "OSX")               { next; }
		if ($0 == "OS2"         && "'$os'" != "OS2")               { next; }
		if ($0 == "DEDICATED"   && "'$enable_dedicated'" != "1")   { next; }
		if ($0 == "AI"          && "'$enable_ai'" == "0")          { next; }
		if ($0 == "COCOA"       && "'$with_cocoa'" == "0")         { next; }
		if ($0 == "HAIKU"       && "'$os'" != "HAIKU")             { next; }
		if ($0 == "WIN32"       && "'$os'" != "MINGW" &&
		                 "'$os'" != "CYGWIN" && "'$os'" != "MSVC") { next; }
		if ($0 == "MSVC"        && "'$os'" != "MSVC")              { next; }
		if ($0 == "DIRECTMUSIC" && "'$with_direct_music'" == "0")  { next; }
		if ($0 == "FLUIDSYNTH"  && "'$fluidsynth'" == "" )         { next; }
		if ($0 == "USE_XAUDIO2" && "'$with_xaudio2'" == "0")       { next; }
		if ($0 == "USE_THREADS" && "'$with_threads'" == "0")       { next; }
		if ($0 == "USE_SSE"     && "'$with_sse'" != "1")           { next; }

		skip += 1;

		next;
	}
	/^(	*)#/ { next }
	/^$/ { next }
	/\.h$/ { next }
	/\.hpp$/ { next }
	{
		if (deep == skip) {
			gsub("	", "", $0);
			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\" | LC_ALL=C $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
	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.grf.in $ROOT_DIR/Makefile.lang.in $ROOT_DIR/Makefile.src.in $ROOT_DIR/Makefile.bundle.in $ROOT_DIR/Makefile.setting.in"

generate_main
generate_lang
generate_settings
generate_grf
generate_src

check_path_characters