Commit 4fa18c56 authored by Mans Rullgard's avatar Mans Rullgard

configure: use pkg-config helpers

This makes existing pkg-config uses as well as the libsdl checks
use the new pkg-config helper functions, which should be more
robust against broken systems.
Signed-off-by: 's avatarMans Rullgard <mans@mansr.com>
parent 3f8040db
...@@ -2849,22 +2849,19 @@ check_mathfunc truncf ...@@ -2849,22 +2849,19 @@ check_mathfunc truncf
# these are off by default, so fail if requested and not available # these are off by default, so fail if requested and not available
enabled avisynth && require2 vfw32 "windows.h vfw.h" AVIFileInit -lavifil32 enabled avisynth && require2 vfw32 "windows.h vfw.h" AVIFileInit -lavifil32
enabled frei0r && { check_header frei0r.h || die "ERROR: frei0r.h header not found"; } enabled frei0r && { check_header frei0r.h || die "ERROR: frei0r.h header not found"; }
enabled libdirac && add_cflags $(pkg-config --cflags dirac) && enabled libdirac && require_pkg_config dirac \
require libdirac libdirac_decoder/dirac_parser.h dirac_decoder_init $(pkg-config --libs dirac) && "libdirac_decoder/dirac_parser.h libdirac_encoder/dirac_encoder.h" \
require libdirac libdirac_encoder/dirac_encoder.h dirac_encoder_init $(pkg-config --libs dirac) "dirac_decoder_init dirac_encoder_init"
enabled libfaac && require2 libfaac "stdint.h faac.h" faacEncGetVersion -lfaac enabled libfaac && require2 libfaac "stdint.h faac.h" faacEncGetVersion -lfaac
enabled libgsm && require libgsm gsm/gsm.h gsm_create -lgsm enabled libgsm && require libgsm gsm/gsm.h gsm_create -lgsm
enabled libmp3lame && require "libmp3lame >= 3.98.3" lame/lame.h lame_set_VBR_quality -lmp3lame enabled libmp3lame && require "libmp3lame >= 3.98.3" lame/lame.h lame_set_VBR_quality -lmp3lame
enabled libnut && require libnut libnut.h nut_demuxer_init -lnut enabled libnut && require libnut libnut.h nut_demuxer_init -lnut
enabled libopencore_amrnb && require libopencore_amrnb opencore-amrnb/interf_dec.h Decoder_Interface_init -lopencore-amrnb enabled libopencore_amrnb && require libopencore_amrnb opencore-amrnb/interf_dec.h Decoder_Interface_init -lopencore-amrnb
enabled libopencore_amrwb && require libopencore_amrwb opencore-amrwb/dec_if.h D_IF_init -lopencore-amrwb enabled libopencore_amrwb && require libopencore_amrwb opencore-amrwb/dec_if.h D_IF_init -lopencore-amrwb
enabled libopencv && { check_lib opencv/cv.h cvCreateImageHeader $(pkg-config --libs opencv) || enabled libopencv && require_pkg_config opencv opencv/cv.h cvCreateImageHeader
die "ERROR: libopencv not found"; }
enabled libopenjpeg && require libopenjpeg openjpeg.h opj_version -lopenjpeg enabled libopenjpeg && require libopenjpeg openjpeg.h opj_version -lopenjpeg
enabled librtmp && { check_lib librtmp/rtmp.h RTMP_Socket $(pkg-config --libs librtmp) || enabled librtmp && require_pkg_config librtmp librtmp/rtmp.h RTMP_Socket
die "ERROR: librtmp not found or RTMP_Socket() missing, librtmp version must be >= 2.2.f"; } enabled libschroedinger && require_pkg_config schroedinger-1.0 schroedinger/schro.h schro_init
enabled libschroedinger && add_cflags $(pkg-config --cflags schroedinger-1.0) &&
require libschroedinger schroedinger/schro.h schro_init $(pkg-config --libs schroedinger-1.0)
enabled libspeex && require libspeex speex/speex.h speex_decoder_init -lspeex enabled libspeex && require libspeex speex/speex.h speex_decoder_init -lspeex
enabled libtheora && require libtheora theora/theoraenc.h th_info_init -ltheoraenc -ltheoradec -logg enabled libtheora && require libtheora theora/theoraenc.h th_info_init -ltheoraenc -ltheoradec -logg
enabled libvorbis && require libvorbis vorbis/vorbisenc.h vorbis_info_init -lvorbisenc -lvorbis -logg enabled libvorbis && require libvorbis vorbis/vorbisenc.h vorbis_info_init -lvorbisenc -lvorbis -logg
...@@ -2889,11 +2886,7 @@ if enabled libdc1394; then ...@@ -2889,11 +2886,7 @@ if enabled libdc1394; then
die "ERROR: No version of libdc1394 found " die "ERROR: No version of libdc1394 found "
fi fi
SDL_CONFIG="${cross_prefix}sdl-config" if check_pkg_config sdl SDL.h SDL_Init; then
if "${SDL_CONFIG}" --version > /dev/null 2>&1; then
sdl_cflags=$("${SDL_CONFIG}" --cflags)
sdl_libs=$("${SDL_CONFIG}" --libs)
check_func_headers SDL.h SDL_Init $sdl_cflags $sdl_libs &&
check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x010201" $sdl_cflags && check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x010201" $sdl_cflags &&
enable sdl && enable sdl &&
check_struct SDL.h SDL_VideoInfo current_w $sdl_cflags && enable sdl_video_size check_struct SDL.h SDL_VideoInfo current_w $sdl_cflags && enable sdl_video_size
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment