llvm.org GIT mirror llvm / de8aed2
Add a configure check for pthread_rwlock_init. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73523 91177308-0d34-0410-b5e6-96231b3b80d8 Owen Anderson 11 years ago
3 changed file(s) with 109 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
795795 AC_SEARCH_LIBS(pthread_mutex_lock,pthread,
796796 AC_DEFINE([HAVE_PTHREAD_MUTEX_LOCK],[1],
797797 [Have pthread_mutex_lock]))
798 AC_SEARCH_LIBS(pthread_rwlock_init,pthread,
799 AC_DEFINE([HAVE_PTHREAD_RWLOCK_INIT],[1],
800 [Have pthread_rwlock_init]))
798801 fi
799802
800803 dnl Allow extra x86-disassembler library
2789527895
2789627896 fi
2789727897
27898 { echo "$as_me:$LINENO: checking for library containing pthread_rwlock_init" >&5
27899 echo $ECHO_N "checking for library containing pthread_rwlock_init... $ECHO_C" >&6; }
27900 if test "${ac_cv_search_pthread_rwlock_init+set}" = set; then
27901 echo $ECHO_N "(cached) $ECHO_C" >&6
27902 else
27903 ac_func_search_save_LIBS=$LIBS
27904 cat >conftest.$ac_ext <<_ACEOF
27905 /* confdefs.h. */
27906 _ACEOF
27907 cat confdefs.h >>conftest.$ac_ext
27908 cat >>conftest.$ac_ext <<_ACEOF
27909 /* end confdefs.h. */
27910
27911 /* Override any GCC internal prototype to avoid an error.
27912 Use char because int might match the return type of a GCC
27913 builtin and then its argument prototype would still apply. */
27914 #ifdef __cplusplus
27915 extern "C"
27916 #endif
27917 char pthread_rwlock_init ();
27918 int
27919 main ()
27920 {
27921 return pthread_rwlock_init ();
27922 ;
27923 return 0;
27924 }
27925 _ACEOF
27926 for ac_lib in '' pthread; do
27927 if test -z "$ac_lib"; then
27928 ac_res="none required"
27929 else
27930 ac_res=-l$ac_lib
27931 LIBS="-l$ac_lib $ac_func_search_save_LIBS"
27932 fi
27933 rm -f conftest.$ac_objext conftest$ac_exeext
27934 if { (ac_try="$ac_link"
27935 case "(($ac_try" in
27936 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
27937 *) ac_try_echo=$ac_try;;
27938 esac
27939 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
27940 (eval "$ac_link") 2>conftest.er1
27941 ac_status=$?
27942 grep -v '^ *+' conftest.er1 >conftest.err
27943 rm -f conftest.er1
27944 cat conftest.err >&5
27945 echo "$as_me:$LINENO: \$? = $ac_status" >&5
27946 (exit $ac_status); } &&
27947 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
27948 { (case "(($ac_try" in
27949 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
27950 *) ac_try_echo=$ac_try;;
27951 esac
27952 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
27953 (eval "$ac_try") 2>&5
27954 ac_status=$?
27955 echo "$as_me:$LINENO: \$? = $ac_status" >&5
27956 (exit $ac_status); }; } &&
27957 { ac_try='test -s conftest$ac_exeext'
27958 { (case "(($ac_try" in
27959 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
27960 *) ac_try_echo=$ac_try;;
27961 esac
27962 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
27963 (eval "$ac_try") 2>&5
27964 ac_status=$?
27965 echo "$as_me:$LINENO: \$? = $ac_status" >&5
27966 (exit $ac_status); }; }; then
27967 ac_cv_search_pthread_rwlock_init=$ac_res
27968 else
27969 echo "$as_me: failed program was:" >&5
27970 sed 's/^/| /' conftest.$ac_ext >&5
27971
27972
27973 fi
27974
27975 rm -f core conftest.err conftest.$ac_objext \
27976 conftest$ac_exeext
27977 if test "${ac_cv_search_pthread_rwlock_init+set}" = set; then
27978 break
27979 fi
27980 done
27981 if test "${ac_cv_search_pthread_rwlock_init+set}" = set; then
27982 :
27983 else
27984 ac_cv_search_pthread_rwlock_init=no
27985 fi
27986 rm conftest.$ac_ext
27987 LIBS=$ac_func_search_save_LIBS
27988 fi
27989 { echo "$as_me:$LINENO: result: $ac_cv_search_pthread_rwlock_init" >&5
27990 echo "${ECHO_T}$ac_cv_search_pthread_rwlock_init" >&6; }
27991 ac_res=$ac_cv_search_pthread_rwlock_init
27992 if test "$ac_res" != no; then
27993 test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
27994
27995 cat >>confdefs.h <<\_ACEOF
27996 #define HAVE_PTHREAD_RWLOCK_INIT 1
27997 _ACEOF
27998
27999 fi
28000
2789828001 fi
2789928002
2790028003
283283
284284 /* Have pthread_mutex_lock */
285285 #undef HAVE_PTHREAD_MUTEX_LOCK
286
287 /* Have pthread_rwlock_init */
288 #undef HAVE_PTHREAD_RWLOCK_INIT
286289
287290 /* Define to 1 if srand48/lrand48/drand48 exist in */
288291 #undef HAVE_RAND48