Skip to content

Commit

Permalink
[Imp] build: Makefile: Allow building mpg123 as a DLL on Windows.
Browse files Browse the repository at this point in the history
[Mod] build: Makefile: MinGW-w64: Enable ALLOW_LGPL=1 by default.


git-svn-id: https://source.openmpt.org/svn/openmpt/trunk/OpenMPT@22352 56274372-70c3-4bfc-bfc3-4c3a0b034d27
  • Loading branch information
manxorist committed Nov 30, 2024
1 parent f2dccc6 commit 7b602ae
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
55 changes: 55 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -851,6 +851,61 @@ ifeq ($(SHARED_SONAME),1)
$(SILENT)ln -sf $(MPG123_SONAME) bin/$(FLAVOUR_DIR)mpg123$(SOSUFFIX)
endif

else ifeq ($(ENABLE_DLL),1)

CPPFLAGS_MPG123 := -DMPT_WITH_MPG123 -DMPG123_NO_LARGENAME
LDFLAGS_MPG123 :=
LDLIBS_MPG123 :=
CPPFLAGS_MPG123 += -Iinclude/mpg123/src/include/ -Iinclude/mpg123/ports/makefile/
MPG123_SOURCES :=
MPG123_SOURCES += include/mpg123/src/compat/compat.c
MPG123_SOURCES += include/mpg123/src/compat/compat_str.c
MPG123_SOURCES += include/mpg123/src/libmpg123/dct64.c
MPG123_SOURCES += include/mpg123/src/libmpg123/equalizer.c
MPG123_SOURCES += include/mpg123/src/libmpg123/feature.c
MPG123_SOURCES += include/mpg123/src/libmpg123/format.c
MPG123_SOURCES += include/mpg123/src/libmpg123/frame.c
MPG123_SOURCES += include/mpg123/src/libmpg123/icy.c
MPG123_SOURCES += include/mpg123/src/libmpg123/icy2utf8.c
MPG123_SOURCES += include/mpg123/src/libmpg123/id3.c
MPG123_SOURCES += include/mpg123/src/libmpg123/index.c
MPG123_SOURCES += include/mpg123/src/libmpg123/layer1.c
MPG123_SOURCES += include/mpg123/src/libmpg123/layer2.c
MPG123_SOURCES += include/mpg123/src/libmpg123/layer3.c
MPG123_SOURCES += include/mpg123/src/libmpg123/lfs_wrap.c
MPG123_SOURCES += include/mpg123/src/libmpg123/libmpg123.c
MPG123_SOURCES += include/mpg123/src/libmpg123/ntom.c
MPG123_SOURCES += include/mpg123/src/libmpg123/optimize.c
MPG123_SOURCES += include/mpg123/src/libmpg123/parse.c
MPG123_SOURCES += include/mpg123/src/libmpg123/readers.c
MPG123_SOURCES += include/mpg123/src/libmpg123/stringbuf.c
MPG123_SOURCES += include/mpg123/src/libmpg123/synth.c
MPG123_SOURCES += include/mpg123/src/libmpg123/synth_8bit.c
MPG123_SOURCES += include/mpg123/src/libmpg123/synth_real.c
MPG123_SOURCES += include/mpg123/src/libmpg123/synth_s32.c
MPG123_SOURCES += include/mpg123/src/libmpg123/tabinit.c
MPG123_OBJECTS += $(MPG123_SOURCES:.c=.mpg123$(FLAVOUR_O).o)
MPG123_DEPENDS = $(MPG123_OBJECTS:$(FLAVOUR_O).o=$(FLAVOUR_O).d)
ALL_OBJECTS += $(MPG123_OBJECTS)
ALL_DEPENDS += $(MPG123_DEPENDS)
include/mpg123/src/compat/%.mpg123$(FLAVOUR_O).o : CFLAGS+=$(CFLAGS_SILENT) -DOPT_GENERIC
include/mpg123/src/libmpg123/%.mpg123$(FLAVOUR_O).o : CFLAGS+=$(CFLAGS_SILENT) -DOPT_GENERIC
include/mpg123/src/compat/%.mpg123$(FLAVOUR_O).o : CPPFLAGS:= -Iinclude/mpg123/src/include/ -Iinclude/mpg123/ports/makefile/ $(CPPFLAGS)
include/mpg123/src/libmpg123/%.mpg123$(FLAVOUR_O).o : CPPFLAGS:= -Iinclude/mpg123/src/include/ -Iinclude/mpg123/ports/makefile/ $(CPPFLAGS)
LIBS_MPG123 = bin/$(FLAVOUR_DIR)mpg123$(SOSUFFIX)

bin/$(FLAVOUR_DIR)mpg123$(SOSUFFIX): $(MPG123_OBJECTS)
$(INFO) [LD] $@
ifeq ($(NO_SHARED_LINKER_FLAG),1)
$(SILENT)$(LINK.cc) -shared $(MPG123_LDFLAGS) $(SO_LDFLAGS) $^ -o $@
else
$(SILENT)$(LINK.cc) -shared $(MPG123_LDFLAGS) $(SO_LDFLAGS) $^ -o $@
endif
ifeq ($(SHARED_SONAME),1)
$(SILENT)mv bin/$(FLAVOUR_DIR)mpg123$(SOSUFFIX) bin/$(FLAVOUR_DIR)$(MPG123_SONAME)
$(SILENT)ln -sf $(MPG123_SONAME) bin/$(FLAVOUR_DIR)mpg123$(SOSUFFIX)
endif

else

CPPFLAGS_MPG123 := -DMPT_WITH_MPG123 -DMPG123_NO_LARGENAME
Expand Down
4 changes: 4 additions & 0 deletions build/make/config-mingw-w64.mk
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,15 @@ EXESUFFIX=.exe
SOSUFFIX=.dll
SOSUFFIXWINDOWS=1

ALLOW_LGPL=1

DYNLINK=0
SHARED_LIB=1
STATIC_LIB=0
SHARED_SONAME=0

ENABLE_DLL=1

ifeq ($(HOST_FLAVOUR),MSYS2)

else
Expand Down

0 comments on commit 7b602ae

Please sign in to comment.