2005-12-16 18:12:40 +08:00
|
|
|
AC_INIT(zm,1.22.0,support@zoneminder.com,ZoneMinder)
|
|
|
|
AC_CONFIG_SRCDIR(src/zm.h)
|
|
|
|
AM_INIT_AUTOMAKE
|
2002-12-10 20:24:10 +08:00
|
|
|
AM_CONFIG_HEADER(config.h)
|
2002-09-17 01:10:34 +08:00
|
|
|
|
2004-09-07 16:39:18 +08:00
|
|
|
PATH_BUILD=`pwd`
|
|
|
|
AC_SUBST(PATH_BUILD)
|
2005-10-04 18:58:55 +08:00
|
|
|
TIME_BUILD=`date +'%s'`
|
|
|
|
AC_SUBST(TIME_BUILD)
|
2004-09-07 16:39:18 +08:00
|
|
|
|
2005-12-16 18:12:40 +08:00
|
|
|
AC_ARG_VAR(ZM_DB_HOST,[Hostname where ZoneMinder database located])
|
|
|
|
AC_ARG_VAR(ZM_DB_NAME,[Name of ZoneMinder database])
|
|
|
|
AC_ARG_VAR(ZM_DB_USER,[Name of ZoneMinder database user])
|
|
|
|
AC_ARG_VAR(ZM_DB_PASS,[Password of ZoneMinder database user])
|
|
|
|
|
|
|
|
if test "$ZM_DB_HOST" == ""; then
|
|
|
|
AC_SUBST(ZM_DB_HOST,[localhost])
|
|
|
|
fi
|
|
|
|
if test "$ZM_DB_NAME" == ""; then
|
|
|
|
AC_SUBST(ZM_DB_NAME,[zm])
|
|
|
|
fi
|
|
|
|
if test "$ZM_DB_USER" == ""; then
|
|
|
|
AC_SUBST(ZM_DB_USER,[zmuser])
|
|
|
|
fi
|
|
|
|
if test "$ZM_DB_PASS" == ""; then
|
|
|
|
AC_SUBST(ZM_DB_PASS,[zmpass])
|
|
|
|
fi
|
|
|
|
|
2005-10-04 04:39:14 +08:00
|
|
|
MYSQL_PREFIX=/usr
|
2002-09-17 01:10:34 +08:00
|
|
|
AC_ARG_WITH(mysql,
|
2005-12-02 00:18:40 +08:00
|
|
|
[ --with-mysql=<path> prefix of MySQL installation, default /usr],
|
2002-09-17 01:10:34 +08:00
|
|
|
[MYSQL_PREFIX=$with_mysql],
|
2005-10-20 20:57:59 +08:00
|
|
|
AC_MSG_WARN([You can call configure with the --with-mysql option.
|
|
|
|
This tells configure where to find the MySql C library and headers if configure cannot
|
2005-12-02 00:18:40 +08:00
|
|
|
locate them automatically..
|
2002-09-17 01:10:34 +08:00
|
|
|
e.g. --with-mysql=/usr/local or --with-mysql=/usr])
|
|
|
|
)
|
|
|
|
AC_SUBST(MYSQL_PREFIX)
|
2003-05-23 00:31:54 +08:00
|
|
|
MYSQL_LIBS="-L${MYSQL_PREFIX}/lib/mysql"
|
2002-09-17 01:10:34 +08:00
|
|
|
MYSQL_CFLAGS="-I${MYSQL_PREFIX}/include"
|
|
|
|
AC_SUBST(MYSQL_LIBS)
|
|
|
|
AC_SUBST(MYSQL_CFLAGS)
|
|
|
|
|
2003-05-23 00:31:54 +08:00
|
|
|
LDFLAGS="${MYSQL_LIBS} $LDFLAGS"
|
|
|
|
|
2005-10-04 04:39:14 +08:00
|
|
|
FFMPEG_PREFIX=/usr
|
2004-03-22 18:33:22 +08:00
|
|
|
# Ask for ffmpeg path:.
|
2004-03-17 00:40:29 +08:00
|
|
|
AC_ARG_WITH(ffmpeg,
|
2005-12-02 00:18:40 +08:00
|
|
|
[ --with-ffmpeg=<path> prefix of ffmpeg root directory for libavcodec etc, default /usr],
|
2004-03-17 00:40:29 +08:00
|
|
|
[FFMPEG_PREFIX=$with_ffmpeg],
|
|
|
|
AC_MSG_WARN([You can call configure with the --with-ffmpeg option.
|
2005-10-04 04:39:14 +08:00
|
|
|
This tells configure where to find the ffmpeg root directory within which are the libavcodec
|
|
|
|
and libavformat files that can be used to build true MPEG streaming into ZoneMinder. Ensure that
|
|
|
|
your copy of ffmpeg has installed libraries as well as binaries (use 'make installlib'). If you
|
|
|
|
are using a local install of ffmpeg you may have to remove or rename a previous real installation
|
|
|
|
as the headers and libraries from that will probably be picked up before your local copy.
|
2004-03-22 18:33:22 +08:00
|
|
|
e.g. --with-ffmpeg=/usr/local])
|
2004-03-17 00:40:29 +08:00
|
|
|
)
|
|
|
|
AC_SUBST(FFMPEG_PREFIX)
|
2004-03-19 05:24:05 +08:00
|
|
|
FFMPEG_LIBS="-L${FFMPEG_PREFIX}/lib"
|
|
|
|
FFMPEG_CFLAGS="-I${FFMPEG_PREFIX}/include"
|
2004-03-17 00:40:29 +08:00
|
|
|
AC_SUBST(FFMPEG_LIBS)
|
|
|
|
AC_SUBST(FFMPEG_CFLAGS)
|
|
|
|
|
|
|
|
LDFLAGS="${FFMPEG_LIBS} $LDFLAGS"
|
|
|
|
|
2005-12-02 00:18:40 +08:00
|
|
|
EXTRA_LIBS=
|
|
|
|
# Ask for extra libraries and paths:.
|
|
|
|
AC_ARG_WITH(extralibs,
|
|
|
|
[ --with-extralibs="<libs>" string containing extra libraries to pass to link, default empty],
|
|
|
|
[EXTRA_LIBS=$with_extralibs],
|
|
|
|
AC_MSG_WARN([You can call configure with the --with-extralibs option.
|
|
|
|
Ordinarily you will need to use this option only when your copy of ffmpeg has been built
|
|
|
|
with support for additional formats and you would use this option to detail which additional
|
|
|
|
libraries ffmpeg was built with so that it is able to link successfully with ZoneMinder.
|
|
|
|
You will need to wrap this option in quotes if it contains any spaces.
|
|
|
|
e.g. --with-extralibs="-lmp3lame"])
|
2004-03-17 00:40:29 +08:00
|
|
|
)
|
2005-12-02 00:18:40 +08:00
|
|
|
AC_SUBST(EXTRA_LIBS)
|
2004-03-17 00:40:29 +08:00
|
|
|
|
2005-12-02 00:18:40 +08:00
|
|
|
LDFLAGS="$LDFLAGS ${EXTRA_LIBS}"
|
2004-03-17 00:40:29 +08:00
|
|
|
|
2002-12-11 07:02:35 +08:00
|
|
|
# Ask user for path to web stuff:.
|
|
|
|
AC_ARG_WITH(webdir,
|
2005-12-02 00:18:40 +08:00
|
|
|
[ --with-webdir=<path> prefix of web directory],
|
2002-12-11 07:02:35 +08:00
|
|
|
[WEB_PREFIX=$with_webdir],
|
|
|
|
AC_MSG_ERROR([You must call configure with the --with-webdir option.
|
|
|
|
This tells configure where to install PHP and web files and scripts.
|
|
|
|
e.g. --with-webdir=/var/www/html or --with-mysql=/www/vhtdocs/<site>])
|
|
|
|
)
|
|
|
|
AC_SUBST(WEB_PREFIX)
|
|
|
|
|
|
|
|
# Ask user for path to cgi stuff:.
|
|
|
|
AC_ARG_WITH(cgidir,
|
2005-12-02 00:18:40 +08:00
|
|
|
[ --with-cgidir=<path> prefix of cgi directory],
|
2002-12-11 07:02:35 +08:00
|
|
|
[CGI_PREFIX=$with_cgidir],
|
|
|
|
AC_MSG_ERROR([You must call configure with the --with-cgidir option.
|
|
|
|
This tells configure where to install cgi files and scripts.
|
|
|
|
e.g. --with-cgidir=/var/www/cgi-bin or --with-mysql=/www/vhtdocs/<site>/cgi-bin])
|
|
|
|
)
|
|
|
|
AC_SUBST(CGI_PREFIX)
|
|
|
|
|
|
|
|
WEB_USER=apache
|
|
|
|
# Ask user for web user name:.
|
|
|
|
AC_ARG_WITH(webuser,
|
2005-12-02 00:18:40 +08:00
|
|
|
[ --with-webuser=<user> name of web user, default apache],
|
2002-12-11 07:02:35 +08:00
|
|
|
[WEB_USER=$with_webuser],
|
|
|
|
AC_MSG_WARN([You can call configure with the --with-webuser option.
|
|
|
|
This tells configure what the user name of the web user is if it is not the default of 'apache'.
|
|
|
|
e.g. --with-webuser=apache or --with-webuser=web])
|
|
|
|
)
|
|
|
|
AC_SUBST(WEB_USER)
|
|
|
|
|
|
|
|
WEB_GROUP=apache
|
|
|
|
# Ask group for web group name:.
|
|
|
|
AC_ARG_WITH(webgroup,
|
2005-12-02 00:18:40 +08:00
|
|
|
[ --with-webgroup=<group> name of web group, default apache],
|
2002-12-11 07:02:35 +08:00
|
|
|
[WEB_GROUP=$with_webgroup],
|
|
|
|
AC_MSG_WARN([You can call configure with the --with-webgroup option.
|
|
|
|
This tells configure what the group name of the web group is if it is not the default of 'apache'.
|
|
|
|
e.g. --with-webgroup=apache or --with-webgroup=web])
|
|
|
|
)
|
|
|
|
AC_SUBST(WEB_GROUP)
|
|
|
|
|
2005-12-02 00:20:24 +08:00
|
|
|
ENABLE_DEBUG=yes
|
|
|
|
# Ask group for web group name:.
|
|
|
|
AC_ARG_ENABLE(debug,
|
|
|
|
[ --enable-debug=<yes|no> enable or disabled debug, default enabled],
|
|
|
|
[ENABLE_DEBUG=$enable_debug],
|
|
|
|
AC_MSG_WARN([You can call configure with the --enable-debug=<yes|no> or --disable-debug option.
|
|
|
|
This tells configure whether to compile ZoneMinder with debug included. Although debug is included
|
|
|
|
by default it is not output unless explicitly switched on elsewhere. These checks may induce a
|
|
|
|
small penalty on performance and if you are after squeezing the maximum possible performance out
|
|
|
|
of ZoneMinder you may use this switch to prevent debug from being compiled in.
|
|
|
|
e.g. --enable-debug=yes or --disable-debug])
|
|
|
|
)
|
2005-12-16 18:12:40 +08:00
|
|
|
if test "$enable_debug" != "yes"; then
|
2005-12-02 00:20:24 +08:00
|
|
|
AC_DEFINE(ZM_DBG_OFF,1,"Whether debug is switched off and compiled out")
|
|
|
|
fi
|
|
|
|
|
2002-12-10 20:24:10 +08:00
|
|
|
AC_PROG_CC
|
|
|
|
AC_PROG_CXX
|
|
|
|
AC_PROG_INSTALL
|
|
|
|
AC_PROG_MAKE_SET
|
2002-09-17 01:10:34 +08:00
|
|
|
|
|
|
|
AC_HEADER_STDC
|
|
|
|
|
2002-12-10 20:24:10 +08:00
|
|
|
AC_LANG_CPLUSPLUS
|
2002-09-17 01:10:34 +08:00
|
|
|
|
2005-10-04 04:39:14 +08:00
|
|
|
AC_SUBST(LDFLAGS)
|
2004-03-04 23:05:54 +08:00
|
|
|
|
2005-12-16 18:12:40 +08:00
|
|
|
AC_CHECK_HEADERS(mysql/mysql.h,,AC_MSG_ERROR(zm requires mysql/mysql.h),)
|
2004-03-19 05:47:09 +08:00
|
|
|
AC_CHECK_HEADERS(pcre/pcre.h,,,)
|
|
|
|
AC_CHECK_HEADERS(pcre.h,,,)
|
2003-03-28 01:18:41 +08:00
|
|
|
AC_CHECK_DECLS(round,,,[#include <math.h>])
|
2004-01-28 01:21:56 +08:00
|
|
|
AC_CHECK_DECLS(strsignal,,,[#include <string.h>])
|
2005-12-16 18:12:40 +08:00
|
|
|
AC_CHECK_DECLS(MD5,,AC_MSG_ERROR(zm requires openssl/md5.h),[#include <openssl/md5.h>])
|
2002-12-10 20:24:10 +08:00
|
|
|
AC_CHECK_LIB(jpeg,jpeg_start_compress,,AC_MSG_ERROR(zm requires libjpeg.a))
|
|
|
|
AC_CHECK_LIB(z,compress,,AC_MSG_ERROR(zm requires libz.a))
|
|
|
|
AC_CHECK_LIB(dl,dlsym,,AC_MSG_ERROR(zm requires libdl.a))
|
2003-05-23 00:31:54 +08:00
|
|
|
AC_CHECK_LIB(mysqlclient,mysql_init,,AC_MSG_ERROR(zm requires libmysqlclient.a))
|
2004-12-30 02:03:13 +08:00
|
|
|
AC_CHECK_LIB(crypto,MD5,,AC_MSG_WARN(libcrypto.a is required for authenticated streaming))
|
2005-12-16 18:12:40 +08:00
|
|
|
AC_CHECK_LIB(pcre,pcre_compile,,AC_MSG_WARN(libpcre.a may be required for remote/network camera support))
|
2005-10-04 04:39:14 +08:00
|
|
|
AC_CHECK_LIB(avutil,ff_gcd,,AC_MSG_WARN(libavutil.a may be required for MPEG streaming))
|
2004-03-04 23:05:54 +08:00
|
|
|
AC_CHECK_LIB(avcodec,avcodec_init,,AC_MSG_WARN(libavcodec.a is required for MPEG streaming))
|
|
|
|
AC_CHECK_LIB(avformat,av_new_stream,,AC_MSG_WARN(libavformat.a is required for MPEG streaming),-lavcodec)
|
2002-12-10 20:24:10 +08:00
|
|
|
|
2005-12-16 18:12:40 +08:00
|
|
|
AC_PROG_PERL_VERSION(5.6.0)
|
|
|
|
|
2005-12-20 00:55:16 +08:00
|
|
|
AC_PROG_PERL_MODULES(Sys::Syslog,,AC_MSG_ERROR(zm requires SYS:Syslog))
|
2005-12-16 18:12:40 +08:00
|
|
|
AC_PROG_PERL_MODULES(DBI,,AC_MSG_ERROR(zm requires DBI))
|
|
|
|
AC_PROG_PERL_MODULES(DBD::mysql,,AC_MSG_ERROR(zm requires DBD::mysql))
|
|
|
|
AC_PROG_PERL_MODULES(Getopt::Long,,AC_MSG_ERROR(zm requires Getopt::Long))
|
|
|
|
AC_PROG_PERL_MODULES(Time::HiRes,,AC_MSG_ERROR(zm requires Time::HiRes))
|
|
|
|
AC_PROG_PERL_MODULES(Date::Manip,,AC_MSG_ERROR(zm requires Date::Manip))
|
|
|
|
|
|
|
|
AC_PROG_PERL_MODULES(LWP::UserAgent,,AC_MSG_WARN(LWP::UserAgent is required for PTZ network camera control))
|
|
|
|
AC_PROG_PERL_MODULES(Device::SerialPort,,AC_MSG_WARN(Device::SerialPort is required for RS232/RS485 PTZ camera control))
|
|
|
|
AC_PROG_PERL_MODULES(Net::FTP,,AC_MSG_WARN(Net::FTP is required for automatic event uploading))
|
|
|
|
AC_PROG_PERL_MODULES(Archive::Tar,,AC_MSG_WARN(Archive::Tar may be required for automatic event uploading))
|
|
|
|
AC_PROG_PERL_MODULES(Archive::Zip,,AC_MSG_WARN(Archive::Zip may be required for automatic event uploading))
|
|
|
|
AC_PROG_PERL_MODULES(Net::SMTP,,AC_MSG_WARN(Net::SMTP may be required for automatic event email notification))
|
|
|
|
AC_PROG_PERL_MODULES(MIME::Lite,,AC_MSG_WARN(MIME::Lite may be required for automatic event email notification))
|
|
|
|
AC_PROG_PERL_MODULES(MIME::Entity,,AC_MSG_WARN(MIME::Entity may be required for automatic event email notification))
|
|
|
|
AC_PROG_PERL_MODULES(X10::ActiveHome,,AC_MSG_WARN(X10::ActiveHome is required for X.10 support))
|
|
|
|
|
|
|
|
AC_DEFINE_DIR([BINDIR],[bindir],[Expanded binary directory])
|
|
|
|
AC_DEFINE_DIR([LIBDIR],[libdir],[Expanded library directory])
|
2005-12-21 23:19:57 +08:00
|
|
|
AC_SUBST(RUNDIR,"/var/run")
|
|
|
|
AC_SUBST(ZM_RUNDIR,"$RUNDIR/zm")
|
|
|
|
AC_SUBST(ZM_PID,"$ZM_RUNDIR/zm.pid")
|
2005-12-16 18:12:40 +08:00
|
|
|
AC_DEFINE_DIR([SYSCONFDIR],[sysconfdir],[Expanded configuration directory])
|
|
|
|
AC_SUBST(ZM_CONFIG,"$SYSCONFDIR/zm.conf")
|
|
|
|
|
|
|
|
AC_OUTPUT(Makefile src/Makefile web/Makefile web/graphics/Makefile scripts/Makefile db/Makefile)
|
2005-12-21 07:00:58 +08:00
|
|
|
AC_OUTPUT(zm.conf src/zm_config.h web/zm_config.php scripts/zm db/zm_create.sql)
|
2005-12-21 00:09:21 +08:00
|
|
|
AC_OUTPUT(scripts/ZoneMinder/lib/ZoneMinder/Base.pm scripts/ZoneMinder/lib/ZoneMinder/Config.pm scripts/ZoneMinder/lib/ZoneMinder/ConfigAdmin.pm )
|
2005-12-16 18:12:40 +08:00
|
|
|
|
|
|
|
AC_CHECK_FILE(scripts/ZoneMinder/Makefile,,[cd scripts/ZoneMinder;perl Makefile.PL])
|