Index: tools/rbspeex/Makefile =================================================================== --- tools/rbspeex/Makefile (revision 18183) +++ tools/rbspeex/Makefile (working copy) @@ -11,12 +11,9 @@ SILENT = @ endif -SPEEXSRC = ../../apps/codecs/libspeex - -INCLUDES = -I $(SPEEXSRC) SPEEXOPTS = -DHAVE_CONFIG_H -DROCKBOX_VOICE_ENCODER -CFLAGS = $(SPEEXOPTS) $(INCLUDES) -O3 -fomit-frame-pointer -Wno-unused-parameter +CFLAGS = $(SPEEXOPTS) -O3 -fomit-frame-pointer -Wno-unused-parameter #build standalone win32 executables on cygwin ifeq ($(findstring CYGWIN,$(shell uname)),CYGWIN) @@ -31,10 +28,21 @@ CFLAGS += -arch $(ARCH) endif +TESTPROGRAM = \#include \\n\#include \\n\#include \\nint main(int argc, char **argv)\\n{\\n\\tvoid *st;\\n\\tSpeexResamplerState *resampler = NULL;\\n\\tst = speex_decoder_init(&speex_wb_mode);\\n\\tspeex_resampler_init(1, 8000, 16000, 10, NULL);\\n\\treturn 0;\\n}\\n -# This sets up 'SRC' based on the files mentioned in SOURCES -SRC := $(shell cat $(SPEEXSRC)/SOURCES | $(CC) $(CFLAGS) -E -P - | grep -v "^\#" | grep -v "^$$") +OUTPUT = $(shell printf "$(TESTPROGRAM)" > test.c; $(CC) test.c -lspeex -lspeexdsp -o /dev/null 2>&1; echo $$? ; rm -f test.c) +ifeq ($(OUTPUT),0) + SPEEXSRC = /usr/include # Do we need this? + CFLAGS+=-lspeex -lspeexdsp +else + # This sets up 'SRC' based on the files mentioned in SOURCES + SPEEXSRC = ../../apps/codecs/libspeex + SRC := $(shell cat $(SPEEXSRC)/SOURCES | $(CC) $(CFLAGS) -E -P - | grep -v "^\#" | grep -v "^$$") +endif +INCLUDES = -I $(SPEEXSRC) +CFLAGS+=$(INCLUDES) + OUT = build$(ARCH) SOURCES = $(SRC:%.c=$(SPEEXSRC)/%.c) rbspeex.c rbspeexenc.c rbspeexdec.c OBJS = $(addprefix $(OUT)/,$(SRC:%.c=%.o)) Index: rbutil/rbutilqt/rbutilqt.pro =================================================================== --- rbutil/rbutilqt/rbutilqt.pro (revision 18183) +++ rbutil/rbutilqt/rbutilqt.pro (working copy) @@ -125,7 +125,7 @@ # Needed by QT on Win INCLUDEPATH = . irivertools zip zlib ../ipodpatcher ../sansapatcher ../../tools/rbspeex ../../tools -LIBS += -L../../tools/rbspeex -lrbspeex +LIBS += -L../../tools/rbspeex -lrbspeex -lspeex -lspeexdsp TEMPLATE = app dbg {