Makefile.wiz
author Sam Lantinga
Sat, 08 Jun 2019 18:22:18 -0700
changeset 12803 70d338e248c8
parent 12131 9601849b3079
permissions -rw-r--r--
Fixed bug 4294 - Audio: perform more validation on conversion request

janisozaur

There are many cases which are not able to be handled by SDL's audio conversion routines, including too low (negative) rate, too high rate (impossible to allocate).

This patch aims to report such issues early and handle others in a graceful manner. The "INT32_MAX / RESAMPLER_SAMPLES_PER_ZERO_CROSSING" value is the conservative approach in terms of what can _technically_ be supported, but its value is 4'194'303, or just shy of 4.2MHz. I highly doubt any sane person would use such rates, especially in SDL2, so I would like to drive this limit further down, but would need some assistance to do that, as doing so would have to introduce an arbitrary value. Are you OK with such approach? What would a good value be? Wikipedia (https://en.wikipedia.org/wiki/High-resolution_audio) lists 96kHz as the highest sampling rate in use, even if I quadruple it for a good measure, to 384kHz it's still an order of magnitude lower than 4MHz.
slouken@3438
     1
# Makefile to build the pandora SDL library
slouken@3438
     2
WIZSDK = /mythtv/media/devel/toolchains/openwiz/arm-openwiz-linux-gnu
slouken@3438
     3
slouken@3438
     4
AR	= $(WIZSDK)/bin/arm-openwiz-linux-gnu-ar
slouken@3438
     5
RANLIB	= $(WIZSDK)/bin/arm-openwiz-linux-gnu-ranlib
slouken@3438
     6
CC = $(WIZSDK)/bin/arm-openwiz-linux-gnu-gcc
slouken@3438
     7
CXX = $(WIZSDK)/bin/arm-openwiz-linux-gnu-g++
slouken@3438
     8
STRIP = $(WIZSDK)/bin/arm-openwiz-linux-gnu-strip
slouken@3438
     9
slouken@3438
    10
CFLAGS  = -Wall -fPIC -I./include -I$(WIZSDK)/include -DWIZ_GLES_LITE
slouken@3438
    11
philipp@10204
    12
TARGET_STATIC  = libSDL2.a
philipp@10204
    13
TARGET_SHARED  = libSDL2.so
slouken@3438
    14
slouken@12131
    15
SOURCES = \
slouken@12131
    16
	./src/*.c \
slouken@12131
    17
	./src/audio/*.c \
slouken@12131
    18
	./src/audio/disk/*.c \
slouken@12131
    19
	./src/audio/dsp/*.c \
slouken@12131
    20
	./src/audio/dummy/*.c \
slouken@12131
    21
	./src/cpuinfo/*.c \
slouken@12131
    22
	./src/events/*.c \
slouken@12131
    23
	./src/file/*.c \
slouken@12131
    24
	./src/haptic/*.c \
slouken@12131
    25
	./src/haptic/linux/*.c \
slouken@12131
    26
	./src/joystick/*.c \
slouken@12131
    27
	./src/joystick/linux/*.c \
slouken@12131
    28
	./src/loadso/dlopen/*.c \
slouken@12131
    29
	./src/sensor/*.c \
slouken@12131
    30
	./src/sensor/dummy/*.c \
slouken@12131
    31
	./src/stdlib/*.c \
slouken@12131
    32
	./src/thread/*.c \
slouken@12131
    33
	./src/thread/pthread/SDL_syscond.c \
slouken@12131
    34
	./src/thread/pthread/SDL_sysmutex.c \
slouken@12131
    35
	./src/thread/pthread/SDL_syssem.c \
slouken@12131
    36
	./src/thread/pthread/SDL_systhread.c \
slouken@12131
    37
	./src/timer/*.c \
slouken@12131
    38
	./src/timer/unix/*.c \
slouken@12131
    39
	./src/video/*.c \
slouken@12131
    40
	./src/video/dummy/*.c \
slouken@12131
    41
	./src/video/pandora/*.c \
slouken@3438
    42
	
slouken@3438
    43
slouken@3438
    44
OBJECTS = $(shell echo $(SOURCES) | sed -e 's,\.c,\.o,g')
slouken@3438
    45
slouken@3438
    46
all: config_copy $(TARGET_STATIC) $(TARGET_SHARED)
slouken@3438
    47
slouken@3438
    48
$(TARGET_STATIC): $(OBJECTS)
slouken@3438
    49
	$(AR) crv $@ $^
slouken@3438
    50
	$(RANLIB) $@
slouken@3438
    51
slouken@3438
    52
$(TARGET_SHARED):
slouken@3438
    53
	$(CC) -shared -Wl,-soname,$(TARGET_SHARED).0 -o $(TARGET_SHARED).0.0.1  $(OBJECTS)
slouken@3438
    54
	ln -s $(TARGET_SHARED).0.0.1 $(TARGET_SHARED).0
slouken@3438
    55
	ln -s $(TARGET_SHARED).0 $(TARGET_SHARED)
slouken@3438
    56
slouken@3438
    57
config_copy:
slouken@3438
    58
	cp include/SDL_config_wiz.h include/SDL_config.h
slouken@3438
    59
slouken@3438
    60
clean:
slouken@3438
    61
	rm -f $(TARGET_STATIC) $(TARGET_SHARED)* $(OBJECTS)
slouken@3438
    62
slouken@3438
    63
install:
slouken@3438
    64
	mkdir -p $(WIZSDK)/lib
philipp@10204
    65
	mkdir -p $(WIZSDK)/include/SDL2
slouken@3438
    66
	cp -f $(TARGET_STATIC) $(WIZSDK)/lib
slouken@3438
    67
	cp -f $(TARGET_SHARED).0.0.1 $(WIZSDK)/lib
slouken@3438
    68
	rm -f $(WIZSDK)/lib/$(TARGET_SHARED).0 $(WIZSDK)/lib/$(TARGET_SHARED)
slouken@3438
    69
	ln -s $(WIZSDK)/lib/$(TARGET_SHARED).0.0.1 $(WIZSDK)/lib/$(TARGET_SHARED).0
slouken@3438
    70
	ln -s $(WIZSDK)/lib/$(TARGET_SHARED).0 $(WIZSDK)/lib/$(TARGET_SHARED)
slouken@3438
    71
slouken@3438
    72
	cp $(TARGET_STATIC) ../../toolchain/libs
slouken@3438
    73
	cp $(TARGET_SHARED).0.0.1 ../../toolchain/libs
slouken@3438
    74
	rm -f ../../toolchain/libs/$(TARGET_SHARED).0 ../../toolchain/libs/$(TARGET_SHARED)
slouken@3438
    75
	ln -s ../../toolchain/libs/$(TARGET_SHARED).0.0.1 ../../toolchain/libs/$(TARGET_SHARED).0
slouken@3438
    76
	ln -s ../../toolchain/libs/$(TARGET_SHARED).0 ../../toolchain/libs/$(TARGET_SHARED)
slouken@3438
    77
slouken@3438
    78
	cp $(TARGET_SHARED).0.0.1 ../nehe_demos/build/$(TARGET_SHARED).0
philipp@10204
    79
	cp -f include/*.h $(WIZSDK)/include/SDL2/
philipp@10204
    80
	cp -f include/*.h ../../toolchain/include/SDL2/