X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=pcsx_rearmed.git;a=blobdiff_plain;f=configure;h=8c40b7dcecddb5f8c1386ae4493ba38822238293;hp=47c68b8e876ee6667e8666b17eca30562e84d6b3;hb=61bc6d40b4f6f846a0ae1b73ceecdca893c14df4;hpb=4132e8ca13b6395f8a9ef7ec7d01cbdcc19c037d diff --git a/configure b/configure index 47c68b8e..8c40b7dc 100755 --- a/configure +++ b/configure @@ -24,10 +24,14 @@ check_define() # setting options to "yes" or "no" will make that choice default, # "" means "autodetect". -platform_list="generic pandora maemo caanoo" +platform_list="generic pandora maemo caanoo libretro" platform="generic" -sound_driver_list="oss alsa none" +builtin_gpu_list="peops unai neon" +builtin_gpu="" +sound_driver_list="oss alsa libretro none" sound_driver="alsa" +plugins="plugins/spunull/spunull.so \ +plugins/dfxvideo/gpu_peops.so plugins/gpu_unai/gpu_unai.so" ram_fixed="no" drc_cache_base="no" have_armv6="" @@ -41,6 +45,7 @@ optimize_arm926ej="no" # hardcoded stuff CC="${CC-${CROSS_COMPILE}gcc}" +CXX="${CXX-${CROSS_COMPILE}g++}" AS="${AS-${CROSS_COMPILE}as}" AR="${AS-${CROSS_COMPILE}ar}" config_mak="config.mak" @@ -71,6 +76,9 @@ set_platform() drc_cache_base="yes" optimize_arm926ej="yes" ;; + libretro) + sound_driver="libretro" + ;; *) echo "unsupported platform: $platform" exit 1 @@ -85,6 +93,8 @@ for opt do ;; --platform=*) set_platform "$optarg" ;; + --gpu=*) builtin_gpu="$optarg" + ;; --sound-driver=*) sound_driver="$optarg" ;; --enable-neon) have_arm_neon="yes" @@ -103,6 +113,8 @@ if [ "$show_help" = "yes" ]; then echo " --help print this message" echo " --platform=NAME target platform [$platform]" echo " available: $platform_list" + echo " --gpu=NAME builtin gpu plugin [guessed]" + echo " available: $builtin_gpu_list" echo " --sound-driver=NAME sound output driver [$sound_driver]" echo " available: $sound_driver_list" echo " --enable-neon" @@ -110,12 +122,23 @@ if [ "$show_help" = "yes" ]; then echo " --disable-dynarec disable dynamic recompiler" echo " (dynarec is only available and enabled on ARM)" echo "influential environment variables:" - echo " CROSS_COMPILE CC AS AR CFLAGS ASFLAGS LDFLAGS LDLIBS" + echo " CROSS_COMPILE CC CXX AS AR CFLAGS ASFLAGS LDFLAGS LDLIBS" exit 1 fi +if [ "x$builtin_gpu" != "x" ]; then + case "$builtin_gpu" in + peops|unai|neon) + ;; + *) + echo "unsupported builtin gpu plugin: $builtin_gpu" + exit 1 + ;; + esac +fi + case "$sound_driver" in -oss|alsa|none) +oss|alsa|libretro|none) ;; *) echo "unsupported sound driver: $sound_driver" @@ -154,6 +177,17 @@ if [ "$ARCH" = "arm" ]; then fi fi + if [ "x$builtin_gpu" = "x" ]; then + if [ "$have_arm_neon" = "yes" ]; then + builtin_gpu="neon" + elif [ "$have_armv7" != "yes" ]; then + # pre-ARMv7 hardware is usually not fast enough for peops + builtin_gpu="unai" + else + builtin_gpu="peops" + fi + fi + # set mfpu and mfloat-abi if they are not set if [ "$have_arm_neon" = "yes" ]; then echo "$CFLAGS" | grep -q -- '-mfpu=' || CFLAGS="$CFLAGS -mfpu=neon" @@ -167,6 +201,11 @@ if [ "$ARCH" = "arm" ]; then echo "$ASFLAGS" | grep -q -- '-mfloat-abi=' || ASFLAGS="$ASFLAGS -mfloat-abi=softfp" fi + # must disable -mthumb as recompiler can't handle it + if check_define __thumb__; then + CFLAGS="$CFLAGS -mno-thumb" + fi + if [ "$have_armv7" = "yes" ]; then ASFLAGS="$ASFLAGS --defsym HAVE_ARMV7=1" else @@ -177,6 +216,10 @@ else enable_dynarec="no" fi +if [ "x$builtin_gpu" = "x" ]; then + builtin_gpu="peops" +fi + if [ "$ARCH" = "x86_64" ]; then # currently we are full of 32bit assumptions, # at least savestate compatibility will break without these @@ -193,12 +236,24 @@ if [ "$ram_fixed" = "yes" ]; then CFLAGS="$CFLAGS -DRAM_FIXED" fi -if [ "$platform" = "maemo" ]; then +case "$platform" in +generic) + generic_cflags=`sdl-config --cflags` + generic_ldlibs=`sdl-config --libs` + CFLAGS="$CFLAGS $generic_cflags" + LDFLAGS="$LDFLAGS $generic_ldlibs" + ;; +maemo) maemo_cflags=`pkg-config --cflags hildon-1` maemo_ldlibs=`pkg-config --libs hildon-1` CFLAGS="$CFLAGS -DMAEMO -DMAEMO_CHANGES $maemo_cflags" LDFLAGS="$LDFLAGS $maemo_ldlibs" -fi + ;; +libretro) + CFLAGS="$CFLAGS -fPIC" + LDFLAGS="$LDFLAGS -shared" + ;; +esac # check for tslib (only headers needed) if [ "x$have_tslib" = "x" ]; then @@ -213,6 +268,29 @@ EOF fi fi +# check for GLES headers +cat > $TMPC < +#include +#include +void *test(void) { + return eglGetDisplay( (EGLNativeDisplayType)0 ); +} +EOF +if compile_object; then + plugins="$plugins plugins/gpu-gles/gpu_gles.so" +fi + +if [ "$have_arm_neon" = "yes" -a "$builtin_gpu" != "neon" ]; then + plugins="$plugins plugins/gpu_neon/gpu_neon.so" +fi + +# short plugin list for display +for p in $plugins; do + p1=`basename $p` + plugins_short="$p1 $plugins_short" +done + # set things that failed to autodetect to "no" test "x$have_armv6" != "x" || have_armv6="no" test "x$have_armv7" != "x" || have_armv7="no" @@ -220,9 +298,12 @@ test "x$have_arm_neon" != "x" || have_arm_neon="no" echo "architecture $ARCH" echo "platform $platform" +echo "built-in GPU $builtin_gpu" echo "sound driver $sound_driver" +echo "plugins $plugins_short" echo "C compiler $CC" echo "C compiler flags $CFLAGS" +echo "linker flags $LDFLAGS" echo "enable dynarec $enable_dynarec" echo "ARMv7 optimizations $have_armv7" echo "enable ARM NEON $have_arm_neon" @@ -234,6 +315,7 @@ printf " '%s'" "$0" "$@" >> $config_mak echo >> $config_mak echo "CC = $CC" >> $config_mak +echo "CXX = $CXX" >> $config_mak echo "AS = $AS" >> $config_mak echo "CFLAGS += $CFLAGS" >> $config_mak echo "ASFLAGS += $ASFLAGS" >> $config_mak @@ -242,19 +324,22 @@ echo "LDLIBS += $LDLIBS" >> $config_mak echo "PLUGIN_CFLAGS += $PLUGIN_CFLAGS" >> $config_mak echo >> $config_mak +if [ "$platform" = "libretro" ]; then + echo "TARGET = libretro.so" >> $config_mak +fi echo "ARCH = $ARCH" >> $config_mak echo "PLATFORM = $platform" >> $config_mak -case "$sound_driver" in -oss) - echo "USE_OSS = 1" >> $config_mak - ;; -alsa) - echo "USE_ALSA = 1" >> $config_mak - ;; -none) - echo "USE_NO_SOUND = 1" >> $config_mak - ;; -esac +echo "BUILTIN_GPU = $builtin_gpu" >> $config_mak +echo "SOUND_DRIVER = $sound_driver" >> $config_mak +if [ "$ARCH" = "arm" ]; then + echo "PLUGINS = $plugins" >> $config_mak +else + echo -n "PLUGINS =" >> $config_mak + for p in $plugins; do + echo -n " ${p}.${ARCH}" >> $config_mak + done + echo >> $config_mak +fi if [ "$have_armv6" = "yes" ]; then echo "HAVE_ARMV6 = 1" >> $config_mak fi @@ -274,4 +359,7 @@ if [ "$drc_cache_base" = "yes" ]; then echo "DRC_CACHE_BASE = 1" >> $config_mak fi +# use pandora's skin (for now) +test -e skin || ln -s frontend/pandora/skin skin + # vim:shiftwidth=2:expandtab