From: Pádraig Brady
Date: Tue, 14 Jan 2014 16:59:07 +0000 (+0000)
Subject: spawn: fix link error on uclibc
X-Git-Tag: v1.0~7430
X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=d6eab2e70fc5ccc82a73e5c988b76a229e4cd3d5;p=gnulib.git
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/ChangeLog b/ChangeLog
index 4cf45008d5..5b42661c9a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2014-02-21 Pádraig Brady
+
+ 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.
+
2014-02-21 Thomas Petazzoni (tiny change)
timer: fix uClibc detection of threading
* m4/time_time.m4 (gl_TIMER_TIME): Detect whether threads are
diff --git a/m4/spawn_h.m4 b/m4/spawn_h.m4
index 87fe122984..3eb835c3c2 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
diff --git a/modules/posix_spawn b/modules/posix_spawn
index ec8eac1825..62b0956e28 100644
--- a/modules/posix_spawn
+++ b/modules/posix_spawn
@@ -23,6 +23,9 @@ Makefile.am:
Include:
+Link:
+$(LIB_POSIX_SPAWN)
+
License:
LGPLv2+