zoneminder/configure.in

137 lines
5.3 KiB
Plaintext

AC_INIT(src/zm.h)
AM_INIT_AUTOMAKE(zm,1.22.0)
AM_CONFIG_HEADER(config.h)
PATH_BUILD=`pwd`
AC_SUBST(PATH_BUILD)
TIME_BUILD=`date +'%s'`
AC_SUBST(TIME_BUILD)
MYSQL_PREFIX=/usr
AC_ARG_WITH(mysql,
[ --with-mysql=<path> prefix of MySQL installation, default /usr],
[MYSQL_PREFIX=$with_mysql],
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
locate them automatically..
e.g. --with-mysql=/usr/local or --with-mysql=/usr])
)
AC_SUBST(MYSQL_PREFIX)
MYSQL_LIBS="-L${MYSQL_PREFIX}/lib/mysql"
MYSQL_CFLAGS="-I${MYSQL_PREFIX}/include"
AC_SUBST(MYSQL_LIBS)
AC_SUBST(MYSQL_CFLAGS)
LDFLAGS="${MYSQL_LIBS} $LDFLAGS"
FFMPEG_PREFIX=/usr
# Ask for ffmpeg path:.
AC_ARG_WITH(ffmpeg,
[ --with-ffmpeg=<path> prefix of ffmpeg root directory for libavcodec etc, default /usr],
[FFMPEG_PREFIX=$with_ffmpeg],
AC_MSG_WARN([You can call configure with the --with-ffmpeg option.
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.
e.g. --with-ffmpeg=/usr/local])
)
AC_SUBST(FFMPEG_PREFIX)
FFMPEG_LIBS="-L${FFMPEG_PREFIX}/lib"
FFMPEG_CFLAGS="-I${FFMPEG_PREFIX}/include"
AC_SUBST(FFMPEG_LIBS)
AC_SUBST(FFMPEG_CFLAGS)
LDFLAGS="${FFMPEG_LIBS} $LDFLAGS"
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"])
)
AC_SUBST(EXTRA_LIBS)
LDFLAGS="$LDFLAGS ${EXTRA_LIBS}"
# Ask user for path to web stuff:.
AC_ARG_WITH(webdir,
[ --with-webdir=<path> prefix of web directory],
[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,
[ --with-cgidir=<path> prefix of cgi directory],
[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,
[ --with-webuser=<user> name of web user, default apache],
[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,
[ --with-webgroup=<group> name of web group, default apache],
[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)
AC_PROG_CC
AC_PROG_CXX
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_HEADER_STDC
AC_LANG_CPLUSPLUS
AC_SUBST(LDFLAGS)
AC_CHECK_HEADERS(pcre/pcre.h,,,)
AC_CHECK_HEADERS(pcre.h,,,)
AC_CHECK_DECLS(round,,,[#include <math.h>])
AC_CHECK_DECLS(strsignal,,,[#include <string.h>])
AC_CHECK_DECLS(MD5,,,[#include <openssl/md5.h>])
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))
AC_CHECK_LIB(mysqlclient,mysql_init,,AC_MSG_ERROR(zm requires libmysqlclient.a))
AC_CHECK_LIB(crypto,MD5,,AC_MSG_WARN(libcrypto.a is required for authenticated streaming))
AC_CHECK_LIB(pcre,pcre_compile,,AC_MSG_WARN(libpcre.a may be required for some remote/network camera support))
AC_CHECK_LIB(avutil,ff_gcd,,AC_MSG_WARN(libavutil.a may be required for MPEG streaming))
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)
AC_SUBST(bindir)
AC_OUTPUT(Makefile src/Makefile web/Makefile web/graphics/Makefile scripts/Makefile db/Makefile zmconfig.pl)
AC_CHECK_FILE(zmconfig.txt,,AC_MSG_WARN([Now run 'perl zmconfig.pl' to create your ZoneMinder configuration]))