[svn r273] Fixes the timeout bug, it uses to happen in some network topologies, like the WLANs, which throws TIMED_OUT sockets when trying to opening them.
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.
53 # Checks for library functions.
56 AC_FUNC_SELECT_ARGTYPES
57 AC_PROG_GCC_TRADITIONAL
62 AC_CHECK_FUNCS([memset socket stime strstr strtoul gethostname inet_ntoa localtime_r select strrchr localtime strptime])
64 ##############################
65 # Checks for Network functions
66 ##############################
68 AC_CHECK_FUNCS([socket])
69 AC_CHECK_FUNCS([inet_ntoa])
70 AC_CHECK_HEADERS([ifaddrs.h])
71 AC_CHECK_FUNCS([getifaddrs])
72 AC_CHECK_FUNCS([time])
74 AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
76 CFLAGS="$CFLAGS -I/usr/include"
77 LDFLAGS="$LDFLAGS -L/usr/lib"
79 # Checks required packages
81 dnl Test if --disable-debug given
83 AC_HELP_STRING([--disable-debug], [enable debugging mode]))
84 if test x"$enable_debug" != xno; then
85 CFLAGS="$CFLAGS -g -DGMYTH_USE_DEBUG"
87 CFLAGS="$CFLAGS -O2 -DG_DISABLE_CHECKS"
90 dnl Test if --disable-upnp / --enable-upnp given
92 AC_HELP_STRING([--disable-upnp], [disable/enable UPnP discovery/search functions]))
94 if test x"$enable_upnp" != xno; then
95 AC_DEFINE(WITH_GMYTH_UPNP, 1, [Enable UPnP discovery/search functions.])
98 AM_CONDITIONAL(WITH_GMYTH_UPNP, test x"$enable_upnp" != xno )
100 # Check for pkgconfig
101 AC_CHECK_PROG(HAVE_PKGCONFIG, pkg-config, yes, no)
102 # Give error and exit if we don't have pkgconfig
103 if test "x$HAVE_PKGCONFIG" = "xno"; then
104 AC_MSG_ERROR(you need to have pkgconfig installed !)
108 PKG_CHECK_MODULES(GLIB, glib-2.0, HAVE_GLIB=yes,HAVE_GLIB=no)
110 # Give error and exit if we don't have glib
111 if test "x$HAVE_GLIB" = "xno"; then
112 AC_MSG_ERROR(you need glib-2.0 installed)
115 # make GLIB_CFLAGS and GLIB_LIBS available
116 AC_SUBST(GLIB_CFLAGS)
119 # Check for GObject2.0
120 PKG_CHECK_MODULES(GOBJECT,
122 HAVE_GOBJECT=yes, HAVE_GOBJECT=no)
124 # Give error and exit if we don't have gobject
125 if test "x$HAVE_GOBJECT" = "xno"; then
126 AC_MSG_ERROR(you need gobject-2.0 installed)
129 # make GOBJECT_CFLAGS and GOBJECT_LIBS available
130 AC_SUBST(GOBJECT_CFLAGS)
131 AC_SUBST(GOBJECT_LIBS)
133 # Check for libxml-2.0
134 PKG_CHECK_MODULES(LIBXML, libxml-2.0, HAVE_LIBXML=yes,HAVE_LIBXML=no)
136 # Give error and exit if we don't have libxml
137 if test "x$HAVE_LIBXML" = "xno"; then
138 AC_MSG_ERROR(you need libxml-2.0 installed)
141 # make LIBXML_CFLAGS and LIBXML_LIBS available
142 AC_SUBST(LIBXML_CFLAGS)
143 AC_SUBST(LIBXML_LIBS)
146 PKG_CHECK_MODULES(LIBCURL, libcurl, HAVE_LIBCRUL=yes, HAVE_LIBCURL=no)
148 # Give error and exit if we don't have libcurl
149 if test "x$HAVE_LIBCURL" = "xno"; then
150 AC_MSG_ERROR(you need libcurl installed)
153 # make LIBCURL_CFLAGS and LIBCURL_LIBS available
154 AC_SUBST(LIBCURL_CFLAGS)
155 AC_SUBST(LIBCURL_LIBS)
158 # check for gstreamer development files
161 PKG_CHECK_MODULES(GST, \
162 gstreamer-$GST_MAJORMINOR >= $GST_REQUIRED,
163 HAVE_GST=yes, HAVE_GST=no)
165 # Give error and exit if we don't have gstreamer
166 if test "x$HAVE_GST" = "xno"; then
167 AC_MSG_ERROR(you need gstreamer development packages installed !)
170 # make GST_CFLAGS and GST_LIBS available
174 # check for gstreamer-base
175 GSTBASE_REQUIRED=0.10
176 GSTBASE_MAJORMINOR=0.10
177 PKG_CHECK_MODULES(GSTBASE, \
178 gstreamer-base-$GSTBASE_MAJORMINOR >= $GSTBASE_REQUIRED,
179 HAVE_GSTBASE=yes, HAVE_GSTBASE=no)
181 # Give error and exit if we don't have gstreamer base libraries
182 if test "x$HAVE_GSTBASE" = "xno"; then
183 AC_MSG_ERROR(you need gstreamer base development packages installed !)
186 # make GSTBASE_CFLAGS and GSTBASE_LIBS available
187 AC_SUBST(GSTBASE_CFLAGS)
188 AC_SUBST(GSTBASE_LIBS)
190 # check for gstreamer-base plugins (xoverlay interface)
191 GSTPLUGINSBASE_REQUIRED=0.10
192 GSTPLUGINSBASE_MAJORMINOR=0.10
193 PKG_CHECK_MODULES(GSTPLUGINSBASE, \
194 gstreamer-plugins-base-$GSTPLUGINSBASE_MAJORMINOR >= $GSTPLUGINSBASE_REQUIRED,
195 HAVE_GSTPLUGINSBASE=yes, HAVE_GSTPLUGINSBASE=no)
197 # Give error and exit if we don't have gstreamer base libraries
198 if test "x$HAVE_GSTPLUGINSBASE" = "xno"; then
199 AC_MSG_ERROR(you need gstreamer plugins base development packages installed !)
202 # make GSTPLUGINSBASE_CFLAGS and GSTPLUGINSBASE_LIBS available
203 AC_SUBST(GSTPLUGINSBASE_CFLAGS)
204 AC_SUBST(GSTPLUGINSBASE_LIBS)
206 # make GST_MAJORMINOR available in Makefile.am
207 AC_SUBST(GST_MAJORMINOR)
208 GSTBASE_MAJORMINOR=0.10
209 PKG_CHECK_MODULES(GSTBASE, \
210 gstreamer-base-$GSTBASE_MAJORMINOR >= $GSTBASE_REQUIRED,
211 HAVE_GSTBASE=yes, HAVE_GSTBASE=no)
213 # Give error and exit if we don't have gstreamer base libraries
214 if test "x$HAVE_GSTBASE" = "xno"; then
215 AC_MSG_ERROR(you need gstreamer base development packages installed !)
221 AC_CHECK_PROG(MYSQL_CFLAGS,mysql_config,`mysql_config --cflags`)
222 if test -z "$MYSQL_CFLAGS"; then
223 AC_MSG_ERROR([Could not find mysql_config script. Make sure the mysql client libraries are installed])
225 AC_SUBST(MYSQL_CFLAGS)
228 AC_CHECK_PROG(MYSQL_LIBS,mysql_config,`mysql_config --libs`)
229 if test -z "$MYSQL_LIBS"; then
230 AC_MSG_ERROR([Could not find mysql_config script. Make sure the mysql client libraries are installed])
234 if test x"$enable_upnp" != xno; then
235 PKG_CHECK_MODULES(GMYTH_UPNP, gmyth-upnp, HAVE_GMYTH_UPNP=yes, HAVE_GMYTH_UPNP=no)
237 # Shows a warning message if we don't have gmyth-upnp libraries
238 if test x"$HAVE_GMYTH_UPNP" != xno; then
239 AC_MSG_WARN([GMyth UPnP development packages found!])
241 AC_SUBST(GMYTH_UPNP_CFLAGS)
242 AC_SUBST(GMYTH_UPNP_LIBS)
244 AC_MSG_WARN([Couldn't find the GMyth UPnP development packages installed. UPnP discovery functions cannot run.])
249 AM_CONDITIONAL(WITH_GMYTH_UPNP, test x"$HAVE_GMYTH_UPNP" != xno )
263 if test "x$enable_debug" != "xno"; then
264 AC_MSG_NOTICE([Debug: Enabled])
266 AC_MSG_NOTICE([Debug: Disabled])