Some improvements towards successful build with netplay on MinGW.
Proabaly not completely there yet. git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2464 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
@@ -538,7 +538,7 @@ EOF
|
||||
}
|
||||
|
||||
# Description: check if a symbol is defined.
|
||||
# set HAVE_<NAME> accordingly, where <NAME> is the capitalized
|
||||
# sets HAVE_<NAME> accordingly, where <NAME> is the capitalized
|
||||
# name of the symbol.
|
||||
# Arguments: $1 - the name of the symbol
|
||||
define_have_symbol() {
|
||||
@@ -600,9 +600,9 @@ EOF
|
||||
}
|
||||
|
||||
# Description: check if a header is available.
|
||||
# set HAVE_<NAME> accordingly, where <NAME> is the capitalized
|
||||
# sets HAVE_<NAME> accordingly, where <NAME> is the capitalized
|
||||
# name of the header file. "sys/time.h" becomes "SYS_TIME_H".
|
||||
# Arguments: $1 - the name of the symbol
|
||||
# Arguments: $1 - the name of the header file
|
||||
define_have_header() {
|
||||
local NAME VALUE
|
||||
NAME=`$TR /.[:lower:] __[:upper:] << EOF
|
||||
@@ -618,6 +618,48 @@ EOF
|
||||
fi
|
||||
}
|
||||
|
||||
# Description: check if a macro is available.
|
||||
# Arguments: $1 - the name of the macro
|
||||
have_macro() {
|
||||
local MACRO EXTRA
|
||||
MACRO="$1"
|
||||
|
||||
EXTRA=`evalVar MACRO_${NAME}_EXTRA`
|
||||
|
||||
try_compile_c "$TEMP_CFLAGS" "$TEMP_LDFLAGS" << EOF > /dev/null 2>&1
|
||||
$EXTRA
|
||||
#ifndef $MACRO
|
||||
# error
|
||||
#endif
|
||||
int main() {
|
||||
return 0;
|
||||
}
|
||||
EOF
|
||||
if [ $? -gt 0 ]; then
|
||||
build_message "Preprocessor macro '$MACRO' not found."
|
||||
return 1
|
||||
fi
|
||||
build_message "Preprocessor macro '$MACRO' found."
|
||||
return 0
|
||||
}
|
||||
|
||||
# Description: check if a macro is defined
|
||||
# sets MACRO_<NAME> to a non-empty string if the macro with
|
||||
# the specified name is defined, and to an empty string if it
|
||||
# is not.
|
||||
# Arguments: $1 - the name of the symbol
|
||||
define_have_macro() {
|
||||
local NAME
|
||||
|
||||
NAME=$1
|
||||
|
||||
if have_macro "$1"; then
|
||||
add_symbol "MACRO_$NAME" "1"
|
||||
else
|
||||
add_symbol "MACRO_$NAME" ""
|
||||
fi
|
||||
}
|
||||
|
||||
# Description: Add a symbol to be replaced by substitute_vars
|
||||
# $HAVE_SYMBOLS will contain the variable names of all
|
||||
# symbols added by define_have_symbol and should be passed to
|
||||
|
||||
Reference in New Issue
Block a user