From: kub Date: Thu, 4 Mar 2021 21:38:11 +0000 (+0100) Subject: core, more on chd support X-Git-Tag: v2.00~595 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8374e606aba6b168b3afe81eacc0d088e801b052;p=picodrive.git core, more on chd support --- diff --git a/Makefile b/Makefile index 99bfc6ac..7a40eb14 100644 --- a/Makefile +++ b/Makefile @@ -237,8 +237,7 @@ endif endif ifneq (,$(HAVE_LIBCHDR)) -CFLAGS += -DUSE_LIBCHDR -Iplatform/common/libchdr/include -LDFLAGS += -Lplatform/common/libchdr -lchdr +CFLAGS += -DUSE_LIBCHDR endif ifeq "$(PLATFORM_ZLIB)" "1" diff --git a/configure b/configure index 9afcca6d..df0a61b1 100755 --- a/configure +++ b/configure @@ -49,6 +49,7 @@ have_armv7="" have_arm_oabi="" have_arm_neon="" have_libavcodec="" +have_libchdr="" need_sdl="no" need_zlib="no" # these are for known platforms @@ -348,6 +349,15 @@ EOF compile_object "$@" } +check_libchdr() +{ + cat > $TMPC < + int main (int argc, char *argv[]) { chd_open("", 0, NULL, NULL); } +EOF + compile_object "$@" +} + check_zlib -lz && MAIN_LDLIBS="$MAIN_LDLIBS -lz" || need_zlib="yes" MAIN_LDLIBS="-lpng $MAIN_LDLIBS" @@ -362,6 +372,10 @@ if check_libavcodec; then esac fi +if check_libchdr; then + have_libchdr="yes" +fi + # find what audio support we can compile if [ "x$sound_drivers" = "x" ]; then if check_oss; then sound_drivers="$sound_drivers oss"; fi @@ -402,6 +416,7 @@ fi test "x$have_armv6" != "x" || have_armv6="no" test "x$have_armv7" != "x" || have_armv7="no" test "x$have_libavcodec" != "x" || have_libavcodec="no" +test "x$have_libchdr" != "x" || have_libchdr="no" echo "architecture $ARCH" echo "platform $platform" @@ -411,6 +426,7 @@ echo "C compiler flags $CFLAGS" echo "libraries $MAIN_LDLIBS" echo "linker flags $LDFLAGS" echo "libavcodec (mp3) $have_libavcodec" +echo "libchdr $have_libchdr" # echo "ARMv7 optimizations $have_armv7" echo "# Automatically generated by configure" > $config_mak @@ -434,6 +450,9 @@ echo "SOUND_DRIVERS = $sound_drivers" >> $config_mak if [ "$have_libavcodec" = "yes" ]; then echo "HAVE_LIBAVCODEC = 1" >> $config_mak fi +if [ "$have_libchdr" = "yes" ]; then + echo "HAVE_LIBCHDR = 1" >> $config_mak +fi if [ "$need_zlib" = "yes" ]; then echo "PLATFORM_ZLIB = 1" >> $config_mak fi