Bugzilla – Bug 313211
librt shouldn't always be used for sem_init
Last modified: 2007-09-15 21:24:46 UTC
---- Reported by recht@netbsd.org 2003-11-24 17:23:19 MST ---- Description of Problem: configure is only looking at librt for sem_init. On (at least) NetBSD-current and Linux it's also defined in libpthread and mono is linked against libpthread on these platforms anyway. So look first there. Idea and implementation (one liner) from Python. The original check-in message is here: http://mail.python.org/pipermail/patches/2003-May/012342.html Steps to reproduce the problem: configure && ldd Actual Results: linked against librt and libpthread Expected Results: linked against libpthread only How often does this happen? always Additional Information: --- configure.in.orig 2003-11-23 13:01:06.000000000 +0100 +++ configure.in 2003-11-24 23:13:19.000000000 +0100 @@ -599,7 +599,10 @@ dnl ******************************** dnl *** Checks for semaphore lib *** dnl ******************************** - AC_CHECK_LIB(rt, sem_init, LIBS="$LIBS -lrt") + AC_SEARCH_LIBS(sem_init, pthread rt posix4) + # 'Real Time' functions on Solaris + # posix4 on Solaris 2.6 + # pthread (first!) on Linux dnl ******************************** dnl *** Checks for timezone stuff ** ---- Additional Comments From vargaz@freemail.hu 2003-11-26 10:40:04 MST ---- Fixed in CVS. Unknown bug field "cf_op_sys_details" encountered while moving bug <cf_op_sys_details>NetBSD-current</cf_op_sys_details> Unknown operating system other. Setting to default OS "Other".