summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-07-20 18:34:21 +0000
committerrubidium <rubidium@openttd.org>2007-07-20 18:34:21 +0000
commit7aa6d30922bf2aa253e5fe11c2e92cef7ac3e91d (patch)
tree7d0d7c68701122eaff1c573b798e3aaaa1ae5d8e
parentb9b59ec1697613b953201c037522f0dc1a2c2003 (diff)
downloadopenttd-7aa6d30922bf2aa253e5fe11c2e92cef7ac3e91d.tar.xz
(svn r10642) -Merge (from NoAI): ./configure flag for disabling threading.
-rw-r--r--config.lib26
-rwxr-xr-xconfigure1
-rwxr-xr-xprojects/generate2
3 files changed, 21 insertions, 8 deletions
diff --git a/config.lib b/config.lib
index 32b309f0e..fe56f8763 100644
--- a/config.lib
+++ b/config.lib
@@ -60,8 +60,9 @@ set_default() {
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() {
@@ -245,6 +246,10 @@ detect_params() {
--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";;
@@ -782,6 +787,10 @@ make_cflags_and_ldflags() {
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`
@@ -819,13 +828,14 @@ make_cflags_and_ldflags() {
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
diff --git a/configure b/configure
index 48213ba72..336880d07 100755
--- a/configure
+++ b/configure
@@ -96,6 +96,7 @@ SRCS="`< $ROOT_DIR/source.list tr '\r' '\n' | $awk '
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;
diff --git a/projects/generate b/projects/generate
index dc43f6be0..bc3b61395 100755
--- a/projects/generate
+++ b/projects/generate
@@ -36,6 +36,7 @@ os="MSVC"
enable_dedicated="0"
with_cocoa="0"
enable_directmusic="1"
+with_threads="1"
file_prefix="..\\\\src\\\\"
safety_check() {
@@ -84,6 +85,7 @@ load_main_data() {
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;