Question
I am having difficulty understanding the expected operation of the configuration script. I'm running on macOSX-10.4 which runs into a problem recognizing pthread support during configuration. (More details on the error output can be found at Motion - Bug Report 2008x 12x 21x 040027). I've been looking in detail into why the script fails (pthread is definitely installed on the system) and I'm curious to understand how it's supposed to work on a standard linux system. What I see is that there are two test flags (PTHREAD_SUPPORT and PTHREAD_LIB) and a test condition (THREAD_CHECK). In tracking to code, it correctly identifies that THREAD_CHECK=yes and that pthread.h exists. Then it finds the correct library in the /usr/lib directory and sets PTHREAD_LIB=yes. But then there seems to be a logic failure (pasted below). Note, if PTHREAD_LIB==yes, then then PTHREAD_SUPPORT never gets set (it's not set anywhere before) and the config file comes to a halt. I'm thinking that it should be a test on PTHREAD_SUPPORT rather than PTHREAD_LIB...but then I'm wondering how this works for anyone else?
if test x$PTHREAD_LIB != xyes; then
if test "${FreeBSD}" != ""; then
TEMP_LIBS="$TEMP_LIBS -pthread"
TEMP_CFLAGS="${TEMP_CFLAGS} -D_REENTRANT -D_THREAD_SAFE"
else
TEMP_LIBS="$TEMP_LIBS -lpthread"
TEMP_CFLAGS="${TEMP_CFLAGS} -D_REENTRANT"
fi
PTHREAD_SUPPORT="yes"
fi
{ echo "$as_me:$LINENO: result: $PTHREAD_SUPPORT" >&5
echo "${ECHO_T}$PTHREAD_SUPPORT" >&6; }
Environment
Motion version: |
3.2.11.1 |
ffmpeg version: |
0.5 |
Libraries: |
ffmpeg, mysql, postgresql |
Server OS: |
MACSX 10.4 |
--
DavidReyna - 05 Feb 2010
Answer
Current configure have to be changed to support
MacOsX as it was changed to support BSD and Linux and those changes broken
MacOsX detection of pthread , it was :
dnl Checks for Library pthread ( no cross platform )
AC_CHECK_LIB(pthread,pthread_create,[
TEMP_LIBS="$TEMP_LIBS -lpthread"
PTHREAD_SUPPORT="yes"
],[
echo
echo You do not have pthread installed
echo
]
)
--
AngelCarpintero - 05 Feb 2010