Merge branch 'master' into cpp-11
# Conflicts: # config.lib
This commit is contained in:
137
config.lib
137
config.lib
@@ -52,7 +52,6 @@ set_default() {
|
||||
enable_profiling="0"
|
||||
enable_lto="0"
|
||||
enable_dedicated="0"
|
||||
enable_network="1"
|
||||
enable_static="1"
|
||||
enable_translator="0"
|
||||
enable_unicode="1"
|
||||
@@ -82,7 +81,6 @@ set_default() {
|
||||
with_iconv="1"
|
||||
with_midi=""
|
||||
with_midi_arg=""
|
||||
with_libtimidity="1"
|
||||
with_fluidsynth="1"
|
||||
with_freetype="1"
|
||||
with_fontconfig="1"
|
||||
@@ -131,7 +129,6 @@ set_default() {
|
||||
enable_profiling
|
||||
enable_lto
|
||||
enable_dedicated
|
||||
enable_network
|
||||
enable_static
|
||||
enable_translator
|
||||
enable_unicode
|
||||
@@ -160,7 +157,6 @@ set_default() {
|
||||
with_iconv
|
||||
with_midi
|
||||
with_midi_arg
|
||||
with_libtimidity
|
||||
with_fluidsynth
|
||||
with_freetype
|
||||
with_fontconfig
|
||||
@@ -291,9 +287,6 @@ detect_params() {
|
||||
--enable-ipo=*) enable_lto="$optarg";;
|
||||
--enable-dedicated) enable_dedicated="1";;
|
||||
--enable-dedicated=*) enable_dedicated="$optarg";;
|
||||
--enable-network) enable_network="2";;
|
||||
--enable-network=*) enable_network="$optarg";;
|
||||
--disable-network) enable_network="0";;
|
||||
--disable-static) enable_static="0";;
|
||||
--enable-static) enable_static="2";;
|
||||
--enable-static=*) enable_static="$optarg";;
|
||||
@@ -370,10 +363,6 @@ detect_params() {
|
||||
--without-libpng) with_png="0";;
|
||||
--with-libpng=*) with_png="$optarg";;
|
||||
|
||||
--with-libtimidity) with_libtimidity="2";;
|
||||
--without-libtimidity) with_libtimidity="0";;
|
||||
--with-libtimidity=*) with_libtimidity="$optarg";;
|
||||
|
||||
--with-fluidsynth) with_fluidsynth="2";;
|
||||
--without-fluidsynth) with_fluidsynth="0";;
|
||||
--with-fluidsynth=*) with_fluidsynth="$optarg";;
|
||||
@@ -559,10 +548,10 @@ check_params() {
|
||||
|
||||
# Check if all params have valid values
|
||||
|
||||
# OS only allows DETECT, UNIX, OSX, FREEBSD, DRAGONFLY, OPENBSD, NETBSD, MORPHOS, BEOS, HAIKU, SUNOS, CYGWIN, MINGW, OS2, and DOS
|
||||
if [ -z "`echo $os | egrep '^(DETECT|UNIX|OSX|FREEBSD|DRAGONFLY|OPENBSD|NETBSD|HPUX|MORPHOS|BEOS|HAIKU|SUNOS|CYGWIN|MINGW|OS2|DOS)$'`" ]; then
|
||||
# OS only allows DETECT, UNIX, OSX, FREEBSD, DRAGONFLY, OPENBSD, NETBSD, HAIKU, SUNOS, CYGWIN, MINGW, and OS2
|
||||
if [ -z "`echo $os | egrep '^(DETECT|UNIX|OSX|FREEBSD|DRAGONFLY|OPENBSD|NETBSD|HPUX|HAIKU|SUNOS|CYGWIN|MINGW|OS2)$'`" ]; then
|
||||
log 1 "configure: error: invalid option --os=$os"
|
||||
log 1 " Available options are: --os=[DETECT|UNIX|OSX|FREEBSD|DRAGONFLY|OPENBSD|NETBSD|HPUX|MORPHOS|BEOS|HAIKU|SUNOS|CYGWIN|MINGW|OS2|DOS]"
|
||||
log 1 " Available options are: --os=[DETECT|UNIX|OSX|FREEBSD|DRAGONFLY|OPENBSD|NETBSD|HPUX|HAIKU|SUNOS|CYGWIN|MINGW|OS2]"
|
||||
exit 1
|
||||
fi
|
||||
# cpu_type can be either 32 or 64
|
||||
@@ -629,7 +618,7 @@ check_params() {
|
||||
detect_sse_capable_architecture
|
||||
|
||||
if [ "$enable_static" = "1" ]; then
|
||||
if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ] || [ "$os" = "MORPHOS" ] || [ "$os" = "DOS" ]; then
|
||||
if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ]; then
|
||||
enable_static="2"
|
||||
else
|
||||
enable_static="0"
|
||||
@@ -639,8 +628,8 @@ check_params() {
|
||||
if [ "$enable_static" != "0" ]; then
|
||||
log 1 "checking static... yes"
|
||||
|
||||
if [ "$os" != "MINGW" ] && [ "$os" != "CYGWIN" ] && [ "$os" != "OSX" ] && [ "$os" != "MORPHOS" ] && [ "$os" != "DOS" ]; then
|
||||
log 1 "WARNING: static is only known to work on Windows, DOS, MacOSX and MorphOS"
|
||||
if [ "$os" != "MINGW" ] && [ "$os" != "CYGWIN" ] && [ "$os" != "OSX" ]; then
|
||||
log 1 "WARNING: static is only known to work on Windows, and MacOSX"
|
||||
log 1 "WARNING: use static at your own risk on this platform"
|
||||
|
||||
sleep 5
|
||||
@@ -650,7 +639,7 @@ check_params() {
|
||||
fi
|
||||
|
||||
if [ "$enable_unicode" = "1" ]; then
|
||||
if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ] || [ "$os" = "DOS" ]; then
|
||||
if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ]; then
|
||||
enable_unicode="2"
|
||||
else
|
||||
enable_unicode="0"
|
||||
@@ -755,11 +744,6 @@ check_params() {
|
||||
if [ "$enable_dedicated" != "0" ]; then
|
||||
log 1 "checking GDI video driver... dedicated server, skipping"
|
||||
log 1 "checking dedicated... found"
|
||||
|
||||
if [ "$enable_network" = "0" ]; then
|
||||
log 1 "configure: error: building a dedicated server without network support is pointless"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ]; then
|
||||
log 1 "checking GDI video driver... found"
|
||||
@@ -790,15 +774,6 @@ check_params() {
|
||||
log 1 "checking console application... enabled"
|
||||
fi
|
||||
|
||||
if [ "$enable_network" = "1" ] && [ "$os" = "DOS" ]; then
|
||||
log 1 "checking network... DOS, skipping"
|
||||
enable_network=0
|
||||
elif [ "$enable_network" != "0" ]; then
|
||||
log 1 "checking network... found"
|
||||
else
|
||||
log 1 "checking network... disabled"
|
||||
fi
|
||||
|
||||
log 1 "checking squirrel... found"
|
||||
SCRIPT_SRC_DIR="$ROOT_DIR/src/3rdparty/squirrel/include"
|
||||
|
||||
@@ -820,7 +795,7 @@ check_params() {
|
||||
pre_detect_with_zlib=$with_zlib
|
||||
detect_zlib
|
||||
|
||||
if [ "$with_zlib" = "0" ] || [ -z "$zlib-config" ]; then
|
||||
if [ "$with_zlib" = "0" ] || [ -z "$zlib_config" ]; then
|
||||
log 1 "WARNING: zlib was not detected or disabled"
|
||||
log 1 "WARNING: OpenTTD doesn't require zlib, but it does mean that many features"
|
||||
log 1 "WARNING: (like loading most old savegames/scenarios, loading heightmaps,"
|
||||
@@ -895,7 +870,6 @@ check_params() {
|
||||
detect_fontconfig
|
||||
detect_icu_layout
|
||||
detect_icu_sort
|
||||
detect_libtimidity
|
||||
detect_fluidsynth
|
||||
|
||||
if [ "$with_direct_music" != "0" ]; then
|
||||
@@ -939,9 +913,7 @@ check_params() {
|
||||
fi
|
||||
|
||||
if [ "$enable_debug" = "0" ] && [ "$enable_profiling" = "0" ] && [ "$enable_strip" != "0" ]; then
|
||||
if [ "$os" = "MORPHOS" ]; then
|
||||
strip_arg="--strip-all --strip-unneeded --remove-section .comment"
|
||||
elif [ "$os" = "OSX" ]; then
|
||||
if [ "$os" = "OSX" ]; then
|
||||
strip_arg=""
|
||||
elif [ "$os" = "OS2" ]; then
|
||||
strip_arg=""
|
||||
@@ -1032,10 +1004,6 @@ check_params() {
|
||||
grfcodec=""
|
||||
fi
|
||||
|
||||
if [ "$os" = "DOS" ]; then
|
||||
with_threads="0"
|
||||
fi
|
||||
|
||||
if [ "$os" != "OSX" ] && [ "$with_application_bundle" != "0" ]; then
|
||||
if [ "$with_application_bundle" = "1" ]; then
|
||||
with_application_bundle="0"
|
||||
@@ -1138,7 +1106,7 @@ check_params() {
|
||||
fi
|
||||
|
||||
if [ "$personal_dir" = "1" ]; then
|
||||
if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ] || [ "$os" = "DOS" ] || [ "$os" = "HAIKU" ]; then
|
||||
if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ] || [ "$os" = "HAIKU" ]; then
|
||||
personal_dir="OpenTTD"
|
||||
elif [ "$os" = "OSX" ]; then
|
||||
personal_dir="Documents/OpenTTD"
|
||||
@@ -1360,6 +1328,9 @@ make_compiler_cflags() {
|
||||
# it happens when using the FOR_ALL_WINDOWS_FROM_BACK_FROM macro
|
||||
flags="$flags -Wno-self-assign"
|
||||
|
||||
# warning: <something> is a C++11 extension
|
||||
flags="$flags -Wno-c++11-extensions"
|
||||
|
||||
if [ "$cc_version" -lt "300" ]; then
|
||||
# warning: equality comparison with extraneous parentheses
|
||||
flags="$flags -Wno-parentheses"
|
||||
@@ -1541,10 +1512,6 @@ make_cflags_and_ldflags() {
|
||||
if [ "$enable_debug" = "0" ]; then
|
||||
# No debug, add default stuff
|
||||
OBJS_SUBDIR="release"
|
||||
if [ "$os" = "MORPHOS" ]; then
|
||||
CFLAGS="-I/gg/os-include -noixemul -fstrict-aliasing -fexpensive-optimizations -mcpu=604 -fno-inline -mstring -mmultiple $CFLAGS"
|
||||
LDFLAGS="$LDFLAGS -noixemul"
|
||||
fi
|
||||
|
||||
if [ "$enable_profiling" = "0" ]; then
|
||||
# -fomit-frame-pointer and -pg do not go well together (gcc errors they are incompatible)
|
||||
@@ -1633,19 +1600,14 @@ make_cflags_and_ldflags() {
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$os" != "CYGWIN" ] && [ "$os" != "HAIKU" ] && [ "$os" != "OPENBSD" ] && [ "$os" != "MINGW" ] && [ "$os" != "MORPHOS" ] && [ "$os" != "OSX" ] && [ "$os" != "DOS" ] && [ "$os" != "OS2" ]; then
|
||||
if [ "$os" != "CYGWIN" ] && [ "$os" != "HAIKU" ] && [ "$os" != "OPENBSD" ] && [ "$os" != "MINGW" ] && [ "$os" != "OSX" ] && [ "$os" != "OS2" ]; then
|
||||
LIBS="$LIBS -lpthread"
|
||||
fi
|
||||
|
||||
if [ "$os" != "CYGWIN" ] && [ "$os" != "HAIKU" ] && [ "$os" != "MINGW" ] && [ "$os" != "DOS" ]; then
|
||||
if [ "$os" != "CYGWIN" ] && [ "$os" != "HAIKU" ] && [ "$os" != "MINGW" ]; then
|
||||
LIBS="$LIBS -lc"
|
||||
fi
|
||||
|
||||
if [ "$os" = "MORPHOS" ]; then
|
||||
# -Wstrict-prototypes generates much noise because of system headers
|
||||
CFLAGS="$CFLAGS -Wno-strict-prototypes"
|
||||
fi
|
||||
|
||||
if [ "$os" = "OPENBSD" ]; then
|
||||
LIBS="$LIBS -pthread"
|
||||
fi
|
||||
@@ -1669,12 +1631,12 @@ make_cflags_and_ldflags() {
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$os" = "BEOS" ] || [ "$os" = "HAIKU" ]; then
|
||||
if [ "$os" = "HAIKU" ]; then
|
||||
LIBS="$LIBS -lmidi -lbe"
|
||||
fi
|
||||
|
||||
# Most targets act like UNIX, just with some additions
|
||||
if [ "$os" = "BEOS" ] || [ "$os" = "HAIKU" ] || [ "$os" = "OSX" ] || [ "$os" = "MORPHOS" ] || [ "$os" = "FREEBSD" ] || [ "$os" = "DRAGONFLY" ] || [ "$os" = "OPENBSD" ] || [ "$os" = "NETBSD" ] || [ "$os" = "HPUX" ] || [ "$os" = "SUNOS" ] || [ "$os" = "OS2" ]; then
|
||||
if [ "$os" = "HAIKU" ] || [ "$os" = "OSX" ] || [ "$os" = "FREEBSD" ] || [ "$os" = "DRAGONFLY" ] || [ "$os" = "OPENBSD" ] || [ "$os" = "NETBSD" ] || [ "$os" = "HPUX" ] || [ "$os" = "SUNOS" ] || [ "$os" = "OS2" ]; then
|
||||
CFLAGS="$CFLAGS -DUNIX"
|
||||
fi
|
||||
# And others like Windows
|
||||
@@ -1698,12 +1660,10 @@ make_cflags_and_ldflags() {
|
||||
CFLAGS="$CFLAGS -DWITH_SDL"
|
||||
# SDL must not add _GNU_SOURCE as it breaks many platforms
|
||||
CFLAGS="$CFLAGS `$sdl_config --cflags | sed 's@-D_GNU_SOURCE[^ ]*@@'`"
|
||||
if [ "$os" != "MINGW" ] && [ "$os" != "CYGWIN" ]; then
|
||||
if [ "$enable_static" != "0" ]; then
|
||||
LIBS="$LIBS `$sdl_config --static-libs`"
|
||||
else
|
||||
LIBS="$LIBS `$sdl_config --libs`"
|
||||
fi
|
||||
if [ "$enable_static" != "0" ]; then
|
||||
LIBS="$LIBS `$sdl_config --static --libs`"
|
||||
else
|
||||
LIBS="$LIBS `$sdl_config --libs`"
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -1731,7 +1691,7 @@ make_cflags_and_ldflags() {
|
||||
fi
|
||||
|
||||
if [ -n "$lzma_config" ]; then
|
||||
CFLAGS="$CFLAGS -DWITH_LZMA"
|
||||
CFLAGS="$CFLAGS -DWITH_LIBLZMA"
|
||||
CFLAGS="$CFLAGS `$lzma_config --cflags | tr '\n\r' ' '`"
|
||||
|
||||
if [ "$enable_static" != "0" ]; then
|
||||
@@ -1802,7 +1762,7 @@ make_cflags_and_ldflags() {
|
||||
fi
|
||||
|
||||
if [ -n "$icu_layout_config" ]; then
|
||||
CFLAGS="$CFLAGS -DWITH_ICU_LAYOUT"
|
||||
CFLAGS="$CFLAGS -DWITH_ICU_LX"
|
||||
CFLAGS="$CFLAGS `$icu_layout_config --cflags | tr '\n\r' ' '`"
|
||||
|
||||
if [ "$static_icu" != "0" ]; then
|
||||
@@ -1813,7 +1773,7 @@ make_cflags_and_ldflags() {
|
||||
fi
|
||||
|
||||
if [ -n "$icu_sort_config" ]; then
|
||||
CFLAGS="$CFLAGS -DWITH_ICU_SORT"
|
||||
CFLAGS="$CFLAGS -DWITH_ICU_I18N"
|
||||
CFLAGS="$CFLAGS `$icu_sort_config --cflags | tr '\n\r' ' '`"
|
||||
|
||||
if [ "$static_icu" != "0" ]; then
|
||||
@@ -1842,17 +1802,6 @@ make_cflags_and_ldflags() {
|
||||
CFLAGS="$CFLAGS -DWITH_XAUDIO2"
|
||||
fi
|
||||
|
||||
if [ -n "$libtimidity_config" ]; then
|
||||
CFLAGS="$CFLAGS -DLIBTIMIDITY"
|
||||
CFLAGS="$CFLAGS `$libtimidity_config --cflags | tr '\n\r' ' '`"
|
||||
|
||||
if [ "$enable_static" != "0" ]; then
|
||||
LIBS="$LIBS `$libtimidity_config --libs --static | tr '\n\r' ' '`"
|
||||
else
|
||||
LIBS="$LIBS `$libtimidity_config --libs | tr '\n\r' ' '`"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -n "$fluidsynth" ]; then
|
||||
LIBS="$LIBS -lfluidsynth"
|
||||
CFLAGS="$CFLAGS -DFLUIDSYNTH"
|
||||
@@ -1888,20 +1837,12 @@ make_cflags_and_ldflags() {
|
||||
CFLAGS="$CFLAGS -DUNICODE -D_UNICODE"
|
||||
fi
|
||||
|
||||
if [ "$enable_network" != "0" ]; then
|
||||
CFLAGS="$CFLAGS -DENABLE_NETWORK"
|
||||
if [ "$os" = "HAIKU" ]; then
|
||||
LDFLAGS="$LDFLAGS -lnetwork"
|
||||
fi
|
||||
|
||||
if [ "$os" = "BEOS" ]; then
|
||||
LDFLAGS="$LDFLAGS -lbind -lsocket"
|
||||
fi
|
||||
|
||||
if [ "$os" = "HAIKU" ]; then
|
||||
LDFLAGS="$LDFLAGS -lnetwork"
|
||||
fi
|
||||
|
||||
if [ "$os" = "SUNOS" ]; then
|
||||
LDFLAGS="$LDFLAGS -lnsl -lsocket"
|
||||
fi
|
||||
if [ "$os" = "SUNOS" ]; then
|
||||
LDFLAGS="$LDFLAGS -lnsl -lsocket"
|
||||
fi
|
||||
|
||||
if [ "$enable_static" != "0" ]; then
|
||||
@@ -2380,7 +2321,7 @@ detect_awk() {
|
||||
|
||||
detect_os() {
|
||||
if [ "$os" = "DETECT" ]; then
|
||||
# Detect UNIX, OSX, FREEBSD, DRAGONFLY, OPENBSD, NETBSD, HPUX, MORPHOS, BEOS, SUNOS, CYGWIN, MINGW, OS2, and DOS
|
||||
# Detect UNIX, OSX, FREEBSD, DRAGONFLY, OPENBSD, NETBSD, HPUX, SUNOS, CYGWIN, MINGW, and OS2
|
||||
|
||||
# Try first via dumpmachine, then via uname
|
||||
os=`echo "$host" | tr '[A-Z]' '[a-z]' | $awk '
|
||||
@@ -2391,15 +2332,12 @@ detect_os() {
|
||||
/openbsd/ { print "OPENBSD"; exit}
|
||||
/netbsd/ { print "NETBSD"; exit}
|
||||
/hp-ux/ { print "HPUX"; exit}
|
||||
/morphos/ { print "MORPHOS"; exit}
|
||||
/beos/ { print "BEOS"; exit}
|
||||
/haiku/ { print "HAIKU"; exit}
|
||||
/sunos/ { print "SUNOS"; exit}
|
||||
/solaris/ { print "SUNOS"; exit}
|
||||
/cygwin/ { print "CYGWIN"; exit}
|
||||
/mingw/ { print "MINGW"; exit}
|
||||
/os2/ { print "OS2"; exit}
|
||||
/dos/ { print "DOS"; exit}
|
||||
'`
|
||||
|
||||
if [ -z "$os" ]; then
|
||||
@@ -2411,8 +2349,6 @@ detect_os() {
|
||||
/openbsd/ { print "OPENBSD"; exit}
|
||||
/netbsd/ { print "NETBSD"; exit}
|
||||
/hp-ux/ { print "HPUX"; exit}
|
||||
/morphos/ { print "MORPHOS"; exit}
|
||||
/beos/ { print "BEOS"; exit}
|
||||
/haiku/ { print "HAIKU"; exit}
|
||||
/sunos/ { print "SUNOS"; exit}
|
||||
/cygwin/ { print "CYGWIN"; exit}
|
||||
@@ -2425,7 +2361,7 @@ detect_os() {
|
||||
if [ -z "$os" ]; then
|
||||
log 1 "detecting OS... none detected"
|
||||
log 1 "I couldn't detect your OS. Please use --os=OS to force one"
|
||||
log 1 "Allowed values are: UNIX, OSX, FREEBSD, DRAGONFLY, OPENBSD, NETBSD, MORPHOS, HPUX, BEOS, HAIKU, SUNOS, CYGWIN, MINGW, OS2, and DOS"
|
||||
log 1 "Allowed values are: UNIX, OSX, FREEBSD, DRAGONFLY, OPENBSD, NETBSD, HPUX, HAIKU, SUNOS, CYGWIN, MINGW, and OS2"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -2790,10 +2726,6 @@ detect_lzo2() {
|
||||
detect_library "$with_lzo2" "lzo2" "liblzo2.a" "lzo/" "lzo1x.h"
|
||||
}
|
||||
|
||||
detect_libtimidity() {
|
||||
detect_pkg_config "$with_libtimidity" "libtimidity" "libtimidity_config" "0.1" "1"
|
||||
}
|
||||
|
||||
detect_fluidsynth() {
|
||||
detect_library "$with_fluidsynth" "fluidsynth" "" "" "fluidsynth.h"
|
||||
}
|
||||
@@ -3528,8 +3460,8 @@ showhelp() {
|
||||
echo " --lipo=LIPO the lipo to use (OSX ONLY) [HOST-lipo]"
|
||||
echo " --os=OS the OS we are compiling for [DETECT]"
|
||||
echo " DETECT/UNIX/OSX/FREEBSD/DRAGONFLY/OPENBSD/"
|
||||
echo " NETBSD/MORPHOS/HPUX/BEOS/SUNOS/CYGWIN/"
|
||||
echo " MINGW/OS2/DOS/HAIKU"
|
||||
echo " NETBSD/HPUX/SUNOS/CYGWIN/"
|
||||
echo " MINGW/OS2/HAIKU"
|
||||
echo ""
|
||||
echo "Paths:"
|
||||
echo " --prefix-dir=dir specifies the prefix for all installed"
|
||||
@@ -3583,7 +3515,6 @@ showhelp() {
|
||||
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-assert disable asserts (continue on errors)"
|
||||
echo " --enable-strip enable any possible stripping"
|
||||
echo " --without-osx-sysroot disable the automatic adding of sysroot "
|
||||
@@ -3598,8 +3529,6 @@ showhelp() {
|
||||
echo " --with-midi=midi define which midi-player to use"
|
||||
echo " --with-midi-arg=arg define which args to use for the"
|
||||
echo " midi-player"
|
||||
echo " --with-libtimidity[=\"pkg-config libtimidity\"]"
|
||||
echo " enables libtimidity support"
|
||||
echo " --with-fluidsynth enables fluidsynth support"
|
||||
echo " --with-allegro[=\"pkg-config allegro\"]"
|
||||
echo " enables Allegro video driver support"
|
||||
|
||||
Reference in New Issue
Block a user