sys-devel/m4: fix spawn_h.m4 for uclibc, bug #580688
authorAnthony G. Basile <blueness@gentoo.org>
Wed, 20 Apr 2016 22:59:42 +0000 (18:59 -0400)
committerAnthony G. Basile <blueness@gentoo.org>
Wed, 20 Apr 2016 23:00:34 +0000 (19:00 -0400)
Package-Manager: portage-2.2.26

sys-devel/m4/files/m4-1.4.17-fix-spawn_h_m4.patch [new file with mode: 0644]
sys-devel/m4/m4-1.4.17.ebuild

diff --git a/sys-devel/m4/files/m4-1.4.17-fix-spawn_h_m4.patch b/sys-devel/m4/files/m4-1.4.17-fix-spawn_h_m4.patch
new file mode 100644 (file)
index 0000000..dbbac65
--- /dev/null
@@ -0,0 +1,31 @@
+commit d6eab2e70fc5ccc82a73e5c988b76a229e4cd3d5
+Author: Pádraig Brady <P@draigBrady.com>
+Date:   Tue Jan 14 16:59:07 2014 +0000
+
+    spawn: fix link error on uclibc
+    
+    * m4/spawn_h.m4 (gl_HAVE_POSIX_SPAWN): use AC_SEARCH_LIBS,
+    to incorporate -lrt if needed (on uclibc for example).
+    * modules/posix_spawn: Reference the substituted LIB.
+
+diff --git a/m4/spawn_h.m4 b/m4/spawn_h.m4
+index 87fe122..3eb835c 100644
+--- a/m4/spawn_h.m4
++++ b/m4/spawn_h.m4
+@@ -64,7 +64,15 @@ AC_DEFUN([gl_HAVE_POSIX_SPAWN],
+   dnl once only, before all statements that occur in other macros.
+   AC_REQUIRE([gl_SPAWN_H_DEFAULTS])
+-  AC_CHECK_FUNCS_ONCE([posix_spawn])
++  LIB_POSIX_SPAWN=
++  AC_SUBST([LIB_POSIX_SPAWN])
++  gl_saved_libs=$LIBS
++    AC_SEARCH_LIBS([posix_spawn], [rt],
++                   [test "$ac_cv_search_posix_spawn" = "none required" ||
++                    LIB_POSIX_SPAWN=$ac_cv_search_posix_spawn])
++    AC_CHECK_FUNCS([posix_spawn])
++  LIBS=$gl_saved_libs
++
+   if test $ac_cv_func_posix_spawn != yes; then
+     HAVE_POSIX_SPAWN=0
+   fi
index 3e45c8c98c180ba5651d9e349ce737b1224a6759..b28aa180460272b5086efb3f44aa1a77bf13eff9 100644 (file)
@@ -1,8 +1,10 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2016 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
-EAPI="4"
+EAPI="5"
+
+inherit eutils
 
 DESCRIPTION="GNU macro processor"
 HOMEPAGE="https://www.gnu.org/software/m4/m4.html"
@@ -18,6 +20,8 @@ DEPEND="app-arch/xz-utils"
 RDEPEND=""
 
 src_prepare() {
+       epatch "${FILESDIR}"/${P}-fix-spawn_h_m4.patch #580688
+
        # Disable gnulib build test that has no impact on the source.
        # Re-enable w/next version bump (and gnulib is updated). #554728
        [[ ${PV} != "1.4.17" ]] && die "re-enable test #554728"