X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=configure;fp=configure;h=097a276447f5e1d69cd96dbe05ebdd170051ad7b;hb=75a30842c4f9e7e95a199361b9348c9f9dede0e6;hp=9af719f4b772d0f83af8abda4890f98451199fe2;hpb=8b78786e0f68a1e0e4331dc5f02eac468c99df11;p=picodrive.git diff --git a/configure b/configure index 9af719f..097a276 100755 --- a/configure +++ b/configure @@ -2,9 +2,9 @@ # some elements originated from qemu configure set -e -TMPC="/tmp/pcsx-conf-${RANDOM}-$$-${RANDOM}.c" -TMPO="/tmp/pcsx-conf-${RANDOM}-$$-${RANDOM}.o" -TMPB="/tmp/pcsx-conf-${RANDOM}-$$-${RANDOM}" +TMPC="/tmp/picodrive-conf-${RANDOM}-$$-${RANDOM}.c" +TMPO="/tmp/picodrive-conf-${RANDOM}-$$-${RANDOM}.o" +TMPB="/tmp/picodrive-conf-${RANDOM}-$$-${RANDOM}" trap "rm -f $TMPC $TMPO $TMPB" EXIT INT QUIT TERM rm -f config.log @@ -17,7 +17,7 @@ compile_object() compile_binary() { - c="$CC $CFLAGS $TMPC -o $TMPB $LDFLAGS $MAIN_LDLIBS $@" + c="$CC $CFLAGS $TMPC -o $TMPB $LDFLAGS $@" echo $c >> config.log $c >> config.log 2>&1 } @@ -31,7 +31,7 @@ check_define() # setting options to "yes" or "no" will make that choice default, # "" means "autodetect". -platform_list="generic pandora" +platform_list="generic pandora gp2x" platform="generic" sound_driver_list="oss alsa sdl" sound_drivers="" @@ -40,12 +40,12 @@ have_armv6="" have_armv7="" have_arm_neon="" have_libavcodec="" -enable_dynarec="yes" need_sdl="no" need_xlib="no" # these are for known platforms optimize_cortexa8="no" optimize_arm926ej="no" +optimize_arm920="no" # hardcoded stuff CC="${CC-${CROSS_COMPILE}gcc}" @@ -72,6 +72,16 @@ set_platform() optimize_cortexa8="yes" have_arm_neon="yes" ;; + gp2x) + sound_drivers="oss" + optimize_arm920="yes" + CFLAGS="$CFLAGS -D__GP2X__" + if [ "$CROSS_COMPILE" = "arm-linux-" ]; then + # still using static, dynamic linking slows Wiz 1-10% + # also libm on F100 is not compatible + MAIN_LDLIBS="$MAIN_LDLIBS -static" + fi + ;; *) fail "unsupported platform: $platform" ;; @@ -87,12 +97,6 @@ for opt do ;; --sound-drivers=*) sound_drivers="$optarg" ;; - --enable-neon) have_arm_neon="yes" - ;; - --disable-neon) have_arm_neon="no" - ;; - --disable-dynarec) enable_dynarec="no" - ;; *) echo "ERROR: unknown option $opt"; show_help="yes" ;; esac @@ -105,10 +109,6 @@ if [ "$show_help" = "yes" ]; then echo " available: $platform_list" echo " --sound-drivers=LIST sound output drivers [guessed]" echo " available: $sound_driver_list" - echo " --enable-neon" - echo " --disable-neon enable/disable ARM NEON optimizations [guessed]" - echo " --disable-dynarec disable dynamic recompiler" - echo " (dynarec is only available and enabled on ARM)" echo "influential environment variables:" echo " CROSS_COMPILE CC CXX AS CFLAGS ASFLAGS LDFLAGS LDLIBS" exit 1 @@ -158,6 +158,10 @@ arm*) CFLAGS="$CFLAGS -mcpu=arm926ej-s -mtune=arm926ej-s" ASFLAGS="$ASFLAGS -mcpu=arm926ej-s -mfloat-abi=softfp" fi + if [ "$optimize_arm920" = "yes" ]; then + CFLAGS="$CFLAGS -mcpu=arm920t -mtune=arm920t" + ASFLAGS="$ASFLAGS -mcpu=arm920t -mfloat-abi=soft" + fi if [ "x$have_arm_neon" = "x" ]; then # detect NEON from user-supplied cflags to enable asm code @@ -202,7 +206,7 @@ arm*) fi # warn about common mistakes - if [ "$have_armv5" != "yes" ]; then + if [ "$platform" != "gp2x" -a "$have_armv5" != "yes" ]; then if ! echo "$CFLAGS" | grep -q -- '-mcpu=\|-march='; then echo "Warning: compiling for ARMv4, is that really what you want?" echo "You probably should specify -mcpu= or -march= like this:" @@ -216,8 +220,6 @@ arm*) fi ;; *) - # dynarec only available on ARM - enable_dynarec="no" ;; esac @@ -243,7 +245,8 @@ check_libpng() #include void main() { png_init_io(0, 0); } EOF - compile_binary +# compile_binary + compile_object } check_oss() @@ -315,7 +318,7 @@ else fi if echo $sound_drivers | grep -q "\"; then MAIN_LDLIBS="-lasound $MAIN_LDLIBS" - check_alsa || fail "please install libasound2-dev" + check_alsa -lasound || fail "please install libasound2-dev" fi fi @@ -324,7 +327,7 @@ if [ "$need_sdl" = "yes" ]; then fail "sdl-config is missing; please install libsdl (libsdl1.2-dev)" CFLAGS="$CFLAGS `sdl-config --cflags`" MAIN_LDLIBS="`sdl-config --libs` $MAIN_LDLIBS" - check_sdl || fail "please install libsdl (libsdl1.2-dev)" + check_sdl `sdl-config --libs` || fail "please install libsdl (libsdl1.2-dev)" fi cat > $TMPC < $config_mak printf "# Configured with:" >> $config_mak @@ -372,11 +372,14 @@ echo "SOUND_DRIVERS = $sound_drivers" >> $config_mak if [ "$have_libavcodec" = "yes" ]; then echo "HAVE_LIBAVCODEC = 1" >> $config_mak fi -if [ "$have_arm_neon" = "yes" ]; then - echo "HAVE_NEON = 1" >> $config_mak -fi -if [ "$enable_dynarec" = "yes" ]; then - echo "USE_DYNAREC = 1" >> $config_mak + +# GP2X toolchains are too old for UAL asm, +# so add this here to not litter main Makefile +if [ "$platform" = "g1p2x" ]; then + echo >> $config_mak + echo "%.o: %.S" >> $config_mak + echo " $(CC) $(CFLAGS) -E -c $^ -o /tmp/$(notdir $@).s" >> $config_mak + echo " $(AS) $(ASFLAGS) /tmp/$(notdir $@).s -o $@" >> $config_mak fi # use pandora's skin (for now)