[svn r254] Added these 2 mandatory directories (m4 and common).
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")
15 GMYTH_MAJORMINOR=$GMYTH_MAJOR_VERSION.$GMYTH_MINOR_VERSION
17 AC_SUBST(GMYTH_MAJORMINOR)
19 dnl AM_MAINTAINER_MODE provides the option to enable maintainer mode
21 dnl make aclocal work in maintainer mode
22 AC_SUBST(ACLOCAL_AMFLAGS, "-I m4")
24 # Checks for programs.
26 # Make sure CFLAGS is defined to stop AC_PROC_CC adding -g
27 CFLAGS="$CFLAGS -Wall"
31 dnl Generate doxygen documentation
40 DX_INIT_DOXYGEN(gmyth, doxygen.cfg, docs)
43 # Checks for libraries.
45 # Checks for header files.
47 AC_CHECK_HEADERS([fcntl.h stdint.h stdlib.h string.h sys/ioctl.h sys/socket.h unistd.h])
49 # Checks for typedefs, structures, and compiler characteristics.
54 # Checks for library functions.
56 AC_PROG_GCC_TRADITIONAL
60 AC_CHECK_FUNCS([memset socket stime strstr strtoul])
62 AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
64 # Checks required packages
66 dnl Test if --disable-debug given
68 [AC_HELP_STRING([--disable-debug], [disable debugging mode])],
69 enable_debug="$enableval",
72 if test "x$enable_debug" = "xyes" ; then
75 AC_DEFINE( NDEBUG, 1, [disable debug messages] )
76 CFLAGS="$CFLAGS -O2 -DG_DISABLE_CHECKS -DNDEBUG"
79 AM_CONDITIONAL( NDEBUG, test "x$enable_debug" = "xyes" )
82 AC_CHECK_PROG(HAVE_PKGCONFIG, pkg-config, yes, no)
83 # Give error and exit if we don't have pkgconfig
84 if test "x$HAVE_PKGCONFIG" = "xno"; then
85 AC_MSG_ERROR(you need to have pkgconfig installed !)
89 PKG_CHECK_MODULES(GLIB, glib-2.0, HAVE_GLIB=yes,HAVE_GLIB=no)
91 # Give error and exit if we don't have glib
92 if test "x$HAVE_GLIB" = "xno"; then
93 AC_MSG_ERROR(you need glib-2.0 installed)
96 # make GLIB_CFLAGS and GLIB_LIBS available
100 # Check for GObject2.0
101 PKG_CHECK_MODULES(GOBJECT,
103 HAVE_GOBJECT=yes, HAVE_GOBJECT=no)
105 # Give error and exit if we don't have gobject
106 if test "x$HAVE_GOBJECT" = "xno"; then
107 AC_MSG_ERROR(you need gobject-2.0 installed)
110 # make GOBJECT_CFLAGS and GOBJECT_LIBS available
111 AC_SUBST(GOBJECT_CFLAGS)
112 AC_SUBST(GOBJECT_LIBS)
115 PKG_CHECK_MODULES(GTK, gtk+-2.0, HAVE_GTK=yes,HAVE_GTK=no)
117 # Give error and exit if we don't have gtk
118 if test "x$HAVE_GTK" = "xyes"; then
119 AC_DEFINE(WITH_GTK, 1, [build with GTK+ related stuff])
120 dnl AC_MSG_ERROR(you need gtk+-2.0 installed)
125 AM_CONDITIONAL(WITH_GTK, test "x$HAVE_GTK" = "xyes" )
127 # make GTK_CFLAGS and GTK_LIBS available
131 dnl ========== Check for Hildon Libraries
132 PKG_CHECK_MODULES(HILDON,
133 hildon-lgpl libosso hildon-status-bar-lib libhildonmenu hildon-base-lib hildon-control-panel hildon-libs,
134 HAVE_HILDON=yes, HAVE_HILDON=no)
136 if test "x$HAVE_HILDON" = "xyes"; then
137 AC_DEFINE(MAEMO_PLATFORM, 1, [build with hildon libs])
138 HILDON_CFLAGS="$HILDON_CFLAGS -DMAEMO_PLATFORM=1"
143 AM_CONDITIONAL(MAEMO_PLATFORM, test "x$HAVE_HILDON" = "xyes")
145 dnl make HILDON_CFLAGS and HILDON_LIBS available
146 AC_SUBST(HILDON_CFLAGS)
147 AC_SUBST(HILDON_LIBS)
149 # Check for libxml-2.0
150 PKG_CHECK_MODULES(LIBXML, libxml-2.0, HAVE_LIBXML=yes,HAVE_LIBXML=no)
152 # Give error and exit if we don't have libxml
153 if test "x$HAVE_LIBXML" = "xno"; then
154 AC_MSG_ERROR(you need libxml-2.0 installed)
157 # make LIBXML_CFLAGS and LIBXML_LIBS available
158 AC_SUBST(LIBXML_CFLAGS)
159 AC_SUBST(LIBXML_LIBS)
162 # check for gstreamer development files
165 PKG_CHECK_MODULES(GST, \
166 gstreamer-$GST_MAJORMINOR >= $GST_REQUIRED,
167 HAVE_GST=yes, HAVE_GST=no)
169 # Give error and exit if we don't have gstreamer
170 if test "x$HAVE_GST" = "xno"; then
171 AC_MSG_ERROR(you need gstreamer development packages installed !)
174 # make GST_CFLAGS and GST_LIBS available
178 # check for gstreamer-base plugins (xoverlay interface)
179 GSTBASE_REQUIRED=0.10
180 GSTBASE_MAJORMINOR=0.10
181 PKG_CHECK_MODULES(GSTBASE, \
182 gstreamer-base-$GSTBASE_MAJORMINOR >= $GSTBASE_REQUIRED,
183 HAVE_GSTBASE=yes, HAVE_GSTBASE=no)
185 # Give error and exit if we don't have gstreamer base libraries
186 if test "x$HAVE_GSTBASE" = "xno"; then
187 AC_MSG_ERROR(you need gstreamer base development packages installed !)
190 # make GSTBASE_CFLAGS and GSTBASE_LIBS available
191 AC_SUBST(GSTBASE_CFLAGS)
192 AC_SUBST(GSTBASE_LIBS)
195 # make GST_MAJORMINOR available in Makefile.am
196 AC_SUBST(GST_MAJORMINOR)
201 AC_CHECK_PROG(MYSQL_CFLAGS,mysql_config,`mysql_config --cflags`)
202 if test -z "$MYSQL_CFLAGS"; then
203 AC_MSG_ERROR([Could not find mysql_config script. Make sure the mysql client libraries are installed])
205 AC_SUBST(MYSQL_CFLAGS)
208 AC_CHECK_PROG(MYSQL_LIBS,mysql_config,`mysql_config --libs`)
209 if test -z "$MYSQL_LIBS"; then
210 AC_MSG_ERROR([Could not find mysql_config script. Make sure the mysql client libraries are installed])
214 ## Check for gmyth-0.1
216 PKG_CHECK_MODULES(LIBGMYTH, gmyth-0.1, HAVE_LIBGMYTH=yes,HAVE_LIBGMYTH=no)
218 # Give error and exit if we don't have gmyth-0.1
219 if test "x$HAVE_LIBGMYTH" = "xno"; then
220 AC_MSG_ERROR(you need gmyth-0.1 installed)
223 # make LIBXML_CFLAGS and LIBXML_LIBS available
224 AC_SUBST(LIBGMYTH_CFLAGS)
225 AC_SUBST(LIBGMYTH_LIBS)
231 AC_CONFIG_FILES([Makefile