@@ -664,9 +664,11 @@ if test "$opal_pthread_c_success" = "1" && \
664
664
test " $opal_pthread_cxx_success " = " 1" && \
665
665
test " $opal_pthread_fortran_success " = " 1" ; then
666
666
internal_useless=1
667
+ AC_MSG_RESULT(" looks like posix threads work" )
667
668
$1
668
669
else
669
670
internal_useless=1
671
+ AC_MSG_RESULT(" looks like posix threads don't work" )
670
672
$2
671
673
fi
672
674
@@ -682,23 +684,31 @@ AC_DEFUN([MCA_opal_threads_pthreads_COMPILE_MODE], [
682
684
AC_MSG_RESULT([$$ 4])
683
685
])
684
686
685
- AC_DEFUN([MCA_opal_threads_pthreads_POST_CONFIG],[
686
- AS_IF([test " $1 " = " 1" ], [threads_base_include= " pthreads/threads_pthreads_threads.h" ])
687
- ])dnl
688
-
689
- AC_DEFUN([MCA_opal_mutex_pthreads_POST_CONFIG],[
690
- AS_IF([test " $1 " = " 1" ], [mutex_base_include= " pthreads/threads_pthreads_mutex.h" ])
691
- AC_MSG_CHECKING([mutex_base_include = $mutex_base_include ])
692
- ])dnl
693
687
694
- AC_DEFUN([MCA_opal_tsd_pthreads_POST_CONFIG],[
695
- AS_IF([test " $1 " = " 1" ], [threads_base_include= " pthreads/threads_pthreads_tsd.h" ])
696
- AC_MSG_CHECKING([threads_base_include = $threads_base_include ])
697
- ])dnl
698
-
699
- AC_DEFUN([MCA_opal_wait_sync_pthreads_POST_CONFIG],[
700
- AS_IF([test " $1 " = " 1" ], [wait_sync_base_include= " pthreads/threads_pthreads_wait_sync.h" ])
701
- AC_MSG_CHECKING([wait_sync_includenclude = $wait_sync_base_include ])
688
+ # If component was selected, $1 will be 1 and we should set the base header
689
+ AC_DEFUN([MCA_opal_threads_pthreads_POST_CONFIG],[
690
+ AS_IF([test " $1 " = " 1" ],
691
+ [opal_thread_type_found= " pthreads"
692
+ AC_DEFINE_UNQUOTED([MCA_threads_base_include_HEADER],
693
+ [" opal/mca/threads/pthreads/threads_pthreads_threads.h" ],
694
+ [Header to include for threads implementation])
695
+ AC_DEFINE_UNQUOTED([MCA_threads_mutex_base_include_HEADER],
696
+ [" opal/mca/threads/pthreads/threads_pthreads_mutex.h" ],
697
+ [Header to include for mutex implementation])
698
+ AC_DEFINE_UNQUOTED([MCA_threads_tsd_base_include_HEADER],
699
+ [" opal/mca/threads/pthreads/threads_pthreads_tsd.h" ],
700
+ [Header to include for tsd implementation])
701
+ AC_DEFINE_UNQUOTED([MCA_threads_wait_sync_base_include_HEADER],
702
+ [" opal/mca/threads/pthreads/threads_pthreads_wait_sync.h" ],
703
+ [Header to include for wait_sync implementation])
704
+ THREAD_CFLAGS= " $TPKG_CFLAGS "
705
+ THREAD_FCFLAGS= " $TPKG_FCFLAGS "
706
+ THREAD_CXXFLAGS= " $TPKG_CXXFLAGS "
707
+ THREAD_CPPFLAGS= " $TPKG_CPPFLAGS "
708
+ THREAD_CXXCPPFLAGS= " $TPKG_CXXCPPFLAGS "
709
+ THREAD_LDFLAGS= " $TPKG_LDFLAGS "
710
+ THREAD_LIBS= " $TPKG_LIBS "
711
+ ])
702
712
])dnl
703
713
704
714
# MCA_threads_pthreads_CONFIG(action-if-can-compile,
@@ -707,8 +717,13 @@ AC_DEFUN([MCA_opal_wait_sync_pthreads_POST_CONFIG],[
707
717
AC_DEFUN([MCA_opal_threads_pthreads_CONFIG],[
708
718
AC_CONFIG_FILES([opal/mca/threads/pthreads/Makefile])
709
719
710
- AS_IF([test " $HAVE_THREAD_PKG_TYPE " = " pthreads" ],
720
+ AS_IF([test -z " $with_threads " || test " $with_threads " = " pthreads" || test " $with_threads " = " yes" ],
721
+ [OPAL_CONFIG_POSIX_THREADS([posix_threads_works= 1],[posix_threads_works= 0])],
722
+ [posix_threads_works= 0])
723
+
724
+ AS_IF([test " $posix_threads_works " = " 1" ],
711
725
[$1 ],
712
726
[$2 ])
727
+ AC_MSG_RESULT(" posix_threads_works = $posix_threads_works " )
713
728
])
714
729
0 commit comments