Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 07 Nov 2010 06:26:13 +0300
From:      Anonymous <swell.k@gmail.com>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/152002: [patch] www/firefox-devel: don't link against librt for clock_gettime(3)
Message-ID:  <86r5exrezu.fsf@gmail.com>
Resent-Message-ID: <201011070330.oA73U9v1099759@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         152002
>Category:       ports
>Synopsis:       [patch] www/firefox-devel: don't link against librt for clock_gettime(3)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    gecko
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Nov 07 03:30:09 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Anonymous
>Release:        FreeBSD 9.0-CURRENT amd64
>Organization:
>Environment:
>Description:
Try to search clock_gettime() in libc first and then in librt.
>How-To-Repeat:
$ make install
$ ldd LOCALBASE/lib/firefox/libxul.so | fgrep librt
>Fix:
--- a.diff begins here ---
Index: www/firefox-devel/files/patch-configure.in
===================================================================
--- www/firefox-devel/files/patch-configure.in	(revision 430)
+++ www/firefox-devel/files/patch-configure.in	(working copy)
@@ -9,3 +9,30 @@
      CPU_ARCH="$OS_TEST"
      ;;
  
+@@ -3767,19 +3767,21 @@ AC_CHECK_FUNCS(flockfile getpagesize)
+ AC_CHECK_FUNCS(localtime_r strtok_r)
+ 
+ dnl check for clock_gettime(), the CLOCK_MONOTONIC clock, and -lrt
+-_SAVE_LDFLAGS=$LDFLAGS
+-LDFLAGS="$LDFLAGS -lrt"
+-AC_CACHE_CHECK(for clock_gettime(CLOCK_MONOTONIC) and -lrt,
++_SAVE_LIBS=$LIBS
++AC_SEARCH_LIBS(clock_gettime, rt)
++AC_CACHE_CHECK(for clock_gettime(CLOCK_MONOTONIC),
+                ac_cv_have_clock_monotonic,
+                [AC_TRY_LINK([#include <time.h>],
+                             [ struct timespec ts;
+                               clock_gettime(CLOCK_MONOTONIC, &ts); ],
+                             ac_cv_have_clock_monotonic=yes,
+                             ac_cv_have_clock_monotonic=no)])
+-LDFLAGS=$_SAVE_LDFLAGS
++LIBS=$_SAVE_LIBS
+ if test "$ac_cv_have_clock_monotonic" = "yes"; then
+     HAVE_CLOCK_MONOTONIC=1
+-    REALTIME_LIBS=-lrt
++    if test "$ac_cv_search_clock_gettime" != "none required"; then
++        REALTIME_LIBS=$ac_cv_search_clock_gettime
++    fi
+     AC_DEFINE(HAVE_CLOCK_MONOTONIC)
+     AC_SUBST(HAVE_CLOCK_MONOTONIC)
+     AC_SUBST(REALTIME_LIBS)
--- a.diff ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86r5exrezu.fsf>