LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   zoneminder-1.25.0 won't build in slackware64-current (https://www.linuxquestions.org/questions/slackware-14/zoneminder-1-25-0-wont-build-in-slackware64-current-939357/)

buckprivatemil 04-11-2012 05:46 PM

zoneminder-1.25.0 won't build in slackware64-current
 
Although it seems to build fine in slackware-13.37 and perhaps also slackware64-13.37, ZoneMinder fails to make in slackware64-current.

I tried the src2pkg script posted here without success. Note that the final script used was never posted, but the problem was missing files and or files in the wrong place, not that the source failed to make.

I would appreciate any help.

The files in the source directory are
README ZoneMinder.info zm_apache.conf
README.PERLDEPS cambozola-0.92.tar.gz zm_logrotate
README.SLACKWARE jscalendar-1.0.zip zoneminder.src2pkg
ZoneMinder-1.25.0.tar.gz slack-desc

The tail end of the make says
make[1]: Entering directory `/tmp/zoneminder-1.25.0-src-1/src'
g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/include -I/usr/include -Wall -Wno-sign-compare -fno-inline -I/usr/include -D__STDC_CONSTANT_MACROS -MT zm_logger.o -MD -MP -MF .deps/zm_logger.Tpo -c -o zm_logger.o zm_logger.cpp
zm_logger.cpp: In constructor 'Logger::Logger()':
zm_logger.cpp:112:49: error: 'isatty' was not declared in this scope
zm_logger.cpp: In member function 'void Logger::logFile(const string&)':
zm_logger.cpp:444:69: error: 'getpid' was not declared in this scope
zm_logger.cpp: In member function 'void Logger::logPrint(bool, const char*, int, int, const char*, ...)':
zm_logger.cpp:519:39: error: 'syscall' was not declared in this scope
zm_logger.cpp:521:22: error: 'getpid' was not declared in this scope
zm_logger.cpp: At global scope:
zm_logger.cpp:43:13: warning: 'void subtractTime(timeval*, timeval*)' defined but not used [-Wunused-function]
make[1]: *** [zm_logger.o] Error 1
make[1]: Leaving directory `/tmp/zoneminder-1.25.0-src-1/src'
make: *** [install-recursive] Error 1
--
buck

CTM 04-11-2012 07:28 PM

The reason it fails in -current and not in 13.37 is down to recent changes in GCC 4.7 that made their way into -current: unistd.h is no longer included in libstdc++, so you'll need to patch that file so that unistd.h is explicitly included. This should probably get reported to the zoneminder developers.

buckprivatemil 04-12-2012 02:29 AM

Thank you, that is the fix.

These may not be technically correct, but do fix the problems:
01-zm_logger.patch
--- src/zm_logger.cpp.org 2012-04-12 00:11:05.606879680 -0700
+++ src/zm_logger.cpp 2012-04-12 00:11:33.075499596 -0700
@@ -33,6 +33,7 @@
#include <signal.h>
#include <stdarg.h>
#include <errno.h>
+#include <unistd.h>

bool Logger::smInitialised = false;
Logger *Logger::smInstance = 0;


02-zm_thread.patch
--- src/zm_thread.h.org 2012-04-12 00:10:04.848687183 -0700
+++ src/zm_thread.h 2012-04-12 00:10:30.415302810 -0700
@@ -17,6 +17,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//

+#include <unistd.h>
#ifndef ZM_THREAD_H
#define ZM_THREAD_H

lpallard 07-19-2013 08:07 PM

Trying to patch the files as you suggested, I get:

Code:

bash-4.2# patch -p1 < zm_logger.patch
can't find file to patch at input line 3
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|--- src/zm_logger.cpp.org 2012-04-12 00:11:05.606879680 -0700
|+++ src/zm_logger.cpp 2012-04-12 00:11:33.075499596 -0700
--------------------------
File to patch: /root/zm/src/zm_logger.cpp
patching file /root/zm/src/zm_logger.cpp
patch: **** malformed patch at line 9: bool Logger::smInitialised = false;

Perhaps I am not applying the patch properly? To do so I:

Copied the text you provided to zm_logger.patch & zm_thread.patch

Code:

--- src/zm_logger.cpp.org 2012-04-12 00:11:05.606879680 -0700
+++ src/zm_logger.cpp 2012-04-12 00:11:33.075499596 -0700
@@ -33,6 +33,7 @@
#include <signal.h>
#include <stdarg.h>
#include <errno.h>
+#include <unistd.h>

bool Logger::smInitialised = false;
Logger *Logger::smInstance = 0;

Code:

--- src/zm_thread.h.org 2012-04-12 00:10:04.848687183 -0700
+++ src/zm_thread.h 2012-04-12 00:10:30.415302810 -0700
@@ -17,6 +17,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//

+#include <unistd.h>
#ifndef ZM_THREAD_H
#define ZM_THREAD_H

Then tried to apply the patch.

Whats wrong? Any idea? Thanks!


All times are GMT -5. The time now is 09:49 PM.