diff options
Diffstat (limited to 'ConfigureChecks.cmake')
-rw-r--r-- | ConfigureChecks.cmake | 86 |
1 files changed, 26 insertions, 60 deletions
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index eb8a0de2..76156fec 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -15,52 +15,28 @@ test_big_endian(WORDS_BIGENDIAN) tde_setup_largefiles( ) -if( NOT CMAKE_ARCHITECTURE ) - execute_process( - COMMAND ${CMAKE_C_COMPILER} -dumpmachine - OUTPUT_VARIABLE CMAKE_ARCHITECTURE - ERROR_VARIABLE CMAKE_ARCHITECTURE - OUTPUT_STRIP_TRAILING_WHITESPACE - ERROR_STRIP_TRAILING_WHITESPACE ) - set( CMAKE_ARCHITECTURE "${CMAKE_ARCHITECTURE}" CACHE INTERNAL "" FORCE ) - message( STATUS "Detected ${CMAKE_ARCHITECTURE} target architecture" ) -endif( NOT CMAKE_ARCHITECTURE ) - -if( ${CMAKE_ARCHITECTURE} MATCHES "i.86" ) - if( NOT ASM_COMPILER_VERSION ) - message( STATUS "Checking binutils version" ) - execute_process( - COMMAND echo - COMMAND as -v - OUTPUT_VARIABLE ASM_VERSION - ERROR_VARIABLE ASM_VERSION - ) - string(REGEX REPLACE ".*version ([0-9][^ \n]*).*" "\\1" ASM_COMPILER_VERSION ${ASM_VERSION} ) - set( ASM_COMPILER_VERSION "${ASM_COMPILER_VERSION}" CACHE INTERNAL "" FORCE ) - message( STATUS "Checking binutils version - ${ASM_COMPILER_VERSION}" ) - endif( NOT ASM_COMPILER_VERSION ) - - if( NOT MMX_SUPPORT ) - message( STATUS "Performing test MMX_SUPPORT" ) - if( ${ASM_COMPILER_VERSION} VERSION_LESS "2.10" ) - message( STATUS "Performing test MMX_SUPPORT - Failed" ) - else( ) - message( STATUS "Performing test MMX_SUPPORT - Success" ) - set( MMX_SUPPORT 1 CACHE INTERNAL "" FORCE ) - endif( ) - endif( NOT MMX_SUPPORT ) - - check_c_source_compiles( " - int main() { - #if defined(__GNUC__) && defined(__i386__) - __asm__(\"movups %xmm0, (%esp)\"); - #else - #error Not gcc on x86 - #endif - return 0; }" - HAVE_X86_SSE - ) -endif( ${CMAKE_ARCHITECTURE} MATCHES "i.86" ) + +##### check specific architecture dependant support + +if( CMAKE_SYSTEM_PROCESSOR MATCHES "i.86" ) + + # MMX support + message( STATUS "Performing MMX support test" ) + cmake_host_system_information( RESULT HAVE_X86_MMX QUERY HAS_MMX ) + if( HAVE_X86_MMX ) + message( STATUS "Performing MMX support test - Success" ) + set( CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} -DHAVE_X86_MMX" ) + endif( ) + + # SSE support + message( STATUS "Performing SSE support test" ) + cmake_host_system_information( RESULT HAVE_X86_SSE QUERY HAS_SSE ) + if( HAVE_X86_SSE ) + message( STATUS "Performing SSE support test - Success" ) + set( CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} -DHAVE_X86_SSE" ) + endif( ) + +endif( ) message( STATUS "Cheking system type - ${CMAKE_SYSTEM_NAME}" ) if( ${CMAKE_SYSTEM_NAME} MATCHES "AIX" ) @@ -97,19 +73,6 @@ check_include_file( sys/soundcard.h HAVE_SYS_SOUNDCARD_H ) check_include_file( machine/soundcard.h HAVE_MACHINE_SOUNDCARD_H ) -##### check libraries ########################### - -set( DL_LIBRARIES dl ) -check_library_exists( ${DL_LIBRARIES} dlopen /lib HAVE_LIBDL ) -if( NOT HAVE_LIBDL ) - unset( DL_LIBRARIES ) - check_function_exists( dlopen HAVE_DLOPEN ) - if( HAVE_DLOPEN ) - set( HAVE_LIBDL 1 ) - endif( HAVE_DLOPEN ) -endif( NOT HAVE_LIBDL ) - - # ALSA if( WITH_ALSA ) pkg_check_modules( ALSA alsa>=0.5 ) @@ -228,7 +191,10 @@ endif( WITH_CDPARANOIA ) if( WITH_FLAC ) pkg_search_module( FLAC flac ) if( NOT FLAC_FOUND ) - tde_message_fatal( "FLAC is requested, but not found on your system" ) + find_library( FLAC_LIBRARIES NAMES FLAC FLAC++ OggFLAC OggFLAC++) + if( NOT FLAC_LIBRARIES ) + tde_message_fatal( "FLAC is requested, but not found on your system" ) + endif( ) endif( ) set( HAVE_LIBFLAC 1 ) endif( WITH_FLAC ) |