1

I have difficulties with adding dependencies like libFLAC to the configure script via MSYS2 with native mingw-w64. They are simply not detected.
However, I have no problem with adding a path to the provided --with-sdl-prefix.

With no success I tried to export LDFLAGS and CPPFLAGS.

export LDFLAGS="-L/c/Users/Test/Desktop/flac-1.3.2/lib"
export CPPFLAGS="-I/c/Users/Test/Desktop/flac-1.3.2/include"

I want to know how to achieve the result of libraries and headers being actually detected before I execute the standard make && make install commands.


Edit:

By modifying LDFLAGS and CPPFLAGS to:

export LDFLAGS="-L/c/Users/Test/Desktop/flac-1.3.2/lib - 
L/c/Users/Test/Desktop/libmodplug-0.8.9.0/lib -L/c/Users/Test/Desktop/libogg- 
1.3.2/lib -L/c/Users/Test/Desktop/libvorbis-1.3.5/lib - 
L/c/Users/Test/Desktop/mpg123-1.25.6/lib -L/c/Users/Test/Desktop/opus-1.0.3/lib 
-L/c/Users/Test/Desktop/opusfile-0.10/lib"

export CPPFLAGS="-I/c/Users/Test/Desktop/flac-1.3.2/include - 
I/c/Users/Test/Desktop/libmodplug-0.8.9.0/include - 
I/c/Users/Test/Desktop/libogg-1.3.2/include -I/c/Users/Test/Desktop/libvorbis- 
1.3.5/include -I/c/Users/Test/Desktop/mpg123-1.25.6/include - 
I/c/Users/Test/Desktop/opus-1.0.3/include -I/c/Users/Test/Desktop/opusfile- 
0.10/include"

I was partially able to include some of those libraries because the following command

./configure --prefix=/c/Users/Test/Desktop/SDL2_mixer-static --disable-music- 
flac-shared --disable-music-mod-modplug-shared --disable-music-ogg-shared -- 
disable-music-mp3-mpg123-shared --disable-music-opus-shared --disable-music- 
mod-mikmod-shared --disable-shared --with-sdl- 
prefix=/c/Users/Test/Desktop/SDL2-static

would give me that output:

configure: loading site script /mingw64/etc/config.site
checking build system type... x86_64-w64-mingw32
checking host system type... x86_64-w64-mingw32
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.exe
checking for suffix of executables... .exe
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... C:/mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/x86_64-w64-mingw32/bin/ld.exe
checking if the linker (C:/mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/x86_64-w64-mingw32/bin/ld.exe) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /c/mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/bin/nm -B
checking the name lister (/c/mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/bin/nm -B) interface... BSD nm
checking whether ln -s works... no, using cp -pR
checking the maximum length of command line arguments... 8192
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking for C:/mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/x86_64-w64-mingw32/bin/ld.exe option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for ar... ar
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /c/mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/bin/nm -B output from gcc object... ok
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... no
checking for as... as
checking for dlltool... dlltool
checking for objdump... (cached) objdump
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -DDLL_EXPORT -DPIC
checking if gcc PIC flag -DDLL_EXPORT -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (C:/mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/x86_64-w64-mingw32/bin/ld.exe) supports shared libraries... yes
checking dynamic linker characteristics... Win32 ld.exe
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... no
checking whether to build static libraries... yes
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking for a BSD-compatible install... /usr/bin/install -c
checking whether make sets $(MAKE)... yes
checking for windres... windres
checking for an ANSI C-conforming const... yes
checking for GCC -MMD -MT option... yes
checking for pkg-config... /mingw64/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for sdl2-config... /c/Users/Test/Desktop/SDL2-static/bin/sdl2-config
checking for SDL - version >= 2.0.7... yes
checking for pow in -lm... yes
checking signal.h usability... yes
checking signal.h presence... yes
checking for signal.h... yes
checking for setbuf... yes
checking for GCC -fvisibility=hidden option... yes
checking for fork... no
checking for vfork... no
checking for MODPLUG... no
checking libmodplug/modplug.h usability... yes
checking libmodplug/modplug.h presence... yes
checking for libmodplug/modplug.h... yes
checking for ModPlug_Load in -lmodplug... no
configure: WARNING: *** Unable to find ModPlug library (http://modplug-xmms.sourceforge.net/)
configure: WARNING: MOD support disabled
checking fluidsynth.h usability... no
checking fluidsynth.h presence... no
checking for fluidsynth.h... no
checking for fluid_player_add_mem in -lfluidsynth... no
configure: WARNING: *** Unable to find FluidSynth library (http://www.fluidsynth.org/)
configure: WARNING: FluidSynth support disabled
checking vorbis/vorbisfile.h usability... yes
checking vorbis/vorbisfile.h presence... yes
checking for vorbis/vorbisfile.h... yes
checking for ov_open_callbacks in -lvorbisfile... yes
checking FLAC/export.h usability... yes
checking FLAC/export.h presence... yes
checking for FLAC/export.h... yes
checking for libflac so-name version >= 8... yes
checking FLAC/stream_decoder.h usability... yes
checking FLAC/stream_decoder.h presence... yes
checking for FLAC/stream_decoder.h... yes
checking for FLAC__stream_decoder_new in -lFLAC... yes
checking mpg123.h usability... yes
checking mpg123.h presence... yes
checking for mpg123.h... yes
checking for mpg123_replace_reader_handle in -lmpg123... no
configure: WARNING: *** Unable to find mpg123 library (https://www.mpg123.de)
configure: WARNING: mpg123 support disabled
configure: WARNING: MP3 support disabled
checking for OPUSFILE... no
checking opus/opusfile.h usability... no
checking opus/opusfile.h presence... no
checking for opus/opusfile.h... no
checking for op_open_callbacks in -lopusfile... yes
configure: WARNING: *** Unable to find opusfile library (http://opus-codec.org/)
configure: creating ./config.status
config.status: executing libtool commands
configure: creating ./config.status
config.status: creating Makefile
config.status: creating SDL2_mixer.spec
config.status: creating SDL2_mixer.pc
config.status: executing libtool commands
config.status: executing default commands

As you can see there are some warnings even though I provided the above exports.

  • Specifying build flags via `configure`'s environment is a supported mechanism, and it should carry through to the `make` step. Your particular variable definitions appear to have the correct form, though I can't evaluate whether they are actually right for your system, or whether the contents of the designated directories are appropriate for building SDL2_mixer. – John Bollinger Dec 19 '18 at 21:02
  • It might be helpful to know in more detail what you tried, and in just what ways the results differed from what you're looking for. – John Bollinger Dec 19 '18 at 21:03
  • The `configure` script will have written a log file that provides considerable detail about the tests it performed and their results. This is sometimes useful for identifying the nature of any problems it encounters, as that is not always well conveyed by the diagnostics emitted to the console. – John Bollinger Dec 20 '18 at 14:33
  • Also, I find it suspicious that you're referencing a bunch of per-library include and lib folders. It looks like these may have been built but not installed. I would recommend installing them before trying to use them, even if you install to some (common) non-default location. As a bonus, that ought to make the needed options much shorter and simpler. – John Bollinger Dec 20 '18 at 14:35
  • If by *install* you mean `--prefix` and `make && make install` then yes I did that personally for each library. And for simplicity sake I *installed* them on *Desktop* so each *pkgconfig* etc. file should be set correctly and the output of the *configure script* you can see above. –  Dec 20 '18 at 19:38
  • By "install" I mean specifically `make install`. *Where* you install each package is your own affair, though I do recommend somewhere other than their respective source trees. It's unclear to me whether you're already meeting that recommendation. In any case, the installed locations are where you should be pointing other packages for their dependencies. – John Bollinger Dec 20 '18 at 19:48

0 Answers0