summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsamelian <samelian@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-10-05 21:53:35 +0000
committersamelian <samelian@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-10-05 21:53:35 +0000
commit38a9ae9da63b668104cb1f486d8a1c01243cfcc1 (patch)
tree0684934a36c36611c14aa4a0c411a02881aaa3a7
parent36bb41f5bea5485f7c47dd18f47fc6177a370270 (diff)
downloadarts-38a9ae9da63b668104cb1f486d8a1c01243cfcc1.tar.gz
arts-38a9ae9da63b668104cb1f486d8a1c01243cfcc1.zip
[dependencies/arts] GSL_HAVE_OGGVORBIS_RC3 and GSL_HAVE_MUTEXATTR_SETTYPE tests have been embedded into CMakeLists.txt
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/dependencies/arts@1182888 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
-rw-r--r--flow/gsl/CMakeLists.txt44
1 files changed, 31 insertions, 13 deletions
diff --git a/flow/gsl/CMakeLists.txt b/flow/gsl/CMakeLists.txt
index 36ee59c..7c880ee 100644
--- a/flow/gsl/CMakeLists.txt
+++ b/flow/gsl/CMakeLists.txt
@@ -9,6 +9,9 @@
#
#################################################
+include( CheckCSourceCompiles )
+
+
##### check for ogg/vorbis ######################
set( GSL_HAVE_OGGVORBIS 0 )
@@ -24,12 +27,17 @@ if( WITH_VORBIS )
set( GSL_HAVE_OGGVORBIS 1 )
- try_compile(
- GSL_HAVE_OGGVORBIS_RC3
- ${CMAKE_CURRENT_BINARY_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/check_for_ov_read_float.c
- CMAKE_FLAGS "-DLINK_LIBRARIES=${VORBISFILE_LIBRARIES}"
- )
+ set( bak_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} )
+ set( CMAKE_REQUIRED_LIBRARIES ${VORBISFILE_LIBRARIES} )
+ check_c_source_compiles(
+ "#include <vorbis/vorbisfile.h>
+ int main() { ov_read_float(0,0,0); return 0; } "
+ GSL_HAVE_OGGVORBIS_RC3 )
+ if( NOT GSL_HAVE_OGGVORBIS_RC3 )
+ set( GSL_HAVE_OGGVORBIS_RC3 0 )
+ endif( NOT GSL_HAVE_OGGVORBIS_RC3 )
+ set( CMAKE_REQUIRED_LIBRARIES ${bak_CMAKE_REQUIRED_LIBRARIES} )
+
else( VORBISFILE_FOUND )
message(FATAL_ERROR "\nOgg/Vorbis support are requested, but `libvorbisfile` not found" )
@@ -69,12 +77,22 @@ check_type_size( pthread_mutex_t GSL_SIZEOF_PTH_MUTEX_T )
check_type_size( pthread_cond_t GSL_SIZEOF_PTH_COND_T )
check_type_size( intmax_t GSL_SIZEOF_STD_INTMAX_T )
-try_compile(
- GSL_HAVE_MUTEXATTR_SETTYPE
- ${CMAKE_CURRENT_BINARY_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/check_for_pthread_mutexattr_settype.c
- CMAKE_FLAGS "-DLINK_LIBRARIES=${CMAKE_THREAD_LIBS_INIT}"
-)
+set( bak_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} )
+set( CMAKE_REQUIRED_LIBRARIES ${CMAKE_THREAD_LIBS_INIT} )
+check_c_source_compiles(
+ "#define _XOPEN_SOURCE 500
+ #include <pthread.h>
+ int main()
+ {
+ int (*attr_settype) (pthread_mutexattr_t *__attr, int __kind) = pthread_mutexattr_settype;
+ int val = PTHREAD_MUTEX_RECURSIVE; attr_settype = 0; val = 0;
+ return 0;
+ }"
+ GSL_HAVE_MUTEXATTR_SETTYPE )
+ if( NOT GSL_HAVE_MUTEXATTR_SETTYPE )
+ set( GSL_HAVE_MUTEXATTR_SETTYPE 0 )
+ endif( NOT GSL_HAVE_MUTEXATTR_SETTYPE )
+set( CMAKE_REQUIRED_LIBRARIES ${bak_CMAKE_REQUIRED_LIBRARIES} )
set( GSL_USE_GSL_GLIB 1 )
set( GSL_USE_ARTS_THREADS 1 )
@@ -82,7 +100,7 @@ set( GSL_USE_ARTS_THREADS 1 )
##### write configuration #######################
-configure_file( gslconfig.h.in gslconfig.h )
+configure_file( gslconfig.h.in gslconfig.h @ONLY )
##### compile ###################################