2009-03-24 05:59:13 +08:00
AC_PREREQ(2.59)
2014-10-19 04:23:13 +08:00
AC_INIT(zm,1.28.0,[http://www.zoneminder.com/forums/ - Please check FAQ first],zoneminder,http://www.zoneminder.com/downloads.html)
2005-12-16 18:12:40 +08:00
AM_INIT_AUTOMAKE
2014-11-12 02:46:20 +08:00
LT_PREREQ([2.4.2])
LT_INIT([dlopen])
AC_CONFIG_MACRO_DIR([m4])
2008-07-14 21:54:50 +08:00
AC_CONFIG_SRCDIR(src/zm.h)
2013-08-31 09:57:52 +08:00
AC_CONFIG_HEADERS(config.h)
2002-09-17 01:10:34 +08:00
2013-04-30 03:32:16 +08:00
AC_SUBST([AM_CXXFLAGS], [-D__STDC_CONSTANT_MACROS])
2013-11-01 21:47:28 +08:00
AC_SUBST(VERSION)
2014-07-30 02:43:13 +08:00
#
# Platform specific setup
#
#############################
AC_CANONICAL_HOST
# Check for which host we are on and setup a few things
# specifically based on the host
case $host_os in
darwin* )
# Do something specific for mac
HOST_OS='darwin'
;;
linux*)
# Do something specific for linux
HOST_OS='linux'
;;
*BSD*)
# Do something specific for BSD
HOST_OS='BSD'
;;
*)
#Default Case
AC_MSG_ERROR([Your platform is not currently supported])
;;
esac
AC_SUBST(HOST_OS)
2004-09-07 16:39:18 +08:00
2013-10-17 04:10:31 +08:00
AC_ARG_VAR(ZM_DB_TYPE,[Type of the ZoneMinder database, default mysql])
2009-01-28 19:23:50 +08:00
AC_ARG_VAR(ZM_DB_HOST,[Hostname where ZoneMinder database located, default localhost])
AC_ARG_VAR(ZM_DB_NAME,[Name of ZoneMinder database, default zm])
AC_ARG_VAR(ZM_DB_USER,[Name of ZoneMinder database user, default zmuser])
AC_ARG_VAR(ZM_DB_PASS,[Password of ZoneMinder database user, default zmpass])
AC_ARG_VAR(ZM_SSL_LIB,[Library to use for ssl functions, default gnutls])
2013-08-17 22:44:40 +08:00
AC_ARG_VAR(ZM_MYSQL_ENGINE,[MySQL engine to use with database, default InnoDB])
2011-01-07 19:10:18 +08:00
AC_ARG_VAR(ZM_RUNDIR,[Location of transient process files, default /var/run/zm])
2014-10-05 22:42:47 +08:00
AC_ARG_VAR(ZM_SOCKDIR,[Location of Unix domain socket files, default /var/run/zm])
AC_ARG_VAR(ZM_TMPDIR,[Location of temporary files, default /var/tmp/zm])
2011-01-07 19:10:18 +08:00
AC_ARG_VAR(ZM_LOGDIR,[Location of generated log files, default /var/log/zm])
2005-12-16 18:12:40 +08:00
2013-11-05 04:38:21 +08:00
if test "$ZM_DB_TYPE" == ""; then
2013-11-07 06:47:23 +08:00
AC_SUBST(ZM_DB_TYPE,[mysql])
2013-11-05 04:38:21 +08:00
fi
2005-12-16 18:12:40 +08:00
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
2008-02-14 07:44:44 +08:00
if test "$ZM_SSL_LIB" == ""; then
AC_SUBST(ZM_SSL_LIB,gnutls)
fi
2009-01-28 19:23:50 +08:00
if test "$ZM_MYSQL_ENGINE" == ""; then
2013-08-17 22:44:40 +08:00
AC_SUBST(ZM_MYSQL_ENGINE,InnoDB)
2009-01-28 19:23:50 +08:00
fi
2011-01-07 19:10:18 +08:00
if test "$ZM_RUNDIR" == ""; then
AC_SUBST(ZM_RUNDIR,[/var/run/zm])
fi
2014-10-05 22:42:47 +08:00
if test "$ZM_SOCKDIR" == ""; then
2014-10-06 00:40:10 +08:00
AC_SUBST(ZM_SOCKDIR,[/var/run/zm])
2014-10-05 22:42:47 +08:00
fi
2011-01-07 19:10:18 +08:00
if test "$ZM_TMPDIR" == ""; then
AC_SUBST(ZM_TMPDIR,[/tmp/zm])
fi
if test "$ZM_LOGDIR" == ""; then
AC_SUBST(ZM_LOGDIR,[/var/log/zm])
fi
2005-12-16 18:12:40 +08:00
2006-01-12 08:03:42 +08:00
LIB_ARCH=lib
AC_ARG_WITH(libarch,
[ --with-libarch=<lib> architecture library path to use, default lib],
[LIB_ARCH=$with_libarch],
AC_MSG_WARN([You can call configure with the --with-libarch option.
This tells configure where to find architecture specific libraries.
The default of 'lib' is usually ok but 64 bit machines may require lib64.
e.g. --with-libarch=lib or --with-libarch=lib64])
)
AC_SUBST(LIB_ARCH)
2014-07-30 02:43:13 +08:00
LDFLAGS="-L/usr/lib/${build_alias} ${LDFLAGS}"
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
2006-01-12 08:03:42 +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)
2006-01-12 08:03:42 +08:00
MYSQL_LIBS="-L${MYSQL_PREFIX}/${LIB_ARCH}/mysql"
2002-09-17 01:10:34 +08:00
MYSQL_CFLAGS="-I${MYSQL_PREFIX}/include"
AC_SUBST(MYSQL_LIBS)
AC_SUBST(MYSQL_CFLAGS)
2014-07-30 02:43:13 +08:00
LDFLAGS="$LDFLAGS ${MYSQL_LIBS}"
MARIADB_PREFIX=/usr
AC_ARG_WITH(mariadb,
[ --with-mariadb=<path> prefix of MariaDB installation, default /usr],
[MYSQL_PREFIX=$with_mariadb],
AC_MSG_WARN([You can call configure with the --with-mariadb option.
This tells configure where to find the mariaDB C library and headers if configure cannot
locate them automatically.
e.g. --with-mariadb=/usr/local or --with-mariadb=/usr])
)
AC_SUBST(MARIADB_PREFIX)
MARIADB_LIBS="-L${MARIADB_PREFIX}/${LIB_ARCH}/mariadb"
MARIADB_CFLAGS="-I${MARIADB_PREFIX}/include"
AC_SUBST(MARIADB_LIBS)
AC_SUBST(MARIADB_CFLAGS)
LDFLAGS="$LDFLAGS ${MARIADB_LIBS}"
2002-09-17 01:10:34 +08:00
2014-08-10 21:47:11 +08:00
POLKIT_PREFIX=/usr
AC_ARG_WITH(polkit,
[ --with-polkit=<path> prefix of polkit root directory, default /usr],
[POLKIT_PREFIX=$with_polkit],
AC_MSG_WARN([You can call configure with the --with-polkit option.
This tells configure where to place the polkit policy files.])
)
AC_SUBST(POLKIT_PREFIX)
PKG_CHECK_MODULES(POLKIT, polkit-gobject-1)
2003-05-23 00:31:54 +08:00
2005-10-04 04:39:14 +08:00
FFMPEG_PREFIX=/usr
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)
2006-01-12 08:03:42 +08:00
FFMPEG_LIBS="-L${FFMPEG_PREFIX}/${LIB_ARCH}"
2012-07-17 17:23:13 +08:00
FFMPEG_CFLAGS="-I${FFMPEG_PREFIX}/include -D__STDC_CONSTANT_MACROS"
2004-03-17 00:40:29 +08:00
AC_SUBST(FFMPEG_LIBS)
AC_SUBST(FFMPEG_CFLAGS)
LDFLAGS="${FFMPEG_LIBS} $LDFLAGS"
2008-12-06 01:20:21 +08:00
CFLAGS="${FFMPEG_CFLAGS} $CFLAGS"
CPPFLAGS="${FFMPEG_CFLAGS} $CPPFLAGS"
2004-03-17 00:40:29 +08:00
2005-12-02 00:18:40 +08:00
EXTRA_LIBS=
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
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.
2009-04-15 04:20:34 +08:00
e.g. --with-webdir=/var/www/html or --with-webdir=/www/vhtdocs/<site>])
2002-12-11 07:02:35 +08:00
)
AC_SUBST(WEB_PREFIX)
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.
2009-04-15 04:20:34 +08:00
e.g. --with-cgidir=/var/www/cgi-bin or --with-webdir=/www/vhtdocs/<site>/cgi-bin])
2002-12-11 07:02:35 +08:00
)
AC_SUBST(CGI_PREFIX)
2014-11-12 06:03:25 +08:00
ENABLE_PLUGIN_SUPPORT=no
AC_ARG_ENABLE([plugin-support],
[ --enable-plugin-support=<yes|no> enable or disable plugin support, default disabled],
[ENABLE_PLUGIN_SUPPORT=$enable_plugin_support],
[AC_MSG_WARN([You can call configure with the --enable-plugin-support=<yes|no>
or --disable-plugin-support option.
This tells configure whether to compile ZoneMinder with plugin support.
e.g. --enable-plugin-support=yes or --disable-plugin-support])]
)
if test "$ENABLE_PLUGIN_SUPPORT" == "yes"; then
if test "$enable_shared" = "no"; then
AC_MSG_ERROR([Plugin support is enabled and shared library are disabled.
If you really want plugin support you must not call configure with
--enable-shared=no or --disabled-shared])
fi
AC_ARG_WITH(pluginsdir,
[ --with-pluginsdir=<path> plugins directory (requires --enable-plugin-support=yes)],
[PLUGINSLIBDIR=$with_pluginsdir],
AC_MSG_ERROR([Plugin support is enabled.
You must call configure with the --with-pluginsdir options.
This tells configure where to install plugin library files.
e.g. --with-pluginsdir=/usr/lib/zoneminder/plugins])
)
AC_SUBST(PLUGINSLIBDIR)
PLUGINSCONFDIR="${sysconfdir}/plugins.d"
AC_ARG_WITH(pluginsconfdir,
[ --with-pluginsconfdir=<path> directory of plugin configuration files (requires --enable-plugin-support=yes)],
[PLUGINSCONFDIR=$with_pluginsconfdir],
AC_MSG_WARN([You can call configure with the --with-pluginsconfdir options.
This tells configure where to install the plugin configuration files.
The default is "${PLUGINSCONFDIR}".
e.g. --with-pluginsconfdir=/etc/zm/plugins.d])
)
AC_SUBST(PLUGINSCONFDIR)
PLUGINSWEBDIR="$WEB_PREFIX/plugins"
AC_SUBST(PLUGINSWEBDIR)
AC_DEFINE(ZM_PLUGINS_ON,1,"Whether plugin support is switched on and compiled")
PLUGINSEXT=".so"
AC_SUBST(PLUGINSEXT)
AC_DEFINE_UNQUOTED(DEFAULT_PLUGIN_EXT,"${PLUGINSEXT}",[File extension to detect plugins])
fi
AM_CONDITIONAL([ZM_HAS_PLUGIN_SUPPORT], [test "x$ENABLE_PLUGIN_SUPPORT" = xyes])
2002-12-11 07:02:35 +08:00
WEB_USER=apache
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
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)
2011-01-04 07:27:58 +08:00
WEB_HOST=zm.local
AC_ARG_WITH(webhost,
[ --with-webhost=<hostname> name of web hostname, default zm.local],
[WEB_HOST=$with_webhost],
AC_MSG_WARN([You can call configure with the --with-webhost option.
This tells configure what the host name is for name based virtual hosting. This is only used to populate the sample web/zmHttpd.conf file.
e.g. --with-webhost=zm.localdomain])
)
AC_SUBST(WEB_HOST)
2005-12-02 00:20:24 +08:00
ENABLE_DEBUG=yes
AC_ARG_ENABLE(debug,
2008-02-14 07:44:44 +08:00
[ --enable-debug=<yes|no> enable or disable debug, default enabled],
2005-12-02 00:20:24 +08:00
[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])
)
2006-04-05 20:22:07 +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
2009-12-03 02:39:16 +08:00
ENABLE_MMAP=yes
2008-07-14 23:21:16 +08:00
AC_ARG_ENABLE(mmap,
2011-05-23 23:16:57 +08:00
[ --enable-mmap=<yes|no> enable or disabled mapped memory versus shared memory, default mapped],
2008-07-14 23:21:16 +08:00
[ENABLE_MMAP=$enable_mmap],
AC_MSG_WARN([You can call configure with the --enable-mmap=<yes|no> or --disable-mmap option.
This tells configure whether to compile ZoneMinder with mmap support rather than IPC shared
2011-05-23 23:16:57 +08:00
memory. This is a feature that uses memory mapped into files which all processes can share.
2009-12-03 02:39:16 +08:00
Memory mapping requires less configuration and is more flexible than shared memory but may
slow down your system unless the mapped files are configured to reside on a fast or RAM based
2011-05-23 23:16:57 +08:00
filesystem which will normally be the case by default.
2008-07-14 23:21:16 +08:00
e.g. --enable-mmap=yes or --disable-mmap])
)
2011-02-16 05:59:06 +08:00
if test "$ENABLE_MMAP" == "yes"; then
2008-07-14 23:21:16 +08:00
AC_DEFINE(ZM_MEM_MAPPED,1,"Whether to use mapped rather than shared memory")
else
AC_DEFINE(ZM_MEM_MAPPED,0,"Whether to use mapped rather than shared memory")
fi
AC_SUBST(ENABLE_MMAP)
2008-07-14 21:54:50 +08:00
# Compiler
AC_LANG_CPLUSPLUS
# Checks for programs.
2002-12-10 20:24:10 +08:00
AC_PROG_CXX
2008-07-14 21:54:50 +08:00
AC_PROG_CC
2002-12-10 20:24:10 +08:00
AC_PROG_INSTALL
2008-07-14 21:54:50 +08:00
AC_PROG_LN_S
2002-12-10 20:24:10 +08:00
AC_PROG_MAKE_SET
2002-09-17 01:10:34 +08:00
2009-01-29 19:29:51 +08:00
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_CONST
AC_TYPE_UID_T
AC_C_INLINE
AC_TYPE_MODE_T
AC_TYPE_SIZE_T
AC_HEADER_TIME
AC_STRUCT_TM
AC_TYPE_SIGNAL
AC_CHECK_TYPES(siginfo_t,,,[#include <signal.h>])
AC_CHECK_TYPES(ucontext_t,,,[#include <signal.h>])
# Checks for library functions.
AC_PROG_GCC_TRADITIONAL
AC_FUNC_MALLOC
AC_FUNC_MMAP
AC_FUNC_SELECT_ARGTYPES
AC_FUNC_STAT
AC_FUNC_STRFTIME
AC_FUNC_STRTOD
AC_FUNC_VPRINTF
2013-10-07 15:37:58 +08:00
AC_CHECK_FUNCS([gethostbyname gethostname gettimeofday memmove memset mkdir munmap posix_memalign putenv select sendfile socket sqrt strcasecmp strchr strcspn strerror strncasecmp strrchr strspn strstr strtol strtoull])
2011-06-21 17:19:10 +08:00
AC_CHECK_FUNCS([syscall sleep usleep ioctl ioctlsocket sigaction])
2009-01-29 19:29:51 +08:00
2008-10-14 21:49:18 +08:00
# Other programs
AC_CHECK_PROG(OPT_FFMPEG,ffmpeg,yes,no)
AC_PATH_PROG(PATH_FFMPEG,ffmpeg)
AC_CHECK_PROG(OPT_NETPBM,pnmscale,yes,no)
AC_PATH_PROG(PATH_NETPBM,pnmscale)
2011-02-16 05:59:06 +08:00
if test "$OPT_NETPBM" == "yes"; then
2008-10-14 21:49:18 +08:00
PATH_NETPBM=`dirname $PATH_NETPBM`
2009-03-08 18:41:49 +08:00
fi
2008-10-14 21:49:18 +08:00
2008-07-14 21:54:50 +08:00
# Checks for libraries.
2014-07-30 02:43:13 +08:00
AC_SEARCH_LIBS(mysql_init,[mysqlclient mariadbclient],,AC_MSG_ERROR(zm requires libmysqlclient.a or libmariadbclient.a))
2008-07-14 21:54:50 +08:00
AC_CHECK_LIB(jpeg,jpeg_start_compress,,AC_MSG_ERROR(zm requires libjpeg.a))
2008-07-16 16:44:58 +08:00
AC_CHECK_LIB(pthread,pthread_create,,AC_MSG_ERROR(zm requires libpthread.a))
2014-11-12 03:24:48 +08:00
AC_CHECK_LIB([dl],
[dlsym],
[AC_SUBST([DL_LIBS],["-ldl"])AC_DEFINE([HAVE_LIBDL],[1],[Define to 1 if you have the 'dl' library (-ldl).])],
[AC_MSG_ERROR(zm requires libdl.a)]
)
2008-07-14 21:54:50 +08:00
if test "$ZM_SSL_LIB" == "openssl"; then
2012-07-04 17:00:20 +08:00
AC_CHECK_HEADERS(openssl/md5.h,,AC_MSG_WARN(zm requires openssl/md5.h header to be installed for openssl),)
2014-11-12 03:24:48 +08:00
AC_CHECK_LIB([crypto],
[MD5],
[AC_SUBST([CRYPTO_LIBS],["-lcrypto"])AC_DEFINE([HAVE_LIBCRYPTO],[1],[Define to 1 if you have the 'crypto' library (-lcrypto).])],
[AC_MSG_WARN([libcrypto.a is required for authenticated streaming - use ZM_SSL_LIB option to select gnutls instead])]
)
2008-07-14 21:54:50 +08:00
else
2012-07-04 17:00:20 +08:00
AC_CHECK_HEADERS(gnutls/openssl.h,AC_SUBST(ZM_HAS_GNUTLS_OPENSSL,1),AC_SUBST(ZM_HAS_GNUTLS_OPENSSL,0),)
AC_CHECK_HEADERS(gnutls/gnutls.h,AC_SUBST(ZM_HAS_GNUTLS,1),AC_SUBST(ZM_HAS_GNUTLS,0),)
if test "$ZM_HAS_GNUTLS_OPENSSL" == "0" && test "$ZM_HAS_GNUTLS" == "0"; then
AC_MSG_WARN(gnutls is required for authenticated streaming - use ZM_SSL_LIB option to select openssl instead)
fi
2013-04-30 03:32:16 +08:00
AC_CHECK_HEADERS(gcrypt.h,,AC_MSG_WARN(zm requires libgcrypt headers to be installed for gnutls),)
2014-11-12 03:24:48 +08:00
AC_CHECK_LIB([gcrypt],
[gcry_check_version],
[AC_SUBST([GCRYPT_LIBS],["-lgcrypt"])AC_DEFINE([HAVE_LIBGCRYPT],[1],[Define to 1 if you have the 'gcrypt' library (-lgcrypt).])],
[AC_MSG_WARN([libgcrypt.a is required for authenticated streaming - use ZM_SSL_LIB option to select openssl instead])]
)
AC_CHECK_LIB([gnutls],
[gnutls_fingerprint],
[AC_SUBST([GNUTLS_LIBS],["-lgnutls"])AC_DEFINE([HAVE_LIBGNUTLS],[1],[Define to 1 if you have the 'gnutls' library (-lgnutls).])],
[AC_MSG_WARN([libgnutls.a is required for authenticated streaming - use ZM_SSL_LIB option to select openssl instead])]
)
2013-08-17 23:24:30 +08:00
if test "$ZM_HAS_GNUTLS_OPENSSL" == "1"; then
2014-11-12 03:24:48 +08:00
AC_CHECK_LIB([gnutls-openssl],
[MD5],
[AC_SUBST([GNUTLS_OPENSSL_LIBS],["-lgnutls-openssl"])AC_DEFINE([HAVE_LIBGNUTLS_OPENSSL],[1],[Define to 1 if you have the 'gnutls-openssl' library (-lgnutls-openssl).])],
[AC_MSG_WARN([libgnutls.a is required for authenticated streaming - use ZM_SSL_LIB option to select openssl instead])]
)
2008-07-14 21:54:50 +08:00
fi
2013-08-17 23:24:30 +08:00
fi
2014-11-12 03:24:48 +08:00
AC_CHECK_LIB([pcre],
[pcre_compile],
[AC_SUBST([PCRE_LIBS],["-lpcre"])AC_DEFINE([HAVE_LIBPCRE],[1],[Define to 1 if you have the 'pcre' library (-lpcre).])],
[AC_MSG_WARN([libpcre.a may be required for remote/network camera support])]
)
2011-06-06 01:03:55 +08:00
AC_CHECK_LIB(z,zlibVersion)
2014-11-12 03:24:48 +08:00
AC_CHECK_LIB([x264],
[x264_predict_16x16_init],
[AC_SUBST([X264_LIBS],["-lx264"])AC_DEFINE([HAVE_LIBX264],[1],[Define to 1 if you have the 'x264' library (-lx264).])],
)
AC_CHECK_LIB([avutil],
[av_malloc],
[AC_SUBST([AVUTIL_LIBS],["-lavutil"])AC_DEFINE([HAVE_LIBAVUTIL],[1],[Define to 1 if you have the 'avutil' library (-lavutil).])],
[AC_MSG_WARN([libavutil.a may be required for MPEG streaming])]
)
2011-02-08 22:31:53 +08:00
# Don't bother to warn about this one
2014-11-12 03:24:48 +08:00
AC_CHECK_LIB([avcore],
[av_image_copy],
[AC_SUBST([AVCORE_LIBS],["-lavcore"])AC_DEFINE([HAVE_LIBAVCORE],[1],[Define to 1 if you have the 'avcore' library (-lavcore).])]
)
AC_CHECK_LIB([avcodec],
[avcodec_version],
[AC_SUBST([AVCODEC_LIBS],["-lavcodec"])AC_DEFINE([HAVE_LIBAVCODEC],[1],[Define to 1 if you have the 'avcodec' library (-lavcodec).])],
[AC_MSG_WARN([libavcodec.a is required for MPEG streaming])]
)
AC_CHECK_LIB([avformat],
[avformat_version],
[AC_SUBST([AVFORMAT_LIBS],["-lavformat"])AC_DEFINE([HAVE_LIBAVFORMAT],[1],[Define to 1 if you have the 'avformat' library (-lavformat).])],
[AC_MSG_WARN([libavformat.a is required for MPEG streaming])]
)
2013-03-17 07:45:21 +08:00
#AC_CHECK_LIB(avcodec,avcodec_open,,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))
2014-11-12 03:24:48 +08:00
AC_CHECK_LIB([avdevice],
[avdevice_register_all],
[AC_SUBST([AVDEVICE_LIBS],["-lavdevice"])AC_DEFINE([HAVE_LIBAVDEVICE],[1],[Define to 1 if you have the 'avdevice' library (-lavdevice).])],
[AC_MSG_WARN([libavdevice.a may be required for MPEG streaming])]
)
AC_CHECK_LIB([swscale],
[sws_scale],
[AC_SUBST([SWSCALE_LIBS],["-lswscale"])AC_DEFINE([HAVE_LIBSWSCALE],[1],[Define to 1 if you have the 'swscale' library (-lswscale).])]
)
AC_CHECK_LIB([vlc],
[libvlc_new],
[AC_SUBST([VLC_LIBS],["-lvlc"])AC_DEFINE([HAVE_LIBVLC],[1],[Define to 1 if you have the 'vlc' library (-lvlc).])],
[AC_MSG_WARN([libvlc.a may be required for streaming])]
)
AC_CHECK_LIB([bz2],
[BZ2_bzCompress],
[AC_SUBST([BZ2_LIBS],["-lbz2"])AC_DEFINE([HAVE_LIBBZ2],[1],[Define to 1 if you have the 'bz2' library (-lbz2).])],
[AC_MSG_WARN([zm requires libbz2.a for recent versions of ffmpeg])]
)
2009-03-20 20:39:29 +08:00
AC_CHECK_LIB(z,compress,,)
2014-11-12 03:24:48 +08:00
AC_CHECK_LIB([curl],
[curl_global_init],
[AC_SUBST([CURL_LIBS],["-lcurl"])AC_DEFINE([HAVE_LIBCURL],[1],[Define to 1 if you have the 'curl' library (-lcurl).])]
)
2002-09-17 01:10:34 +08:00
2008-07-14 21:54:50 +08:00
# Checks for header files.
AC_FUNC_ALLOCA
AC_HEADER_STDC
2011-06-21 17:19:10 +08:00
AC_CHECK_HEADERS([fcntl.h limits.h memory.h stddef.h stdlib.h string.h strings.h sys/param.h sys/time.h syslog.h unistd.h values.h])
2011-04-29 22:26:50 +08:00
AC_CHECK_HEADERS([netdb.h netinet/in.h arpa/inet.h sys/ioctl.h sys/socket.h sys/un.h glob.h sys/sendfile.h])
2011-06-21 17:19:10 +08:00
AC_CHECK_HEADERS(execinfo.h,,,)
2013-10-06 23:26:33 +08:00
AC_CHECK_HEADERS(ucontext.h,,,)
2013-09-25 12:11:59 +08:00
AC_CHECK_HEADERS(sys/syscall.h,,,)
2011-06-21 17:19:10 +08:00
AC_CHECK_HEADERS(pthread.h,,,)
2011-02-16 05:59:06 +08:00
AC_CHECK_HEADERS(linux/videodev.h,AC_SUBST(ZM_HAS_V4L1,1),AC_SUBST(ZM_HAS_V4L1,0),)
AC_CHECK_HEADERS(linux/videodev2.h,AC_SUBST(ZM_HAS_V4L2,1),AC_SUBST(ZM_HAS_V4L2,0),)
if test "$ZM_HAS_V4L1" == "1" || test "$ZM_HAS_V4L2" == "1"; then
AC_SUBST(ZM_HAS_V4L,1)
else
AC_SUBST(ZM_HAS_V4L,0)
AC_MSG_WARN(zm requires Video4Linux or Video4Linux2 to be installed for analog or USB camera support)
fi
2010-10-13 23:38:43 +08:00
AC_CHECK_HEADERS(jpeglib.h,,AC_MSG_ERROR(zm requires libjpeg headers to be installed),)
2008-07-21 23:21:31 +08:00
AC_CHECK_HEADERS(mysql/mysql.h,,AC_MSG_ERROR(zm requires MySQL headers - check that MySQL development packages are installed),)
2013-04-30 03:32:16 +08:00
AC_LANG_PUSH([C])
2008-07-25 00:57:39 +08:00
AC_CHECK_HEADERS(libavutil/avutil.h,,,)
2008-07-24 19:30:18 +08:00
AC_CHECK_HEADERS(libavcodec/avcodec.h,,,)
2008-07-14 22:43:34 +08:00
AC_CHECK_HEADERS(libavformat/avformat.h,,,)
AC_CHECK_HEADERS(libswscale/swscale.h,,,)
2013-04-30 03:32:16 +08:00
AC_LANG_POP([C])
2008-12-06 05:11:33 +08:00
AC_CHECK_HEADERS(pcre/pcre.h,AC_SUBST(ZM_PCRE,"1"),,)
AC_CHECK_HEADERS(pcre.h,AC_SUBST(ZM_PCRE,"1"),,)
2011-02-16 05:59:06 +08:00
if test "$ENABLE_MMAP" == "yes"; then
2008-07-14 23:21:16 +08:00
AC_CHECK_HEADERS(sys/mman.h,,,)
AC_CHECK_HEADERS(fcntl.h,,,)
else
AC_CHECK_HEADERS(sys/ipc.h,,,)
AC_CHECK_HEADERS(sys/shm.h,,,)
fi
2009-03-20 20:39:29 +08:00
AC_CHECK_HEADERS(zlib.h,,,)
2013-12-21 12:47:12 +08:00
AC_CHECK_HEADERS(vlc/vlc.h,,,)
2013-12-28 00:02:32 +08:00
AC_CHECK_HEADERS(curl/curl.h,,,)
2004-03-04 23:05:54 +08:00
2008-02-14 07:44:44 +08:00
if test "$ZM_SSL_LIB" == "openssl"; then
2008-02-25 02:30:16 +08:00
AC_CHECK_DECLS(MD5,,AC_MSG_ERROR([zm requires openssl/md5.h - use ZM_SSL_LIB option to select gnutls instead]),[#include <stdlib.h>
2008-02-14 07:44:44 +08:00
#include <openssl/md5.h>])
else
2012-07-04 17:00:20 +08:00
if test "$ZM_HAS_GNUTLS_OPENSSL" == "1"; then
2008-02-25 02:30:16 +08:00
AC_CHECK_DECLS(MD5,,AC_MSG_ERROR([zm requires gnutls/openssl.h - use ZM_SSL_LIB option to select openssl instead]),[#include <stdlib.h>
2007-12-24 00:37:39 +08:00
#include <gnutls/openssl.h>])
2012-07-04 17:00:20 +08:00
else
AC_CHECK_DECLS(gnutls_fingerprint,,AC_MSG_ERROR([zm requires gnutls/gnutls.h - use ZM_SSL_LIB option to select openssl instead]),[#include <stdlib.h>
#include <gnutls/gnutls.h>])
fi
2008-02-14 07:44:44 +08:00
fi
2006-04-05 20:22:07 +08:00
AC_CHECK_DECLS(backtrace,,,[#include <execinfo.h>])
2013-10-06 23:26:33 +08:00
AC_CHECK_DECLS(backtrace_symbols,,,[#include <execinfo.h>])
2008-07-14 21:54:50 +08:00
AC_SUBST(LDFLAGS)
2002-12-10 20:24:10 +08:00
2005-12-16 18:12:40 +08:00
AC_PROG_PERL_VERSION(5.6.0)
2008-07-14 23:21:16 +08:00
# Compulsory perl modules
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))
2006-01-12 02:07:58 +08:00
AC_PROG_PERL_MODULES(LWP::UserAgent,,AC_MSG_ERROR(zm requires LWP::UserAgent))
2011-06-06 01:03:55 +08:00
AC_PROG_PERL_MODULES(ExtUtils::MakeMaker,,AC_MSG_ERROR(zm requires ExtUtils::MakeMaker))
2011-02-16 05:59:06 +08:00
if test "$ENABLE_MMAP" == "yes"; then
2011-05-25 15:26:31 +08:00
AC_PROG_PERL_MODULES(Sys::Mmap,,AC_MSG_ERROR(zm requires Sys::Mmap for mapped memory - set --enable-mmap=no to use IPC shared memory instead))
2008-07-14 23:21:16 +08:00
fi
2005-12-16 18:12:40 +08:00
2008-07-14 23:21:16 +08:00
# Optional perl modules
2007-08-30 18:43:06 +08:00
AC_PROG_PERL_MODULES(Module::Load,,AC_MSG_WARN(Module::Load is required for PTZ camera control))
2005-12-16 18:12:40 +08:00
AC_PROG_PERL_MODULES(Device::SerialPort,,AC_MSG_WARN(Device::SerialPort is required for RS232/RS485 PTZ camera control))
2011-08-23 22:10:20 +08:00
AC_PROG_PERL_MODULES(Net::FTP,,AC_MSG_WARN(Net::FTP is required for automatic event uploading using ftp))
AC_PROG_PERL_MODULES(Net::SFTP::Foreign,,AC_MSG_WARN(Net::SFTP::Foreign is required for automatic event uploading using sftp))
2011-08-26 04:44:56 +08:00
AC_PROG_PERL_MODULES(Expect,,AC_MSG_WARN(Expect is required for automatic event uploading using sftp))
2005-12-16 18:12:40 +08:00
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])
2013-10-07 21:26:29 +08:00
AC_DEFINE_DIR([DATADIR],[datadir],[Expanded data directory])
AC_SUBST(PKGDATADIR,"$DATADIR/$PACKAGE")
2005-12-21 23:19:57 +08:00
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")
2009-06-08 17:11:56 +08:00
# Slight hack for non-standard perl install paths
if test "$prefix" != "NONE"; then
2009-12-03 02:08:08 +08:00
PERL_SITE_PREFIX=`perl -V:siteprefix | sed -e "s/.*='\(.*\)';/\1/"`
2009-06-08 17:11:56 +08:00
PERL_SITE_LIB=`perl -V:installsitelib | sed -e "s/.*='\(.*\)';/\1/"`
2009-12-03 02:08:08 +08:00
PERL_LIB_PATH=`echo $PERL_SITE_LIB | sed -e "s|^$PERL_SITE_PREFIX||"`
2009-06-08 17:11:56 +08:00
EXTRA_PERL_LIB="use lib '$prefix$PERL_LIB_PATH'; # Include custom perl install path"
2009-06-24 18:22:11 +08:00
PERL_MM_PARMS="PREFIX=$prefix"
2009-06-08 17:11:56 +08:00
else
EXTRA_PERL_LIB="# Include from system perl paths only"
2009-06-24 18:22:11 +08:00
PERL_MM_PARMS=
2009-06-08 17:11:56 +08:00
fi
2009-06-24 18:22:11 +08:00
AC_SUBST(PERL_MM_PARMS)
2009-06-08 17:11:56 +08:00
AC_SUBST(EXTRA_PERL_LIB)
2014-06-26 03:28:10 +08:00
2014-11-12 06:53:09 +08:00
AC_CONFIG_FILES([Makefile zm.conf zmconfgen.pl db/Makefile db/zm_create.sql misc/Makefile misc/apache.conf misc/logrotate.conf misc/syslog.conf misc/com.zoneminder.systemctl.policy misc/com.zoneminder.systemctl.rules misc/plugins.conf scripts/Makefile scripts/zm scripts/zmaudit.pl scripts/zmcontrol.pl scripts/zmdc.pl scripts/zmfilter.pl scripts/zmpkg.pl scripts/zmtrack.pl scripts/zmcamtool.pl scripts/zmsystemctl.pl scripts/zmtrigger.pl scripts/zmupdate.pl scripts/zmvideo.pl scripts/zmwatch.pl scripts/zmx10.pl scripts/zmdbbackup scripts/zmdbrestore scripts/zmeventdump scripts/zmlogrotate.conf scripts/ZoneMinder/lib/ZoneMinder/Base.pm scripts/ZoneMinder/lib/ZoneMinder/Config.pm scripts/ZoneMinder/lib/ZoneMinder/Memory.pm scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm src/Makefile src/zm_config.h src/libzmplugins.pc web/Makefile web/ajax/Makefile web/css/Makefile web/graphics/Makefile web/includes/Makefile web/includes/config.php web/js/Makefile web/lang/Makefile web/skins/Makefile web/skins/classic/Makefile web/skins/classic/ajax/Makefile web/skins/classic/css/Makefile web/skins/classic/graphics/Makefile web/skins/classic/includes/Makefile web/skins/classic/js/Makefile web/skins/classic/lang/Makefile web/skins/classic/views/Makefile web/skins/classic/views/css/Makefile web/skins/classic/views/js/Makefile web/skins/mobile/Makefile web/skins/mobile/ajax/Makefile web/skins/mobile/css/Makefile web/skins/mobile/graphics/Makefile web/skins/mobile/includes/Makefile web/skins/mobile/lang/Makefile web/skins/mobile/views/Makefile web/skins/mobile/views/css/Makefile web/tools/Makefile web/tools/mootools/Makefile web/views/Makefile web/skins/xml/Makefile web/skins/xml/views/Makefile web/skins/xml/includes/Makefile web/skins/flat/Makefile web/skins/flat/ajax/Makefile web/skins/flat/css/Makefile web/skins/flat/graphics/Makefile web/skins/flat/includes/Makefile web/skins/flat/js/Makefile web/skins/flat/lang/Makefile web/skins/flat/views/Makefile web/skins/flat/views/css/Makefile web/skins/flat/views/js/Makefile])
2005-12-16 18:12:40 +08:00
2011-01-07 19:10:18 +08:00
# Create the definitions for compilation and defaults for the database
AC_CONFIG_COMMANDS([src/zm_config_defines.h],[perl ./zmconfgen.pl])
# Manually generate the perl Makefile maker
2011-01-07 20:14:01 +08:00
AC_CONFIG_COMMANDS([scripts/ZoneMinder/Makefile],[(cd scripts/ZoneMinder; echo "perl Makefile.PL $PERL_MM_PARMS"; perl Makefile.PL $PERL_MM_PARMS)],[PERL_MM_PARMS=$PERL_MM_PARMS])
2011-01-07 19:10:18 +08:00
AC_OUTPUT