drc: patch up some potential issues on the switch
[pcsx_rearmed.git] / configure
index 7b30025..cb124ac 100755 (executable)
--- a/configure
+++ b/configure
@@ -45,7 +45,6 @@ sound_driver_list="oss alsa pulseaudio sdl libretro"
 sound_drivers=""
 plugins="plugins/spunull/spunull.so \
 plugins/dfxvideo/gpu_peops.so plugins/gpu_unai/gpu_unai.so plugins/gpu_senquack/gpu_senquack.so"
-ram_fixed="no"
 drc_cache_base="no"
 have_armv5=""
 have_armv6=""
@@ -73,6 +72,9 @@ AR="${AS-${CROSS_COMPILE}ar}"
 MAIN_LDLIBS="$LDLIBS -ldl -lm -lpthread"
 config_mak="config.mak"
 
+SYSROOT="$(${CC} --print-sysroot)"
+[ "x${SDL_CONFIG}" = "x" ] && SDL_CONFIG="${SYSROOT}/usr/bin/sdl-config"
+
 fail()
 {
   echo "$@"
@@ -89,21 +91,18 @@ set_platform()
     ;;
   pandora)
     sound_drivers="oss alsa"
-    ram_fixed="yes"
     drc_cache_base="yes"
     optimize_cortexa8="yes"
     have_arm_neon="yes"
     need_xlib="yes"
     ;;
   maemo)
-    ram_fixed="yes"
     drc_cache_base="yes"
     optimize_cortexa8="yes"
     have_arm_neon="yes"
     ;;
   caanoo)
     sound_drivers="oss"
-    ram_fixed="yes"
     drc_cache_base="yes"
     optimize_arm926ej="yes"
     need_warm="yes"
@@ -297,10 +296,6 @@ if [ "$ARCH" != "arm" -o "$have_armv6" = "yes" ]; then
   PLUGIN_CFLAGS="$PLUGIN_CFLAGS -fPIC"
 fi
 
-if [ "$ram_fixed" = "yes" ]; then
-  CFLAGS="$CFLAGS -DRAM_FIXED"
-fi
-
 case "$platform" in
 generic)
   need_sdl="yes"
@@ -406,7 +401,7 @@ if [ "x$sound_drivers" = "x" ]; then
     sound_drivers="$sound_drivers pulseaudio"
     MAIN_LDLIBS="-lpulse $MAIN_LDLIBS"
   fi
-  if [ "$need_sdl" = "yes" ] || check_sdl `sdl-config --cflags --libs`; then
+  if [ "$need_sdl" = "yes" ] || check_sdl `${SDL_CONFIG} --cflags --libs`; then
     sound_drivers="$sound_drivers sdl"
     need_sdl="yes"
   fi
@@ -425,10 +420,10 @@ else
 fi
 
 if [ "$need_sdl" = "yes" ]; then
-  which sdl-config > /dev/null || \
+  which ${SDL_CONFIG} > /dev/null || \
     fail "sdl-config is missing; please install libsdl (libsdl1.2-dev)"
-  CFLAGS="$CFLAGS `sdl-config --cflags`"
-  MAIN_LDLIBS="`sdl-config --libs` $MAIN_LDLIBS"
+  CFLAGS="$CFLAGS `${SDL_CONFIG} --cflags`"
+  MAIN_LDLIBS="`${SDL_CONFIG} --libs` $MAIN_LDLIBS"
   check_sdl || fail "please install libsdl (libsdl1.2-dev)"
 fi