2 # Process this file with autoconf to produce a configure script.
8 dnl AC_CONFIG_SRCDIR([src/mmyth_main.c])
9 AC_CONFIG_HEADER(config.h)
11 dnl when going to/from release please set the nano (fourth number) right !
12 dnl releases only do Wall, SVN and prerelease does Werror too
13 AS_VERSION(gmyth, GMYTH, 0, 1, 0, 3, GMYTH_SVN="no", GMYTH_SVN="yes")
14 GMYTH_MAJORMINOR=$GMYTH_MAJOR_VERSION.$GMYTH_MINOR_VERSION
15 AC_SUBST(GMYTH_MAJORMINOR)
17 dnl AM_MAINTAINER_MODE provides the option to enable maintainer mode
19 dnl make aclocal work in maintainer mode
20 AC_SUBST(ACLOCAL_AMFLAGS, "-I m4")
22 # Checks for programs.
24 # Make sure CFLAGS is defined to stop AC_PROC_CC adding -g
25 CFLAGS="$CFLAGS -Wall"
29 dnl Generate doxygen documentation
38 DX_INIT_DOXYGEN(gmyth, doxygen.cfg, docs)
40 # Checks for libraries.
42 # Checks for header files.
44 AC_CHECK_HEADERS([fcntl.h stdint.h stdlib.h string.h sys/ioctl.h sys/socket.h unistd.h])
46 # Checks for typedefs, structures, and compiler characteristics.
54 # Checks for library functions.
57 AC_FUNC_SELECT_ARGTYPES
58 AC_PROG_GCC_TRADITIONAL
62 AC_CHECK_FUNCS([memset socket stime strstr strtoul gethostname inet_ntoa localtime_r select strrchr localtime])
64 AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
66 # Checks required packages
68 dnl Test if --disable-debug given
70 AC_HELP_STRING([--disable-debug], [enable debugging mode]))
71 if test x"$enable_debug" != xno; then
72 CFLAGS="$CFLAGS -g -DGMYTH_USE_DEBUG"
74 CFLAGS="$CFLAGS -O2 -DG_DISABLE_CHECKS"
78 AC_CHECK_PROG(HAVE_PKGCONFIG, pkg-config, yes, no)
79 # Give error and exit if we don't have pkgconfig
80 if test "x$HAVE_PKGCONFIG" = "xno"; then
81 AC_MSG_ERROR(you need to have pkgconfig installed !)
85 PKG_CHECK_MODULES(GLIB, glib-2.0, HAVE_GLIB=yes,HAVE_GLIB=no)
87 # Give error and exit if we don't have glib
88 if test "x$HAVE_GLIB" = "xno"; then
89 AC_MSG_ERROR(you need glib-2.0 installed)
92 # make GLIB_CFLAGS and GLIB_LIBS available
96 # Check for GObject2.0
97 PKG_CHECK_MODULES(GOBJECT,
99 HAVE_GOBJECT=yes, HAVE_GOBJECT=no)
101 # Give error and exit if we don't have gobject
102 if test "x$HAVE_GOBJECT" = "xno"; then
103 AC_MSG_ERROR(you need gobject-2.0 installed)
106 # make GOBJECT_CFLAGS and GOBJECT_LIBS available
107 AC_SUBST(GOBJECT_CFLAGS)
108 AC_SUBST(GOBJECT_LIBS)
110 # Check for libxml-2.0
111 PKG_CHECK_MODULES(LIBXML, libxml-2.0, HAVE_LIBXML=yes,HAVE_LIBXML=no)
113 # Give error and exit if we don't have libxml
114 if test "x$HAVE_LIBXML" = "xno"; then
115 AC_MSG_ERROR(you need libxml-2.0 installed)
118 # make LIBXML_CFLAGS and LIBXML_LIBS available
119 AC_SUBST(LIBXML_CFLAGS)
120 AC_SUBST(LIBXML_LIBS)
123 # check for gstreamer development files
126 PKG_CHECK_MODULES(GST, \
127 gstreamer-$GST_MAJORMINOR >= $GST_REQUIRED,
128 HAVE_GST=yes, HAVE_GST=no)
130 # Give error and exit if we don't have gstreamer
131 if test "x$HAVE_GST" = "xno"; then
132 AC_MSG_ERROR(you need gstreamer development packages installed !)
135 # make GST_CFLAGS and GST_LIBS available
139 # check for gstreamer-base
140 GSTBASE_REQUIRED=0.10
141 GSTBASE_MAJORMINOR=0.10
142 PKG_CHECK_MODULES(GSTBASE, \
143 gstreamer-base-$GSTBASE_MAJORMINOR >= $GSTBASE_REQUIRED,
144 HAVE_GSTBASE=yes, HAVE_GSTBASE=no)
146 # Give error and exit if we don't have gstreamer base libraries
147 if test "x$HAVE_GSTBASE" = "xno"; then
148 AC_MSG_ERROR(you need gstreamer base development packages installed !)
151 # make GSTBASE_CFLAGS and GSTBASE_LIBS available
152 AC_SUBST(GSTBASE_CFLAGS)
153 AC_SUBST(GSTBASE_LIBS)
155 # check for gstreamer-base plugins (xoverlay interface)
156 GSTPLUGINSBASE_REQUIRED=0.10
157 GSTPLUGINSBASE_MAJORMINOR=0.10
158 PKG_CHECK_MODULES(GSTPLUGINSBASE, \
159 gstreamer-plugins-base-$GSTPLUGINSBASE_MAJORMINOR >= $GSTPLUGINSBASE_REQUIRED,
160 HAVE_GSTPLUGINSBASE=yes, HAVE_GSTPLUGINSBASE=no)
162 # Give error and exit if we don't have gstreamer base libraries
163 if test "x$HAVE_GSTPLUGINSBASE" = "xno"; then
164 AC_MSG_ERROR(you need gstreamer plugins base development packages installed !)
167 # make GSTPLUGINSBASE_CFLAGS and GSTPLUGINSBASE_LIBS available
168 AC_SUBST(GSTPLUGINSBASE_CFLAGS)
169 AC_SUBST(GSTPLUGINSBASE_LIBS)
172 # make GST_MAJORMINOR available in Makefile.am
173 AC_SUBST(GST_MAJORMINOR)
174 GSTBASE_MAJORMINOR=0.10
175 PKG_CHECK_MODULES(GSTBASE, \
176 gstreamer-base-$GSTBASE_MAJORMINOR >= $GSTBASE_REQUIRED,
177 HAVE_GSTBASE=yes, HAVE_GSTBASE=no)
179 # Give error and exit if we don't have gstreamer base libraries
180 if test "x$HAVE_GSTBASE" = "xno"; then
181 AC_MSG_ERROR(you need gstreamer base development packages installed !)
184 ##############################
185 # Checks for Network functions
186 ##############################
188 AC_CHECK_FUNCS([socket])
189 AC_CHECK_FUNCS([inet_ntoa])
190 AC_CHECK_HEADERS([ifaddrs.h])
191 AC_CHECK_FUNCS([getifaddrs])
192 AC_CHECK_FUNCS([time])
197 AC_CHECK_PROG(MYSQL_CFLAGS,mysql_config,`mysql_config --cflags`)
198 if test -z "$MYSQL_CFLAGS"; then
199 AC_MSG_ERROR([Could not find mysql_config script. Make sure the mysql client libraries are installed])
201 AC_SUBST(MYSQL_CFLAGS)
204 AC_CHECK_PROG(MYSQL_LIBS,mysql_config,`mysql_config --libs`)
205 if test -z "$MYSQL_LIBS"; then
206 AC_MSG_ERROR([Could not find mysql_config script. Make sure the mysql client libraries are installed])
219 if test x"$enable_debug" != xno; then
220 AC_MSG_NOTICE([Debug: Enabled])
222 AC_MSG_NOTICE([Debug: Disabled])