(svn r21194) -Add: Configure option for compiling OpenTTD as a console application under MinGW.

This commit is contained in:
terkhen 2010-11-14 20:47:45 +00:00
parent 6433ce5f6c
commit c370f56bf3

View File

@ -55,6 +55,7 @@ set_default() {
enable_static="1" enable_static="1"
enable_translator="0" enable_translator="0"
enable_unicode="1" enable_unicode="1"
enable_console="1";
enable_assert="1" enable_assert="1"
enable_strip="0" enable_strip="0"
enable_universal="1" enable_universal="1"
@ -128,6 +129,7 @@ set_default() {
enable_static enable_static
enable_translator enable_translator
enable_unicode enable_unicode
enable_console
enable_assert enable_assert
enable_strip enable_strip
enable_universal enable_universal
@ -305,6 +307,9 @@ detect_params() {
--disable-unicode) enable_unicode="0";; --disable-unicode) enable_unicode="0";;
--enable-unicode) enable_unicode="2";; --enable-unicode) enable_unicode="2";;
--enable-unicode=*) enable_unicode="$optarg";; --enable-unicode=*) enable_unicode="$optarg";;
--disable-console) enable_console="0";;
--enable-console) enable_console="2";;
--enable-console=*) enable_console="$optarg";;
--disable-cocoa-quartz) enable_cocoa_quartz="0";; --disable-cocoa-quartz) enable_cocoa_quartz="0";;
--enable-cocoa-quartz) enable_cocoa_quartz="2";; --enable-cocoa-quartz) enable_cocoa_quartz="2";;
@ -718,6 +723,20 @@ check_params() {
fi fi
fi fi
if [ "$os" != "MINGW" ] && [ "$os" != "CYGWIN" ]; then
log 1 "checking console application... not Windows, skipping"
elif [ "$enable_console" = "1" ] && [ "$enable_dedicated" != "0" ]; then
log 1 "checking console application... dedicated server, enabled"
enable_console="2"
elif [ "$enable_console" = "1" ]; then
log 1 "checking console application... disabled (only used when forced)"
enable_console="0"
elif [ "$enable_console" = "0" ]; then
log 1 "checking console application... disabled"
else
log 1 "checking console application... enabled"
fi
if [ "$enable_network" = "1" ] && [ "$os" = "DOS" ]; then if [ "$enable_network" = "1" ] && [ "$os" = "DOS" ]; then
log 1 "checking network... DOS, skipping" log 1 "checking network... DOS, skipping"
enable_network=0 enable_network=0
@ -1334,7 +1353,13 @@ make_cflags_and_ldflags() {
fi fi
if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ]; then if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ]; then
flags="$flags -mno-cygwin" flags="$flags -mno-cygwin"
if [ "$enable_console" != "0" ]; then
LDFLAGS="$LDFLAGS -mno-cygwin -Wl,--subsystem,console"
else
LDFLAGS="$LDFLAGS -mno-cygwin -Wl,--subsystem,windows" LDFLAGS="$LDFLAGS -mno-cygwin -Wl,--subsystem,windows"
fi
LIBS="$LIBS -lws2_32 -lwinmm -lgdi32 -ldxguid -lole32" LIBS="$LIBS -lws2_32 -lwinmm -lgdi32 -ldxguid -lole32"
if [ $cc_version -ge 44 ]; then if [ $cc_version -ge 44 ]; then
@ -3298,6 +3323,9 @@ showhelp() {
echo " --disable-cocoa-quickdraw disable the quickdraw window mode driver for Cocoa (OSX ONLY)" echo " --disable-cocoa-quickdraw disable the quickdraw window mode driver for Cocoa (OSX ONLY)"
echo " --disable-unicode disable unicode support to build win9x" echo " --disable-unicode disable unicode support to build win9x"
echo " version (Win32 ONLY)" echo " version (Win32 ONLY)"
echo " --enable-console compile as a console application instead of as a GUI application."
echo " If this setting is active, debug output will appear in the same"
echo " console instead of opening a new window. (Win32 ONLY)"
echo " --disable-network disable network support" echo " --disable-network disable network support"
echo " --disable-assert disable asserts (continue on errors)" echo " --disable-assert disable asserts (continue on errors)"
echo " --enable-strip enable any possible stripping" echo " --enable-strip enable any possible stripping"