Bug 153764 - [patch] multimedia/vlc: don't link against librt for sem_init(3)
Summary: [patch] multimedia/vlc: don't link against librt for sem_init(3)
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Joseph S. Atkinson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-07 15:00 UTC by swell.k
Modified: 2011-01-30 01:00 UTC (History)
0 users

See Also:


Attachments
a.diff (634 bytes, patch)
2011-01-07 15:00 UTC, swell.k
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description swell.k 2011-01-07 15:00:13 UTC

    
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2011-01-07 15:00:21 UTC
Responsible Changed
From-To: freebsd-ports-bugs->jsa

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Joseph S. Atkinson freebsd_committer freebsd_triage 2011-01-12 01:02:47 UTC
Can you explain a bit while you feel this change is necessary?
Comment 3 Joseph S. Atkinson freebsd_committer freebsd_triage 2011-01-12 01:15:07 UTC
State Changed
From-To: open->feedback

Requires more details.
Comment 4 swell.k 2011-01-12 03:02:39 UTC
"Joseph S. Atkinson" <jsa@FreeBSD.org> writes:

> Can you explain a bit while you feel this change is necessary?

AC_CHECK_LIB() unlike AC_SEARCH_LIBS() doesn't search function in
default library first, i.e. libc.

  AC_CHECK_LIB(rt, clock_nanosleep, [
    VLC_ADD_LIBS([libvlccore],[-lrt])
    AC_DEFINE(HAVE_CLOCK_NANOSLEEP, 1, [Define to 1 if you have clock_nanosleep.])
  ], [
    dnl HP/UX port
    AC_CHECK_LIB(rt,sem_init, [VLC_ADD_LIBS([libvlccore],[-lrt])])
  ])

But FreeBSD is neither HP/UX and doesn't have any sem_* symbols in
librt[1] nor it has sem_overview(7) like linux that states

  Programs using the POSIX semaphores API must be compiled with cc
  -lrt to link against the real-time library, librt.

And sem_init(3) manpage has only -lc.

For example, nanosleep() check just after does it right

  have_nanosleep=false
  AC_CHECK_FUNCS(nanosleep,have_nanosleep=:,[
    AC_CHECK_LIB(rt,nanosleep,
      [VLC_ADD_LIBS([libvlccore],[-lrt]) have_nanosleep=:],
      [AC_CHECK_LIB(posix4,nanosleep,
          [VLC_ADD_LIBS([libvlccore],[-lposix4]) have_nanosleep=:])]
    )
  ])

So, sem_init check at least could look like

%%
@@ -800,8 +800,9 @@ AC_CHECK_LIB(rt, clock_nanosleep, [
   VLC_ADD_LIBS([libvlccore],[-lrt])
   AC_DEFINE(HAVE_CLOCK_NANOSLEEP, 1, [Define to 1 if you have clock_nanosleep.])
 ], [
-  dnl HP/UX port
-  AC_CHECK_LIB(rt,sem_init, [VLC_ADD_LIBS([libvlccore],[-lrt])])
+  AC_CHECK_FUNCS(sem_init,,
+    [AC_CHECK_LIB(rt, sem_init, [VLC_ADD_LIBS([libvlccore],[-lrt])])
+  ])
 ])
 
 have_nanosleep=false
%%

[1] OpenSolaris and NetBSD seem to have sem_* symbols in librt, too
Comment 5 dfilter service freebsd_committer freebsd_triage 2011-01-30 00:04:17 UTC
jsa         2011-01-30 00:04:11 UTC

  FreeBSD ports repository

  Modified files:
    multimedia/vlc       Makefile distinfo 
  Removed files:
    multimedia/vlc/files 
                         patch-modules__gui__qt4__util__customwidgets.cpp 
  Log:
  Update VLC to 1.1.6.
  Include support for GCRYPT and REMOTEOSD [1].
  Stop linking against librt [2].
  Chase libdvbpsi shlib bump.
  
  PR:             [1] ports/153734, [2] ports/153764
  Submitted by:   Anonymous <swell.k@gmail.com>
  Approved by:    kwm (mentor)
  Feature safe:   yes
  
  Revision  Changes    Path
  1.251     +18 -3     ports/multimedia/vlc/Makefile
  1.43      +2 -2      ports/multimedia/vlc/distinfo
  1.2       +0 -11     ports/multimedia/vlc/files/patch-modules__gui__qt4__util__customwidgets.cpp (dead)
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 6 Joseph S. Atkinson freebsd_committer freebsd_triage 2011-01-30 00:52:21 UTC
I intend to discuss you patch with upstream to hopefully do away with the need 
for this in the future. This has been committed for FreeBSD with 1.1.6.
Comment 7 Joseph S. Atkinson freebsd_committer freebsd_triage 2011-01-30 00:52:54 UTC
State Changed
From-To: feedback->closed

Committed. Thanks!