mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-23 16:09:47 +00:00
commit
a6accec402
@ -137,12 +137,12 @@ check_lib '' THREADS "$PTHREADLIB" pthread_create
|
||||
check_enabled THREADS THREAD_STORAGE 'Thread Local Storage' 'Threads are' false
|
||||
check_lib '' THREAD_STORAGE "$PTHREADLIB" pthread_key_create
|
||||
|
||||
if [ "$HAVE_NO_CDROM" = "" ]; then
|
||||
if [ "$OS" = 'Win32' ] || [ "$OS" = 'Linux' ]; then
|
||||
HAVE_CDROM=yes
|
||||
fi
|
||||
if [ "$OS" = 'Linux' ]; then
|
||||
check_header CDROM stropts.h scsi/sg.h
|
||||
fi
|
||||
|
||||
check_platform 'Linux Win32' CDROM 'CD-ROM is' user
|
||||
|
||||
if [ "$OS" = 'Win32' ]; then
|
||||
HAVE_DYLIB=yes
|
||||
else
|
||||
|
@ -144,4 +144,4 @@ HAVE_VIDEOPROCESSOR=auto # Enable video processor core
|
||||
HAVE_VIDEOCORE=auto # Broadcom Videocore 4 support
|
||||
HAVE_DRMINGW=no # DrMingw exception handler
|
||||
HAVE_EASTEREGG=yes # Easter egg
|
||||
HAVE_CDROM=no
|
||||
HAVE_CDROM=auto # CD-ROM support
|
||||
|
@ -41,3 +41,19 @@ exists()
|
||||
done
|
||||
return $v
|
||||
}
|
||||
|
||||
# match:
|
||||
# Compares a variable against a list of variables
|
||||
# $1 = variable
|
||||
# $@ = list of variables
|
||||
match()
|
||||
{
|
||||
var="$1"
|
||||
shift
|
||||
for string do
|
||||
case "$string" in
|
||||
"$var" ) return 0 ;;
|
||||
esac
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
@ -82,30 +82,45 @@ check_enabled()
|
||||
}
|
||||
|
||||
# check_platform:
|
||||
# $1 = OS
|
||||
# $1 = OS ['OS' or 'OS OS2 OS3', $1 = name]
|
||||
# $2 = HAVE_$2
|
||||
# $3 = feature
|
||||
# $4 = enable feature when true [checked only if non-empty]
|
||||
# $4 = enable feature when 'true', disable errors with 'user' [checked only if non-empty]
|
||||
check_platform()
|
||||
{ tmpval="$(eval "printf %s \"\$HAVE_$2\"")"
|
||||
[ "$tmpval" = 'no' ] && return 0
|
||||
|
||||
error=
|
||||
newval=
|
||||
setval="$(eval "printf %s \"\$USER_$2\"")"
|
||||
|
||||
for platform in $(printf %s "$1"); do
|
||||
if [ "$setval" = 'yes' ]; then
|
||||
if { [ "$1" != "$OS" ] && [ "${4:-}" = 'true' ]; } ||
|
||||
{ [ "$1" = "$OS" ] &&
|
||||
[ "${4:-}" != 'true' ]; }; then
|
||||
die 1 "Error: $3 not supported for $OS."
|
||||
if [ "$error" != 'no' ] && [ "${4:-}" != 'user' ] &&
|
||||
{ { [ "$platform" != "$OS" ] &&
|
||||
match "${4:-}" true user; } ||
|
||||
{ [ "$platform" = "$OS" ] &&
|
||||
! match "${4:-}" true user; }; }; then
|
||||
error='yes'
|
||||
elif match "${4:-}" true user; then
|
||||
error='no'
|
||||
fi
|
||||
elif [ "$1" = "$OS" ]; then
|
||||
if [ "${4:-}" = 'true' ]; then
|
||||
eval "HAVE_$2=yes"
|
||||
elif [ "$platform" = "$OS" ]; then
|
||||
if match "${4:-}" true user; then
|
||||
newval=yes
|
||||
break
|
||||
else
|
||||
eval "HAVE_$2=no"
|
||||
newval=no
|
||||
fi
|
||||
elif [ "${4:-}" = 'true' ]; then
|
||||
eval "HAVE_$2="
|
||||
elif match "${4:-}" true user; then
|
||||
newval=auto
|
||||
fi
|
||||
done
|
||||
|
||||
if [ "${error}" = 'yes' ]; then
|
||||
die 1 "Error: $3 not supported for $OS."
|
||||
else
|
||||
eval "HAVE_$2=\"${newval:-$tmpval}\""
|
||||
fi
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user