Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MSYS2 : replace Fmod by OpenAL #4807

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed export/msys2/fmodex.dll
Binary file not shown.
Binary file added libs/kiss/lib/msys2/libkiss.a
Binary file not shown.
1 change: 1 addition & 0 deletions libs/openFrameworks/sound/ofOpenALSoundPlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ ofOpenALSoundPlayer::ofOpenALSoundPlayer(){
// ----------------------------------------------------------------------------
ofOpenALSoundPlayer::~ofOpenALSoundPlayer(){
unload();
close();
kiss_fftr_free(fftCfg);
players().erase(this);
}
Expand Down
7 changes: 6 additions & 1 deletion libs/openFrameworks/sound/ofSoundPlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@ void ofSoundUpdate(){
#ifdef OF_SOUND_PLAYER_FMOD
ofFmodSoundUpdate();
#else
ofLogWarning("ofSoundPlayer") << "ofSoundUpdate() not implemented on this platform";
// Only write the log message once !
static bool logOnce = true;
if(logOnce){
ofLogWarning("ofSoundPlayer") << "ofSoundUpdate() not implemented on this platform.";
logOnce = false;
}
#endif
}

Expand Down
2 changes: 1 addition & 1 deletion libs/openFrameworks/utils/ofConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ typedef TESSindex ofIndexType;
#if !defined(OF_SOUND_PLAYER_QUICKTIME) && !defined(OF_SOUND_PLAYER_FMOD) && !defined(OF_SOUND_PLAYER_OPENAL) && !defined(OF_SOUND_PLAYER_EMSCRIPTEN)
#ifdef TARGET_OF_IOS
#define OF_SOUND_PLAYER_IPHONE
#elif defined(TARGET_LINUX)
#elif defined(TARGET_LINUX) || (defined (TARGET_WIN32) && defined(__MINGW32__)) || (defined (TARGET_WIN32) && defined(__MINGW64__))
#define OF_SOUND_PLAYER_OPENAL
#elif defined(TARGET_EMSCRIPTEN)
#define OF_SOUND_PLAYER_EMSCRIPTEN
Expand Down
15 changes: 15 additions & 0 deletions libs/openFrameworksCompiled/project/msys2/config.msys2.default.mk
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ PLATFORM_RUN_COMMAND = cd bin;./$(BIN_NAME)
##########################################################################################

PLATFORM_DEFINES =
PLATFORM_DEFINES += OF_USING_MPG123

##########################################################################################
# PLATFORM REQUIRED ADDON
Expand Down Expand Up @@ -164,6 +165,7 @@ PLATFORM_CORE_EXCLUSIONS += $(OF_LIBS_PATH)/openFrameworks/video/ofGstUtils.cpp
PLATFORM_CORE_EXCLUSIONS += $(OF_LIBS_PATH)/openFrameworks/video/ofGstVideoGrabber.cpp
PLATFORM_CORE_EXCLUSIONS += $(OF_LIBS_PATH)/openFrameworks/video/ofGstVideoPlayer.cpp
PLATFORM_CORE_EXCLUSIONS += $(OF_LIBS_PATH)/openFrameworks/app/ofAppEGLWindow.cpp
PLATFORM_CORE_EXCLUSIONS += $(OF_LIBS_PATH)/openFrameworks/sound/ofFmodSoundPlayer.cpp

# third party

Expand All @@ -181,6 +183,7 @@ PLATFORM_CORE_EXCLUSIONS += $(OF_LIBS_PATH)/assimp/%
PLATFORM_CORE_EXCLUSIONS += $(OF_LIBS_PATH)/glut/%
PLATFORM_CORE_EXCLUSIONS += $(OF_LIBS_PATH)/openssl/%
PLATFORM_CORE_EXCLUSIONS += $(OF_LIBS_PATH)/boost/%
PLATFORM_CORE_EXCLUSIONS += $(OF_LIBS_PATH)/fmodex/%


##########################################################################################
Expand Down Expand Up @@ -231,12 +234,14 @@ PLATFORM_STATIC_LIBRARIES += $(OF_LIBS_PATH)/poco/lib/$(ABI_LIB_SUBPATH)/libPoco
PLATFORM_STATIC_LIBRARIES += $(OF_LIBS_PATH)/poco/lib/$(ABI_LIB_SUBPATH)/libPocoMongoDB.a
PLATFORM_STATIC_LIBRARIES += $(OF_LIBS_PATH)/poco/lib/$(ABI_LIB_SUBPATH)/libPocoData.a
PLATFORM_STATIC_LIBRARIES += $(OF_LIBS_PATH)/poco/lib/$(ABI_LIB_SUBPATH)/libPocoDataSQLite.a
PLATFORM_STATIC_LIBRARIES += $(OF_LIBS_PATH)/kiss/lib/$(ABI_LIB_SUBPATH)/libkiss.a
#PLATFORM_STATIC_LIBRARIES += somestaticlib

PLATFORM_PKG_CONFIG_LIBRARIES =
PLATFORM_PKG_CONFIG_LIBRARIES += zlib
PLATFORM_PKG_CONFIG_LIBRARIES += openssl
PLATFORM_PKG_CONFIG_LIBRARIES += glew
PLATFORM_PKG_CONFIG_LIBRARIES += openal sndfile libmpg123
#PLATFORM_PKG_CONFIG_LIBRARIES += gstreamer-1.0

# shared libraries
Expand Down Expand Up @@ -298,6 +303,7 @@ copy_dlls:
@cp $(MSYS2_ROOT)/bin/libbz2-1.dll bin/
@cp $(MSYS2_ROOT)/bin/libcairo-2.dll bin/
@cp $(MSYS2_ROOT)/bin/LIBEAY32.dll bin/
@cp $(MSYS2_ROOT)/bin/libFLAC-*.dll bin/
@cp $(MSYS2_ROOT)/bin/libfreeimage-3.dll bin/
@cp $(MSYS2_ROOT)/bin/libfreetype-6.dll bin/
@cp $(MSYS2_ROOT)/bin/glew32.dll bin/
Expand All @@ -319,12 +325,17 @@ copy_dlls:
@cp $(MSYS2_ROOT)/bin/liblzma-5.dll bin/
@cp $(MSYS2_ROOT)/bin/libminizip-1.dll bin/
@cp $(MSYS2_ROOT)/bin/libjpeg-8.dll bin/
@cp $(MSYS2_ROOT)/bin/libjpegxr.dll bin/
@cp $(MSYS2_ROOT)/bin/libjxrglue.dll bin/
@cp $(MSYS2_ROOT)/bin/libopenjp2-7.dll bin/
@cp $(MSYS2_ROOT)/bin/libraw-10.dll bin/
@cp $(MSYS2_ROOT)/bin/libtiff-5.dll bin/
@cp $(MSYS2_ROOT)/bin/libwebp*.dll bin/
@cp $(MSYS2_ROOT)/bin/zlib1.dll bin/
@cp $(MSYS2_ROOT)/bin/libjasper-1.dll bin/
@cp $(MSYS2_ROOT)/bin/libmpg123-*.dll bin/
@cp $(MSYS2_ROOT)/bin/libogg-*.dll bin/
@cp $(MSYS2_ROOT)/bin/libopenal-*.dll bin/
@cp $(MSYS2_ROOT)/bin/libopencv_calib3d*.dll bin/
@cp $(MSYS2_ROOT)/bin/libopencv_core*.dll bin/
@cp $(MSYS2_ROOT)/bin/libopencv_features2d*.dll bin/
Expand All @@ -336,6 +347,10 @@ copy_dlls:
@cp $(MSYS2_ROOT)/bin/libopencv_photo*.dll bin/
@cp $(MSYS2_ROOT)/bin/libopencv_video*.dll bin/
@cp $(MSYS2_ROOT)/bin/libopencv_videoio*.dll bin/
@cp $(MSYS2_ROOT)/bin/libsndfile-*.dll bin/
@cp $(MSYS2_ROOT)/bin/libspeex-*.dll bin/
@cp $(MSYS2_ROOT)/bin/libvorbis-*.dll bin/
@cp $(MSYS2_ROOT)/bin/libvorbisenc-*.dll bin/
@cp $(MSYS2_ROOT)/bin/tbb.dll bin/
@cp $(MSYS2_ROOT)/bin/zlib1.dll bin/
@cp $(MSYS2_ROOT)/bin/libassimp.dll bin/
Expand Down
7 changes: 7 additions & 0 deletions scripts/apothecary/formulas/kiss.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ function prepare() {
cp -Rv $FORMULA_DIR/Makefile.linux .
elif [ "$TYPE" == "linux64" ] ; then
cp -Rv $FORMULA_DIR/Makefile.linux64 .
elif [ "$TYPE" == "msys2" ] ; then
cp -Rv $FORMULA_DIR/kiss/Makefile.msys2 .
fi
}

Expand All @@ -39,6 +41,8 @@ function build() {
make -j${PARALLEL_MAKE} -f Makefile.linux
elif [ "$TYPE" == "linux64" ] ; then
make -j${PARALLEL_MAKE} -f Makefile.linux64
elif [ "$TYPE" == "msys2" ] ; then
make -j${PARALLEL_MAKE} -f Makefile.msys2
else
echo "build not needed for $TYPE"
fi
Expand Down Expand Up @@ -66,6 +70,9 @@ function copy() {
elif [ "$TYPE" == "linux64" ] ; then
mkdir -p $1/lib/linux64
cp -v libkiss.a $1/lib/linux64/libkiss.a
elif [ "$TYPE" == "msys2" ] ; then
mkdir -p $1/lib/$TYPE
cp -v libkiss.a $1/lib/$TYPE/libkiss.a
fi

# copy license file
Expand Down
25 changes: 25 additions & 0 deletions scripts/apothecary/formulas/kiss/Makefile.msys2
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
CC=/mingw32/bin/gcc.exe
AR=/mingw32/bin/ar.exe
CFLAGS=-I. -I./tools

LIB=libkiss.a
LIBDEST=./lib/msys2/

LIBSRC=kiss_fft.c tools/kiss_fftr.c

LIBOBJ=$(LIBSRC:.c=.o)

install: $(LIB)
@echo lib Makefile - installing $(LIB)
mkdir -p $(LIBDEST)
@install -m 444 $(LIB) $(LIBDEST)

$(LIB): $(LIBOBJ)
@echo lib Makefile - archiving $(LIB)
@$(AR) r $(LIB) $(LIBOBJ)

.c.o:
@echo lib Makefile - compiling $<
@$(CC) $(CFLAGS) -c $< -o $@


12 changes: 11 additions & 1 deletion scripts/apothecary/formulas/kiss/kiss.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ function prepare() {

# executed inside the lib src dir
function build() {

if [ "$TYPE" == "linux" ] ; then
gcc -I./include -c src/kiss_fft.c -o kiss_fft.o
gcc -I./include -c src/kiss_fftr.c -o kiss_fftr.o
Expand All @@ -41,6 +40,17 @@ function build() {
elif [ "$TYPE" == "linux64" ] ; then
echoWarning "TODO: linux64 build"

elif [ "$TYPE" == "msys2" ] ; then
if [ $ARCH == 32 ] ; then
/mingw32/bin/gcc.exe -I./include -c src/kiss_fft.c -o kiss_fft.o
/mingw32/bin/gcc.exe -I./include -c src/kiss_fftr.c -o kiss_fftr.o
/mingw32/bin/ar.exe r libkiss.a kiss_fft.o kiss_fftr.o
elif [ $ARCH == 64 ] ; then
#/mingw64/bin/gcc.exe -I./include -c src/kiss_fft.c -o kiss_fft_64.o
#/mingw64/bin/gcc.exe -I./include -c src/kiss_fftr.c -o kiss_fftr_64.o
#/mingw64/bin/ar.exe r libkiss64.a kiss.o
fi

else
echo "build not needed for $TYPE"
fi
Expand Down
5 changes: 4 additions & 1 deletion scripts/msys2/install_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ arch=i686
pacman -Sy
pacman -Su
pacman -S $confirm ca-certificates
pacman -Sy $confirm --needed make mingw-w64-$arch-gcc mingw-w64-$arch-glew mingw-w64-$arch-freeglut mingw-w64-$arch-FreeImage mingw-w64-$arch-opencv mingw-w64-$arch-assimp mingw-w64-$arch-boost mingw-w64-$arch-cairo mingw-w64-$arch-clang mingw-w64-$arch-gdb mingw-w64-$arch-zlib mingw-w64-$arch-tools mingw-w64-$arch-pkg-config mingw-w64-$arch-poco mingw-w64-$arch-glfw
pacman -Sy $confirm --needed make mingw-w64-$arch-gcc mingw-w64-$arch-glew mingw-w64-$arch-freeglut mingw-w64-$arch-FreeImage \
mingw-w64-$arch-opencv mingw-w64-$arch-assimp mingw-w64-$arch-boost mingw-w64-$arch-cairo mingw-w64-$arch-clang \
mingw-w64-$arch-gdb mingw-w64-$arch-zlib mingw-w64-$arch-tools mingw-w64-$arch-pkg-config mingw-w64-$arch-poco \
mingw-w64-$arch-glfw mingw-w64-$arch-openal mingw-w64-$arch-mpg123 mingw-w64-$arch-libsndfile

# this would install gstreamer which can be used in mingw too
#pacman -Sy mingw-w64-$arch-gst-libav mingw-w64-$arch-gst-plugins-bad mingw-w64-$arch-gst-plugins-base mingw-w64-$arch-gst-plugins-good mingw-w64-$arch-gst-plugins-ugly mingw-w64-$arch-gstreamer
Expand Down