我需要设置哪些标志才能将libwebp-1.0.0与所提供的外部库静态链接?

时间:2018-12-20 06:04:29

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

我很难通过 MSYS2将--with-sdlincludedir--with-sdllibdir--with-pngincludedir--with-pnglibdir标志传递给配置脚本 和本地 mingw-w64 。根本无法检测到它们。
但是,将路径添加到 SDL2_image 所需的剩余 configure脚本标志中没有问题。

以下命令

./configure --prefix=/c/Users/Test/Desktop/libwebp-1.0.0 --with- 
sdlincludedir=/c/Users/Test/Desktop/SDL2-static/include --with- 
sdllibdir=/c/Users/Test/Desktop/SDL2-static/lib --with- 
pngincludedir=/c/Users/Test/Desktop/libpng-1.6.32/include --with- 
pnglibdir=/c/Users/Test/Desktop/libpng-1.6.32/lib --with- 
jpegincludedir=/c/Users/Test/Desktop/jpeg-9b/include --with- 
jpeglibdir=/c/Users/Test/Desktop/jpeg-9b/lib --with- 
tiffincludedir=/c/Users/Test/Desktop/tiff-4.0.8/include --with- 
tifflibdir=/c/Users/Test/Desktop/tiff-4.0.8/lib --disable-shared --enable- 
dependency-tracking

将给我该输出:

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 a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports the include directive... yes (GNU style)
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 whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking for ar... ar
checking the archiver (ar) interface... ar
checking how to print strings... printf
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 how to convert x86_64-w64-mingw32 file names to x86_64-w64-mingw32 format... func_convert_file_msys_to_w32
checking how to convert x86_64-w64-mingw32 file names to toolchain format... func_convert_file_msys_to_w32
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... file_magic ^x86 archive import|^x86 DLL
checking for dlltool... dlltool
checking how to associate runtime and link libraries... func_cygming_dll_for_implib
checking for archiver @FILE support... @
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 for sysroot... no
checking for a working dd... /usr/bin/dd
checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1
checking for mt... no
checking if : is a manifest tool... no
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 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 a sed that does not truncate output... (cached) /usr/bin/sed
checking whether make supports nested variables... (cached) yes
checking whether byte ordering is bigendian... no
checking whether asserts are enabled... no
checking whether gcc supports -fvisibility=hidden... yes
checking whether gcc supports -Wall... yes
checking whether gcc supports -Wconstant-conversion... no
checking whether gcc supports -Wdeclaration-after-statement... yes
checking whether gcc supports -Wextra... yes
checking whether gcc supports -Wfloat-conversion... yes
checking whether gcc supports -Wformat -Wformat-nonliteral... yes
checking whether gcc supports -Wformat -Wformat-security... yes
checking whether gcc supports -Wmissing-declarations... yes
checking whether gcc supports -Wmissing-prototypes... yes
checking whether gcc supports -Wold-style-definition... yes
checking whether gcc supports -Wparentheses-equality... no
checking whether gcc supports -Wshadow... yes
checking whether gcc supports -Wshorten-64-to-32... no
checking whether gcc supports -Wundef... yes
checking whether gcc supports -Wunreachable-code... yes
checking whether gcc supports -Wunused-but-set-variable... yes
checking whether gcc supports -Wunused... yes
checking whether gcc supports -Wvla... yes
checking whether gcc supports -mavx2... yes
checking for immintrin.h... yes
checking whether gcc supports -msse4.1... yes
checking smmintrin.h usability... yes
checking smmintrin.h presence... yes
checking for smmintrin.h... yes
checking whether gcc supports -msse2... yes
checking emmintrin.h usability... yes
checking emmintrin.h presence... yes
checking for emmintrin.h... yes
checking for __builtin_bswap16... yes
checking for __builtin_bswap32... yes
checking for __builtin_bswap64... yes
configure: checking for threading support...
checking if compiler needs -Werror to reject unknown flags... no
checking for the pthreads library -lpthreads... no
checking whether pthreads work without any flags... yes
checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE
checking if more special flags are required for pthreads... no
checking for PTHREAD_PRIO_INHERIT... yes
configure: checking if threading is enabled... yes
checking GL/glut.h usability... no
checking GL/glut.h presence... no
checking for GL/glut.h... no
checking GLUT/glut.h usability... no
checking GLUT/glut.h presence... no
checking for GLUT/glut.h... no
checking OpenGL/glut.h usability... no
checking OpenGL/glut.h presence... no
checking for OpenGL/glut.h... no
checking for sdl-config... no
checking SDL/SDL.h usability... no
checking SDL/SDL.h presence... no
checking for SDL/SDL.h... no
checking SDL.h usability... no
checking SDL.h presence... no
checking for SDL.h... no
configure: WARNING: SDL library not available - no sdl.h
configure: WARNING: Optional SDL library not found
checking for libpng-config... no
checking for libpng16-config... no
checking for libpng15-config... no
checking for libpng14-config... no
checking for libpng12-config... no
checking png.h usability... yes
checking png.h presence... yes
checking for png.h... yes
checking for library containing png_get_libpng_ver... no
configure: WARNING: Optional png library not found
checking jpeglib.h usability... yes
checking jpeglib.h presence... yes
checking for jpeglib.h... yes
checking for jpeg_set_defaults in -ljpeg... yes
checking tiffio.h usability... yes
checking tiffio.h presence... yes
checking for tiffio.h... yes
checking for TIFFGetVersion in -ltiff... yes
checking gif_lib.h usability... no
checking gif_lib.h presence... no
checking for gif_lib.h... no
configure: WARNING: gif library not available - no gif_lib.h
checking wincodec.h usability... yes
checking wincodec.h presence... yes
checking for wincodec.h... yes
checking shlwapi.h usability... yes
checking shlwapi.h presence... yes
checking for shlwapi.h... yes
checking windows.h usability... yes
checking windows.h presence... yes
checking for windows.h... yes
checking for Windows Imaging Component support... yes
checking if --enable-swap-16bit-csp option is specified... no
checking if --disable-near-lossless option is specified... no
checking whether libwebpmux is to be built... no
checking whether libwebpdemux is to be built... yes
checking whether decoder library is to be built... no
checking whether libwebpextras is to be built... no
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating man/Makefile
config.status: creating examples/Makefile
config.status: creating extras/Makefile
config.status: creating imageio/Makefile
config.status: creating src/dec/Makefile
config.status: creating src/enc/Makefile
config.status: creating src/dsp/Makefile
config.status: creating src/demux/Makefile
config.status: creating src/mux/Makefile
config.status: creating src/utils/Makefile
config.status: creating src/libwebp.pc
config.status: creating src/libwebpdecoder.pc
config.status: creating src/demux/libwebpdemux.pc
config.status: creating src/mux/libwebpmux.pc
config.status: creating src/webp/config.h
config.status: executing depfiles commands
config.status: executing libtool commands
configure:
WebP Configuration Summary
--------------------------

Shared libraries: no
Static libraries: yes
Threading support: yes
libwebp: yes
libwebpdecoder: no
libwebpdemux: yes
libwebpmux: no
libwebpextras: no

Tools:
cwebp : yes
  Input format support
  ====================
  JPEG : yes
  PNG  : no
  TIFF : yes
  WIC  : yes
dwebp : yes
  Output format support
  =====================
  PNG  : no
  WIC  : yes
GIF support : no
anim_diff   : no
gif2webp    : no
img2webp    : no
webpmux     : no
vwebp       : no
webpinfo    : no
SDL support : no
vwebp_sdl   : no

您可以看到,即使我提供了 configure的路径,也没有将 PNG SDL 支持设置为。脚本

1 个答案:

答案 0 :(得分:0)

export CPPFLAGS="-I/c/Users/Test/Desktop/jpeg-9b/include -I/c/Users/Test/Desktop/tiff-4.0.8/include"
export LDFLAGS="-L/c/Users/Test/Desktop/jpeg-9b/lib -L/c/Users/Test/Desktop/tiff-4.0.8/lib"
export LIBPNG_CONFIG="/c/Users/Test/Desktop/libpng-1.6.32/bin/libpng16-config --static"
export LIBSDL_CONFIG="/c/Users/Test/Desktop/SDL2-static/bin/sdl2-config"
  

由于某种原因,在上一次导出的末尾添加--static-libs会导致错误。

然后:

./configure --prefix=/c/Users/Test/Desktop/libwebp-1.0.0 --disable-shared