我需要设置哪些标志才能将SDL2_mixer与外部库静态链接?

时间:2018-12-19 19:30:38

标签: autotools configure mingw-w64 msys2 sdl-mixer

我很难通过具有本地 mingw-w64 MSYS2 将诸如libFLAC之类的依赖项添加到配置脚本中。根本无法检测到它们。
但是,向添加的--with-sdl-prefix添加路径没有问题。

没有成功,我尝试导出LDFLAGSCPPFLAGS

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

我想知道如何在执行标准make && make install命令之前实现库和标头被实际检测到的结果。


编辑:

通过将LDFLAGSCPPFLAGS修改为:

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"

由于下面的命令

,我能够部分地包含其中一些库
./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

将给我该输出:

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

您可以看到,即使我提供了上述出口,也有一些警告。

0 个答案:

没有答案