Pthread support from Gwl.

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3041 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
Meep-Eep
2008-08-21 20:03:54 +00:00
parent f726de4474
commit aa02a78da5
11 changed files with 846 additions and 9 deletions
+28 -2
View File
@@ -70,7 +70,7 @@ uqm_prepare_config()
{
# Describe the menu:
MENU_main_ITEMS="debug graphics sound mikmod ovcodec netplay joystick \
ioformat accel"
ioformat accel threadlib"
case "$HOST_SYSTEM" in
Darwin)
# Installation directory not modifiable
@@ -92,6 +92,7 @@ uqm_prepare_config()
MENU_main_ITEM_joystick_TYPE=CHOICE
MENU_main_ITEM_ioformat_TYPE=CHOICE
MENU_main_ITEM_accel_TYPE=CHOICE
MENU_main_ITEM_threadlib_TYPE=CHOICE
MENU_main_ITEM_install_path_TYPE=MENU
CHOICE_debug_OPTIONS="nodebug debug strictdebug"
@@ -290,6 +291,31 @@ uqm_prepare_config()
}
CHOICE_accel_DEFAULT=asm
CHOICE_threadlib_OPTIONS="sdl pthread"
CHOICE_threadlib_TITLE="Thread library"
CHOICE_threadlib_OPTION_sdl_TITLE="SDL-controlled thread library"
CHOICE_threadlib_OPTION_sdl_ACTION="threadlib_sdl_action"
threadlib_sdl_action() {
CFLAGS="$CFLAGS -DTHREADLIB_SDL"
THREADLIB="SDL"
}
CHOICE_threadlib_OPTION_pthread_TITLE="Pthread thread library"
CHOICE_threadlib_OPTION_pthread_PRECOND="have_library pthread"
CHOICE_threadlib_OPTION_pthread_ACTION="threadlib_pthread_action"
threadlib_pthread_action() {
CFLAGS="$CFLAGS -DTHREADLIB_PTHREAD"
THREADLIB="PTHREAD"
use_library pthread
}
case "$HOST_SYSTEM" in
ARMV5|WINSCW)
CHOICE_threadlib_DEFAULT=pthread
;;
*)
CHOICE_threadlib_DEFAULT=sdl
;;
esac
MENU_install_path_ITEMS="install_prefix install_bindir install_libdir \
install_sharedir"
MENU_install_path_TITLE="Installation paths"
@@ -359,7 +385,7 @@ uqm_process_config() {
MAKE ECHON SED DEBUG JOYSTICK NETPLAY \
OGGVORBIS SOUNDMODULE USE_INTERNAL_MIKMOD \
HAVE_OPENGL HAVE_REGEX_H_FLAG USE_ZIP_IO \
USE_PLATFORM_ACCEL USE_WINSOCK \
USE_PLATFORM_ACCEL THREADLIB USE_WINSOCK \
INSTALL_LIBDIR INSTALL_BINDIR INSTALL_SHAREDIR \
REZ WINDRES $HAVE_SYMBOLS"
SUBSTITUTE_FILES="build.vars"
+4
View File
@@ -1007,6 +1007,10 @@ set_host_system() {
HOST_SYSTEM="QNX" ;;
[Cc][Ee][Gg][Cc][Cc])
HOST_SYSTEM="cegcc" ;;
[Ww][Ii][Nn][Ss][Cc][Ww])
HOST_SYSTEM="WINSCW" ;;
[Aa][Rr][Mm][Vv]5)
HOST_SYSTEM="ARMV5" ;;
*)
build_message "Warning: host type '$BUILD_HOST' unknown. Using defaults."
;;
+21
View File
@@ -222,6 +222,27 @@ LIB_zlib_DETECT="try_pkgconfig_lib zlib zlib"
LIB_zlib_DEPEND_DETECT_BIN="pkgconfig"
### pthread ###
LIB_pthread_NAME="pthread"
case "$HOST_SYSTEM" in
Linux)
LIB_pthread_CFLAGS=""
LIB_pthread_LDFLAGS=""
LIB_pthread_VERSION=""
;;
FreeBSD|OpenBSD)
LIB_pthread_CFLAGS="$(pthread-config --cflags)"
LIB_pthread_LDFLAGS="$(pthread-config --ldflags)"
LIB_pthread_VERSION="$(pthread-config --version)"
;;
*)
LIB_pthread_CFLAGS=""
LIB_pthread_LDFLAGS="-lpthread"
LIB_pthread_VERSION=""
;;
esac
# Additional platform-specific libraries for networking.
LIB_netlibs_NAME="Platform-specific network libraries"
case "$HOST_SYSTEM" in