Add missing files for OpenMPT that were excluded by .gitignore

CQTexperiment
Christopher Snowhill 2019-10-10 15:53:22 -07:00
parent 9a47c0ebe9
commit c53c048d59
23 changed files with 939 additions and 0 deletions

3
.gitignore vendored
View File

@ -1,3 +1,6 @@
.DS_Store
xcuserdata
build
# Special cog exceptions
!Frameworks/OpenMPT/OpenMPT/build

View File

@ -0,0 +1,224 @@
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := openmpt
LOCAL_CFLAGS +=#-std=c99
LOCAL_CPPFLAGS += -std=c++11 -fexceptions -frtti
LOCAL_CPP_FEATURES += exceptions rtti
LOCAL_C_INCLUDES += $(LOCAL_PATH) $(LOCAL_PATH)/common $(LOCAL_PATH)/build/svn_version
LOCAL_CFLAGS += -fvisibility=hidden -Wall -DLIBOPENMPT_BUILD -DMPT_WITH_ZLIB
LOCAL_CPPFLAGS +=#-fvisibility=hidden -Wall -DLIBOPENMPT_BUILD -DMPT_WITH_ZLIB
LOCAL_LDLIBS += -lz
MPT_SVNURL?=
MPT_SVNVERSION?=
MPT_SVNDATE?=
ifneq ($(MPT_SVNURL),)
LOCAL_CFLAGS += -D MPT_SVNURL=\"$(MPT_SVNURL)\"
LOCAL_CPPFLAGS +=#-D MPT_SVNURL=\"$(MPT_SVNURL)\"
endif
ifneq ($(MPT_SVNVERSION),)
LOCAL_CFLAGS += -D MPT_SVNVERSION=\"$(MPT_SVNVERSION)\"
LOCAL_CPPFLAGS +=#-D MPT_SVNVERSION=\"$(MPT_SVNVERSION)\"
endif
ifneq ($(MPT_SVNDATE),)
LOCAL_CFLAGS += -D MPT_SVNDATE=\"$(MPT_SVNDATE)\"
LOCAL_CPPFLAGS +=#-D MPT_SVNDATE=\"$(MPT_SVNDATE)\"
endif
LOCAL_SRC_FILES :=
ifeq ($(MPT_WITH_MINIMP3),1)
LOCAL_CFLAGS += -DMPT_WITH_MINIMP3
LOCAL_CPPFLAGS +=#-DMPT_WITH_MINIMP3
LOCAL_C_INCLUDES += $(LOCAL_PATH)/include
LOCAL_SRC_FILES += include/minimp3/minimp3.c
LOCAL_LDLIBS +=
endif
ifeq ($(MPT_WITH_MPG123),1)
LOCAL_CFLAGS += -DMPT_WITH_MPG123
LOCAL_CPPFLAGS +=#-DMPT_WITH_MPG123
LOCAL_C_INCLUDES +=
LOCAL_SRC_FILES +=
LOCAL_LDLIBS += -lmpg123
endif
ifeq ($(MPT_WITH_OGG),1)
LOCAL_CFLAGS += -DMPT_WITH_OGG
LOCAL_CPPFLAGS +=#-DMPT_WITH_OGG
LOCAL_C_INCLUDES +=
LOCAL_SRC_FILES +=
LOCAL_LDLIBS += -logg
endif
ifeq ($(MPT_WITH_STBVORBIS),1)
LOCAL_CFLAGS += -DMPT_WITH_STBVORBIS
LOCAL_CPPFLAGS +=#-DMPT_WITH_STBVORBIS
LOCAL_C_INCLUDES += $(LOCAL_PATH)/include
LOCAL_SRC_FILES += include/stb_vorbis/stb_vorbis.c
LOCAL_LDLIBS +=
endif
ifeq ($(MPT_WITH_VORBIS),1)
LOCAL_CFLAGS += -DMPT_WITH_VORBIS
LOCAL_CPPFLAGS +=#-DMPT_WITH_VORBIS
LOCAL_C_INCLUDES +=
LOCAL_SRC_FILES +=
LOCAL_LDLIBS += -lvorbis
endif
ifeq ($(MPT_WITH_VORBISFILE),1)
LOCAL_CFLAGS += -DMPT_WITH_VORBISFILE
LOCAL_CPPFLAGS +=#-DMPT_WITH_VORBISFILE
LOCAL_C_INCLUDES +=
LOCAL_SRC_FILES +=
LOCAL_LDLIBS += -lvorbisfile
endif
LOCAL_SRC_FILES += \
common/ComponentManager.cpp \
common/FileReader.cpp \
common/Logging.cpp \
common/misc_util.cpp \
common/mptAlloc.cpp \
common/mptCPU.cpp \
common/mptFileIO.cpp \
common/mptIO.cpp \
common/mptLibrary.cpp \
common/mptOS.cpp \
common/mptPathString.cpp \
common/mptRandom.cpp \
common/mptString.cpp \
common/mptStringBuffer.cpp \
common/mptStringFormat.cpp \
common/mptStringParse.cpp \
common/mptTime.cpp \
common/mptUUID.cpp \
common/mptWine.cpp \
common/Profiler.cpp \
common/serialization_utils.cpp \
common/version.cpp \
libopenmpt/libopenmpt_c.cpp \
libopenmpt/libopenmpt_cxx.cpp \
libopenmpt/libopenmpt_impl.cpp \
libopenmpt/libopenmpt_ext_impl.cpp \
soundlib/AudioCriticalSection.cpp \
soundlib/ContainerMMCMP.cpp \
soundlib/ContainerPP20.cpp \
soundlib/ContainerUMX.cpp \
soundlib/ContainerXPK.cpp \
soundlib/Dither.cpp \
soundlib/Dlsbank.cpp \
soundlib/Fastmix.cpp \
soundlib/InstrumentExtensions.cpp \
soundlib/ITCompression.cpp \
soundlib/ITTools.cpp \
soundlib/Load_669.cpp \
soundlib/Load_amf.cpp \
soundlib/Load_ams.cpp \
soundlib/Load_c67.cpp \
soundlib/Load_dbm.cpp \
soundlib/Load_digi.cpp \
soundlib/Load_dmf.cpp \
soundlib/Load_dsm.cpp \
soundlib/Load_dtm.cpp \
soundlib/Load_far.cpp \
soundlib/Load_gdm.cpp \
soundlib/Load_imf.cpp \
soundlib/Load_it.cpp \
soundlib/Load_itp.cpp \
soundlib/load_j2b.cpp \
soundlib/Load_mdl.cpp \
soundlib/Load_med.cpp \
soundlib/Load_mid.cpp \
soundlib/Load_mo3.cpp \
soundlib/Load_mod.cpp \
soundlib/Load_mt2.cpp \
soundlib/Load_mtm.cpp \
soundlib/Load_okt.cpp \
soundlib/Load_plm.cpp \
soundlib/Load_psm.cpp \
soundlib/Load_ptm.cpp \
soundlib/Load_s3m.cpp \
soundlib/Load_sfx.cpp \
soundlib/Load_stm.cpp \
soundlib/Load_stp.cpp \
soundlib/Load_ult.cpp \
soundlib/Load_uax.cpp \
soundlib/Load_wav.cpp \
soundlib/Load_xm.cpp \
soundlib/Message.cpp \
soundlib/MIDIEvents.cpp \
soundlib/MIDIMacros.cpp \
soundlib/MixerLoops.cpp \
soundlib/MixerSettings.cpp \
soundlib/MixFuncTable.cpp \
soundlib/ModChannel.cpp \
soundlib/modcommand.cpp \
soundlib/ModInstrument.cpp \
soundlib/ModSample.cpp \
soundlib/ModSequence.cpp \
soundlib/modsmp_ctrl.cpp \
soundlib/mod_specifications.cpp \
soundlib/MPEGFrame.cpp \
soundlib/OggStream.cpp \
soundlib/OPL.cpp \
soundlib/Paula.cpp \
soundlib/patternContainer.cpp \
soundlib/pattern.cpp \
soundlib/RowVisitor.cpp \
soundlib/S3MTools.cpp \
soundlib/SampleFormats.cpp \
soundlib/SampleFormatFLAC.cpp \
soundlib/SampleFormatMediaFoundation.cpp \
soundlib/SampleFormatMP3.cpp \
soundlib/SampleFormatOpus.cpp \
soundlib/SampleFormatVorbis.cpp \
soundlib/SampleIO.cpp \
soundlib/Sndfile.cpp \
soundlib/Snd_flt.cpp \
soundlib/Snd_fx.cpp \
soundlib/Sndmix.cpp \
soundlib/SoundFilePlayConfig.cpp \
soundlib/UMXTools.cpp \
soundlib/UpgradeModule.cpp \
soundlib/Tables.cpp \
soundlib/Tagging.cpp \
soundlib/tuningbase.cpp \
soundlib/tuningCollection.cpp \
soundlib/tuning.cpp \
soundlib/WAVTools.cpp \
soundlib/WindowedFIR.cpp \
soundlib/XMTools.cpp \
soundlib/plugins/DigiBoosterEcho.cpp \
soundlib/plugins/dmo/DMOPlugin.cpp \
soundlib/plugins/dmo/Chorus.cpp \
soundlib/plugins/dmo/Compressor.cpp \
soundlib/plugins/dmo/Distortion.cpp \
soundlib/plugins/dmo/Echo.cpp \
soundlib/plugins/dmo/Flanger.cpp \
soundlib/plugins/dmo/Gargle.cpp \
soundlib/plugins/dmo/I3DL2Reverb.cpp \
soundlib/plugins/dmo/ParamEq.cpp \
soundlib/plugins/dmo/WavesReverb.cpp \
soundlib/plugins/LFOPlugin.cpp \
soundlib/plugins/PluginManager.cpp \
soundlib/plugins/PlugInterface.cpp \
sounddsp/AGC.cpp \
sounddsp/DSP.cpp \
sounddsp/EQ.cpp \
sounddsp/Reverb.cpp \
test/TestToolsLib.cpp \
test/test.cpp
include $(BUILD_SHARED_LIBRARY)

View File

@ -0,0 +1,5 @@
APP_CFLAGS :=#-std=c99
APP_CPPFLAGS := -std=c++11 -fexceptions -frtti
APP_LDFLAGS :=
APP_STL := c++_shared

View File

@ -0,0 +1,21 @@
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
This is preliminary documentation.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
0. The minimum required Android NDK version is r16b.
1. Copy the whole libopenmpt source tree below your jni directory.
2. Copy build/android_ndk/* into the root of libopenmpt, i.e. also into the
jni directory and adjust as needed.
3. If you want to support MO3 decoding, you have to either make libmpg123,
libogg, libvorbis and libvorbisfile available (recommended) OR build
libopenmpt with minimp3 and stb_vorbis support (not recommended).
Pass the appropriate options to ndk-build:
MPT_WITH_MINIMP3=1 : Build minimp3 into libopenmpt
MPT_WITH_MPG123=1 : Link against libmpg123 compiled externally
MPT_WITH_OGG=1 : Link against libogg compiled externally
MPT_WITH_STBVORBIS=1 : Build stb_vorbis into libopenmpt
MPT_WITH_VORBIS=1 : Link against libvorbis compiled externally
MPT_WITH_VORBISFILE=1 : Link against libvorbisfile compiled externally
4. Use ndk-build as usual.

View File

@ -0,0 +1,4 @@
MPT_SVNVERSION=11626
MPT_SVNURL=https://source.openmpt.org/svn/openmpt/tags/libopenmpt-0.4.5
MPT_SVNDATE=2019-05-27T06:47:50.022790Z

View File

@ -0,0 +1,50 @@
CC = contrib/fuzzing/afl/afl-clang-fast
CXX = contrib/fuzzing/afl/afl-clang-fast++
LD = contrib/fuzzing/afl/afl-clang-fast++
AR = ar
ifneq ($(STDCXX),)
CXXFLAGS_STDCXX = -std=$(STDCXX)
else
ifeq ($(shell printf '\n' > bin/empty.cpp ; if $(CXX) -std=c++17 -c bin/empty.cpp -o bin/empty.out > /dev/null 2>&1 ; then echo 'c++17' ; fi ), c++17)
CXXFLAGS_STDCXX = -std=c++17
else
ifeq ($(shell printf '\n' > bin/empty.cpp ; if $(CXX) -std=c++14 -c bin/empty.cpp -o bin/empty.out > /dev/null 2>&1 ; then echo 'c++14' ; fi ), c++14)
CXXFLAGS_STDCXX = -std=c++14
else
ifeq ($(shell printf '\n' > bin/empty.cpp ; if $(CXX) -std=c++11 -c bin/empty.cpp -o bin/empty.out > /dev/null 2>&1 ; then echo 'c++11' ; fi ), c++11)
CXXFLAGS_STDCXX = -std=c++11
endif
endif
endif
endif
CFLAGS_STDC = -std=c99
CXXFLAGS += $(CXXFLAGS_STDCXX)
CFLAGS += $(CFLAGS_STDC)
CPPFLAGS +=
CXXFLAGS += -fPIC -fno-strict-aliasing
CFLAGS += -fPIC -fno-strict-aliasing
LDFLAGS +=
LDLIBS += -lm
ARFLAGS := rcs
CXXFLAGS_WARNINGS += -Wmissing-declarations
CFLAGS_WARNINGS += -Wmissing-prototypes
ifeq ($(CHECKED_ADDRESS),1)
CXXFLAGS += -fsanitize=address
CFLAGS += -fsanitize=address
endif
ifeq ($(CHECKED_UNDEFINED),1)
CXXFLAGS += -fsanitize=undefined
CFLAGS += -fsanitize=undefined
endif
EXESUFFIX=
FUZZ=1
CPPFLAGS += -DMPT_BUILD_FUZZER -DMPT_BUILD_FATAL_ASSERTS

View File

@ -0,0 +1,62 @@
CC = clang$(TOOLCHAIN_SUFFIX)
CXX = clang++$(TOOLCHAIN_SUFFIX)
LD = clang++$(TOOLCHAIN_SUFFIX)
AR = ar$(TOOLCHAIN_SUFFIX)
ifneq ($(STDCXX),)
CXXFLAGS_STDCXX = -std=$(STDCXX)
else
ifeq ($(shell printf '\n' > bin/empty.cpp ; if $(CXX) -std=c++17 -c bin/empty.cpp -o bin/empty.out > /dev/null 2>&1 ; then echo 'c++17' ; fi ), c++17)
CXXFLAGS_STDCXX = -std=c++17
else
ifeq ($(shell printf '\n' > bin/empty.cpp ; if $(CXX) -std=c++14 -c bin/empty.cpp -o bin/empty.out > /dev/null 2>&1 ; then echo 'c++14' ; fi ), c++14)
CXXFLAGS_STDCXX = -std=c++14
else
ifeq ($(shell printf '\n' > bin/empty.cpp ; if $(CXX) -std=c++11 -c bin/empty.cpp -o bin/empty.out > /dev/null 2>&1 ; then echo 'c++11' ; fi ), c++11)
CXXFLAGS_STDCXX = -std=c++11
endif
endif
endif
endif
CFLAGS_STDC = -std=c99
CXXFLAGS += $(CXXFLAGS_STDCXX)
CFLAGS += $(CFLAGS_STDC)
CPPFLAGS +=
CXXFLAGS += -fPIC
CFLAGS += -fPIC
LDFLAGS +=
LDLIBS += -lm
ARFLAGS := rcs
ifeq ($(CHECKED_ADDRESS),1)
CXXFLAGS += -fsanitize=address
CFLAGS += -fsanitize=address
endif
ifeq ($(CHECKED_UNDEFINED),1)
CXXFLAGS += -fsanitize=undefined
CFLAGS += -fsanitize=undefined
endif
CXXFLAGS_WARNINGS += -Wmissing-declarations -Wshift-count-negative -Wshift-count-overflow -Wshift-overflow -Wshift-sign-overflow -Wshift-op-parentheses
CFLAGS_WARNINGS += -Wmissing-prototypes -Wshift-count-negative -Wshift-count-overflow -Wshift-overflow -Wshift-sign-overflow -Wshift-op-parentheses
#CXXFLAGS_WARNINGS += -Wdocumentation
#CXXFLAGS_WARNINGS += -Wconversion
#CXXFLAGS_WARNINGS += -Weverything -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-padded -Wno-shadow -Wno-sign-conversion -Wno-weak-vtables
ifeq ($(MODERN),1)
LDFLAGS += -fuse-ld=lld
CXXFLAGS_WARNINGS += -Wpedantic -Wframe-larger-than=20000
#CXXFLAGS_WARNINGS += -Wdouble-promotion -Wframe-larger-than=16000
CFLAGS_WARNINGS += -Wpedantic -Wframe-larger-than=4000
#CFLAGS_WARNINGS += -Wdouble-promotion
LDFLAGS_WARNINGS += -Wl,-no-undefined -Wl,--detect-odr-violations
CXXFLAGS_WARNINGS += -Wdeprecated -Wextra-semi -Wnon-virtual-dtor -Wreserved-id-macro
endif
CFLAGS_SILENT += -Wno-unused-parameter -Wno-unused-function -Wno-cast-qual
EXESUFFIX=

View File

@ -0,0 +1,45 @@
ifeq ($(HOST),unix)
ifeq ($(HOST_FLAVOUR),MACOSX)
include build/make/config-clang.mk
# Mac OS X overrides
DYNLINK=0
SHARED_SONAME=0
# when using iconv
#CPPFLAGS += -DMPT_WITH_ICONV
#LDLIBS += -liconv
else ifeq ($(HOST_FLAVOUR),LINUX)
include build/make/config-gcc.mk
else ifeq ($(HOST_FLAVOUR),FREEBSD)
include build/make/config-clang.mk
NO_LTDL?=1
NO_PORTAUDIOCPP?=1
else ifeq ($(HOST_FLAVOUR),HAIKU)
# In Haiku x86 32bit (but not 64bit),
# modern compilers need a -x86 suffix.
UNAME_P:=$(shell uname -p)
ifeq ($(UNAME_P),x86)
TOOLCHAIN_SUFFIX=-x86
endif
include build/make/config-gcc.mk
else
include build/make/config-generic.mk
endif
else
include build/make/config-generic.mk
endif

View File

@ -0,0 +1,62 @@
CC = i586-pc-msdosdjgpp-gcc
CXX = i586-pc-msdosdjgpp-g++
LD = i586-pc-msdosdjgpp-g++
AR = i586-pc-msdosdjgpp-ar
# Note that we are using GNU extensions instead of 100% standards-compliant
# mode, because otherwise DJGPP-specific headers/functions are unavailable.
CXXFLAGS_STDCXX = -std=gnu++11
CFLAGS_STDC = -std=gnu99
CXXFLAGS += $(CXXFLAGS_STDCXX)
CFLAGS += $(CFLAGS_STDC)
CPPFLAGS +=
CXXFLAGS += -march=pentium -mtune=pentium
CFLAGS += -march=pentium -mtune=pentium
LDFLAGS +=
LDLIBS += -lm
ARFLAGS := rcs
ifeq ($(BUNDLED_ALLEGRO42),1)
CPPFLAGS_ALLEGRO42 := -Iinclude/allegro42/include -DALLEGRO_HAVE_STDINT_H -DLONG_LONG="long long"
LDFLAGS_ALLEGRO42 :=
LDLIBS_ALLEGRO42 := include/allegro42/lib/liballeg.a
endif
CFLAGS_SILENT += -Wno-unused-parameter -Wno-unused-function -Wno-cast-qual -Wno-old-style-declaration -Wno-type-limits -Wno-unused-but-set-variable
EXESUFFIX=.exe
DYNLINK=0
SHARED_LIB=0
STATIC_LIB=1
SHARED_SONAME=0
DEBUG=0
OPTIMIZE=0
OPTIMIZE_SIZE=1
IS_CROSS=1
# generates warnings
MPT_COMPILER_NOVISIBILITY=1
# causes crashes on process shutdown
MPT_COMPILER_NOGCSECTIONS=1
NO_ZLIB=1
NO_LTDL=1
NO_DL=1
NO_MPG123=1
NO_OGG=1
NO_VORBIS=1
NO_VORBISFILE=1
NO_PORTAUDIO=1
NO_PORTAUDIOCPP=1
NO_PULSEAUDIO=1
NO_SDL=1
NO_SDL2=1
NO_SNDFILE=1
NO_FLAC=1

View File

@ -0,0 +1,132 @@
CC = emcc
CXX = em++
LD = em++
AR = emar
EMSCRIPTEN_TARGET?=default
ifneq ($(STDCXX),)
CXXFLAGS_STDCXX = -std=$(STDCXX)
else
ifeq ($(shell printf '\n' > bin/empty.cpp ; if $(CXX) -std=c++17 -c bin/empty.cpp -o bin/empty.out > /dev/null 2>&1 ; then echo 'c++17' ; fi ), c++17)
CXXFLAGS_STDCXX = -std=c++17
else
ifeq ($(shell printf '\n' > bin/empty.cpp ; if $(CXX) -std=c++14 -c bin/empty.cpp -o bin/empty.out > /dev/null 2>&1 ; then echo 'c++14' ; fi ), c++14)
CXXFLAGS_STDCXX = -std=c++14
else
ifeq ($(shell printf '\n' > bin/empty.cpp ; if $(CXX) -std=c++11 -c bin/empty.cpp -o bin/empty.out > /dev/null 2>&1 ; then echo 'c++11' ; fi ), c++11)
CXXFLAGS_STDCXX = -std=c++11
endif
endif
endif
endif
CFLAGS_STDC = -std=c99
CXXFLAGS += $(CXXFLAGS_STDCXX)
CFLAGS += $(CFLAGS_STDC)
CPPFLAGS +=
CXXFLAGS += -fPIC
CFLAGS += -fPIC
LDFLAGS +=
LDLIBS +=
ARFLAGS := rcs
CXXFLAGS += -Os
CFLAGS += -Os
LDFLAGS += -Os
ifeq ($(EMSCRIPTEN_TARGET),default)
# emits whatever is emscripten's default, currently (1.38.8) this is the same as "wasm" below.
CPPFLAGS += -DMPT_BUILD_WASM
CXXFLAGS +=
CFLAGS +=
LDFLAGS +=
LDFLAGS += -s ALLOW_MEMORY_GROWTH=1
else ifeq ($(EMSCRIPTEN_TARGET),wasm)
# emits native wasm AND an emulator for running wasm in asmjs/js with full wasm optimizations.
# as of emscripten 1.38, this is equivalent to default.
CPPFLAGS += -DMPT_BUILD_WASM
CXXFLAGS += -s WASM=1 -s BINARYEN_METHOD='native-wasm'
CFLAGS += -s WASM=1 -s BINARYEN_METHOD='native-wasm'
LDFLAGS += -s WASM=1 -s BINARYEN_METHOD='native-wasm'
LDFLAGS += -s ALLOW_MEMORY_GROWTH=1
else ifeq ($(EMSCRIPTEN_TARGET),asmjs128m)
# emits only asmjs
CPPFLAGS += -DMPT_BUILD_ASMJS
CXXFLAGS += -s WASM=0 -s ASM_JS=1
CFLAGS += -s WASM=0 -s ASM_JS=1
LDFLAGS += -s WASM=0 -s ASM_JS=1
LDFLAGS += -s ALLOW_MEMORY_GROWTH=0 -s ABORTING_MALLOC=0 -s TOTAL_MEMORY=134217728
else ifeq ($(EMSCRIPTEN_TARGET),asmjs)
# emits only asmjs
CPPFLAGS += -DMPT_BUILD_ASMJS
CXXFLAGS += -s WASM=0 -s ASM_JS=1
CFLAGS += -s WASM=0 -s ASM_JS=1
LDFLAGS += -s WASM=0 -s ASM_JS=1
LDFLAGS += -s ALLOW_MEMORY_GROWTH=0 -s ABORTING_MALLOC=0
else ifeq ($(EMSCRIPTEN_TARGET),js)
# emits only plain javascript with plain javascript focused optimizations.
CPPFLAGS += -DMPT_BUILD_ASMJS
CXXFLAGS += -s WASM=0 -s ASM_JS=2 -s LEGACY_VM_SUPPORT=1
CFLAGS += -s WASM=0 -s ASM_JS=2 -s LEGACY_VM_SUPPORT=1
LDFLAGS += -s WASM=0 -s ASM_JS=2 -s LEGACY_VM_SUPPORT=1
LDFLAGS += -s ALLOW_MEMORY_GROWTH=1
endif
CXXFLAGS += -s DISABLE_EXCEPTION_CATCHING=0 -s ERROR_ON_UNDEFINED_SYMBOLS=1 -ffast-math
CFLAGS += -s DISABLE_EXCEPTION_CATCHING=0 -s ERROR_ON_UNDEFINED_SYMBOLS=1 -ffast-math -fno-strict-aliasing
LDFLAGS += -s DISABLE_EXCEPTION_CATCHING=0 -s ERROR_ON_UNDEFINED_SYMBOLS=1 -s EXPORT_NAME="'libopenmpt'"
CFLAGS_SILENT += -Wno-unused-parameter -Wno-unused-function -Wno-cast-qual
CXXFLAGS_WARNINGS += -Wmissing-declarations
CFLAGS_WARNINGS += -Wmissing-prototypes
REQUIRES_RUNPREFIX=1
EXESUFFIX=.js
SOSUFFIX=.js
RUNPREFIX=node
TEST_LDFLAGS= --pre-js build/make/test-pre.js
DYNLINK=0
SHARED_LIB=1
STATIC_LIB=0
EXAMPLES=1
OPENMPT123=0
SHARED_SONAME=0
# Disable the generic compiler optimization flags as emscripten is sufficiently different.
# Optimization flags are hard-coded for emscripten in this file.
DEBUG=0
OPTIMIZE=0
OPTIMIZE_SIZE=0
IS_CROSS=1
NO_ZLIB=1
NO_LTDL=1
NO_DL=1
NO_MPG123=1
NO_OGG=1
NO_VORBIS=1
NO_VORBISFILE=1
NO_PORTAUDIO=1
NO_PORTAUDIOCPP=1
NO_PULSEAUDIO=1
NO_SDL=1
NO_SDL2=1
NO_FLAC=1
NO_SNDFILE=1

View File

@ -0,0 +1,56 @@
CC = gcc$(TOOLCHAIN_SUFFIX)
CXX = g++$(TOOLCHAIN_SUFFIX)
LD = g++($TOOLCHAIN_SUFFIX)
AR = ar$(TOOLCHAIN_SUFFIX)
ifneq ($(STDCXX),)
CXXFLAGS_STDCXX = -std=$(STDCXX)
else
ifeq ($(shell printf '\n' > bin/empty.cpp ; if $(CXX) -std=c++17 -c bin/empty.cpp -o bin/empty.out > /dev/null 2>&1 ; then echo 'c++17' ; fi ), c++17)
CXXFLAGS_STDCXX = -std=c++17
else
ifeq ($(shell printf '\n' > bin/empty.cpp ; if $(CXX) -std=c++14 -c bin/empty.cpp -o bin/empty.out > /dev/null 2>&1 ; then echo 'c++14' ; fi ), c++14)
CXXFLAGS_STDCXX = -std=c++14
else
ifeq ($(shell printf '\n' > bin/empty.cpp ; if $(CXX) -std=c++11 -c bin/empty.cpp -o bin/empty.out > /dev/null 2>&1 ; then echo 'c++11' ; fi ), c++11)
CXXFLAGS_STDCXX = -std=c++11
endif
endif
endif
endif
CFLAGS_STDC = -std=c99
CXXFLAGS += $(CXXFLAGS_STDCXX)
CFLAGS += $(CFLAGS_STDC)
CPPFLAGS +=
CXXFLAGS += -fPIC
CFLAGS += -fPIC
LDFLAGS +=
LDLIBS += -lm
ARFLAGS := rcs
ifeq ($(CHECKED_ADDRESS),1)
CXXFLAGS += -fsanitize=address
CFLAGS += -fsanitize=address
endif
ifeq ($(CHECKED_UNDEFINED),1)
CXXFLAGS += -fsanitize=undefined
CFLAGS += -fsanitize=undefined
endif
ifeq ($(MODERN),1)
LDFLAGS += -fuse-ld=gold
CXXFLAGS_WARNINGS += -Wpedantic -Wlogical-op -Wframe-larger-than=16000
#CXXFLAGS_WARNINGS += -Wdouble-promotion
CFLAGS_WARNINGS += -Wpedantic -Wlogical-op -Wframe-larger-than=4000
#CFLAGS_WARNINGS += -Wdouble-promotion
LDFLAGS_WARNINGS += -Wl,-no-undefined -Wl,--detect-odr-violations
CXXFLAGS_WARNINGS += -Wsuggest-override
endif
CFLAGS_SILENT += -Wno-unused-parameter -Wno-unused-function -Wno-cast-qual -Wno-old-style-declaration -Wno-type-limits -Wno-unused-but-set-variable
EXESUFFIX=

View File

@ -0,0 +1,24 @@
CC ?= cc
CXX ?= c++
LD ?= c++
AR = ar
CXXFLAGS_STDCXX = -std=c++11
CFLAGS_STDC = -std=c99
CXXFLAGS += $(CXXFLAGS_STDCXX)
CFLAGS += $(CFLAGS_STDC)
CPPFLAGS +=
CXXFLAGS +=
CFLAGS +=
LDFLAGS +=
LDLIBS +=
ARFLAGS := rcs
MPT_COMPILER_GENERIC=1
SHARED_LIB=0
DYNLINK=0
EXESUFFIX=

View File

@ -0,0 +1,2 @@
include config-defaults.mk

View File

@ -0,0 +1,2 @@
include config-defaults.mk

View File

@ -0,0 +1,45 @@
CC = i686-w64-mingw32-gcc$(MINGW_FLAVOUR)
CXX = i686-w64-mingw32-g++$(MINGW_FLAVOUR)
LD = i686-w64-mingw32-g++$(MINGW_FLAVOUR)
AR = i686-w64-mingw32-ar$(MINGW_FLAVOUR)
CXXFLAGS_STDCXX = -std=c++11
CFLAGS_STDC = -std=c99
CXXFLAGS += $(CXXFLAGS_STDCXX)
CFLAGS += $(CFLAGS_STDC)
CPPFLAGS += -DWIN32 -D_WIN32
CXXFLAGS += -municode -mconsole
CFLAGS += -municode -mconsole
LDFLAGS +=
LDLIBS += -lm -lrpcrt4 -lwinmm
ARFLAGS := rcs
CFLAGS_SILENT += -Wno-unused-parameter -Wno-unused-function -Wno-cast-qual -Wno-old-style-declaration -Wno-type-limits -Wno-unused-but-set-variable
EXESUFFIX=.exe
SOSUFFIX=.dll
SOSUFFIXWINDOWS=1
DYNLINK=0
SHARED_LIB=1
STATIC_LIB=0
SHARED_SONAME=0
IS_CROSS=1
NO_ZLIB=1
NO_LTDL=1
NO_DL=1
NO_MPG123=1
NO_OGG=1
NO_VORBIS=1
NO_VORBISFILE=1
NO_PORTAUDIO=1
NO_PORTAUDIOCPP=1
NO_PULSEAUDIO=1
NO_SDL=1
NO_SDL2=1
NO_SNDFILE=1
NO_FLAC=1

View File

@ -0,0 +1,45 @@
CC = x86_64-w64-mingw32-gcc$(MINGW_FLAVOUR)
CXX = x86_64-w64-mingw32-g++$(MINGW_FLAVOUR)
LD = x86_64-w64-mingw32-g++$(MINGW_FLAVOUR)
AR = x86_64-w64-mingw32-ar$(MINGW_FLAVOUR)
CXXFLAGS_STDCXX = -std=c++11
CFLAGS_STDC = -std=c99
CXXFLAGS += $(CXXFLAGS_STDCXX)
CFLAGS += $(CFLAGS_STDC)
CPPFLAGS += -DWIN32 -D_WIN32 -DWIN64 -D_WIN64
CXXFLAGS += -municode -mconsole
CFLAGS += -municode -mconsole
LDFLAGS +=
LDLIBS += -lm -lrpcrt4 -lwinmm
ARFLAGS := rcs
CFLAGS_SILENT += -Wno-unused-parameter -Wno-unused-function -Wno-cast-qual -Wno-old-style-declaration -Wno-type-limits -Wno-unused-but-set-variable
EXESUFFIX=.exe
SOSUFFIX=.dll
SOSUFFIXWINDOWS=1
DYNLINK=0
SHARED_LIB=1
STATIC_LIB=0
SHARED_SONAME=0
IS_CROSS=1
NO_ZLIB=1
NO_LTDL=1
NO_DL=1
NO_MPG123=1
NO_OGG=1
NO_VORBIS=1
NO_VORBISFILE=1
NO_PORTAUDIO=1
NO_PORTAUDIOCPP=1
NO_PULSEAUDIO=1
NO_SDL=1
NO_SDL2=1
NO_SNDFILE=1
NO_FLAC=1

View File

@ -0,0 +1,47 @@
CC = x86_64-w64-mingw32-gcc$(MINGW_FLAVOUR)
CXX = x86_64-w64-mingw32-g++$(MINGW_FLAVOUR)
LD = x86_64-w64-mingw32-g++$(MINGW_FLAVOUR)
AR = x86_64-w64-mingw32-ar$(MINGW_FLAVOUR)
CXXFLAGS_STDCXX = -std=c++11
CFLAGS_STDC = -std=c99
CXXFLAGS += $(CXXFLAGS_STDCXX)
CFLAGS += $(CFLAGS_STDC)
CPPFLAGS += -DWIN32 -D_WIN32 -DWIN64 -D_WIN64 -DWINAPI_FAMILY=0x2 -D_WIN32_WINNT=0x0602
CXXFLAGS += -municode -mconsole
CFLAGS += -municode -mconsole
LDFLAGS +=
LDLIBS += -lm -lole32 -lwinmm
ARFLAGS := rcs
CFLAGS_SILENT += -Wno-unused-parameter -Wno-unused-function -Wno-cast-qual -Wno-old-style-declaration -Wno-type-limits -Wno-unused-but-set-variable
EXESUFFIX=.exe
SOSUFFIX=.dll
SOSUFFIXWINDOWS=1
DYNLINK=0
SHARED_LIB=1
STATIC_LIB=0
SHARED_SONAME=0
IS_CROSS=1
OPENMPT123=0
NO_ZLIB=1
NO_LTDL=1
NO_DL=1
NO_MPG123=1
NO_OGG=1
NO_VORBIS=1
NO_VORBISFILE=1
NO_PORTAUDIO=1
NO_PORTAUDIOCPP=1
NO_PULSEAUDIO=1
NO_SDL=1
NO_SDL2=1
NO_SNDFILE=1
NO_FLAC=1

View File

@ -0,0 +1,47 @@
CC = i686-w64-mingw32-gcc$(MINGW_FLAVOUR)
CXX = i686-w64-mingw32-g++$(MINGW_FLAVOUR)
LD = i686-w64-mingw32-g++$(MINGW_FLAVOUR)
AR = i686-w64-mingw32-ar$(MINGW_FLAVOUR)
CXXFLAGS_STDCXX = -std=c++11
CFLAGS_STDC = -std=c99
CXXFLAGS += $(CXXFLAGS_STDCXX)
CFLAGS += $(CFLAGS_STDC)
CPPFLAGS += -DWIN32 -D_WIN32 -DWINAPI_FAMILY=0x2 -D_WIN32_WINNT=0x0602
CXXFLAGS += -municode -mconsole
CFLAGS += -municode -mconsole
LDFLAGS +=
LDLIBS += -lm -lole32 -lwinmm
ARFLAGS := rcs
CFLAGS_SILENT += -Wno-unused-parameter -Wno-unused-function -Wno-cast-qual -Wno-old-style-declaration -Wno-type-limits -Wno-unused-but-set-variable
EXESUFFIX=.exe
SOSUFFIX=.dll
SOSUFFIXWINDOWS=1
DYNLINK=0
SHARED_LIB=1
STATIC_LIB=0
SHARED_SONAME=0
IS_CROSS=1
OPENMPT123=0
NO_ZLIB=1
NO_LTDL=1
NO_DL=1
NO_MPG123=1
NO_OGG=1
NO_VORBIS=1
NO_VORBISFILE=1
NO_PORTAUDIO=1
NO_PORTAUDIOCPP=1
NO_PULSEAUDIO=1
NO_SDL=1
NO_SDL2=1
NO_SNDFILE=1
NO_FLAC=1

View File

@ -0,0 +1,24 @@
CC ?= cc
CXX ?= c++
LD ?= c++
AR = ar
CXXFLAGS_STDCXX = -std=c++11
CFLAGS_STDC = -std=c99
CXXFLAGS += $(CXXFLAGS_STDCXX)
CFLAGS += $(CFLAGS_STDC)
CPPFLAGS += -DMPT_COMPILER_GENERIC
CXXFLAGS +=
CFLAGS +=
LDFLAGS +=
LDLIBS +=
ARFLAGS := rcs
MPT_COMPILER_GENERIC=1
SHARED_LIB=0
DYNLINK=0
EXESUFFIX=

View File

@ -0,0 +1,9 @@
var Module = {
'preInit': function(text) {
FS.mkdir('/test');
FS.mount(NODEFS, {'root': '../test/'}, '/test');
FS.mkdir('/libopenmpt');
FS.mount(NODEFS, {'root': '../libopenmpt/'}, '/libopenmpt');
}
};

View File

@ -0,0 +1,10 @@
#pragma once
#define OPENMPT_VERSION_SVNVERSION "11626"
#define OPENMPT_VERSION_REVISION 11626
#define OPENMPT_VERSION_DIRTY 0
#define OPENMPT_VERSION_MIXEDREVISIONS 0
#define OPENMPT_VERSION_URL "https://source.openmpt.org/svn/openmpt/tags/libopenmpt-0.4.5"
#define OPENMPT_VERSION_DATE "2019-05-27T06:47:50.022790Z"
#define OPENMPT_VERSION_IS_PACKAGE 1

View File

@ -0,0 +1,14 @@
#pragma once
#define OPENMPT_VERSION_URL "$WCURL$"
#define OPENMPT_VERSION_SVNVERSION "$WCRANGE$$WCMODS?M:$"
#define OPENMPT_VERSION_DATE "$WCDATEUTC=%Y-%m-%dT%H:%M:%S$Z"
#define OPENMPT_VERSION_REVISION $WCREV$
#define OPENMPT_VERSION_DIRTY $WCMODS?1:0$
#define OPENMPT_VERSION_MIXEDREVISIONS $WCMIXED?1:0$
#define OPENMPT_VERSION_IS_PACKAGE 0
#define OPENMPT_BUILD_DATE "$WCNOW=%Y-%m-%d %H:%M:%S$"

View File

@ -0,0 +1,6 @@
@echo off
set INTDIR=%1%
if not exist %INTDIR% mkdir %INTDIR%
if not exist %INTDIR%\svn_version mkdir %INTDIR%\svn_version
subwcrev ..\.. ..\..\build\svn_version\svn_version.template.subwcrev.h %INTDIR%\svn_version\svn_version.h || del %INTDIR%\svn_version\svn_version.h || exit 0
exit 0