freebsd motion build fixes. issue #267

This commit is contained in:
Pisike Sipelgas
2016-12-06 14:01:10 +02:00
parent 9df0c11fad
commit 8a3067f369
3 changed files with 16 additions and 3 deletions

View File

@@ -350,7 +350,11 @@ WITHOUT_MMAL="no")
if test "${WITHOUT_MMAL}" = "no"; then
HAVE_MMAL=""
LIBRASPBERRYPIDEVPATH="/opt/vc/include/interface/mmal"
if test "${FreeBSD}" != "" ; then
LIBRASPBERRYPIDEVPATH="/usr/local/include/interface/mmal"
else
LIBRASPBERRYPIDEVPATH="/opt/vc/include/interface/mmal"
fi
if test -d ${LIBRASPBERRYPIDEVPATH}; then
HAVE_MMAL="yes"
@@ -362,7 +366,10 @@ if test "${WITHOUT_MMAL}" = "no"; then
AC_SUBST(MMAL_LIBS)
MMAL_OBJ="mmalcam.o raspicam/RaspiCamControl.o raspicam/RaspiCLI.o"
MMAL_CFLAGS="-std=gnu99 -DHAVE_MMAL -Irasppicam -I/opt/vc/include"
MMAL_LIBS="-L/opt/vc/lib -lmmal_core -lmmal_util -lmmal_vc_client -lvcos -lvchostif -lvchiq_arm"
AS_IF([test "${FreeBSD}" != "" ], [
MMAL_CFLAGS="${MMAL_CFLAGS} -I/usr/local/include -I/usr/local/include/interface/vcos -I/usr/local/include/interface/vcos/pthreads/ -I/usr/local/include/interface/vmcs_host/linux"
])
MMAL_LIBS="-L/opt/vc/lib -lmmal_core -lmmal_util -lmmal_vc_client -lvcos -lvchostif -lvchiq_arm"
AC_DEFINE([HAVE_MMAL], 1, [Define to 1 if we want MMAL])
])
fi

View File

@@ -192,7 +192,9 @@ void motion_log(int level, unsigned int type, int errno_flag, const char *fmt, .
errno_save = errno;
char threadname[32] = "unknown";
#if (!defined(__FreeBSD__))
pthread_getname_np(pthread_self(), threadname, sizeof(threadname));
#endif
/*
* Prefix the message with the log level string, log type string,

View File

@@ -462,9 +462,13 @@ static int netcam_rtsp_open_context(netcam_context_ptr netcam){
* our thread name - so temporarily change our thread name to the
* desired name */
{
char curtname[16];
char newtname[16];
#if defined(__FreeBSD__)
char curtname[16] = "unknown";
#else
char curtname[16];
pthread_getname_np(pthread_self(), curtname, sizeof(curtname));
#endif
snprintf(newtname, sizeof(newtname), "av%d%s%s",
netcam->cnt->threadnr,
netcam->cnt->conf.camera_name ? ":" : "",