Skip to content
Permalink
Browse files

Added configure and cmake support for libsamplerate

  • Loading branch information
slouken committed Jan 7, 2017
1 parent c5825b6 commit df25258a1ec354fc7eb4681773d02b79a371f623
Showing with 294 additions and 179 deletions.
  1. +5 −2 CMakeLists.txt
  2. +23 −0 cmake/sdlchecks.cmake
  3. +170 −117 configure
  4. +82 −53 configure.in
  5. +3 −0 include/SDL_config.h.cmake
  6. +4 −0 include/SDL_config.h.in
  7. +7 −7 src/audio/SDL_audiocvt.c
@@ -267,8 +267,6 @@ set_option(DISKAUDIO "Support the disk writer audio driver" ON)
set_option(DUMMYAUDIO "Support the dummy audio driver" ON)
set_option(VIDEO_DIRECTFB "Use DirectFB video driver" OFF)
dep_option(DIRECTFB_SHARED "Dynamically load directfb support" ON "VIDEO_DIRECTFB" OFF)
set_option(FUSIONSOUND "Use FusionSound audio driver" OFF)
dep_option(FUSIONSOUND_SHARED "Dynamically load fusionsound audio support" ON "FUSIONSOUND" OFF)
set_option(VIDEO_DUMMY "Use dummy video driver" ON)
set_option(VIDEO_OPENGL "Include OpenGL support" ON)
set_option(VIDEO_OPENGLES "Include OpenGL ES support" ON)
@@ -287,6 +285,10 @@ dep_option(ARTS_SHARED "Dynamically load aRts audio support" ON "ARTS" O
set_option(NAS "Support the NAS audio API" ${UNIX_SYS})
set_option(NAS_SHARED "Dynamically load NAS audio API" ${UNIX_SYS})
set_option(SNDIO "Support the sndio audio API" ${UNIX_SYS})
set_option(FUSIONSOUND "Use FusionSound audio driver" OFF)
dep_option(FUSIONSOUND_SHARED "Dynamically load fusionsound audio support" ON "FUSIONSOUND" OFF)
set_option(LIBSAMPLERATE "Use libsamplerate for audio rate conversion" ${UNIX_SYS})
dep_option(LIBSAMPLERATE_SHARED "Dynamically load libsamplerate" ON "LIBSAMPLERATE" OFF)
set_option(RPATH "Use an rpath when linking SDL" ${UNIX_SYS})
set_option(CLOCK_GETTIME "Use clock_gettime() instead of gettimeofday()" OFF)
set_option(INPUT_TSLIB "Use the Touchscreen library for input" ${UNIX_SYS})
@@ -847,6 +849,7 @@ elseif(UNIX AND NOT APPLE)
CheckNAS()
CheckSNDIO()
CheckFusionSound()
CheckLibSampleRate()
endif()

if(SDL_VIDEO)
@@ -315,6 +315,29 @@ macro(CheckFusionSound)
endif()
endmacro()

# Requires:
# - LIBSAMPLERATE
# Optional:
# - LIBSAMPLERATE_SHARED opt
# - HAVE_DLOPEN opt
macro(CheckLibSampleRate)
if(LIBSAMPLERATE)
check_include_file(samplerate.h HAVE_LIBSAMPLERATE_H)
if(HAVE_LIBSAMPLERATE_H)
if(LIBSAMPLERATE_SHARED)
if(NOT HAVE_DLOPEN)
message_warn("You must have SDL_LoadObject() support for dynamic libsamplerate loading")
else()
FindLibraryAndSONAME("samplerate")
set(SDL_LIBSAMPLERATE_DYNAMIC "\"${SAMPLERATE_LIB_SONAME}\"")
endif()
else()
list(APPEND EXTRA_LDFLAGS -lsamplerate)
endif()
endif()
endif()
endmacro()

# Requires:
# - n/a
# Optional:

0 comments on commit df25258

Please sign in to comment.