sys-cluster/mpich: drop REQUIRED_USE
authorChristoph Junghans <ottxor@gentoo.org>
Mon, 29 Aug 2016 20:13:06 +0000 (14:13 -0600)
committerChristoph Junghans <ottxor@gentoo.org>
Mon, 29 Aug 2016 20:13:11 +0000 (14:13 -0600)
See discussion on gentoo-science/sci#664

Package-Manager: portage-2.2.28

sys-cluster/mpich/mpich-3.2-r1.ebuild

index 382b2caba7a8f7a8bae5a52329448aee0254688f..90b3ee35f07037fe552c83cf4ff6b91b5578a8cb 100644 (file)
@@ -18,7 +18,6 @@ SLOT="0"
 LICENSE="mpich"
 KEYWORDS=""
 IUSE="+cxx doc fortran mpi-threads romio threads"
-REQUIRED_USE="mpi-threads? ( threads )"
 
 COMMON_DEPEND="
        >=dev-libs/libaio-0.3.109-r5[${MULTILIB_USEDEP}]
@@ -54,7 +53,25 @@ src_prepare() {
 multilib_src_configure() {
        # The configure statements can be somewhat confusing, as they
        # don't all show up in the top level configure, however, they
-       # are picked up in the children directories.
+       # are picked up in the children directories.  Hence the separate
+       # local vars.
+
+       local c=
+       if use mpi-threads; then
+               # MPI-THREAD requries threading.
+               c="${c} --with-thread-package=pthreads"
+               c="${c} --enable-threads=runtime"
+       else
+               if use threads ; then
+                       c="${c} --with-thread-package=pthreads"
+               else
+                       c="${c} --with-thread-package=none"
+               fi
+               c="${c} --enable-threads=single"
+       fi
+
+       c="${c} --sysconfdir=${EPREFIX}/etc/${PN}"
+       c="${c} --docdir=${EPREFIX}/usr/share/doc/${PF}"
 
        export MPICHLIB_CFLAGS="${CFLAGS}"
        export MPICHLIB_CPPFLAGS="${CPPFLAGS}"
@@ -66,10 +83,8 @@ multilib_src_configure() {
 
        ECONF_SOURCE=${S} econf \
                --enable-shared \
-               --sysconfdir="${EPREFIX}/etc/${PN}" \
                --with-hwloc-prefix="${EPREFIX}/usr" \
-               --enable-threads=$(usex mpi-threads runtime single) \
-               --with-thread-package=$(usex threads pthreads none) \
+               ${c} \
                --with-pm=hydra \
                --disable-fast \
                --enable-versioning \