Changeset - r7294:493f34a5ab4d
[Not reviewed]
master
0 3 0
rubidium - 17 years ago 2007-07-20 18:34:21
rubidium@openttd.org
(svn r10642) -Merge (from NoAI): ./configure flag for disabling threading.
3 files changed with 21 insertions and 8 deletions:
0 comments (0 inline, 0 general)
config.lib
Show inline comments
 
@@ -51,26 +51,27 @@ set_default() {
 
	with_zlib="1"
 
	with_png="1"
 
	with_makedepend="1"
 
	with_direct_music="1"
 
	with_sort="1"
 
	with_iconv="1"
 
	with_midi=""
 
	with_midi_arg=""
 
	with_libtimidity="1"
 
	with_freetype="1"
 
	with_fontconfig="1"
 
	with_psp_config="1"
 
	with_threads="1"
 

	
 
	save_params_array="build host cc_build cc_host cxx_build cxx_host windres strip awk lipo os cpu_type revision endian config_log prefix_dir binary_dir data_dir icon_dir personal_dir install_dir enable_debug enable_profiling enable_dedicated enable_network enable_static enable_translator enable_assert enable_strip with_distcc with_ccache with_osx_sysroot enable_universal enable_osx_g5 enable_unicode with_application_bundle with_sdl with_cocoa with_zlib with_png with_makedepend with_direct_music with_sort with_iconv with_midi with_midi_arg with_libtimidity with_freetype with_fontconfig with_psp_config CC CXX CFLAGS LDFLAGS"
 
	save_params_array="build host cc_build cc_host cxx_build cxx_host windres strip awk lipo os cpu_type revision endian config_log prefix_dir binary_dir data_dir icon_dir personal_dir install_dir enable_install enable_debug enable_profiling enable_dedicated enable_network enable_static enable_translator enable_assert enable_strip with_distcc with_osx_sysroot enable_universal enable_osx_g5 enable_unicode with_application_bundle with_sdl with_cocoa with_zlib with_png with_makedepend with_direct_music with_sort with_iconv with_midi with_midi_arg with_libtimidity with_freetype with_fontconfig with_psp_config with_threads CC CXX CFLAGS LDFLAGS"
 
}
 

	
 
detect_params() {
 
	# Walk over all params from the user and override any default settings if
 
	#  needed. This also handles any invalid option.
 
	for p in "$@"; do
 
		if [ -n "$prev_p" ]; then
 
			eval "$prev_p=\$p"
 
			prev_p=
 
			continue
 
		fi
 

	
 
@@ -236,24 +237,28 @@ detect_params() {
 
			--without-ccache)             with_ccache="0";;
 
			--with-ccache)                with_ccache="2";;
 
			--with-ccache=*)              with_ccache="$optarg";;
 

	
 
			--without-osx-sysroot)        with_osx_sysroot="0";;
 
			--with-osx-sysroot)           with_osx_sysroot="2";;
 
			--with-osx-sysroot=*)         with_osx_sysroot="$optarg";;
 

	
 
			--without-application-bundle) with_application_bundle="0";;
 
			--with-application-bundle)    with_application_bundle="1";;
 
			--with-application-bundle=*)  with_application_bundle="$optarg";;
 

	
 
			--without-threads)            with_threads="0";;
 
			--with-threads)               with_threads="1";;
 
			--with-threads=*)             with_threads="$optarg";;
 

	
 
			CC=* | --CC=*)                CC="$optarg";;
 
			CXX=* | --CXX=*)              CXX="$optarg";;
 
			CFLAGS=* | --CFLAGS=*)        CFLAGS="$optarg";;
 
			LDFLAGS=* | --LDFLAGS=*)      LDFLAGS="$optarg";;
 

	
 
			--ignore-extra-parameters)    ignore_extra_parameters="1";;
 

	
 
			--*)
 
				if [ "$ignore_extra_parameters" = "0" ]; then
 
					echo "Unknown option $p"
 
					exit 1
 
				else
 
@@ -773,24 +778,28 @@ make_cflags_and_ldflags() {
 
		if [ $enable_debug -ge 3 ]; then
 
			CFLAGS="$CFLAGS -O0"
 
		else
 
			CFLAGS="$CFLAGS -O2"
 
		fi
 
	fi
 

	
 
	if [ "$enable_profiling" != "0" ]; then
 
		CFLAGS="$CFLAGS -p"
 
		LDFLAGS="$LDFLAGS -pg"
 
	fi
 

	
 
	if [ "$with_threads" = "0" ]; then
 
		CFLAGS="$CFLAGS -DNO_THREADS"
 
	fi
 

	
 
	# Enable some things only for certain GCC versions
 
	cc_version=`$cc_host -dumpversion | cut -c 1,3`
 

	
 
	if [ $cc_version -ge 29 ]; then
 
		CFLAGS="$CFLAGS -Wall -Wno-multichar -Wsign-compare -Wundef"
 
		CFLAGS="$CFLAGS -Wwrite-strings -Wpointer-arith"
 

	
 
		CC_CFLAGS="$CC_CFLAGS -Wstrict-prototypes"
 
	fi
 

	
 
	gcc295=""
 
	if [ "$cc_version" = 29 ]; then
 
@@ -810,31 +819,32 @@ make_cflags_and_ldflags() {
 
	if [ "$os" = "CYGWIN" ]; then
 
		CFLAGS="$CFLAGS -mwin32"
 
		LDFLAGS="$LDFLAGS -mwin32"
 
	fi
 
	if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ]; then
 
		CFLAGS="$CFLAGS -mno-cygwin"
 
		LDFLAGS="$LDFLAGS -mno-cygwin"
 
	fi
 

	
 
	if [ "$os" = "CYGWIN" ] || [ "$os" = "MINGW" ]; then
 
		LDFLAGS="$LDFLAGS -Wl,--subsystem,windows"
 
		LIBS="$LIBS -lws2_32 -lwinmm -lgdi32 -ldxguid -lole32"
 
		# GCC 4.0+ complains about that we break strict-aliasing.
 
		#  On most places we don't see how to fix it, and it doesn't
 
		#  break anything. So disable strict-aliasing to make the
 
		#  compiler all happy.
 
		if [ $cc_version -ge 40 ]; then
 
			CFLAGS="$CFLAGS -fno-strict-aliasing"
 
		fi
 
	fi
 

	
 
	# GCC 4.0+ complains about that we break strict-aliasing.
 
	#  On most places we don't see how to fix it, and it doesn't
 
	#  break anything. So disable strict-aliasing to make the
 
	#  compiler all happy.
 
	if [ $cc_version -ge 40 ]; then
 
		CFLAGS="$CFLAGS -fno-strict-aliasing"
 
	fi
 

	
 
	if [ "$os" != "CYGWIN" ] && [ "$os" != "FREEBSD" ] && [ "$os" != "OPENBSD" ] && [ "$os" != "MINGW" ] && [ "$os" != "MORPHOS" ] && [ "$os" != "OSX" ] && [ "$os" != "WINCE" ] && [ "$os" != "PSP" ] && [ "$os" != "OS2" ]; then
 
		LIBS="$LIBS -lpthread"
 
		LIBS="$LIBS -lrt"
 
	fi
 

	
 
	if [ "$os" != "CYGWIN" ] && [ "$os" != "MINGW" ] && [ "$os" != "WINCE" ]; then
 
		LIBS="$LIBS -lc"
 
	fi
 
	if [ "$os" = "WINCE" ]; then
 
		LIBS="$LIBS -lcoredll -lcorelibc -laygshell -lws2 -e WinMainCRTStartup"
configure
Show inline comments
 
@@ -87,24 +87,25 @@ SRCS="`< $ROOT_DIR/source.list tr '\r' '
 
		if ($0 == "OSX"         && "'$os'" != "OSX")               { next; }
 
		if ($0 == "OS2"         && "'$os'" != "OS2")               { next; }
 
		if ($0 == "PSP"         && "'$os'" != "PSP")               { next; }
 
		if ($0 == "DEDICATED"   && "'$enable_dedicated'" != "1")   { next; }
 
		if ($0 == "COCOA"       && "'$with_cocoa'" == "0")         { next; }
 
		if ($0 == "BEOS"        && "'$os'" != "BEOS")              { next; }
 
		if ($0 == "WIN32"       && "'$os'" != "MINGW" &&
 
		                "'$os'" != "CYGWIN" && "'$os'" != "MSVC" ) { next; }
 
		if ($0 == "WINCE"       && "'$os'" != "WINCE")             { next; }
 
		if ($0 == "MSVC"        && "'$os'" != "MSVC")              { next; }
 
		if ($0 == "DIRECTMUSIC" && "'$with_direct_music'" == "0")  { next; }
 
		if ($0 == "LIBTIMIDITY" && "'$libtimidity'" == "" )        { next; }
 
		if ($0 == "NO_THREADS"  && "'$with_threads'" == "0")       { next; }
 

	
 
		skip += 1;
 

	
 
		next;
 
	}
 
	/^(	*)#/ { next }
 
	/^$/ { next }
 
	/\.h$/ { next }
 
	/\.hpp$/ { next }
 
	{
 
		if (deep == skip) {
 
			gsub("	", "", $0);
projects/generate
Show inline comments
 
@@ -27,24 +27,25 @@ fi
 

	
 
# openttd.tgt         is for WatCom
 

	
 

	
 

	
 
# First, collect the list of Windows files
 
sdl_config="1"
 
png_config="1"
 
os="MSVC"
 
enable_dedicated="0"
 
with_cocoa="0"
 
enable_directmusic="1"
 
with_threads="1"
 
file_prefix="..\\\\src\\\\"
 

	
 
safety_check() {
 
	li=""
 
	for i in `cat $1 | grep -v "#\|ottdres.rc\|win32.cpp\|win32_v.cpp" | xargs -n 1 basename | sort`; do
 
		if [ "$li" = "$i" ]; then
 
			echo " !! ERROR !!"
 
			echo ""
 
			echo "The filename '$i' is already used in this project."
 
			echo "Because MSVC uses one single directory for all object files, it"
 
			echo "cannot handle filenames with the same name inside the same project."
 
			echo "Please rename either one of the file and try generating again."
 
@@ -75,24 +76,25 @@ load_main_data() {
 
			if ($0 == "OSX"         && "'$os'" != "OSX")               { next; }
 
			if ($0 == "OS2"         && "'$os'" != "OS2")               { next; }
 
			if ($0 == "PSP"         && "'$os'" != "PSP")               { next; }
 
			if ($0 == "DEDICATED"   && "'$enable_dedicated'" != "1")   { next; }
 
			if ($0 == "COCOA"       && "'$with_cocoa'" == "0")         { next; }
 
			if ($0 == "BEOS"        && "'$os'" != "BEOS")              { next; }
 
			if ($0 == "WIN32"       && "'$os'" != "MINGW" &&
 
											"'$os'" != "CYGWIN" && "'$os'" != "MSVC" ) { next; }
 
			if ($0 == "WINCE"       && "'$os'" != "WINCE")             { next; }
 
			if ($0 == "MSVC"        && "'$os'" != "MSVC")              { next; }
 
			if ($0 == "DIRECTMUSIC" && "'$enable_directmusic'" != "1") { next; }
 
			if ($0 == "LIBTIMIDITY" && "'$libtimidity'" == "" )        { next; }
 
			if ($0 == "NO_THREADS"  && "'$with_threads'" == "0")       { next; }
 

	
 
			skip += 1;
 

	
 
			next;
 
		}
 
		/^(	*)#/ {
 
			if (deep == skip) {
 
				gsub("	", "", $0);
 
				gsub("^#", "", $0);
 
				gsub("^ ", "", $0);
 

	
 
				if (first_time != 0) {
0 comments (0 inline, 0 general)