|
25 | 25 |
|
26 | 26 | AC_DEFUN([OPAL_CONFIG_QTHREADS],[ |
27 | 27 |
|
28 | | - AC_CHECK_HEADERS([qthread/qthread.h], |
29 | | - [AC_CHECK_LIB([qthread],[qthread_initialize], |
30 | | - [threads_qthreads_happy="yes"], |
31 | | - [threads_qthreads_happy="no"])], |
32 | | - [threads_qthreads_happy="no"]) |
| 28 | + AC_ARG_WITH([qthreads], |
| 29 | + [AC_HELP_STRING([--with-qthreads=DIR], |
| 30 | + [Specify location of qthreads installation. Error if qthreads support cannot be found.])]) |
33 | 31 |
|
34 | | - AS_IF([test "$threads_qthreads_happy" = "yes"], |
| 32 | + AC_ARG_WITH([qthreads-libdir], |
| 33 | + [AC_HELP_STRING([--with-qthreads-libdir=DIR], |
| 34 | + [Search for qthreads libraries in DIR])]) |
| 35 | + |
| 36 | + opal_check_qthreads_save_CPPFLAGS=$CPPFLAGS |
| 37 | + opal_check_qthreads_save_LDFLAGS=$LDFLAGS |
| 38 | + opal_check_qthreads_save_LIBS=$LIBS |
| 39 | + |
| 40 | + opal_qthreads_happy=yes |
| 41 | + AS_IF([test "$with_qthreads" = "no"], |
| 42 | + [opal_qthreads_happy=no]) |
| 43 | + |
| 44 | + AS_IF([test $opal_qthreads_happy = yes], |
| 45 | + [AC_MSG_CHECKING([looking for qthreads in]) |
| 46 | + AS_IF([test "$with_qthreads" != "yes"], |
| 47 | + [opal_qthreads_dir=$with_qthreads |
| 48 | + AC_MSG_RESULT([($opal_qthreads_dir)])], |
| 49 | + [AC_MSG_RESULT([(default search paths)])]) |
| 50 | + AS_IF([test ! -z "$with_qthreads_libdir" && \ |
| 51 | + test "$with_qthreads_libdir" != "yes"], |
| 52 | + [opal_qthreads_libdir=$with_qthreads_libdir]) |
| 53 | + ]) |
| 54 | + |
| 55 | + AS_IF([test $opal_qthreads_happy = yes], |
| 56 | + [OPAL_CHECK_PACKAGE([opal_qthreads], |
| 57 | + [qthread.h], |
| 58 | + [qthread], |
| 59 | + [qthread_initialize], |
| 60 | + [], |
| 61 | + [$opal_qthreads_dir], |
| 62 | + [$opal_qthreads_libdir], |
| 63 | + [], |
| 64 | + [opal_qthreads_happy=no])]) |
| 65 | + |
| 66 | + AS_IF([test $opal_qthreads_happy = yes && test -n "$opal_qthreads_dir"], |
| 67 | + [OPAL_QTHREADS_INCLUDE_PATH="$opal_qthreads_dir/include/"], |
| 68 | + [OPAL_QTHREADS_INCLUDE_PATH=""]) |
| 69 | + |
| 70 | + AS_IF([test $opal_qthreads_happy = yes], |
| 71 | + [TPKG_CFLAGS="$opal_qthreads_CPPFLAGS" |
| 72 | + TPKG_FCFLAGS="$opal_qthreads_CPPFLAGS" |
| 73 | + TPKG_CXXFLAGS="$opal_qthreads_CPPFLAGS" |
| 74 | + TPKG_CPPFLAGS="$opal_qthreads_CPPFLAGS" |
| 75 | + TPKG_CXXCPPFLAGS="$opal_qthreads_CPPFLAGS" |
| 76 | + TPKG_LDFLAGS="$opal_qthreads_LDFLAGS" |
| 77 | + TPKG_LIBS="$opal_qthreads_LIBS"]) |
| 78 | + |
| 79 | + AC_CONFIG_FILES([opal/mca/threads/qthreads/threads_qthreads.h]) |
| 80 | + AC_SUBST([OPAL_QTHREADS_INCLUDE_PATH]) |
| 81 | + AC_SUBST([opal_qthreads_CPPFLAGS]) |
| 82 | + AC_SUBST([opal_qthreads_LDFLAGS]) |
| 83 | + AC_SUBST([opal_qthreads_LIBS]) |
| 84 | + |
| 85 | + CPPFLAGS=$opal_check_qthreads_save_CPPFLAGS |
| 86 | + LDFLAGS=$opal_check_qthreads_save_LDFLAGS |
| 87 | + LIBS=$opal_check_qthreads_save_LIBS |
| 88 | + |
| 89 | + AS_IF([test "$opal_qthreads_happy" = "yes"], |
35 | 90 | [$1], |
36 | 91 | [$2]) |
37 | 92 | ])dnl |
@@ -60,6 +115,15 @@ AC_DEFUN([MCA_opal_threads_qthreads_POST_CONFIG],[ |
60 | 115 | AC_DEFINE_UNQUOTED([MCA_threads_wait_sync_base_include_HEADER], |
61 | 116 | ["opal/mca/threads/qthreads/threads_qthreads_wait_sync.h"], |
62 | 117 | [Header to include for wait_sync implementation]) |
| 118 | + THREAD_CFLAGS="$TPKG_CFLAGS" |
| 119 | + THREAD_FCFLAGS="$TPKG_FCFLAGS" |
| 120 | + THREAD_CXXFLAGS="$TPKG_CXXFLAGS" |
| 121 | + THREAD_CPPFLAGS="$TPKG_CPPFLAGS" |
| 122 | + THREAD_CXXCPPFLAGS="$TPKG_CXXCPPFLAGS" |
| 123 | + THREAD_LDFLAGS="$TPKG_LDFLAGS" |
| 124 | + THREAD_LIBS="$TPKG_LIBS" |
| 125 | + LIBS="$LIBS $THREAD_LIBS" |
| 126 | + LDFLAGS="$LDFLAGS $THREAD_LDFLAGS" |
63 | 127 | ]) |
64 | 128 | ])dnl |
65 | 129 |
|
|
0 commit comments