]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
buildsys: fix static configuration and building
authorLada Trimasova <ltrimas@synopsys.com>
Tue, 26 Jan 2016 15:34:50 +0000 (18:34 +0300)
committerLada Trimasova <ltrimas@synopsys.com>
Tue, 26 Jan 2016 15:34:50 +0000 (18:34 +0300)
In case of uClibc librt depends on libpthread. In particular
timer_create() function uses pthread_XXX(). That means in case of static
builds it's required to link not librt alone but together with libpthread. So
if checking timer_create function in librt fails, it is necessary to check if
timer_create function successfully links with "-lpthread".

That issues was spotted in Buldroot autobuilder failures:
http://autobuild.buildroot.net/results/759/75960db671807091fe9155aee9e46a6245e32590/
http://autobuild.buildroot.org/results/112/112e8b85783f5aaba42a937a6eb064317615a21b/

Signed-off-by: Lada Trimasova <ltrimas@synopsys.com>
configure.ac

index 3002e77a22115085ec28f620350964e5eac28613..75e86906442ebeba8f494179e92009ecc22a9aa2 100644 (file)
@@ -394,7 +394,14 @@ AC_CHECK_FUNCS([timer_create],
        [AC_CHECK_LIB([rt], [timer_create], [
                have_timer="yes"
                REALTIME_LIBS="-lrt"
-       ])]
+       ],[
+               AC_SEARCH_LIBS([timer_create], [rt], [
+                       AC_MSG_RESULT(yes)
+                       have_timer="yes"
+                       REALTIME_LIBS="-lrt -lpthread"
+               ],[], [-lpthread]
+               )
+               ])]
 )
 
 AC_SUBST([REALTIME_LIBS])